NorESMhub / BLOM

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

Add missing configurations for the ATRC option #346

Closed TomasTorsvik closed 1 month ago

TomasTorsvik commented 1 month ago

add missing configurations for the ATRC option

ATRC is used as compiler option in BLOM, but it is not defined.

add ATRC option in the namelist building script and in the XML files.

This PR duplicates the essence of #341, but use the updated master branch as a starting point. This PR differs from #341 only with respect to changes that have been introduced for build config files, specifically buildnml and buildcpp replacing functionality that was previously in buildlib.

This PR technically allows activation of the ATRC CPP flag. I don't know if this option is up to date.

If this functionality is needed for CMIP6-type simulations, I suggest to start from the v1.4.0 tag and make an update on the NorESM2.0.7 release branch.

TomasTorsvik commented 1 month ago

Setting the ATRC option to TRUE will not change anything since in mod_tracers.F90 we have the setting:

   ! Number of age tracers.
   integer, parameter :: natr = 0

I did a test where I set natr = 1 in the source code, which results in a segmentation fault at run time in blom_init, so apparently something is either missing or not up to date for the ATRC functionality. I probably won't do any more testing on this at the moment, unless there is an urgent need to have this working for NorESM2.3.

YanchunHe commented 1 month ago

Setting the ATRC option to TRUE will not change anything since in mod_tracers.F90 we have the setting:

   ! Number of age tracers.
   integer, parameter :: natr = 0

I did a test where I set natr = 1 in the source code, which results in a segmentation fault at run time in blom_init, so apparently something is either missing or not up to date for the ATRC functionality. I probably won't do any more testing on this at the moment, unless there is an urgent need to have this working for NorESM2.3.

Thank you, Tomas!

natr in mod_param.F90 should be set together with ntrocn. ntrocn should be a minimum value of double of the natr.

This should work. But I can do a test later.

TomasTorsvik commented 1 month ago

@YanchunHe - I realized that ntrocn needed to at least double natr after making the last comment. When setting natr = 1 and ntrocn = 2 the model runs without errors.

TomasTorsvik commented 1 month ago

Regression tests against NorESM:BLOM tags noresm2.1.1:dev1.5.1.3 show bit-identical output.