-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
migrate HAMOCC config settings to run time namelist settings #281
Changes from 10 commits
9df579a
b8bb56a
c0a4824
e7a9ef9
eb003cc
36e488d
9768273
ce12ae5
78e347c
fa9ef0f
e54e67b
133564d
10ab1c1
55a03c0
90ca8ea
0a1082e
07b389f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,6 +85,11 @@ def buildnml(case, caseroot, compname): | |
hamocc_sedspinup_ncycle = case.get_value("HAMOCC_SEDSPINUP_NCYCLE") | ||
is_test = case.get_value("TEST") | ||
|
||
blom_vcoord = case.get_value("BLOM_VCOORD") | ||
turbclo = case.get_value("BLOM_TURBULENT_CLOSURE") | ||
expect(blom_vcoord != "cntiso_hybrid" or not turbclo, | ||
f"BLOM_VCOORD == {blom_vcoord} and BLOM_TURBULENT_CLOSURE == {turbclo} is not a valid combination") | ||
|
||
#-------------------------- | ||
# Construct ParamGen objects: | ||
#-------------------------- | ||
|
@@ -198,7 +203,7 @@ def buildnml(case, caseroot, compname): | |
case_dict = CaseDict() | ||
var_list = ('DIN_LOC_ROOT', 'RUN_TYPE', 'BLOM_VCOORD', | ||
'CCSM_CO2_PPMV', 'HAMOCC_SEDSPINUP_YR_START', | ||
'HAMOCC_SEDSPINUP_YR_END') | ||
'HAMOCC_SEDSPINUP_YR_END', 'OCN_CO2_TYPE') | ||
|
||
for item in var_list: | ||
case_dict[item] = case.get_value(item) | ||
|
@@ -223,6 +228,11 @@ def buildnml(case, caseroot, compname): | |
if pg_blom.get_value('inid14c') == 'UNSET': | ||
pg_blom.set_value('inid14c', value='') | ||
|
||
if pg_blom.get_value('use_cisonew') == ".true.": | ||
if pg_blom.bet_value("use_SEDBYPASS") == ".false.": | ||
expect(False, | ||
"HAMOCC C-isotopes currently not supported in the sediment module. Set use_SEDBYPASS to .true.") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be removed now, since C-isotopes with sediment is technically supported now. |
||
|
||
#--------------------------- | ||
# Write out Fortran namelist: | ||
#--------------------------- | ||
|
@@ -245,6 +255,7 @@ def buildnml(case, caseroot, compname): | |
groups.append("bgcnml") | ||
groups.append("bgcoafx") | ||
groups.append("diabgc") | ||
groups.append("config_bgc") | ||
|
||
# for now don't write out bgcparams - just create an empty namelist | ||
# if "ecosys" in case.get_value("BLOM_TRACER_MODULES"): | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mvertens, @TomasTorsvik, @jmaerz there are some things I came across during my own testing yesterday:
Maybe this could also be quickly fixed with this PR? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @JorgSchwinger - thanks for catching these! I will fix them in this PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for finding these. I've put in the fixes and am regenerating tests and baselines now. |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -3759,6 +3759,103 @@ | |||||||||
</desc> | ||||||||||
</entry> | ||||||||||
|
||||||||||
<entry id="ocn_co2_type" modify_via_xml="OCN_CO2_TYPE"> | ||||||||||
<type>char</type> | ||||||||||
<category>config_bgc</category> | ||||||||||
<group>bgcnml</group> | ||||||||||
<values> | ||||||||||
<value>$OCN_CO2_TYPE</value> | ||||||||||
</values> | ||||||||||
<desc>Determines provenance of atmospheric CO2 for gas flux computation.</desc> | ||||||||||
</entry> | ||||||||||
|
||||||||||
<!-- hamocc configuration --> | ||||||||||
|
||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dear @mvertens , if I understand the approach correct, the entry ids for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jmaerz - thanks for catching this. I think we need to add two more tests for use_BOXATM and use_AGG. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So in looking at the original buildcpp - BOXATM and AGG were never defined - and I only introduced namelists that corresponded to those variables. That was clearly an oversight on my part. Do we want to test turning these on with hamocc given that they were not defined as part of NorESM configurations before? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi Mariana, my suspicion is that both cases are not well supported, but I would hope that particularly There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jmaerz - use_BOXATM and use_AGG are only turned on via user_nl_blom right now - no longer throught the xml since they are no longer CPP variables. I will test that use_AGG works and add a test today. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @mvertens , I just realize that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. BOXATM, AGG, FB_BGC_OCN all are options that have not been used quite some time. So currently, these are only for expert users who can activate these options via namelist switches if they know what they are doing. How much it makes sense to include tests for these options I don't know, I wouldn't see this as a priority. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @JorgSchwinger @jmaerz - I have added missing namelists use_boxatm, use_agg and use_fb_bgc_oce to the new namelist group config_bgc. Given the last statement by @JorgSchwinger - can we test these options after this PR and add appropriate tests if everyone agrees? Otherwise - I'm happy to test it in this PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @mvertens , from my side, I am totally fine to proceed as you suggested. The testing feature is different from the nml configuration. |
||||||||||
<entry id="use_WLIN"> | ||||||||||
<type>logical</type> | ||||||||||
<category>config_bgc</category> | ||||||||||
<group>config_bgc</group> | ||||||||||
<values> | ||||||||||
<value>.true.</value> | ||||||||||
</values> | ||||||||||
<desc>add desc</desc> | ||||||||||
</entry> | ||||||||||
|
||||||||||
<entry id="use_CFC"> | ||||||||||
<type>logical</type> | ||||||||||
<category>config_bgc</category> | ||||||||||
<group>config_bgc</group> | ||||||||||
<values> | ||||||||||
<value>.false.</value> | ||||||||||
<value compset="HIST_CAM60%NORESM.*_BLOM%ECO">.true.</value> | ||||||||||
<value compset="20TR_DATM.*_BLOM%ECO">.true.</value> | ||||||||||
</values> | ||||||||||
<desc>activates HAMOCC CFC code</desc> | ||||||||||
</entry> | ||||||||||
|
||||||||||
<entry id="use_natDIC"> | ||||||||||
<type>logical</type> | ||||||||||
<category>config_bgc</category> | ||||||||||
<group>config_bgc</group> | ||||||||||
<values> | ||||||||||
<value>.false.</value> | ||||||||||
<value compset="HIST_CAM60%NORESM.*">.true.</value> | ||||||||||
<value compset="20TR_DATM.*">.true.</value> | ||||||||||
</values> | ||||||||||
<desc>activates HAMOCC natural tracer code</desc> | ||||||||||
</entry> | ||||||||||
|
||||||||||
<entry id="use_PBGC_OCNP_TIMESTEP"> | ||||||||||
<type>logical</type> | ||||||||||
<category>config_bgc</category> | ||||||||||
<group>config_bgc</group> | ||||||||||
<values> | ||||||||||
<value>.false.</value> | ||||||||||
</values> | ||||||||||
<desc>HAMOCC debug mode flag</desc> | ||||||||||
</entry> | ||||||||||
|
||||||||||
<entry id="use_PBGC_CK_TIMESTEP"> | ||||||||||
<type>logical</type> | ||||||||||
<category>config_bgc</category> | ||||||||||
<group>config_bgc</group> | ||||||||||
<values> | ||||||||||
<value>.false.</value> | ||||||||||
</values> | ||||||||||
<desc>HAMOCC debug mode flag</desc> | ||||||||||
</entry> | ||||||||||
|
||||||||||
<entry id="use_BROMO"> | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Maybe something like this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Exactly. Thanks! |
||||||||||
<type>logical</type> | ||||||||||
<category>config_bgc</category> | ||||||||||
<group>config_bgc</group> | ||||||||||
<values> | ||||||||||
<value>.false.</value> | ||||||||||
<value ocn_grid="tnx1v4"> .true.</value> | ||||||||||
</values> | ||||||||||
<desc>add desc</desc> | ||||||||||
</entry> | ||||||||||
|
||||||||||
<entry id="use_SEDBYPASS"> | ||||||||||
<type>logical</type> | ||||||||||
<category>config_bgc</category> | ||||||||||
<group>config_bgc</group> | ||||||||||
<values> | ||||||||||
<value>.false.</value> | ||||||||||
</values> | ||||||||||
<desc>Bypass the HAMOCC sediment code</desc> | ||||||||||
</entry> | ||||||||||
|
||||||||||
<entry id="use_cisonew"> | ||||||||||
<type>logical</type> | ||||||||||
<category>config_bgc</category> | ||||||||||
<group>config_bgc</group> | ||||||||||
<values> | ||||||||||
<value>.false.</value> | ||||||||||
</values> | ||||||||||
<desc>activate the HAMOCC carbon isotope code</desc> | ||||||||||
</entry> | ||||||||||
|
||||||||||
<!-- ========================= --> | ||||||||||
<!-- namelist group: bgcoafx --> | ||||||||||
<!-- These options can be activated by expert users via user namelist. --> | ||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is perhaps an important comment to preserve, i.e. why only tnx1v4 gid is supported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TomasTorsvik - use_BROMO is now a namelist variable - not a CPP variable -
this is why I removed it from buildcpp. I have now added the comment to namelist_definition_blom.xml.