Skip to content

Commit 05c7eae

Browse files
committed
Merge remote-tracking branch 'origin/noresm' into drydep-fix-ctsm
2 parents 4987410 + 2109041 commit 05c7eae

4 files changed

Lines changed: 21 additions & 8 deletions

File tree

bld/CLMBuildNamelist.pm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2103,13 +2103,16 @@ sub setup_logic_irrigate {
21032103
my ($opts, $nl_flags, $definition, $defaults, $nl) = @_;
21042104

21052105
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'irrigate',
2106-
'use_crop'=>$nl_flags->{'use_crop'}, 'use_cndv'=>$nl_flags->{'use_cndv'},
2106+
'use_crop'=>$nl_flags->{'use_crop'}, 'use_cndv'=>$nl_flags->{'use_cndv'}, 'use_fates'=>$nl_flags->{'use_fates'},
21072107
'sim_year'=>$nl_flags->{'sim_year'}, 'sim_year_range'=>$nl_flags->{'sim_year_range'}, );
21082108
if ( &value_is_true($nl->get_value('irrigate') ) ) {
21092109
$nl_flags->{'irrigate'} = ".true.";
21102110
if ( $nl_flags->{'sim_year'} eq "PtVg" ) {
21112111
$log->fatal_error("irrigate=TRUE does NOT make sense with the Potential Vegetation dataset, leave irrigate=FALSE");
21122112
}
2113+
if (&value_is_true($nl_flags->{'use_fates'})) {
2114+
$log->fatal_error("irrigate=TRUE is NOT possible with use_fates=TRUE, leave irrigate=FALSE");
2115+
}
21132116
} else {
21142117
$nl_flags->{'irrigate'} = ".false.";
21152118
}

bld/namelist_files/namelist_defaults_ctsm.xml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,11 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
200200
<stream_model_year_align_atm_c13 sim_year_range="1850-2000" >1700</stream_model_year_align_atm_c13>
201201

202202
<!-- Irrigation default (Note, the use-cases also set this) -->
203-
<irrigate >.false.</irrigate>
204-
<irrigate use_cndv=".false." sim_year_range="1850-2100">.true.</irrigate>
205-
<irrigate phys="clm6_0" use_cndv=".false." sim_year_range="1850-2000">.true.</irrigate>
206-
<irrigate phys="clm4_5" use_cndv=".false." sim_year_range="1850-2100">.false.</irrigate>
203+
<irrigate >.false.</irrigate>
204+
<irrigate use_fates=".true." >.false.</irrigate>
205+
<irrigate use_cndv=".false." sim_year_range="1850-2100" use_fates=".false." >.true.</irrigate>
206+
<irrigate phys="clm6_0" use_cndv=".false." sim_year_range="1850-2000" use_fates=".false." >.true.</irrigate>
207+
<irrigate phys="clm4_5" use_cndv=".false." sim_year_range="1850-2100" >.false.</irrigate>
207208

208209
<!-- Saturation excess runoff for crops -->
209210
<crop_fsat_equals_zero>.false.</crop_fsat_equals_zero>

src/main/clm_driver.F90

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro
119119
use FATESFireFactoryMod , only : scalar_lightning
120120
use FatesInterfaceTypesMod, only : fates_dispersal_cadence_none
121121
use CIsoAtmTimeseriesMod, only : C14BombSpike, C13TimeSeries
122+
use shr_log_mod, only : errMsg => shr_log_errMsg
122123
!
123124
! !ARGUMENTS:
124125
implicit none
@@ -821,6 +822,12 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro
821822

822823
if (irrigate) then
823824

825+
if (use_fates) then
826+
call endrun(msg=' ERROR: Cannot have ' // &
827+
'use_fates = .true. and irrigate = .true. ' // &
828+
'Set one of them to .false. in your user_nl_clm. ' // &
829+
errMsg(sourcefile, __LINE__))
830+
endif
824831
! ============================================================================
825832
! Determine irrigation needed for future time steps
826833
! ============================================================================

src/utils/clmfates_interfaceMod.F90

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1881,9 +1881,6 @@ subroutine restart( this, bounds_proc, ncid, flag, waterdiagnosticbulk_inst, &
18811881
! I think that is it...
18821882
! ---------------------------------------------------------------------------------
18831883

1884-
! Set the FATES global time and date variables
1885-
call GetAndSetTime
1886-
18871884
if(.not.initialized) then
18881885

18891886
initialized=.true.
@@ -2016,6 +2013,11 @@ subroutine restart( this, bounds_proc, ncid, flag, waterdiagnosticbulk_inst, &
20162013
! ---------------------------------------------------------------------------------
20172014

20182015
if(flag=='read')then
2016+
! pass time to FATES internal variables
2017+
! since this routine is called on 'define','write','read'
2018+
! and the first two can be called whenever, calling this outside 'read'
2019+
! will change the time that has been previously set in dynamics_driver
2020+
call GetAndSetTime
20192021

20202022
!$OMP PARALLEL DO PRIVATE (nc,bounds_clump,s)
20212023
do nc = 1, nclumps

0 commit comments

Comments
 (0)