From 655d811de788839bdf0cc271be6d0249d8003057 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Thu, 1 Feb 2024 11:20:15 -0700 Subject: [PATCH 01/34] New history fields for coupler history verification (default inactive) --- src/biogeophys/Wateratm2lndType.F90 | 5 ++ src/main/atm2lndType.F90 | 102 ++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+) diff --git a/src/biogeophys/Wateratm2lndType.F90 b/src/biogeophys/Wateratm2lndType.F90 index 44fe39e58d..18e92c78f7 100644 --- a/src/biogeophys/Wateratm2lndType.F90 +++ b/src/biogeophys/Wateratm2lndType.F90 @@ -171,6 +171,11 @@ subroutine InitHistory(this, bounds) avgflag='A', long_name=this%info%lname('atmospheric specific humidity (downscaled to columns in glacier regions)'), & ptr_col=this%forc_q_downscaled_col, default='inactive') + this%forc_q_not_downscaled_grc(begg:endg) = spval + call hist_addfld1d (fname=this%info%fname('QBOT_NOT_DOWNSCALED'), units='kg/kg', & + avgflag='A', long_name=this%info%lname('atmospheric specific humidity (pre-downscaling)'), & + ptr_lnd=this%forc_q_not_downscaled_grc, default='inactive') + this%forc_flood_grc(begg:endg) = spval call hist_addfld1d (fname=this%info%fname('QFLOOD'), units='mm/s', & avgflag='A', long_name=this%info%lname('runoff from river flooding'), & diff --git a/src/main/atm2lndType.F90 b/src/main/atm2lndType.F90 index b99e0c8ba1..298ca4a41d 100644 --- a/src/main/atm2lndType.F90 +++ b/src/main/atm2lndType.F90 @@ -533,6 +533,7 @@ subroutine InitHistory(this, bounds) integer :: begg, endg integer :: begc, endc integer :: begp, endp + real(r8), pointer :: data1dptr(:) ! temp. pointer for slicing larger arrays !--------------------------------------------------------------------- begg = bounds%begg; endg= bounds%endg @@ -548,6 +549,16 @@ subroutine InitHistory(this, bounds) avgflag='A', long_name='atmospheric wind velocity magnitude', & ptr_gcell=this%forc_wind_grc, default = 'inactive') + this%forc_u_grc(begg:endg) = spval + call hist_addfld1d (fname='UWIND', units='m/s', & + avgflag='A', long_name='atmospheric U wind velocity magnitude', & + ptr_lnd=this%forc_u_grc, default = 'inactive') + + this%forc_v_grc(begg:endg) = spval + call hist_addfld1d (fname='VWIND', units='m/s', & + avgflag='A', long_name='atmospheric V wind velocity magnitude', & + ptr_lnd=this%forc_v_grc, default = 'inactive') + this%forc_hgt_grc(begg:endg) = spval call hist_addfld1d (fname='ZBOT', units='m', & avgflag='A', long_name='atmospheric reference height', & @@ -611,6 +622,11 @@ subroutine InitHistory(this, bounds) avgflag='A', long_name='atmospheric pressure at surface (downscaled for glacier and hillslope columns)', & ptr_col=this%forc_pbot_downscaled_col, default='inactive') + this%forc_pbot_not_downscaled_grc(begg:endg) = spval + call hist_addfld1d (fname='PBOT_NOT_DOWNSCALED', units='Pa', & + avgflag='A', long_name='atmospheric pressure at surface (pre-downscaling)', & + ptr_gcell=this%forc_pbot_not_downscaled_grc, default = 'inactive') + this%forc_lwrad_downscaled_col(begc:endc) = spval call hist_addfld1d (fname='FLDS', units='W/m^2', & avgflag='A', long_name='atmospheric longwave radiation (downscaled for glacier and hillslope columns)', & @@ -619,6 +635,11 @@ subroutine InitHistory(this, bounds) avgflag='A', long_name='atmospheric longwave radiation (downscaled for glacier and hillslope columns)', & ptr_col=this%forc_lwrad_downscaled_col, default='inactive') + this%forc_lwrad_not_downscaled_grc(begg:endg) = spval + call hist_addfld1d (fname='FLDS_NOT_DOWNSCALED', units='W/m^2', & + avgflag='A', long_name='atmospheric longwave radiation (pre-downscaling)', & + ptr_gcell=this%forc_lwrad_not_downscaled_grc, default = 'inactive') + call hist_addfld1d (fname='FLDS_ICE', units='W/m^2', & avgflag='A', & long_name='atmospheric longwave radiation (downscaled for glacier and hillslope columns) (ice landunits only)', & @@ -630,6 +651,87 @@ subroutine InitHistory(this, bounds) avgflag='A', long_name='atmospheric air potential temperature (downscaled for glacier and hillslope columns)', & ptr_col=this%forc_th_downscaled_col) + this%forc_th_not_downscaled_grc(begg:endg) = spval + call hist_addfld1d (fname='Thair_from_atm', units='K', & + avgflag='A', long_name='atmospheric air potential temperature (pre-downscaling)', & + ptr_gcell=this%forc_th_not_downscaled_grc, default = 'inactive') + + this%forc_rho_not_downscaled_grc(begg:endg) = spval + call hist_addfld1d (fname='Rho_from_atm', units='kg/m^3', & + avgflag='A', long_name='atmospheric density (pre-downscaling)', & + ptr_gcell=this%forc_rho_not_downscaled_grc, default = 'inactive') + + this%forc_aer_grc(begg:endg,:) = spval + data1dptr => this%forc_aer_grc(begg:endg,1) + call hist_addfld1d (fname='BCPHIDRY', units='kg/m^2/s', & + avgflag='A', long_name='black carbon deposition (phidry) from atmosphere', & + ptr_gcell=data1dptr, default = 'inactive') + + data1dptr => this%forc_aer_grc(begg:endg,2) + call hist_addfld1d (fname='BCPHODRY', units='kg/m^2/s', & + avgflag='A', long_name='black carbon deposition (phodry) from atmosphere', & + ptr_gcell=data1dptr, default = 'inactive') + + data1dptr => this%forc_aer_grc(begg:endg,3) + call hist_addfld1d (fname='BCPHIWET', units='kg/m^2/s', & + avgflag='A', long_name='black carbon deposition (phiwet) from atmosphere', & + ptr_gcell=data1dptr, default = 'inactive') + + data1dptr => this%forc_aer_grc(begg:endg,4) + call hist_addfld1d (fname='OCPHIDRY', units='kg/m^2/s', & + avgflag='A', long_name='organic carbon deposition (phidry) from atmosphere', & + ptr_gcell=data1dptr, default = 'inactive') + + data1dptr => this%forc_aer_grc(begg:endg,5) + call hist_addfld1d (fname='OCPHODRY', units='kg/m^2/s', & + avgflag='A', long_name='black carbon deposition (phodry) from atmosphere', & + ptr_gcell=data1dptr, default = 'inactive') + + data1dptr => this%forc_aer_grc(begg:endg,6) + call hist_addfld1d (fname='OCPHIWET', units='kg/m^2/s', & + avgflag='A', long_name='organic carbon deposition (phiwet) from atmosphere', & + ptr_gcell=data1dptr, default = 'inactive') + + data1dptr => this%forc_aer_grc(begg:endg,7) + call hist_addfld1d (fname='DSTWET1', units='kg/m^2/s', & + avgflag='A', long_name='dust deposition (wet1) from atmosphere', & + ptr_gcell=data1dptr, default = 'inactive') + + data1dptr => this%forc_aer_grc(begg:endg,8) + call hist_addfld1d (fname='DSTDRY1', units='kg/m^2/s', & + avgflag='A', long_name='dust deposition (dry1) from atmosphere', & + ptr_gcell=data1dptr, default = 'inactive') + + data1dptr => this%forc_aer_grc(begg:endg,9) + call hist_addfld1d (fname='DSTWET2', units='kg/m^2/s', & + avgflag='A', long_name='dust deposition (wet2) from atmosphere', & + ptr_gcell=data1dptr, default = 'inactive') + + data1dptr => this%forc_aer_grc(begg:endg,10) + call hist_addfld1d (fname='DSTDRY2', units='kg/m^2/s', & + avgflag='A', long_name='dust deposition (dry2) from atmosphere', & + ptr_gcell=data1dptr, default = 'inactive') + + data1dptr => this%forc_aer_grc(begg:endg,11) + call hist_addfld1d (fname='DSTWET3', units='kg/m^2/s', & + avgflag='A', long_name='dust deposition (wet3) from atmosphere', & + ptr_gcell=data1dptr, default = 'inactive') + + data1dptr => this%forc_aer_grc(begg:endg,12) + call hist_addfld1d (fname='DSTDRY3', units='kg/m^2/s', & + avgflag='A', long_name='dust deposition (dry3) from atmosphere', & + ptr_gcell=data1dptr, default = 'inactive') + + data1dptr => this%forc_aer_grc(begg:endg,13) + call hist_addfld1d (fname='DSTWET4', units='kg/m^2/s', & + avgflag='A', long_name='dust deposition (wet4) from atmosphere', & + ptr_gcell=data1dptr, default = 'inactive') + + data1dptr => this%forc_aer_grc(begg:endg,14) + call hist_addfld1d (fname='DSTDRY4', units='kg/m^2/s', & + avgflag='A', long_name='dust deposition (dry4) from atmosphere', & + ptr_gcell=data1dptr, default = 'inactive') + ! Time averaged quantities this%fsi24_patch(begp:endp) = spval call hist_addfld1d (fname='FSI24', units='K', & From 6d6e22c9026de201ce6176dbd6a396ceeb3f5315 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Thu, 1 Feb 2024 12:44:57 -0700 Subject: [PATCH 02/34] New parameter file and namelist values for clm5_1 --- bld/namelist_files/namelist_defaults_ctsm.xml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 3ef6615b73..a1cee6dffc 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -441,7 +441,9 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 1.e9 SwensonLawrence2012 + Jordan1991 +Sturm1997 -lnd/clm2/paramdata/ctsm51_params.c240207b.nc -lnd/clm2/paramdata/clm50_params.c240207b.nc -lnd/clm2/paramdata/clm45_params.c240207b.nc +/glade/campaign/cgd/tss/people/oleson/modify_param/ctsm51_params.c240201.nc +lnd/clm2/paramdata/clm50_params.c240105.nc +lnd/clm2/paramdata/clm45_params.c240105.nc @@ -1637,7 +1639,8 @@ use_crop=".true.">lnd/clm2/surfdata_map/ctsm5.1.dev052/landuse.timeseries_mpasa1 mid_latitude_winter sahara .false. -.false. +.false. +.true. .true. .false. From 791392b844b0dfd79af3e1ba1b6411ea322ae4f9 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Thu, 1 Feb 2024 13:15:19 -0700 Subject: [PATCH 03/34] Remove flg_snoage_scl in SNICAR such that xdrdt can have an effect --- src/biogeophys/SnowSnicarMod.F90 | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/biogeophys/SnowSnicarMod.F90 b/src/biogeophys/SnowSnicarMod.F90 index 5bc1c61edb..f6d41bd6a0 100644 --- a/src/biogeophys/SnowSnicarMod.F90 +++ b/src/biogeophys/SnowSnicarMod.F90 @@ -81,9 +81,6 @@ module SnowSnicarMod real(r8), parameter :: tim_cns_dst_rmv = 2.2E-8_r8 ! time constant for removal of dust in snow on sea-ice ! [s-1] (50% mass removal/year) - ! scaling of the snow aging rate (tuning option): - logical :: flg_snoage_scl = .false. ! flag for scaling the snow aging rate by some arbitrary factor - ! snow and aerosol Mie parameters: ! (arrays declared here, but are set in iniTimeConst) ! (idx_Mie_snw_mx is number of snow radii with defined parameters (i.e. from 30um to 1500um)) @@ -1656,13 +1653,10 @@ subroutine SnowAge_grain(bounds, & dr = dr + dr_wet ! - !********** 3. SNOWAGE SCALING (TURNED OFF BY DEFAULT) ************* + !********** 3. SNOWAGE SCALING ************* ! ! Multiply rate of change of effective radius by some constant, xdrdt - if (flg_snoage_scl) then - dr = dr*params_inst%xdrdt - endif - + dr = dr*params_inst%xdrdt ! !********** 4. INCREMENT EFFECTIVE RADIUS, ACCOUNTING FOR: *********** From 87715e074117cc0621c1ae08f12158bca69176d8 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Thu, 1 Feb 2024 13:17:53 -0700 Subject: [PATCH 04/34] Remove snicar_snobc_intmix from EXPERIMENTAL endrun (allow it to be true) --- src/main/controlMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index eaa7c5c1e4..5f909affb2 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -636,7 +636,7 @@ subroutine control_init(dtime) snicar_solarspec /= 'mid_latitude_winter' .or. & snicar_dust_optics /= 'sahara' .or. & snicar_numrad_snw /= 5 .or. & - snicar_snobc_intmix .or. snicar_snodst_intmix .or. & + snicar_snodst_intmix .or. & .not. snicar_use_aerosol .or. & do_sno_oc) then call endrun(msg=' ERROR: You have selected an option that is EXPERIMENTAL, UNSUPPORTED, and UNTESTED. For guidance see namelist_defaults_ctsm.xml'//& From e56dd98f956d89f58f66685946b516e1a4d23500 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Tue, 6 Feb 2024 11:21:29 -0700 Subject: [PATCH 05/34] Remove snicar_snobc_intmix from CLMBuildNamelist.pm warning --- bld/CLMBuildNamelist.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 9b0af55452..7f8c364f21 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -2037,7 +2037,7 @@ sub setup_logic_snicar_methods { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'do_sno_oc' ); # Error checking in loop - my %supportedSettings = ( 'snicar_solarspec' => "'mid_latitude_winter'", 'snicar_dust_optics' => "'sahara'", 'snicar_numrad_snw' => '5', 'snicar_snobc_intmix' => '.false.', 'snicar_snodst_intmix' => '.false.', 'snicar_use_aerosol' => '.true.', 'do_sno_oc' => '.false.' ); + my %supportedSettings = ( 'snicar_solarspec' => "'mid_latitude_winter'", 'snicar_dust_optics' => "'sahara'", 'snicar_numrad_snw' => '5', 'snicar_snodst_intmix' => '.false.', 'snicar_use_aerosol' => '.true.', 'do_sno_oc' => '.false.' ); keys %supportedSettings; while ( my ($key, $val) = each %supportedSettings ) { my $var = $nl->get_value($key); From a0d9460f4f1f7fd2043f3852081f3468b0a7a84a Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Thu, 8 Feb 2024 08:31:57 -0700 Subject: [PATCH 06/34] Rework logic for snicar_snobc_intmix and snicar_snodst_intmix --- bld/CLMBuildNamelist.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 7f8c364f21..4b7499ddfa 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -2055,13 +2055,13 @@ sub setup_logic_snicar_methods { $log->warning("$key1=$val1a and $val1b are supported; $var1 is EXPERIMENTAL, UNSUPPORTED, and UNTESTED!"); } - # snicar_snobc_intmix and snicar_snodst_intmix cannot both be true + # snicar_snobc_intmix and snicar_snodst_intmix cannot both be true, however, they can both be false my $key1 = 'snicar_snobc_intmix'; my $key2 = 'snicar_snodst_intmix'; my $var1 = $nl->get_value($key1); my $var2 = $nl->get_value($key2); - my $val1 = $supportedSettings{$key1}; # supported value for this option - if (($var1 eq $var2) && ($var1 ne $val1)) { + my $val2 = $supportedSettings{$key2}; # supported value for this option + if (($var1 eq $var2) && ($var2 ne $val2)) { $log->warning("$key1 = $var1 and $key2 = $var2 do not work together!"); } } From 324423eac583811e53788b3f7bc253f27248d49c Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Thu, 8 Feb 2024 08:34:43 -0700 Subject: [PATCH 07/34] Move snow5d_thresh_for_onset to parameter files --- bld/namelist_files/namelist_defaults_ctsm.xml | 6 +++--- .../testdefs/testmods_dirs/clm/ciso_cwd_hr/user_nl_clm | 2 +- src/biogeochem/CNPhenologyMod.F90 | 7 +++++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index a1cee6dffc..0594591693 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -486,9 +486,9 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -/glade/campaign/cgd/tss/people/oleson/modify_param/ctsm51_params.c240201.nc -lnd/clm2/paramdata/clm50_params.c240105.nc -lnd/clm2/paramdata/clm45_params.c240105.nc +/glade/campaign/cgd/tss/people/oleson/modify_param/ctsm51_params.c240208.nc +/glade/campaign/cgd/tss/people/oleson/modify_param/clm50_params.c240208.nc +/glade/campaign/cgd/tss/people/oleson/modify_param/clm45_params.c240208.nc diff --git a/cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/user_nl_clm index c235d72df1..2b8f437246 100644 --- a/cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/user_nl_clm @@ -1,2 +1,2 @@ -paramfile = '$DIN_LOC_ROOT/lnd/clm2/paramdata/ctsm51_ciso_cwd_hr_params.c240207b.nc' +paramfile = '/glade/campaign/cgd/tss/people/oleson/modify_param/ctsm51_ciso_cwd_hr_params.c240208.nc' hist_fincl1 = 'CWDC_HR','C13_CWDC_HR','C14_CWDC_HR','CWD_HR_L2','CWD_HR_L2_vr','CWD_HR_L3','CWD_HR_L3_vr' diff --git a/src/biogeochem/CNPhenologyMod.F90 b/src/biogeochem/CNPhenologyMod.F90 index 05041527a7..fffb19bc46 100644 --- a/src/biogeochem/CNPhenologyMod.F90 +++ b/src/biogeochem/CNPhenologyMod.F90 @@ -97,6 +97,7 @@ module CNPhenologyMod real(r8) :: soilpsi_off ! critical soil water potential for leaf offset real(r8) :: lwtop ! live wood turnover proportion (annual fraction) real(r8) :: phenology_soil_depth ! soil depth used for measuring states for phenology triggers + real(r8) :: snow5d_thresh_for_onset ! 5-day snow depth threshold for leaf onset end type params_type type(params_type) :: params_inst @@ -280,6 +281,7 @@ subroutine CNPhenologySetParams( ) params_inst%soilpsi_off = -0.8 ! MPa params_inst%lwtop = 0.7_r8 ! Fraction params_inst%phenology_soil_depth = 0.08_r8 ! m + params_inst%snow5d_thresh_for_onset = 0.2_r8 ! m end subroutine CNPhenologySetParams !----------------------------------------------------------------------- @@ -313,6 +315,7 @@ subroutine readParams ( ncid ) call readNcdioScalar(ncid, 'soilpsi_off', subname, params_inst%soilpsi_off) call readNcdioScalar(ncid, 'lwtop_ann', subname, params_inst%lwtop) call readNcdioScalar(ncid, 'phenology_soil_depth', subname, params_inst%phenology_soil_depth) + call readNcdioScalar(ncid, 'snow5d_thresh_for_onset', subname, params_inst%snow5d_thresh_for_onset) end subroutine readParams @@ -1136,7 +1139,6 @@ function SeasonalDecidOnset( onset_gdd, onset_gddflag, soilt, soila10, t_a5min, logical :: do_onset ! Flag if onset should happen (return value) ! ! !LOCAL VARIABLES: - real(r8), parameter :: snow5d_thresh_for_onset = 0.1_r8 ! 5-day snow depth threshold for leaf onset real(r8), parameter :: min_critical_daylength_onset = 39300._r8/2._r8 ! Minimum daylength for onset to happen ! NOTE above: The 39300/2(19650) value is what we've ! tested with, we are concerned that changing @@ -1192,7 +1194,8 @@ function SeasonalDecidOnset( onset_gdd, onset_gddflag, soilt, soila10, t_a5min, else if (season_decid_temperate == 0 .and. onset_gddflag == 1.0_r8 .and. & soila10 > SHR_CONST_TKFRZ .and. & t_a5min > SHR_CONST_TKFRZ .and. ws_flag==1.0_r8 .and. & - dayl>min_critical_daylength_onset .and. snow_5daymin_critical_daylength_onset .and. & + snow_5day Date: Wed, 6 Mar 2024 16:11:26 -0700 Subject: [PATCH 08/34] Update param file paths --- bld/namelist_files/namelist_defaults_ctsm.xml | 6 +++--- .../testdefs/testmods_dirs/clm/ciso_cwd_hr/user_nl_clm | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 0594591693..f532cd7fa5 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -486,9 +486,9 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -/glade/campaign/cgd/tss/people/oleson/modify_param/ctsm51_params.c240208.nc -/glade/campaign/cgd/tss/people/oleson/modify_param/clm50_params.c240208.nc -/glade/campaign/cgd/tss/people/oleson/modify_param/clm45_params.c240208.nc +/glade/campaign/cesm/cesmdata/inputdata/lnd/clm2/paramdata/ctsm51_params.c240208.nc +/glade/campaign/cesm/cesmdata/inputdata/lnd/clm2/paramdata/clm50_params.c240208.nc +/glade/campaign/cesm/cesmdata/inputdata/lnd/clm2/paramdata/clm45_params.c240208.nc diff --git a/cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/user_nl_clm index 2b8f437246..1d0be15d59 100644 --- a/cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/user_nl_clm @@ -1,2 +1,2 @@ -paramfile = '/glade/campaign/cgd/tss/people/oleson/modify_param/ctsm51_ciso_cwd_hr_params.c240208.nc' +paramfile = '/glade/campaign/cesm/cesmdata/inputdata/lnd/clm2/paramdata/ctsm51_ciso_cwd_hr_params.c240208.nc' hist_fincl1 = 'CWDC_HR','C13_CWDC_HR','C14_CWDC_HR','CWD_HR_L2','CWD_HR_L2_vr','CWD_HR_L3','CWD_HR_L3_vr' From 81f1d763e6e0bf35c25119e7d9db7a8f721b69c1 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 7 Mar 2024 12:30:43 -0700 Subject: [PATCH 09/34] Draft ChangeLog/ChangeSum files --- doc/ChangeLog | 108 ++++++++++++++++++++------------------------------ doc/ChangeSum | 4 +- 2 files changed, 45 insertions(+), 67 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 9ef124937f..4dc62242cf 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,15 +1,24 @@ =============================================================== -Tag name: ctsm5.1.dev172 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Tue 12 Mar 2024 11:59:48 PM MDT -One-line Summary: Merge b4b-dev +Tag name: ctsm5.1.dev173 +Originator(s): olyson (Keith Oleson,UCAR/TSS) +Date: Thu 07 Mar 2024 12:07:43 PM MST +One-line Summary: Improve vegetation health at high latitudes Purpose and description of changes ---------------------------------- -Update of externals to what's expected in cesm2_3_beta17. Some documentation updates including a rebuild -of the documentation and updating how images are handled with git lfs. Improvements to the documentation for -residue removal and tillage for prognostic crops. +The corresponding changes: + +Remove snicar_snobc_intmix from EXPERIMENTAL endrun (allow it to be true) +Remove flg_snoage_scl in SNICAR such that xdrdt can have an effect (fixes #2298 ) +New parameter file and namelist values for clm5_1: + +- snow_thermal_cond_method = Sturm1997 (default for clm5_1) +- snicar_snobc_intmix = .true. (default for clm5_1) +- ctsm51_params.c240201.nc is the new CTSM parameter file (changes: froot_leaf(11:12)=1.2, FUN_fracfixers(11:12)=1, xdrdt=5, scvng_fct_mlt_sf=0.5, snw_rds_refrz=1500, fresh_snw_rds_max=400) +- New history fields for coupler history verification (default off) +- Add snow5d_thresh_for_onset to parameter file, set to 0.2 for clm51 and 0.1 (unchanged) for clm50 and clm45. + Significant changes to scientifically-supported configurations -------------------------------------------------------------- @@ -19,7 +28,7 @@ Does this tag change answers significantly for any of the following physics conf [Put an [X] in the box for any configuration with significant answer changes.] -[ ] clm5_1 +[X] clm5_1 [ ] clm5_0 @@ -30,83 +39,52 @@ Does this tag change answers significantly for any of the following physics conf Bugs fixed ---------- - CTSM issues fixed (include CTSM Issue #): - Fixes #2351 Update to cesm2_3_beta17 externals - Fixes #2380 ctsm_pylib on izumi can use python3.7.9 - Fixes #2331 py_env_create fails on izumi - Fixes #1910 modify_singlept_neon on izumi - Fixes #1658 malformed file on izumi - Fixes #2412 Check current directory isn't being removed in run_neon +Fixes #2298 +Fixes LMWG_dev discussion #3 + Notes of particular relevance for users --------------------------------------- - -Notes of particular relevance for developers: ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide -[Remove any lines that don't apply. Remove entire section if nothing applies.] - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - - ccs_config config_machines.xml files were updated from v2 to v3 - - The timing and memory usage information was moved from drv.log to med.log for nuopc runs. - This allows the creating of the baselines cpl-mem.log and cpl-tput.log files. - - SMP_PRESENT removed and BUILD_THREADED added. - -Changes to tests or testing: - Bring back DEBUG testing with intel for mpi-serial cases. +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): + New namelist defaults including new parameter files: + ctsm51_params.c240208.nc + clm50_params.c240208.nc + clm45_params.c240208.nc + ctsm51_ciso_cwd_hr_params.c240208.nc -Testing summary: regular +Testing summary: ---------------- - [PASS means all tests PASS; OK means tests PASS other than expected fails.] - build-namelist tests (if CLMBuildNamelist.pm has changed): - - derecho - PASS - - python testing (if python code has changed; see instructions in python/README.md; document testing done): - - derecho - PASS - - clm_pymods test suite on derecho - PASS + [PASS means all tests PASS; OK means tests PASS other than expected fails.] regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): - derecho ----- OK - izumi ------- OK - -If the tag used for baseline comparisons was NOT the previous tag, note that here: + derecho ----- + izumi ------- + any other testing (give details below): + Keith Oleson replicated simulation in LMWG_dev issue #51 as bfb when snow5d_thresh_for_onset on ctsm51_ciso_cwd_hr_params.c240208.nc + was set to original value of 0.1. Answer changes -------------- -Changes answers relative to baseline: no bit-for-bit +Changes answers relative to baseline: YES + + Summarize any changes to answers, i.e., + - what code configurations: clm51 + - what platforms/compilers: all + - nature of change: new climate + + See LMWG_dev discussion #3 and simulations discussed therein, + including (though possibly not limited to) LMWG_dev issues #51, 52, 54, 57. Other details ------------- -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): - manage externals - cismwrap_2_1_97 - = rtm1_0_79 - mosart1_0_49 - ccs_config_cesm0.0.92 - cime6.0.217_httpsbranch03 - cmeps0.14.50 - cdeps1.0.28 - share1.0.18 - Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - - #2396 Explain residue removal - #2385 Update externals - #2394 Fix tillage instructions and images - #2389 Minor docs updates + https://github.com/ESCOMP/ctsm/pull/2348 =============================================================== =============================================================== diff --git a/doc/ChangeSum b/doc/ChangeSum index c9cf2183f4..d1a3ff1a5f 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,7 +1,7 @@ Tag Who Date Summary ============================================================================================================================ - ctsm5.1.dev172 erik 03/12/2024 Merge b4b-dev - ctsm5.1.dev171 slevis 03/01/2024 Set initial t_soisno=272 for soils and 274K for urban road + ctsm5.1.dev173 olyson 03/07/2024 Improve vegetation health at high latitudes + ctsm5.1.dev171 olyson 03/01/2024 Set initial t_soisno=272 for soils and 274K for urban road ctsm5.1.dev170 samrabin 02/28/2024 Add hillslope hydrology ctsm5.1.dev169 samrabin 02/22/2024 Merge b4b-dev ctsm5.1.dev168 slevis 02/16/2024 Remove a source of negative snocan in CanopyFluxesMod From eaaddcb8bd60d9a43ab2a0f9c0dfce5993e2c0db Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 7 Mar 2024 14:30:07 -0700 Subject: [PATCH 10/34] Corrections/updates to ChangeLog --- doc/ChangeLog | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 4dc62242cf..380580df86 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -15,7 +15,7 @@ New parameter file and namelist values for clm5_1: - snow_thermal_cond_method = Sturm1997 (default for clm5_1) - snicar_snobc_intmix = .true. (default for clm5_1) -- ctsm51_params.c240201.nc is the new CTSM parameter file (changes: froot_leaf(11:12)=1.2, FUN_fracfixers(11:12)=1, xdrdt=5, scvng_fct_mlt_sf=0.5, snw_rds_refrz=1500, fresh_snw_rds_max=400) +- ctsm51_params.c240208.nc is the new CTSM parameter file (changes: froot_leaf(11:12)=1.2, FUN_fracfixers(11:12)=1, xdrdt=5, scvng_fct_mlt_sf=0.5, snw_rds_refrz=1500, fresh_snw_rds_max=400) - New history fields for coupler history verification (default off) - Add snow5d_thresh_for_onset to parameter file, set to 0.2 for clm51 and 0.1 (unchanged) for clm50 and clm45. @@ -65,8 +65,9 @@ Testing summary: izumi ------- any other testing (give details below): - Keith Oleson replicated simulation in LMWG_dev issue #51 as bfb when snow5d_thresh_for_onset on ctsm51_ciso_cwd_hr_params.c240208.nc - was set to original value of 0.1. + Keith Oleson replicated simulation in LMWG_dev issue #51 as bfb when + snow5d_thresh_for_onset on ctsm51_ciso_cwd_hr_params.c240208.nc was set + to original value of 0.1. Answer changes -------------- @@ -76,11 +77,15 @@ Changes answers relative to baseline: YES Summarize any changes to answers, i.e., - what code configurations: clm51 - what platforms/compilers: all - - nature of change: new climate + - nature of change: new climate at high latitudes See LMWG_dev discussion #3 and simulations discussed therein, including (though possibly not limited to) LMWG_dev issues #51, 52, 54, 57. + slevis will add this tag with the label "SIGNIFICANT" to the + Answer-changing-tags wiki: + https://github.com/ESCOMP/CTSM/wiki/Answer-changing-tags + Other details ------------- Pull Requests that document the changes (include PR ids): From 185db7014abad74d0328962c9333be4fa351f196 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Thu, 2 Nov 2023 16:32:38 -0400 Subject: [PATCH 11/34] added some comments --- src/main/clm_varctl.F90 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index bdcb653b64..0da0933668 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -319,8 +319,15 @@ module clm_varctl logical, public :: use_fates_inventory_init = .false. ! true => initialize fates from inventory logical, public :: use_fates_fixed_biogeog = .false. ! true => use fixed biogeography mode logical, public :: use_fates_nocomp = .false. ! true => use no comopetition mode - logical, public :: use_fates_luh = .false. ! true => use FATES landuse data mode - character(len=256), public :: fluh_timeseries = '' ! filename for fates landuse timeseries data + + ! History density level + ! fates can produce history at either the daily timescale (dynamics) + ! and the model step timescale. It can also generate output on the extra dimension + ! Performing this output can be expensive, so we allow different history density + ! levels + + logical, public :: fates_hist_dense_level = 1 ! + character(len=256), public :: fates_inventory_ctrl_filename = '' ! filename for inventory control ! FATES SP AND FATES BGC are MUTUTALLY EXCLUSIVE, THEY CAN'T BOTH BE ON From cf681f73bb5bce115ead97b834448f86a592e346 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Fri, 3 Nov 2023 10:34:53 -0400 Subject: [PATCH 12/34] updates to crossreffing namelist history vars and allocated history vars --- src/main/histFileMod.F90 | 2 +- src/utils/clmfates_interfaceMod.F90 | 65 +++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 1 deletion(-) diff --git a/src/main/histFileMod.F90 b/src/main/histFileMod.F90 index d419f97630..863bf6e987 100644 --- a/src/main/histFileMod.F90 +++ b/src/main/histFileMod.F90 @@ -180,7 +180,7 @@ module histFileMod private :: hist_set_snow_field_2d ! Set values in history field dimensioned by levsno private :: list_index ! Find index of field in exclude list private :: set_hist_filename ! Determine history dataset filenames - private :: getname ! Retrieve name portion of input "inname" + public :: getname ! Retrieve name portion of input "inname" (PUBLIC FOR FATES) private :: getflag ! Retrieve flag private :: next_history_pointer_index ! Latest index into raw history data (clmptr_r*) arrays private :: max_nFields ! The max number of fields on any tape diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index da167d9266..578b65686e 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -274,6 +274,7 @@ module CLMFatesInterfaceMod public :: CLMFatesGlobals1 public :: CLMFatesGlobals2 + public :: CrossRefHistoryFields contains @@ -571,6 +572,70 @@ subroutine CLMFatesGlobals2() return end subroutine CLMFatesGlobals2 + ! =================================================================================== + + subroutine CrossRefHistoryFields + + ! This routine only needs to be called on the masterproc. + ! Here we cross reference the CLM history master + ! list and make sure that all fields that start + ! with fates have been allocated. If it has + ! not, then we give a more constructive error + ! message than what is possible in PIO. The user + ! most likely needs to increase the history density + ! level + + use histFileMod, only: getname + use histFileMod, only: fincl, hist_fincl1 + use histFileMod, only: max_tapes, max_flds + + integer :: t ! iterator index for history tapes + integer :: f ! iterator index for registered history field names + integer :: nh ! iterator index for fates registered history + logical :: found ! if true, than the history field is either + ! not part of the fates set, or was found in + ! the fates set + character(len=64) :: fincl_name + + do t = 1,max_tapes + + f = 1 + search_fields: do while (f < max_flds .and. fincl(f,t) /= ' ') + + ! This fincl array might not be ready by the time + ! this is called + fincl_name = getname(fincl(f,t)) + + if(scan(fincl_name,'FATES_'))then + found = .false. + do_fates_hist: do nh = 1,fates_hist%num_history_vars + if(trim(fates_hist%hvars(nh)%vname) == & + trim(fincl_name)) then + found=.true. + exit do_fates_hist + end if + end do do_fates_hist + + if(.not.found)then + write(iulog,*) 'the history field: ',trim(fincl_name) + write(iulog,*) 'was requested in the namelist, but was' + write(iulog,*) 'not found in the list of fates_hist%hvars.' + write(iulog,*) 'Most likely, this is because this history variable' + write(iulog,*) 'was specified in the user namelist, but the user' + write(iulog,*) 'specified a FATES history output density level' + write(iulog,*) 'that does not contain that variable in its valid set.' + write(iulog,*) 'You may have to increase the namelist setting: fates_hist_dens_level' + write(iulog,*) 'current fates_hist_dens_level: ',hlm_hist_dens_level + call endrun(msg=errMsg(sourcefile, __LINE__)) + end if + end if + f = f + 1 + end do search_fields + end do + + end subroutine CrossRefHistoryFields + + ! =================================================================================== subroutine CLMFatesTimesteps() From 6c6a5407a9e03bd0548f0a0f42e258fef5ca12dc Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Mon, 6 Nov 2023 13:28:43 -0500 Subject: [PATCH 13/34] changed nl argument to text --- src/main/clm_varctl.F90 | 12 +++++++++--- src/utils/clmfates_interfaceMod.F90 | 7 +++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index 0da0933668..71b4681b97 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -320,13 +320,19 @@ module clm_varctl logical, public :: use_fates_fixed_biogeog = .false. ! true => use fixed biogeography mode logical, public :: use_fates_nocomp = .false. ! true => use no comopetition mode - ! History density level + ! FATES history density level ! fates can produce history at either the daily timescale (dynamics) ! and the model step timescale. It can also generate output on the extra dimension ! Performing this output can be expensive, so we allow different history density - ! levels + ! levels. + ! The first index is output at the model timescale + ! The second index is output at the dynamics (daily) timescale + ! 0 - no output + ! 1 - include only column level means + ! 2 - include only output with only 1 additional dimension + ! 3 - include all multiplexed dimensions - logical, public :: fates_hist_dense_level = 1 ! + character(len=2), public :: fates_hist_dense_level = '11' character(len=256), public :: fates_inventory_ctrl_filename = '' ! filename for inventory control diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 578b65686e..cdf5ab912b 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -64,6 +64,7 @@ module CLMFatesInterfaceMod use clm_varctl , only : fates_inventory_ctrl_filename use clm_varctl , only : use_nitrif_denitrif use clm_varctl , only : use_lch4 + use clm_varctl , only : fates_hist_dense_level use clm_varcon , only : tfrz use clm_varcon , only : spval use clm_varcon , only : denice @@ -407,6 +408,8 @@ subroutine CLMFatesGlobals2() call set_fates_ctrlparms('parteh_mode',ival=fates_parteh_mode) call set_fates_ctrlparms('seeddisp_cadence',ival=fates_seeddisp_cadence) + call set_fates_ctrlparms('hist_dense_level',cval=fates_hist_dense_level) + ! CTSM-FATES is not fully coupled (yet) ! So lets tell fates to use the RD competition mechanism ! which has fewer boundary conditions (simpler) @@ -624,8 +627,8 @@ subroutine CrossRefHistoryFields write(iulog,*) 'was specified in the user namelist, but the user' write(iulog,*) 'specified a FATES history output density level' write(iulog,*) 'that does not contain that variable in its valid set.' - write(iulog,*) 'You may have to increase the namelist setting: fates_hist_dens_level' - write(iulog,*) 'current fates_hist_dens_level: ',hlm_hist_dens_level + write(iulog,*) 'You may have to increase the namelist setting: fates_hist_dense_level' + write(iulog,*) 'current fates_hist_dens_level: ',hlm_hist_dense_level call endrun(msg=errMsg(sourcefile, __LINE__)) end if end if From 3427a5ec19d04f1cb70164dc16d132083b8d0b8e Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Fri, 22 Sep 2023 11:14:15 -0400 Subject: [PATCH 14/34] Update external pointer for fates, better name of experimental branch --- Externals_CLM.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index a6fae66356..0c6fc55262 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -2,7 +2,7 @@ local_path = src/fates protocol = git repo_url = https://github.com/NGEET/fates -tag = sci.1.71.0_api.33.0.0 +branch = unsupported_sp_calibration required = True [externals_description] From 42eed6fd9e360f85936dfeb6d1bac58dfa8bb711 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Thu, 30 Nov 2023 12:47:35 -0500 Subject: [PATCH 15/34] changed hist dense namelist to integer --- src/main/clm_varctl.F90 | 2 +- src/main/controlMod.F90 | 4 ++-- src/utils/clmfates_interfaceMod.F90 | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index 71b4681b97..e64f7444ca 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -332,7 +332,7 @@ module clm_varctl ! 2 - include only output with only 1 additional dimension ! 3 - include all multiplexed dimensions - character(len=2), public :: fates_hist_dense_level = '11' + integer, dimension(2), public :: fates_hist_dense_level = (/1,1/) character(len=256), public :: fates_inventory_ctrl_filename = '' ! filename for inventory control diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index 5f909affb2..4e4c41f7bd 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -235,7 +235,7 @@ subroutine control_init(dtime) fates_inventory_ctrl_filename, & fates_parteh_mode, & fates_seeddisp_cadence, & - use_fates_tree_damage + use_fates_tree_damage, fates_hist_dense_level ! Ozone vegetation stress method namelist / clm_inparm / o3_veg_stress_method @@ -495,7 +495,7 @@ subroutine control_init(dtime) call endrun(msg=' ERROR: C13 and C14 dynamics are not compatible with FATES.'//& errMsg(sourcefile, __LINE__)) end if - + else ! These do default to false anyway, but this emphasizes they diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index cdf5ab912b..ec94668c55 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -408,7 +408,8 @@ subroutine CLMFatesGlobals2() call set_fates_ctrlparms('parteh_mode',ival=fates_parteh_mode) call set_fates_ctrlparms('seeddisp_cadence',ival=fates_seeddisp_cadence) - call set_fates_ctrlparms('hist_dense_level',cval=fates_hist_dense_level) + call set_fates_ctrlparms('hist_hifrq_dense_level',ival=fates_hist_dense_level(1)) + call set_fates_ctrlparms('hist_dynam_dense_level',ival=fates_hist_dense_level(2)) ! CTSM-FATES is not fully coupled (yet) ! So lets tell fates to use the RD competition mechanism From 267888ba7e890782b6aa6323702e37c40b8e5484 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Thu, 25 Jan 2024 12:22:18 -0500 Subject: [PATCH 16/34] fates history density work --- bld/CLMBuildNamelist.pm | 6 ++- bld/namelist_files/namelist_defaults_ctsm.xml | 2 +- .../namelist_definition_ctsm.xml | 13 +++++ src/main/clm_varctl.F90 | 2 + src/utils/clmfates_interfaceMod.F90 | 49 +++++++++++++------ 5 files changed, 53 insertions(+), 19 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 4b7499ddfa..45dc4f0559 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -784,7 +784,8 @@ sub setup_cmdl_fates_mode { my @list = ( "fates_spitfire_mode", "use_fates_planthydro", "use_fates_ed_st3", "use_fates_ed_prescribed_phys", "use_fates_cohort_age_tracking","use_fates_inventory_init","use_fates_fixed_biogeog", "use_fates_nocomp","use_fates_sp","fates_inventory_ctrl_filename","use_fates_logging", - "fates_parteh_mode","use_fates_tree_damage","fates_seeddisp_cadence","use_fates_luh","fluh_timeseries" ); + "fates_parteh_mode","use_fates_tree_damage","fates_hist_dense_level","fates_seeddisp_cadence", + "use_fates_luh","fluh_timeseries" ); # dis-allow fates specific namelist items with non-fates runs foreach my $var ( @list ) { if ( defined($nl->get_value($var)) ) { @@ -4438,7 +4439,8 @@ sub setup_logic_fates { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fates_paramfile', 'phys'=>$nl_flags->{'phys'}); my @list = ( "fates_spitfire_mode", "use_fates_planthydro", "use_fates_ed_st3", "use_fates_ed_prescribed_phys", "use_fates_inventory_init","use_fates_fixed_biogeog","use_fates_nocomp","fates_seeddisp_cadence", - "use_fates_logging","fates_parteh_mode", "use_fates_cohort_age_tracking","use_fates_tree_damage","use_fates_luh" ); + "use_fates_logging","fates_parteh_mode", "use_fates_cohort_age_tracking","use_fates_tree_damage", + "use_fates_luh","fates_hist_dense_level" ); foreach my $var ( @list ) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'use_fates'=>$nl_flags->{'use_fates'}, 'use_fates_sp'=>$nl_flags->{'use_fates_sp'} ); diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index f532cd7fa5..d9cf902452 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2786,7 +2786,7 @@ use_crop=".true.">lnd/clm2/surfdata_map/ctsm5.1.dev052/landuse.timeseries_mpasa1 .false. 1 0 - +1,1 .true. .false. .true. diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 0469af2344..c9f83296b7 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -777,6 +777,19 @@ Full pathname to the inventory initialization control file. (Only relevant if FATES is on). + + Setting for what types of FATES history to be allocate and + calculated at the dynamics timestep (1st integer) and the + model timestep (2nd integer). This must be consistent with + hist_fincl*, ie output variables must not be listed if the + output level is not enabled. + 0 = no fates history variables are calculated or allocated + 1 = only time x space (3d) fates history variables allowed + 2 = multiplexed dimensioned fates history is also allowed + (Only relevant if FATES is on) + + diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index e64f7444ca..96719109c8 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -334,6 +334,8 @@ module clm_varctl integer, dimension(2), public :: fates_hist_dense_level = (/1,1/) + logical, public :: use_fates_luh = .false. ! true => use FATES landuse data mode + character(len=256), public :: fluh_timeseries = '' ! filename for fates landuse timeseries data character(len=256), public :: fates_inventory_ctrl_filename = '' ! filename for inventory control ! FATES SP AND FATES BGC are MUTUTALLY EXCLUSIVE, THEY CAN'T BOTH BE ON diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index ec94668c55..efa4a11374 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -134,7 +134,7 @@ module CLMFatesInterfaceMod use FatesParametersInterface, only : fates_parameters_type use FatesInterfaceMod , only : DetermineGridCellNeighbors - + use FatesIOVariableKindMod, only : group_dyna_simple, group_dyna_complx use FatesHistoryInterfaceMod, only : fates_hist use FatesRestartInterfaceMod, only : fates_restart_interface_type @@ -1175,9 +1175,9 @@ subroutine dynamics_driv(this, nc, bounds_clump, & ! Flush arrays to values defined by %flushval (see registry entry in ! subroutine define_history_vars() ! --------------------------------------------------------------------------------- - call fates_hist%flush_hvars(nc,upfreq_in=1) + call fates_hist%flush_hvars(nc,upfreq_in=group_dyna_simple) - call fates_hist%flush_hvars(nc,upfreq_in=5) + call fates_hist%flush_hvars(nc,upfreq_in=group_dyna_complx) ! --------------------------------------------------------------------------------- ! Part II: Call the FATES model now that input boundary conditions have been @@ -1952,11 +1952,20 @@ subroutine restart( this, bounds_proc, ncid, flag, waterdiagnosticbulk_inst, & ! ------------------------------------------------------------------------ ! Update history IO fields that depend on ecosystem dynamics ! ------------------------------------------------------------------------ - call fates_hist%flush_hvars(nc,upfreq_in=1) - do s = 1,this%fates(nc)%nsites - call fates_hist%zero_site_hvars(this%fates(nc)%sites(s), & - upfreq_in=1) - end do + if(fates_hist_dense_level(2)>0) then + call fates_hist%flush_hvars(nc,upfreq_in=group_dyna_simple) + do s = 1,this%fates(nc)%nsites + call fates_hist%zero_site_hvars(this%fates(nc)%sites(s), & + upfreq_in=group_dyna_simple) + end do + if(fates_hist_dense_level(2)>1) then + call fates_hist%flush_hvars(nc,upfreq_in=group_dyna_complx) + do s = 1,this%fates(nc)%nsites + call fates_hist%zero_site_hvars(this%fates(nc)%sites(s), & + upfreq_in=group_dyna_complx) + end do + end if + end if call fates_hist%update_history_dyn( nc, & this%fates(nc)%nsites, & this%fates(nc)%sites, & @@ -2136,18 +2145,25 @@ subroutine init_coldstart(this, waterstatebulk_inst, waterdiagnosticbulk_inst, & ! ------------------------------------------------------------------------ ! Update history IO fields that depend on ecosystem dynamics ! ------------------------------------------------------------------------ - call fates_hist%flush_hvars(nc,upfreq_in=1) - do s = 1,this%fates(nc)%nsites - call fates_hist%zero_site_hvars(this%fates(nc)%sites(s), & - upfreq_in=1) - end do - call fates_hist%update_history_dyn( nc, & + if(fates_hist_dense_level(2)>0) then + call fates_hist%flush_hvars(nc,upfreq_in=group_dyna_simple) + do s = 1,this%fates(nc)%nsites + call fates_hist%zero_site_hvars(this%fates(nc)%sites(s), & + upfreq_in=group_dyna_simple) + end do + if(fates_hist_dense_level(2)>1) then + call fates_hist%flush_hvars(nc,upfreq_in=group_dyna_complx) + do s = 1,this%fates(nc)%nsites + call fates_hist%zero_site_hvars(this%fates(nc)%sites(s), & + upfreq_in=group_dyna_complx) + end do + end if + end if + call fates_hist%update_history_dyn( nc, & this%fates(nc)%nsites, & this%fates(nc)%sites, & this%fates(nc)%bc_in) - - end if end do !$OMP END PARALLEL DO @@ -2954,6 +2970,7 @@ subroutine wrap_update_hifrq_hist(this, bounds_clump, & this%fates(nc)%nsites, & this%fates(nc)%sites, & this%fates(nc)%bc_in, & + this%fates(nc)%bc_out, & dtime) end associate From 12bd83726f3cc487763419eb01641ab78704ab4a Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Fri, 26 Jan 2024 10:36:03 -0700 Subject: [PATCH 17/34] Changed default namelist density to level 2, which preserves b4b --- bld/namelist_files/namelist_defaults_ctsm.xml | 2 +- src/utils/clmfates_interfaceMod.F90 | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index d9cf902452..6548c2d8ba 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2786,7 +2786,7 @@ use_crop=".true.">lnd/clm2/surfdata_map/ctsm5.1.dev052/landuse.timeseries_mpasa1 .false. 1 0 -1,1 +2,2 .true. .false. .true. diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index efa4a11374..48b4b26b15 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -408,6 +408,7 @@ subroutine CLMFatesGlobals2() call set_fates_ctrlparms('parteh_mode',ival=fates_parteh_mode) call set_fates_ctrlparms('seeddisp_cadence',ival=fates_seeddisp_cadence) + call set_fates_ctrlparms('hist_hifrq_dense_level',ival=fates_hist_dense_level(1)) call set_fates_ctrlparms('hist_dynam_dense_level',ival=fates_hist_dense_level(2)) From 70c1bba63d6d72d6fe87a4974f3cbd3b264ecd9f Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Tue, 30 Jan 2024 10:38:53 -0700 Subject: [PATCH 18/34] bcasting fates history density level --- src/main/controlMod.F90 | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index 4e4c41f7bd..0902eb8a0a 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -797,6 +797,7 @@ subroutine control_spmd() call mpi_bcast (fluh_timeseries, len(fluh_timeseries) , MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (fates_parteh_mode, 1, MPI_INTEGER, 0, mpicom, ier) call mpi_bcast (fates_seeddisp_cadence, 1, MPI_INTEGER, 0, mpicom, ier) + call mpi_bcast (fates_hist_dense_level, 2, MPI_INTEGER, 0, mpicom, ier) ! flexibleCN nitrogen model call mpi_bcast (use_flexibleCN, 1, MPI_LOGICAL, 0, mpicom, ier) From 37fd624d57599694be25f849f29c31dc9578f023 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Wed, 31 Jan 2024 10:15:20 -0700 Subject: [PATCH 19/34] Setting fates hist density default to 2 until we roll out new tests --- src/main/clm_varctl.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index 96719109c8..dd87c4e871 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -332,7 +332,7 @@ module clm_varctl ! 2 - include only output with only 1 additional dimension ! 3 - include all multiplexed dimensions - integer, dimension(2), public :: fates_hist_dense_level = (/1,1/) + integer, dimension(2), public :: fates_hist_dense_level = (/2,2/) logical, public :: use_fates_luh = .false. ! true => use FATES landuse data mode character(len=256), public :: fluh_timeseries = '' ! filename for fates landuse timeseries data From 9880f89afdd12d42e2016887af740fceccbec84d Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Tue, 13 Feb 2024 14:09:44 -0700 Subject: [PATCH 20/34] update allvars --- .../clm/FatesColdAllVars/user_nl_clm | 122 ++++++++---------- 1 file changed, 51 insertions(+), 71 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdAllVars/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdAllVars/user_nl_clm index 7f5ece27c8..3b8e9a12cc 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdAllVars/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdAllVars/user_nl_clm @@ -4,74 +4,54 @@ hist_nhtfrq = -24 hist_empty_htapes = .false. fates_spitfire_mode = 1 hist_ndens = 1 -hist_fincl1 = 'FATES_CROWNAREA_PF', 'FATES_CANOPYCROWNAREA_PF', -'FATES_NCL_AP', 'FATES_NPATCH_AP', 'FATES_VEGC_AP', -'FATES_SECONDARY_FOREST_FRACTION', 'FATES_WOOD_PRODUCT', -'FATES_SECONDARY_FOREST_VEGC', 'FATES_SECONDAREA_ANTHRODIST_AP', -'FATES_SECONDAREA_DIST_AP', 'FATES_STOMATAL_COND_AP', 'FATES_LBLAYER_COND_AP', -'FATES_NPP_AP', 'FATES_GPP_AP', 'FATES_PARSUN_Z_CLLL', 'FATES_PARSHA_Z_CLLL', -'FATES_PARSUN_Z_CLLLPF', 'FATES_PARSHA_Z_CLLLPF', 'FATES_PARSUN_Z_CL', -'FATES_PARSHA_Z_CL', 'FATES_LAISUN_Z_CLLL', 'FATES_LAISHA_Z_CLLL', -'FATES_LAISUN_Z_CLLLPF', 'FATES_LAISHA_Z_CLLLPF', 'FATES_LAISUN_TOP_CL', -'FATES_LAISHA_TOP_CL', 'FATES_FABD_SUN_CLLLPF', 'FATES_FABD_SHA_CLLLPF', -'FATES_FABI_SUN_CLLLPF', 'FATES_FABI_SHA_CLLLPF', 'FATES_FABD_SUN_CLLL', -'FATES_FABD_SHA_CLLL', 'FATES_FABI_SUN_CLLL', 'FATES_FABI_SHA_CLLL', -'FATES_PARPROF_DIR_CLLLPF', 'FATES_PARPROF_DIF_CLLLPF', -'FATES_FABD_SUN_TOPLF_CL', -'FATES_FABD_SHA_TOPLF_CL', 'FATES_FABI_SUN_TOPLF_CL', 'FATES_FABI_SHA_TOPLF_CL', -'FATES_NET_C_UPTAKE_CLLL', 'FATES_CROWNAREA_CLLL', 'FATES_NPLANT_CANOPY_SZAP', -'FATES_NPLANT_USTORY_SZAP', 'FATES_DDBH_CANOPY_SZAP', 'FATES_DDBH_USTORY_SZAP', -'FATES_MORTALITY_CANOPY_SZAP', 'FATES_MORTALITY_USTORY_SZAP', -'FATES_NPLANT_SZAPPF', 'FATES_NPP_APPF', 'FATES_VEGC_APPF', 'FATES_GPP_SZPF', -'FATES_GPP_CANOPY_SZPF', 'FATES_AUTORESP_CANOPY_SZPF', 'FATES_GPP_USTORY_SZPF', -'FATES_AUTORESP_USTORY_SZPF', 'FATES_NPP_SZPF', 'FATES_LEAF_ALLOC_SZPF', -'FATES_SEED_ALLOC_SZPF', 'FATES_FROOT_ALLOC_SZPF', 'FATES_BGSAPWOOD_ALLOC_SZPF', -'FATES_BGSTRUCT_ALLOC_SZPF', 'FATES_AGSAPWOOD_ALLOC_SZPF', -'FATES_AGSTRUCT_ALLOC_SZPF', 'FATES_STORE_ALLOC_SZPF', 'FATES_DDBH_SZPF', -'FATES_GROWTHFLUX_SZPF', 'FATES_GROWTHFLUX_FUSION_SZPF', -'FATES_DDBH_CANOPY_SZPF', 'FATES_DDBH_USTORY_SZPF', 'FATES_BASALAREA_SZPF', -'FATES_VEGC_ABOVEGROUND_SZPF', 'FATES_NPLANT_SZPF', 'FATES_NPLANT_ACPF', -'FATES_MORTALITY_BACKGROUND_SZPF', 'FATES_MORTALITY_HYDRAULIC_SZPF', -'FATES_MORTALITY_CSTARV_SZPF', 'FATES_MORTALITY_IMPACT_SZPF', -'FATES_MORTALITY_FIRE_SZPF', 'FATES_MORTALITY_CROWNSCORCH_SZPF', -'FATES_MORTALITY_CAMBIALBURN_SZPF', 'FATES_MORTALITY_TERMINATION_SZPF', -'FATES_MORTALITY_LOGGING_SZPF', 'FATES_MORTALITY_FREEZING_SZPF', -'FATES_MORTALITY_SENESCENCE_SZPF', 'FATES_MORTALITY_AGESCEN_SZPF', -'FATES_MORTALITY_AGESCEN_ACPF', 'FATES_MORTALITY_CANOPY_SZPF', -'FATES_STOREC_CANOPY_SZPF', 'FATES_LEAFC_CANOPY_SZPF', -'FATES_NPLANT_CANOPY_SZPF', 'FATES_MORTALITY_USTORY_SZPF', -'FATES_STOREC_USTORY_SZPF', 'FATES_LEAFC_USTORY_SZPF', -'FATES_NPLANT_USTORY_SZPF', 'FATES_CWD_ABOVEGROUND_DC', -'FATES_CWD_BELOWGROUND_DC', 'FATES_CWD_ABOVEGROUND_IN_DC', -'FATES_CWD_BELOWGROUND_IN_DC', 'FATES_CWD_ABOVEGROUND_OUT_DC', -'FATES_CWD_BELOWGROUND_OUT_DC', 'FATES_AUTORESP_SZPF', 'FATES_GROWAR_SZPF', -'FATES_MAINTAR_SZPF', 'FATES_RDARK_SZPF', 'FATES_AGSAPMAINTAR_SZPF', -'FATES_BGSAPMAINTAR_SZPF', 'FATES_FROOTMAINTAR_SZPF', -'FATES_YESTCANLEV_CANOPY_SZ', 'FATES_YESTCANLEV_USTORY_SZ', -'FATES_VEGC_SZ', 'FATES_DEMOTION_RATE_SZ', 'FATES_PROMOTION_RATE_SZ', -'FATES_SAI_CANOPY_SZ', 'FATES_SAI_USTORY_SZ', 'FATES_NPP_CANOPY_SZ', -'FATES_NPP_USTORY_SZ', 'FATES_TRIMMING_CANOPY_SZ', 'FATES_TRIMMING_USTORY_SZ', -'FATES_CROWNAREA_CANOPY_SZ', 'FATES_CROWNAREA_USTORY_SZ', -'FATES_LEAFCTURN_CANOPY_SZ', 'FATES_FROOTCTURN_CANOPY_SZ', -'FATES_STORECTURN_CANOPY_SZ', 'FATES_STRUCTCTURN_CANOPY_SZ', -'FATES_SAPWOODCTURN_CANOPY_SZ', 'FATES_SEED_PROD_CANOPY_SZ', -'FATES_LEAF_ALLOC_CANOPY_SZ', 'FATES_FROOT_ALLOC_CANOPY_SZ', -'FATES_SAPWOOD_ALLOC_CANOPY_SZ', 'FATES_STRUCT_ALLOC_CANOPY_SZ', -'FATES_SEED_ALLOC_CANOPY_SZ', 'FATES_STORE_ALLOC_CANOPY_SZ', -'FATES_RDARK_CANOPY_SZ', 'FATES_LSTEMMAINTAR_CANOPY_SZ', -'FATES_CROOTMAINTAR_CANOPY_SZ', 'FATES_FROOTMAINTAR_CANOPY_SZ', -'FATES_GROWAR_CANOPY_SZ', 'FATES_MAINTAR_CANOPY_SZ', -'FATES_LEAFCTURN_USTORY_SZ', 'FATES_FROOTCTURN_USTORY_SZ', -'FATES_STORECTURN_USTORY_SZ', 'FATES_STRUCTCTURN_USTORY_SZ', -'FATES_SAPWOODCTURN_USTORY_SZ', 'FATES_SEED_PROD_USTORY_SZ', -'FATES_LEAF_ALLOC_USTORY_SZ', 'FATES_FROOT_ALLOC_USTORY_SZ', -'FATES_SAPWOOD_ALLOC_USTORY_SZ', 'FATES_STRUCT_ALLOC_USTORY_SZ', -'FATES_SEED_ALLOC_USTORY_SZ', 'FATES_STORE_ALLOC_USTORY_SZ', -'FATES_RDARK_USTORY_SZ', 'FATES_LSTEMMAINTAR_USTORY_SZ', -'FATES_CROOTMAINTAR_USTORY_SZ', 'FATES_FROOTMAINTAR_USTORY_SZ', -'FATES_GROWAR_USTORY_SZ', 'FATES_MAINTAR_USTORY_SZ', 'FATES_VEGC_SZPF', -'FATES_LEAFC_SZPF', 'FATES_FROOTC_SZPF', 'FATES_SAPWOODC_SZPF', -'FATES_STOREC_SZPF', 'FATES_REPROC_SZPF', 'FATES_DROUGHT_STATUS_PF', -'FATES_DAYSINCE_DROUGHTLEAFOFF_PF', 'FATES_DAYSINCE_DROUGHTLEAFON_PF', -'FATES_MEANLIQVOL_DROUGHTPHEN_PF', 'FATES_MEANSMP_DROUGHTPHEN_PF', -'FATES_ELONG_FACTOR_PF' +hist_fincl1 = 'FATES_TLONGTERM', +'FATES_TGROWTH','FATES_SEEDS_IN_GRIDCELL_PF','FATES_SEEDS_OUT_GRIDCELL_PF','FATES_NCL_AP', +'FATES_NPATCH_AP','FATES_VEGC_AP','FATES_SECONDAREA_ANTHRODIST_AP','FATES_SECONDAREA_DIST_AP', +'FATES_FUEL_AMOUNT_APFC','FATES_STOREC_TF_USTORY_SZPF','FATES_STOREC_TF_CANOPY_SZPF', +'FATES_CROWNAREA_CLLL','FATES_ABOVEGROUND_MORT_SZPF', +'FATES_ABOVEGROUND_PROD_SZPF','FATES_NPLANT_SZAP','FATES_NPLANT_CANOPY_SZAP', +'FATES_NPLANT_USTORY_SZAP','FATES_DDBH_CANOPY_SZAP','FATES_DDBH_USTORY_SZAP', +'FATES_MORTALITY_CANOPY_SZAP','FATES_MORTALITY_USTORY_SZAP','FATES_NPLANT_SZAPPF', +'FATES_NPP_APPF','FATES_VEGC_APPF','FATES_SCORCH_HEIGHT_APPF','FATES_GPP_SZPF', +'FATES_GPP_CANOPY_SZPF','FATES_AUTORESP_CANOPY_SZPF','FATES_GPP_USTORY_SZPF', +'FATES_AUTORESP_USTORY_SZPF','FATES_NPP_SZPF','FATES_LEAF_ALLOC_SZPF', +'FATES_SEED_ALLOC_SZPF','FATES_FROOT_ALLOC_SZPF','FATES_BGSAPWOOD_ALLOC_SZPF', +'FATES_BGSTRUCT_ALLOC_SZPF','FATES_AGSAPWOOD_ALLOC_SZPF','FATES_AGSTRUCT_ALLOC_SZPF', +'FATES_STORE_ALLOC_SZPF','FATES_DDBH_SZPF','FATES_GROWTHFLUX_SZPF','FATES_GROWTHFLUX_FUSION_SZPF', +'FATES_DDBH_CANOPY_SZPF','FATES_DDBH_USTORY_SZPF','FATES_BASALAREA_SZPF','FATES_VEGC_ABOVEGROUND_SZPF', +'FATES_NPLANT_SZPF','FATES_NPLANT_ACPF','FATES_MORTALITY_BACKGROUND_SZPF','FATES_MORTALITY_HYDRAULIC_SZPF', +'FATES_MORTALITY_CSTARV_SZPF','FATES_MORTALITY_IMPACT_SZPF','FATES_MORTALITY_FIRE_SZPF', +'FATES_MORTALITY_CROWNSCORCH_SZPF','FATES_MORTALITY_CAMBIALBURN_SZPF','FATES_MORTALITY_TERMINATION_SZPF', +'FATES_MORTALITY_LOGGING_SZPF','FATES_MORTALITY_FREEZING_SZPF','FATES_MORTALITY_SENESCENCE_SZPF', +'FATES_MORTALITY_AGESCEN_SZPF','FATES_MORTALITY_AGESCEN_ACPF','FATES_MORTALITY_CANOPY_SZPF', +'FATES_M3_MORTALITY_CANOPY_SZPF','FATES_M3_MORTALITY_USTORY_SZPF','FATES_C13DISC_SZPF', +'FATES_STOREC_CANOPY_SZPF','FATES_LEAFC_CANOPY_SZPF','FATES_LAI_CANOPY_SZPF','FATES_CROWNAREA_CANOPY_SZPF', +'FATES_CROWNAREA_USTORY_SZPF','FATES_NPLANT_CANOPY_SZPF','FATES_MORTALITY_USTORY_SZPF','FATES_STOREC_USTORY_SZPF', +'FATES_LEAFC_USTORY_SZPF','FATES_LAI_USTORY_SZPF','FATES_NPLANT_USTORY_SZPF','FATES_CWD_ABOVEGROUND_DC', +'FATES_CWD_BELOWGROUND_DC','FATES_CWD_ABOVEGROUND_IN_DC','FATES_CWD_BELOWGROUND_IN_DC', +'FATES_CWD_ABOVEGROUND_OUT_DC','FATES_CWD_BELOWGROUND_OUT_DC','FATES_YESTCANLEV_CANOPY_SZ', +'FATES_YESTCANLEV_USTORY_SZ','FATES_VEGC_SZ','FATES_DEMOTION_RATE_SZ','FATES_PROMOTION_RATE_SZ', +'FATES_SAI_CANOPY_SZ','FATES_M3_MORTALITY_CANOPY_SZ','FATES_M3_MORTALITY_USTORY_SZ','FATES_SAI_USTORY_SZ', +'FATES_NPP_CANOPY_SZ','FATES_NPP_USTORY_SZ','FATES_TRIMMING_CANOPY_SZ','FATES_TRIMMING_USTORY_SZ', +'FATES_CROWNAREA_CANOPY_SZ','FATES_CROWNAREA_USTORY_SZ','FATES_LEAFCTURN_CANOPY_SZ','FATES_FROOTCTURN_CANOPY_SZ', +'FATES_STORECTURN_CANOPY_SZ','FATES_STRUCTCTURN_CANOPY_SZ','FATES_SAPWOODCTURN_CANOPY_SZ','FATES_SEED_PROD_CANOPY_SZ', +'FATES_LEAF_ALLOC_CANOPY_SZ','FATES_FROOT_ALLOC_CANOPY_SZ','FATES_SAPWOOD_ALLOC_CANOPY_SZ','FATES_STRUCT_ALLOC_CANOPY_SZ', +'FATES_SEED_ALLOC_CANOPY_SZ','FATES_STORE_ALLOC_CANOPY_SZ','FATES_LEAFCTURN_USTORY_SZ','FATES_FROOTCTURN_USTORY_SZ', +'FATES_STORECTURN_USTORY_SZ','FATES_STRUCTCTURN_USTORY_SZ','FATES_SAPWOODCTURN_USTORY_SZ', +'FATES_SEED_PROD_USTORY_SZ','FATES_LEAF_ALLOC_USTORY_SZ','FATES_FROOT_ALLOC_USTORY_SZ','FATES_SAPWOOD_ALLOC_USTORY_SZ', +'FATES_STRUCT_ALLOC_USTORY_SZ','FATES_SEED_ALLOC_USTORY_SZ','FATES_STORE_ALLOC_USTORY_SZ','FATES_CROWNAREA_CANOPY_CD', +'FATES_CROWNAREA_USTORY_CD','FATES_NPLANT_CDPF','FATES_NPLANT_CANOPY_CDPF','FATES_NPLANT_USTORY_CDPF', +'FATES_M3_CDPF','FATES_M11_SZPF','FATES_M11_CDPF','FATES_MORTALITY_CDPF','FATES_M3_MORTALITY_CANOPY_CDPF', +'FATES_M3_MORTALITY_USTORY_CDPF','FATES_M11_MORTALITY_CANOPY_CDPF','FATES_M11_MORTALITY_USTORY_CDPF', +'FATES_MORTALITY_CANOPY_CDPF','FATES_MORTALITY_USTORY_CDPF','FATES_DDBH_CDPF','FATES_DDBH_CANOPY_CDPF', +'FATES_DDBH_USTORY_CDPF','FATES_VEGC_SZPF','FATES_LEAFC_SZPF','FATES_FROOTC_SZPF','FATES_SAPWOODC_SZPF', +'FATES_STOREC_SZPF','FATES_REPROC_SZPF','FATES_NPP_AP','FATES_GPP_AP','FATES_RDARK_USTORY_SZ', +'FATES_LSTEMMAINTAR_USTORY_SZ','FATES_CROOTMAINTAR_USTORY_SZ','FATES_FROOTMAINTAR_USTORY_SZ','FATES_GROWAR_USTORY_SZ', +'FATES_MAINTAR_USTORY_SZ','FATES_RDARK_CANOPY_SZ','FATES_CROOTMAINTAR_CANOPY_SZ','FATES_FROOTMAINTAR_CANOPY_SZ', +'FATES_GROWAR_CANOPY_SZ','FATES_MAINTAR_CANOPY_SZ','FATES_LSTEMMAINTAR_CANOPY_SZ','FATES_AUTORESP_SZPF', +'FATES_GROWAR_SZPF','FATES_MAINTAR_SZPF','FATES_RDARK_SZPF','FATES_AGSAPMAINTAR_SZPF','FATES_BGSAPMAINTAR_SZPF', +'FATES_FROOTMAINTAR_SZPF','FATES_PARSUN_CLLL','FATES_PARSHA_CLLL','FATES_PARSUN_CLLLPF','FATES_PARSHA_CLLLPF', +'FATES_PARSUN_CL','FATES_PARSHA_CL','FATES_LAISUN_CLLL','FATES_LAISHA_CLLL','FATES_LAISUN_CLLLPF', +'FATES_LAISHA_CLLLPF','FATES_PARPROF_DIR_CLLLPF','FATES_PARPROF_DIF_CLLLPF','FATES_LAISUN_CL','FATES_LAISHA_CL', +'FATES_PARPROF_DIR_CLLL','FATES_PARPROF_DIF_CLLL','FATES_NET_C_UPTAKE_CLLL','FATES_CROWNFRAC_CLLLPF', +'FATES_LBLAYER_COND_AP','FATES_STOMATAL_COND_AP' From eaa2d0438390a765d3f05e3475f7a4a32f94521e Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Wed, 28 Feb 2024 12:39:02 -0500 Subject: [PATCH 21/34] Updated namelist naming convention: from density to dimension for fates_history_dimlevel --- bld/CLMBuildNamelist.pm | 4 ++-- bld/namelist_files/namelist_defaults_ctsm.xml | 2 +- .../namelist_definition_ctsm.xml | 2 +- src/main/clm_varctl.F90 | 11 +++++----- src/main/controlMod.F90 | 4 ++-- src/utils/clmfates_interfaceMod.F90 | 20 +++++++++---------- 6 files changed, 21 insertions(+), 22 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 45dc4f0559..b4eefd984c 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -784,7 +784,7 @@ sub setup_cmdl_fates_mode { my @list = ( "fates_spitfire_mode", "use_fates_planthydro", "use_fates_ed_st3", "use_fates_ed_prescribed_phys", "use_fates_cohort_age_tracking","use_fates_inventory_init","use_fates_fixed_biogeog", "use_fates_nocomp","use_fates_sp","fates_inventory_ctrl_filename","use_fates_logging", - "fates_parteh_mode","use_fates_tree_damage","fates_hist_dense_level","fates_seeddisp_cadence", + "fates_parteh_mode","use_fates_tree_damage","fates_history_dimlevel","fates_seeddisp_cadence", "use_fates_luh","fluh_timeseries" ); # dis-allow fates specific namelist items with non-fates runs foreach my $var ( @list ) { @@ -4440,7 +4440,7 @@ sub setup_logic_fates { my @list = ( "fates_spitfire_mode", "use_fates_planthydro", "use_fates_ed_st3", "use_fates_ed_prescribed_phys", "use_fates_inventory_init","use_fates_fixed_biogeog","use_fates_nocomp","fates_seeddisp_cadence", "use_fates_logging","fates_parteh_mode", "use_fates_cohort_age_tracking","use_fates_tree_damage", - "use_fates_luh","fates_hist_dense_level" ); + "use_fates_luh","fates_history_dimlevel" ); foreach my $var ( @list ) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'use_fates'=>$nl_flags->{'use_fates'}, 'use_fates_sp'=>$nl_flags->{'use_fates_sp'} ); diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 6548c2d8ba..6c4ff7e11a 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2786,7 +2786,7 @@ use_crop=".true.">lnd/clm2/surfdata_map/ctsm5.1.dev052/landuse.timeseries_mpasa1 .false. 1 0 -2,2 +2,2 .true. .false. .true. diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index c9f83296b7..8b292294c9 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -777,7 +777,7 @@ Full pathname to the inventory initialization control file. (Only relevant if FATES is on). - Setting for what types of FATES history to be allocate and calculated at the dynamics timestep (1st integer) and the diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index dd87c4e871..267c425d7d 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -320,19 +320,18 @@ module clm_varctl logical, public :: use_fates_fixed_biogeog = .false. ! true => use fixed biogeography mode logical, public :: use_fates_nocomp = .false. ! true => use no comopetition mode - ! FATES history density level + ! FATES history dimension level ! fates can produce history at either the daily timescale (dynamics) ! and the model step timescale. It can also generate output on the extra dimension - ! Performing this output can be expensive, so we allow different history density + ! Performing this output can be expensive, so we allow different history dimension ! levels. ! The first index is output at the model timescale ! The second index is output at the dynamics (daily) timescale ! 0 - no output - ! 1 - include only column level means - ! 2 - include only output with only 1 additional dimension - ! 3 - include all multiplexed dimensions + ! 1 - include only column level means (3D) + ! 2 - include output that includes the 4th dimension - integer, dimension(2), public :: fates_hist_dense_level = (/2,2/) + integer, dimension(2), public :: fates_history_dimlevel = (/2,2/) logical, public :: use_fates_luh = .false. ! true => use FATES landuse data mode character(len=256), public :: fluh_timeseries = '' ! filename for fates landuse timeseries data diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index 0902eb8a0a..2e3f493bf7 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -235,7 +235,7 @@ subroutine control_init(dtime) fates_inventory_ctrl_filename, & fates_parteh_mode, & fates_seeddisp_cadence, & - use_fates_tree_damage, fates_hist_dense_level + use_fates_tree_damage, fates_history_dimlevel ! Ozone vegetation stress method namelist / clm_inparm / o3_veg_stress_method @@ -797,7 +797,7 @@ subroutine control_spmd() call mpi_bcast (fluh_timeseries, len(fluh_timeseries) , MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (fates_parteh_mode, 1, MPI_INTEGER, 0, mpicom, ier) call mpi_bcast (fates_seeddisp_cadence, 1, MPI_INTEGER, 0, mpicom, ier) - call mpi_bcast (fates_hist_dense_level, 2, MPI_INTEGER, 0, mpicom, ier) + call mpi_bcast (fates_history_dimlevel, 2, MPI_INTEGER, 0, mpicom, ier) ! flexibleCN nitrogen model call mpi_bcast (use_flexibleCN, 1, MPI_LOGICAL, 0, mpicom, ier) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 48b4b26b15..748038a1df 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -64,7 +64,7 @@ module CLMFatesInterfaceMod use clm_varctl , only : fates_inventory_ctrl_filename use clm_varctl , only : use_nitrif_denitrif use clm_varctl , only : use_lch4 - use clm_varctl , only : fates_hist_dense_level + use clm_varctl , only : fates_history_dimlevel use clm_varcon , only : tfrz use clm_varcon , only : spval use clm_varcon , only : denice @@ -409,8 +409,8 @@ subroutine CLMFatesGlobals2() call set_fates_ctrlparms('seeddisp_cadence',ival=fates_seeddisp_cadence) - call set_fates_ctrlparms('hist_hifrq_dense_level',ival=fates_hist_dense_level(1)) - call set_fates_ctrlparms('hist_dynam_dense_level',ival=fates_hist_dense_level(2)) + call set_fates_ctrlparms('hist_hifrq_dimlevel',ival=fates_history_dimlevel(1)) + call set_fates_ctrlparms('hist_dynam_dimlevel',ival=fates_history_dimlevel(2)) ! CTSM-FATES is not fully coupled (yet) ! So lets tell fates to use the RD competition mechanism @@ -627,10 +627,10 @@ subroutine CrossRefHistoryFields write(iulog,*) 'not found in the list of fates_hist%hvars.' write(iulog,*) 'Most likely, this is because this history variable' write(iulog,*) 'was specified in the user namelist, but the user' - write(iulog,*) 'specified a FATES history output density level' + write(iulog,*) 'specified a FATES history output dimension level' write(iulog,*) 'that does not contain that variable in its valid set.' - write(iulog,*) 'You may have to increase the namelist setting: fates_hist_dense_level' - write(iulog,*) 'current fates_hist_dens_level: ',hlm_hist_dense_level + write(iulog,*) 'You may have to increase the namelist setting: fates_history_dimlevel' + write(iulog,*) 'current fates_history_dimlevel: ',fates_history_dimlevel(:) call endrun(msg=errMsg(sourcefile, __LINE__)) end if end if @@ -1953,13 +1953,13 @@ subroutine restart( this, bounds_proc, ncid, flag, waterdiagnosticbulk_inst, & ! ------------------------------------------------------------------------ ! Update history IO fields that depend on ecosystem dynamics ! ------------------------------------------------------------------------ - if(fates_hist_dense_level(2)>0) then + if(fates_history_dimlevel(2)>0) then call fates_hist%flush_hvars(nc,upfreq_in=group_dyna_simple) do s = 1,this%fates(nc)%nsites call fates_hist%zero_site_hvars(this%fates(nc)%sites(s), & upfreq_in=group_dyna_simple) end do - if(fates_hist_dense_level(2)>1) then + if(fates_history_dimlevel(2)>1) then call fates_hist%flush_hvars(nc,upfreq_in=group_dyna_complx) do s = 1,this%fates(nc)%nsites call fates_hist%zero_site_hvars(this%fates(nc)%sites(s), & @@ -2146,13 +2146,13 @@ subroutine init_coldstart(this, waterstatebulk_inst, waterdiagnosticbulk_inst, & ! ------------------------------------------------------------------------ ! Update history IO fields that depend on ecosystem dynamics ! ------------------------------------------------------------------------ - if(fates_hist_dense_level(2)>0) then + if(fates_history_dimlevel(2)>0) then call fates_hist%flush_hvars(nc,upfreq_in=group_dyna_simple) do s = 1,this%fates(nc)%nsites call fates_hist%zero_site_hvars(this%fates(nc)%sites(s), & upfreq_in=group_dyna_simple) end do - if(fates_hist_dense_level(2)>1) then + if(fates_history_dimlevel(2)>1) then call fates_hist%flush_hvars(nc,upfreq_in=group_dyna_complx) do s = 1,this%fates(nc)%nsites call fates_hist%zero_site_hvars(this%fates(nc)%sites(s), & From 161ca0a69e516f93b1ca195f073f60ba9cb106b3 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Thu, 7 Mar 2024 09:51:55 -0700 Subject: [PATCH 22/34] subtle updates to namelist reading and testing --- .../testdefs/testmods_dirs/clm/FatesColdAllVars/user_nl_clm | 2 ++ src/main/controlMod.F90 | 3 ++- src/utils/clmfates_interfaceMod.F90 | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdAllVars/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdAllVars/user_nl_clm index 3b8e9a12cc..a426c775b0 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdAllVars/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdAllVars/user_nl_clm @@ -3,6 +3,8 @@ hist_mfilt = 365 hist_nhtfrq = -24 hist_empty_htapes = .false. fates_spitfire_mode = 1 +fates_history_dimlevel = 2,2 +use_fates_tree_damage = .true. hist_ndens = 1 hist_fincl1 = 'FATES_TLONGTERM', 'FATES_TGROWTH','FATES_SEEDS_IN_GRIDCELL_PF','FATES_SEEDS_OUT_GRIDCELL_PF','FATES_NCL_AP', diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index 2e3f493bf7..a5da9c3082 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -235,7 +235,8 @@ subroutine control_init(dtime) fates_inventory_ctrl_filename, & fates_parteh_mode, & fates_seeddisp_cadence, & - use_fates_tree_damage, fates_history_dimlevel + use_fates_tree_damage, & + fates_history_dimlevel ! Ozone vegetation stress method namelist / clm_inparm / o3_veg_stress_method diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 748038a1df..2bdbf27e5e 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -631,6 +631,10 @@ subroutine CrossRefHistoryFields write(iulog,*) 'that does not contain that variable in its valid set.' write(iulog,*) 'You may have to increase the namelist setting: fates_history_dimlevel' write(iulog,*) 'current fates_history_dimlevel: ',fates_history_dimlevel(:) + !uncomment if you want to list all fates history variables in registry + !do_fates_hist2: do nh = 1,fates_hist%num_history_vars() + ! write(iulog,*) trim(fates_hist%hvars(nh)%vname) + !end do do_fates_hist2 call endrun(msg=errMsg(sourcefile, __LINE__)) end if end if From fff02babdb9644d346a84a1e7462961a5c0d5cb1 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Tue, 5 Mar 2024 15:16:32 -0700 Subject: [PATCH 23/34] updating external --- Externals_CLM.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index 0c6fc55262..df122d2c12 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -2,7 +2,7 @@ local_path = src/fates protocol = git repo_url = https://github.com/NGEET/fates -branch = unsupported_sp_calibration +tag = sci.1.72.0_api.33.0.0 required = True [externals_description] From d2c83f48b8ba6c1bd7ccdedd12595479d2aadae8 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Wed, 13 Mar 2024 10:54:09 -0600 Subject: [PATCH 24/34] Updated change logs and externals for history dim level --- Externals_CLM.cfg | 4 +-- doc/ChangeLog | 84 ++++++++++++++--------------------------------- doc/ChangeSum | 4 +-- 3 files changed, 28 insertions(+), 64 deletions(-) diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index df122d2c12..69d13ca73b 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -1,8 +1,8 @@ [fates] local_path = src/fates protocol = git -repo_url = https://github.com/NGEET/fates -tag = sci.1.72.0_api.33.0.0 +repo_url = https://github.com/rgknox/fates +tag = sci.1.72.2_api.34.0.0 required = True [externals_description] diff --git a/doc/ChangeLog b/doc/ChangeLog index 380580df86..f29f055025 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,95 +1,59 @@ =============================================================== Tag name: ctsm5.1.dev173 -Originator(s): olyson (Keith Oleson,UCAR/TSS) -Date: Thu 07 Mar 2024 12:07:43 PM MST -One-line Summary: Improve vegetation health at high latitudes +Originator(s): rgknox (Ryan Knox,LAWRENCE BERKELEY NATIONAL LABORATORY) +Date: Wed 13 Mar 2024 10:42:26 AM MDT +One-line Summary: New FATES namelist variable, fates_history_dimlevel Purpose and description of changes ---------------------------------- - -The corresponding changes: - -Remove snicar_snobc_intmix from EXPERIMENTAL endrun (allow it to be true) -Remove flg_snoage_scl in SNICAR such that xdrdt can have an effect (fixes #2298 ) -New parameter file and namelist values for clm5_1: - -- snow_thermal_cond_method = Sturm1997 (default for clm5_1) -- snicar_snobc_intmix = .true. (default for clm5_1) -- ctsm51_params.c240208.nc is the new CTSM parameter file (changes: froot_leaf(11:12)=1.2, FUN_fracfixers(11:12)=1, xdrdt=5, scvng_fct_mlt_sf=0.5, snw_rds_refrz=1500, fresh_snw_rds_max=400) -- New history fields for coupler history verification (default off) -- Add snow5d_thresh_for_onset to parameter file, set to 0.2 for clm51 and 0.1 (unchanged) for clm50 and clm45. +This set of changes introduces a new namelist setting that allows more control over fates history diagnostics. This setting, fates_history_dimlevel accepts two integers, comma-delimited, from 0-2. The first specifies the history output dimension level for high-frequency output (ie model timestep) and the second is for output at the dynamics timestep. A value of 0 indicates no history variables should be processed. A value of 1 indicates that only site-level mean values should be processed. A value of 2 indicates that all variables, including those that use an extra dimension should be processed. This is different from adding and excluding history variable names from the namelist, in that these settings not only omit variables from the output file, but they prevent their allocations and calculations all together. Processing history diagnostics in FATES takes a non-trivial amount of time. Significant changes to scientifically-supported configurations -------------------------------------------------------------- -Does this tag change answers significantly for any of the following physics configurations? -(Details of any changes will be given in the "Answer changes" section below.) +These changes have no non-trivial impacts on any scientific configurations, this is a refactor. - [Put an [X] in the box for any configuration with significant answer changes.] - -[X] clm5_1 +Bugs fixed +---------- -[ ] clm5_0 +No bugs fixed, feature addition only. -[ ] ctsm5_0-nwp +Notes of particular relevance for users +--------------------------------------- -[ ] clm4_5 +Users should be aware of the new namelist setting fates_history_dimlevel. Omitting this setting will default to a level of "2" which enables all output and should maintain existing model behavior. +Substantial timing or memory changes: The FATES model is somewhere on the order of 10% faster for level 0 and 1, versus 2, for large gridded runs with non satellite phenology, on derecho. -Bugs fixed ----------- -CTSM issues fixed (include CTSM Issue #): -Fixes #2298 -Fixes LMWG_dev discussion #3 +Notes of particular relevance for developers: +--------------------------------------------- -Notes of particular relevance for users ---------------------------------------- -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): - New namelist defaults including new parameter files: - ctsm51_params.c240208.nc - clm50_params.c240208.nc - clm45_params.c240208.nc - ctsm51_ciso_cwd_hr_params.c240208.nc +None of note. Testing summary: ---------------- - [PASS means all tests PASS; OK means tests PASS other than expected fails.] - regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): - derecho ----- - izumi ------- + derecho ----- OK + izumi ------- OK - any other testing (give details below): - Keith Oleson replicated simulation in LMWG_dev issue #51 as bfb when - snow5d_thresh_for_onset on ctsm51_ciso_cwd_hr_params.c240208.nc was set - to original value of 0.1. + fates tests: (give name of baseline if different from CTSM tagname, normally fates baselines are fates--) + derecho ----- OK + izumi ------- OK -Answer changes --------------- -Changes answers relative to baseline: YES +If the tag used for baseline comparisons was NOT the previous tag, note that here: (used ctsm5.1.dev172) - Summarize any changes to answers, i.e., - - what code configurations: clm51 - - what platforms/compilers: all - - nature of change: new climate at high latitudes - See LMWG_dev discussion #3 and simulations discussed therein, - including (though possibly not limited to) LMWG_dev issues #51, 52, 54, 57. +Answer changes +-------------- - slevis will add this tag with the label "SIGNIFICANT" to the - Answer-changing-tags wiki: - https://github.com/ESCOMP/CTSM/wiki/Answer-changing-tags +Answer changes for FATES tests were detected. All diffs were small enough to be consistent with order of operations changes, with the exception of some variables that were updated to have ignore values used for non-vegetated patches instead of zero. -Other details -------------- -Pull Requests that document the changes (include PR ids): - https://github.com/ESCOMP/ctsm/pull/2348 =============================================================== =============================================================== diff --git a/doc/ChangeSum b/doc/ChangeSum index d1a3ff1a5f..a81856c8c5 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,7 +1,7 @@ Tag Who Date Summary ============================================================================================================================ - ctsm5.1.dev173 olyson 03/07/2024 Improve vegetation health at high latitudes - ctsm5.1.dev171 olyson 03/01/2024 Set initial t_soisno=272 for soils and 274K for urban road + ctsm5.1.dev173 rgknox 03/13/2024 New FATES namelist variable: fates_history_dimlevel + ctsm5.1.dev171 slevis 03/01/2024 Set initial t_soisno=272 for soils and 274K for urban road ctsm5.1.dev170 samrabin 02/28/2024 Add hillslope hydrology ctsm5.1.dev169 samrabin 02/22/2024 Merge b4b-dev ctsm5.1.dev168 slevis 02/16/2024 Remove a source of negative snocan in CanopyFluxesMod From a18a764ac62aecbc4a930d56f511ec2b663dd851 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 13 Mar 2024 16:47:00 -0600 Subject: [PATCH 25/34] Update Changelog date, add some notes about python and build-namelist testing --- doc/ChangeLog | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index f29f055025..9e889a8ff7 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: ctsm5.1.dev173 Originator(s): rgknox (Ryan Knox,LAWRENCE BERKELEY NATIONAL LABORATORY) -Date: Wed 13 Mar 2024 10:42:26 AM MDT +Date: Wed 13 Mar 2024 04:46:37 PM MDT One-line Summary: New FATES namelist variable, fates_history_dimlevel Purpose and description of changes @@ -36,6 +36,14 @@ None of note. Testing summary: ---------------- + build-namelist tests (if CLMBuildNamelist.pm has changed): + + derecho - OK (64 fates tests differ) + + python testing (if python code has changed; see instructions in python/README.md; document testing done): + + derecho - PASS + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): derecho ----- OK From c5ac541538f811c29f575b2db5b868667712836c Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 14 Mar 2024 17:00:02 -0600 Subject: [PATCH 26/34] Update to ChangeLog concerning test-suite results --- doc/ChangeLog | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 9e889a8ff7..001b9e2bb6 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,100 @@ =============================================================== +Tag name: ctsm5.1.dev174 +Originator(s): olyson (Keith Oleson,UCAR/TSS) +Date: Thu 14 Mar 2024 04:56:37 PM MDT +One-line Summary: Improve vegetation health at high latitudes + +Purpose and description of changes +---------------------------------- + +The corresponding changes: + +Remove snicar_snobc_intmix from EXPERIMENTAL endrun (allow it to be true) +Remove flg_snoage_scl in SNICAR such that xdrdt can have an effect (fixes #2298 ) +New parameter file and namelist values for clm5_1: + +- snow_thermal_cond_method = Sturm1997 (default for clm5_1) +- snicar_snobc_intmix = .true. (default for clm5_1) +- ctsm51_params.c240208.nc is the new CTSM parameter file (changes: froot_leaf(11:12)=1.2, FUN_fracfixers(11:12)=1, xdrdt=5, scvng_fct_mlt_sf=0.5, snw_rds_refrz=1500, fresh_snw_rds_max=400) +- New history fields for coupler history verification (default off) +- Add snow5d_thresh_for_onset to parameter file, set to 0.2 for clm51 and 0.1 (unchanged) for clm50 and clm45. + + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? +(Details of any changes will be given in the "Answer changes" section below.) + + [Put an [X] in the box for any configuration with significant answer changes.] + +[X] clm5_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- +CTSM issues fixed (include CTSM Issue #): +Fixes #2298 +Fixes LMWG_dev discussion #3 + +New bug discovered or introduced: +Relevant post appears in #2348 on 2024/3/14 + +Notes of particular relevance for users +--------------------------------------- +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): + New namelist defaults including new parameter files: + ctsm51_params.c240208.nc + clm50_params.c240208.nc + clm45_params.c240208.nc + ctsm51_ciso_cwd_hr_params.c240208.nc + + +Testing summary: +---------------- + + [PASS means all tests PASS; OK means tests PASS other than expected fails.] + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + derecho ----- OK + izumi ------- OK + + any other testing (give details below): + Keith Oleson replicated simulation in LMWG_dev issue #51 as bfb when + snow5d_thresh_for_onset on ctsm51_ciso_cwd_hr_params.c240208.nc was set + to original value of 0.1. + +Answer changes +-------------- + +Changes answers relative to baseline: YES + + Summarize any changes to answers, i.e., + - what code configurations: clm51 + - what platforms/compilers: all + - nature of change: new climate at high latitudes + + See LMWG_dev discussion #3 and simulations discussed therein, + including (though possibly not limited to) LMWG_dev issues #51, 52, 54, 57. + + slevis will add this tag with the label "SIGNIFICANT" to the + Answer-changing-tags wiki: + https://github.com/ESCOMP/CTSM/wiki/Answer-changing-tags + +Other details +------------- +Pull Requests that document the changes (include PR ids): + https://github.com/ESCOMP/ctsm/pull/2348 + +=============================================================== +=============================================================== Tag name: ctsm5.1.dev173 Originator(s): rgknox (Ryan Knox,LAWRENCE BERKELEY NATIONAL LABORATORY) Date: Wed 13 Mar 2024 04:46:37 PM MDT From 921ae32b71032968934196770898698e3449b83c Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 14 Mar 2024 17:03:50 -0600 Subject: [PATCH 27/34] Update ChangeSum date of tag --- doc/ChangeSum | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/ChangeSum b/doc/ChangeSum index a81856c8c5..5f34618ee7 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.1.dev174 olyson 03/15/2024 Improve vegetation health at high latitudes ctsm5.1.dev173 rgknox 03/13/2024 New FATES namelist variable: fates_history_dimlevel ctsm5.1.dev171 slevis 03/01/2024 Set initial t_soisno=272 for soils and 274K for urban road ctsm5.1.dev170 samrabin 02/28/2024 Add hillslope hydrology From d9a720f26c3ada500f3deeb46126854ebbebd737 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 14 Mar 2024 17:05:42 -0600 Subject: [PATCH 28/34] Correction to last commit --- doc/ChangeSum | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ChangeSum b/doc/ChangeSum index 5f34618ee7..438a86f720 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,6 +1,6 @@ Tag Who Date Summary ============================================================================================================================ - ctsm5.1.dev174 olyson 03/15/2024 Improve vegetation health at high latitudes + ctsm5.1.dev174 olyson 03/14/2024 Improve vegetation health at high latitudes ctsm5.1.dev173 rgknox 03/13/2024 New FATES namelist variable: fates_history_dimlevel ctsm5.1.dev171 slevis 03/01/2024 Set initial t_soisno=272 for soils and 274K for urban road ctsm5.1.dev170 samrabin 02/28/2024 Add hillslope hydrology From e9a1a493ec0f57c4ebcb3943abb48fe8ea7ad452 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 20 Feb 2024 13:31:25 -0700 Subject: [PATCH 29/34] Bring in CTSM-specific hillslope Python scripts. --- python/ctsm/hillslopes/combine_chunk_files.py | 268 ++++++++++++++++ .../ctsm/hillslopes/combine_gridcell_files.py | 290 +++++++++++++++++ python/ctsm/hillslopes/loop_call.py | 49 +++ python/ctsm/hillslopes/synthetic_hillslope.py | 300 ++++++++++++++++++ 4 files changed, 907 insertions(+) create mode 100755 python/ctsm/hillslopes/combine_chunk_files.py create mode 100755 python/ctsm/hillslopes/combine_gridcell_files.py create mode 100755 python/ctsm/hillslopes/loop_call.py create mode 100755 python/ctsm/hillslopes/synthetic_hillslope.py diff --git a/python/ctsm/hillslopes/combine_chunk_files.py b/python/ctsm/hillslopes/combine_chunk_files.py new file mode 100755 index 0000000000..6a4a3ede85 --- /dev/null +++ b/python/ctsm/hillslopes/combine_chunk_files.py @@ -0,0 +1,268 @@ +#!/usr/bin/env python +# coding: utf-8 + +# Import modules + +import sys +import string +import subprocess +import copy +import argparse +import netCDF4 as netcdf4 +import numpy as np + +def check_file_permissions(ifile,addWrite=False): + command=['ls','-l',ifile] + wflag=subprocess.run(command,capture_output=True).stdout.decode().split()[0][2] + if addWrite and wflag != 'w': + command=['chmod','+w',ifile] + x=subprocess.run(command,capture_output=True) + command=['ls','-l',ifile] + p=subprocess.run(command,capture_output=True).stdout.decode().split()[0] + print('new permissions ',p) + +# ---------------------------------------------------------- # +# +# Combine chunk files into single surface data file +# +# ---------------------------------------------------------- # + +# Choose surface data file to which hillslope fields will be appended +sfcfile = '/fs/cgd/csm/inputdata/lnd/clm2/surfdata_map/surfdata_0.9x1.25_78pfts_CMIP6_simyr2000_c170824.nc' + +# Choose data files to combine and append +totalChunks = 36 +cdir = './subregion_chunk_files/' +cfile0 = cdir + 'combined_chunk_ChunkIndex_HAND_4_col_hillslope_geo_params_section_quad.nc' + +# Output file +odir = './' +outfile = odir + 'surfdata_0.9x1.25_78pfts_HAND_hillslope_geo_params_section_quad.nc' + +f = netcdf4.Dataset(sfcfile, 'r') +landmask = f.variables['PFTDATA_MASK'][:,] +f.close() + +initializeArrays = True +for n in range(totalChunks): + print(n,totalChunks) + ndx = n+1 + cstr = '{:02d}'.format(ndx) + cfile = cfile0.replace('ChunkIndex',cstr) + command=['ls',cfile] + file_exists=subprocess.run(command,capture_output=True).returncode + + if initializeArrays and file_exists==0: + f = netcdf4.Dataset(cfile, 'r') + + ncolumns_per_gridcell = len(f.dimensions['nmaxhillcol']) + nhillslope = len(f.dimensions['nhillslope']) + sjm = len(f.dimensions['lsmlat']) + sim = len(f.dimensions['lsmlon']) + + # initialize new fields to be added to surface data file + h_elev = np.zeros((ncolumns_per_gridcell,sjm,sim)) + h_dist = np.zeros((ncolumns_per_gridcell,sjm,sim)) + h_area = np.zeros((ncolumns_per_gridcell,sjm,sim)) + h_slope = np.zeros((ncolumns_per_gridcell,sjm,sim)) + h_aspect = np.zeros((ncolumns_per_gridcell,sjm,sim)) + h_width = np.zeros((ncolumns_per_gridcell,sjm,sim)) + h_pftndx = np.zeros((ncolumns_per_gridcell,sjm,sim)) + h_bedrock = np.zeros((ncolumns_per_gridcell,sjm,sim)) + h_stream_depth = np.zeros((sjm,sim)) + h_stream_width = np.zeros((sjm,sim)) + h_stream_slope = np.zeros((sjm,sim)) + + nhillcolumns = np.zeros((sjm,sim),dtype=int) + pct_hillslope = np.zeros((nhillslope,sjm,sim)) + hillslope_index = np.zeros((ncolumns_per_gridcell,sjm,sim),dtype=int) + column_index = np.zeros((ncolumns_per_gridcell,sjm,sim),dtype=int) + downhill_column_index = np.zeros((ncolumns_per_gridcell,sjm,sim),dtype=int) + + if 'hillslope_bedrock_depth' in f.variables.keys(): + addBedrock = True + else: + addBedrock = False + + if 'hillslope_stream_depth' in f.variables.keys(): + addStream = True + else: + addStream = False + + initializeArrays = False + f.close() + + if file_exists > 0: + print(cfile,' not found') + else: + f = netcdf4.Dataset(cfile, 'r') + nhillslope = len(f.dimensions['nhillslope']) + chunk_mask = f.variables['chunk_mask'][:,] + h_elev0 = f.variables['hillslope_elevation'][:,] + h_dist0 = f.variables['hillslope_distance'][:,] + h_width0 = f.variables['hillslope_width'][:,] + h_area0 = f.variables['hillslope_area'][:,] + h_slope0 = f.variables['hillslope_slope'][:,] + h_aspect0 = f.variables['hillslope_aspect'][:,] + if addBedrock: + h_bedrock0 = f.variables['hillslope_bedrock_depth'][:,] + if addStream: + h_stream_depth0 = f.variables['hillslope_stream_depth'][:,] + h_stream_width0 = f.variables['hillslope_stream_width'][:,] + h_stream_slope0 = f.variables['hillslope_stream_slope'][:,] + + nhillcolumns0 = f.variables['nhillcolumns'][:,].astype(int) + pct_hillslope0 = f.variables['pct_hillslope'][:,] + hillslope_index0 = f.variables['hillslope_index'][:,].astype(int) + column_index0 = f.variables['column_index'][:,].astype(int) + downhill_column_index0 = f.variables['downhill_column_index'][:,].astype(int) + f.close() + + for i in range(sim): + for j in range(sjm): + if chunk_mask[j,i] > 0 and landmask[j,i] > 0: + + h_elev[:,j,i] = h_elev0[:,j,i] + h_dist[:,j,i] = h_dist0[:,j,i] + h_width[:,j,i] = h_width0[:,j,i] + h_area[:,j,i] = h_area0[:,j,i] + h_slope[:,j,i] = h_slope0[:,j,i] + h_aspect[:,j,i] = h_aspect0[:,j,i] + if addBedrock: + h_bedrock[:,j,i] = h_bedrock0[:,j,i] + if addStream: + h_stream_depth[j,i] = h_stream_depth0[j,i] + h_stream_width[j,i] = h_stream_width0[j,i] + h_stream_slope[j,i] = h_stream_slope0[j,i] + + nhillcolumns[j,i] = nhillcolumns0[j,i] + pct_hillslope[:,j,i] = pct_hillslope0[:,j,i] + hillslope_index[:,j,i] = hillslope_index0[:,j,i] + column_index[:,j,i] = column_index0[:,j,i] + downhill_column_index[:,j,i] = downhill_column_index0[:,j,i] + + # if 2 or less valid aspects, remove all hillslope data + minAspect = True + if minAspect: + if nhillcolumns0[j,i] > 0: + # check number of hillslopes + h_ndx = hillslope_index0[:,j,i] + nactual_hillslopes = np.unique(h_ndx[h_ndx > 0]).size + if nactual_hillslopes < 3: + h_elev[:,j,i] = 0 + h_dist[:,j,i] = 0 + h_width[:,j,i] = 0 + h_area[:,j,i] = 0 + h_slope[:,j,i] = 0 + h_aspect[:,j,i] = 0 + h_bedrock[:,j,i] = 0 + h_stream_depth[j,i] = 0 + h_stream_width[j,i] = 0 + h_stream_slope[j,i] = 0 + + nhillcolumns[j,i] = 0 + pct_hillslope[:,j,i] = 0 + hillslope_index[:,j,i] = 0 + column_index[:,j,i] = 0 + downhill_column_index[:,j,i] = 0 + +#-- Write data to file ------------------ + +command='date "+%y%m%d"' +timetag=subprocess.Popen(command,stdout=subprocess.PIPE,shell='True').communicate()[0].strip().decode() + +# copy original file +command=['cp',sfcfile,outfile] +x=subprocess.call(command,stderr=subprocess.PIPE) +# check permissions +check_file_permissions(outfile,addWrite=True) + +print('appending file') +w = netcdf4.Dataset(outfile,'a') +w.creation_date = timetag + +w.createDimension('nhillslope',nhillslope) +w.createDimension('nmaxhillcol',ncolumns_per_gridcell) + +ohand = w.createVariable('hillslope_elevation',np.float64,('nmaxhillcol','lsmlat','lsmlon',)) +ohand.units = 'm' +ohand.long_name = 'hillslope elevation above channel' + +odtnd = w.createVariable('hillslope_distance',np.float64,('nmaxhillcol','lsmlat','lsmlon',)) +odtnd.units = 'm' +odtnd.long_name = 'hillslope distance from channel' + +owidth = w.createVariable('hillslope_width',np.float64,('nmaxhillcol','lsmlat','lsmlon',)) +owidth.units = 'm' +owidth.long_name = 'hillslope width' + +oarea = w.createVariable('hillslope_area',np.float64,('nmaxhillcol','lsmlat','lsmlon',)) +oarea.units = 'm2' +oarea.long_name = 'hillslope area' + +oslop = w.createVariable('hillslope_slope',np.float64,('nmaxhillcol','lsmlat','lsmlon',)) +oslop.units = 'm/m' +oslop.long_name = 'hillslope slope' + +oasp = w.createVariable('hillslope_aspect',np.float64,('nmaxhillcol','lsmlat','lsmlon',)) +oasp.units = 'radians' +oasp.long_name = 'hillslope aspect (clockwise from North)' + +if addBedrock: + obed = w.createVariable('hillslope_bedrock_depth',np.float64,('nmaxhillcol','lsmlat','lsmlon',)) + obed.units = 'meters' + obed.long_name = 'hillslope bedrock depth' + +if addStream: + osdepth = w.createVariable('hillslope_stream_depth',np.float64,('lsmlat','lsmlon',)) + osdepth.units = 'meters' + osdepth.long_name = 'stream channel bankfull depth' + oswidth = w.createVariable('hillslope_stream_width',np.float64,('lsmlat','lsmlon',)) + oswidth.units = 'meters' + oswidth.long_name = 'stream channel bankfull width' + osslope = w.createVariable('hillslope_stream_slope',np.float64,('lsmlat','lsmlon',)) + osslope.units = 'm/m' + osslope.long_name = 'stream channel slope' + +onhill = w.createVariable('nhillcolumns',np.int32,('lsmlat','lsmlon',)) +onhill.units = 'unitless' +onhill.long_name = 'number of columns per landunit' + +opcthill = w.createVariable('pct_hillslope',np.float64,('nhillslope','lsmlat','lsmlon',)) +opcthill.units = 'per cent' +opcthill.long_name = 'percent hillslope of landunit' + +ohillndx = w.createVariable('hillslope_index',np.int32,('nmaxhillcol','lsmlat','lsmlon',)) +ohillndx.units = 'unitless' +ohillndx.long_name = 'hillslope_index' + +ocolndx = w.createVariable('column_index',np.int32,('nmaxhillcol','lsmlat','lsmlon',)) +ocolndx.units = 'unitless' +ocolndx.long_name = 'column index' + +odcolndx = w.createVariable('downhill_column_index',np.int32,('nmaxhillcol','lsmlat','lsmlon',)) +odcolndx.units = 'unitless' +odcolndx.long_name = 'downhill column index' + +ohand[:,] = h_elev +odtnd[:,] = h_dist +oarea[:,] = h_area +owidth[:,] = h_width +oslop[:,] = h_slope +# aspect should be in radians on surface data file +oasp[:,] = h_aspect +if addBedrock: + obed[:,] = h_bedrock +if addStream: + osdepth[:,] = h_stream_depth + oswidth[:,] = h_stream_width + osslope[:,] = h_stream_slope +opcthill[:,] = pct_hillslope +onhill[:,] = nhillcolumns.astype(np.int32) +ohillndx[:,] = hillslope_index.astype(np.int32) +ocolndx[:,] = column_index.astype(np.int32) +odcolndx[:,] = downhill_column_index.astype(np.int32) + +w.close() +print(outfile+' created') + diff --git a/python/ctsm/hillslopes/combine_gridcell_files.py b/python/ctsm/hillslopes/combine_gridcell_files.py new file mode 100755 index 0000000000..4d895ff202 --- /dev/null +++ b/python/ctsm/hillslopes/combine_gridcell_files.py @@ -0,0 +1,290 @@ +#!/usr/bin/env python +# coding: utf-8 + +# Import modules + +import sys +import string +import subprocess +import copy +import argparse +import netCDF4 as netcdf4 +import numpy as np + +# ---------------------------------------------------------- # +# +# Combine gridcell files into single file +# +# ---------------------------------------------------------- # + +parser = argparse.ArgumentParser(description='Combine gridcell files') +parser.add_argument("cndx", help="chunk", nargs='?',type=int,default=0) +parser.add_argument("-o", "--overwrite", help="overwrite", action="store_true",default=False) +parser.add_argument("-v", "--verbose", help="print info", action="store_true",default=False) +args = parser.parse_args() + +cndx = args.cndx +verbose = args.verbose + +totalChunks = 36 +if cndx < 1 or cndx > totalChunks: + print('cndx must be 1-{:d}'.format(totalChunks)) + stop + +printFlush = True + +# Specify data files to combine + +# Input file with grid information +gridfile = '/fs/cgd/csm/inputdata/lnd/clm2/surfdata_map/surfdata_0.9x1.25_78pfts_CMIP6_simyr2000_c170824.nc' + +# Gridcell file directory +dem_source = 'MERIT' +cdir = './{}_gridcell_files/'.format(dem_source) +cfile = cdir + 'chunk_{:02d}_HAND_4_col_hillslope_geo_params_section_quad_{}.nc'.format(cndx,dem_source) + +# Output file +odir = './' +outfile = odir + cfile.split('/')[-1].replace('chunk_','combined_chunk_') + +# Read output file coordinates +f = netcdf4.Dataset(gridfile, 'r') +sjm = len(f.dimensions['lsmlat']) +sim = len(f.dimensions['lsmlon']) +f.close() + +# Check for output file existence +command=['ls',outfile] +file_exists=subprocess.run(command,capture_output=True).returncode +# if file_exists !=0, file not found +if file_exists == 0: + if args.overwrite: + if verbose: + print(outfile,' exists; overwriting',flush=printFlush) + else: + print(outfile,' exists; stopping',flush=printFlush) + stop + +# Locate gridcell files +gfile = cfile.replace('.nc','*.nc') + +command = 'ls '+gfile +gfiles = subprocess.run(command,capture_output=True,shell='True').stdout.decode('utf-8').split('\n')[:-1] + +if len(gfiles) == 0: + print('No files found') + stop + +# Read hillslope data dimensions +f = netcdf4.Dataset(gfiles[0], 'r') +nhillslope = len(f.dimensions['nhillslope']) +nmaxhillcol = len(f.dimensions['nmaxhillcol']) + +if 'hillslope_bedrock_depth' in f.variables.keys(): + addBedrock = True +else: + addBedrock = False + +if 'hillslope_stream_depth' in f.variables.keys(): + addStreamChannelVariables = True +else: + addStreamChannelVariables = False +f.close() + +# initialize outfile +command='date "+%y%m%d"' +timetag=subprocess.Popen(command,stdout=subprocess.PIPE,shell='True').communicate()[0].strip().decode() + +w = netcdf4.Dataset(outfile,'w') +w.creation_date = timetag + +w.createDimension('lsmlon',sim) +w.createDimension('lsmlat',sjm) +w.createDimension('nhillslope',nhillslope) +w.createDimension('nmaxhillcol',nmaxhillcol) + +olon = w.createVariable('longitude',float,('lsmlon',)) +olon.units = 'degrees' +olon.long_name = 'longitude' + +olat = w.createVariable('latitude',float,('lsmlat',)) +olat.units = 'degrees' +olat.long_name = 'latitude' + +olon2d = w.createVariable('LONGXY',float,('lsmlat','lsmlon',)) +olon2d.units = 'degrees' +olon2d.long_name = 'longitude - 2d' + +olat2d = w.createVariable('LATIXY',float,('lsmlat','lsmlon',)) +olat2d.units = 'degrees' +olat2d.long_name = 'latitude - 2d' + +ohand = w.createVariable('hillslope_elevation',np.float64,('nmaxhillcol','lsmlat','lsmlon',)) +ohand.units = 'm' +ohand.long_name = 'hillslope elevation above channel' + +odtnd = w.createVariable('hillslope_distance',np.float64,('nmaxhillcol','lsmlat','lsmlon',)) +odtnd.units = 'm' +odtnd.long_name = 'hillslope distance from channel' + +owidth = w.createVariable('hillslope_width',np.float64,('nmaxhillcol','lsmlat','lsmlon',)) +owidth.units = 'm' +owidth.long_name = 'hillslope width' + +oarea = w.createVariable('hillslope_area',np.float64,('nmaxhillcol','lsmlat','lsmlon',)) +oarea.units = 'm2' +oarea.long_name = 'hillslope area' + +oslop = w.createVariable('hillslope_slope',np.float64,('nmaxhillcol','lsmlat','lsmlon',)) +oslop.units = 'm/m' +oslop.long_name = 'hillslope slope' + +oasp = w.createVariable('hillslope_aspect',np.float64,('nmaxhillcol','lsmlat','lsmlon',)) +oasp.units = 'radians' +oasp.long_name = 'hillslope aspect (clockwise from North)' + +obed = w.createVariable('hillslope_bedrock_depth',np.float64,('nmaxhillcol','lsmlat','lsmlon',)) +obed.units = 'meters' +obed.long_name = 'hillslope bedrock depth' + +onhill = w.createVariable('nhillcolumns',np.int32,('lsmlat','lsmlon',)) +onhill.units = 'unitless' +onhill.long_name = 'number of columns per landunit' + +opcthill = w.createVariable('pct_hillslope',np.float64,('nhillslope','lsmlat','lsmlon',)) +opcthill.units = 'per cent' +opcthill.long_name = 'percent hillslope of landunit' + +ohillndx = w.createVariable('hillslope_index',np.int32,('nmaxhillcol','lsmlat','lsmlon',)) +ohillndx.units = 'unitless' +ohillndx.long_name = 'hillslope_index' + +ocolndx = w.createVariable('column_index',np.int32,('nmaxhillcol','lsmlat','lsmlon',)) +ocolndx.units = 'unitless' +ocolndx.long_name = 'column index' + +odcolndx = w.createVariable('downhill_column_index',np.int32,('nmaxhillcol','lsmlat','lsmlon',)) +odcolndx.units = 'unitless' +odcolndx.long_name = 'downhill column index' + +ocmask = w.createVariable('chunk_mask',np.int32,('lsmlat','lsmlon',)) +ocmask.units = 'unitless' +ocmask.long_name = 'chunk mask' + +if addStreamChannelVariables: + wdims = w['LONGXY'].dimensions + osdepth = w.createVariable('hillslope_stream_depth', float, wdims) + oswidth = w.createVariable('hillslope_stream_width', float, wdims) + osslope = w.createVariable('hillslope_stream_slope', float, wdims) + + osdepth.long_name = 'stream channel bankfull depth' + osdepth.units = 'm' + + oswidth.long_name = 'stream channel bankfull width' + oswidth.units = 'm' + + osslope.long_name = 'stream channel slope' + osslope.units = 'm/m' + +# Initialize arrays +olon[:,] = 0 +olat[:,] = 0 +olon2d[:,] = 0 +olat2d[:,] = 0 + +ohand[:,] = 0 +odtnd[:,] = 0 +oarea[:,] = 0 +owidth[:,] = 0 +oslop[:,] = 0 +obed[:,] = 0 +oasp[:,] = 0 +opcthill[:,] = 0 +onhill[:,] = 0 +ohillndx[:,] = 0 +ocolndx[:,] = 0 +odcolndx[:,] = 0 +ocmask[:,] = 0 + +if addStreamChannelVariables: + osdepth[:,] = 0 + oswidth[:,] = 0 + osslope[:,] = 0 + +# loop over gridcell files +for gfile in gfiles: + + y1, x1 = gfile.index('j_'),gfile.index('i_') + j, i = int(gfile[y1+2:y1+5]),int(gfile[x1+2:x1+5]) + + f = netcdf4.Dataset(gfile, 'r') + lon = f.variables['longitude'][:,] + lat = f.variables['latitude'][:,] + lon2d = f.variables['LONGXY'][:,] + lat2d = f.variables['LATIXY'][:,] + chunk_mask = f.variables['chunk_mask'][:,] + # h_elev = f.variables['hillslope_elevation'][:,] + # h_dist = f.variables['hillslope_distance'][:,] + # h_width = f.variables['hillslope_width'][:,] + # h_area = f.variables['hillslope_area'][:,] + # h_slope = f.variables['hillslope_slope'][:,] + # h_aspect = f.variables['hillslope_aspect'][:,] + # if addBedrock: + # h_bedrock = f.variables['hillslope_bedrock_depth'][:,] + # if addStreamChannelVariables: + # h_stream_depth = f.variables['hillslope_stream_depth'][:,] + # h_stream_width = f.variables['hillslope_stream_width'][:,] + # h_stream_slope = f.variables['hillslope_stream_slope'][:,] + + h_elev = np.asarray(f.variables['h_height'][:,]) + h_dist = np.asarray(f.variables['h_length'][:,]) + h_width = np.asarray(f.variables['h_width'][:,]) + h_area = np.asarray(f.variables['h_area'][:,]) + h_slope = np.asarray(f.variables['h_slope'][:,]) + h_aspect = np.asarray(f.variables['h_aspect'][:,]) + if addBedrock: + h_bedrock = np.asarray(f.variables['h_bedrock'][:,]) + if addStreamChannelVariables: + h_stream_depth = np.asarray(f.variables['h_stream_depth'][:,]) + h_stream_width = np.asarray(f.variables['h_stream_width'][:,]) + h_stream_slope = np.asarray(f.variables['h_stream_slope'][:,]) + + + + + nhillcolumns = f.variables['nhillcolumns'][:,].astype(int) + pct_hillslope = f.variables['pct_hillslope'][:,] + hillslope_index = f.variables['hillslope_index'][:,].astype(int) + column_index = f.variables['column_index'][:,].astype(int) + downhill_column_index = f.variables['downhill_column_index'][:,].astype(int) + f.close() + + olon[i] = lon + olat[j] = lat + olon2d[j,i] = lon2d + olat2d[j,i] = lat2d + + ohand[:,j,i] = h_elev + odtnd[:,j,i] = h_dist + oarea[:,j,i] = h_area + owidth[:,j,i] = h_width + oslop[:,j,i] = h_slope + oasp[:,j,i] = h_aspect + opcthill[:,j,i] = pct_hillslope + onhill[j,i] = np.int32(nhillcolumns) + ohillndx[:,j,i] = hillslope_index.astype(np.int32) + ocolndx[:,j,i] = column_index.astype(np.int32) + odcolndx[:,j,i] = downhill_column_index.astype(np.int32) + ocmask[j,i] = np.int32(chunk_mask) + if addBedrock: + obed[:,j,i] = h_bedrock + + if addStreamChannelVariables: + osdepth[j,i] = h_stream_depth + oswidth[j,i] = h_stream_width + osslope[j,i] = h_stream_slope + + +w.close() +print(outfile+' created') + diff --git a/python/ctsm/hillslopes/loop_call.py b/python/ctsm/hillslopes/loop_call.py new file mode 100755 index 0000000000..37e03f9ad5 --- /dev/null +++ b/python/ctsm/hillslopes/loop_call.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python +# coding: utf-8 + +# Import modules + +import sys +import string +import subprocess +import copy +import argparse + +# ------------------------------------------------------- # +# +# Loop over script calls when chunking data +# +# ------------------------------------------------------- # +parser = argparse.ArgumentParser(description='Loop script call') +parser.add_argument("snum", help="script flag", nargs='?',type=int,default=0) +parser.add_argument("-o","--overwrite", help="overwrite", action="store_true",default=False) +args = parser.parse_args() + +snum = args.snum +if snum not in [1]: + print('only 1 script currently supported') + print('snum must be 1') + stop + +# Combine individual gridcell files into chunks +if snum == 1: + script_to_call = './combine_gridcell_files.py' + + +# totalChunks must match value used in scripts +totalChunks = 36 + +istart,iend = 1,totalChunks+1 +for i in range(istart,iend): + print('===============================================') + print('Beginning chunk {:d}'.format(i),flush=True) + + if args.overwrite: + command=[script_to_call, str(i),'-o'] + else: + command=[script_to_call, str(i)] + + try: + x=subprocess.call(command,stderr=subprocess.PIPE) + except: + continue diff --git a/python/ctsm/hillslopes/synthetic_hillslope.py b/python/ctsm/hillslopes/synthetic_hillslope.py new file mode 100755 index 0000000000..07532f3f74 --- /dev/null +++ b/python/ctsm/hillslopes/synthetic_hillslope.py @@ -0,0 +1,300 @@ +#! /usr/bin/env python +from __future__ import print_function +import sys +import string +import subprocess +import numpy as np +import netCDF4 as netcdf4 + +def check_file_permissions(ifile,addWrite=False): + command=['ls','-l',ifile] + wflag=subprocess.run(command,capture_output=True).stdout.decode().split()[0][2] + if addWrite and wflag != 'w': + command=['chmod','+w',ifile] + x=subprocess.run(command,capture_output=True) + command=['ls','-l',ifile] + p=subprocess.run(command,capture_output=True).stdout.decode().split()[0] + print('new permissions ',p) + +''' + specify a synthetic hillslope profile +''' + +snum = 1 +if snum == 1: + infile = '/fs/cgd/csm/inputdata/lnd/clm2/surfdata_map/surfdata_0.9x1.25_78pfts_CMIP6_simyr2000_c170824.nc' + outfile = './surfdata_0.9x1.25_78pfts_CMIP6_simyr2000_synthetic.nc' +if snum == 2: + infile = '/fs/cgd/csm/inputdata/lnd/clm2/surfdata_map/surfdata_10x15_78pfts_simyr2000_c170428.nc' + outfile = './surfdata_10x15_78pfts_simyr2000_synthetic.nc' + +f = netcdf4.Dataset(infile, 'r') +im = len(f.dimensions['lsmlon']) +jm = len(f.dimensions['lsmlat']) +std_elev = np.asarray(f.variables['STD_ELEV'][:,:]) +lmask = np.asarray(f.variables['PFTDATA_MASK'][:,:]) +pct_natveg = np.asarray(f.variables['PCT_NATVEG'][:,:]) +f.close() + +# are any points in land mask but have zero % natveg? +print('zero natveg pts ',np.sum(np.where(np.logical_and(lmask==1,pct_natveg==0),1,0))) +lmask = np.where(np.logical_and(lmask==1,pct_natveg>0),1,0).astype(int) + +num_hillslopes = int(4) +nmaxhillcol = int(16) + +command='date "+%y%m%d"' +x2=subprocess.Popen(command,stdout=subprocess.PIPE,shell='True') +x=x2.communicate() +timetag = x[0].strip().decode() + +hcase = 'slope_aspect' +if hcase == 'slope_aspect': + max_columns_per_hillslope = nmaxhillcol//num_hillslopes + + if max_columns_per_hillslope == 4: + bin_fractions = np.array((0.25, 0.75, 1.0)) + if max_columns_per_hillslope == 5: + bin_fractions = np.array((0.25, 0.50, 0.75, 1.0)) + if max_columns_per_hillslope == 6: + bin_fractions = np.array((0.20, 0.40, 0.60, 0.80, 1.0)) + + max_columns_per_landunit = num_hillslopes * max_columns_per_hillslope + + #-- define geometry of hillslopes + # percentage of landunit occupied by each hillslope (must sum to 100) + pct_landunit = np.zeros((num_hillslopes,jm,im)) + # distance of column midpoint from stream channel + distance = np.zeros((max_columns_per_landunit,jm,im),dtype=float) + # area of column + area = np.zeros((max_columns_per_landunit,jm,im),dtype=float) + # width of interface with downstream column (or channel) + width = np.zeros((max_columns_per_landunit,jm,im),dtype=float) + # elevation of column midpoint + elevation = np.zeros((max_columns_per_landunit,jm,im),dtype=float) + # mean slope of column + slope = np.zeros((max_columns_per_landunit,jm,im),dtype=float) + # azimuth angle of column + aspect = np.zeros((max_columns_per_landunit,jm,im),dtype=float) + # column identifier index + col_ndx = np.zeros((max_columns_per_landunit,jm,im),dtype=np.int32) + # index of downhill column + col_dndx = np.zeros((max_columns_per_landunit,jm,im),dtype=np.int32) + # index of hillslope type + hill_ndx = np.zeros((max_columns_per_landunit,jm,im),dtype=np.int32) + + + ''' + --------------------------------------------------- + #cosine - power law hillslope + create bins of equal height + this form ensures a near-zero slope at the hill top + --------------------------------------------------- + ''' + # uniform width + width_reach = 500.0 # meters + # distance from channel to ridge + hillslope_distance = 500.0 # meters + # shape parameter (power law exponent) + phill = 0.7 + phill = 1.0 + + def cosp_height(x,hlen,hhgt,phill): + fx=0.5*(1.0+np.cos(np.pi*(1.0+(x/hlen)))) + h=hhgt*np.power(fx,phill) + return h + + def icosp_height(h,hlen,hhgt,phill): + if hhgt <= 0.0: + x = 0.0 + else: + fh=np.arccos(2.0*np.power((h/hhgt),(1.0/phill))-1) + # np.arccos returns [0,pi] + # want [pi,2pi] based on cosp_height definition + fh = 2.0*np.pi - fh + x=hlen*((1./np.pi)*fh - 1.0) + return x + + ntag = '_cosphill_'+str(phill) + outfile = outfile.replace ('.nc',ntag+'.nc') + + # increments to use in numerical integration of mean elevation + delx = 1.0 #[m] + + cndx = 0 + for i in range(im): + for j in range(jm): + if lmask[j,i] == 1: + + # slope tangent (y/x) + beta = np.min((std_elev[j,i],200.0))/hillslope_distance + + # specify hill height from slope and length + hhgt = beta * hillslope_distance + #hhgt = np.max([hhgt,0.1]) + hhgt = np.max([hhgt,4.0]) + + # create height bins + #hbins = hhgt * np.arange(max_columns_per_landunit+1)/float(max_columns_per_landunit) + # create specified fractional bins + thresh = 2.0 + hbins = np.zeros(max_columns_per_hillslope+1) + hbins[1] = thresh + # array needs to be length max_columns_per_hillslope-1 + hbins[2:max_columns_per_hillslope+1] = hbins[1] \ + + (hhgt - thresh) * bin_fractions + + #hbins=np.flipud(hbins) + # create length bins from height bins + lbins=np.zeros(max_columns_per_hillslope+1) + for n in range(max_columns_per_hillslope+1): + if hhgt > 0.: + lbins[n] = icosp_height(hbins[n],hillslope_distance,hhgt,phill) + + # loop over aspect bins + for naspect in range(num_hillslopes): + pct_landunit[naspect,j,i] = 100/float(num_hillslopes) + # index from ridge to channel (i.e. downhill) + for n in range(max_columns_per_hillslope): + ncol = n + naspect*max_columns_per_hillslope + + cndx += 1 # start at 1 not zero (oceans are 0) + col_ndx[ncol,j,i] = cndx + hill_ndx[ncol,j,i] = (naspect + 1) + + uedge = lbins[n+1] + ledge = lbins[n] + # lowland column + if n == 0: + col_dndx[ncol,j,i] = -999 + else:# upland columns + col_dndx[ncol,j,i] = col_ndx[ncol,j,i]-1 + + distance[ncol,j,i] = 0.5*(uedge + ledge) + area[ncol,j,i] = width_reach*(uedge - ledge) + width[ncol,j,i] = width_reach + # numerically integrate to calculate mean elevation + nx = int(uedge - ledge) + mean_elev = 0. + for k in range(nx): + x1 = uedge - (k+0.5)*delx + mean_elev += cosp_height(x1,hillslope_distance,hhgt,phill) + mean_elev = mean_elev/float(nx) + + elevation[ncol,j,i] = mean_elev + + slope[ncol,j,i] = (hbins[n+1]-hbins[n])/(lbins[n+1]-lbins[n]) + if naspect == 0: # north + aspect[ncol,j,i] = 0. + if naspect == 1: # east + aspect[ncol,j,i] = 0.5*np.pi + if naspect == 2: # south + aspect[ncol,j,i] = np.pi + if naspect == 3: # west + aspect[ncol,j,i] = 1.5*np.pi + + +# write to file -------------------------------------------- +command=['cp',infile,outfile] +x=subprocess.call(command,stderr=subprocess.PIPE) +# check permissions +check_file_permissions(outfile,addWrite=True) + +w = netcdf4.Dataset(outfile, 'a') +w.createDimension('nhillslope',num_hillslopes) +w.createDimension('nmaxhillcol',max_columns_per_landunit) + +ohand = w.createVariable('hillslope_elevation',np.float64,('nmaxhillcol','lsmlat','lsmlon',)) +ohand.units = 'm' +ohand.long_name = 'hillslope elevation' + +odtnd = w.createVariable('hillslope_distance',np.float64,('nmaxhillcol','lsmlat','lsmlon',)) +odtnd.units = 'm' +odtnd.long_name = 'hillslope distance' + +owidth = w.createVariable('hillslope_width',np.float64,('nmaxhillcol','lsmlat','lsmlon',)) +owidth.units = 'm' +owidth.long_name = 'hillslope width' + +oarea = w.createVariable('hillslope_area',np.float64,('nmaxhillcol','lsmlat','lsmlon',)) +oarea.units = 'm2' +oarea.long_name = 'hillslope area' + +oslop = w.createVariable('hillslope_slope',np.float64,('nmaxhillcol','lsmlat','lsmlon',)) +oslop.units = 'm/m' +oslop.long_name = 'hillslope slope' + +oasp = w.createVariable('hillslope_aspect',np.float64,('nmaxhillcol','lsmlat','lsmlon',)) +oasp.units = 'radians' +oasp.long_name = 'hillslope aspect (clockwise from North)' + +onhill = w.createVariable('nhillcolumns',np.int32,('lsmlat','lsmlon',)) +onhill.units = 'unitless' +onhill.long_name = 'number of columns per landunit' + +opcthill = w.createVariable('pct_hillslope',np.float64,('nhillslope','lsmlat','lsmlon',)) +opcthill.units = 'per cent' +opcthill.long_name = 'percent hillslope of landunit' + +ohillndx = w.createVariable('hillslope_index',np.int32,('nmaxhillcol','lsmlat','lsmlon',)) +ohillndx.units = 'unitless' +ohillndx.long_name = 'hillslope_index' + +ocolndx = w.createVariable('column_index',np.int32,('nmaxhillcol','lsmlat','lsmlon',)) +ocolndx.units = 'unitless' +ocolndx.long_name = 'column index' + +odcolndx = w.createVariable('downhill_column_index',np.int32,('nmaxhillcol','lsmlat','lsmlon',)) +odcolndx.units = 'unitless' +odcolndx.long_name = 'downhill column index' + +obed = w.createVariable('hillslope_bedrock_depth',np.float64,('nmaxhillcol','lsmlat','lsmlon',)) +obed.units = 'meters' +obed.long_name = 'hillslope bedrock depth' + +opft = w.createVariable('hillslope_pftndx',np.int32,('nmaxhillcol','lsmlat','lsmlon',)) +opft.units = 'unitless' +opft.long_name = 'hillslope pft indices' + + +w.variables['nhillcolumns'][:,:] = max_columns_per_landunit * lmask +w.variables['pct_hillslope'][:,] = pct_landunit +w.variables['hillslope_index'][:,] = hill_ndx +w.variables['column_index'][:,] = col_ndx +w.variables['downhill_column_index'][:,] = col_dndx +w.variables['hillslope_distance'][:,] = distance +w.variables['hillslope_width'][:,] = width +w.variables['hillslope_elevation'][:,] = elevation +w.variables['hillslope_slope'][:,] = slope +w.variables['hillslope_aspect'][:,] = aspect +w.variables['hillslope_area'][:,] = area +w.variables['hillslope_bedrock_depth'][:,] = 2 +w.variables['hillslope_pftndx'][:,] = 13 + +# add stream variables +wdepth = w.createVariable('hillslope_stream_depth', np.float64, ('lsmlat','lsmlon')) +wwidth = w.createVariable('hillslope_stream_width', np.float64, ('lsmlat','lsmlon')) +wslope = w.createVariable('hillslope_stream_slope', np.float64, ('lsmlat','lsmlon')) + +wdepth.long_name = 'stream channel bankfull depth' +wdepth.units = 'm' + +wwidth.long_name = 'stream channel bankfull width' +wwidth.units = 'm' + +wslope.long_name = 'stream channel slope' +wslope.units = 'm/m' + +# Calculate stream geometry from hillslope parameters +uharea = np.sum(area,axis=0) +adepth, bdepth = 1e-3, 0.4 +wdepth[:,] = adepth*(uharea**bdepth) +awidth, bwidth = 1e-3, 0.6 +wwidth[:,] = awidth*(uharea**bwidth) +wslope[:,] = 1e-2 + +print('created ',outfile) + +#-- Close output file +w.close + From 225bdbdb564ccd582d144f38898dd73673373068 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 20 Feb 2024 13:37:05 -0700 Subject: [PATCH 30/34] Add representative-hillslopes external (optional) in tools/external/. --- Externals.cfg | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Externals.cfg b/Externals.cfg index c09bd4041e..e187763424 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -97,5 +97,12 @@ repo_url = https://github.com/ESMCI/doc-builder tag = v1.0.8 required = False +[representative-hillslopes] +local_path = tools/external/representative-hillslopes +protocol = git +repo_url = https://github.com/swensosc/Representative_Hillslopes +tag = 83a8cef +required = False + [externals_description] schema_version = 1.0.0 From 226ee8b0ce5cefc414bf3b394a452009ce518118 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 5 Mar 2024 11:31:37 -0700 Subject: [PATCH 31/34] Update representative-hillslopes external. --- Externals.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals.cfg b/Externals.cfg index e187763424..c55a8357ee 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -101,7 +101,7 @@ required = False local_path = tools/external/representative-hillslopes protocol = git repo_url = https://github.com/swensosc/Representative_Hillslopes -tag = 83a8cef +tag = 06f12b6 required = False [externals_description] From da03c9051fd4b2a4e0a31b987a3ad3ecc06e5367 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 8 Mar 2024 14:29:30 -0700 Subject: [PATCH 32/34] Point representative-hillslopes external at my branch. --- Externals.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Externals.cfg b/Externals.cfg index c55a8357ee..a672033d54 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -100,8 +100,8 @@ required = False [representative-hillslopes] local_path = tools/external/representative-hillslopes protocol = git -repo_url = https://github.com/swensosc/Representative_Hillslopes -tag = 06f12b6 +repo_url = https://github.com/samsrabin/Representative_Hillslopes +tag = 4d60abc required = False [externals_description] From 5cf42314229edf4348711ab8ffd4a5def524d87f Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Sat, 9 Mar 2024 14:53:10 -0700 Subject: [PATCH 33/34] Update representative-hillslopes external to include fix for cndx 11. --- Externals.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals.cfg b/Externals.cfg index a672033d54..6650a7ad50 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -101,7 +101,7 @@ required = False local_path = tools/external/representative-hillslopes protocol = git repo_url = https://github.com/samsrabin/Representative_Hillslopes -tag = 4d60abc +tag = def6367 required = False [externals_description] From b722a14e880f3eec0b991f0f2be0d0b0b9936e0e Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 15 Mar 2024 09:49:06 -0600 Subject: [PATCH 34/34] Update representative-hillslopes with fixes for cndx 27 and 28. --- Externals.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals.cfg b/Externals.cfg index 6650a7ad50..1229424f5a 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -101,7 +101,7 @@ required = False local_path = tools/external/representative-hillslopes protocol = git repo_url = https://github.com/samsrabin/Representative_Hillslopes -tag = def6367 +tag = 11a5b16716b5dfaf21f7f9b4b1568514e754d59a required = False [externals_description]