From 4797c22bf278864d76eb05522c2911b8be7c212e Mon Sep 17 00:00:00 2001 From: Tomas Torsvik <43031053+TomasTorsvik@users.noreply.github.com> Date: Mon, 27 May 2024 13:18:03 +0200 Subject: [PATCH] Add missing configurations for the ATRC option (#349) This PR is identical to #346 , but applies the updates to the release-1.4 branch, which is applicable for NorESM2.0 experiments. --- cime_config/buildcpp | 4 ++++ cime_config/buildnml | 2 ++ cime_config/config_component.xml | 9 +++++++++ meson.build | 4 ++++ meson_options.txt | 2 ++ phy/mod_remap.F | 2 +- 6 files changed, 22 insertions(+), 1 deletion(-) diff --git a/cime_config/buildcpp b/cime_config/buildcpp index 7c354ce2..ec5f5bac 100644 --- a/cime_config/buildcpp +++ b/cime_config/buildcpp @@ -80,6 +80,7 @@ def buildcpp(case): ocn_grid = case.get_value("OCN_GRID") turbclo = case.get_value("BLOM_TURBULENT_CLOSURE") tracers = case.get_value("BLOM_TRACER_MODULES") + blom_atrc = case.get_value("BLOM_ATRC") blom_unit = case.get_value("BLOM_UNIT") pio_typename = case.get_value("PIO_TYPENAME", subgroup="OCN") @@ -125,6 +126,9 @@ def buildcpp(case): else: expect(False, "tracer module {} is not recognized".format(module)) + if blom_atrc: + blom_cppdefs = blom_cppdefs + " -DATRC" + if blom_unit == "mks": blom_cppdefs = blom_cppdefs + " -DMKS" else: diff --git a/cime_config/buildnml b/cime_config/buildnml index 4e610f77..8d85b92f 100755 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -78,6 +78,7 @@ def buildnml(case, caseroot, compname): blom_ndep_scenario = case.get_value("BLOM_NDEP_SCENARIO") blom_coupling = case.get_value("BLOM_COUPLING") blom_tracer_modules = case.get_value("BLOM_TRACER_MODULES") + blom_atrc = case.get_value("BLOM_ATRC") hamocc_ciso = case.get_value("HAMOCC_CISO") hamocc_sedbypass = case.get_value("HAMOCC_SEDBYPASS") hamocc_sedspinup = case.get_value("HAMOCC_SEDSPINUP") @@ -181,6 +182,7 @@ def buildnml(case, caseroot, compname): config["blom_n_deposition"] = "yes" if blom_n_deposition else "no" config["blom_coupling"] = blom_coupling config["blom_tracer_modules"] = blom_tracer_modules + config["blom_atrc"] = blom_atrc config["hamocc_ciso"] = "yes" if hamocc_ciso else "no" config["hamocc_sedbypass"] = "yes" if hamocc_sedbypass else "no" config["hamocc_sedspinup"] = "yes" if hamocc_sedspinup else "no" diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index f543d3f2..a78f0411 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -25,6 +25,15 @@ Optional ocean tracers. Valid values are Any combination of: iage ecosys + + logical + TRUE,FALSE + FALSE + build_component_blom + env_build.xml + Set preprocessor option to activate age tracer code. Requires module iage or ecosys + + char diff --git a/meson.build b/meson.build index af5befca..ec544638 100644 --- a/meson.build +++ b/meson.build @@ -86,6 +86,10 @@ if get_option('iage') or turbclo.length() > 0 or get_option('ecosys') subdir('trc') endif +if get_option('atrc') + add_project_arguments('-DATRC', language: 'fortran') +endif + if turbclo.length() > 0 if not (turbclo.contains('oneeq') or turbclo.contains('twoeq')) error('For turbulent closure, either twoeq or oneeq must be provided as options!') diff --git a/meson_options.txt b/meson_options.txt index 8e48383f..2672366f 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -22,6 +22,8 @@ option('iage', type: 'boolean', description: 'Enable ideal age tracer', value: true) option('ecosys', type: 'boolean', description: 'Enable HAMOCC as ecosystem module', value: false) +option('atrc', type: 'boolean', + description: 'Enable age tracer in BLOM', value: false) option('hamocc_agg', type: 'boolean', description: 'Enable Kriest aggregation scheme in HAMOCC', value: false) option('hamocc_boxatm', type: 'boolean', diff --git a/phy/mod_remap.F b/phy/mod_remap.F index 10e19318..f83e66e8 100644 --- a/phy/mod_remap.F +++ b/phy/mod_remap.F @@ -28,7 +28,7 @@ module mod_remap use mod_xc use mod_constants, only: P_mks2cgs #ifdef TRC - use mod_tracers, only: ntr, itrtke, itrgls + use mod_tracers, only: ntr, natr, itrtke, itrgls #endif c implicit none