From b83c4acc82f79f9b0789376e80a087fde937e89d Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Sat, 15 Feb 2025 13:49:43 -0700 Subject: [PATCH] Add maxlai_triggers_grainfill option. Default .true. preserves old behavior. --- bld/CLMBuildNamelist.pm | 1 + bld/namelist_files/namelist_defaults_ctsm.xml | 1 + bld/namelist_files/namelist_definition_ctsm.xml | 5 +++++ cime_config/testdefs/testlist_clm.xml | 9 +++++++++ .../clm/NoMaxLaiGrainFillTrigger/user_nl_clm | 2 ++ src/biogeochem/CNPhenologyMod.F90 | 6 ++++-- 6 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 cime_config/testdefs/testmods_dirs/clm/NoMaxLaiGrainFillTrigger/user_nl_clm diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 93004ad1c4..49a03e8a4b 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4288,6 +4288,7 @@ sub setup_logic_cropcal_streams { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'flush_gdd20'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'generate_crop_gdds'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_mxmat'); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'maxlai_triggers_grainfill'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_cropcal'); # These can't both be true diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 64e00527fe..08d25ebbb0 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -605,6 +605,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). .false. .true. +.true. .true. diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index ac61b86852..3196ff0872 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -1398,6 +1398,11 @@ Set to .true. in order to override crop harvesting logic and to instead harvest Set to .false. in order to ignore crop PFT parameter for maximum growing season length (mxmat). Must be set to .false. when generate_crop_gdds is .true. + +Set to .false. in order to disable behavior where crops enter grain-filling phase upon reaching max LAI + + Method for determining what the minimum critical day length for seasonal decidious leaf offset depends on diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 2845bf8d7c..6b6859ce7a 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1393,6 +1393,15 @@ + + + + + + + + + diff --git a/cime_config/testdefs/testmods_dirs/clm/NoMaxLaiGrainFillTrigger/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/NoMaxLaiGrainFillTrigger/user_nl_clm new file mode 100644 index 0000000000..6b2e488141 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/NoMaxLaiGrainFillTrigger/user_nl_clm @@ -0,0 +1,2 @@ +maxlai_triggers_grainfill = .false. + diff --git a/src/biogeochem/CNPhenologyMod.F90 b/src/biogeochem/CNPhenologyMod.F90 index abd6a15b44..5bd14bfcde 100644 --- a/src/biogeochem/CNPhenologyMod.F90 +++ b/src/biogeochem/CNPhenologyMod.F90 @@ -146,6 +146,7 @@ module CNPhenologyMod real(r8) :: min_gddmaturity = 1._r8 ! Weird things can happen if gddmaturity is tiny logical, public :: generate_crop_gdds = .false. ! If true, harvest the day before next sowing logical, public :: use_mxmat = .true. ! If true, ignore crop maximum growing season length + logical, public :: maxlai_triggers_grainfill = .true. ! If true, crops will enter cphase_grainfill upon reaching maximum LAI ! For use with adapt_cropcal_rx_cultivar_gdds .true. real(r8), parameter :: min_gdd20_baseline = 0._r8 ! If gdd20_baseline_patch is ≤ this, do not consider baseline. @@ -200,7 +201,7 @@ subroutine CNPhenologyReadNML( NLFilename ) !----------------------------------------------------------------------- namelist /cnphenology/ initial_seed_at_planting, onset_thresh_depends_on_veg, & min_critical_dayl_method, generate_crop_gdds, & - use_mxmat + use_mxmat, maxlai_triggers_grainfill ! Initialize options to default values, in case they are not specified in ! the namelist @@ -226,6 +227,7 @@ subroutine CNPhenologyReadNML( NLFilename ) call shr_mpi_bcast (min_critical_dayl_method, mpicom) call shr_mpi_bcast (generate_crop_gdds, mpicom) call shr_mpi_bcast (use_mxmat, mpicom) + call shr_mpi_bcast (maxlai_triggers_grainfill, mpicom) if ( min_critical_dayl_method == "DependsOnLat" )then critical_daylight_method = critical_daylight_depends_on_lat @@ -2434,7 +2436,7 @@ subroutine CropPhenology(num_pcropp, filter_pcropp , & ! enter phase 2 onset for one time step: ! transfer seed carbon to leaf emergence - if (peaklai(p) >= 1 .and. hui(p) < huigrain(p)) then + if (maxlai_triggers_grainfill .and. peaklai(p) >= 1 .and. hui(p) < huigrain(p)) then hui(p) = huigrain(p) crop_inst%maxlai_triggered_grainfill_patch(p) = .true. endif