NorESMhub / BLOM

Bergen Layered Ocean Model
GNU Lesser General Public License v3.0
16 stars 25 forks source link

Feature iHAMOCC nml #261

Closed jmaerz closed 1 year ago

jmaerz commented 1 year ago

Hi @TomasTorsvik and @JorgSchwinger , I create this draft pull request to follow up on and move the discussion https://github.com/NorESMhub/BLOM/discussions/195 based on the current changes I did for the BGC parameter nml. I restructured the parameter initialization a bit related to the different topics of the parameters.

I currently see a few related questions:

  1. How shall we deal with parameters calculated from other (tunable) parameters? - shall we introduce functions or shall we ONLY calculate them after having read the namelist?
  2. Shall we continue putting atmospheric concentrations (as external controlling parameters) into the former BGC namelist, where atm_co2 is still located? - this would enable to recombine the further calculation of dependent concentrations (isotopes) and initializing the atmosphere fields.
  3. I thus far only introduced TYPICAL tuning parameters in the new nml. I personally would keep it like this or do you have a different opinion?
  4. I would like to delete the line breaks in the write parameter routine - any objections?
  5. I still need to delete the old subroutine that is still present (but not used anymore).

Thus far, I didn't move any of the parameter declarations to get the parameter values under the protect statement. I can do this, if you want me to do it. Just let me know.

jmaerz commented 1 year ago

To briefly summarize the conversation on this PR: To avoid too many merging conflicts, the potential restructuring wrt protect statements and pulling all parameters into one module is envisaged in an extra PR, once #264 is merged into master.

jmaerz commented 1 year ago

Hi @TomasTorsvik and @JorgSchwinger , I tested the branch against the current master using the NOINYOC T62_tn21 setup and ran the model for 1 year and checked successfully for binary identical results.

How to use the new feature (thus far, tested): After model setup (./case.setup), copy the ./components/blom/cime_config/buildnml to the ./SourceMods/src.blom/ folder (no further subfolders needed). In this copy of buildnml, enter the parameters that you wish to change in the BGCPARAMS namelist (for available parameters, see code, potentially add it, if needed - careful with rates and parameters that are required for further calculation of other parameters - make sure that they are converted and applied after reading the namelist - currently, this should be ensured, but with new developments, this needs care-taking). Parameters available through the user_nl_blom are still possible to change via an additionally provided user namelist for BLOM (so nothing changed in this regards).

I will perform the pull once the boxatm change #265 has been merged into master. Afterward, I will also merge these changes into the feature-HAMOCC_beyond-CMIP6 branch. Once the ifdefs refactoring #264 are merged into master, we can proceed with restructuring the parameter declaration and initialization.

jmaerz commented 1 year ago

To briefly summarize (incl. the short-conversation today), before merging: