New const_get_index logic without cam_ccpp_cap dependency (in atmos_phys)#314
Conversation
nusbaume
left a comment
There was a problem hiding this comment.
Looks good, but did have two small change requests.
cime_config/cam_autogen.py
Outdated
| if not os.path.isdir(atm_phys_to_be_ccppized_dir): | ||
| # CAM-SIMA will likely not run without this, so raise an error | ||
| emsg = "ERROR: Unable to find CCPP physics to_be_ccppized directory:\n" | ||
| emsg += f" {atm_phys_util_dir}\n Have you run 'git-fleximod'?" |
There was a problem hiding this comment.
I think this should be atm_phys_to_be_ccppized_dir here:
| emsg += f" {atm_phys_util_dir}\n Have you run 'git-fleximod'?" | |
| emsg += f" {atm_phys_to_be_ccppized_dir}\n Have you run 'git-fleximod'?" |
| call ccpp_const_get_idx(const_props, name, cindex, errmsg, errcode) | ||
|
|
||
| if (errcode /= 0) then | ||
| call endrun(subname//"Error "//to_str(errcode)//": "// & |
There was a problem hiding this comment.
I might use stringify here instead of to_str (my hope is to eventually use stringify for all string conversions):
| call endrun(subname//"Error "//to_str(errcode)//": "// & | |
| use string_utils, only: stringify | |
| ... | |
| call endrun(subname//"Error "//stringify((/errcode/))//": "// & |
nusbaume
left a comment
There was a problem hiding this comment.
Looks great now! Just had one last bug fix (but it doesn't need a re-review). Thanks for getting this in!
|
|
||
| if (errcode /= 0) then | ||
| call endrun(subname//"Error "//to_str(errcode)//": "// & | ||
| call endrun(subname//"Error "//stringify(errcode)//": "// & |
There was a problem hiding this comment.
I think stringify expects an array here, so:
| call endrun(subname//"Error "//stringify(errcode)//": "// & | |
| call endrun(subname//"Error "//stringify((/errcode/))//": "// & |
|
Thanks @nusbaume! Apologies for the oversight. Updated and waiting for tests to run then I'll merge to development. |
|
All build tests passed - had to wait in the queue for longer than I expected. Merging now! Thanks everyone for the reviews and feedback. |
Companion atmospheric_physics PR: ESCOMP/atmospheric_physics#135
This avoids a circular dependency if schemes require const_get_index, which presently depends on cam_ccpp_cap, which depends on individual schemes.