Created
May 29, 2018 09:28
-
-
Save chrisb13/ba91f6e2b112bec057a1d10cce5994ad to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lg.info("") | |
lg.info("Running check to see if changes found in "+cfgf+" are now in: "+ofile) | |
#run quick check to make sure all diff'd parameters were inserted | |
#(still uses f90nml, so not exactly independent) | |
with open(ofile) as nml_file: | |
new_nml = f90nml.read(nml_file) | |
for top_key in diff[cfgf].keys(): | |
for bot_key in diff[cfgf][top_key].keys(): | |
# assert(new_nml[top_key][bot_key]==diff[cfgf][top_key][bot_key]),ofile + " did not get created correctly" | |
# print(top_key,bot_key,new_nml[top_key][bot_key],diff[cfgf][top_key][bot_key]) | |
if new_nml[top_key][bot_key]!=diff[cfgf][top_key][bot_key]: #chk: how does this work elementwise? | |
# print(top_key,bot_key,new_nml[top_key][bot_key],diff[cfgf][top_key][bot_key]) | |
lg.error("") | |
lg.error("For "+top_key + " "+ bot_key) | |
lg.error("New namelist has: "+str(new_nml[top_key][bot_key] )) | |
lg.error("but old namelist has: "+str(diff[cfgf][top_key][bot_key])) | |
lg.error("") | |
# __import__('pdb').set_trace() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment