From 892b4f66a1ece8e76ab996646fe8511eeb354fbc Mon Sep 17 00:00:00 2001 From: mvdebolskiy Date: Thu, 12 Mar 2026 12:02:53 -0600 Subject: [PATCH 1/2] make irrigate false a default for fates, restrict irrigate to be true with fates --- bld/CLMBuildNamelist.pm | 5 ++++- bld/namelist_files/namelist_defaults_ctsm.xml | 9 +++++---- src/main/clm_driver.F90 | 5 +++++ 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index d433ba8698..885e074c14 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -2084,13 +2084,16 @@ sub setup_logic_irrigate { my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'irrigate', - 'use_crop'=>$nl_flags->{'use_crop'}, 'use_cndv'=>$nl_flags->{'use_cndv'}, + 'use_crop'=>$nl_flags->{'use_crop'}, 'use_cndv'=>$nl_flags->{'use_cndv'}, 'use_fates'=>$nl_flags->{'use_fates'}, 'sim_year'=>$nl_flags->{'sim_year'}, 'sim_year_range'=>$nl_flags->{'sim_year_range'}, ); if ( &value_is_true($nl->get_value('irrigate') ) ) { $nl_flags->{'irrigate'} = ".true."; if ( $nl_flags->{'sim_year'} eq "PtVg" ) { $log->fatal_error("irrigate=TRUE does NOT make sense with the Potential Vegetation dataset, leave irrigate=FALSE"); } + if (&value_is_true($nl_flags->{'use_fates'})) { + $log->fatal_error("irrigate=TRUE is NOT possible with use_fates=TRUE, leave irrigate=FALSE"); + } } else { $nl_flags->{'irrigate'} = ".false."; } diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 25d4b53fac..26d392c0e6 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -200,10 +200,11 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 1700 -.false. -.true. -.true. -.false. +.false. +.false. +.true. +.true. +.false. .false. diff --git a/src/main/clm_driver.F90 b/src/main/clm_driver.F90 index ad97911736..c43ca9a2ee 100644 --- a/src/main/clm_driver.F90 +++ b/src/main/clm_driver.F90 @@ -120,6 +120,7 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro use FATESFireFactoryMod , only : scalar_lightning use FatesInterfaceTypesMod, only : fates_dispersal_cadence_none use CIsoAtmTimeseriesMod, only : C14BombSpike, C13TimeSeries + use shr_log_mod, only : errMsg => shr_log_errMsg ! ! !ARGUMENTS: implicit none @@ -822,6 +823,10 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro if (irrigate) then + if (use_fates) then + call endrun(msg=' ERROR: somehow use_fates and irrigate are both set to TRUE ' // & + errMsg(sourcefile, __LINE__)) + endif ! ============================================================================ ! Determine irrigation needed for future time steps ! ============================================================================ From 5213525c5450c6fd82eafa1ceb6ba1931a384aab Mon Sep 17 00:00:00 2001 From: mvdebolskiy Date: Sat, 14 Mar 2026 11:10:00 -0600 Subject: [PATCH 2/2] Make errmsg more useful and shorter --- src/main/clm_driver.F90 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/clm_driver.F90 b/src/main/clm_driver.F90 index c43ca9a2ee..04fff94669 100644 --- a/src/main/clm_driver.F90 +++ b/src/main/clm_driver.F90 @@ -824,8 +824,10 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro if (irrigate) then if (use_fates) then - call endrun(msg=' ERROR: somehow use_fates and irrigate are both set to TRUE ' // & - errMsg(sourcefile, __LINE__)) + call endrun(msg=' ERROR: Can not have ' // & + 'use_fates = .true. and irrigate = .true. ' // & + 'Set one of them to .false. in your user_nl_clm. ' // & + errMsg(sourcefile, __LINE__)) endif ! ============================================================================ ! Determine irrigation needed for future time steps