-
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
migrate HAMOCC config settings to run time namelist settings #281
Conversation
I think we should merge #280 first - it gets very confusing, because I see all changes at the same time (maybe that's just because I don't know how to switch this of?). Anyway - this PR seems also to bring in the changes with the fluxes calculated in the mediator, and there are some changes related to mct, too. Is this intended? |
@JorgSchwinger - I agree. We need to bring in #280 first. The changes for fluxes in the mediator should not be there. |
atmco2_da(i,j,l2ci) = | ||
. x2o_o%rAttr(index_x2o_Sa_co2prog,n) | ||
endif | ||
if (ocn_co2_type == 'prognostic') then |
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 would now need a #ifdef HAMOCC
, too since ocn_co2_type
will be undefined otherwise
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.
Thanks. I will be testing this PR with mct as well.
cime_config/buildnml
Outdated
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 comment
The 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.
@JorgSchwinger @TomasTorsvik @jmaerz - I'd really like some feedback as to what new tests I should add. I would propose at least the following:
I would do these as 5 day ERS tests at tn14 I also need to introduce tn21 for the development code - but I'll do that in a separate PR - since it will also need cice6 namelist changes. |
Looks good to me. But note that switching the CFCs and natDIC options on will mostly only test that it compiles correctly - if no transient compset is used then natDIC=DIC and CDFs=0 all the time. For a transient compset (e.g., NOIIAOC20TR) one would need to restart from e.g. 1948. That would be the most meaningful test, but this might get too complicated. |
@JorgSchwinger - thanks! I'm confused by the meaning of restart here. |
If we want to test natDIC and CFCs with "real" values we need to restart from 1948 files (or any other year over the period where atmospheric CFCs were > 0 and and atmospheric CO2 > 284) |
Caveat: for CO2 this requires that transient CO2 is available through the data atmosphere |
# HAMOCC bromoform scheme currently only supported on the tnx1v4 grid | ||
# (no swa-climatology has been created for other grid configurations)" |
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.
<desc>HAMOCC debug mode flag</desc> | ||
</entry> | ||
|
||
<entry id="use_BROMO"> |
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.
<entry id="use_BROMO"> | |
<!-- HAMOCC bromoform scheme currently only supported on the tnx1v4 grid --> | |
<!-- (no swa-climatology has been created for other grid configurations) --> | |
<entry id="use_BROMO"> |
Maybe something like this?
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.
Exactly. Thanks!
Can we proceed with this PR? I would have two or three small PR that should go into release 1.4.0, but I think it would be better to merge this in first. |
I have not had a chance to add the new test yet. Could you please give me this afternoon to add the test and create the baselines - then I'm fine with proceeding. Sorry for the delay. |
Of course that's fine. Meanwhile I'll add some of the stuff already that will not interfere with this PR. |
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.
@mvertens, @TomasTorsvik, @jmaerz there are some things I came across during my own testing yesterday:
-
for some HAMOCC entries a
is_input_data="yes"
flag is missing (inidic, inialk,inipo3,inioxy,inino3,ndepfile,fedepfile,rivinfile,swaclimfile). -
the value for
ndepfile
isn't generated correctly ifblom_ndep_scenario=ssp*
i.e. any of the SSPs (I guess$BLOM_NDEP_SCENARIO
doesn't exist any longer?) -
do_sedspinup
andsedspin_ncyc
should have amodify_via_xml
flag -
I think the C-iso option should stay as an option in env_run, and get the
modify_via_xml
flag, too
Maybe this could also be quickly fixed with this PR?
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.
@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 comment
The 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.
Dear @mvertens , many thanks for making the code more flexible to use! - could you also adjust the |
@jmaerz - I am happy to work on the meson build. However, could we please chat today so that I can understand how to test this - both in the new and old system. Also - should that fix be added to this PR? |
Hi @mvertens , sure, we can have a short conversation (while admittedly, I am also more a user of the meson.build system than developer). From what I know about it, it's just about cleaning out the previously used preprocessor flags for iHAMOCC (which are now configured via the config namelist). Wrt testing, I personally used to use it for the single column setup, which can be tested locally or on betzy and requires a limits file (generated from the namelist file), which I can provide (maybe need to update it to the latest developments). I am not sure, if there are other tests to perform than just check that such setup is still running. @TomasTorsvik: anything else to add on this? |
@jmaerz - how do I run a single column test? Is this documented? |
Hi Mariana, it's described on the main page: https://github.com/NorESMhub/BLOM/ - maybe we chat quickly and then I'll provide the limits file, etc. afterward. If it is easier, I can also do the editing of the meson.build after the PR. |
Hi Mariana, I just realize that some files experienced too long lines and compilation failed in |
A quick update:
|
I think at this point we should defer changes to the meson build until the next PR and try to get this one merged in if everyone is in agreement. |
</entry> | ||
|
||
<!-- hamocc configuration --> | ||
|
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.
Dear @mvertens , if I understand the approach correct, the entry ids for use_Agg
and use_BOXATM
are missing.
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.
@jmaerz - thanks for catching this. I think we need to add two more tests for use_BOXATM and use_AGG.
I'll do that today.
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.
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 comment
The 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 AGG
isn't broken (it was used the last time in a study by @JorgSchwinger). AGG
should work within a coupled NorESM setup, while I have limited idea about BOXATM
- I would need to look into it - I would suggest to skip the testing for BOXATM
now, but I feel it would be good to enable switching it on via the xml. I hope to get through your changes by the end of the day.
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.
@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 comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @mvertens , I just realize that use_FB_BGC_OCE
might also be missing?
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.
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 comment
The 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 comment
The 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.
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.
Dear @mvertens , apart from the comments that I had, it looks good to me.
@mvertens , @JorgSchwinger , @jmaerz |
@TomasTorsvik - I have verified that adding the new namelists to ocn_in does not change answers. |
Then go ahead @mvertens 👍 |
This PR builds on top of #280. Instead of using build time configuration settings for new HAMOCC use_XXX variables, namelist variables have been introduced instead. This allows HAMOCC to be configured at run time rather than at compile time. This PR was brought in as a separate pull request - but if desired be merged into #280.
The only files that are different with respect to #280 are