diff --git a/.config_files.xml b/.config_files.xml index 5c88ec4051..a1775b52ce 100644 --- a/.config_files.xml +++ b/.config_files.xml @@ -5,19 +5,20 @@ char unset - $SRCROOT + $SRCROOT + $SRCROOT $CIMEROOT/src/components/data_comps_mct/dlnd $CIMEROOT/src/components/cdeps/dlnd $CIMEROOT/src/components/stub_comps_$COMP_INTERFACE/slnd diff --git a/.gitignore b/.gitignore index 7948b49eed..26aca9549c 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ manage_externals.log /tools/PTCLM/ /cime/ /components/ +/doc/doc-builder/ # ignore svn directories **/.svn/** @@ -47,16 +48,6 @@ CMakeFiles/ # unit testing directories /src/unit_tests.* -# files generated by the unit test build -/src/dyn_subgrid/dynVarMod.F90 -/src/dyn_subgrid/dynVarTimeInterpMod.F90 -/src/dyn_subgrid/dynVarTimeUninterpMod.F90 -/src/utils/array_utils.F90 -/src/unit_test_stubs/utils/restUtilMod_stub.F90 -/src/unit_test_stubs/main/ncdio_pio_fake.F90 -/src/unit_test_stubs/main/ncdio_var.F90 -/src/unit_test_shr/unittestArrayMod.F90 - # cime_config buildnmlc @@ -72,6 +63,7 @@ buildnmlc /bld/unit_testers/drv_flds_in* /bld/unit_testers/temp_file.txt* /bld/unit_testers/user_nl_clm_real_parameters* +/bld/unit_testers/user_nl_ctsm_real_parameters* /bld/unit_testers/env_run.xml # tools testing output @@ -86,8 +78,8 @@ surfdata_*.namelist landuse.timeseries_*.namelist landuse.timeseries_*.log landuse_timeseries_*.txt -clm.input_data_list -clm.input_data_list.previous +ctsm.input_data_list +ctsm.input_data_list.previous *.stdout.txt.o* # mksurfdata unit tests diff --git a/Externals.cfg b/Externals.cfg index 556e30be13..aecac45976 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -16,31 +16,51 @@ required = True local_path = components/rtm protocol = git repo_url = https://github.com/ESCOMP/RTM -tag = rtm1_0_72 +tag = rtm1_0_73 required = True [mosart] local_path = components/mosart protocol = git repo_url = https://github.com/ESCOMP/MOSART -tag = mosart1_0_37 +tag = mosart1_0_38 required = True -[cdeps] -hash = 45b7a85 +[mizuRoute] +local_path = components/mizuRoute protocol = git -repo_url = https://github.com/ESCOMP/CDEPS.git -local_path = components/cdeps +repo_url = https://github.com/nmizukami/mizuRoute +hash = 34723c2 required = True [cime] local_path = cime protocol = git repo_url = https://github.com/ESMCI/cime -tag = cime5.8.32 -externals = ../Externals_cime.cfg +tag = branch_tags/cime5.8.32_a02 +required = True + +[cmeps] +local_path = cime/src/drivers/nuopc/ +protocol = git +repo_url = https://github.com/ESCOMP/CMEPS.git +hash = 7654038 +required = True + +[cdeps] +local_path = components/cdeps +protocol = git +repo_url = https://github.com/ESCOMP/CDEPS.git +hash = 45b7a85 required = True +[doc-builder] +local_path = doc/doc-builder +protocol = git +repo_url = https://github.com/ESMCI/doc-builder +tag = v1.0.5 +required = False + [externals_description] schema_version = 1.0.0 diff --git a/Externals_cime.cfg b/Externals_cime.cfg deleted file mode 100644 index a4ef9d88e8..0000000000 --- a/Externals_cime.cfg +++ /dev/null @@ -1,9 +0,0 @@ -[cmeps] -hash = 7654038 -protocol = git -repo_url = https://github.com/ESCOMP/CMEPS.git -local_path = src/drivers/nuopc/ -required = True - -[externals_description] -schema_version = 1.0.0 diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index c6c26857f0..2698f9f6a8 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -1010,24 +1010,6 @@ sub setup_cmdl_maxpft { } $nl_flags->{'maxpft'} = $val; - $var = "maxpatch_pft"; - my $group = $definition->get_group_name($var); - if ( ! defined($nl->get_variable_value($group, $var)) ) { - $val = $nl_flags->{'maxpft'}; - $nl->set_variable_value($group, $var, $val); - } - $val = $nl->get_variable_value($group, $var); - my @valid_values = ($maxpatchpft{'.true.'}, $maxpatchpft{'.false.'} ); - my $found = 0; - foreach my $valid_val ( @valid_values ) { - if ( $val == $valid_val ) { - $found = 1; - last; - } - } - if ( ! $found ) { - $log->warning("$var has a value ($val) that is normally NOT valid. Normal valid values are: @valid_values"); - } } #------------------------------------------------------------------------------- @@ -1488,7 +1470,7 @@ sub process_namelist_inline_logic { ############################## # namelist group: clm_inparm # ############################## - setup_logic_site_specific($nl_flags, $definition, $nl); + setup_logic_site_specific($opts, $nl_flags, $definition, $defaults, $nl); setup_logic_lnd_frac($opts, $nl_flags, $definition, $defaults, $nl, $envxml_ref); setup_logic_co2_type($opts, $nl_flags, $definition, $defaults, $nl); setup_logic_irrigate($opts, $nl_flags, $definition, $defaults, $nl); @@ -1516,6 +1498,7 @@ sub process_namelist_inline_logic { setup_logic_supplemental_nitrogen($opts, $nl_flags, $definition, $defaults, $nl); setup_logic_snowpack($opts, $nl_flags, $definition, $defaults, $nl); setup_logic_fates($opts, $nl_flags, $definition, $defaults, $nl); + setup_logic_misc($opts, $nl_flags, $definition, $defaults, $nl); ######################################### # namelist group: atm2lnd_inparm @@ -1717,7 +1700,7 @@ sub process_namelist_inline_logic { sub setup_logic_site_specific { # site specific requirements - my ($nl_flags, $definition, $nl) = @_; + my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; # res check prevents polluting the namelist with an unnecessary # false variable for every run @@ -1748,6 +1731,9 @@ sub setup_logic_site_specific { $log->fatal_error("1x1_numaIA grids must use a compset with CN and CROP turned on."); } } + # Set compname + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'compname', + 'phys'=>$nl_flags->{'phys'} ); } #------------------------------------------------------------------------------- @@ -2378,6 +2364,7 @@ sub setup_logic_dynamic_subgrid { setup_logic_do_transient_pfts($opts, $nl_flags, $definition, $defaults, $nl); setup_logic_do_transient_crops($opts, $nl_flags, $definition, $defaults, $nl); + setup_logic_do_transient_lakes($opts, $nl_flags, $definition, $defaults, $nl); setup_logic_do_harvest($opts, $nl_flags, $definition, $defaults, $nl); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'reset_dynbal_baselines'); @@ -2543,6 +2530,69 @@ sub setup_logic_do_transient_crops { } } +sub setup_logic_do_transient_lakes { + # + # Set do_transient_lakes default value, and perform error checking on do_transient_lakes + # + # Assumes the following are already set in the namelist (although it's okay + # for them to be unset if that will be their final state): + # - flanduse_timeseries + # + # NOTE(wjs, 2020-08-23) I based this function on setup_logic_do_transient_crops. I'm + # not sure if all of the checks here are truly important for transient lakes (in + # particular, my guess is that collapse_urban could probably be done with transient + # lakes - as well as transient pfts and transient crops for that matter), but some of + # the checks probably are needed, and it seems best to keep transient lakes consistent + # with other transient areas in this respect. + my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; + + my $var = 'do_transient_lakes'; + + # cannot_be_true will be set to a non-empty string in any case where + # do_transient_lakes should not be true; if it turns out that + # do_transient_lakes IS true in any of these cases, a fatal error will be + # generated + my $cannot_be_true = ""; + + my $n_dom_pfts = $nl->get_value( 'n_dom_pfts' ); + my $n_dom_landunits = $nl->get_value( 'n_dom_landunits' ); + my $toosmall_soil = $nl->get_value( 'toosmall_soil' ); + my $toosmall_crop = $nl->get_value( 'toosmall_crop' ); + my $toosmall_glacier = $nl->get_value( 'toosmall_glacier' ); + my $toosmall_lake = $nl->get_value( 'toosmall_lake' ); + my $toosmall_wetland = $nl->get_value( 'toosmall_wetland' ); + my $toosmall_urban = $nl->get_value( 'toosmall_urban' ); + + if (string_is_undef_or_empty($nl->get_value('flanduse_timeseries'))) { + $cannot_be_true = "$var can only be set to true when running a transient case (flanduse_timeseries non-blank)"; + } + + if (!$cannot_be_true) { + # Note that, if the variable cannot be true, we don't call add_default + # - so that we don't clutter up the namelist with variables that don't + # matter for this case + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var); + } + + # Make sure the value is false when it needs to be false - i.e., that the + # user hasn't tried to set a true value at an inappropriate time. + + if (&value_is_true($nl->get_value($var)) && $cannot_be_true) { + $log->fatal_error($cannot_be_true); + } + + # if do_transient_lakes is .true. and any of these (n_dom_* or toosmall_*) + # are > 0 or collapse_urban = .true., then give fatal error + if (&value_is_true($nl->get_value($var))) { + if (&value_is_true($nl->get_value('collapse_urban'))) { + $log->fatal_error("$var cannot be combined with collapse_urban"); + } + if ($n_dom_pfts > 0 || $n_dom_landunits > 0 || $toosmall_soil > 0 || $toosmall_crop > 0 || $toosmall_glacier > 0 || $toosmall_lake > 0 || $toosmall_wetland > 0 || $toosmall_urban > 0) { + $log->fatal_error("$var cannot be combined with any of the of the following > 0: n_dom_pfts > 0, n_dom_landunit > 0, toosmall_soil > 0._r8, toosmall_crop > 0._r8, toosmall_glacier > 0._r8, toosmall_lake > 0._r8, toosmall_wetland > 0._r8, toosmall_urban > 0._r8"); + } + } +} + sub setup_logic_do_harvest { # # Set do_harvest default value, and perform error checking on do_harvest @@ -3420,7 +3470,7 @@ sub setup_logic_megan { #------------------------------------------------------------------------------- sub setup_logic_soilm_streams { - # prescribed soil moisture streams require clm4_5/clm5_0 + # prescribed soil moisture streams require clm4_5/clm5_0/clm5_1 my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_soil_moisture_streams'); @@ -3833,6 +3883,18 @@ sub setup_logic_fates { #------------------------------------------------------------------------------- +sub setup_logic_misc { + # + # Set some misc options + # + my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; + + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'for_testing_run_ncdiopio_tests'); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'hist_master_list_file'); +} + +#------------------------------------------------------------------------------- + sub write_output_files { my ($opts, $nl_flags, $defaults, $nl) = @_; diff --git a/bld/config_files/clm_phys_vers.pm b/bld/config_files/clm_phys_vers.pm index 32124491a8..3e4de9c610 100755 --- a/bld/config_files/clm_phys_vers.pm +++ b/bld/config_files/clm_phys_vers.pm @@ -28,7 +28,7 @@ use bigint; #use warnings; #use diagnostics; -my @version_strings = ("clm4_5", "clm5_0"); +my @version_strings = ("clm4_5", "clm5_0", "clm5_1"); #------------------------------------------------------------------------------- @@ -83,12 +83,12 @@ if ( ! defined(caller) && $#ARGV == -1 ) { require Test::More; Test::More->import( ); - plan( tests=>2 ); + plan( tests=>3 ); sub testit { print "unit tester\n"; my %lastv; - my @vers_list = ( "clm4_5", "clm5_0" ); + my @vers_list = ( "clm4_5", "clm5_0", "clm5_1" ); foreach my $vers ( @vers_list ) { my $phys = config_files::clm_phys_vers->new($vers); isa_ok($phys, "config_files::clm_phys_vers", "created clm_phys_vers object"); diff --git a/bld/config_files/config_definition_ctsm.xml b/bld/config_files/config_definition_ctsm.xml index b02510ed64..06263c6d19 100644 --- a/bld/config_files/config_definition_ctsm.xml +++ b/bld/config_files/config_definition_ctsm.xml @@ -5,10 +5,10 @@ -Specifies either clm4_5 or clm5_0 physics +Specifies either clm4_5, clm5_0, or clm5_1 physics -Specifies clm physics +Specifies clm physics EOF $fh->close(); diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 2a1f4a532b..a99a3c1599 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -34,19 +34,34 @@ attributes from the config_cache.xml file (with keys converted to upper-case). sp -clm4_5_CRUv7 -clm5_0_cam6.0 +clm4_5_CRUv7 +clm5_0_cam6.0 +clm5_1_GSWP3v1 + + +clm2 +clm2 +clm2 off +2 2 1 +2 +2 +2 2 1 0 +.false. + + +.false. + .true. 20 -.false. -.false. +.false. +.false. +.false. -.true. -.false. - - -.true. +.true. +.true. +.false. -2 -1 -0 +2 +2 +1 +0 +.true. .true. .false. -Medlyn2011 -Ball-Berry1987 -Ball-Berry1987 +Medlyn2011 +Ball-Berry1987 +Medlyn2011 +Ball-Berry1987 +Ball-Berry1987 lnd/clm2/isotopes/atm_delta_C13_CMIP6_1850-2015_yearly_v2.0_c190528.nc @@ -103,9 +121,11 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/isotopes/atm_delta_C14_CMIP6_SSP5B_3x1_global_1850-2100_yearly_c181209.nc -.true. -.false. -.false. +.true. +.false. +.true. +.false. +.false. .false. .true. @@ -124,18 +144,22 @@ attributes from the config_cache.xml file (with keys converted to upper-case). NONE -0.50,0.30 -0.60,0.40 +0.50,0.30 +0.50,0.30 +0.60,0.40 +ON_WASTEHEAT ON_WASTEHEAT ON -1 -0 +1 +1 +0 -FAST -NONE +FAST +FAST +NONE .false. @@ -143,41 +167,53 @@ attributes from the config_cache.xml file (with keys converted to upper-case). .true. .false. +.false. 4SL_2m -20SL_8.5m -10SL_3.5m +20SL_8.5m +20SL_8.5m +10SL_3.5m -.false. -.false. -.true. -.false. +.false. +.false. +.true. +.false. +.false. +.true. +.false. -1 -0 +1 +1 +0 -1 -1 +1 +1 +1 -1 -0 +1 +1 +0 -1.d-2 -0.001d00 -1.d-2 -1.d-2 +1.d-2 +0.001d00 +1.d-2 +0.001d00 +1.d-2 +1.d-2 -2.0d00 -0.5d00 +2.0d00 +0.5d00 +0.5d00 -.true. -.false. +.true. +.true. +.false. .true. @@ -192,24 +228,29 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 0. 2. -0. -2. +0. +2. --2. -0. +-2. +0. + +-2. +0. -.false. -.true. +.false. +.true. +.true. -li2016crufrc -li2014qianfrc +li2021gswpfrc +li2016crufrc +li2014qianfrc 30.0d00 80.0d00 @@ -251,28 +292,50 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 0.5d00 0.28d00 +30.0d00 +80.0d00 +0.85d00 +0.98d00 +0.025d00 +0.09d-4 +0.010d00 +0.17d-3 +1.6d-4 +0.33d00 +75.d00 +1050.d00 +0.5d00 +0.28d00 + -.false. -.true. +.false. +.false. +.true. 40 3 -.true. -1.0 -0.05 +.true. +1.0 +0.05 -.false. -0.25 -1.0 +.true. +1.0 +0.05 + +.false. +0.25 +1.0 -0 -1 +0 +1 +1 1 1 +1 4 2 @@ -293,13 +356,15 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 14400 -3400. 0.6 -1.0 -0.5 +1.0 +1.0 +0.5 0.1 -.false. -.false. +.false. +.false. +.false. .false. @@ -309,15 +374,19 @@ attributes from the config_cache.xml file (with keys converted to upper-case). .true. -12 -5 -5 +12 +5 +12 +5 +5 -10000.0 -5000.0 -1000.0 +10000.0 +5000.0 +10000.0 +5000.0 +1000.0 0.010d00 0.015d00 @@ -326,27 +395,34 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 0.02d00 0.05d00 -2000. +2000. +2000. -1.e30 +1.e30 -10.0d00 -10.0 +10.0d00 +10.0d00 +10.0 +.true. .true. .false. -'Vionnet2012' -'Anderson1976' +'Vionnet2012' +'Vionnet2012' +'Anderson1976' -'Slater2017' -'TruncatedAnderson1976' +'Slater2017' +'Slater2017' +'TruncatedAnderson1976' -100.d00 -175.d00 +100.d00 +175.d00 +175.d00 -54.526d00 -204.526d00 +54.526d00 +204.526d00 +204.526d00 0.08d00 @@ -386,6 +462,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). simplicity, we tie the defaults for both of these options to the overall CLM phys version, rather than having some intermediate option that controls the defaults for both h2osno_max and glc_snow_persistence_max_days. --> +0 0 7300 @@ -393,8 +470,9 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/clm5_params.c200624.nc -lnd/clm2/paramdata/clm45_params.c200624.nc +lnd/clm2/paramdata/ctsm51_params.c200905.nc +lnd/clm2/paramdata/clm50_params.c200905.nc +lnd/clm2/paramdata/clm45_params.c200905.nc @@ -405,13 +483,17 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -.true. -.false. -.false. +.true. +.false. +.true. +.false. +.false. +.true. +.false. .true. -.false. +.false. .false. @@ -439,62 +521,78 @@ attributes from the config_cache.xml file (with keys converted to upper-case). .false. .false. -.true. -.true. +.true. +.true. +.true. -0.17 +0.17 +0.17 .false. -.false. -.true. +.false. +.true. +.true. -constant -varytropicsbylat -12.0d00 -0.4d00 +constant +varytropicsbylat +12.0d00 +0.4d00 +varytropicsbylat +12.0d00 +0.4d00 -3.d00 -1.d00 +3.d00 +3.d00 +1.d00 -0.5 -10.0 +0.5 +10.0 +10.0 -.false. -.true. +.false. +.true. +.true. .true. -.false. -.false. -.false. -.false. -.false. +.false. +.false. +.false. +.false. +.false. +.false. -.false. -.false. -.true. - -1.d-9 -1.d-8 --6.d+1 --6.d+0 --6.d+2 --6.d+1 +.false. +.false. +.true. +.false. +.true. + +1.d-9 +1.d-9 +1.d-8 +-6.d+1 +-6.d+0 +-6.d+1 +-6.d+0 +-6.d+2 +-6.d+1 -.false. -.true. +.false. +.true. +.true. -.true. -.false. + +.true. .true. +.true. .true. .true. @@ -590,6 +689,16 @@ attributes from the config_cache.xml file (with keys converted to upper-case). >hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.false. glc_nec=10 + + +hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_nitrif_denitrif=.false. use_vertsoilc=.false. use_crop=.false. irrigate=.true. glc_nec=10 + + +hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.false. glc_nec=10 + + hgrid=1.9x2.5 maxpft=79 mask=gx1v7 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.true. glc_nec=10 @@ -606,11 +715,17 @@ attributes from the config_cache.xml file (with keys converted to upper-case). hgrid=1.9x2.5 maxpft=79 mask=gx1v7 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.true. glc_nec=10 +hgrid=1.9x2.5 maxpft=79 mask=gx1v7 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.true. glc_nec=10 + hgrid=1.9x2.5 maxpft=79 mask=gx1v7 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.true. glc_nec=10 +hgrid=1.9x2.5 maxpft=79 mask=gx1v7 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.true. glc_nec=10 + + hgrid=ne120np4.pg3 maxpft=79 mask=tx0.1v3 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.true. glc_nec=10 @@ -773,6 +889,19 @@ p >lnd/clm2/initdata_map/clmi.I1850Clm50SpCru.1706-01-01.0.9x1.25_gx1v7_simyr1850_c200806.nc + +lnd/clm2/initdata_map/clmi.I1850Clm50Sp.0181-01-01.0.9x1.25_gx1v7_simyr1850_c200806.nc + +lnd/clm2/initdata_map/clmi.I1850Clm50BgcCrop-ciso.1366-01-01.0.9x1.25_gx1v7_simyr1850_c200428.nc + lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP5-3.4_16pfts_Irrig_CMIP6_simyr1850-2100_c190228.nc -.true. -.false. +.true. +.true. +.false. 0.0117d00 0.0006d00 @@ -1272,24 +1409,31 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts 0.83d-06 +0.015d00 0.015d00 0.015d00 -20.0d00, 20.0d00, 20.0d00 -200.0d00, 200.0d00, 200.0d00 -20.0d00, 20.0d00, 20.0d00 -200.0d00, 200.0d00, 200.0d00 - -1.50d00 -0.3 -1.50d00 -0.3 - -100.d00 -20.d00 -1.d00 -1.d00 +20.0d00, 20.0d00, 20.0d00 +200.0d00, 200.0d00, 200.0d00 +200.0d00, 200.0d00, 200.0d00 +20.0d00, 20.0d00, 20.0d00 +200.0d00, 200.0d00, 200.0d00 +200.0d00, 200.0d00, 200.0d00 + +1.50d00 +1.50d00 +0.3 +1.50d00 +1.50d00 +0.3 + +100.d00 +100.d00 +20.d00 +1.d00 +1.d00 +1.d00 @@ -1297,13 +1441,17 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts lnd/clm2/snicardata/snicar_drdt_bst_fit_60_c070416.nc -2015 -2101 -2015 +2015 +2101 +2015 + +2015 +2101 +2015 -2015 -2101 -2015 +2015 +2101 +2015 2010 2010 @@ -1323,35 +1471,49 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts 2000 2000 -lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc -lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc +lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc +lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc +lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc -lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP5-8.5-WACCM_1849-2101_monthly_c191007.nc +lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP1-2.6-WACCM_1849-2101_monthly_c191007.nc +lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP2-4.5-WACCM_1849-2101_monthly_c191007.nc +lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP3-7.0-WACCM_1849-2101_monthly_c191007.nc + +lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP5-8.5-WACCM_1849-2101_monthly_c191007.nc -lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP1-2.6-WACCM_1849-2101_monthly_c191007.nc -lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP2-4.5-WACCM_1849-2101_monthly_c191007.nc -lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP3-7.0-WACCM_1849-2101_monthly_c191007.nc -lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP5-8.5-WACCM_1849-2101_monthly_c191007.nc -lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP1-2.6-WACCM_1849-2101_monthly_c191007.nc -lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP5-8.5-WACCM_1849-2101_monthly_c191007.nc -lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP3-7.0-WACCM_1849-2101_monthly_c191007.nc -cycle -NDEP_month -limit +cycle +NDEP_month +limit -cycle -NDEP_month -limit +cycle +NDEP_month +limit + +cycle +NDEP_month +limit bilinear @@ -1372,17 +1534,6 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts lnd/clm2/prescribed_data/LFMIP-pdLC-SST.H2OSOI.0.9x1.25.20levsoi.natveg.climo1980-2014.MONS_c190709.nc -linear - - - -.false. -1997 -1997 -1997 - -lnd/clm2/prescribed_data/LFMIP-pdLC-SST.H2OSOI.0.9x1.25.20levsoi.natveg.1980-2014.MONS_climo.c190716.nc - linear 0 @@ -1417,6 +1568,7 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts none 94x192 94x192 +360x720 360x720 360x720 @@ -1441,13 +1593,17 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts nn -2015 -2100 -2015 +2015 +2100 +2015 + +2015 +2100 +2015 -2015 -2100 -2015 +2015 +2100 +2015 2010 2010 @@ -1542,13 +1698,17 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts nn -2015 -2106 -2015 +2015 +2106 +2015 -2015 -2106 -2015 +2015 +2106 +2015 + +2015 +2106 +2015 2000 2000 @@ -1568,6 +1728,9 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts 1850 2106 +lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc + lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc @@ -3434,8 +3597,9 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts -TWS_inversion -ZWT_inversion +TWS_inversion +TWS_inversion +ZWT_inversion .true. .true. @@ -3487,6 +3651,7 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts +.false. .false. diff --git a/bld/namelist_files/namelist_defaults_ctsm_tools.xml b/bld/namelist_files/namelist_defaults_ctsm_tools.xml index 78ab368110..2a14f2df50 100644 --- a/bld/namelist_files/namelist_defaults_ctsm_tools.xml +++ b/bld/namelist_files/namelist_defaults_ctsm_tools.xml @@ -269,7 +269,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/rawdata/mksrf_urban_0.05x0.05_simyr2000.c120621.nc +>lnd/clm2/rawdata/mksrf_urban_0.05x0.05_simyr2000.c170724.nc lnd/clm2/rawdata/mksrf_urban_0.05x0.05_zerourbanpct.c181014.nc diff --git a/bld/namelist_files/namelist_defaults_drydep.xml b/bld/namelist_files/namelist_defaults_drydep.xml index e73f2987c2..25094e4ea8 100644 --- a/bld/namelist_files/namelist_defaults_drydep.xml +++ b/bld/namelist_files/namelist_defaults_drydep.xml @@ -23,6 +23,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 'ISOP = isoprene', 'C10H16 = pinene_a + carene_3 + thujene_a', 'CH3OH = methanol', 'C2H5OH = ethanol', 'CH2O = formaldehyde', 'CH3CHO = acetaldehyde', 'CH3COOH = acetic_acid', 'CH3COCH3 = acetone' +atm/cam/chem/trop_mozart/emis/megan21_emis_factors_78pft_c20161108.nc atm/cam/chem/trop_mozart/emis/megan21_emis_factors_78pft_c20161108.nc atm/cam/chem/trop_mozart/emis/megan21_emis_factors_78pft_c20161108.nc diff --git a/bld/namelist_files/namelist_defaults_overall.xml b/bld/namelist_files/namelist_defaults_overall.xml index b69f4c138b..5839ef7451 100644 --- a/bld/namelist_files/namelist_defaults_overall.xml +++ b/bld/namelist_files/namelist_defaults_overall.xml @@ -22,18 +22,23 @@ determine default values for namelists. --> -arb_ic -arb_ic -arb_ic -arb_ic -startup -startup -startup -startup -arb_ic -arb_ic -arb_ic -cold +arb_ic +arb_ic +arb_ic +arb_ic +arb_ic +arb_ic +startup +startup +startup +startup +startup +startup +arb_ic +arb_ic +arb_ic +arb_ic +cold arb_ic diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 1bb9f84e7d..618ecd9879 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -49,6 +49,15 @@ Full pathname of master restart file for a branch run. (only used if RUN_TYPE=br (Set with RUN_REFCASE and RUN_REFDATE) + +Component name to use in history and restart files + + + group="cnfire_inparm" valid_values="nofire,li2014qianfrc,li2016crufrc,li2021gswpfrc,spitfire" > The method type to use for CNFire nofire: Turn fire effects off li2014qianfrc: Reference paper Li, et. al.(2014) tuned with QIAN atmospheric forcing li2016crufrc: Reference paper Li, et. al.(2016) tuned with CRU-NCEP atmospheric forcing +li2021gswpfrc: Reference paper Li, et. al.(2021?) tuned with GSWP3 atmospheric forcing + +If TRUE, write master field list to separate file for documentation purposes + + Per file averaging flag. @@ -948,6 +963,12 @@ Whether to use subgrid fluxes for snow Whether snow on the vegetation canopy affects the radiation/albedo calculations + +Whether to run some tests of ncdio_pio as part of the model run. This is +typically only used in automated tests. + + @@ -1089,11 +1110,6 @@ Toggle for vancouver specific logic. Toggle for mexico city specific logic. - -Max number of plant functional types in naturally vegetated landunit. - - @@ -1115,37 +1131,37 @@ If true, this directs the model to collapse the urban landunits to the dominant Percentage threshold above which the model keeps the soil landunit. Selecting the value 0 means DO NOTHING. Default: 0 Percentage threshold above which the model keeps the crop landunit. Selecting the value 0 means DO NOTHING. Default: 0 Percentage threshold above which the model keeps the glacier landunit. Selecting the value 0 means DO NOTHING. Default: 0 Percentage threshold above which the model keeps the lake landunit. Selecting the value 0 means DO NOTHING. Default: 0 Percentage threshold above which the model keeps the wetland landunit. Selecting the value 0 means DO NOTHING. Default: 0 Percentage threshold above which the model keeps the urban landunits. Selecting the value 0 means DO NOTHING. If collapse_urban = .false., the same threshold will apply to all three urban landunits if they are present. If collapse_urban = .true., this threshold will apply to the single collapsed urban landunit if presnet. Default: 0 @@ -1667,37 +1683,6 @@ Filename of input stream data for prescribed soil moisture streams data Time interpolation method to use for prescribed soil moisture streams data - - -Toggle to turn on use of input prescribed soil moisture streams rather than have CLM prognose it (EXPERIMENTAL) - - - -First year to loop over for prescribed soil moisture streams data - - - -Last year to loop over for prescribed soil moisture streams data - - - -Simulation year that aligns with stream_year_first_soilm value - - - -Filename of input stream data for prescribed soil moisture streams data - - - -Time interpolation method to use for prescribed soil moisture streams data - - Offset in time coordinate for soil moisture streams (sec) @@ -1981,7 +1966,7 @@ Land mask description + valid_values="clm4_5_CRUv7,clm4_5_GSWP3v1,clm4_5_cam6.0,clm5_0_cam6.0,clm5_0_CRUv7,clm5_0_GSWP3v1,clm5_1_GSWP3v1"> General configuration of model version and atmospheric forcing to tune the model to run under. This sets the model to run with constants and initial conditions that were set to run well under the configuration of model version and atmospheric forcing. To run well constants would need to be changed @@ -2431,6 +2416,12 @@ If TRUE, apply transient crops from flanduse_timeseries file. (Only valid for transient runs, where there is a flanduse_timeseries file.) + +If TRUE, apply transient lakes from flanduse_timeseries file. +(Only valid for transient runs, where there is a flanduse_timeseries file.) + + If TRUE, apply harvest from flanduse_timeseries file. diff --git a/bld/namelist_files/use_cases/1850_control.xml b/bld/namelist_files/use_cases/1850_control.xml index 501d734129..94ee8c5d0d 100644 --- a/bld/namelist_files/use_cases/1850_control.xml +++ b/bld/namelist_files/use_cases/1850_control.xml @@ -8,6 +8,7 @@ constant +.false. .false. .false. @@ -17,24 +18,37 @@ 1850 1850 +1850 +1850 + 1850 1850 1850 1850 +1850 +1850 + 1850 1850 1850 1850 +1850 +1850 + +lnd/clm2/ndepdata/fndep_clm_WACCM6_CMIP6piControl001_y21-50avg_1850monthly_0.95x1.25_c180802.nc + lnd/clm2/ndepdata/fndep_clm_WACCM6_CMIP6piControl001_y21-50avg_1850monthly_0.95x1.25_c180802.nc lnd/clm2/ndepdata/fndep_clm_WACCM6_CMIP6piControl001_y21-50avg_1850monthly_0.95x1.25_c180802.nc -cycle +cycle +cycle diff --git a/bld/namelist_files/use_cases/1850_noanthro_control.xml b/bld/namelist_files/use_cases/1850_noanthro_control.xml index cc0cc66ccf..c998d97608 100644 --- a/bld/namelist_files/use_cases/1850_noanthro_control.xml +++ b/bld/namelist_files/use_cases/1850_noanthro_control.xml @@ -10,22 +10,17 @@ .false. -1850 -1850 - -1850 -1850 - 1850 1850 1850 1850 -cycle +1850 +1850 -1925 -1925 +cycle +cycle 1925 1925 @@ -33,11 +28,17 @@ 1925 1925 +1925 +1925 + lnd/clm2/firedata/clmforc.no_anthro_zero_hdm_1x1_simyr1925_181113.nc nn +1850 +1850 + 1850 1850 diff --git a/bld/namelist_files/use_cases/2000_control.xml b/bld/namelist_files/use_cases/2000_control.xml index f5d2cd59e9..f3c4980fc8 100644 --- a/bld/namelist_files/use_cases/2000_control.xml +++ b/bld/namelist_files/use_cases/2000_control.xml @@ -8,9 +8,11 @@ constant -.true. -.false. -.false. +.true. +.false. +.true. +.false. +.false. 2000 2000 @@ -18,19 +20,25 @@ 2000 2000 +2000 +2000 + 2000 2000 2000 2000 +2000 +2000 + 2000 2000 2000 2000 -2000 -2000 +2000 +2000 diff --git a/bld/namelist_files/use_cases/2010_control.xml b/bld/namelist_files/use_cases/2010_control.xml index 244009df02..9316ecfb7f 100644 --- a/bld/namelist_files/use_cases/2010_control.xml +++ b/bld/namelist_files/use_cases/2010_control.xml @@ -8,32 +8,44 @@ constant -.true. -.false. -.false. +.true. +.true. +.false. +.true. +.false. +.false. -2010 -2010 +2010 +2010 -2010 -2010 +2010 +2010 -2010 -2010 +2010 +2010 -2010 -2010 +2010 +2010 -2010 -2010 +2010 +2010 -2010 -2010 +2010 +2010 -2010 -2010 +2010 +2010 -2010 -2010 +2010 +2010 + +2010 +2010 + +2010 +2010 + +2010 +2010 diff --git a/bld/namelist_files/use_cases/20thC_transient.xml b/bld/namelist_files/use_cases/20thC_transient.xml index 824f63cdc4..faf0534f34 100644 --- a/bld/namelist_files/use_cases/20thC_transient.xml +++ b/bld/namelist_files/use_cases/20thC_transient.xml @@ -14,9 +14,11 @@ flanduse_timeseries -.true. -.false. -.false. +.true. +.false. +.true. +.false. +.false. 1850 2015 @@ -26,6 +28,10 @@ 2015 1850 +1850 +2015 +1850 + 1850 2016 1850 @@ -34,6 +40,10 @@ 2016 1850 +1850 +2016 +1850 + 1850 2106 1850 @@ -42,8 +52,8 @@ 2106 1850 -1850 -2106 -1850 +1850 +2106 +1850 diff --git a/bld/namelist_files/use_cases/stdurbpt_pd.xml b/bld/namelist_files/use_cases/stdurbpt_pd.xml index 9114742e66..ab1da63bcf 100644 --- a/bld/namelist_files/use_cases/stdurbpt_pd.xml +++ b/bld/namelist_files/use_cases/stdurbpt_pd.xml @@ -18,8 +18,10 @@ 'OFF' -.true. -.false. -.false. +.true. +.false. +.true. +.false. +.false. diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index b43860cb29..e9bebe0a24 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -78,7 +78,7 @@ sub make_config_cache { -Specifies clm physics +Specifies clm physics EOF $fh->close(); @@ -138,9 +138,9 @@ sub make_config_cache { # # Figure out number of tests that will run # -my $ntests = 949; +my $ntests = 1513; if ( defined($opts{'compare'}) ) { - $ntests += 591; + $ntests += 1017; } plan( tests=>$ntests ); @@ -164,7 +164,7 @@ sub make_config_cache { &make_config_cache($phys); my $DOMFILE = "$inputdata_rootdir/atm/datm7/domain.lnd.T31_gx3v7.090928.nc"; -my $real_par_file = "user_nl_clm_real_parameters"; +my $real_par_file = "user_nl_ctsm_real_parameters"; my $bldnml = "../build-namelist -verbose -csmdata $inputdata_rootdir -lnd_frac $DOMFILE -configuration clm -structure standard -glc_nec 10 -no-note -output_reals $real_par_file"; if ( $opts{'test'} ) { $bldnml .= " -test"; @@ -1033,11 +1033,6 @@ sub make_config_cache { GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, - "maxpft_wrong" =>{ options=>"-envxml_dir . -bgc cn", - namelst=>"maxpatch_pft=19", - GLC_TWO_WAY_COUPLING=>"FALSE", - phys=>"clm5_0", - }, "soilm_stream w transient" =>{ options=>"-res 0.9x1.25 -envxml_dir . -use_case 20thC_transient", namelst=>"use_soil_moisture_streams=T,soilm_tintalgo='linear'", GLC_TWO_WAY_COUPLING=>"FALSE", @@ -1071,15 +1066,18 @@ sub make_config_cache { system( "cat $tempfile" ); } +# +# Loop over all physics versions +# +foreach my $phys ( "clm4_5", "clm5_0", "clm5_1" ) { +$mode = "-phys $phys"; +&make_config_cache($phys); print "\n==================================================\n"; -print "Test ALL resolutions with CLM5.0 and SP \n"; +print "Test ALL resolutions with SP\n"; print "==================================================\n"; # Check for ALL resolutions with CLM50SP -$phys = "clm5_0"; -$mode = "-phys $phys"; -&make_config_cache($phys); my $reslist = `../queryDefaultNamelist.pl -res list -s`; my @resolutions = split( / /, $reslist ); my @regional; @@ -1143,16 +1141,13 @@ sub make_config_cache { } print "\n==================================================\n"; -print " Test important resolutions for CLM4.5 and BGC\n"; +print " Test important resolutions for BGC\n"; print "==================================================\n"; -$phys = "clm4_5"; -$mode = "-phys $phys"; -&make_config_cache($phys); my @resolutions = ( "4x5", "10x15", "ne30np4", "ne16np4", "1.9x2.5", "0.9x1.25" ); my @regional; my $nlbgcmode = "bgc"; -my $mode = "clm45-$nlbgcmode"; +my $mode = "$phys-$nlbgcmode"; foreach my $res ( @resolutions ) { chomp($res); print "=== Test $res === \n"; @@ -1210,9 +1205,6 @@ sub make_config_cache { print "==================================================\n"; # Check for crop resolutions -$phys = "clm5_0"; -$mode = "-phys $phys"; -&make_config_cache($phys); my @crop_res = ( "1x1_numaIA", "1x1_smallvilleIA", "4x5", "10x15", "0.9x1.25", "1.9x2.5", "ne30np4" ); foreach my $res ( @crop_res ) { $options = "-bgc bgc -crop -res $res -envxml_dir ."; @@ -1246,9 +1238,6 @@ sub make_config_cache { # use cases, but I've kept these pointing to the equivalent normal use # cases; I'm not sure if it's actually important to test this with all # of the different use cases. -$phys = "clm4_5"; -$mode = "-phys $phys"; -&make_config_cache($phys); my @glc_res = ( "0.9x1.25", "1.9x2.5" ); my @use_cases = ( "1850-2100_SSP1-2.6_transient", "1850-2100_SSP2-4.5_transient", @@ -1288,9 +1277,6 @@ sub make_config_cache { } } # Transient 20th Century simulations -$phys = "clm5_0"; -$mode = "-phys $phys"; -&make_config_cache($phys); my @tran_res = ( "0.9x1.25", "1.9x2.5", "ne30np4", "10x15" ); my $usecase = "20thC_transient"; my $GLC_NEC = 10; @@ -1312,9 +1298,6 @@ sub make_config_cache { &cleanup(); } # Transient ssp_rcp scenarios that work -$phys = "clm5_0"; -$mode = "-phys $phys"; -&make_config_cache($phys); my @tran_res = ( "0.9x1.25", "1.9x2.5", "10x15" ); foreach my $usecase ( "1850_control", "1850-2100_SSP5-8.5_transient", "1850-2100_SSP1-2.6_transient", "1850-2100_SSP3-7.0_transient", "1850-2100_SSP2-4.5_transient" ) { @@ -1342,7 +1325,15 @@ sub make_config_cache { &cleanup(); } } +} # End loop over all physics versions +# +# End loop over versions +# + # The SSP's that fail... +$phys = "clm5_0"; +$mode = "-phys $phys"; +&make_config_cache($phys); my $res = "0.9x1.25"; foreach my $usecase ( "1850-2100_SSP4-3.4_transient", "1850-2100_SSP5-3.4_transient", "1850-2100_SSP1-1.9_transient", "1850-2100_SSP4-6.0_transient" ) { @@ -1354,10 +1345,10 @@ sub make_config_cache { } print "\n==================================================\n"; -print "Test clm4.5/clm5.0 resolutions \n"; +print "Test clm4.5/clm5.0/clm5_1 resolutions \n"; print "==================================================\n"; -foreach my $phys ( "clm4_5", 'clm5_0' ) { +foreach my $phys ( "clm4_5", 'clm5_0', 'clm5_1' ) { my $mode = "-phys $phys"; &make_config_cache($phys); my @clmoptions = ( "-bgc bgc -envxml_dir .", "-bgc bgc -envxml_dir . -clm_accelerated_spinup=on", "-bgc bgc -envxml_dir . -light_res 360x720", @@ -1449,10 +1440,16 @@ sub make_config_cache { my $res = "0.9x1.25"; my $mask = "gx1v6"; my $simyr = "1850"; -foreach my $phys ( "clm4_5", 'clm5_0' ) { +foreach my $phys ( "clm4_5", 'clm5_0', 'clm5_1' ) { my $mode = "-phys $phys"; &make_config_cache($phys); - foreach my $forc ( "CRUv7", "GSWP3v1", "cam6.0" ) { + my @forclist = (); + if ( $phys == "clm5_1" ) { + @forclist = ( "GSWP3v1" ); + } else { + @forclist = ( "CRUv7", "GSWP3v1", "cam6.0" ); + } + foreach my $forc ( @forclist ) { foreach my $bgc ( "sp", "bgc" ) { my $lndtuningmode = "${phys}_${forc}"; my $clmoptions = "-res $res -mask $mask -sim_year $simyr -envxml_dir . -lnd_tuning_mod $lndtuningmode -bgc $bgc"; diff --git a/cime_config/SystemTests/lciso.py b/cime_config/SystemTests/lciso.py index e79af2886b..12a74d5d5c 100644 --- a/cime_config/SystemTests/lciso.py +++ b/cime_config/SystemTests/lciso.py @@ -17,6 +17,7 @@ class LCISO(SystemTestsCompareTwo): def __init__(self, case): + self.comp = case.get_value("COMP_LND") SystemTestsCompareTwo.__init__(self, case, separate_builds = False, run_two_suffix = 'cisoallon', @@ -26,11 +27,11 @@ def __init__(self, case): def _case_one_setup(self): append_to_user_nl_files(caseroot = self._get_caseroot(), - component = "clm", + component = self.comp, contents = "use_c13=F, use_c14=F") def _case_two_setup(self): append_to_user_nl_files(caseroot = self._get_caseroot(), - component = "clm", + component = self.comp, contents = "use_c13=.true.,use_c14=.true.,use_c13_timeseries=.true.,use_c14_bombspike=.true." ) diff --git a/cime_config/SystemTests/lii.py b/cime_config/SystemTests/lii.py index 0bf371ee9a..d89bd0aa09 100644 --- a/cime_config/SystemTests/lii.py +++ b/cime_config/SystemTests/lii.py @@ -1,5 +1,4 @@ -""" -Implementation of the CIME LII test. +"""Implementation of the CIME LII test. This is a CLM specific test: Verifies that interpolation of initial conditions onto an identical @@ -23,10 +22,11 @@ (2) Copy the finidat_interp_dest.nc file from the 'base' case to the inputdata space. Rename this to be similar to the name of the file pointed to in this -test's user_nl_clm file, but with a new creation date. +test's user_nl_ctsm file, but with a new creation date. -(3) Update this test's user_nl_clm file (in the appropriate testmods directory) -to point to the new finidat file. +(3) Update this test's user_nl_ctsm file (in the appropriate testmods directory, or in +namelist_defaults if the test is using an out-of-the-box initial conditions file and it is +acceptable to update that file) to point to the new finidat file. """ from CIME.SystemTests.system_tests_compare_two import SystemTestsCompareTwo diff --git a/cime_config/SystemTests/lii2finidatareas.py b/cime_config/SystemTests/lii2finidatareas.py index 21ba082fff..f7a0a2f10e 100644 --- a/cime_config/SystemTests/lii2finidatareas.py +++ b/cime_config/SystemTests/lii2finidatareas.py @@ -1,17 +1,11 @@ -""" -Implementation of the LII2FINIDATAREAS test. +"""Implementation of the LII2FINIDATAREAS test. This is similar to the LII test, but tests init_interp with mode 'use_finidat_areas'. -As with the standard LII test, this must be used in a configuration for -which we have a compatible out-of-the-box finidat file (so that the run -with use_init_interp = .false. runs successfully). In constrast to our -standard LII test (which uses glcMEC_spunup_1way), this one can use a -standard CISM2%NOEVOLVE configuration: we do *not* need to set -GLC_TWO_WAY_COUPLING=FALSE; in fact, it's a better test if we have -GLC_TWO_WAY_COUPLING=TRUE: with this mode of operation, areas should -match between the two runs. +As with the standard LII test, this must be used in a configuration for which we have a +compatible out-of-the-box finidat file (so that the run with use_init_interp = +.false. runs successfully). It may not be totally necessary to have a system test covering this init_interp_method: between unit tests and inline checks, we have quite @@ -41,7 +35,7 @@ (3) Update namelist defaults to point to the new finidat file. If updating the out-of-the-box file is not desired, then you could instead -point to this new finidat file with a user_nl_clm file in this testmod. +point to this new finidat file with a user_nl_ctsm file in this testmod. """ from CIME.XML.standard_module_setup import * diff --git a/cime_config/SystemTests/lilacsmoke.py b/cime_config/SystemTests/lilacsmoke.py index ed4624ff57..2a566feb60 100644 --- a/cime_config/SystemTests/lilacsmoke.py +++ b/cime_config/SystemTests/lilacsmoke.py @@ -111,6 +111,12 @@ def _build_atm_driver(self): debug=str(self._case.get_value('DEBUG')).upper(), ctsm_mkfile=os.path.join(caseroot, 'lilac_build', 'ctsm.mk')) makecmd = 'make {makevars} atm_driver'.format(makevars=makevars) + + # Normally the user will source either ctsm_build_environment.sh or + # ctsm_build_environment.csh before building the atmosphere model. In the context + # of this test case, case.load_env does the equivalent. + self._case.load_env() + self._run_build_cmd(makecmd, blddir, 'atm_driver.bldlog') def _create_link_to_atm_driver(self): diff --git a/cime_config/SystemTests/soilstructud.py b/cime_config/SystemTests/soilstructud.py index c59ab8b4f6..b454695f6e 100644 --- a/cime_config/SystemTests/soilstructud.py +++ b/cime_config/SystemTests/soilstructud.py @@ -2,10 +2,10 @@ Implementation of the CIME SOILSTRUCTUD test. This is a CLM specific test: -Verifies that a simulation that points to user_nl_clm containing +Verifies that a simulation that points to user_nl_ctsm containing soil_layerstruct_userdefined_nlevsoi = 4 soil_layerstruct_userdefined = 0.1d0,0.3d0,0.6d0,1.0d0,1.0d0 -gives bfb same results as one that points to user_nl_clm containing +gives bfb same results as one that points to user_nl_ctsm containing soil_layerstruct_predefined = '4SL_2m' """ diff --git a/cime_config/buildlib b/cime_config/buildlib index 9e87bad732..1b32e401ed 100755 --- a/cime_config/buildlib +++ b/cime_config/buildlib @@ -1,7 +1,7 @@ #!/usr/bin/env python """ -build clm library +build ctsm library """ import sys, os @@ -64,6 +64,8 @@ def _write_ctsm_mk(gmake, gmake_opts, makefile, exeroot, libroot): # ====================================================================== # The following settings are meant for internal use, and generally # should not be included directly in an atmosphere model's build. +# NOTE: clm library name and subdirectory will eventually need to +# be updated to ctsm. # ====================================================================== CTSM_BLD_DIR = {ctsm_bld_dir} @@ -100,17 +102,21 @@ def _main_func(): #------------------------------------------------------- # create Filepath file #------------------------------------------------------- + compname = case.get_value("COMP_LND") filepath_file = os.path.join(bldroot,"Filepath") if not os.path.isfile(filepath_file): caseroot = case.get_value("CASEROOT") + expect( ((compname == "clm") or (compname == "ctsm")), "Unexpected COMP_LND name: %s" % (compname)) - paths = [os.path.join(caseroot,"SourceMods","src.clm"), + paths = [os.path.join(caseroot,"SourceMods","src."+compname), + os.path.join(lnd_root,"src","cpl",driver), os.path.join(lnd_root,"src","main"), os.path.join(lnd_root,"src","biogeophys"), os.path.join(lnd_root,"src","biogeochem"), os.path.join(lnd_root,"src","soilbiogeochem"), os.path.join(lnd_root,"src","dyn_subgrid"), os.path.join(lnd_root,"src","init_interp"), + os.path.join(lnd_root,"src","self_tests"), os.path.join(lnd_root,"src","fates"), os.path.join(lnd_root,"src","fates","main"), os.path.join(lnd_root,"src","fates","biogeophys"), @@ -119,7 +125,7 @@ def _main_func(): os.path.join(lnd_root,"src","fates","parteh"), os.path.join(lnd_root,"src","utils"), os.path.join(lnd_root,"src","cpl"), - os.path.join(lnd_root,"src","cpl",driver)] + os.path.join(lnd_root,"src","cpl","utils")] if lilac_mode == 'on': paths.append(os.path.join(lnd_root,"lilac","src")) @@ -135,10 +141,10 @@ def _main_func(): # create the library in libroot #------------------------------------------------------- - complib = os.path.join(libroot,"libclm.a") + complib = os.path.join(libroot,"lib%s.a"%(compname)) - cmd = "{} complib -j {} MODEL=clm COMPLIB={} -f {} {}" \ - .format(gmake, gmake_j, complib, makefile, gmake_opts) + cmd = "{} complib -j {} MODEL={} COMPLIB={} -f {} {}" \ + .format(gmake, gmake_j, compname, complib, makefile, gmake_opts) rc, out, err = run_cmd(cmd) logger.info("%s: \n\n output:\n %s \n\n err:\n\n%s\n"%(cmd,out,err)) diff --git a/cime_config/buildnml b/cime_config/buildnml index a33fadb864..f60206a01d 100755 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -1,7 +1,7 @@ #!/usr/bin/env python """ -CLM namelist creator +CTSM namelist creator """ import sys, os, shutil @@ -23,17 +23,17 @@ _config_cache_template = """ -Specifies clm physics +Specifies CTSM physics """ ############################################################################### def buildnml(case, caseroot, compname): ############################################################################### - """Build the clm namelist """ + """Build the CTSM namelist """ # Build the component namelist - if compname != "clm": + if compname != "ctsm" and compname != "clm": raise AttributeError lnd_root = case.get_value("COMP_ROOT_DIR_LND") @@ -63,12 +63,12 @@ def buildnml(case, caseroot, compname): mask = case.get_value("MASK_GRID") # ----------------------------------------------------- - # Set clmconf + # Set ctsmconf # ----------------------------------------------------- - clmconf = os.path.join(caseroot, "Buildconf", "clmconf") - if not os.path.isdir(clmconf): - os.makedirs(clmconf) + ctsmconf = os.path.join(caseroot, "Buildconf", compname+"conf") + if not os.path.isdir(ctsmconf): + os.makedirs(ctsmconf) # ----------------------------------------------------- # Create config_cache.xml file @@ -80,7 +80,7 @@ def buildnml(case, caseroot, compname): clm_phys = case.get_value("CLM_PHYSICS_VERSION") config_cache_text = _config_cache_template.format(clm_phys=clm_phys) - config_cache_path = os.path.join(caseroot, "Buildconf", "clmconf", "config_cache.xml") + config_cache_path = os.path.join(caseroot, "Buildconf", compname+"conf", "config_cache.xml") with open(config_cache_path, 'w') as config_cache_file: config_cache_file.write(config_cache_text) @@ -148,13 +148,13 @@ def buildnml(case, caseroot, compname): spinup = "-clm_accelerated_spinup %s "%clm_accelerated_spinup - infile = os.path.join(clmconf, "namelist") + infile = os.path.join(ctsmconf, "namelist") - inputdata_file = os.path.join(caseroot,"Buildconf","clm.input_data_list") + inputdata_file = os.path.join(caseroot,"Buildconf","ctsm.input_data_list") lndfrac_file = os.path.join(lnd_domain_path,lnd_domain_file) - config_cache_file = os.path.join(caseroot,"Buildconf","clmconf","config_cache.xml") + config_cache_file = os.path.join(caseroot,"Buildconf", compname+"conf","config_cache.xml") # ----------------------------------------------------- # Clear out old data @@ -188,11 +188,19 @@ def buildnml(case, caseroot, compname): # ----------------------------------------------------- if run_type == "hybrid" or run_type == "branch": - clm_startfile = "%s.clm2%s.r.%s-%s.nc"%(run_refcase,inst_string,run_refdate,run_reftod) - if not os.path.exists(os.path.join(rundir, clm_startfile)): - clm_startfile = "%s.clm2.r.%s-%s.nc"%(run_refcase,run_refdate,run_reftod) - logger.warning( "WARNING: the start file being used for a multi-instance case is a single instance: "+clm_startfile ) + compnames = [ "clm4", "clm5", "clm2" ] + for comp in compnames: + clm_startfile = "%s.%s%s.r.%s-%s.nc"%(run_refcase,comp,inst_string,run_refdate,run_reftod) + if os.path.exists(os.path.join(rundir, clm_startfile)): + break + else: + clm_startfile = "%s.%s.r.%s-%s.nc"%(run_refcase,comp,run_refdate,run_reftod) + if os.path.exists(os.path.join(rundir, clm_startfile)): + logger.warning( "WARNING: the start file being used for a multi-instance case is a single instance: "+clm_startfile ) + break + if not os.path.exists(os.path.join(rundir, clm_startfile)): + logger.warning( "WARNING: Could NOT find a start file to use using"+clm_startfile ) clm_icfile = "%s = \'%s\'"%(startfile_type, clm_startfile) else: clm_icfile = "" @@ -201,7 +209,7 @@ def buildnml(case, caseroot, compname): infile_lines.append(clm_icfile) user_nl_file = os.path.join(caseroot, "user_nl_clm" + inst_string) - namelist_infile = os.path.join(clmconf, "namelist") + namelist_infile = os.path.join(ctsmconf, "namelist") create_namelist_infile(case, user_nl_file, namelist_infile, "\n".join(infile_lines)) @@ -218,7 +226,7 @@ def buildnml(case, caseroot, compname): lndfrac_file, glc_nec, ccsm_co2_ppmv, clm_co2_type, config_cache_file, clm_bldnml_opts, spinup, tuning, gridmask)) - rc, out, err = run_cmd(command, from_dir=clmconf) + rc, out, err = run_cmd(command, from_dir=ctsmconf) expect(rc==0,"Command %s failed rc=%d\nout=%s\nerr=%s"%(cmd,rc,out,err)) if out is not None: logger.debug(" %s"%out) @@ -230,11 +238,11 @@ def buildnml(case, caseroot, compname): # ----------------------------------------------------- if os.path.isdir(rundir): - file1 = os.path.join(clmconf, "lnd_in") + file1 = os.path.join(ctsmconf, "lnd_in") file2 = os.path.join(rundir, "lnd_in") if ninst > 1: file2 += inst_string - logger.debug("CLM namelist copy: file1 %s file2 %s " %(file1, file2)) + logger.debug("CTSM namelist copy: file1 %s file2 %s " %(file1, file2)) shutil.copy(file1,file2) ############################################################################### @@ -242,7 +250,8 @@ def _main_func(): caseroot = parse_input(sys.argv) with Case(caseroot) as case: - buildnml(case, caseroot, "clm") + compname = case.get_value("COMP_LND") + buildnml(case, caseroot, compname) if __name__ == "__main__": _main_func() diff --git a/cime_config/config_archive.xml b/cime_config/config_archive.xml index bc9f1d6c0a..c219a1d1ef 100644 --- a/cime_config/config_archive.xml +++ b/cime_config/config_archive.xml @@ -25,4 +25,25 @@ anothercasename.clm2.i.1976-01-01-00000.nc + + r + rh\d? + h\d*.*\.nc$ + e + locfnh + + rpointer.lnd$NINST_STRING + ./$CASE.ctsm$NINST_STRING.r.$DATENAME.nc + + + rpointer.lnd + rpointer.lnd_9999 + casename.ctsm.r.1976-01-01-00000.nc + casename.ctsm.rh4.1976-01-01-00000.nc + casename.ctsm.h0.1976-01-01-00000.nc + casename.ctsm.h0.1976-01-01-00000.nc.base + casename.ctsm_0002.e.postassim.1976-01-01-00000.nc + casename.ctsm_0002.e.preassim.1976-01-01-00000.nc + + diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 545c17d9c4..51f8e4bd96 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -16,6 +16,7 @@ clm4.5: clm5.0: + clm5.1: Satellite phenology: CN: Carbon Nitrogen model CNDV: CN with Dynamic Vegetation (deprecated) @@ -36,11 +37,14 @@ NWP configuration with satellite phenology: NWP configuration with BGC and CROP: - char - clm - clm + clm,ctsm + UNSET + + clm + ctsm + case_comp env_case.xml Name of land component @@ -50,19 +54,19 @@ char on,off off - build_component_clm + build_component_ctsm env_build.xml Flag to enable building the LILAC cap and coupling code char - run_component_clm + run_component_ctsm env_run.xml Tuning parameters and initial conditions should be optimized for what CLM model version and what meteorlogical forcing combination? UNSET - clm5_0_cam6.0,clm5_0_GSWP3v1,clm5_0_CRUv7,clm4_5_CRUv7,clm4_5_GSWP3v1,clm4_5_cam6.0 + clm5_0_cam6.0,clm5_0_GSWP3v1,clm5_0_CRUv7,clm4_5_CRUv7,clm4_5_GSWP3v1,clm4_5_cam6.0,clm5_1_GSWP3v1 clm4_5_CRUv7 clm4_5_CRUv7 @@ -72,22 +76,24 @@ clm5_0_CRUv7 clm5_0_GSWP3v1 clm5_0_cam6.0 + clm5_1_GSWP3v1 char - clm4_5,clm5_0 + clm4_5,clm5_0,clm5_1 UNSET - clm4_5 - clm5_0 + clm4_5 + clm5_0 + clm5_1 - run_component_clm + run_component_ctsm env_run.xml Overall physics version to use. This sets the default values for many different namelist options. @@ -101,7 +107,7 @@ nwp - run_component_clm + run_component_ctsm env_run.xml Sets CLM default namelist options related to model configuration. clm: Configuration used for climate applications (CLM) @@ -116,7 +122,7 @@ fast - run_component_clm + run_component_ctsm env_run.xml Sets CLM default namelist options related to model structure. standard: Standard model structure, allowing for more subgrid heterogeneity, @@ -148,7 +154,7 @@ 20thC_transient 1850-2100_SSP5-8.5_transient - run_component_clm + run_component_ctsm env_run.xml CLM namelist use_case. Determines the use-case that will be sent to the CLM build-namelist utility. @@ -185,8 +191,13 @@ -bgc bgc -dynamic_vegetation -crop -bgc sp -vichydro -bgc fates -no-megan + + -bgc sp + -bgc bgc + -bgc bgc -crop + -bgc fates -no-megan - run_component_clm + run_component_ctsm env_run.xml CLM build-namelist options @@ -202,7 +213,7 @@ diagnostic diagnostic - run_component_clm + run_component_ctsm env_run.xml Determines how CLM will determine where CO2 is set. If value is constant, it will be set to CCSM_CO2_PPMV, @@ -217,7 +228,7 @@ char - run_component_clm + run_component_ctsm env_run.xml CLM-specific namelist settings for -namelist option in the CLM build-namelist. CLM_NAMELIST_OPTS is normally set as a compset variable @@ -232,7 +243,7 @@ char on,off off - run_component_clm + run_component_ctsm env_run.xml Turn on any settings for accellerating the model spinup. @@ -241,7 +252,7 @@ char UNSET - run_component_clm + run_component_ctsm env_run.xml Dataset name for user-created datasets. This is used as the argument in Buildconf/clm.buildnml to build-namelist -clm_usr_name. An example of @@ -253,13 +264,13 @@ char on,off off - run_component_clm + run_component_ctsm env_run.xml Flag to the CLM build-namelist command to force CLM to do a cold start (finidat will be set to blanks). A value of on forces the model to spin up from a cold-start (arbitrary initial conditions). Setting this value in the xml file will take - precedence over any settings for finidat in the $CASEROOT/user_clm_clm file. + precedence over any settings for finidat in the $CASEROOT/user_nl_ctsm file. @@ -272,7 +283,7 @@ $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_waccm_deck $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_waccm_nociso_deck - run_component_clm + run_component_ctsm env_case.xml User mods to apply to specific compset matches. diff --git a/cime_config/config_compsets.xml b/cime_config/config_compsets.xml index 598aa7bb2e..de0139fc63 100644 --- a/cime_config/config_compsets.xml +++ b/cime_config/config_compsets.xml @@ -14,7 +14,7 @@ Where for the CAM specific compsets below the following is supported TIME = Time period (e.g. 2000, HIST, SSP585...) ATM = [CAM40, CAM50, CAM55] - LND = [CLM45, CLM50, SLND] + LND = [CLM45, CLM50, CLM51, SLND] ICE = [CICE, DICE, SICE] OCN = [DOCN, ,AQUAP, SOCN] ROF = [RTM, SROF] @@ -37,12 +37,17 @@ - I1PtClm50SpRsGs + I1PtClm51SpRs + 2000_DATM%1PT_CLM51%SP_SICE_SOCN_SROF_SGLC_SWAV + + + + I1PtClm50SpRs 2000_DATM%1PT_CLM50%SP_SICE_SOCN_SROF_SGLC_SWAV - I1PtClm45SpRsGs + I1PtClm45SpRs 2000_DATM%1PT_CLM45%SP_SICE_SOCN_SROF_SGLC_SWAV @@ -50,293 +55,308 @@ I2000Clm50Sp - 2000_DATM%GSWP3v1_CLM50%SP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + 2000_DATM%GSWP3v1_CLM50%SP_SICE_SOCN_MOSART_SGLC_SWAV - I2000Clm50SpRsGs + I2000Clm50SpRs 2000_DATM%GSWP3v1_CLM50%SP_SICE_SOCN_SROF_SGLC_SWAV + + I2000Clm51Sp + 2000_DATM%GSWP3v1_CLM51%SP_SICE_SOCN_MOSART_SGLC_SWAV + + + + + I2000Clm51SpRs + 2000_DATM%GSWP3v1_CLM51%SP_SICE_SOCN_SROF_SGLC_SWAV + + - I2000Clm50SpRtmGs + I2000Clm50SpRtm 2000_DATM%GSWP3v1_CLM50%SP_SICE_SOCN_RTM_SGLC_SWAV + + I2000Clm50SpMizGs + 2000_DATM%GSWP3v1_CLM50%SP_SICE_SOCN_MIZUROUTE_SGLC_SWAV + + I2010Clm50Sp - 2010_DATM%GSWP3v1_CLM50%SP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + 2010_DATM%GSWP3v1_CLM50%SP_SICE_SOCN_MOSART_SGLC_SWAV I2000Clm50BgcCru - 2000_DATM%CRUv7_CLM50%BGC_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + 2000_DATM%CRUv7_CLM50%BGC_SICE_SOCN_MOSART_SGLC_SWAV I2000Clm50BgcCropRtm - 2000_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_RTM_CISM2%NOEVOLVE_SWAV + 2000_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_RTM_SGLC_SWAV - - I2000Clm50BgcCropRtmGs - 2000_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_RTM_SGLC_SWAV + I2000Clm50BgcCrop + 2000_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_SGLC_SWAV - I2000Clm50BgcCrop - 2000_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + I2000Clm51BgcCrop + 2000_DATM%GSWP3v1_CLM51%BGC-CROP_SICE_SOCN_MOSART_SGLC_SWAV + + + + I2000Clm51Bgc + 2000_DATM%GSWP3v1_CLM51%BGC_SICE_SOCN_MOSART_SGLC_SWAV I2000Clm50Cn - 2000_DATM%GSWP3v1_CLM50%CN_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + 2000_DATM%GSWP3v1_CLM50%CN_SICE_SOCN_MOSART_SGLC_SWAV I1850Clm50Sp - 1850_DATM%GSWP3v1_CLM50%SP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + 1850_DATM%GSWP3v1_CLM50%SP_SICE_SOCN_MOSART_SGLC_SWAV I1850Clm50SpCru - 1850_DATM%CRUv7_CLM50%SP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + 1850_DATM%CRUv7_CLM50%SP_SICE_SOCN_MOSART_SGLC_SWAV I1850Clm50BgcCrop - 1850_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + 1850_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_SGLC_SWAV - - I1850Clm50BgcCropCmip6 - 1850_DATM%GSWP3v1_CLM50%BGC-CROP-CMIP6DECK_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + I1850Clm51Sp + 1850_DATM%GSWP3v1_CLM51%SP_SICE_SOCN_MOSART_SGLC_SWAV - - I1850Clm50BgcCropCmip6waccm - 1850_DATM%GSWP3v1_CLM50%BGC-CROP-CMIP6WACCMDECK_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + I1850Clm51Bgc + 1850_DATM%GSWP3v1_CLM51%BGC_SICE_SOCN_MOSART_SGLC_SWAV - - I1850Clm50BgcCropCru - 1850_DATM%CRUv7_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV - - - + - I2000Clm50SpGs - 2000_DATM%GSWP3v1_CLM50%SP_SICE_SOCN_MOSART_SGLC_SWAV + I1850Clm50BgcCropCmip6 + 1850_DATM%GSWP3v1_CLM50%BGC-CROP-CMIP6DECK_SICE_SOCN_MOSART_SGLC_SWAV - + - I2000Clm50BgcCropGs - 2000_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_SGLC_SWAV + I1850Clm50BgcCropCmip6waccm + 1850_DATM%GSWP3v1_CLM50%BGC-CROP-CMIP6WACCMDECK_SICE_SOCN_MOSART_SGLC_SWAV - - I2000Clm50BgcCropQianRsGs - 2000_DATM%QIA_CLM50%BGC-CROP_SICE_SOCN_SROF_SGLC_SWAV + I1850Clm50BgcCropCru + 1850_DATM%CRUv7_CLM50%BGC-CROP_SICE_SOCN_MOSART_SGLC_SWAV + + + atm forcing to speed up datm, SROF to speed up build and run --> - I2000Clm50BgcCropQianRsGs + I2000Clm50BgcCropQianRs 2000_DATM%QIA_CLM50%BGC-CROP_SICE_SOCN_SROF_SGLC_SWAV - I2000Clm45BgcCropQianRsGs + I2000Clm45BgcCropQianRs 2000_DATM%QIA_CLM45%BGC-CROP_SICE_SOCN_SROF_SGLC_SWAV - I2000Clm50BgcCruGs - 2000_DATM%CRUv7_CLM50%BGC_SICE_SOCN_MOSART_SGLC_SWAV - - - - I2000Clm50BgcCruRsGs + I2000Clm50BgcCruRs 2000_DATM%CRUv7_CLM50%BGC_SICE_SOCN_SROF_SGLC_SWAV I2000Clm50SpRtmFl - 2000_DATM%GSWP3v1_CLM50%SP_SICE_SOCN_RTM%FLOOD_CISM2%NOEVOLVE_SWAV + 2000_DATM%GSWP3v1_CLM50%SP_SICE_SOCN_RTM%FLOOD_SGLC_SWAV - I2000Clm50Fates - 2000_DATM%GSWP3v1_CLM50%FATES_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + I2000Clm51Fates + 2000_DATM%GSWP3v1_CLM51%FATES_SICE_SOCN_MOSART_SGLC_SWAV - I2000Clm50FatesCruGs - 2000_DATM%CRUv7_CLM50%FATES_SICE_SOCN_MOSART_SGLC_SWAV + I2000Clm50Fates + 2000_DATM%GSWP3v1_CLM50%FATES_SICE_SOCN_MOSART_SGLC_SWAV - - - I2000Clm50FatesRsGs - 2000_DATM%GSWP3v1_CLM50%FATES_SICE_SOCN_SROF_SGLC_SWAV + I2000Clm50FatesCru + 2000_DATM%CRUv7_CLM50%FATES_SICE_SOCN_MOSART_SGLC_SWAV - I2000Clm50FatesRsGs + I2000Clm50FatesRs 2000_DATM%GSWP3v1_CLM50%FATES_SICE_SOCN_SROF_SGLC_SWAV I1850Clm50Bgc - 1850_DATM%GSWP3v1_CLM50%BGC_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + 1850_DATM%GSWP3v1_CLM50%BGC_SICE_SOCN_MOSART_SGLC_SWAV I1850Clm50BgcNoAnthro - 1850_DATM%GSWP3v1_CLM50%BGC-NOANTHRO_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + 1850_DATM%GSWP3v1_CLM50%BGC-NOANTHRO_SICE_SOCN_MOSART_SGLC_SWAV I1850Clm50SpNoAnthro - 1850_DATM%GSWP3v1_CLM50%SP-NOANTHRO_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + 1850_DATM%GSWP3v1_CLM50%SP-NOANTHRO_SICE_SOCN_MOSART_SGLC_SWAV IHistClm50BgcCrop - HIST_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + HIST_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_SGLC_SWAV - IHistClm50Sp - HIST_DATM%GSWP3v1_CLM50%SP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV - - + I1850Clm51SpNoAnthro + 1850_DATM%GSWP3v1_CLM51%SP-NOANTHRO_SICE_SOCN_MOSART_SGLC_SWAV + + + + IHistClm51Sp + HIST_DATM%GSWP3v1_CLM51%SP_SICE_SOCN_MOSART_SGLC_SWAV - IHistClm50SpGs - HIST_DATM%GSWP3v1_CLM50%SP_SICE_SOCN_MOSART_SGLC_SWAV + IHistClm51Bgc + HIST_DATM%GSWP3v1_CLM51%BGC_SICE_SOCN_MOSART_SGLC_SWAV + + IHistClm51BgcCrop + HIST_DATM%GSWP3v1_CLM51%BGC-CROP_SICE_SOCN_MOSART_SGLC_SWAV + + + + IHistClm50Sp + HIST_DATM%GSWP3v1_CLM50%SP_SICE_SOCN_MOSART_SGLC_SWAV + + + IHistClm50SpCru - HIST_DATM%CRUv7_CLM50%SP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + HIST_DATM%CRUv7_CLM50%SP_SICE_SOCN_MOSART_SGLC_SWAV IHistClm50Bgc - HIST_DATM%GSWP3v1_CLM50%BGC_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + HIST_DATM%GSWP3v1_CLM50%BGC_SICE_SOCN_MOSART_SGLC_SWAV - + - IHistClm50BgcQianGs + IHistClm50BgcQian HIST_DATM%QIA_CLM50%BGC_SICE_SOCN_MOSART_SGLC_SWAV - IHistClm50BgcQianRsGs + IHistClm50BgcQianRs HIST_DATM%QIA_CLM50%BGC_SICE_SOCN_SROF_SGLC_SWAV ISSP585Clm50BgcCrop - SSP585_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + SSP585_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_SGLC_SWAV ISSP126Clm50BgcCrop - SSP126_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + SSP126_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_SGLC_SWAV ISSP119Clm50BgcCrop - SSP119_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + SSP119_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_SGLC_SWAV ISSP245Clm50BgcCrop - SSP245_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + SSP245_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_SGLC_SWAV ISSP370Clm50BgcCrop - SSP370_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + SSP370_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_SGLC_SWAV ISSP434Clm50BgcCrop - SSP434_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + SSP434_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_SGLC_SWAV ISSP460Clm50BgcCrop - SSP460_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + SSP460_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_SGLC_SWAV ISSP534Clm50BgcCrop - SSP534_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + SSP534_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_SGLC_SWAV - + - IHistClm50BgcCropQianRsGs + IHistClm50BgcCropQianRs HIST_DATM%QIA_CLM50%BGC-CROP_SICE_SOCN_SROF_SGLC_SWAV - + - IHistClm50BgcCropRsGs + IHistClm50BgcCropRs HIST_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_SROF_SGLC_SWAV I2000Clm50BgcDvCrop - 2000_DATM%GSWP3v1_CLM50%BGCDV-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + 2000_DATM%GSWP3v1_CLM50%BGCDV-CROP_SICE_SOCN_MOSART_SGLC_SWAV - I2000Clm50BgcDvCropQianRsGs + I2000Clm50BgcDvCropQianRs 2000_DATM%QIA_CLM50%BGCDV-CROP_SICE_SOCN_SROF_SGLC_SWAV @@ -344,33 +364,33 @@ I1850Clm50BgcSpinup - 1850_DATM%CPLHIST_CLM50%BGC_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + 1850_DATM%CPLHIST_CLM50%BGC_SICE_SOCN_MOSART_SGLC_SWAV - I2000Ctsm50NwpSpGswpGs + I2000Ctsm50NwpSpGswp 2000_DATM%GSWP3v1_CLM50%NWP-SP_SICE_SOCN_MOSART_SGLC_SWAV - I2000Ctsm50NwpBgcCropGswpGs + I2000Ctsm50NwpBgcCropGswp 2000_DATM%GSWP3v1_CLM50%NWP-BGC-CROP_SICE_SOCN_MOSART_SGLC_SWAV - I2000Ctsm50NwpSpNldasGs + I2000Ctsm50NwpSpNldas 2000_DATM%NLDAS2_CLM50%NWP-SP_SICE_SOCN_MOSART_SGLC_SWAV - I2000Ctsm50NwpSpNldasRsGs + I2000Ctsm50NwpSpNldasRs 2000_DATM%NLDAS2_CLM50%NWP-SP_SICE_SOCN_SROF_SGLC_SWAV @@ -378,11 +398,11 @@ I1850Clm45BgcCrop - 1850_DATM%GSWP3v1_CLM45%BGC-CROP_SICE_SOCN_RTM_CISM2%NOEVOLVE_SWAV + 1850_DATM%GSWP3v1_CLM45%BGC-CROP_SICE_SOCN_RTM_SGLC_SWAV - I1850Clm45BgcCruGs + I1850Clm45BgcCru 1850_DATM%CRUv7_CLM45%BGC_SICE_SOCN_RTM_SGLC_SWAV @@ -391,86 +411,66 @@ IHistClm45BgcCrop - HIST_DATM%GSWP3v1_CLM45%BGC-CROP_SICE_SOCN_RTM_CISM2%NOEVOLVE_SWAV + HIST_DATM%GSWP3v1_CLM45%BGC-CROP_SICE_SOCN_RTM_SGLC_SWAV - IHistClm45BgcCropQianRsGs + IHistClm45BgcCropQianRs HIST_DATM%QIA_CLM45%BGC-CROP_SICE_SOCN_SROF_SGLC_SWAV I2000Clm45Sp - 2000_DATM%GSWP3v1_CLM45%SP_SICE_SOCN_RTM_CISM2%NOEVOLVE_SWAV + 2000_DATM%GSWP3v1_CLM45%SP_SICE_SOCN_RTM_SGLC_SWAV I2000Clm45BgcCrop - 2000_DATM%GSWP3v1_CLM45%BGC-CROP_SICE_SOCN_RTM_CISM2%NOEVOLVE_SWAV + 2000_DATM%GSWP3v1_CLM45%BGC-CROP_SICE_SOCN_RTM_SGLC_SWAV I2000Clm45Fates - 2000_DATM%GSWP3v1_CLM45%FATES_SICE_SOCN_RTM_CISM2%NOEVOLVE_SWAV + 2000_DATM%GSWP3v1_CLM45%FATES_SICE_SOCN_RTM_SGLC_SWAV - + - I2000Clm45FatesRsGs - 2000_DATM%GSWP3v1_CLM45%FATES_SICE_SOCN_SROF_SGLC_SWAV - - - - I2000Clm45FatesRsGs + I2000Clm45FatesRs 2000_DATM%GSWP3v1_CLM45%FATES_SICE_SOCN_SROF_SGLC_SWAV I1850Clm45Cn - 1850_DATM%GSWP3v1_CLM45%CN_SICE_SOCN_RTM_CISM2%NOEVOLVE_SWAV + 1850_DATM%GSWP3v1_CLM45%CN_SICE_SOCN_RTM_SGLC_SWAV I1850Clm45Bgc - 1850_DATM%GSWP3v1_CLM45%BGC_SICE_SOCN_RTM_CISM2%NOEVOLVE_SWAV - - - - I1850Clm45BgcGs 1850_DATM%GSWP3v1_CLM45%BGC_SICE_SOCN_RTM_SGLC_SWAV - - I1850Clm45BgcCru - 1850_DATM%CRUv7_CLM45%BGC_SICE_SOCN_RTM_CISM2%NOEVOLVE_SWAV - - IHistClm45Bgc - HIST_DATM%GSWP3v1_CLM45%BGC_SICE_SOCN_RTM_CISM2%NOEVOLVE_SWAV - - - - IHistClm45BgcGs HIST_DATM%GSWP3v1_CLM45%BGC_SICE_SOCN_RTM_SGLC_SWAV - IHistClm45BgcCruGs + IHistClm45BgcCru HIST_DATM%CRUv7_CLM45%BGC_SICE_SOCN_RTM_SGLC_SWAV - IHistClm45SpGs + IHistClm45Sp HIST_DATM%GSWP3v1_CLM45%SP_SICE_SOCN_RTM_SGLC_SWAV @@ -479,11 +479,11 @@ I2000Clm50Vic - 2000_DATM%GSWP3v1_CLM50%SP-VIC_SICE_SOCN_RTM_CISM2%NOEVOLVE_SWAV + 2000_DATM%GSWP3v1_CLM50%SP-VIC_SICE_SOCN_RTM_SGLC_SWAV I2000Clm45VicCru - 2000_DATM%CRUv7_CLM45%SP-VIC_SICE_SOCN_RTM_CISM2%NOEVOLVE_SWAV + 2000_DATM%CRUv7_CLM45%SP-VIC_SICE_SOCN_RTM_SGLC_SWAV @@ -503,13 +503,6 @@ 1850_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%EVOLVE_SWAV - - IHistClm40SpGswGs - HIST_DATM%GSWP3v1_CLM40%SP_SICE_SOCN_RTM_SGLC_SWAV - - - - IHistClm50BgcCropG HIST_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%EVOLVE_SWAV @@ -523,7 +516,7 @@ tests, but it seems most intuitive to use the same compset for both purposes.) --> - I2000Ctsm50NwpSpAsRsGs + I2000Ctsm50NwpSpAsRs 2000_SATM_CLM50%NWP-SP_SICE_SOCN_SROF_SGLC_SWAV diff --git a/cime_config/config_pes.xml b/cime_config/config_pes.xml index d391f2b9d1..909c0d8049 100644 --- a/cime_config/config_pes.xml +++ b/cime_config/config_pes.xml @@ -757,14 +757,14 @@ -48 - 2 - 2 - 2 - 2 - 2 - 2 - 2 - 2 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 0 @@ -831,14 +831,14 @@ -48 - 2 - 2 - 2 - 2 - 2 - 2 - 2 - 2 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 0 diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index e54a1ff969..8cfd8db6e6 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1,6 +1,6 @@ - + @@ -8,7 +8,7 @@ - + @@ -17,7 +17,7 @@ - + @@ -26,16 +26,27 @@ - + - + + + + + + + + + + + + - + - + @@ -44,16 +55,16 @@ - + - + - + - + @@ -78,16 +89,47 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + @@ -97,7 +139,7 @@ - + @@ -130,7 +172,7 @@ - + @@ -139,7 +181,7 @@ - + @@ -148,7 +190,7 @@ - + @@ -156,7 +198,7 @@ - + @@ -164,7 +206,7 @@ - + @@ -172,7 +214,7 @@ - + @@ -181,7 +223,15 @@ - + + + + + + + + + @@ -189,7 +239,7 @@ - + @@ -197,7 +247,7 @@ - + @@ -206,7 +256,7 @@ - + @@ -215,12 +265,33 @@ - + - + + + + + + + + + + + + + + + + + + + + + + @@ -231,13 +302,33 @@ - + + + + + + + + + + + - + + + + + + + + + + + @@ -249,7 +340,7 @@ - + @@ -257,7 +348,7 @@ - + @@ -265,7 +356,7 @@ - + @@ -273,7 +364,7 @@ - + @@ -281,7 +372,7 @@ - + @@ -290,12 +381,13 @@ - + + @@ -332,7 +424,36 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -340,7 +461,7 @@ - + @@ -349,7 +470,7 @@ - + @@ -384,7 +505,7 @@ - + @@ -392,7 +513,7 @@ - + @@ -400,7 +521,7 @@ - + @@ -408,7 +529,7 @@ - + @@ -416,7 +537,7 @@ - + @@ -425,7 +546,7 @@ - + @@ -434,7 +555,7 @@ - + @@ -462,7 +583,7 @@ - + @@ -504,7 +625,7 @@ - + @@ -554,6 +675,26 @@ + + + + + + + + + + + + + + + + + + + + @@ -562,7 +703,7 @@ - + @@ -570,7 +711,7 @@ - + @@ -578,7 +719,7 @@ - + @@ -586,7 +727,7 @@ - + @@ -603,13 +744,24 @@ - + - + + + + + + + + + + + + - + @@ -618,7 +770,7 @@ - + @@ -665,16 +817,56 @@ - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -682,7 +874,27 @@ - + + + + + + + + + + + + + + + + + + + + + @@ -736,7 +948,7 @@ - + @@ -809,13 +1021,13 @@ - + - + - - + + @@ -827,7 +1039,7 @@ - + @@ -851,6 +1063,7 @@ + @@ -864,7 +1077,7 @@ - + @@ -874,7 +1087,7 @@ - + @@ -883,7 +1096,7 @@ - + @@ -891,7 +1104,7 @@ - + @@ -899,7 +1112,7 @@ - + @@ -916,7 +1129,7 @@ - + @@ -933,7 +1146,7 @@ - + @@ -942,7 +1155,7 @@ - + @@ -950,7 +1163,7 @@ - + @@ -959,7 +1172,7 @@ - + @@ -968,7 +1181,7 @@ - + @@ -977,7 +1190,7 @@ - + @@ -986,7 +1199,7 @@ - + @@ -1005,7 +1218,7 @@ - + @@ -1023,7 +1236,7 @@ - + @@ -1031,7 +1244,7 @@ - + @@ -1049,7 +1262,7 @@ - + @@ -1059,13 +1272,13 @@ - + - + @@ -1077,7 +1290,7 @@ - + @@ -1086,7 +1299,7 @@ - + @@ -1105,7 +1318,7 @@ - + @@ -1114,7 +1327,7 @@ - + @@ -1159,41 +1372,61 @@ - + - + +for ERS test as otherwise it won't work for a sub-day test (no need to run this high core count test with every tag, but include it in the less frequent ctsm_sci testing)" - + - - + + - + - + - + - + + + + + + + + + + + + + + + + + + + + + @@ -1223,7 +1456,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1242,7 +1475,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1250,7 +1483,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1258,7 +1491,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1268,7 +1501,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1299,7 +1532,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1318,7 +1551,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1328,7 +1561,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1336,7 +1569,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1354,7 +1587,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1364,7 +1597,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1374,7 +1607,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1383,7 +1616,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1392,6 +1625,16 @@ for ERS test as otherwise it won't work for a sub-day test" + + + + + + + + + + @@ -1402,7 +1645,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1410,7 +1653,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1427,7 +1670,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1435,7 +1678,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1445,7 +1688,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1453,7 +1696,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1496,7 +1739,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1532,7 +1775,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1540,16 +1783,17 @@ for ERS test as otherwise it won't work for a sub-day test" - + - + + + + + + - - - - - + @@ -1568,7 +1812,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1577,7 +1821,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1595,7 +1839,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1620,7 +1864,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1629,7 +1873,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1675,7 +1919,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1684,7 +1928,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1692,7 +1936,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1702,7 +1946,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1815,7 +2059,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1827,7 +2071,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1839,7 +2083,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1849,7 +2093,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1861,31 +2105,31 @@ for ERS test as otherwise it won't work for a sub-day test" - + - + - + - + - + @@ -1893,7 +2137,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1911,7 +2155,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1921,7 +2165,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1931,7 +2175,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1941,7 +2185,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1950,7 +2194,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1960,7 +2204,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1969,7 +2213,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1988,7 +2232,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -1998,7 +2242,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -2007,7 +2251,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -2017,7 +2261,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -2025,7 +2269,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -2035,7 +2279,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -2043,7 +2287,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -2053,7 +2297,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -2063,7 +2307,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -2072,7 +2316,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -2112,7 +2356,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -2122,7 +2366,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -2132,7 +2376,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -2153,7 +2397,7 @@ for ERS test as otherwise it won't work for a sub-day test" - + @@ -2164,7 +2408,20 @@ for ERS test as otherwise it won't work for a sub-day test" - + + + + + + + + + + + + + + diff --git a/cime_config/testdefs/testmods_dirs/clm/decStart/user_nl_cism b/cime_config/testdefs/testmods_dirs/clm/decStart/user_nl_cism deleted file mode 100644 index 85f5789000..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/decStart/user_nl_cism +++ /dev/null @@ -1,9 +0,0 @@ -! The need for this is subtle. The problem is that this decStart testmod is used in short -! (multi-day) ERP tests, whose length is such that the end of the year occurs in the -! initial run but not in the restart run. Without setting history_option = 'coupler', this -! would mean that CISM outputs a history file in the initial run but not in the restart -! run, which causes the test to fail because the test system requires any component's -! final history file in one case to have a counterpart in the other case. Setting -! history_option = 'coupler' forces CISM to output a history file only at the end of the -! run. -history_option = 'coupler' diff --git a/cime_config/testdefs/testmods_dirs/clm/extra_outputs/README b/cime_config/testdefs/testmods_dirs/clm/extra_outputs/README index 83fad7964a..03bc956b6f 100644 --- a/cime_config/testdefs/testmods_dirs/clm/extra_outputs/README +++ b/cime_config/testdefs/testmods_dirs/clm/extra_outputs/README @@ -1 +1,4 @@ This test mod turns on extra diagnostic fields + +It also outputs an optional text file containing a table of the +history fields master list diff --git a/cime_config/testdefs/testmods_dirs/clm/extra_outputs/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/extra_outputs/user_nl_clm index 512a426909..6d1167fc39 100644 --- a/cime_config/testdefs/testmods_dirs/clm/extra_outputs/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/extra_outputs/user_nl_clm @@ -1 +1,2 @@ calc_human_stress_indices = 'ALL' +hist_master_list_file = .true. diff --git a/cime_config/testdefs/testmods_dirs/clm/glcMEC_changeFlags/README b/cime_config/testdefs/testmods_dirs/clm/glcMEC_changeFlags/README index 2e8fcfc52e..5afac87d62 100644 --- a/cime_config/testdefs/testmods_dirs/clm/glcMEC_changeFlags/README +++ b/cime_config/testdefs/testmods_dirs/clm/glcMEC_changeFlags/README @@ -1,4 +1,10 @@ This testmods directory switches some glc_mec-related flags in CLM, in order to test different branches than are tested with the default options. -It also turns off the feedback from CISM to CLM, to test that option. +It also turns off the feedback from CISM to CLM, to test that +option. For this piece of the test to be useful, it should be used in a +test that uses CISM rather than SGLC, and ideally should be in a test +where CISM's glacier areas change within the test (though that last +piece may not be strictly necessary, since the relevant logic will still +be exercised in the first time step of the run even with a non-evolving +CISM). diff --git a/cime_config/testdefs/testmods_dirs/clm/glcMEC_changeFlags/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/glcMEC_changeFlags/include_user_mods index 1730b6b7cf..f076fe1cf5 100644 --- a/cime_config/testdefs/testmods_dirs/clm/glcMEC_changeFlags/include_user_mods +++ b/cime_config/testdefs/testmods_dirs/clm/glcMEC_changeFlags/include_user_mods @@ -1 +1 @@ -../glcMEC +../glcMEC_increase diff --git a/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/README b/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/README deleted file mode 100644 index ec74e38b4c..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/README +++ /dev/null @@ -1,34 +0,0 @@ -This testmods directory is for running LII tests which compare the answers for a case where -initial condition interpolation is on (use_init_interp=T) to a case with it's off and ensures -they are exact. For the interpolated result to match uninterpolation, it needs to be a case that -essentially needs no interpolation so it's at the same resolution as the initial condition -file (finidat file). When surface datasets are changed, or the land-mask is changed, or an -important change is made to model physics (for example where new fields are added to the restart -file) -- you'll need to update the initial conditions file in this test (finidat file in -the user_nl_clm file). - -This testmods also turns off the glc two-way coupling. This is done so that -glacier areas are taken from the restart file rather than from -CISM. This is partly so that changes in CISM don't affect the test -results, but more importantly so that LII tests can pass even if CISM -changes. (GLC two-way coupling was off in the generation of the -initial conditions file used here, too.) (4-24-18: I *think* we'll be -able to turn two-way coupling on once -https://github.com/ESCOMP/ctsm/issues/340 is resolved, though I'm not -positive about that. However, if -https://github.com/ESMCI/cime/issues/2484 is done, then we'd need this -testmods to turn off comparison of cpl initial hist files if we have -two-way coupling on, since areas will differ in initialization between -the two cases.) - -To update the initial conditions (finidat) file for this test: - -(1) Run the LII test; the 'base' case should run to completion even if the -no_interp test fails. - -(2) Copy the finidat_interp_dest.nc file from the 'base' case to the inputdata -space. Rename this to be similar to the name of the file pointed to in this -test's user_nl_clm file, but with a new creation date. - -(3) Update this the user_nl_clm file in this directory to point to the new -finidat file. diff --git a/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/include_user_mods deleted file mode 100644 index 1730b6b7cf..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../glcMEC diff --git a/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/shell_commands b/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/shell_commands deleted file mode 100755 index 404b22b006..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/shell_commands +++ /dev/null @@ -1 +0,0 @@ -./xmlchange GLC_TWO_WAY_COUPLING=FALSE diff --git a/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/user_nl_clm deleted file mode 100644 index 44014d43e0..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/user_nl_clm +++ /dev/null @@ -1,5 +0,0 @@ -! See more notes in the README file in this directory and in the comments in the test list. -! -! Initial condition file at the desired configuration to run, so can verify that interpolating from it gives the same result -! Note that this was generated with GLC_TWO_WAY_COUPLING=FALSE -finidat = '$DIN_LOC_ROOT/lnd/clm2/initdata_map/clmi.I2000Clm50BgcCrop.2000-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c200428.nc' diff --git a/cime_config/testdefs/testmods_dirs/clm/nlevgrnd_small/README b/cime_config/testdefs/testmods_dirs/clm/nlevgrnd_small/README new file mode 100644 index 0000000000..3be0d15bfc --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/nlevgrnd_small/README @@ -0,0 +1,13 @@ +The main point of this testmod is to exercise the case where nlevgrnd < +nlevurb (connected with +https://github.com/ESCOMP/CTSM/issues/674). If/when we have an +out-of-the-box configuration with nlevgrnd < nlevurb (such as the NWP +configuration once nlevurb = 10 is the standard) then we can remove this +test. + +A secondary consideration is having a test that interpolates from a +configuration with nlevgrnd > nlevurb onto one with lower nlevgrnd and +nlevgrnd < nlevurb. But I don't think it's critical to maintain this +test just for that purpose - e.g., if we start having an out-of-the-box +configuration with nlevgrnd < nlevurb but where the finidat file also +has nlevgrnd < nlevurb, then I feel it will be okay to remove this test. diff --git a/cime_config/testdefs/testmods_dirs/clm/nlevgrnd_small/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/nlevgrnd_small/include_user_mods new file mode 100644 index 0000000000..fe0e18cf88 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/nlevgrnd_small/include_user_mods @@ -0,0 +1 @@ +../default diff --git a/cime_config/testdefs/testmods_dirs/clm/nlevgrnd_small/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/nlevgrnd_small/user_nl_clm new file mode 100644 index 0000000000..d7e1f9bbc2 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/nlevgrnd_small/user_nl_clm @@ -0,0 +1,8 @@ +! The following results in nlevsoi = 3, nlevgrnd = 4; together with the standard setting +! of nlevurb = 5, this results in nlevgrnd < nlevurb, which is what we particularly want +! to test here. +soil_layerstruct_userdefined = 0.2, 0.4, 0.8, 1.6 +soil_layerstruct_userdefined_nlevsoi = 3 + +! Need to make sure interpolation is on because of the change in nlevgrnd relative to finidat +use_init_interp = .true. diff --git a/cime_config/testdefs/testmods_dirs/clm/run_self_tests/README b/cime_config/testdefs/testmods_dirs/clm/run_self_tests/README new file mode 100644 index 0000000000..938dffbe6f --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/run_self_tests/README @@ -0,0 +1,5 @@ +The purpose of this testmod directory is to trigger the runtime +self-tests. This runs a suite of unit/integration tests. + +We use cold start so that we can get through initialization faster, +since how we initialize the model is unimportant for these self-tests. diff --git a/cime_config/testdefs/testmods_dirs/clm/run_self_tests/shell_commands b/cime_config/testdefs/testmods_dirs/clm/run_self_tests/shell_commands new file mode 100644 index 0000000000..a66f52f6fd --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/run_self_tests/shell_commands @@ -0,0 +1,3 @@ +#!/bin/bash +./xmlchange CLM_FORCE_COLDSTART="on" + diff --git a/cime_config/testdefs/testmods_dirs/clm/run_self_tests/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/run_self_tests/user_nl_clm new file mode 100644 index 0000000000..6187386336 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/run_self_tests/user_nl_clm @@ -0,0 +1 @@ +for_testing_run_ncdiopio_tests = .true. diff --git a/cime_config/testdefs/testmods_dirs/clm/snowlayers_3_monthly/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/smallville_dynlakes_monthly/include_user_mods similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/snowlayers_3_monthly/include_user_mods rename to cime_config/testdefs/testmods_dirs/clm/smallville_dynlakes_monthly/include_user_mods diff --git a/cime_config/testdefs/testmods_dirs/clm/smallville_dynlakes_monthly/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/smallville_dynlakes_monthly/user_nl_clm new file mode 100644 index 0000000000..b85d0ba6c1 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/smallville_dynlakes_monthly/user_nl_clm @@ -0,0 +1,12 @@ +do_transient_lakes = .true. + +! This file was created with the following command: +! ncap2 -s 'PCT_LAKE=array(0.0,0.0,PCT_CROP); PCT_LAKE={0.,50.,25.,25.,25.,25.}; HASLAKE=array(1.,1.,AREA); PCT_CROP=array(0.0,0.0,PCT_LAKE); PCT_CROP={0.,25.,12.,12.,12.,12.}' landuse.timeseries_1x1_smallvilleIA_hist_78pfts_simyr1850-1855_c160127.nc landuse.timeseries_1x1_smallvilleIA_hist_78pfts_simyr1850-1855_dynLakes_c200928.nc +! Key points are that lake area starts as 0, increases after the first year, then decreases after the second year. +! PCT_CROP is also changed so that PCT_LAKE + PCT_CROP <= 100. (Here, PCT_CROP increases and decreases at the same time as PCT_LAKE in order to exercise the simultaneous increase or decrease of two landunits, but that isn't a critical part of this test.) +! Note that the use of this file means that this testmod can only be used with the 1x1_smallvilleIA grid. +flanduse_timeseries = '$DIN_LOC_ROOT/lnd/clm2/surfdata_map/landuse.timeseries_1x1_smallvilleIA_hist_78pfts_simyr1850-1855_dynLakes_c200928.nc' + +! BUG(wjs, 2020-09-25, ESCOMP/CTSM#43) Dynamic lakes don't work when methane is active, +! so for now disable methane for this test. +use_lch4 = .false. diff --git a/cime_config/testdefs/testmods_dirs/clm/snowlayers_3_monthly/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/snowlayers_3_monthly/user_nl_clm deleted file mode 100644 index e7500fff58..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/snowlayers_3_monthly/user_nl_clm +++ /dev/null @@ -1,4 +0,0 @@ -nlevsno = 3 - -! Need to set use_init_interp because initial conditions file has 5 snow layers -use_init_interp = .true. diff --git a/doc/.ChangeLog_template b/doc/.ChangeLog_template index f5474f33a8..107df0102a 100644 --- a/doc/.ChangeLog_template +++ b/doc/.ChangeLog_template @@ -29,6 +29,8 @@ 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 + [ ] clm5_0 [ ] ctsm5_0-nwp @@ -56,9 +58,6 @@ Caveats for developers (e.g., code that is duplicated that requires double maint Changes to tests or testing: -Code reviewed by: - - CTSM testing: [... Remove before making master tag. Available test levels: @@ -104,8 +103,9 @@ Answer changes Changes answers relative to baseline: - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): + [ If a tag changes answers relative to baseline comparison the + following should be filled in (otherwise remove this section). + And always remove these three lines and parts that don't apply. ] Summarize any changes to answers, i.e., - what code configurations: diff --git a/doc/ChangeLog b/doc/ChangeLog index 39f375cc66..4eac6c847f 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,23 +1,22 @@ =============================================================== -Tag name: ctsm1.0.dev113 -Originator(s): negins (Negin Sobhani,UCAR/TSS,303-497-1224) -Date: Tue Sep 8 15:57:49 MDT 2020 -One-line Summary: Some bit-for-bit changes needed for the Perturbed Parameter Ensemble work +Tag name: ctsm5.1.dev020 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Wed Dec 30 00:42:16 MST 2020 +One-line Summary: Potential roundoff changes in preparation for bio-mass heat storage option Purpose of changes ------------------ -Some BFB fixes including bug fixes needed for PPE simulations. +This adds in some changes that may be roundoff different in preparation for bringing in the changes +that allow turning on the bio-mass heat storage option. There's a few zeroed terms added to some calculations +in CanopyFluxes. The new terms are identical to what will come in for BHS except the zeroed terms are +not arrays here but scalars. I showed the new terms are only off by roundoff with a previous commit that added +explicit tests for the terms and verified it for two tests. + Bugs fixed or introduced ------------------------ -Issues fixed (include CTSM Issue #): -- Resolves ESCOMP/CTSM#1060 (Some code cleanup of luna bug fixes) -- Resolves ESCOMP/CTSM#1062 (PPE namelist parameter defaults) -- Resolves ESCOMP/CTSM#1053 (Non-standard namelist parameter) -- Resolves ESCOMP/CTSM#1055 (Expand potential vcmax:jmax ratio) - Significant changes to scientifically-supported configurations -------------------------------------------------------------- @@ -26,6 +25,8 @@ 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 + [ ] clm5_0 [ ] ctsm5_0-nwp @@ -35,111 +36,97 @@ Does this tag change answers significantly for any of the following physics conf Notes of particular relevance for users --------------------------------------- -Caveats for users (e.g., need to interpolate initial conditions): -cmb_cmplt_fact was a parameter under namelist control pertaining to the fire -model (combusion completion factor [unitless]), which previously included an array. -This parameter is now splitted into two real values i.e. cmb_cmplt_fact_litter and -cmb_cmplt_fact_cwd. -If the users have cmb_cmplt_fact in a user_nl_clm file that worked before, it -won't work anymore since it is now splitted into cmb_cmplt_fact_litter -and cmb_cmplt_fact_cwd. - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): -Previously, denitrif_nitrateconc_exponent and denitrif_nitrateconc_coefficient -were on the params file but ALSO on the namelist. They are now removed from the namelist. - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: [For timing changes, can check PFS -test(s) in the test suite] None +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): Added new Clm51 compsets + I1PtClm51SpRs + I2000Clm51Sp + I2000Clm51SpRs + I1850Clm51Sp + I2000Clm51Fates + I1850Clm51SpNoAnthro + IHistClm51Sp Notes of particular relevance for developers: (including Code reviews and testing) --------------------------------------------- NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide -Caveats for developers (e.g., code that is duplicated that requires double -maintenance): None - -Changes to tests or testing: None - +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + Here I set some terms to zero that will be non-zero even when BHS is off + Earlier commits show the smaller set of changes that are needed. -CTSM testing: +Changes to tests or testing: Switched one Clm50Sp test to Clm51Sp and added one HistClm51Sp test +CTSM testing: regular [PASS means all tests PASS and OK means tests PASS other than expected fails.] build-namelist tests: - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run + cheyenne - PASS python testing (see instructions in python/README.md; document testing done): - (any machine) - not run + cheyenne - PASS regular tests (aux_clm): - cheyenne ---- PASS (except for NLCOMP) - izumi ------- PASS (except for NLCOMP) + cheyenne ---- OK + izumi ------- OK If the tag used for baseline comparisons was NOT the previous tag, note that here: -ctsm1.0.dev111 Answer changes -------------- -Changes answers relative to baseline: None +Changes answers relative to baseline: + + Summarize any changes to answers, i.e., + - what code configurations: all + - what platforms/compilers: izumi-PGI + - nature of change: roundoff + + If bitwise differences were observed, how did you show they were no worse + than roundoff? + + Earlier commit tested the new terms versus the old and showed they were + order e-11 for absolute difference and e-14 relative difference. + + Tests that change from baseline.... + + ERS_Ly5_P144x1.f10_f10_musgs.IHistClm51BgcCrop.cheyenne_intel.clm-cropMonthOutput + SMS.f10_f10_musgs.I2000Clm50BgcCrop.izumi_pgi.clm-crop + SMS_D.f10_f10_musgs.I2000Clm51BgcCrop.izumi_pgi.clm-crop Detailed list of changes ------------------------ -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): -None +Pull Requests that document the changes (include PR ids): #1241 +(https://github.com/ESCOMP/ctsm/pull) -Pull Requests that document the changes (include PR ids): -https://github.com/ESCOMP/CTSM/pull/1102 + #1241 -- Small answer changes in preparation for adding option for bio-mass heat storage =============================================================== =============================================================== -Tag name: ctsm1.0.dev112 -Originator(s): sacks (Bill Sacks), wwieder (Will Wieder) -Date: Fri Aug 28 17:10:57 MDT 2020 -One-line Summary: Small changes to mksurfdata_map, singlept tool and run_sys_tests +Tag name: ctsm5.1.dev019 +Originator(s): sacks (Bill Sacks) +Date: Sat Dec 19 06:55:46 MST 2020 +One-line Summary: Fix ndep from coupler Purpose of changes ------------------ -(1) Move mksurfdata_map rounding of special landunits to before wetland - fill: I think this may be important to avoid errors and/or wrong - behavior in some edge cases where we have < 0.5% cover of glacier - and/or lake, and other cases. See - https://github.com/ESCOMP/CTSM/issues/1118 for detailed - thoughts. May change answers in rare cases, but no answer changes - observed for present-day surface datasets at standard resolutions - (f09, f19, f10, f45). +There was a bug in ndep forcing (forc_ndep_grc) when receiving ndep from +CAM (ndep_from_cpl true). This first appeared in ctsm5.1.dev002. NDEP +forcings have been garbage since then when receiving ndep from CAM. -(2) run_sys_tests: record command-line arguments in SRCROOT_GIT_STATUS - file - -(3) (From Will Wieder) Updates to current surfdata & landuse files in - tools/contrib/singlept +This tag fixes that issue. Bugs fixed or introduced ------------------------ Issues fixed (include CTSM Issue #): -- Resolves ESCOMP/CTSM#1118 (mksurfdata_map rounding/truncation of - special landunits should happen before wetland filling) +- Resolves ESCOMP/CTSM#1233 (ndep forcing incorrect when receiving ndep + from CAM (starting with ctsm5.1.dev002)) Significant changes to scientifically-supported configurations @@ -150,6 +137,8 @@ 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 + [ ] clm5_0 [ ] ctsm5_0-nwp @@ -167,7 +156,7 @@ Changes made to namelist defaults (e.g., changed parameter values): none Changes to the datasets (e.g., parameter, surface or initial files): none -Substantial timing or memory changes: none +Substantial timing or memory changes: none expected (not checked) Notes of particular relevance for developers: (including Code reviews and testing) --------------------------------------------- @@ -177,9 +166,6 @@ Caveats for developers (e.g., code that is duplicated that requires double maint Changes to tests or testing: none -Code reviewed by: self - - CTSM testing: [PASS means all tests PASS and OK means tests PASS other than expected fails.] @@ -190,10 +176,7 @@ CTSM testing: tools-tests (test/tools): - cheyenne - PASS - - Note: ran tools testing on code based off of ctsm1.0.dev110 (before - merging with ctsm1.0.dev111) + cheyenne - not run PTCLM testing (tools/shared/PTCLM/test): @@ -201,63 +184,72 @@ CTSM testing: python testing (see instructions in python/README.md; document testing done): - (any machine) - PASS on mac (bishorn) + (any machine) - not run regular tests (aux_clm): - cheyenne ---- not run - izumi ------- not run + cheyenne ---- pass + izumi ------- pass + + izumi testing: baseline generation failed due to running out of disk + space. I have sym linked the ctsm5.1.dev018 baselines to + ctsm5.1.dev019, because answers are bit-for-bit between the two tags + as far as aux_clm testing is concerned. + +If the tag used for baseline comparisons was NOT the previous tag, note that here: -If the tag used for baseline comparisons was NOT the previous tag, note that here: ctsm1.0.dev110 Answer changes -------------- -Changes answers relative to baseline: NO +Changes answers relative to baseline: YES, but just in select coupled configurations + + [ If a tag changes answers relative to baseline comparison the + following should be filled in (otherwise remove this section). + And always remove these three lines and parts that don't apply. ] -In principle, the changes to mksurfdata_map could change answers for -rare cases. No answer changes were observed for present-day surface -datasets at resolutions f09, f19, f10 or f45. Also note that no surface -datasets were actually updated in this tag, so if any answer changes -appear from these changes, they would appear the next time we update -surface datasets. + Summarize any changes to answers, i.e., + - what code configurations: Coupled configurations where CTSM + receives NDEP from CAM + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + potentially new climate + + If bitwise differences were observed, how did you show they were no worse + than roundoff? N/A + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + - casename: N/A + + URL for LMWG diagnostics output used to validate new climate: N/A + Detailed list of changes ------------------------ List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none -Pull Requests that document the changes (include PR ids): -https://github.com/ESCOMP/CTSM/pull/1119 -https://github.com/ESCOMP/CTSM/pull/1120 -https://github.com/ESCOMP/CTSM/pull/1122 +Pull Requests that document the changes (include PR ids): none =============================================================== =============================================================== -Tag name: ctsm1.0.dev111 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Fri Aug 28 14:08:25 MDT 2020 -One-line Summary: Compsets don't use 2014 for GSWP3 forcing, LUNA prevyr changed back +Tag name: ctsm5.1.dev018 +Originator(s): slevis (Samuel Levis,,303-665-1310) +Date: Tue Dec 8 11:19:02 MST 2020 +One-line Summary: Add ACTIVE (T/F) column to master hist fields table and alphabetize Purpose of changes ------------------ -Update cime so that default end year for GSWP3 forcing is 2013 because 2014 data is bad. Also update -the prevyr default for vcmax/jmax to what it was before ctsm1.0.dev102. - -Fix some issues for finding initial condition files for Clm45 compsets. Also bring in updated CDEPS/CMEPS -as they were required with the cime update. + For convenience, added an ACTIVE column to the master fields table and + alphabetized. Bugs fixed or introduced ------------------------ -Issues fixed (include CTSM Issue #): - Fixes #1107 -- Change initial values of LUNA back to previous global values - Fixes #1067 -- Stop using PIO2 in the LILAC build - Fixes #1121 -- FMOZ test fails +Issues fixed (include CTSM Issue #): #941 -CIME Issues fixed (include issue #): - Fixes ESMCI/cime#3683 -- Avoid artificial limit on string lengths in shr_string_listMerge Significant changes to scientifically-supported configurations -------------------------------------------------------------- @@ -267,6 +259,8 @@ 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 + [ ] clm5_0 [ ] ctsm5_0-nwp @@ -277,47 +271,53 @@ Notes of particular relevance for users --------------------------------------- Caveats for users (e.g., need to interpolate initial conditions): - Last time-step in Dec/2013 for GSWP3 data still has zero humidity + None -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): None +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): + None -Changes made to namelist defaults (e.g., changed parameter values): None +Changes made to namelist defaults (e.g., changed parameter values): + None -Changes to the datasets (e.g., parameter, surface or initial files): None +Changes to the datasets (e.g., parameter, surface or initial files): + None -Substantial timing or memory changes: None +Substantial timing or memory changes: [For timing changes, can check PFS test(s) in the test suite] + None Notes of particular relevance for developers: (including Code reviews and testing) --------------------------------------------- NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - cime is pointing to a branch_tag we should update it to a trunk tag as soon as possible - -Changes to tests or testing: build-namelist unit testing improved to find problems like #1121 a #1125 - -Code reviewed by: self +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + None +Changes to tests or testing: + None -CTSM testing: regular +CTSM testing: [PASS means all tests PASS and OK means tests PASS other than expected fails.] build-namelist tests: - cheyenne - PASS (all identical to previous tag) + cheyenne - tools-tests (test/tools): - cheyenne - PASS + cheyenne - + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - python testing (see instructions in python/README.md; document testing done): - cheyenne - PASS + (any machine) - regular tests (aux_clm): - cheyenne ---- OK + cheyenne ---- PASS izumi ------- PASS If the tag used for baseline comparisons was NOT the previous tag, note that here: @@ -326,54 +326,40 @@ If the tag used for baseline comparisons was NOT the previous tag, note that her Answer changes -------------- -Changes answers relative to baseline: Yes - - Summarize any changes to answers, i.e., - - what code configurations: (2010 and SSP compsets) and Clm50 with LUNA on (Bgc or Sp) - - what platforms/compilers: All - - nature of change: similar climate +Changes answers relative to baseline: + No Detailed list of changes ------------------------ -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cime, cmeps, cdeps - (fox removed as a separate checkout) - cime to branch_tags/cime5.8.31_a01 +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): + None -Pull Requests that document the changes (include PR ids): #1114 -(https://github.com/ESCOMP/ctsm/pull) - #1114 -- Update cime so default end year for GSWP3 forcing is 2013 and change prevyr default for vcmax/jmax +Pull Requests that document the changes (include PR ids): + https://github.com/ESCOMP/CTSM/pull/1222 =============================================================== =============================================================== -Tag name: ctsm1.0.dev110 -Originator(s): jedwards (Jim Edwards) -Date: Fri Aug 21 10:49:08 MDT 2020 -One-line Summary: Fixes needed for PIO2 +Tag name: ctsm5.1.dev017 +Originator(s): slevis (Samuel Levis,303-665-1310) +Date: Tue Nov 17 18:19:20 MST 2020 +One-line Summary: Write history fields master list to separate optional file Purpose of changes ------------------ -Fixes needed for CTSM to work with PIO2. There is an additional fix -needed in PIO2 itself; this is available in a later version of cime that -we will bring in soon. + User can choose to write the history fields master list in a separate + text file by setting hist_master_list_file = .true. in CTSM's namelist. -Note that this PR also includes a change in config_files.xml that is -needed for a newer version of cime when running compsets with dlnd, slnd -or xlnd; this may be incompatible with the current version of the cime -external, but this does not impact compsets with CTSM. + File contents follow recommended reStructuredText "simple table" + formatting (see + https://docutils.sourceforge.io/docs/user/rst/quickref.html#tables) + for use in CTSM documentation in the sphinx environment. Bugs fixed or introduced ------------------------ -Issues fixed (include CTSM Issue #): -The changes in this tag, together with a cime update that will be coming -in soon, resolve the following issues (I'm not sure off-hand which -issues are resolved by the changes here alone and which ones require the -cime update): -- Resolves ESCOMP/CTSM#1029 (FATES tests fail with PIO2) -- Resolves ESCOMP/CTSM#1030 (mpi-serial nag case fails with pio2 when - defining h1 history restart file) +Issues fixed (include CTSM Issue #): #34 #941 Significant changes to scientifically-supported configurations -------------------------------------------------------------- @@ -383,6 +369,8 @@ 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 + [ ] clm5_0 [ ] ctsm5_0-nwp @@ -393,55 +381,69 @@ Notes of particular relevance for users --------------------------------------- Caveats for users (e.g., need to interpolate initial conditions): -- May not be able to run configurations with dlnd, slnd or xlnd from this tag + None -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): + New namelist option hist_master_list_file. Setting to true generates a + new text output file containing the history fields master list. -Changes made to namelist defaults (e.g., changed parameter values): none +Changes made to namelist defaults (e.g., changed parameter values): + Default for hist_master_list_file = .false. -Changes to the datasets (e.g., parameter, surface or initial files): none +Changes to the datasets (e.g., parameter, surface or initial files): + None -Substantial timing or memory changes: Not investigated, but almost definitely not +Substantial timing or memory changes: + No Notes of particular relevance for developers: (including Code reviews and testing) --------------------------------------------- NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + None -Changes to tests or testing: none +Changes to tests or testing: + Introduced testing for the new namelist option within the existing test + ERP_P36x2_D_Ld3.f10_f10_musgs.I1850Clm50BgcCrop.cheyenne_gnu.clm-extra_outputs + by adding hist_master_list_file = .true. to the test's user_nl_clm + +CTSM testing: -Code reviewed by: Bill Sacks +[... Remove before making master tag. Available test levels: + a) regular (must be run before handing off a tag to SEs and must be run + before committing a tag) + b) build_namelist (if namelists and/or build_system changed)) + c) tools (only if tools are modified and no CTSM source is modified) + d) short (for use during development and in rare cases where only a small + change with known behavior is added ... eg. a minor bug fix) + e) doc (no source testing required) -CTSM testing: +... ] [PASS means all tests PASS and OK means tests PASS other than expected fails.] build-namelist tests: - cheyenne - not run + cheyenne - tools-tests (test/tools): - cheyenne - not run + cheyenne - PTCLM testing (tools/shared/PTCLM/test): - cheyenne - not run + cheyenne - python testing (see instructions in python/README.md; document testing done): - (any machine) - not run + (any machine) - regular tests (aux_clm): - cheyenne ---- PASS - izumi ------- PASS - - Note: Standard testing was done using PIO1 (as this is still the - default), but separate testing was also done using PIO2 (using an - updated cime) and tests were found to pass. + cheyenne ---- OK (NLCOMP tests fail as expected) + izumi ------- OK (NLCOMP tests fail as expected) If the tag used for baseline comparisons was NOT the previous tag, note that here: @@ -449,33 +451,35 @@ If the tag used for baseline comparisons was NOT the previous tag, note that her Answer changes -------------- -Changes answers relative to baseline: NO +Changes answers relative to baseline: + No Detailed list of changes ------------------------ -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + Added section to subr. hist_printflds (called by subr. initialize2). + The new section runs when hist_master_list_file = .true. + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): + None Pull Requests that document the changes (include PR ids): -https://github.com/ESCOMP/CTSM/pull/1095 + https://github.com/ESCOMP/CTSM/pull/1209 =============================================================== =============================================================== -Tag name: ctsm1.0.dev109 -Originator(s): negins (Negin Sobhani,UCAR/TSS,303-497-1224) -Date: Thu Aug 20 11:40:07 MDT 2020 -One-line Summary: Allow for resorbtion in transition from live to dead wood N +Tag name: ctsm5.1.dev016 +Originator(s): mvertens (Mariana Vertenstein), jedwards (Jim Edwards), + sacks (Bill Sacks), erik (Erik Kluzek) +Date: Tue Nov 17 10:49:40 MST 2020 +One-line Summary: Updates for nuopc Purpose of changes ------------------ -This PR allows for resorbtion in transition from live to dead wood N, which also move -to NPOOL for free. - -Bugs fixed or introduced ------------------------- +Various updates needed for NUOPC. -Issues fixed (include CTSM Issue #): Issue #443 +Also adds mizuRoute as an external component. Significant changes to scientifically-supported configurations @@ -484,36 +488,41 @@ 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.) -[x] clm5_0 + [Put an [X] in the box for any configuration with significant answer changes.] -[x] ctsm5_0-nwp +[ ] clm5_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp [ ] clm4_5 Notes of particular relevance for users --------------------------------------- -Caveats for users (e.g., need to interpolate initial conditions): None +Caveats for users (e.g., need to interpolate initial conditions): none -Changes to CTSM's user interface (e.g., new/renamed XML or namelist -variables): None +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none -Changes made to namelist defaults (e.g., changed parameter values): None +Changes made to namelist defaults (e.g., changed parameter values): none -Changes to the datasets (e.g., parameter, surface or initial files): None +Changes to the datasets (e.g., parameter, surface or initial files): none -Substantial timing or memory changes: [For timing changes, can check PFS test(s) in the test suite] +Substantial timing or memory changes: none -Notes of particular relevance for developers: None +Notes of particular relevance for developers: (including Code reviews and testing) --------------------------------------------- NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide Caveats for developers (e.g., code that is duplicated that requires double maintenance): +- SoilMoistureStreamMod now is duplicated: the version used with mct is + still in src/biogeochem, but there is a new version used with nuopc + and the CDEPS data models in src/cpl/nuopc. The latter has just been + introduced for testing purposes. Eventually, once we switch everything + to use CDEPS, we'll remove this duplicated version. -Changes to tests or testing: None - -Code reviewed by: Erik Kluzek - +Changes to tests or testing: none CTSM testing: @@ -537,8 +546,8 @@ CTSM testing: regular tests (aux_clm): - cheyenne ---- PASS - izumi ------- PASS + cheyenne ---- pass + izumi ------- pass If the tag used for baseline comparisons was NOT the previous tag, note that here: @@ -546,76 +555,61 @@ If the tag used for baseline comparisons was NOT the previous tag, note that her Answer changes -------------- -Changes answers relative to baseline: YES - - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: Clm50 with Bgc or Cn - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new - climate): larger than roundoff/same climate - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - Will Wieder thought the changes were small enough that we didn't need to do - a long simulation. Erik Kluzek thinks the changes were verified with single - point simulations. - - - URL for LMWG diagnostics output used to validate new climate: - +Changes answers relative to baseline: NO Detailed list of changes ------------------------ List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): +- Added mizuRoute (at 34723c2) +- cime: branch_tags/cime5.8.32_a01 -> branch_tags/cime5.8.32_a02 +- (Some other rearrangement of Externals files, but versions stayed the + same) -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) +Pull Requests that document the changes (include PR ids): none =============================================================== =============================================================== -Tag name: ctsm1.0.dev108 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Wed Aug 19 17:23:47 MDT 2020 -One-line Summary: Update default PE layouts for new SE/FV3 grids +Tag name: ctsm5.1.dev015 +Originator(s): sacks (Bill Sacks) +Date: Fri Nov 13 11:52:34 MST 2020 +One-line Summary: A few small fixes Purpose of changes ------------------ -Change PE layouts for new high resolution SE/FV3 grids. Have a version for cheyenne and a default one -as well. +(1) Fixes needed for PIO2 when running in pts/scam mode (from Jim + Edwards and Bill Sacks) + +(2) Fix mpi broadcast of hist_avgflag_pertape so that this namelist + variable is applied properly (from Sunniva Indrehus, Keith Oleson + and Bill Sacks) -Update externals: cime, cism, CMEPS, CDEPS -Change single point tests to use stub ROF -Change tests to use gx1v7 rather than gx1v6 -Update waccmx_offline to use START=1979 +(3) Fix invalid xml in namelist_definition_ctsm.xml + +(4) Add point of interest code for debugging Bugs fixed or introduced ------------------------ -Issues fixed (include CTSM Issue #): - Fixes #1108 Change single point tests to use stub ROF - Fixes #1098 ARCTICGRIS PE layout is very slow - Fixes #1105 Default new FV3/SE grid PE layouts are problematic - Fixes #1103 Some changes to prevent missing file for WACCMX testing - Fixes #1113 ARCTIC test is failing +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/CTSM#1191 (hist_avgflag_pertape doesn't always produce + desired averaging type for some history file streams) +- Resolves ESCOMP/CTSM#1159 (Invalid xml in + namelist_definition_ctsm.xml) +- Resolves ESCOMP/CTSM#1210 (Add "point of interest" code) + Significant changes to scientifically-supported configurations -------------------------------------------------------------- -Does this tag change answers significantly for any of the following physics configurations? No +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.] +[ ] clm5_1 + [ ] clm5_0 [ ] ctsm5_0-nwp @@ -625,53 +619,46 @@ Does this tag change answers significantly for any of the following physics conf Notes of particular relevance for users --------------------------------------- -Caveats for users (e.g., need to interpolate initial conditions): None +Caveats for users (e.g., need to interpolate initial conditions): none -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): None +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none -Changes made to namelist defaults (e.g., changed parameter values): None +Changes made to namelist defaults (e.g., changed parameter values): none -Changes to the datasets (e.g., parameter, surface or initial files): None +Changes to the datasets (e.g., parameter, surface or initial files): none -Substantial timing or memory changes: None +Substantial timing or memory changes: none expected (not checked) Notes of particular relevance for developers: (including Code reviews and testing) --------------------------------------------- NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - Some tests were chagned to use stub ROF and one to stub GLC. @billsacks suggest we should also change - other tests in this same way. - -Changes to tests or testing: Yes - -Code reviewed by: self - +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none -CTSM testing: regular, tools +Changes to tests or testing: none [PASS means all tests PASS and OK means tests PASS other than expected fails.] build-namelist tests: - cheyenne - PASS + cheyenne - not run tools-tests (test/tools): - cheyenne - PASS + cheyenne - not run PTCLM testing (tools/shared/PTCLM/test): - cheyenne - OK + cheyenne - not run python testing (see instructions in python/README.md; document testing done): - cheyenne -- PASS + (any machine) - not run regular tests (aux_clm): - cheyenne ---- PASS - izumi ------- PASS + cheyenne ---- pass + izumi ------- pass If the tag used for baseline comparisons was NOT the previous tag, note that here: @@ -679,115 +666,123 @@ If the tag used for baseline comparisons was NOT the previous tag, note that her Answer changes -------------- -Changes answers relative to baseline: No (except for waccmx_offline test) +Changes answers relative to baseline: NO Detailed list of changes ------------------------ -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cime, cism, CDEPS, CMEPS - cism to cism2_1_69 - cime to cime5.8.30 - Update hash for CDEPS and CMEPS (so that nuopc test will run) - -Pull Requests that document the changes (include PR ids): #1111 -(https://github.com/ESCOMP/ctsm/pull) +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - #1111 -- Adjust FV3/SE PE layouts +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/CTSM/pull/1214 =============================================================== =============================================================== -Tag name: ctsm1.0.dev107 -Originator(s): erik (Erik Kluzek) -Date: Mon Aug 10 02:21:12 MDT 2020 -One-line Summary: Answer changes needed for CESM2.2.0 +Tag name: ctsm5.1.dev014 +Originator(s): dll (Danica Lombardozzi) / oleson (Keith Oleson) / sacks (Bill Sacks) +Date: Sat Nov 7 12:19:14 MST 2020 +One-line Summary: Grass/crop snow burial fraction fix, and some other fixes Purpose of changes ------------------ -A list of small answer changes needed for CESM2.2.0. Nitrogen deposition file now properly -ends in 2015 rather than 2005. Have 2010_control compset match the 2000 IOC file rather than 2010. -Modify the waccmx_offline tests to more closely match the CAM tests. +(1) Crop/grass snow burial changed based on height and lodging (Danica + Lombardozzi) - resolves ESCOMP/CTSM#516. Updates grass and crop snow + burial ('fb' in SatellitePhenologyMod.F90) from being 0.2m to change + with PFT height and accounts for 20% lodging (falling over). + +(2) In BGC code, make elai and esai depend on frac_sno (Danica + Lombardozzi, Keith Oleson & Bill Sacks) - resolves ESCOMP/CTSM#1116 -Interpolate IC files for an exact match. Answers are identical for an exact match, but different -when used for other resolutions. +(3) Fix to quadratic solution error bug caused by negative shaded + photosynthesis (Danica Lombardozzi & Keith Oleson) - resolves + ESCOMP/CTSM#756 -Two small bit-for-bit changes remove levurb and string_len dimensions on restart files. -Remove xsmrpool_loss when use_crop is NOT true. +(4) Point to cime branch tag that avoids building CDEPS with LILAC, to + avoid dependence on unreleased ESMF code (Bill Sacks) - resolves + ESCOMP/CTSM#1203 +(5) Some tweaks to documentation and how the documentation is built + (Bill Sacks) Bugs fixed or introduced ------------------------ -Issues fixed (include CTSM Issue #): [If none, remove this line] - Answer changing fixes: - Fixes #1004 -- stream_year_last_ndep is set to 2005 instead of 2015 for historical with ctsm1.0.dev093 - Fixes #1012 -- Help prevent problems with WACCM-X testing by modifying our waccmx_offline test - Fixes #1090 -- Have 2010_control compset match 2000 simulation-year rather than 2010 - Fixes #1089 -- Failure in FXHIST test when running with CAM - Fixes #1037 -- Interpolate out-of-the-box initial conditions files for CESM2.2 release - (only changes answers for resolutions other than IC file resolution) - - Bit-for-bit changes: - Fixes #1101 -- levurb and string_len dimensions no longer needed on the restart files - Fixes #1097 -- xsmrpool_loss should only be written to the restart file if use_crop is true +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/CTSM#516 (crop and grass snow burial) +- Resolves ESCOMP/CTSM#1116 (elai and esai for non-SP runs should use + frac_sno) +- Resolves ESCOMP/CTSM#756 (Quadratic solution error) +- Resolves ESCOMP/CTSM#1203 (Rework LILAC build to avoid dependence on + unreleased ESMF code) + +CIME Issues fixed (include issue #): +- https://github.com/ESMCI/cime/issues/3769 (Avoid building CDEPS with + CTSM's LILAC) Significant changes to scientifically-supported configurations -------------------------------------------------------------- -Does this tag change answers significantly for any of the following physics configurations? No +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.] -[ ] clm5_0 +[X] clm5_1 -[ ] ctsm5_0-nwp +[X] clm5_0 -[ ] clm4_5 +[X] ctsm5_0-nwp + +[X] clm4_5 Notes of particular relevance for users --------------------------------------- -Caveats for users (e.g., need to interpolate initial conditions): None +Caveats for users (e.g., need to interpolate initial conditions): none -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): - 2010_control doesn't match 2010 finidat file +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none -Changes made to namelist defaults (e.g., changed parameter values): None +Changes made to namelist defaults (e.g., changed parameter values): none -Changes to the datasets (e.g., parameter, surface or initial files): Interpolated IC files - Add f19 2003 IC file, f09 and 19 1979 IC file - Remove 2010 IC file +Changes to the datasets (e.g., parameter, surface or initial files): none -Substantial timing or memory changes: None +Substantial timing or memory changes: none Notes of particular relevance for developers: (including Code reviews and testing) --------------------------------------------- NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: waccm_offline test changed to more closely match the FXHIST CAM test - -Code reviewed by: self +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none +Changes to tests or testing: none -CTSM testing: regular +CTSM testing: [PASS means all tests PASS and OK means tests PASS other than expected fails.] build-namelist tests: - cheyenne - PASS (115 tests are different than before) + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run python testing (see instructions in python/README.md; document testing done): - cheyenne - PASS + (any machine) - not run regular tests (aux_clm): - cheyenne ---- PASS - izumi ------- PASS + cheyenne ---- ok + izumi ------- ok + + ok: tests pass, baselines fail as expected If the tag used for baseline comparisons was NOT the previous tag, note that here: @@ -795,79 +790,81 @@ If the tag used for baseline comparisons was NOT the previous tag, note that her Answer changes -------------- -Changes answers relative to baseline: Yes! +Changes answers relative to baseline: YES - Hist and SSP BGC compsets change answers because of the correction of the end year for ndep. - You wouldn't think this would matter until you get to the end of the time-sequence -- but it - does for the first time-step. + Summarize any changes to answers, i.e., + - what code configurations: all (or at least most) + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + new climate, at least to some extent - The 2010 compset changes answers because of using the 2000 finidat file rather than 2010 + Changes arise from (1) & (2) (large changes) and from (3) (small + changes). The change in snow burial parameterizations results in + changes to albedo and water & energy fluxes. - Some finidat files interpolated to the resolution they are designed for. This causes an apparent - change of answers when these datasets are used for other resolutions (even though it does NOT for - the resolution it's interpolated to) + If bitwise differences were observed, how did you show they were no worse + than roundoff? N/A - waccm_offline tests are also changed in order to more closely match the FXHIST tests in CAM. + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + - casename: N/A - Summarize any changes to answers, i.e., - - what code configurations: Hist, SSP, 2010 compsets, Clm45 and some f10, 1x1 because of IC files - - what platforms/compilers: All - - nature of change: same climate + URL for LMWG diagnostics output used to validate new climate: + For analysis of diffs, see + https://github.com/danicalombardozzi/ctsm_py/blob/7543b0f3b413bae9974c11b467fdbc0413c3b7fa/notebooks/SnowBurial.ipynb Detailed list of changes ------------------------ -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): +- cime: cime5.8.32 -> branch_tags/cime5.8.32_a01 +- doc-builder: v1.0.2 -> v1.0.4 -Pull Requests that document the changes (include PR ids): #1100 -(https://github.com/ESCOMP/ctsm/pull) - #1100 -- Answer changes needed for CESM2.2.0 +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/CTSM/pull/1112 =============================================================== =============================================================== -Tag name: ctsm1.0.dev106 -Originator(s): erik (Erik Kluzek) -Date: Thu Aug 6 15:35:47 MDT 2020 -One-line Summary: Bit-for-bit updates for the CESM2.2.0 release +Tag name: ctsm5.1.dev013 +Originator(s): jedwards (Jim Edwards) / sacks (Bill Sacks) +Date: Wed Nov 4 14:24:55 MST 2020 +One-line Summary: Allow pnetcdf for vector history files Purpose of changes ------------------ -Fix some bit-for-bit things needed for the CESM2.2.0 release -Bring changes needed from release-clm5.0.31-34 to trunk. ndep change. -Brings in some changes for PtVg datasets for no-anthro compset. -Do some refactoring of Fire class so that it makes sense for FATES to use the base class. -Update RTM and MOSART with NUOPC changes and an update of a NetCDF-4 file to NetCDF-5 -needed for the cesm2.2.0 release. - -The 2010 finidat file is now set in the 2010_control use-case rather than relying on the -finidat dataset matching. +Ever since clm4_5_1_r091, we had been avoiding the use of pnetcdf for +vector history files (i.e., history files with dov2xy = .false.). This +was to workaround an issue that was found on the old yellowstone +supercomputer (bugzilla 1730). However, I cannot reproduce this issue on +cheyenne, either with PIO1 or with PIO2. Moreover, the workaround was +leading to very slow performance with PIO2, at least for some +tests. This tag removes that old workaround. +See https://github.com/ESCOMP/CTSM/issues/33 for details. -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): - Fixes #1087 -- wrong finidat file - Fixes #1096 -- failing tests - Fixes #1036 -- ne30 case fails - Fixes #946 --- better error message - Fixes #983 --- Fire method renames - Fixes #938 --- mscripgrid issue +Also change PE layouts for C96 and C192. The main motivation for this is +to get the aux_clm C96 test through the queue faster (the current test +sometimes waits for multiple hours in the queue): -Known bugs found since the previous tag (include github issue ID): - #1098 -- ARCTICGRIS PE-layout is very slow... - #1097 -- xsmrpool_loss should only be written to the restart file if use_crop is true +(1) Make the out-of-the-box PE counts unthreaded, as is standard for I + compsets +(2) In the aux_clm test for C92, use a 360x2 PE layout: Use a PE layout + that (a) has threading, because CAM uses threading at this + resolution; and (b) has a smaller-than-standard task count in order + to get through the queue faster. Significant changes to scientifically-supported configurations -------------------------------------------------------------- -Does this tag change answers significantly for any of the following physics configurations? No +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.] +[ ] clm5_1 + [ ] clm5_0 [ ] ctsm5_0-nwp @@ -877,51 +874,65 @@ Does this tag change answers significantly for any of the following physics conf Notes of particular relevance for users --------------------------------------- -Caveats for users (e.g., need to interpolate initial conditions): +Caveats for users (e.g., need to interpolate initial conditions): none -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): - if ndep file isn't found die with a warning rather than fatal error. - The warning allows you to override with CLM_BLDNML_OPTS="-ignore_warnings" +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - finidat file matching will now use the sim_year rather than start-year - for a control case (transient cases used the start-year) - Add 2010 f09 finidat file for clm5_0_cam6.0 +Changes made to namelist defaults (e.g., changed parameter values): none -Changes made to namelist defaults (e.g., changed parameter values): +Changes to the datasets (e.g., parameter, surface or initial files): none -Changes to the datasets (e.g., parameter, surface or initial files): +Substantial timing or memory changes: -Substantial timing or memory changes: None + Timing changes seem small, though not investigated carefully. No + timing changes are expected to show up in the PFS test (because it + doesn't do history output), but I looked at a few other non-debug f09 + cases: ERP_Ld5.f09_g17.I2000Clm50Vic.cheyenne_intel.clm-vrtlay, + ERP_Ld3.f09_g17.I1850Clm50BgcCropCru.cheyenne_intel.clm-ciso, + ERS_Ld3.f09_g17.I1850Clm50BgcCrop.cheyenne_intel.clm-rad_hrly_light_res_half, + ERS_Ld3.f09_g17.I2000Clm50Fates.cheyenne_intel.clm-FatesColdDef. Total + runtime of these increased in some tests and decreased in others + relative to the baseline, but on average, there was little change + relative to the baseline. I have more carefully investigated this + change in the context of pio2, which will soon become the default: + with pio2, this change is important to get good performance. + Notes of particular relevance for developers: (including Code reviews and testing) --------------------------------------------- NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - -Changes to tests or testing: - Add clm45cam6LndTuningMode testmod - Some tests needed more wallclock - -Code reviewed by: self +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none +Changes to tests or testing: Changed PE layout for C96 test -CTSM testing: regular +CTSM testing: [PASS means all tests PASS and OK means tests PASS other than expected fails.] build-namelist tests: - cheyenne - PASS (one test is different than ctsm1.0.dev105) + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run python testing (see instructions in python/README.md; document testing done): - cheyenne -= PASS + (any machine) - not run regular tests (aux_clm): - cheyenne ---- PASS - izumi ------- PASS + cheyenne ---- pass + izumi ------- pass + + Note: testing was done on 13c693d88, which was before the PE layout + change for C96 and C192. I then ran the new C96 test manually. If the tag used for baseline comparisons was NOT the previous tag, note that here: @@ -929,63 +940,53 @@ If the tag used for baseline comparisons was NOT the previous tag, note that her Answer changes -------------- -Changes answers relative to baseline: No (bit-for-bit) +Changes answers relative to baseline: NO Detailed list of changes ------------------------ -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): rtm, mosart - RTM to rtm1_0_72 - MOSART to mosart1_0_37 +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none -Pull Requests that document the changes (include PR ids): #1079 -(https://github.com/ESCOMP/ctsm/pull) - #1079 -- Bit-for-bit updates for the CESM2.2.0 release +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/CTSM/pull/1190 =============================================================== =============================================================== -Tag name: ctsm1.0.dev105 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) / Chris Fischer -Date: Thu Jul 23 08:59:37 MDT 2020 -One-line Summary: Bring in some new SE grids for CAM as well as initial condition files for them +Tag name: ctsm5.1.dev012 +Originator(s): oleson (Keith Oleson) / sacks (Bill Sacks) +Date: Tue Nov 3 09:31:41 MST 2020 +One-line Summary: Allow nlevgrnd < nlevurb Purpose of changes ------------------ - Add new SE (Spectral Element) grids: ne30np4.pg2, ne30np4.pg3, ne30np4, ne60np4, ne120np4, ne120np4.pg2, ne120np4.pg3, - ne0np4CONUS.ne30x8, ne0np4.ARCTIC.ne30x4, ne0np4.ARCTICGRIS.ne30x8 - Add new datasets for them, some new tests, and add support for their creation. - Also add some new initial condition (IC) files for 1979, 2000, and 2013 for use when coupled to CAM +Allow nlevgrnd < nlevurb. This will become more important soon, when +nlevurb is increased to 10, yet we want to allow simple soil layer +structures, e.g., for NWP applications. - The process for picking initial condition files was improved so that there can be more than one year that matches - and it will do the best to pick the best match. Also added the possibility for 1982 and 2013 simulation years for - specific grid matches. +Also some additions to ncdio-related utilities to support this, +including extending find_var_on_file to support dimensions as well as +variables. - Also update cime to a newer version that supports these new grids. And update CMEPS (and hence add in fox, CDEPS) - to latest used on the nuopc_dev branch. Testing with nuopc wouldn't work without this update. The cime version updates - the tables for dry-deposition and changes answers for dry-deposition when it's turned on. +Also add levsoi coordinate variable on history files. Bugs fixed or introduced ------------------------ -Issues fixed (include CTSM Issue #): #992 #994 - Fixes #992 -- New initial conditions for 1979, 2000 - Fixes #994 -- New CAM SE grids - Fixes #888 -- Add support for various "physics grids" needed by CAM -CIME Issues fixed (include issue #): #3593, #3569, #3564, PR#3557 - cime/#3593 -- Fix mapping files for new grids - cime/#3569 -- Fix cime regression testing - cime/#3564 -- Change alias for arctic grids - cime/#3557 -- updates to dry deposition data (PR) +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/CTSM#674 (Allow nlevgrnd less than nlevurb) + Significant changes to scientifically-supported configurations -------------------------------------------------------------- -Does this tag change answers significantly for any of the following physics configurations? No +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.] +[ ] clm5_1 + [ ] clm5_0 [ ] ctsm5_0-nwp @@ -995,68 +996,50 @@ Does this tag change answers significantly for any of the following physics conf Notes of particular relevance for users --------------------------------------- -Caveats for users (e.g., need to interpolate initial conditions): - Initial conditions (IC) for 1979 start date is technically 1982 - New initial condition files are ONLY for when coupled to CAM (B and F compsets) +Caveats for users (e.g., need to interpolate initial conditions): none -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): Allow for new grids - User updates to cime: - - Allow a user supplied config_grids.xml file. - - Improved error message for incorrect setting of cime model. +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none -Changes made to namelist defaults (e.g., changed parameter values): Add IC files for 1982 and 2013 years +Changes made to namelist defaults (e.g., changed parameter values): none -Changes to the datasets (e.g., parameter, surface or initial files): New SE grid datasets - Remove conus_30_x8 grid (previous name for new ne0np4CONUS.ne30x8 grid - Add new grids: ne30np4.pg2, ne30np4.pg3, ne30np4, ne60np4, ne120np4, ne120np4.pg2, ne120np4.pg3, - ne0np4CONUS.ne30x8, ne0np4.ARCTIC.ne30x4, ne0np4.ARCTICGRIS.ne30x8 - Add new mask: tx0.1v3 - New IC files: 1982 for ARCTIC and ARCTICGRIS, ne120np4 for 2000 and 2013 for CONUS all when coupled to CAM +Changes to the datasets (e.g., parameter, surface or initial files): none -Substantial timing or memory changes: None +Substantial timing or memory changes: none Notes of particular relevance for developers: (including Code reviews and testing) --------------------------------------------- NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - Initial condition picking will pick the file it finds with the closet simulation year to the request - for the lnd_tuning_mode desired. It will pick based on year over an exact match in resolution. - You can get around this by setting use_init_interp to be specific for a resolution - - Also realized that there is a dependence between the namelist_defaults_ctsm.xml file and namelist_defaults_overall.xml - for the clm_start_type item. It must be coordinated with use_init_interp, init_interp_attributes and finidat - to work properly. I added a comment about this. We should probably just move them into the same file. - -Changes to tests or testing: Added tests for new grids - -Code reviewed by: self, fischer-ncar, adamrher +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none +Changes to tests or testing: +- Removed the no-longer-useful snowlayers_3_monthly test +- Added a test with nlevgrnd < nlevurb -CTSM testing: regular +CTSM testing: [PASS means all tests PASS and OK means tests PASS other than expected fails.] build-namelist tests: - cheyenne - OK (130 tests fail comparison to previous verison due to new IC files) + cheyenne - not run tools-tests (test/tools): - izumi - OK + cheyenne - not run PTCLM testing (tools/shared/PTCLM/test): - izumi - OK + cheyenne - not run python testing (see instructions in python/README.md; document testing done): - izumi -- PASS + (any machine) - not run regular tests (aux_clm): - cheyenne ---- OK - izumi ------- PASS + cheyenne ---- pass + izumi ------- pass If the tag used for baseline comparisons was NOT the previous tag, note that here: @@ -1064,70 +1047,77 @@ If the tag used for baseline comparisons was NOT the previous tag, note that her Answer changes -------------- -Changes answers relative to baseline: No bit-for-bit (unless running with CAM because of new finidat files) - Running with nuopc changes answers because of updates to nuopc drivers - Dry-deposition changes answers when turned on (but doesn't effect anything else) +Changes answers relative to baseline: NO Detailed list of changes ------------------------ -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cime, cmeps, cdeps, fox - cime updated to cime5.8.28 (from branch_tags/cime5.8.24_a01) - fox, and cdeps added in - cmeps, cdeps and fox updated to hashes used in the nuopc_dev branch of CESM +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none -Pull Requests that document the changes (include PR ids): #1038 -(https://github.com/ESCOMP/ctsm/pull) - #1038 -- New fsufdat and landuse time series files for ne grids +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/CTSM/pull/1195 =============================================================== =============================================================== -Tag name: ctsm1.0.dev104 +Tag name: ctsm5.1.dev011 Originator(s): sacks (Bill Sacks) -Date: Mon Jul 6 09:58:15 MDT 2020 -One-line Summary: Add LILAC +Date: Mon Nov 2 10:28:35 MST 2020 +One-line Summary: Change CISM2%NOEVOLVE compsets to use SGLC; documentation updates Purpose of changes ------------------ -Add LILAC: The Lightweight Infrastructure for Land-Atmosphere -Coupling. This infrastructure consists of two major pieces: +(1) Change CISM2%NOEVOLVE compsets to use SGLC. + +The use of CISM2%NOEVOLVE adds complexity and (perhaps most importantly) +increases the turnaround time of CTSM software testing, while adding +only marginal scientific value. Therefore, we are changing I compsets to +use a stub glacier (SGLC) rather than CISM2%NOEVOLVE for now. Within the +next year, we'd like to have these use a data glc model, but that will +most likely wait until we switch to using NUOPC by default (so we can +use a data glc in CDEPS: ESCOMP/CDEPS#25). + +This tag changes the meaning of compset aliases that previously had +neither a Gs (for stub glacier) or G (for CISM2%EVOLVE), so that they +now use a stub glacier (SGLC) rather than CISM2%NOEVOLVE. Compset +aliases that previously had Gs (so were already using a stub glacier) +have been changed so that there is no longer a Gs in the alias: stub +glacier is now the implied default. -(1) A lightweight coupling infrastructure built on top of ESMF that - makes it easier for atmosphere models to call CTSM directly, rather - than using the hub-and-spoke architecture that is used by CESM. +This change reduces our test build time to 40% of what it previously +was! When I ran the test suite for ctsm5.1.dev010, the cheyenne-intel +test suite (by far the largest of our test suites) took 5 hours, 8 min +to build. In yesterday's run of the test suite with this change in +place, the cheyenne-intel test suite took only 2 hours, 6 min to build! +The final test in this test suite finished running just 2 hours, 29 min +after I started the test suite. This may not be a completely fair +comparison, because the machine may have been relatively lightly loaded +during this Sunday afternoon run, but I wouldn't expect the test suite +build time (which is what I'm reporting here) to be hugely impacted by +that. -(2) A set of python-based tools for building CTSM and creating its - runtime inputs when running in an atmosphere model via - LILAC. Although these tools are built on top of cime, details of the - create_newcase / case.setup / case.build process are hidden from the - user, because many of the aspects of this workflow don't make sense - in the LILAC context. +Changes due to using SGLC in place of CISM2%NOEVOLVE are documented +here: +. -So far we have used LILAC to couple CTSM to WRF. There are plans to use -the same infrastructure to couple CTSM to other regional atmosphere -models. +(2) Documentation updates -Documentation of LILAC is provided in -https://escomp.github.io/ctsm-docs/versions/master/html/lilac/index.html -(though there are still some missing sections), as well as in various -presentations on the wiki -(https://github.com/ESCOMP/CTSM/wiki/Presentations). +Brings in a new optional external, doc-builder, to assist with building +the documentation, specifically with a new Docker-based workflow +documented here +. + +Also updates LILAC documentation and a bit more. -There have been many contributors besides myself to the development, -testing and documentation of LILAC; chief among them being Mariana -Vertenstein, Negin Sobhani, Joe Hamman, Sam Levis, Mike Barlage and Dave -Lawrence. Bugs fixed or introduced ------------------------ Issues fixed (include CTSM Issue #): -- See issues in the Done column of https://github.com/ESCOMP/CTSM/projects/23 +- Resolves ESCOMP/CTSM#1135 (Replace CISM2%NOEVOLVE compsets with SGLC) Known bugs introduced in this tag (include github issue ID): -- Although LILAC is working to first order, there is still some work to -do. See outstanding issues in https://github.com/ESCOMP/CTSM/projects/23 +- See ESCOMP/CTSM#1136 (Use data glc model where we used to use CISM2%NOEVOLVE) Significant changes to scientifically-supported configurations @@ -1138,19 +1128,26 @@ 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_0 +[X] clm5_1 -[ ] ctsm5_0-nwp +[X] clm5_0 -[ ] clm4_5 +[X] ctsm5_0-nwp + +[X] clm4_5 Notes of particular relevance for users --------------------------------------- -Caveats for users (e.g., need to interpolate initial conditions): none +Caveats for users (e.g., need to interpolate initial conditions): +- This tag changes the meaning of compset aliases that previously had + neither a Gs (for stub glacier) or G (for CISM2%EVOLVE), so that they + now use a stub glacier (SGLC) rather than CISM2%NOEVOLVE. Compset + aliases that previously had Gs (so were already using a stub glacier) + have been changed so that there is no longer a Gs in the alias: stub + glacier is now the implied default. -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): -- dtime no longer specified on the namelist: just obtained from driver +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none Changes made to namelist defaults (e.g., changed parameter values): none @@ -1165,10 +1162,14 @@ NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the Caveats for developers (e.g., code that is duplicated that requires double maintenance): none Changes to tests or testing: -- Added LILACSMOKE test - -Code reviewed by: self - +- Changed compsets used in testing according to the above notes. In + particular, this involved removing the 'Gs' from compset names in + tests. +- No longer need a specific testmod for the LII test (see commit + f75335a45) +- Changed the glcMEC_changeFlags test to be more useful (see commit + e350beced) +- Removed _gl4 from resolution in tests that no longer use CISM CTSM testing: @@ -1176,10 +1177,7 @@ CTSM testing: build-namelist tests: - cheyenne - ok - - Baseline comparisons fail as expected. One test failed, but it also - failed for me on master (https://github.com/ESCOMP/CTSM/issues/1074) + cheyenne - not run tools-tests (test/tools): @@ -1191,12 +1189,14 @@ CTSM testing: python testing (see instructions in python/README.md; document testing done): - (any machine) - pass on my mac + (any machine) - not run regular tests (aux_clm): - cheyenne ---- pass - izumi ------- pass + cheyenne ---- ok + izumi ------- ok + + ok: tests pass, baselines fail as expected If the tag used for baseline comparisons was NOT the previous tag, note that here: @@ -1204,43 +1204,83 @@ If the tag used for baseline comparisons was NOT the previous tag, note that her Answer changes -------------- -Changes answers relative to baseline: NO +Changes answers relative to baseline: YES + + Summarize any changes to answers, i.e., + - what code configurations: ALL + - what platforms/compilers: ALL + - nature of change (roundoff; larger than roundoff/same climate; new climate): + Larger than roundoff; potentially new climate regionally, over Greenland + + The changes arise from changes in the meaning of + compsets. Configurations that used to use a stub GLC (compsets + with Gs in their alias) have the same meaning as before, but a + different compset alias (so in testing, this resulted in BFAILs + due to missing baselines). Configurations that previously used + CISM2%NOEVOLVE (which included most of our standard + configurations) now instead use a stub GLC. This results in + differences over Greenland (in ways described here: + ). + + If bitwise differences were observed, how did you show they were no worse + than roundoff? N/A + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + - casename: N/A + URL for LMWG diagnostics output used to validate new climate: N/A + Detailed list of changes ------------------------ -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): +- New doc-builder external (at v1.0.2) -Pull Requests that document the changes (include PR ids): -https://github.com/ESCOMP/CTSM/pull/1068 +Pull Requests that document the changes (include PR ids): none =============================================================== =============================================================== -Tag name: ctsm1.0.dev103 -Originator(s): slevis (Samuel Levis, SLevis Consulting LLC,303-665-1310) -Date: Mon Jun 29 17:16:29 MDT 2020 -One-line Summary: Gridcell-level balance-check for methane (CH4) +Tag name: ctsm5.1.dev010 +Originator(s): sacks (Bill Sacks), jedwards (Jim Edwards) +Date: Fri Oct 23 14:36:03 MDT 2020 +One-line Summary: Fix reading netcdf variable into a different data type Purpose of changes ------------------ - Bracket the model time-step loop to calculate balance checks at the - gridcell level, as detailed in issue #315. The column-level check - remains unchanged. +Main change is to fix the reading of a variable that is one type on a +NetCDF file but a different data type in memory. Previously, this could +lead to memory corruption (not just of the variable in question, but +other variables as well). This was not causing any problems in +out-of-the-box configurations, but it sometimes tripped up some +developers when they added new fields on datasets. - Subroutine ch4_init_balance_check is replaced with - ch4_init_column_balance_check. Subroutine - ch4_init_gridcell_balance_check is added. +In addition, this adds new self-test code to test ncdio_pio. This module +is hard to get under unit test, but we want to have some tests of it, to +pick up problems like the one fixed in this tag. So as a compromise +solution for now, I have introduced unit test-like tests that are built +into a standard build of CTSM and run in a standard run if a given +namelist flag is set. A better long-term solution would be to integrate +these tests into the pFUnit-based unit testing framework, but that would +take some work. I have added tests of the new code, and a bit of testing +of other code in ncdio_pio, but there's still a lot in ncdio_pio that is +not tested. I figure we can gradually add tests as we make changes to +ncdio_pio. - The implementation is similar to the one for carbon and nitrogen (see - tag ctsm1.0.dev096). +Finally, an unrelated change to the unit test build: files generated by +genf90 now appear in the unit test build directory rather than the +source tree. Bugs fixed or introduced ------------------------ -Issues fixed (include CTSM Issue #): #315 - +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/CTSM#1091 (Memory corruption when reading a netcdf + variable into a variable of a different type, at least with PIO1) +- Resolves ESCOMP/CTSM#1188 (In unit test build: files generated by + genf90 should go in build dir rather than source dir) Significant changes to scientifically-supported configurations -------------------------------------------------------------- @@ -1250,6 +1290,8 @@ 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 + [ ] clm5_0 [ ] ctsm5_0-nwp @@ -1259,34 +1301,33 @@ Does this tag change answers significantly for any of the following physics conf Notes of particular relevance for users --------------------------------------- -Caveats for users (e.g., need to interpolate initial conditions): - None +Caveats for users (e.g., need to interpolate initial conditions): none Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): - None +- new namelist variable, for_testing_run_ncdiopio_tests -Changes made to namelist defaults (e.g., changed parameter values): - None +Changes made to namelist defaults (e.g., changed parameter values): none -Changes to the datasets (e.g., parameter, surface or initial files): - None +Changes to the datasets (e.g., parameter, surface or initial files): none -Substantial timing or memory changes: - No +Substantial timing or memory changes: none Notes of particular relevance for developers: (including Code reviews and testing) --------------------------------------------- NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide Caveats for developers (e.g., code that is duplicated that requires double maintenance): - None +- Ideally the ncdio_pio self-tests would be recoded as true unit tests, + leveraging the pFUnit framework. This would get them out of the main + source code, and would give other benefits that come with a real unit + testing framework, such as that a single failure doesn't abort the + entire test suite. +- The existence of tests for ncdio_pio should NOT be taken as a sign + that all (or even most) of this module is now under unit test: in + fact, much of it is not covered yet by my new testing module. Changes to tests or testing: - None - -Code reviewed by: - @billsacks - +- Added a test that triggers for_testing_run_ncdiopio_tests CTSM testing: @@ -1294,24 +1335,24 @@ CTSM testing: build-namelist tests: - cheyenne - + cheyenne - not run tools-tests (test/tools): - cheyenne - + cheyenne - not run PTCLM testing (tools/shared/PTCLM/test): - cheyenne - + cheyenne - not run python testing (see instructions in python/README.md; document testing done): - (any machine) - + (any machine) - not run regular tests (aux_clm): - cheyenne ---- PASS - izumi ------- PASS + cheyenne ---- pass + izumi ------- pass If the tag used for baseline comparisons was NOT the previous tag, note that here: @@ -1319,55 +1360,36 @@ If the tag used for baseline comparisons was NOT the previous tag, note that her Answer changes -------------- -Changes answers relative to baseline: - No +Changes answers relative to baseline: NO Detailed list of changes ------------------------ -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): - None +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none Pull Requests that document the changes (include PR ids): - https://github.com/ESCOMP/CTSM/pull/1022 +https://github.com/ESCOMP/CTSM/pull/1189 +https://github.com/ESCOMP/CTSM/pull/1176 (old version, superseded by 1189) =============================================================== =============================================================== -Tag name: ctsm1.0.dev102 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Fri Jun 26 01:32:04 MDT 2020 -One-line Summary: Some important fixes for LUNA in clm5_0, and small urban issue in clm5_0 +Tag name: ctsm5.1.dev009 +Originator(s): negins (Negin Sobhani,UCAR/TSS,303-497-1224) +Date: Wed Oct 21 11:14:25 MDT 2020 +One-line Summary: BFB changes for Perturbed Parameter Ensemble and Hydraulic redistribution Purpose of changes ------------------ -Fix some important issues that were found in LUNA for the arctic. These changes were large enough -that we had to re-tune the clm5_0 parameters to give a similar simulation. Leah Birch noticed -that the formulations in the code disagreed with the paper. Correcting this caused arctic plants -to be less productive. In order to compensate parameters for leafcn, and slatop were adjusted for -broadleaf_deciduous_boreal_shrub and c3_arctic_grass for clm5_0. - -The total vegetation carbon threshold on exit_spinup (from accelerated decomposition (AD) mode) was -increased from 0.1 to 1.0. Without this change some PFT's can die out in exit spinup even when -they have significant carbon stores from the AD spinup mode. - -There is an implicit assumption in the urban building energy model that building width equals -street width. However, this assumption can/should be relaxed and building width can be derived -from the morphology dataset. - +Some BFB changes for PPE work and Hydraulic redistribution Bugs fixed or introduced ------------------------ -Issues fixed (include CTSM Issue #): #738 #803 #953 #958 #1056 - Fixes #1056 -- Remove allpfts dimension - Fixes #953 -- Incorrect formula in LUNA uses day time rather than average of day/night - Fixes #958 -- LUNA day length factor missing - Fixes #738 -- Totvegc threshold increased from 0.1 to 1. - Fixes #803 -- No longer assume building width +Issues fixed (include CTSM Issue #): [If none, remove this line] + - resolves ESCOMP/CTSM#881 + - resolves ESCOMP/CTSM#1020 -Known bugs introduced in this tag (include github issue ID): #1060 - #1060 -- Some code cleanup of luna bug fixes Significant changes to scientifically-supported configurations -------------------------------------------------------------- @@ -1375,131 +1397,120 @@ 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_0 +[ ] clm5_1 + +[ ] clm5_0 -[x] ctsm5_0-nwp +[ ] ctsm5_0-nwp [ ] clm4_5 Notes of particular relevance for users --------------------------------------- -Caveats for users (e.g., need to interpolate initial conditions): clm5_0 climate adjusted for arctic plants +Caveats for users (e.g., need to interpolate initial conditions): None -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): + - maxpatch_pft is removed from namelist -Changes made to namelist defaults (e.g., changed parameter values): +Changes made to namelist defaults (e.g., changed parameter values): None -Changes to the datasets (e.g., parameter, surface or initial files): New parameter files +Changes to the datasets (e.g., parameter, surface or initial files): None -Substantial timing or memory changes: None +Substantial timing or memory changes: [For timing changes, can check PFS test(s) in the test suite] Notes of particular relevance for developers: (including Code reviews and testing) --------------------------------------------- NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide -Caveats for developers (e.g., code that is duplicated that requires double maintenance): We - chose some bad names for variables, so we'll clean this up in a seperate step (see #1060) - -Changes to tests or testing: None - -Code reviewed by: self, olyson, bill-sacks, wweider +Caveats for developers (e.g., code that is duplicated that requires double maintenance): None +Changes to tests or testing: -CTSM testing: regular +CTSM testing: [PASS means all tests PASS and OK means tests PASS other than expected fails.] build-namelist tests: - cheyenne - PASS (266 compare differently because of update in paramsfile and jmaxb1) + cheyenne - not run - python testing (see instructions in python/README.md; document testing done): + tools-tests (test/tools): - cheyenne - PASS + cheyenne - not run - regular tests (aux_clm): - - cheyenne ---- PASS - izumi ------- PASS - -If the tag used for baseline comparisons was NOT the previous tag, note that here: + PTCLM testing (tools/shared/PTCLM/test): + cheyenne - not run -Answer changes --------------- + python testing (see instructions in python/README.md; document testing done): -Changes answers relative to baseline: Yes for clm5_0 + (any machine) - None - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): + regular tests (aux_clm): - Summarize any changes to answers, i.e., - - what code configurations: clm5_0 when Luna on as well as smaller changes for urban - - what platforms/compilers: all - - nature of change: climate changing, but tuned to respond similar to clm5.0 + cheyenne ---- ok + izumi ------- ok - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - luna changes: oleson case clm50_ctsm10d089_2deg_GSWP3V1_luna3_jmaxb1-0.17_slatopA_leafcnA_hist +If the tag used for baseline comparisons was NOT the previous tag, note that here: N/A - URL for LMWG diagnostics output used to validate new climate: - urban changes: +Answer changes +-------------- +Changes answers relative to baseline: + Four new fields regarding plant hydraulic processes has been added: -http://webext.cgd.ucar.edu/I2000/clm50_ctsm10d098_1deg_GSWP3V1_CON_FIXBUILDENERGY_2000/lnd/clm50_ctsm10d098_1deg_GSWP3V1_CON_FIXBUILDENERGY_2000.1991_2010-clm50_ctsm10d098_1deg_GSWP3V1_CON_2000.1991_2010/setsIndex.html - + - QHR (patch-level hydraulic redistribution) + - VEGWPLN (local noon vegetation water potential) + - VEGWPPD (predawn vegetation water potential) + - VPD_CAN: canopy vapor pressure deficit (functional input to Medlyn model) Detailed list of changes ------------------------ List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None -Pull Requests that document the changes (include PR ids): #1034 and #962 -(https://github.com/ESCOMP/ctsm/pull) - #1034 -- Building energy fix - #962 --- Fixes for the LUNA dayl bugs +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/CTSM/pull/1187 +https://github.com/ESCOMP/CTSM/pull/1126 =============================================================== =============================================================== -Tag name: ctsm1.0.dev101 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326), oleson (Keith Oleson) -Date: Wed Jun 17 23:51:22 MDT 2020 -One-line Summary: Changes from Keith to bring a list of variables to the parameter file +Tag name: ctsm5.1.dev008 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Wed Oct 7 11:48:30 MDT 2020 +One-line Summary: Two answer changes: Clm45/50/51 with crop, and for 2000Clm51 Purpose of changes ------------------ -Change some hardcoded parameters to go on the parameter files. This is needed in preparation -of running the Perturbed Parameter Ensemble. +Turn dribble_crophrv_xsmrpool_2atm when crop is on for clm4_5, clm5_0, and clm5_1 physics +Fix the finidat files being selected for 2000_control conditions for clm5_1 Bugs fixed or introduced ------------------------ -Issues fixed (include CTSM Issue #): #995 #138, #206 - -Fixes #995 -- Soil turnover times are on paramfile and hardcoded -Fixes #138 -- use tau_ values on paramfile -Fixes #206 -- add prh30 to paramfile -Some work on #290 -- LUNA refactoring - +Issues fixed (include CTSM Issue #): + Fixes #1158 -- Turn dribble_crophrv_xsmrpool_2atm on when crop is on for all physics versions + Another issue in #1166 -- correct finidat file for 2000Clm51 Significant changes to scientifically-supported configurations -------------------------------------------------------------- -Does this tag change answers significantly for any of the following physics configurations? No +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.] -[ ] clm5_0 +[x] clm5_1 + +[x] clm5_0 [ ] ctsm5_0-nwp -[ ] clm4_5 +[x] clm4_5 Notes of particular relevance for users --------------------------------------- @@ -1508,18 +1519,10 @@ Caveats for users (e.g., need to interpolate initial conditions): None Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): None -Changes made to namelist defaults (e.g., changed parameter values): None +Changes made to namelist defaults (e.g., changed parameter values): + dribble_crophrv_xsmrpool_2atm now on when crop on for all physics versions -Changes to the datasets (e.g., parameter, surface or initial files): paramfile for both clm4_5 and clm5_0 - Add 51 new parameters to the paramsfile: - bsw_adjustfactor,cpha,csol_clay,csol_om,csol_sand,denitrif_nitrateconc_coefficient,denitrif_nitrateconc_exponent, - denitrif_respiration_coefficient,denitrif_respiration_exponent,drift_gs,e_ice,enzyme_turnover_daily,eta0_anderson, - eta0_vionnet,fnps,hksat_adjustfactor,ignition_efficiency,jmaxb0,jmaxha,jmaxhd,kcha,koha,kp25ratio,lmrha,lmrhd, - lmrse,luna_theta_cj,minrelh,n_baseflow,pd,perched_baseflow_scalar,prh30,relhExp,ssi,sucsat_adjustfactor,theta_cj, - theta_ip,theta_psii,tpuha,tpuhd,tkd_clay,tkd_om,tkd_sand,tkm_om,tpu25ratio,vcmaxha,vcmaxhd,watsat_adjustfactor, - wc2wjb0,wimp,wind_min - k_nitr_max removed and replaced with k_nitr_max_perday - meta-data for the tau_* variables changed, and a roundoff difference in the clm4_5 paramfile +Changes to the datasets (e.g., parameter, surface or initial files): None Substantial timing or memory changes: None @@ -1527,31 +1530,28 @@ Notes of particular relevance for developers: (including Code reviews and testin --------------------------------------------- NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide -Caveats for developers (e.g., code that is duplicated that requires double maintenance): prh30 not used for clm4_5 - prh30 was added in but won't be used for the CNFireLi2014 formulation. - It's only used for the clm5_0 and following formulations +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + The namelist dribble_crophrv_xsmrpool_2atm should now be removed as a namelist item both + in the fortran code and in build-namelist scripts. This change should be bit-for-bit. Changes to tests or testing: None -Code reviewed by: self, oleson - - CTSM testing: regular [PASS means all tests PASS and OK means tests PASS other than expected fails.] build-namelist tests: - cheyenne - PASS (170 tests differ from baseline because of new paramfiles) + cheyenne - PASS (120 tests are different than before) python testing (see instructions in python/README.md; document testing done): - cheyenne - PASS + cheyenne -- PASS regular tests (aux_clm): - cheyenne ---- OK - izumi ------- OK + cheyenne ---- PASS + izumi ------- PASS If the tag used for baseline comparisons was NOT the previous tag, note that here: @@ -1559,48 +1559,111 @@ If the tag used for baseline comparisons was NOT the previous tag, note that her 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: Clm45/50/51 with crop (except with prognostic CO2) and 2000Clm51 + - what platforms/compilers: All + - nature of change: same climate Detailed list of changes ------------------------ List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None -Pull Requests that document the changes (include PR ids): #1039 +Pull Requests that document the changes (include PR ids): #1177 (https://github.com/ESCOMP/ctsm/pull) - #1039 -- move hardcoded parameters to paramfile + + #1177 -- Two answer changes turn dribble_crophrv_xsmrpool_2atm and correct clm5_1 finidat + file for 2000 conditions =============================================================== =============================================================== -Tag name: ctsm1.0.dev100 +Tag name: ctsm5.1.dev007 Originator(s): sacks (Bill Sacks) -Date: Tue Jun 9 06:15:15 MDT 2020 -One-line Summary: Deallocate memory after running init_interp - +Date: Tue Oct 6 09:29:27 MDT 2020 +One-line Summary: CNFire: btran2 fixes and general cleanup + Purpose of changes ------------------ -Many of the pointer arrays in init_interp were not being deallocated -when init_interp finished. This was a particular problem because some of -these arrays were allocated for the full global source grid on each -processor, so the memory use was significant. This tag fixes this issue. +(1) Call routine to calculate fire's btran2 from CNFireArea; this has a + few advantages: + + - It makes the logic of CNFireArea more clear (rather than depending on + a btran2 variable that is calculated from some other part of the code) + + - This avoids having the biogeophysics depend on the biogeochemistry + + - This lets us avoid doing this btran calc if using no-fire – or other, + future, fire methods that don't need it + + Note regarding testing: In the initial step, I kept this calculation + dependent on a saved version of h2osoi_vol to avoid changing + answers; I changed this in the answer changes in step (2), as noted + below. + +(2) Answer-changing fixes to CNFire's btran2 calculation and use: + + (a) Calculate fire btran2 using updated h2osoi_vol (this is an + answer-changing cleanup step from (1)) + + (b) TEMPORARY CHANGE (reverted in the cleanup in (3)): Reinitialize + fire btran2 to spval for all patches in each time step, so that + the fire code isn't trying to use btran2 from earlier time steps + for patches that were in the exposed veg filter at one point but + no longer are. + + One implication of this is that, if there is currently no + exposed veg on a column, the new code leads to the block of code + that forces fire_m = 0 (because wtlf will be 0). Previously, in + contrast, it looks like fire_m was allowed to be non-zero even + if there is currently no exposed veg, because btran2 and wtlf + were accumulated if a patch ever was exposed in the past. + + (c) Limit fire btran2 to be <= 1, rather than letting it be slightly + greater than 1. (Due to a conditional in CNFireArea, these + slightly-greater-tan-1 values were being ignored when computing + btran_col, rather than averaging in a 1 value.) + +(3) Non-answer-changing fire code cleanup: + + (a) Cleanup of the btran2 fixes, including reverting the TEMPORARY + CHANGE noted in (2b), instead relying on a better mechanism: + just doing the calculations of btran_col and wtlf over the + exposedvegp filter. Also, get rid of the checks for + shr_infnan_isnan(btran2(p)) and btran2(p) <= 1 (allowed by the + other changes in (2) and (3)). + + (b) Set btran2 to 0 over non-exposed-veg points: this changes + answers for the BTRAN2 diagnostic field, but nothing else. (This + follows what is done for the standard BTRAN.) + + (c) Move calc_fire_root_wetness for CNFireLi2021 into the base type + to avoid future bugs (assuming that the next fire module will + extend the base class but will also want to use this new version + of calc_fire_root_wetness). + + (d) Change fire looping structure to be more standard -This issue is documented in https://github.com/ESCOMP/CTSM/issues/1010 -and https://github.com/ESCOMP/CTSM/issues/1032. +(4) Remove some very expensive tests from aux_clm, putting some in the + new ctsm_sci test list instead +(5) A bit of other minor cleanup Bugs fixed or introduced ------------------------ Issues fixed (include CTSM Issue #): -- Resolves ESCOMP/CTSM#1032 (Memory isn't deallocated in some of the - init_interp code) - -Known bugs found since the previous tag (include github issue ID): -- This does NOT resolve ESCOMP/CTSM#1010 (WACCMX test fails with - ctsm1.0.dev093 in cesm2_2_alpha05c), even though that was the original - hope. - +- Resolves ESCOMP/CTSM#1139 (Decrease expense of ne0ARCTICGRISne30x8 + test and C96 tests) +- Resolves ESCOMP/CTSM#1153 (Fire btran2 is only computed for exposed + veg patches, but is used over all veg patches) +- Resolves ESCOMP/CTSM#1170 (CNFire code: btran2 should not be skipped + when it's greater than 1) +- Partially addresses ESCOMP/CTSM#1142 (Add ctsm_sci test list that + would be used for releases and making sure important resolutions run + well) Significant changes to scientifically-supported configurations -------------------------------------------------------------- @@ -1610,11 +1673,13 @@ 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_0 +[X] clm5_1 -[ ] ctsm5_0-nwp +[X] clm5_0 -[ ] clm4_5 +[X] ctsm5_0-nwp + +[X] clm4_5 Notes of particular relevance for users --------------------------------------- @@ -1628,9 +1693,6 @@ Changes made to namelist defaults (e.g., changed parameter values): none Changes to the datasets (e.g., parameter, surface or initial files): none Substantial timing or memory changes: none -- The initial run of the PFS test showed a very long time taken in - initialization. However, it appears that this was a system issue: - rerunning twice showed times back to normal. Notes of particular relevance for developers: (including Code reviews and testing) --------------------------------------------- @@ -1638,10 +1700,8 @@ NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the Caveats for developers (e.g., code that is duplicated that requires double maintenance): none -Changes to tests or testing: none - -Code reviewed by: self - +Changes to tests or testing: Remove some very expensive tests from +aux_clm, putting some in the new ctsm_sci test list instead. CTSM testing: @@ -1665,22 +1725,10 @@ CTSM testing: regular tests (aux_clm): - cheyenne ---- pass - izumi ------- pass - - Most testing was done on f332fafc. After that, I made a minor change - that was needed for the unit tests to pass. I then reran (1) - clm_short on cheyenne, and (2) this subset of the test list on - izumi: + cheyenne ---- ok + izumi ------- ok - SMS.f10_f10_musgs.I2000Clm50BgcCrop.izumi_gnu.clm-crop - SMS_D.f10_f10_musgs.I2000Clm50BgcCrop.izumi_gnu.clm-crop - PEM_Ld1.f10_f10_musgs.I2000Clm50BgcCropGs.izumi_intel.clm-crop - SMS_D.f10_f10_musgs.I2000Clm50BgcCrop.izumi_intel.clm-crop - SMS.f10_f10_musgs.I2000Clm50BgcCrop.izumi_pgi.clm-crop - SMS_D.f10_f10_musgs.I2000Clm50BgcCrop.izumi_pgi.clm-crop - SMS_Ld5_D_P48x1.f10_f10_musgs.IHistClm50Bgc.izumi_nag.clm-monthly - ERP_Ld5_P48x1.f10_f10_musgs.I1850Clm50Bgc.izumi_nag.clm-default + ok: tests pass, many baselines fail as expected If the tag used for baseline comparisons was NOT the previous tag, note that here: @@ -1688,32 +1736,78 @@ If the tag used for baseline comparisons was NOT the previous tag, note that her Answer changes -------------- -Changes answers relative to baseline: NO +Changes answers relative to baseline: YES, for all CN/BGC configurations + Summarize any changes to answers, i.e., + - what code configurations: All CN/BGC configurations + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + larger than roundoff; expected to be same climate, but not + investigated yet + + + To verify that the answer changes only came from expected changes, I + did a few rounds of testing. The following numbers refer to the groups + of changes listed under "Purpose of changes", above. The changes in + groups (4) and (5) were combined with those in groups (1) and (3) - + i.e., the basically non-answer-changing sets. + + First, I tested with just the changes in (1). This led to differences + in only limited configurations, as noted in + https://github.com/ESCOMP/CTSM/pull/1155#issuecomment-695035048: + - nofire tests had diffs in BTRAN2 + - dynroots tests had extensive diffs because now btran2 is calculated + after the dyn roots updates in each time step + - tests where the compared clm2 h0 file includes the 0th time step had + diffs just in BTRAN2, for reasons I couldn't determine + + Then I tested with the changes in (2), which were expected to change + answers for all CN/BGC tests. In particular, these change answers due + to: + - using updated h2osoi_vol rather than the one earlier in the time + step when calculating btran2 + - only considering points in the exposed veg filter when averaging + btran2 from patch to column, rather than using stale values from + no-longer-exposed patches (which also means having fire_m = 0 if + there are no currently-exposed veg patches in a column) (fix for + ESCOMP/CTSM#1153) + - treating btran2 values that are slightly greater than 1 as 1, rather + than ignoring them completely (fix for ESCOMP/CTSM#1170) + + Finally, I tested with all of the changes, comparing against the + baselines generated from (2). As expected, the only answer changes in + this final round were in the BTRAN2 diagnostic field (due to setting + btran2 to 0 over non-exposed-veg points). Detailed list of changes ------------------------ List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none -Pull Requests that document the changes (include PR ids): none +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/CTSM/pull/1155 =============================================================== =============================================================== -Tag name: ctsm1.0.dev099 +Tag name: ctsm5.1.dev006 Originator(s): sacks (Bill Sacks) -Date: Mon Jun 8 09:29:38 MDT 2020 -One-line Summary: Update cime, needed for izumi machine updates +Date: Sat Oct 3 19:50:41 MDT 2020 +One-line Summary: Call correct routine to calculate btran2 for CNFireLi2021 Purpose of changes ------------------ -Update cime. The most important change here is an update for izumi, -which is needed for the recent izumi machine updates. +Due to a subtle code bug, CNFireLi2021 was using the btran2 calculating +routine from the base class rather than the new one that is specific to +this formulation. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/CTSM#1173 (CNFireLi2021Mod uses the wrong btran2 + routine) -Also: Change izumi PEM test to use SGLC (after the machine updates, the -PEM test was failing; see also -https://github.com/ESCOMP/CTSM/issues/840). Significant changes to scientifically-supported configurations -------------------------------------------------------------- @@ -1723,6 +1817,8 @@ 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.] +[X] clm5_1 + [ ] clm5_0 [ ] ctsm5_0-nwp @@ -1740,7 +1836,7 @@ Changes made to namelist defaults (e.g., changed parameter values): none Changes to the datasets (e.g., parameter, surface or initial files): none -Substantial timing or memory changes: not investigated; none expected +Substantial timing or memory changes: not investigated (none expected) Notes of particular relevance for developers: (including Code reviews and testing) --------------------------------------------- @@ -1748,12 +1844,7 @@ NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the Caveats for developers (e.g., code that is duplicated that requires double maintenance): none -Changes to tests or testing: -- Changed izumi PEM test to use SGLC (after the machine updates, the PEM -test was failing; see also https://github.com/ESCOMP/CTSM/issues/840). - -Code reviewed by: self - +Changes to tests or testing: none CTSM testing: @@ -1777,16 +1868,19 @@ CTSM testing: regular tests (aux_clm): - cheyenne ---- pass + cheyenne ---- ok izumi ------- ok - izumi: tests pass, some baselines fail as expected + ok: tests pass, Clm51Bgc baselines fail as expected + + Note: there were also the following BFAIL results due to missing + baselines, as documented in the previous tag: - ERP_D_Ld3.f09_g17.I2000Clm50SpGs.cheyenne_intel.clm-prescribed - showed differences from the stored baselines, but it appears that - the stored baselines were incorrect: when I reran this test from - master, the master version differed from the stored baselines and - was identical to this branch. + FAIL ERS_D_Ld10.C96_C96_mg17.IHistClm50Sp.cheyenne_intel.clm-decStart BASELINE ctsm5.1.dev005: ERROR BFAIL some baseline files were missing + FAIL ERS_Ln9.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.IHistClm50SpGs.cheyenne_intel.clm-clm50cam6LndTuningMode_1979Start BASELINE ctsm5.1.dev005: ERROR BFAIL some baseline files were missing + FAIL SMS_Ln9.ne0ARCTICGRISne30x8_ne0ARCTICGRISne30x8_mt12.IHistClm50Sp.cheyenne_intel.clm-clm50cam6LndTuningMode_1979Start BASELINE ctsm5.1.dev005: ERROR BFAIL some baseline files were missing + FAIL SMS_Ln9.ne0ARCTICGRISne30x8_ne0ARCTICGRISne30x8_mt12.ISSP585Clm50BgcCrop.cheyenne_intel.clm-clm50cam6LndTuningMode BASELINE ctsm5.1.dev005: ERROR BFAIL some baseline files were missing + FAIL SMS_Ln9.ne0CONUSne30x8_ne0CONUSne30x8_mt12.IHistClm50Sp.cheyenne_intel.clm-clm50cam6LndTuningMode_2013Start BASELINE ctsm5.1.dev005: ERROR BFAIL some baseline files were missing If the tag used for baseline comparisons was NOT the previous tag, note that here: @@ -1794,68 +1888,49 @@ If the tag used for baseline comparisons was NOT the previous tag, note that her Answer changes -------------- -Changes answers relative to baseline: YES, just on izumi due to machine updates - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): +Changes answers relative to baseline: YES Summarize any changes to answers, i.e., - - what code configurations: some izumi tests - - what platforms/compilers: izumi gnu & pgi + - what code configurations: Clm51Bgc + - what platforms/compilers: all - nature of change (roundoff; larger than roundoff/same climate; new climate): - not investigated; expected to be roundoff - - Answer changes were observed in these tests: - - SMS_D.f10_f10_musgs.I2000Clm50BgcCrop.izumi_gnu.clm-crop - - SMS_D.f10_f10_musgs.I2000Clm50BgcCrop.izumi_pgi.clm-crop - - SMS.f10_f10_musgs.I2000Clm50BgcCrop.izumi_pgi.clm-crop - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - + larger than roundoff; whether it is climate changing was not investigated Detailed list of changes ------------------------ -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): -- cime: branch_tags/cime5.8.23_a01 -> branch_tags/cime5.8.24_a01 - Point to a cime branch tag that is equivalent to cime5.8.24 but uses - pio1 rather than pio2, even for mpi-serial cases (the changes in - branch_tags/cime5.8.24_a01 relative to cime5.8.24 are equivalent to the - changes in branch_tags/cime5.8.23_a01 relative to cime5.8.23). +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none -Pull Requests that document the changes (include PR ids): none +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/CTSM/pull/1174 =============================================================== =============================================================== -Tag name: ctsm1.0.dev098 -Originator(s): John Truesdale,UCAR/AMP,303-497-1386 -Date: Thu May 28 14:39:27 MDT 2020 -One-line Summary: Bring in GFDL fv3 cubed sphere grids C24, C48, C96, C192, C384 +Tag name: ctsm5.1.dev005 +Originator(s): sacks (Bill Sacks) +Date: Fri Oct 2 09:51:08 MDT 2020 +One-line Summary: Answer changing bug fixes for clm51: fire and organic_frac_squared Purpose of changes ------------------ -Add support for new GFDL fv3 curbed sphere grids. Low resolution C24, and C48 -Moderate resolution C96, and high resolution C192 and C384. Add in mapping files -so all can be created. Make C96 a default resolution created with new surface -datasets. For all of these only the crop versions of surface and landuse.timeseries -are in place, as non-crop can run in CLM without needing different datasets. Also for -historical landuse.timeseries we use the SSP5-8.5 timeseries files, so that it can be -used for future, historical and beyond 2015 present day. - +A few bug fixes for CLM51: +- Initialize btran2 to 0 in CNFireLi2021Mod +- Remove multiplications by col%wtgcell in CNFireLi2021Mod +- Initialize nfire to 0 in CNFireLi2021Mod +- Fix organic_frac_squared default for clm5_1 Bugs fixed or introduced ------------------------ -Issues fixed (include CTSM Issue #): #1025 - Fixes #1025 -- By default only create crop version of surface/landuse.timeseries datasets +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/CTSM#1171 (btran2 not initialized to zero in + CNFireLi2021Mod.F90) +- Partially addresses ESCOMP/CTSM#1169 (CNFireLi2021Mod reintroduces a + number of bugs that were fixed in earlier versions) +- Partially addresses ESCOMP/CTSM#1166 (Possible problems with namelist + defaults starting in ctsm5.0.dev001) + Significant changes to scientifically-supported configurations -------------------------------------------------------------- @@ -1865,6 +1940,8 @@ 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.] +[X] clm5_1 + [ ] clm5_0 [ ] ctsm5_0-nwp @@ -1874,100 +1951,118 @@ Does this tag change answers significantly for any of the following physics conf Notes of particular relevance for users --------------------------------------- -Caveats for users (e.g., need to interpolate initial conditions): None +Caveats for users (e.g., need to interpolate initial conditions): none -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): None +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none -Changes made to namelist defaults (e.g., changed parameter values): None +Changes made to namelist defaults (e.g., changed parameter values): +- Fixes default for organic_frac_squared for clm5_1 -Changes to the datasets (e.g., parameter, surface or initial files): New surface and landuse.timeseries files +Changes to the datasets (e.g., parameter, surface or initial files): none -Substantial timing or memory changes: None +Substantial timing or memory changes: not investigated (none expected) Notes of particular relevance for developers: (including Code reviews and testing) --------------------------------------------- NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: Add C96 tests +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none -Code reviewed by: @ekluzek +Changes to tests or testing: none -CTSM testing: regular, tools +CTSM testing: [PASS means all tests PASS and OK means tests PASS other than expected fails.] build-namelist tests: - cheyenne - PASS (15 new tests for new resolutions) + cheyenne - not run tools-tests (test/tools): - cheyenne - OK + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run python testing (see instructions in python/README.md; document testing done): - (any machine) - PASS (cheyenne) + (any machine) - not run regular tests (aux_clm): - cheyenne ---- PASS - izumi ------- PASS + cheyenne ---- ok + izumi ------- ok -If the tag used for baseline comparisons was NOT the previous tag, note that here: previous + ok: tests pass, baselines fail just for CLM51 cases, as expected + + NOTE: The following expensive tests did not run, due to a long queue + wait time; we are about to remove these tests from the test suite + anyway: + + PEND ERS_D_Ld10.C96_C96_mg17.IHistClm50Sp.cheyenne_intel.clm-decStart RUN + PEND ERS_Ln9.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.IHistClm50SpGs.cheyenne_intel.clm-clm50cam6LndTuningMode_1979Start RUN + PEND SMS_Ln9.ne0ARCTICGRISne30x8_ne0ARCTICGRISne30x8_mt12.IHistClm50Sp.cheyenne_intel.clm-clm50cam6LndTuningMode_1979Start RUN + PEND SMS_Ln9.ne0ARCTICGRISne30x8_ne0ARCTICGRISne30x8_mt12.ISSP585Clm50BgcCrop.cheyenne_intel.clm-clm50cam6LndTuningMode RUN + PEND SMS_Ln9.ne0CONUSne30x8_ne0CONUSne30x8_mt12.IHistClm50Sp.cheyenne_intel.clm-clm50cam6LndTuningMode_2013Start RUN + +If the tag used for baseline comparisons was NOT the previous tag, note that here: Answer changes -------------- -Changes answers relative to baseline: No bit-for-bit +Changes answers relative to baseline: YES - just for CLM51 + + Summarize any changes to answers, i.e., + - what code configurations: CLM51 + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + possibly new climate Detailed list of changes ------------------------ -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None - -Pull Requests that document the changes (include PR ids): #891 -(https://github.com/ESCOMP/ctsm/pull) +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - #891 -- add definitions/defaults for GFDL fv3 cubed sphere grids C24, C48, C96, C192, C384 +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/CTSM/pull/1172 =============================================================== =============================================================== -Tag name: ctsm1.0.dev097 -Originator(s): ycheng (Yanyan Cheng); final changes & testing by Bill Sacks -Date: Mon May 25 15:14:56 MDT 2020 -One-line Summary: Add two bioenergy crops (switchgrass and miscanthus) +Tag name: ctsm5.1.dev004 +Originator(s): oleson (Keith Oleson), sacks (Bill Sacks) +Date: Wed Sep 30 10:45:25 MDT 2020 +One-line Summary: Improve robustness of onset and offset counters when changing dt Purpose of changes ------------------ -Main change is from Yanyan Cheng: adding parameters and code for two -bioenergy crops, switchgrass and miscanthus. Along with this, there is a -new potential flux from crop leaves and stems to the crop product pool -at harvest, representing biofuel products; a new pft-specific parameter -controls this flux (biofuel_harvfrac). Currently, the out-of-the-box -surface datasets do not specify any area for these crops, but the new -parameter file will allow them to be present if specified on the surface -dataset or landuse_timeseries file. Note that this is only an option for -CLM5.0, NOT for CLM4.5. (See https://github.com/ESCOMP/CTSM/pull/884 for -details.) +The logic in CNPhenology for onset_counter and offset_counter was not +robust when the model time step differed from the time step used to +generate the finidat file. This showed up when running with a 20-minute +time step using a finidat file that was generated with a 30-minute time +step. See https://github.com/ESCOMP/CTSM/issues/1163 for details. + +The fix here improves the situation significantly, but I believe still +leaves some issues remaining; see +https://github.com/ESCOMP/CTSM/issues/1167 for details. -Also, some minor fixes from Bill Sacks: See notes under "bugs fixed" -below. Bugs fixed or introduced ------------------------ Issues fixed (include CTSM Issue #): -- Resolves ESCOMP/CTSM#203 - Fixes creation of harvest-related variables - on surface datasets created with the all_veg option - smallville, - PTCLM, etc. (documented in https://github.com/ESCOMP/CTSM/pull/1019) -- Resolves ESCOMP/CTSM#930 - Makes gindex_ocn intent(inout) rather than - intent(out) -- Resolves ESCOMP/CTSM#1021 - Changes SSP test to only do symlink if - needed +- Resolves ESCOMP/CTSM#1163 (onset_counter variable on (all?) restart + files is not compatible with subsequent model runs using a 20 minute + time step) + +Known bugs introduced in this tag (include github issue ID): +- ESCOMP/CTSM#1167 (Rework CNPhenology onset and offset triggers to be + more robust to changes in dt) + - This issue was not exactly introduced in this tag, but it captures + some things that I think still need to be done for complete robustness Significant changes to scientifically-supported configurations -------------------------------------------------------------- @@ -1986,21 +2081,15 @@ Does this tag change answers significantly for any of the following physics conf Notes of particular relevance for users --------------------------------------- -Caveats for users (e.g., need to interpolate initial conditions): -- For transient crop cases, now more crops in memory. This creates a - need for interpolation of initial conditions for initial conditions - generated from a transient case. +Caveats for users (e.g., need to interpolate initial conditions): none Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none -Changes made to namelist defaults (e.g., changed parameter values): -- Changed parameter values for switchgrass and miscanthus (only for clm5.0) -- New pft-specific parameter, biofuel_harvfrac (for both clm4.5 and clm5.0) +Changes made to namelist defaults (e.g., changed parameter values): none -Changes to the datasets (e.g., parameter, surface or initial files): -- New parameter files with the above changes +Changes to the datasets (e.g., parameter, surface or initial files): none -Substantial timing or memory changes: none +Substantial timing or memory changes: not checked (none expected) Notes of particular relevance for developers: (including Code reviews and testing) --------------------------------------------- @@ -2008,13 +2097,7 @@ NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the Caveats for developers (e.g., code that is duplicated that requires double maintenance): none -Changes to tests or testing: -- Changed smallville ERS_Lm20 test to be cold start (see comment in - commit 8368f222 for details) -- Added a multi-year smallville test that includes these new crops - -Code reviewed by: Bill Sacks, Danica Lombardozzi - +Changes to tests or testing: none CTSM testing: @@ -2026,20 +2109,7 @@ CTSM testing: tools-tests (test/tools): - cheyenne - ok - - Pass except for expected baseline failures - - Ran on 633be0eb, with comparison against ctsm1.0.dev095; tests pass - except these expected baseline failures: - - 030 blf84 TBLscript_tools.sh PTCLM PTCLMmkdata PTCLM_USUMB_clm4_5^buildtools ....................\c - rc=7 FAIL - - 032 blfc4 TBLscript_tools.sh PTCLM PTCLMmkdata PTCLM_USUMB_Cycle_clm4_5^buildtools ..............\c - rc=7 FAIL - - Diffs for these are just in the harvest-related fields on the surface dataset, as expected. + cheyenne - not run PTCLM testing (tools/shared/PTCLM/test): @@ -2054,12 +2124,7 @@ CTSM testing: cheyenne ---- ok izumi ------- pass - For cheyenne testing: a few tests had baseline failures. The - differences just arise in the h1 (vector) files, due to differences - in dimension sizes. These differences are expected. See below for - details. - - Ran most testing on 8309c213. Reran two SSP tests on 4665c9ce + ok: tests pass, one test had answer changes as noted below If the tag used for baseline comparisons was NOT the previous tag, note that here: @@ -2067,51 +2132,21 @@ If the tag used for baseline comparisons was NOT the previous tag, note that her Answer changes -------------- -Changes answers relative to baseline: YES, but diagnostic only due to -change in dimension sizes - does not change answers in any meaningful -way - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): +Changes answers relative to baseline: YES, but in very limited circumstances Summarize any changes to answers, i.e., - - what code configurations: Transient CLM50 cases with crops; just - changes dimensions on vector (h1) history files - - what platforms/compilers: All + - what code configurations: Only when the model run uses a different + time step than the initial conditions file + - what platforms/compilers: all - nature of change (roundoff; larger than roundoff/same climate; new climate): - diagnostic change only - - Differences were observed in the following tests: - - ERS_Ly3_Mmpi-serial.1x1_smallvilleIA.IHistClm50BgcCropQianGs.cheyenne_gnu.clm-cropMonthOutput - SMS_Ld5.f10_f10_musgs.ISSP245Clm50BgcCrop.cheyenne_gnu.clm-ciso_dec2050Start - SMS_Ld5.f10_f10_musgs.ISSP370Clm50BgcCrop.cheyenne_gnu.clm-ciso_dec2050Start - ERP_D_Ld10_P36x2.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-ciso_decStart - ERP_D_Ld5.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-allActive - ERP_Ly3_P72x2.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-cropMonthOutput - ERS_D_Ld7_Mmpi-serial.1x1_smallvilleIA.IHistClm50BgcCropGs.cheyenne_intel.clm-decStart1851_noinitial - ERS_Ly3_P72x2.f10_f10_musgs.IHistClm50BgcCropG.cheyenne_intel.clm-cropMonthOutput - ERS_Ly5_P144x1.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-cropMonthOutput - ERS_Ly6_Mmpi-serial.1x1_smallvilleIA.IHistClm50BgcCropQianGs.cheyenne_intel.clm-cropMonthOutput - LCISO_Lm13.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-ciso_monthly - SMS_Ld5.f10_f10_musgs.ISSP585Clm50BgcCrop.cheyenne_intel.clm-ciso_dec2050Start - - The differences just arise in the h1 files, due to differences in - dimension sizes. I reran these tests with a paramfile where I - reverted the mergeToPft variable; then they were all bfb with - master. - - Other than this, there were FIELDLIST differences, as expected. + larger than roundoff; magnitude not investigated; in some cases, + the differences might be significant if the model actually + continues without aborting - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A + In the aux_clm test suite, this only appears in one test: + SMS_Ln9.ne30pg2_ne30pg2_mg17.I2000Clm50BgcCrop.cheyenne_intel.clm-clm50cam6LndTuningMode - URL for LMWG diagnostics output used to validate new climate: N/A - + but it might appear more widely in cam / fully coupled testing Detailed list of changes ------------------------ @@ -2119,30 +2154,42 @@ Detailed list of changes List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none Pull Requests that document the changes (include PR ids): -- https://github.com/ESCOMP/CTSM/pull/884 -- https://github.com/ESCOMP/CTSM/pull/1019 +https://github.com/ESCOMP/CTSM/pull/1165 =============================================================== =============================================================== -Tag name: ctsm1.0.dev096 -Originator(s): slevis (Samuel Levis,SLevis Consulting LLC,303-665-1310) -Date: Thu May 21 19:18:24 MDT 2020 -One-line Summary: Gridcell-level balance checks for carbon and nitrogen +Tag name: ctsm5.1.dev003 +Originator(s): ivanderkelen (Inne Vanderkelen) / sacks (Bill Sacks) +Date: Tue Sep 29 10:16:00 MDT 2020 +One-line Summary: Add capability for dynamic lakes Purpose of changes ------------------ - Bracket the model's time-step loop to calculate balance checks at the - gridcell level because there are terms in the carbon and nitrogen - cycles not accounted for at the column level. Balance checks at the - column level remain unchanged for now. +Adds the capability for dynamic lake areas, read from the +landuse_timeseries file. This represents reservoir construction. For +now, this capability is off by default. Turning it on requires new +fields on the landuse_timeseries file which cannot yet be produced by +mksurfdata_map; these new fields will be added in +https://github.com/ESCOMP/CTSM/pull/1073. +A substantial part of this tag involved changing the accounting of water +and energy in lakes in order to conserve water and energy across +landunit transitions while not producing too large adjustment +fluxes. This change results in roundoff-level answer changes for all +transient cases. + +The core changes in this tag are from Inne Vanderkelen, in consultation +with Bill Sacks. Additional changes are from Bill Sacks, in consultation +with Inne Vanderkelen. Bugs fixed or introduced ------------------------ -Issues fixed (include CTSM Issue #): #314 - +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/CTSM#200 (Count energy of water in lakes in total + gridcell heat content) +- Resolves ESCOMP/CTSM#1140 (Add lake water to dynbal baselines) Significant changes to scientifically-supported configurations -------------------------------------------------------------- @@ -2161,26 +2208,38 @@ Does this tag change answers significantly for any of the following physics conf Notes of particular relevance for users --------------------------------------- -Caveats for users (e.g., need to interpolate initial conditions): None +Caveats for users (e.g., need to interpolate initial conditions): +- Using the dynamic lakes functionality will require either the + mksurfdata_map changes in https://github.com/ESCOMP/CTSM/pull/1073 or + manually adding the necessary fields to the landuse_timeseries file. -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): None +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): +- New namelist variable for transient runs: do_transient_lakes -Changes made to namelist defaults (e.g., changed parameter values): None +Changes made to namelist defaults (e.g., changed parameter values): none -Changes to the datasets (e.g., parameter, surface or initial files): None +Changes to the datasets (e.g., parameter, surface or initial files): none -Substantial timing or memory changes: None +Substantial timing or memory changes: none Notes of particular relevance for developers: (including Code reviews and testing) --------------------------------------------- NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: None +Caveats for developers (e.g., code that is duplicated that requires double maintenance): +- Using the dynamic lakes functionality will require either the + mksurfdata_map changes in https://github.com/ESCOMP/CTSM/pull/1073 or + manually adding the necessary fields to the landuse_timeseries file. +- For this reason, the new test + (ERS_Lm25.1x1_smallvilleIA.IHistClm50BgcCropQianRsGs.cheyenne_gnu.clm-smallville_dynlakes_monthly) + requires a manual step to create the necessary landuse_timeseries + file. This step is documented in the README file for the + clm-smallville_dynlakes_monthly testmod. -Code reviewed by: - @billsacks +Changes to tests or testing: +- Added a single-point test covering dynamic lakes, using a + manually-created landuse_timeseries file: + ERS_Lm25.1x1_smallvilleIA.IHistClm50BgcCropQianRsGs.cheyenne_gnu.clm-smallville_dynlakes_monthly CTSM testing: @@ -2188,24 +2247,29 @@ CTSM testing: build-namelist tests: - cheyenne - + cheyenne - ok + + Tests pass, differences from baseline as expected due to new + namelist variable tools-tests (test/tools): - cheyenne - + cheyenne - not run PTCLM testing (tools/shared/PTCLM/test): - cheyenne - + cheyenne - not run python testing (see instructions in python/README.md; document testing done): - (any machine) - + (any machine) - not run regular tests (aux_clm): - cheyenne ---- OK - izumi ------- PASS + cheyenne ---- ok + izumi ------- ok + + Tests pass, baselines differ as expected If the tag used for baseline comparisons was NOT the previous tag, note that here: @@ -2213,40 +2277,81 @@ If the tag used for baseline comparisons was NOT the previous tag, note that her Answer changes -------------- -Changes answers relative to baseline: No +Changes answers relative to baseline: YES + + If a tag changes answers relative to baseline comparison the + following should be filled in (otherwise remove this section): + And always remove these three lines and parts that don't apply. + + Summarize any changes to answers, i.e., + - what code configurations: Transient cases + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + Mostly roundoff-level. See below for details. + + - Differences in HEAT_CONTENT1, ICE_CONTENT1, LIQUID_CONTENT1, as + expected + + - In transient tests (including Hist/SSP, Fates, CNDV and + transient glacier), roundoff-level diffs in EFLX_DYNBAL, + QFLX_ICE_DYNBAL and QFLX_LIQ_DYNBAL, along with related flux + terms, and river volume + + - In some transient tests, roundoff-level diffs in methane terms, + presumably from downstream effects of changes in VOLR due to + roundoff-level changes in fluxes. In multi-year tests, these + methane diffs grow to bigger than roundoff-level, but I think + they originate from roundoff-level diffs. (I feel like I've seen + this high sensitivity before.) + + - glcMEC_increase test + (ERP_P180x2_D_Ld5.f19_g17_gl4.I1850Clm50BgcCropG.cheyenne_intel.clm-glcMEC_increase) + shows significant differences in river-related terms, maybe due + to glacier running over lake and now lake has different states + than before; also, FILLDIFFs in h1 file because lake remains + active even when it goes to 0 area. + + If bitwise differences were observed, how did you show they were no worse + than roundoff? + - Examined cprnc RMS diffs + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + - casename: N/A + URL for LMWG diagnostics output used to validate new climate: N/A + Detailed list of changes ------------------------ -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none Pull Requests that document the changes (include PR ids): - https://github.com/ESCOMP/CTSM/pull/984 +https://github.com/ESCOMP/CTSM/pull/1109 +https://github.com/billsacks/ctsm/pull/3 =============================================================== =============================================================== -Tag name: ctsm1.0.dev095 -Originator(s): sacks (Bill Sacks) -Date: Thu May 21 10:25:16 MDT 2020 -One-line Summary: Update cime and cmeps externals; rework initialization of CNFire object +Tag name: ctsm5.1.dev002 +Originator(s): slevis (Samuel Levis,303-665-1310) +Date: Mon Sep 25 09:39:19 MDT 2020 +One-line Summary: Reduce duplication between caps Purpose of changes ------------------ -Main change is to update cime and cmeps externals. cime is now -essentially at the version used in cesm2_2_beta05 (but with one change -backed out); cmeps is at latest master. + Eliminate duplication of the "derived quantities for required fields" + and corresponding error checking codes that repeat across the mct, + nuopc, and lilac caps. This consolidates the code and reduces + maintenance requirements. -Also, reworks initialization of CNFire object to avoid occasional -segmentation faults. Bugs fixed or introduced ------------------------ -Issues fixed (include CTSM Issue #): -- Resolves ESCOMP/CTSM#1018 (Occasional seg faults when initializing - CNFire object) +Issues fixed (include CTSM Issue #): #918 + Significant changes to scientifically-supported configurations -------------------------------------------------------------- @@ -2256,37 +2361,34 @@ 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_0 +[X] clm5_0 -[ ] ctsm5_0-nwp +[X] ctsm5_0-nwp -[ ] clm4_5 +[X] clm4_5 Notes of particular relevance for users --------------------------------------- -Caveats for users (e.g., need to interpolate initial conditions): none +Caveats for users (e.g., need to interpolate initial conditions): None -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): None -Changes made to namelist defaults (e.g., changed parameter values): none +Changes made to namelist defaults (e.g., changed parameter values): None -Changes to the datasets (e.g., parameter, surface or initial files): none +Changes to the datasets (e.g., parameter, surface or initial files): None -Substantial timing or memory changes: none -- Note: Because of a change in cime, datm now uses netcdf rather than - pnetcdf, but it doesn't seem that that impacts performance - significantly +Substantial timing or memory changes: [For timing changes, can check PFS test(s) in the test suite] None Notes of particular relevance for developers: (including Code reviews and testing) --------------------------------------------- NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none +Caveats for developers (e.g., code that is duplicated that requires double maintenance): None -Changes to tests or testing: none +Changes to tests or testing: None -Code reviewed by: self +Code reviewed by: @billsacks @slevisconsulting CTSM testing: @@ -2295,26 +2397,24 @@ CTSM testing: build-namelist tests: - cheyenne - not run + cheyenne - tools-tests (test/tools): - cheyenne - not run + cheyenne - PTCLM testing (tools/shared/PTCLM/test): - cheyenne - not run + cheyenne - python testing (see instructions in python/README.md; document testing done): - (any machine) - not run + (any machine) - regular tests (aux_clm): - cheyenne ---- ok - izumi ------- pass - - cheyenne tests pass; some answer changes as expected (as noted below) + cheyenne ---- OK + izumi ------- PASS If the tag used for baseline comparisons was NOT the previous tag, note that here: @@ -2322,381 +2422,72 @@ If the tag used for baseline comparisons was NOT the previous tag, note that her Answer changes -------------- -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): +Changes answers relative to baseline: Yes (Similar climate) Summarize any changes to answers, i.e., - - what code configurations: - - cheyenne_gnu - due to compiler version update - - nuopc - presumably due to the major cmeps update - - what platforms/compilers: see above - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - Not investigated - - I have verified that gnu tests in 59d1dd4a are identical to those - in dcaad375 - i.e., the rework of the initialization logic for fire - didn't change answers - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A + - what code configurations: All + - what platforms/compilers: All + - nature of change: Larger than roundoff/same climate - URL for LMWG diagnostics output used to validate new climate: N/A - Detailed list of changes ------------------------ -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): -- cime: cime5.8.19 -> branch_tags/cime5.8.23_a01 - (same as cime5.8.23, but reverts to using pio1 for mpi-serial cases, - since some mpi-serial cases failed with pio2) -- cmeps - -Pull Requests that document the changes (include PR ids): none - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev094 -Originator(s): sacks (Bill Sacks) -Date: Fri May 15 13:41:01 MDT 2020 -One-line Summary: Minor bug fixes needed for latest cime - -Purpose of changes ------------------- - -(1) Refactor a conditional to avoid divide by 0 (ESCOMP/CTSM#1013) - -(2) Remove some FATES coordinate variables that were writing garbage - (temporary workaround for ESCOMP/CTSM#1014) - -(3) Minor update to manage_externals - -(4) Document authorship in README.md and .zenodo.json - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Resolves ESCOMP/CTSM#1013 -- Workaround for ESCOMP/CTSM#1014, but doesn't properly resolve that issue - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: not checked; none expected - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: self - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- pass - izumi ------- pass - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - + Changes were implemented in three steps: -Answer changes --------------- + 1) Bit-for-bit: @billsacks simplified subroutine QSat by making three + arguments optional (es, qsdT, esdT). -Changes answers relative to baseline: NO + 2) Answer-changing: @slevisconsulting replaced local calculations of + qsat in /src/cpl/mct, /src/cpl/lilac, and /src/cpl/nuopc with calls to + CTSM's subroutine QSat. Subroutine QSat uses a higher-order polynomial + approximation to estimate qsat, which explains the larger than + round-off diffs. When moving the three identical local approximations + to QSat as a temporary test instead of using the higher-order + polynomial approximation, the diffs reduce to round-off. -Detailed list of changes ------------------------- + 3) Bit-for-bit: @slevisconsulting consolidated repeating codes in + /src/cpl/mct, /src/cpl/lilac, and /src/cpl/nuopc by placing in the new + file /src/utils/lnd_import_export_utils.F90. -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): Pull Requests that document the changes (include PR ids): -- https://github.com/ESCOMP/ctsm/pull/1006 - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev093 -Originator(s): erik (Erik Kluzek) -Date: Fri May 1 22:27:16 MDT 2020 -One-line Summary: Bring in changes from release-clm5.0 branch to master - -Purpose of changes ------------------- - -Move changes from release-clm5.0.12.13/14/16/17/18/20/21/22/23/24/25/26/27/28/29/30 to master -(note excludes release-clm5.0.15, release-clm5.0.19) - -Answer changing! -Updates FATES with PARTEH option. - -Remove CRUNCEP half degree, ne120np4, f05 surface datasets -Landuse-timeseries files for just: f09, f19, f10, ne30np4, 1x1_numaIA, 1x1_smallvilleIA, 1x1_brazil -Add datasets needed for SSP scenarios (only Tier I for ndep). Add ZWT_inversion dataset for methane. - -Add new ability to use prescribed soil moisture data (from streams files based on an earlier CTSM simulation). - -Add new MODISv2 mapping files for mksurfdata_map. Remove T5 and T21 mapping files. Add conus_30_x8 mapping files, -and T62 mapping files - -Add contrib directory to tools with contributed tools and scripts. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): 31 issues.... - #873 -- Release clm5.0.12 changes - #871 -- don't check for valid resolution for CESM cases by default - #836 -- add izumi as a place that can run tools tests - #831 -- add namelist tint_algo settings for input streams - #817 -- Have clm4_5 use the same ndep file as clm5_0 for 1850 - #809 -- mkmapdata using an old version of intel - #804 -- mksurfdata option - #791 -- fix threading for prescribed LAI and soil-moisture - #786 -- allow use_init_interp for a branch - #746 -- Some CLM45 configurations use CLM50 initial conditions files - #741 -- C13_HR, C13_NBP, FPI values result in numeric conversion not representable error (changes answers) - #734 -- Isotope historical files off of NetCDF-4 - #716 -- 2 degree CMIP6WACCMDECK needs Carbon isotopes off - #707 -- Missing mapping files for hirespft - #673 -- Ice shelf wetland fix in mksurfdata_map can lead to glacier+lake > 100% on surface datasets (changes surface dataset creation) - #653 -- To save disk on fsurdat files use zwt0 on finindated file - #629 -- Remove unused fields from surface datasets - #624 -- QSNOEVAP history output incorrect - #621 -- Fully remove rcp in place of only ssp_rcp - #608 -- Odd (blocky) spatial patterns in generic crop leafc for BGC simulation when initialized from BGC-Crop (changes answers) - #589 -- Existence of content in the lai_streams namelist makes it confusing to users - #557 -- no-anthro compset and options - #553 -- More robust mksurfdata_map logic for determining where to put wetlands - #547 -- Add conus_30_x8 grid as valid option for CTSM and mksurfdata_map - #545 -- Antarctica ice shelves are being treated as wetlands rather than glaciers - #544 -- Transient cases are matching wrong IC file - #533 -- Add -no-anthro option to mksurfdata - #276 -- Tests for pre_alpha/pre_beta - #262 -- hirespft option to mksurfdata.pl - #175 -- Set stream_year_first_urbantv/last for CLM4.5 - #150 -- mksurfdata code cleanup - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): New surface datasets do mean initial conditions - will need to be interpolated - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): Add 2010 compset option - New namelist items: ndep_tintalgo, lai_tintalgo, lightng_tintalgo, urbantv_tintalgo, dribble_crophrv_xsmrpool_2atm - New soil moisture namelist items: use_soil_moisture_streams, stream_year_first_soilm, stream_year_last_soilm, model_year_align_soilm, - model_year_align_soilm, soilm_tintalgo, soilm_offset, soilm_ignore_data_if_missing - New namelist items for FATES: fates_parteh_mode - New 2010, no-anthro, SSP use cases - New compsets: I2010Clm50Sp, I2000Clm50BgcCropQianGs, I1850Clm50BgcNoAnthro, I1850Clm50SpNoAnthro, IHistClm50SpCru, IHistClm50SpCru, - IHistClm45SpGs, IHistClm45SpGs - New SSP compsets: ISSP585Clm50BgcCrop, ISSP126Clm50BgcCrop, ISSP126Clm50BgcCrop, ISSP245Clm50BgcCrop, ISSP370Clm50BgcCrop, - ISSP434Clm50BgcCrop, ISSP460Clm50BgcCrop, ISSP460Clm50BgcCrop - LAI streams options don't show up in the namelist unless you ask for them - finundation comes from streams files, no longer from the surface dataset - FATES adds a list of new history variables and dimension types - -Changes made to namelist defaults (e.g., changed parameter values): New fsurdat files, SSP C13/C14 files - Add PtVg surface dataset - most finidat files now need to be interpolated, a few added in to get testing to work - New ndep datasets - -Changes to the datasets (e.g., parameter, surface or initial files): - New fsurdat files, finidat files need to be interpolated from now - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - Threshold to reseed dead vegetation increased from zero to 1.0 as a hard coded parameter. - Reseeding also happens for generic crop types and not just natural vegetation now. - The ability to read in 3D streams was added (input files have to be at the same resolution as the model) - -Changes to tests or testing: - Add no-anthro, 2010, f19 waccm and SSP tests - Make sure prealpha/prebeta tests are also run by aux_clm - Add prescribed soil moisture test - Lengthen waccm_offline test - Remove hcru_hcru and edison tests - Add some aux_cime_baseline tests - -Code reviewed by: self - - -CTSM testing: regular, tools - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS (345 are different than baseline) - - tools-tests (test/tools): - - cheyenne - OK - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - OK - - python testing (see instructions in python/README.md; document testing done): - - cheyennne -- PASS (when ncar_pylib run) - - regular tests (aux_clm): - - cheyenne ---- OK - izumi ------- OK - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: Yes - - Updates in all fsurdat files leads to changes in answers - Also there are updated finidat files as they had to be interpolated - to work with the new fsurdat files - Reseeding change can effect answers on startup if activated - Extra call to SoilBiogeochemPrecisionControl can cause a small answer change - - Summarize any changes to answers, i.e., - - what code configurations: all global - - what platforms/compilers: all - - nature of change: Main change is around Antarctica - - CMIP6 simulations and release branch simulations were run with these surface datasets - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): fates, PTCLM - - fates to sci.1.30.0_api.8.0.0 - PTCLM to PTCLM2_20200121 - - FATES now points to the NGEET repository rather than the NCAR fates-release - -Pull Requests that document the changes (include PR ids): #998, #883, #849, #567, #564, #561 -(https://github.com/ESCOMP/ctsm/pull) - #998 -- Remove Copyright file - #883 -- Bring changes on release-clm5.0 branch to master PR status: ready priority: high type: enhancement - #849 -- Fix link to new forums - #567 -- Ignore patterns for vim - #564 -- Update mksurfdata_map to include glaciers outside of pft landmask - #561 -- Add list of checks that should be done when making new surface datasets - + https://github.com/ESCOMP/CTSM/pull/1086 + https://github.com/ESCOMP/CTSM/pull/1094 =============================================================== =============================================================== -Tag name: ctsm1.0.dev092 +Tag name: ctsm5.1.dev001 Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Mon Apr 27 14:51:21 MDT 2020 -One-line Summary: Update cime to version in cesm2_2_beta04 +Date: Wed Sep 23 02:29:08 MDT 2020 +One-line Summary: Start the clm5_1 physics series, with some changes to the fire model from Fang Li Purpose of changes ------------------ -Update cime to latest in cesm2.2 beta tag (cesm2_2_beta04) -Fix two small issues that had gone on the release-clm5.0 branch. -Update manage_externals (to manic-v1.1.8) +Fang Li's latest Fire version - includes allowing clm5.1 phys version. New physics option is added +called "clm5_1", with currently the new feature to use the latest fire changes. This has some +adjustments to the fire model and includes some changes to the parameter file. Other new features +will be added into clm5_1 in future tags. -NOTE: Part of the reason for updating cime, was because of some problems -Mike Mills was having on cheyenne with inputdata files being deleted out -from under him before setting up his cases. We think system issues were -interacting with issues with cime putting in place zero length -missing files for the version of cime he was using. Those issues went -away with a cime update, so we hope updating to a newer cime version here -will help prevent those issues for CTSM users. +Also bring in mksurfdata changes for the raw urban dataset change. This adds some changes to +mksurfdata for a new urban raw dataset, as well as preparation for new changes for some other +urban changes that will be a future part of clm5_1. Also use the half degree lightning dataset +by default for clm5_1. -cime updates: +Start adding a new test list ctsm_sci that tests all the scientifically supported compsets. +Some of those tests fail due to existing issues, that will be fixed later. -some cleanup from the last maint-5.6 update -Add ne5np4.pg4 grid. -case.setup: Add --keep option -Add omip as option to DATM_CO2_TSERIES +Some more work done to change clm to ctsm, and allow for ctsm as a component. Bugs fixed or introduced ------------------------ -Issues fixed (include CTSM Issue #): #974 #966 - Fixes #974 -- python 3 problem in ssp test - Fixes #966 -- a few history fields need to be made CF compliant -CIME Issues fixed (include issue #): 3459 3466 - 3459 -- case.setup refuses to fix corrupted env_mach_specfic.xml - 3466 -- fix for aquap +Issues fixed (include CTSM Issue #): + Fix #1142 -- Add ctsm_sci test list + Fix #1145 -- File was corrupted on glade + Fix #1144 -- Move btran2 to just inside of fire model + Fix #889 --- Some adjustments to the Li Fire model Significant changes to scientifically-supported configurations -------------------------------------------------------------- @@ -2717,12 +2508,16 @@ Notes of particular relevance for users Caveats for users (e.g., need to interpolate initial conditions): None -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): - ./case.setup now has a --keep option +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): Adds clm5_1 option to CLM_PHYSICS_VERSION + clm5_1_GSWP3v1 is the only LND_TUNING_MDOE option for clm5_1 + New compsets added for CLM51 I2000Clm51BgcCropGs, I2000Clm51BgcGs, I1850Clm51BgcGs, IHistClm51BgcGs, IHistClm51BgcCropGs + -Changes made to namelist defaults (e.g., changed parameter values): None +Changes made to namelist defaults (e.g., changed parameter values): clm5_1 physics options added in + Add the ability to set the component name in filenames (default is still clm2, but can be clm4, olr clm5) + By default lightning dataset for clm5_1 is the half degree file -Changes to the datasets (e.g., parameter, surface or initial files): None +Changes to the datasets (e.g., parameter, surface or initial files): All params files updated with new fields for fire Substantial timing or memory changes: None @@ -2730,12634 +2525,54 @@ Notes of particular relevance for developers: (including Code reviews and testin --------------------------------------------- NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None +Caveats for developers (e.g., code that is duplicated that requires double maintenance): -Changes to tests or testing: None +Changes to tests or testing: Add ctsm_sci test list and move some clm5_0 to clm5_1 and one one clm5_1 specific test Code reviewed by: self -CTSM testing: regular +CTSM testing: regular, tools [PASS means all tests PASS and OK means tests PASS other than expected fails.] build-namelist tests: - cheyenne - PASS + cheyenne - PASS (853 tests are different) tools-tests (test/tools): - cheyenne - OK - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - OK + cheyenne - PASS python testing (see instructions in python/README.md; document testing done): - (any machine) - + cheyenne -- PASS regular tests (aux_clm): cheyenne ---- OK - izumi ------- OK + izumi ------- PASS -If the tag used for baseline comparisons was NOT the previous tag, note that here: previous +If the tag used for baseline comparisons was NOT the previous tag, note that here: Answer changes -------------- -Changes answers relative to baseline: None bit-for-bit +Changes answers relative to baseline: No (although clm5_1 is a new physics option that is different) Detailed list of changes ------------------------ -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cime - cime to cime5.8.19 - (NOTE: CMEPS is pointing to a newer hash than used in the beta tag) +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None Pull Requests that document the changes (include PR ids): (https://github.com/ESCOMP/ctsm/pull) - #996 -- Update cime to latest cesm2.2 beta tag + #1151 -- Move btran2 to inside CNFireBase + #1150 -- ctsm5.1 starting point + #1157 -- Urban mksurfdata_map changes + #1149 -- LILACSMOKE test change + #1146 -- Add --project to LILACS create_newcase =============================================================== =============================================================== -Tag name: ctsm1.0.dev091 -Originator(s): sacks (Bill Sacks) -Date: Fri Apr 24 07:43:46 MDT 2020 -One-line Summary: Increase tolerance on near-zero truncation for a snow state update - -Purpose of changes ------------------- - -In UpdateState_TopLayerFluxes, the tolerance of 1.e-13 was occasionally -exceeded. Although I haven't done a careful analysis, it seems okay to -me to increase this tolerance slightly. Here I increase it to 1.e-12. - -Previously, if top-layer h2osoi_ice or h2osoi_liq were reduced to less -than 1e-13 times the original value (in an absolute value sense), these -masses were set to 0; now we set these masses to 0 if they are reduced -to less than 1e-12 times the original. So we can now occasionally set a -value to exactly 0 when before it was left at slightly different from -zero. If the previous code led to a small positive value, between 1e-13 -and 1e-12 times the original, this tag will change answers slightly. If -the previous code led to a small negative number, it would cause the -model to abort, leading to the issue reported in ESCOMP/CTSM#988; this -change should fix those occasional aborts. - -This tag also introduces the general ability to set tolerances to a -custom value in calls to truncate_small_values. - -See ESCOMP/CTSM#988 for details. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Resolves ESCOMP/CTSM#988 - - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none expected (not checked) - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: Erik Kluzek - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- pass - izumi ------- pass - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: YES, in theory (but none in test suite) - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: potentially all, but very rarely - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Roundoff - - Potentially changes answers by roundoff (see notes above), but no - changes were observed in any test in the test suite - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -https://github.com/ESCOMP/CTSM/pull/989 - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev090 -Originator(s): negins (Negin Sobhani,UCAR/CSEG,303-497-1224) -Date: Thu Apr 23 09:21:18 MDT 2020 -One-line Summary: Refactoring banded diagonal matrix and solve system in SoilTemperature module - -Purpose of changes ------------------- - -Previously, the SoilTemperature module has a high level of nested subroutine -calls, which hurt its performance and readability. There were many -redundancies, logical issues, and nested conditionals in the modular code -as discussed in issue #323. In this PR, SoilTemperature module is optimized -and rewritten for better readability and performance while maintaining bfb -compatibility. - - -This PR addresses issue ESCOMP/ctsm#323 - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): - -ESCOMP/ctsm#323 - -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.) - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: The revised code improved the -performance of the previous code by ~1.5-2x. - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: Bill Sacks - - -CTSM testing: - - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- OK - izumi ------- PASS - -Externals used for the testing: - [cism] - tag = cism2_1_68 - [rtm] - tag = rtm1_0_70 - [mosart] - tag = mosart1_0_35 - [cime] - tag = branch_tags/cime5.8.15_a01 - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: NO - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/CTSM/pull/979) - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev089 -Originator(s): sacks (Bill Sacks) -Date: Tue Apr 7 12:01:59 MDT 2020 -One-line Summary: Bring documentation source to master - -Purpose of changes ------------------- - -1. Bring documentation source to master: Pulls in the source from - https://github.com/escomp/ctsm-docs. This is important so that - documentation can remain in sync with changes in the model - code. Images are stored here using git-lfs (Git Large File - Storage). I also made some minor fixes to get the pdf build of the - tech note working. - -2. Use a different documentation theme that supports a version dropdown - menu, and add the code needed to support this versioning on the - documentation web pages. At a high level, the way the versioned - documentation works is to have separate subdirectories in the - gh-pages branch of the ctsm-docs repository for each version of the - documentation we want to support. There is then a bit of JavaScript - code which uses a json file in the gh-pages branch to determine which - versions exist and how these should be named in the dropdown - menu. Most of these changes were borrowed from ESMCI/cime#3439, which - in turn borrowed from ESCOMP/CISM-wrapper#23, which in turn was a - slight modification of an implementation provided by @mnlevy1981 for - the MARBL documentation, which in turn borrowed from an - implementation put together by Unidata (credit where credit is due). - - I am not aware of out-of-the-box support for a version pull-down in - out-of-the-box sphinx themes (though the last time I looked was in - Fall, 2018, so there may be something available now). However, - support for a version dropdown exists in an open PR in the sphinx - readthedocs theme repository: readthedocs/sphinx_rtd_theme#438. I - have pushed this branch to a new repository in ESMCI - (https://github.com/ESMCI/sphinx_rtd_theme) to facilitate long-term - maintenance of this branch in case it disappears from the official - sphinx_rtd_theme repository. I have also cherry-picked a commit onto - that branch, which is needed to fix search functionality in sphinx1.8 - (from readthedocs/sphinx_rtd_theme#672) (which is another reason for - maintaining our own copy of this branch). The branch in this - repository is now named version-dropdown-with-fixes (branching off of - the version-dropdown branch in the sphinx_rtd_theme repository). In - the long-term, I am a little concerned about using this theme that - isn't showing any signs of being merged to the main branch of the - readthedocs theme, but this has been working for us in other projects - for the last 2 years, so I feel this is a reasonable approach in the - short-medium term. - -The new process for building the documentation is given here: -https://github.com/ESCOMP/CTSM/wiki/Directions-for-editing-CLM-documentation-on-github-and-sphinx - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Resolves ESCOMP/ctsm#239 (Move documentation source to master) - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: Erik Kluzek - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- not run! - izumi ------- not run! - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: NO - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -https://github.com/ESCOMP/CTSM/pull/954 - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev088 -Originator(s): sacks (Bill Sacks) -Date: Tue Apr 7 10:43:03 MDT 2020 -One-line Summary: Fix bug in snow aerosol numerics (causes occasional HUGE aerosol values) - -Purpose of changes ------------------- - -Multiplications / divisions by dtime were missing in a few places, in -some code that ensures that aerosol mass fluxes between the snow layers -don't exceed the total mass. This bug was introduced in ctsm1.0.dev065, -when a term was changed from a mass to a flux (per unit time), but some -of the code wasn't changed correspondingly. - -In one case this bug caused a crash, but in other cases it just causes -incorrect answers. The issue can be seen by examining the history -variables SNOBCMCL, SNOOCMCL and SNODSTMCL. In the case that led to the -crash, SNOBCMCL and SNOOCMCL became huge in one grid cell (~ 10^12) for -a long period before the crash. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Resolves ESCOMP/ctsm#965 (Bug in snow aerosol numerics can cause - aerosol masses to blow up, starting with ctsm1.0.dev065) - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none (not checked, but none expected) - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: Erik Kluzek, Keith Oleson - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- ok - izumi ------- pass - - ok means tests pass, some answer changes as expected - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: all - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - larger than roundoff/same climate - - Answer changes arise due to a bug fix for a condition that only - appears infrequently. When it does appear, answer changes can - potentially be enormous (e.g., snow aerosol concentrations 20 - orders of magnitude too large), though answer changes observed in - the test suite all appear relatively small. - - Answer changes just appeared for the following tests: - - FAIL ERP_D_P36x2_Ld3.f10_f10_musgs.I2000Clm45BgcCrop.cheyenne_gnu.clm-no_subgrid_fluxes BASELINE ctsm1.0.dev087: DIFF - FAIL SMS_Ld1.nldas2_rnldas2_mnldas2.I2000Ctsm50NwpSpNldasGs.cheyenne_gnu.clm-default BASELINE ctsm1.0.dev087: DIFF - FAIL SMS_Ld1.nldas2_rnldas2_mnldas2.I2000Ctsm50NwpSpNldasRsGs.cheyenne_gnu.clm-default BASELINE ctsm1.0.dev087: DIFF - FAIL ERI_D_Ld9.ne30_g16.I2000Clm50BgcCruGs.cheyenne_intel.clm-vrtlay BASELINE ctsm1.0.dev087: DIFF - FAIL ERI_D_Ld9.T31_g37.I2000Clm50Sp.cheyenne_intel.clm-SNICARFRC BASELINE ctsm1.0.dev087: DIFF - FAIL ERI_Ld9.f45_g37.I2000Clm50BgcCruGs.cheyenne_intel.clm-nofire BASELINE ctsm1.0.dev087: DIFF - FAIL ERI_N2_Ld9.f19_g17.I2000Clm50BgcCrop.cheyenne_intel.clm-default BASELINE ctsm1.0.dev087: DIFF - FAIL SMS_D_Lm6.f45_f45_mg37.I2000Clm50Fates.cheyenne_intel.clm-FatesColdDef BASELINE ctsm1.0.dev087: DIFF - FAIL SMS_D_Lm6_P144x1.f45_f45_mg37.I2000Clm50Fates.cheyenne_intel.clm-FatesColdDef BASELINE ctsm1.0.dev087: DIFF - FAIL SMS_Lm13.f19_g17.I2000Clm50BgcCrop.cheyenne_intel.clm-cropMonthOutput BASELINE ctsm1.0.dev087: DIFF - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -https://github.com/ESCOMP/CTSM/pull/971 - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev087 -Originator(s): sacks (Bill Sacks) -Date: Mon Apr 6 11:23:51 MDT 2020 -One-line Summary: Change hard-coded soil layers in phenology to use a target depth - -Purpose of changes ------------------- - -Adds infrastructure for finding the soil layer containing a given depth -(covered by unit tests). - -In phenology code, replaces hard-coded level 3 with a target soil -depth. This value is read from the parameter file. The default value is -set in a way that is bit-for-bit for standard CLM45 and CLM50 -configurations, but this will change answers for non-SP configurations -using the NWP soil layer structure or non-standard soil layer -structures. - -This is important for the sake of supporting flexible soil layers, as in -the NWP configuration. - -Also, some cleanup of the CNPhenology parameter reading code. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Resolves ESCOMP/ctsm#952 (Change hard coded soil layers in phenology - to use a target depth) - - -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.] - -[ ] clm5_0 - -[X] ctsm5_0-nwp -- only for non-SP cases - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): -- New parameter added to NetCDF parameter file: phenology_soil_depth - -Substantial timing or memory changes: none expected (not checked) - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: Erik Kluzek - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- ok - izumi ------- pass - - ok means tests pass, a few answer changes as expected - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: Non-SP cases with NWP or non-standard - soil layer structures - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - larger than roundoff; same vs. new climate not investigated - - Differences in non-SP cases with soil layer structure different - from that of standard clm45 or clm50. Differences observed in - tests - ERS_D_Ld3.f10_f10_musgs.I2000Clm50BgcCruGs.cheyenne_intel.clm-deepsoil_bedrock - and - SOILSTRUCTUD_Ld5.f10_f10_musgs.I2000Clm50BgcCropGs.cheyenne_intel.clm-default. - - ERP_P36x2_D_Ld5.f10_f10_musgs.I2000Ctsm50NwpBgcCropGswpGs.cheyenne_intel.clm-default - had no differences; I'm guessing this is just because there didn't - happen to be the appropriate PFTs present to show differences in - this short, coarse-resolution test. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -https://github.com/ESCOMP/CTSM/pull/963 - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev086 -Originator(s): mvertens (Mariana Vertenstein) -Date: Thu Mar 19 16:03:26 MDT 2020 -One-line Summary: Updates to NUOPC cap and minor fixes to ncdio_pio - -Purpose of changes ------------------- - -This tag has updates to the NUOPC cap that are needed for the latest -version of CMEPS. - -Now each component NUOPC cap needs to compute possibly time varying -orbital parameters. Before, in cpl7, this was done in the driver and -passed to the components via seq_infodata. However, now the driver is -really just a simple ascii file - so those calculations needed to -migrate to the component caps. - -In addition, this tag contains changes to ncdio_pio.F90 that improve -performance in some situations. - -This also updates MOSART and RTM tags to include fixes for the NUOPC cap -for MOSART and implementation of an initial NUOPC cap for RTM. - -Also, I1Pt compsets now use SROF rather than using an active runoff -model in 'null' mode. This leads to differences in namelists, but not in -results. - -Mariana Vertenstein implemented most of the changes in this tag; Jim -Edwards implemented the ncdio_pio changes; Bill Sacks did final testing -and integration. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Resolves ESCOMP/ctsm#943 (NUOPC tests will fail in ctsm1.0.dev085) - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: -- I1Pt tests and cases now use SROF rather than an active runoff model - with a null grid (only impacts namelists, not results) -- Changed nuopc test to use MOSART rather than SROF -- Changed finidat file used by LII test to solve a problem that was - uncovered with the ncdio_pio changes in this tag - -Code reviewed by: Bill Sacks - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- pass - izumi ------- pass - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: YES (just for NUOPC configurations) - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: Just some NUOPC configurations - - what platforms/compilers: - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Not investigated carefully, but likely to be larger than roundoff - / same climate (due to introduction of time-varying orbital parameters) - - Differences are expected in NUOPC configurations using time-varying - orbital parameters. Note that no differences showed up in the test - suite, however, because the only nuopc test in the test suite is - new in this tag (so did not have baselines). - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): -- mosart: mosart1_0_35 -> mosart1_0_36 -- rtm: rtm1_0_70 -> rtm1_0_71 -- cmeps - -Pull Requests that document the changes (include PR ids): -https://github.com/ESCOMP/CTSM/issues/943 - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev085 -Originator(s): sacks (Bill Sacks) -Date: Mon Mar 16 09:19:57 MDT 2020 -One-line Summary: Update cime - -Purpose of changes ------------------- - -Update to latest version of cime master - -Bugs fixed or introduced ------------------------- - -Known bugs introduced in this tag (include github issue ID): -- https://github.com/ESCOMP/CTSM/issues/943 - NUOPC tests will fail in ctsm1.0.dev085 - - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): -- NUOPC cases will fail from a standalone checkout - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: self - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- ok - izumi ------- pass - - Two test failures: - - PEND SMS_D_Vnuopc.f10_f10_musgs.I2000Clm50SpRsGs.cheyenne_intel.clm-default SHAREDLIB_BUILD - I have added this to the expected fails list for now - FAIL SMS_P720x1_Ln6.hcru_hcru.I2000Clm50BgcCruGs.cheyenne_intel.clm-coldStart BASELINE ctsm1.0.dev084: ERROR BFAIL baseline directory '/glade/p/cgd/tss/ctsm_baselines/ctsm1.0.dev084/SMS_P720x1_Ln6.hcru_hcru.I2000Clm50BgcCruGs.cheyenne_intel.clm-coldStart' does not exist - This test was added in the previous tag, but apparently wasn't run from there - - Note: I did testing using cime hash - 4f1880756a66ff12d304937d3c166d451ea50cf9, then updated to the tag - (cime5.8.17). The two are identical except for the cime ChangeLog. - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: NO - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): -cime: branch_tags/cime5.8.15_a01 -> cime5.8.17 - -Pull Requests that document the changes (include PR ids): none - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev084 -Originator(s): negins (Negin Sobhani,UCAR/CSEG,303-497-1224) -Date: Wed Feb 19 15:05:03 MST 2020 -One-line Summary: Bounds assertion for C isotopes when threading is on - -Purpose of changes ------------------- - -Previously, the bounds of c13 and c14 in subroutines TruncateCStates and -TruncateCandNStates were not checked when threading was on. This PR allows us -to handle c13 and c14 arrays like everything else in CTSM including (bounds -checking). - -This PR resolves issue ESCOMP/ctsm#811 - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): - -ESCOMP/ctsm#811 - -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.) - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: - - There was an issue (wrong wallclock time ) for one of the tests in the test - definitions which got fixed: (SMS_D_Vnuopc.f10_f10_musgs.I2000Clm50SpRsGs..) - - Also, I tried making the wallclocktime for all tests in - cime_config/testdefs/testlist_clm.xml consistent in the format of hh:mm:ss. - -Code reviewed by: Bill Sacks - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- OK - izumi ------- PASS - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: NO - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/CTSM/pull/923) - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev083 -Originator(s): negins (Negin Sobhani,UCAR/CSEG,303-497-1224) -Date: Thu Feb 6 12:12:26 MST 2020 -One-line Summary: Some BFB Fixes: Resolve issues #683, # 874, #878, # 885, # 745, #838 - -Purpose of changes ------------------- - -Resolved issues: - -ESCOMP/ctsm#683 : Writing out FATES parameters only on masterproc. -ESCOMP/ctsm#874 : Changing the number of timesteps to run for - SMS_P720x1_Ln3.hcru_hcru.I2000Clm50BgcCruGs.cheyenne_intel.clm-coldStar - to prevent failing with CMEPS. -ESCOMP/ctsm#878 : Removing the unused atm2lnd field. -ESCOMP/ctsm#885 : Changing the defaults for br_root in namelist_defaults to - enable FUN with CLM4.5. -ESCOMP/ctsm#745 : Removing ReadNL private subroutine from initVerticalMod.F90. -ESCOMP/ctsm#838 : Clarifying ZISNO in the variable long name. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -Resolves : - - ESCOMP/ctsm#683 - - ESCOMP/ctsm#874 - - ESCOMP/ctsm#878 - - ESCOMP/ctsm#885 - - ESCOMP/ctsm#745 - - ESCOMP/ctsm#838 - - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): - Not any changes in parameter values. - changing the default for br_root in namelist_defaults to enable FUN with - CLM4.5. - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: - Changed the number of timesteps from Ln3 to Ln6 for - SMS_P720x1_Ln3.hcru_hcru.I2000Clm50BgcCruGs.cheyenne_intel.clm-coldStar - -Code reviewed by: Bill Sacks - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- OK - izumi ------- PASS - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: NO - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -https://github.com/ESCOMP/CTSM/pull/897 - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev082 -Originator(s): oleson (Keith Oleson) -Date: Sat Feb 1 09:28:41 MST 2020 -One-line Summary: Rename variables to avoid confusion; fix QSNOEVAP diagnostic - -Purpose of changes ------------------- - -Renamed variables as discussed in ESCOMP/ctsm#118 throughout the code. - -Also made a couple of minor changes to fix a couple of potential -problems with these variables as described in the branch commit logs. - -Tested for bfb before changing the history field variables -themselves. These changes are all bfb (with the exception of QSNOEVAP) -for a 1 month global 2deg simulation, but may not be bfb under all -conditions. QSNOEVAP is not bfb because I've added in qflx_ev_snow for -lakes. - -Also, update cime slightly with a fix for izumi machine updates - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Resolves ESCOMP/ctsm#118 - - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none expected (not checked) - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: Bill Sacks - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- ok - izumi ------- ok - - ok: tests pass, answer changes in QSNOEVAP but nothing else (as expected) - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: all - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - Larger than roundoff, but only in the diagnostic field QSNOEVAP - - Possibility of other answer changes in rare circumstances, not - observed in testing. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): -- cime: cime5.8.15 -> branch_tags/cime5.8.15_a01 - Minor update for izumi machine changes - -Pull Requests that document the changes (include PR ids): -https://github.com/ESCOMP/CTSM/pull/893 - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev081 -Originator(s): slevis (Samuel Levis,SLevis Consulting LLC,303-665-1310) -Date: Mon Jan 13 15:37:07 MST 2020 -One-line Summary: Speed up restart writes - -Purpose of changes ------------------- - - E3SM#3163 made some changes to speed up restart writes. I use E3SM#3163 - function GetGlobalIndexArray in place of GetGlobalIndex so as to get - global indices by array rather than looping over every element. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): #801 - - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: Limited testing did not show substantial timing changes - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: - @billsacks - @bishtgautam - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - - - tools-tests (test/tools): - - cheyenne - - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - - - regular tests (aux_clm): - - cheyenne ---- OK - izumi ------- PASS - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: - No - - @billsacks recommended running a global test in the branch vs. in master (i.e. - with vs. without the code mods) to compare restart files because the test suite - does not compare restart files and an error in the subgrid indices on the - restart file might go undetected. I ran this test: - ERS_D_Ld6.f10_f10_musgs.I1850Clm45BgcCrop.cheyenne_intel.clm-clm50CMIP6frc - and got identical values for all variables in the two restart files. - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): - https://github.com/ESCOMP/ctsm/pull/880 - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev080 -Originator(s): sacks (Bill Sacks) -Date: Mon Dec 2 12:23:22 MST 2019 -One-line Summary: Update externals, minor fixes to work with latest cime, get nuopc cap working - -Purpose of changes ------------------- - -(1) Update to latest version of externals. This includes a significant - cime update. - -(2) Minor fixes to get things working with the latest version of cime. - -(3) Fix from Mariana Vertenstein to get NUOPC cap working, fixes to - externals cfg files to allow running NUOPC cases out of the box, and - add a NUOPC test. - - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): -CIME update brings in some changes, e.g., in mapping files; otherwise, none. - -Substantial timing or memory changes: not investigated - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: -- Added NUOPC test: - SMS_D_Vnuopc.f10_f10_musgs.I2000Clm50SpRsGs.cheyenne_intel.clm-default - -Code reviewed by: self - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- ok - izumi ------- ok - - ok means tests passed, some baseline comparisons failed as expected - - Note: Most testing was done on ad1ad752; then, from the latest - version, I ran a 2-test test list of: - - SMS_D_Vnuopc.f10_f10_musgs.I2000Clm50SpRsGs.cheyenne_intel.clm-default - - SMS_D.f10_f10_musgs.I2000Clm50SpRsGs.cheyenne_intel.clm-default - - In addition to verifying that the above tests passed, I also - inspected the sharedlib build area to verify that separate builds of - the clm library were done for mct and nuopc. - -If the tag used for baseline comparisons was NOT the previous tag, note that here: -- cheyenne tests compared against ctsm1.0.dev078, since cheyenne testing -was not run on ctsm1.0.dev079. - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: Cases at f10 resolution - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Larger than roundoff, but probably same climate - - Answer changes are due to https://github.com/esmci/cime/pull/3186 - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): -- cime: branch_tags/cime5.8.3_chint17-05 -> cime5.8.15 -- rtm: rtm1_0_68 -> rtm1_0_70 -- mosart: mosart1_0_34 -> mosart1_0_35 -- cmeps: 471ac52 -> 181ff1ed9dfb279e619e8a2173f43baf7bf1dce3 - Also, note that cmeps is now checked out automatically - - -Pull Requests that document the changes (include PR ids): -https://github.com/ESCOMP/CTSM/pull/845 - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev079 -Originator(s): sacks (Bill Sacks) -Date: Mon Nov 4 14:41:41 MST 2019 -One-line Summary: Change a few uses of shr_kind - -Purpose of changes ------------------- - -Change a few uses of shr_kind to work with latest cime. These changes -are from Mariana Vertenstein. - - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: Bill Sacks - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- NOT RUN! - izumi ------- pass - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: NO - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): none - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev078 -Originator(s): oleson (Keith Oleson) -Date: Thu Oct 31 12:30:00 MDT 2019 -One-line Summary: Fix rootr calculation with use_hydrstress true - -Purpose of changes ------------------- - -In cases with use_hydrstress=.true., both rootr_patch and rootr_col had -problems. This affected the diagnostic fields ROOTR and ROOTR_COLUMN, -and (in BGC cases) fed back on other parts of the system via affecting -the methane code. See https://github.com/ESCOMP/CTSM/issues/812 for more -details. - -This tag fixes this issue via these specific changes: - -1. Calculate btran in SoilMoistStressMod.F90 regardless of - use_hydrstress - -2. Comment on the applicability of this calculation and that of rootr in - SoilMoistStressMod.F90 - -3. Add the following comment to uses of rootr and rootr_col throughout - the code: "SMS method only" - -4. Allow ROOTR_COL history field only if use_hydrstress = .false. - -5. Remove the calculation of rootr_col in subroutine - Compute_EffecRootFrac_And_VertTranSink_HydStress within module - SoilWaterPlantSinkMod.F90 since that calculation is invalid for PHS. - -6. Normalize root resistances for pervious road over nlevgrnd, not - nlevsoi - -Note that the rootr calculation is done using the non-PHS (i.e., SMS) -method. So rootr is not really consistent with PHS; this is something -that should probably be revisited later. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Fixes ESCOMP/ctsm#812 (Problems with rootr when use_hydrstress=.true.) - - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: not checked; none expected - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: Bill Sacks - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- ok - izumi ------- ok - - ok means tests pass, answers change as expected - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: Clm50Bgc (cases with both use_hydrstress=.true. and methane active) - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - larger than roundoff / same climate - - For details on differences, see - https://github.com/ESCOMP/CTSM/issues/812#issuecomment-547924289 - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: - http://webext.cgd.ucar.edu/I20TR/clm50_ctsm10d074_2deg_GSWP3V1_rootr_hist/lnd/clm50_ctsm10d074_2deg_GSWP3V1_rootr_hist.1995_2014-clm50_ctsm10d074_2deg_GSWP3V1_hist.1995_2014/setsIndex.html - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): none - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev077 -Originator(s): sacks (Bill Sacks) -Date: Sun Oct 27 16:23:39 MDT 2019 -One-line Summary: Consistently use frac_sno_eff rather than frac_sno in qg calculations - -Purpose of changes ------------------- - -Consistently use frac_sno_eff rather than frac_sno in qg calculations - -The change here only changes answers for (1) urban pervious road, and -(2) more broadly with use_subgrid_fluxes = .false. - -Previously, code in CalculateSurfaceHumidity was inconsistent regarding -the use of frac_sno vs. frac_sno_eff. I wanted to make this consistent -to facilitate upcoming cleanup of CalculateSurfaceHumidity. I went back -and forth as to which one we should use here. (See also -https://github.com/ESCOMP/CTSM/issues/822). - -Argument for frac_sno_eff: This is consistent with the use of -frac_sno_eff elsewhere in the calculation of surface fluxes. - -Argument for frac_sno: Even in CLM4.0 (prior to the introduction of -frac_sno_eff and frac_h2osfc), frac_sno was used to calculate surface -relative humidity. That makes me think that the parameterizations were -improved by using frac_sno here, even though frac_sno at that point was -mainly just used for albedo / radiation calculations. So sticking with -frac_sno would be more consistent with what has been done for a long -time, and would presumably be a bit better scientifically. - -However, when I tried changing this to use frac_sno rather than -frac_sno_eff: - - qg(c) = frac_sno_eff(c)*qg_snow(c) + (1._r8 - frac_sno_eff(c) - frac_h2osfc(c))*qg_soil(c) & - + frac_h2osfc(c) * qg_h2osfc(c) - -I got a crash with use_subgrid_fluxes false (test -SMS_D_Ld1_P4x1.f10_f10_musgs.I2000Clm45BgcCropQianRsGs.bishorn_gnu.clm-no_subgrid_fluxes), -due to a check I put in relatively recently to ensure that the top-layer -soil liquid never goes significantly negative: - -WJS 218: frac_sno, frac_sno_eff, frac_h2osfc, snl = 6.6447358408778726E-005 1.0000000000000000 0.0000000000000000 -1 - qg_snow, qg_soil, qg_h2osfc, qg = 3.8414454029812475E-003 3.6634834595404343E-003 3.6635176705822736E-003 3.6634952846414733E-003 - ERROR: In UpdateState_TopLayerFluxes, h2osoi_liq has gone significantly negative - Bulk/tracer name = bulk - c, lev_top(c) = 218 0 - h2osoi_liq_top_orig = 6.6448689668604415E-004 - h2osoi_liq = -2.6754040213948407E-004 - frac_sno_eff = 1.0000000000000000 - qflx_liq_grnd*dtime = 0.0000000000000000 - qflx_dew_grnd*dtime = 0.0000000000000000 - qflx_evap_grnd*dtime = 9.3202729882552822E-004 - ENDRUN: - ERROR: In UpdateState_TopLayerFluxes, h2osoi_liq has gone significantly negative - -What seems to be going on is: With a little bit of snow present, when I -use frac_sno rather than frac_sno_eff, we end up with a qg value very -close to that of soil. But I think the later evaporation happens from -the snow, at which point I guess the dryer air above leads to there -being too large evaporation from the snow. - -So in the end, I decided to consistently use frac_sno_eff, even though -this might be a small step backwards in terms of the accuracy of surface -humidity for urban pervious road and with use_subgrid_fluxes = .false. - - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: self (but approved conceptually by Sean Swenson and -Keith Oleson) - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- ok - izumi ------- ok - - ok means tests pass, answers change as expected - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: all - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Expected to be larger than roundoff/same climate, but not - investigated carefully - - For the default configuration with use_subgrid_fluxes = .true., - differences are restricted to urban pervious road. I spot-checked - a few tests to ensure that we only saw differences in FSH for - urban landunits; this was generally true, with the exception of - ERP_Ly3_P72x2.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-cropMonthOutput, - which also had differences over crop and natural veg - landunits. This spillover effect seems to be related to the - non-local interactions that arise from methane's dependence on - TWS, though I don't understand why I only saw this in a transient - case, and not in similar non-transient cases. See - https://github.com/ESCOMP/CTSM/issues/658#issuecomment-546740771 - for more details. - - For the non-default use_subgrid_fluxes = .false., there - differences in the natural vegetation and crop landunits, too. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): none - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev076 -Originator(s): sacks (Bill Sacks) -Date: Fri Oct 25 16:04:20 MDT 2019 -One-line Summary: Set frac_sno_eff=0 if frac_sno is 0; avoid unnecessary calls to QSat - -Purpose of changes ------------------- - -Two changes that are bit-for-bit except for changes in the FSNO_EFF -diagnostic field, both with an eye towards cleaning up -SurfaceHumidityMod in preparation for adding water tracers to that -module: - -(1) Set frac_sno_eff to 0 if frac_sno is 0. Previously, for cases where - frac_sno_eff was a binary 0/1 rather than being set equal to - frac_sno, frac_sno_eff was always being set to 1, even if there was - no snow. Sean Swenson thinks that didn't matter, but I found it - confusing, and it could be more problematic with some upcoming - changes I plan to make (where I'm going to use frac_sno_eff as a - weighting factor in calculating qg terms, including for landunits - that use a binary 0/1 frac_sno_eff.) - -(2) Avoid unnecessary calls to QSat, since this function is relatively - expensive. - - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: No substantial changes; from a -single run of PFS_Ld20.f09_g17.I2000Clm50BgcCrop.cheyenne_intel, max -timing of the main changed section (bgp1) decreased by about 10%; this -may be within machine variability, though. - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: self - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- ok - izumi ------- ok - - ok means tests pass, answer changes as expected just for FSNO_EFF - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: YES, but just for the diagnostic field FSNO_EFF - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: all - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - diagnostic only: just changes FSNO_EFF - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): none - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev075 -Originator(s): sacks (Bill Sacks) -Date: Fri Oct 25 15:44:52 MDT 2019 -One-line Summary: Lakes: Adjust frac_sno after updating 0-layer snow pack for dew & sublimation - -Purpose of changes ------------------- - -Main change is: for lakes, possibly adjust frac_sno after updating -0-layer snow pack for dew & sub, ensuring that zero vs. non-zero values -of frac_sno agree with whether the snow pack has zero or non-zero -amounts of snow. The main motivation for this is to ensure that, if we -have any snow, then frac_sno should be non-zero. Along with this, I'm -also ensuring that, if we go down to 0 snow, then we also go down to 0 -frac_sno. - -A related change was to move the code ensuring that h2osno_no_layers -doesn't go negative: I have moved this to before h2osno_no_layers is -referenced, to assure we don't get a slightly negative snow depth. (I -haven't noticed any problems due to the old placement, but it seems -safer to put the limiting before the reference to h2osno_no_layers.) - -Also, an unrelated change in run_sys_tests: Add option for rerunning -existing failed tests. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Resolves ESCOMP/ctsm#827 (Lake frac_sno can remain 0 even when there - is some snow addition from frost) - - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: None expected - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: self - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - pass (on my mac: 'make test' with python2 & python3 and 'make lint') - - regular tests (aux_clm): - - cheyenne ---- ok - izumi ------- ok - - ok means tests pass, answers change as expected - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: all - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Expected to be larger than roundoff/same climate - - Changes are introduced only over lake columns, and these changes - should be small, since they only relate to the setting of frac_sno - when there is dew or sublimation on a very thin snow - pack. - - Although the direct changes should only affect lakes, I did - observe changes in crop columns in a transient test that I - spot-checked - (ERP_Ly3_P72x2.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-cropMonthOutput) - - maybe due to some of the non-local interactions in - https://github.com/ESCOMP/CTSM/wiki/Parameterizations-that-can-cause-nonlocal-interactions, - or maybe due to some other non-local interaction, either known or - buggy. (In non-transient tests that I spot checked - (ERP_P72x2_Lm36.f10_f10_musgs.I2000Clm50BgcCrop.cheyenne_intel.clm-clm50cropIrrigMonth_interp - and - SMS_Lm13.f19_g17.I2000Clm50BgcCrop.cheyenne_intel.clm-cropMonthOutput): - diffs in FSH in h1 file are just over lake landunits, as - expected.) - - Update: it seems that these changes in crop columns arise from - the nonlocal interactions caused by the dependence of methane - on TWS, though I don't understand why I only saw this in a - transient case, and not in similar non-transient cases. See - https://github.com/ESCOMP/CTSM/issues/658#issuecomment-546740771 - for more details. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): none - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev074 -Originator(s): sacks (Bill Sacks) -Date: Wed Oct 23 19:25:21 MDT 2019 -One-line Summary: For lakes: when reading finidat, set frac_sno=1 if h2osno_total > 0 - -Purpose of changes ------------------- - -Due to ESCOMP/ctsm#783, frac_sno used to be 0 for all lake points. That -was mostly fixed, but the issue is still present on initial conditions -files that were generated prior to that fix (which includes most or all -of our out-of-the-box restart files). This causes frac_sno to be 0 for -lake points at the start of the simulation, even if there is a snow pack -present. Currently this doesn't cause significant problems, but I'd like -to change the calculation of frac_sno_eff so that it is 0 if frac_sno is -0 - and then this frac_sno problem becomes an issue (causing divide by 0 -in at least one place). - -However, further problems were introduced if I tried to always apply -this correction: It appears that sometimes the restart file legitimately -has frac_sno == 0 for lake columns with non-zero snow cover. To avoid -changing answers for newer restart files, I am writing metadata to the -restart file documenting whether the fix has already been applied on -that restart file, and if so, we avoid reapplying the fix. - -Getting this restart metadata correct was tricky, especially when -running init_interp. I have introduced a new module to encapsulate this -complexity. This can be used in general for writing / reading metadata -on which issues have been fixed on a given restart file. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): [If none, remove this line] -- Resolves ESCOMP/ctsm#783 - - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): -- The setting of initial lake frac_sno to 1 isn't exactly correct, but - it's better than the old value of 0. - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none -- I didn't check the PFS test, but the only change that could have - likely led to performance changes was the addition of a metadata copy - in init_interp. I checked the timing of this piece, and found it to be - a negligible portion of the total init_interp time - (https://github.com/ESCOMP/CTSM/pull/825#issuecomment-545219601). - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: Erik Kluzek gave this an initial look and gave general -approval for the restart file metadata mechanism I have added. He may -give it a more careful look, possibly accompanied by a further cleanup -tag addressing any issues he finds. - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- ok - izumi ------- ok - - ok means tests passed, baselines fail as expected. - - Note that the FUNIT test failed initially; I got it passing on my - Mac, but didn't rerun it on cheyenne. - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: all - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Larger than roundoff/same climate - - The only change is in initial lake frac_sno. This should only - affect the start of the simulation, and only over lake points. I - verified that changes are only over lake points via: For both - SMS_D_Ld1.f09_g17.I1850Clm50Sp.cheyenne_intel.clm-default (which - doesn't use init_interp) and - SMS_D_Ld3.f10_f10_musgs.I2000Clm50BgcCruGs.cheyenne_gnu.clm-default - (which uses init_interp): I checked which points have differences - in FSH in the h1 (vector) history file. Diffs were only over lake - points. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -https://github.com/ESCOMP/CTSM/pull/825 - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev073 -Originator(s): sacks (Bill Sacks) -Date: Tue Oct 22 06:14:24 MDT 2019 -One-line Summary: Fix bug in calculation of dqgdT - -Purpose of changes ------------------- - -The calculation of dqgdT, which gives the derivative, d(qg)/dT, was -incorrect for soil/crop landunits when there is no snow. This tag fixes -that bug. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Resolves ESCOMP/CTSM#824 (dqgdT incorrect when there is no snow) - - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: not checked, but none expected - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: Sean Swenson reviewed and approved my plan, though not the final code - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- ok - izumi ------- ok - - ok means tests pass, answers change as expected - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: all - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Larger than roundoff/same climate - - I checked the impact from one-day averages in test - SMS_D_Ld1_P4x1.f10_f10_musgs.I2000Clm50BgcCropQianRsGs.bishorn_gnu.clm-default, - by looking at differences in EFLX_LH_TOT. The impact is small: - daily-average differences in that variable are typically 0.01 W - m-2 or less; most grid cells have significantly less difference - than that; only one or a few f10 grid cells have significantly - greater differences, with the biggest difference being about 0.1 W - m-2. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): none - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev072 -Originator(s): mvertens (Mariana Vertenstein) -Date: Tue Oct 15 09:41:50 MDT 2019 -One-line Summary: Add NUOPC cap - -Purpose of changes ------------------- - -Add NUOPC cap in order to run with the new NUOPC driver/mediator. There -was some code movement / refactoring of existing code to support this, -with the biggest change being the introduction of a new subdirectory -under src/cpl. - -Most changes are from Mariana Vertenstein and Jim Edwards. - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none expected (not checked) - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): -- NUOPC cap currently does not have any tests in the aux_clm test suite -- There are currently no tests ensuring that the nuopc and mct caps give - bit-for-bit answers, though the nuopc_cap_bfb testmod could be used to - support such a test - -Changes to tests or testing: none - -Code reviewed by: Bill Sacks - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- pass - izumi ------- pass - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: NO - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): -- mosart: mosart1_0_33 -> mosart1_0_34 (supports nuopc cap) - -Pull Requests that document the changes (include PR ids): none - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev071 -Originator(s): sacks (Bill Sacks) -Date: Fri Oct 11 07:03:40 MDT 2019 -One-line Summary: Split CanopyTemperature into separate pieces - -Purpose of changes ------------------- - -CanopyTemperature was doing a few unrelated things, none of which -actually had anything to do with calculating canopy temperature. At the -driver level, I have split CanopyTemperature into BiogeophysPreFluxCalcs -and CalculateSurfaceHumidity. BiogeophysPreFluxCalcs calls out to a -number of separate routines, some in that same module and some -elsewhere, including a new routine in FrictionVelocityMod. - -Also some minor related cleanup, including - -- Made FrictionVelocityMod object-oriented - -- A bit of rework of how qflx_evap_veg and qflx_tran_veg are set. This - changes answers for the (default inactive) QFLX_EVAP_VEG history field - (see also ESCOMP/ctsm#816). - -- Removed qsat conditionals that should never be invoked - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Fixes ESCOMP/ctsm#816 (QFLX_EVAP_VEG should be 0 over lakes) - - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: self - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- pass - izumi ------- pass - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: YES, but only for the -(default-inactive) field QFLX_EVAP_VEG - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: all - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - larger than roundoff, but only for the default-inactive field QFLX_EVAP_VEG - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): none - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev070 -Originator(s): sacks (Bill Sacks) -Date: Wed Oct 9 06:16:39 MDT 2019 -One-line Summary: Fix for writing 0-d variables with PIO2 - -Purpose of changes ------------------- - -Previously, there were problems when writing 0-d (scalar) variables with -PIO2 in DEBUG mode. This change fixes that issue. - -Jim Edwards put in place an initial fix; I put in place the final fix -based on changes Mariana Vertenstein made in MOSART. I have not tested -this with PIO2, but am hopeful that it fixes the PIO2 problem since the -similar MOSART changes fixed that problem. - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: self; earlier version reviewed by Erik Kluzek and Mariana Vertenstein - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- pass - izumi ------- pass - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: NO - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -https://github.com/ESCOMP/CTSM/pull/810 - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev069 -Originator(s): sacks (Bill Sacks) -Date: Mon Oct 7 10:22:22 MDT 2019 -One-line Summary: Misc. code cleanup and minor bug fixes - -Purpose of changes ------------------- - -Resolve a variety of "simple bfb" issues. Note that some of these result -in answer changes for select diagnostic fields. See specific notes below -for details, under "Issues fixed" and answer changes. - -The fix for ESCOMP/ctsm#27 changes answers for some diagnostic fields, -as noted below. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Resolves ESCOMP/ctsm#27 (BTRAN should be spval over all special - landunits) - - Also fixed some related fields, as noted below, under answer changes - -- Resolves ESCOMP/ctsm#31 (some CLM history fields don't restart - properly) - - This was mostly resolved previously; here I just did some final - cleanup and fixing of NFIRE - -- Resolves ESCOMP/ctsm#48 (code for initializing some isotope carbon - state variables looks wrong) - - Removed the incorrect code, which was never being exercised - -- Resolves ESCOMP/ctsm#58 (Change SHR_ASSERT calls to avoid using - errMsg) - - Purpose was to speed up DEBUG runs on some machines/compilers - -- Resolves ESCOMP/ctsm#111 (Precision of constants in - SoilTemperature.F90 is not double) - - No answer changes, because 1 (single prec) = 1 (double prec) - -- Resolves ESCOMP/ctsm#334 (Introduce a new activelayer_type) - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: potentially speeds up debug runs on some machines/compilers - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: self - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- ok - izumi ------- ok - - ok means tests pass, some baseline comparisons fail as expected - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: YES, but just for select diagnostic fields - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: ALL - - what platforms/compilers: ALL - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Greater than roundoff, but only in select diagnostic field - no impact on climate - - There were changes in the following diagnostic fields, which are - now averaged over only vegetated landunits (see ESCOMP/ctsm#27): - - BTRAN - - BTRANMN - - RSSHA - - RSSUN - - ROOTR (inactive by default) - - ROOTR_COLUMN (inactive by default) - - RRESIS (inactive by default) - - Changes are also possible in rare circumstances for the NFIRE - diagnostic field, in transient cases, although no differences were - observed for this field in the test suite (see ESCOMP/ctsm#31). - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): none - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev068 -Originator(s): sacks (Bill Sacks) -Date: Mon Sep 30 09:57:04 MDT 2019 -One-line Summary: Add water tracers to CombineSnowLayers, DivideSnowLayers, ZeroEmptySnowLayers - -Purpose of changes ------------------- - -Add water tracers to CombineSnowLayers, DivideSnowLayers and -ZeroEmptySnowLayers. This completes the tracerization of the core snow -code: most or all of the code in SnowHydrologyMod is now tracerized. - -In contrast to most routines that I have tracerized, the tracerization -of these routines is done by embedding loops over tracers inside -existing code structures, rather than splitting out separate routines -that operate on bulk or tracer quantities. This is because (1) it didn't -make sense to introduce explicit fluxes for the state updates done here, -so we didn't have the extra need of having separate routines for flux -calculations vs. state updates; (2) the state updates were embedded in -loops over levels and conditionals in a way that would have been awkward -and messy to try to separately update bulk-and-tracer quantities -(h2osoi_liq, h2osoi_ice, etc.) from bulk-only quantities (dz, etc.). - -Also, a bit of reordering of LakeHydrologyMod in order to keep the snow -code more together. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Resolves ESCOMP/ctsm#778 (Implement water tracers for combining and - dividing snow layers) - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: I don't think so - Based on the changes introduced, I expect *very* small increases in - runtime of the modified routines (which would show up in the - hydro_without_drainage timer), even for cases without water tracers, - but I wouldn't expect this to have a significant impact. From PFS - test, and specifically looking at the timing of - hydro_without_drainage in that test, I see a possible small increase - (a few percent) in the timing of that section, though the differences - are within typical machine variability, so don't seem necessarily - significant. - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: self - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- pass - izumi ------- pass - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: NO - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): none - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev067 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Thu Sep 26 15:02:39 MDT 2019 -One-line Summary: Add config_archive.xml to CTSM cime_config -- no testing - -Purpose of changes ------------------- - -Add config_archive.xml to cime_config for CTSM. Update the CODE_OF_CONDUCT -to the August/2019 UCAR version. - -No testing done. - -Bugs fixed or introduced ------------------------- - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: None - -Code reviewed by: self - - -CTSM testing: doc (no standard testing done) - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - src unit-tests: - - cheyenne - PASS - - regular tests (aux_clm): None - -If the tag used for baseline comparisons was NOT the previous tag, note that here: previous - - -Answer changes --------------- - -Changes answers relative to baseline: No! - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None - -Pull Requests that document the changes (include PR ids): None -(https://github.com/ESCOMP/ctsm/pull) - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev066 -Originator(s): sacks (Bill Sacks) -Date: Fri Sep 20 09:07:23 MDT 2019 -One-line Summary: Add water tracers to SnowCapping - -Purpose of changes ------------------- - -Update water tracer terms in SnowCapping. As I have done elsewhere, this -has involved splitting each piece of SnowCapping into its own subroutine, -which operates either on bulk, tracers, or bulk + tracers. - -This is supported by calls to ResetCheckedTracers prior to the call to -SnowCapping, since some intervening code is not yet tracerized. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Resolves ESCOMP/ctsm#777 (Implement water tracers for SnowCapping) - - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - Small increase in total runtime of PFS test, but the relevant timing - section, hydro_without_drainage, took slightly *less* time compared - with the last tag. - - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: self - - -CTSM testing: - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- pass - izumi ------- pass - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: NO - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): none - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev065 -Originator(s): sacks (Bill Sacks) -Date: Sat Sep 14 12:52:42 MDT 2019 -One-line Summary: Add water tracers to SnowWater - -Purpose of changes ------------------- - -Update water tracer terms in SnowWater. As I have done elsewhere, this -has involved splitting each piece of SnowWater into its own subroutine, -which operates either on bulk, tracers, or bulk + tracers. - -This is supported by calls to ResetCheckedTracers prior to the call to -SnowWater, since some intervening code is not yet tracerized. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Resolves ESCOMP/ctsm#776 (Implement water tracers for SnowWater) - - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: self - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- ok - izumi ------- ok - - ok means tests pass, baselines fail as expected - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: all - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - Roundoff level: answer changes just arise because I have made - qflx_snow_percolation_col a true flux, with units of - per-unit-time; this involved dividing by dtime, and later - multiplying by dtime when it is applied to states. Previously, the - corresponding variable (qout / qin) was not per-unit-time. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - I ran comparisons against a version off of master that had the - minimal changes to exhibit these roundoff-level changes. Diffs for - this are below. My branch is bit-for-bit with this version. - - diff --git a/src/biogeophys/SnowHydrologyMod.F90 b/src/biogeophys/SnowHydrologyMod.F90 - index cad47e28..0abcc49f 100644 - --- a/src/biogeophys/SnowHydrologyMod.F90 - +++ b/src/biogeophys/SnowHydrologyMod.F90 - @@ -1140,17 +1140,17 @@ subroutine SnowWater(bounds, & - c = filter_snowc(fc) - if (j >= snl(c)+1) then - - - h2osoi_liq(c,j) = h2osoi_liq(c,j) + qin(c) - + h2osoi_liq(c,j) = h2osoi_liq(c,j) + qin(c)*dtime - - - mss_bcphi(c,j) = mss_bcphi(c,j) + qin_bc_phi(c) - - mss_bcpho(c,j) = mss_bcpho(c,j) + qin_bc_pho(c) - - mss_ocphi(c,j) = mss_ocphi(c,j) + qin_oc_phi(c) - - mss_ocpho(c,j) = mss_ocpho(c,j) + qin_oc_pho(c) - + mss_bcphi(c,j) = mss_bcphi(c,j) + qin_bc_phi(c)*dtime - + mss_bcpho(c,j) = mss_bcpho(c,j) + qin_bc_pho(c)*dtime - + mss_ocphi(c,j) = mss_ocphi(c,j) + qin_oc_phi(c)*dtime - + mss_ocpho(c,j) = mss_ocpho(c,j) + qin_oc_pho(c)*dtime - - - mss_dst1(c,j) = mss_dst1(c,j) + qin_dst1(c) - - mss_dst2(c,j) = mss_dst2(c,j) + qin_dst2(c) - - mss_dst3(c,j) = mss_dst3(c,j) + qin_dst3(c) - - mss_dst4(c,j) = mss_dst4(c,j) + qin_dst4(c) - + mss_dst1(c,j) = mss_dst1(c,j) + qin_dst1(c)*dtime - + mss_dst2(c,j) = mss_dst2(c,j) + qin_dst2(c)*dtime - + mss_dst3(c,j) = mss_dst3(c,j) + qin_dst3(c)*dtime - + mss_dst4(c,j) = mss_dst4(c,j) + qin_dst4(c)*dtime - - if (j <= -1) then - ! No runoff over snow surface, just ponding on surface - @@ -1167,8 +1167,8 @@ subroutine SnowWater(bounds, & - qout(c) = max(0._r8,(vol_liq(c,j) & - - ssi*eff_porosity(c,j))*dz(c,j)*frac_sno_eff(c)) - end if - - qout(c) = qout(c)*1000._r8 - - h2osoi_liq(c,j) = h2osoi_liq(c,j) - qout(c) - + qout(c) = (qout(c)*1000._r8)/dtime - + h2osoi_liq(c,j) = h2osoi_liq(c,j) - qout(c)*dtime - qin(c) = qout(c) - - ! mass of ice+water: in extremely rare circumstances, this can - @@ -1187,7 +1187,7 @@ subroutine SnowWater(bounds, & - if (qout_bc_phi(c) > mss_bcphi(c,j)) then - qout_bc_phi(c) = mss_bcphi(c,j) - endif - - mss_bcphi(c,j) = mss_bcphi(c,j) - qout_bc_phi(c) - + mss_bcphi(c,j) = mss_bcphi(c,j) - qout_bc_phi(c)*dtime - qin_bc_phi(c) = qout_bc_phi(c) - - ! BCPHO: - @@ -1196,7 +1196,7 @@ subroutine SnowWater(bounds, & - if (qout_bc_pho(c) > mss_bcpho(c,j)) then - qout_bc_pho(c) = mss_bcpho(c,j) - endif - - mss_bcpho(c,j) = mss_bcpho(c,j) - qout_bc_pho(c) - + mss_bcpho(c,j) = mss_bcpho(c,j) - qout_bc_pho(c)*dtime - qin_bc_pho(c) = qout_bc_pho(c) - - ! OCPHI: - @@ -1205,7 +1205,7 @@ subroutine SnowWater(bounds, & - if (qout_oc_phi(c) > mss_ocphi(c,j)) then - qout_oc_phi(c) = mss_ocphi(c,j) - endif - - mss_ocphi(c,j) = mss_ocphi(c,j) - qout_oc_phi(c) - + mss_ocphi(c,j) = mss_ocphi(c,j) - qout_oc_phi(c)*dtime - qin_oc_phi(c) = qout_oc_phi(c) - - ! OCPHO: - @@ -1214,7 +1214,7 @@ subroutine SnowWater(bounds, & - if (qout_oc_pho(c) > mss_ocpho(c,j)) then - qout_oc_pho(c) = mss_ocpho(c,j) - endif - - mss_ocpho(c,j) = mss_ocpho(c,j) - qout_oc_pho(c) - + mss_ocpho(c,j) = mss_ocpho(c,j) - qout_oc_pho(c)*dtime - qin_oc_pho(c) = qout_oc_pho(c) - - ! DUST 1: - @@ -1223,7 +1223,7 @@ subroutine SnowWater(bounds, & - if (qout_dst1(c) > mss_dst1(c,j)) then - qout_dst1(c) = mss_dst1(c,j) - endif - - mss_dst1(c,j) = mss_dst1(c,j) - qout_dst1(c) - + mss_dst1(c,j) = mss_dst1(c,j) - qout_dst1(c)*dtime - qin_dst1(c) = qout_dst1(c) - - ! DUST 2: - @@ -1232,7 +1232,7 @@ subroutine SnowWater(bounds, & - if (qout_dst2(c) > mss_dst2(c,j)) then - qout_dst2(c) = mss_dst2(c,j) - endif - - mss_dst2(c,j) = mss_dst2(c,j) - qout_dst2(c) - + mss_dst2(c,j) = mss_dst2(c,j) - qout_dst2(c)*dtime - qin_dst2(c) = qout_dst2(c) - - ! DUST 3: - @@ -1241,7 +1241,7 @@ subroutine SnowWater(bounds, & - if (qout_dst3(c) > mss_dst3(c,j)) then - qout_dst3(c) = mss_dst3(c,j) - endif - - mss_dst3(c,j) = mss_dst3(c,j) - qout_dst3(c) - + mss_dst3(c,j) = mss_dst3(c,j) - qout_dst3(c)*dtime - qin_dst3(c) = qout_dst3(c) - - ! DUST 4: - @@ -1250,7 +1250,7 @@ subroutine SnowWater(bounds, & - if (qout_dst4(c) > mss_dst4(c,j)) then - qout_dst4(c) = mss_dst4(c,j) - endif - - mss_dst4(c,j) = mss_dst4(c,j) - qout_dst4(c) - + mss_dst4(c,j) = mss_dst4(c,j) - qout_dst4(c)*dtime - qin_dst4(c) = qout_dst4(c) - - end if - @@ -1280,9 +1280,9 @@ subroutine SnowWater(bounds, & - do fc = 1, num_snowc - c = filter_snowc(fc) - ! Qout from snow bottom - - qflx_snow_drain(c) = qflx_snow_drain(c) + (qout(c) / dtime) - + qflx_snow_drain(c) = qflx_snow_drain(c) + qout(c) - - - qflx_rain_plus_snomelt(c) = (qout(c) / dtime) & - + qflx_rain_plus_snomelt(c) = qout(c) & - + (1.0_r8 - frac_sno_eff(c)) * qflx_liq_grnd(c) - int_snow(c) = int_snow(c) + frac_sno_eff(c) & - * (qflx_dew_snow(c) + qflx_dew_grnd(c) + qflx_liq_grnd(c)) * dtime - - - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): none - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev064 -Originator(s): slevis (Samuel Levis,SLevis Consulting LLC,303-665-1310) -Date: Mon Sep 9 13:14:51 MDT 2019 -One-line Summary: User defined top-two snow layers - -Purpose of changes ------------------- - - Instead of hardcoding, we now set: - - dzmin(1) = snow_dzmin_1 - dzmax_l(1) = snow_dzmax_l_1 - dzmax_u(1) = snow_dzmax_u_1 - dzmin(2) = snow_dzmin_2 - dzmax_l(2) = snow_dzmax_l_2 - dzmax_u(2) = snow_dzmax_u_2 - - where the right-hand-side variables get namelist-defined values and the - model calculates dzmin and dzmax_* for the remaining snow layers using - recursive formulas. The calculation is intended to match the previously - hardcoded values, except for the bottom snow layer when nlevsno < 12. - The bottom layer now always gets dzmax_* = huge(1._r8). The formulas - appear in a document titled "A firn model for CLM" that is linked to - #729. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): #729 - - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): - New namelist parameters for specifying the top-two snow layers: - snow_dzmin_1, snow_dzmax_l_1, snow_dzmax_u_1 - snow_dzmin_2, snow_dzmax_l_2, snow_dzmax_u_2 - -Changes made to namelist defaults (e.g., changed parameter values): - Introduced default values for the new parameters so as to maintain - same answers to within roundoff - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: @billsacks - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - - - tools-tests (test/tools): - - cheyenne - - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - - - regular tests (aux_clm): - - cheyenne ---- OK - izumi ------- OK - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - Summarize any changes to answers, i.e., - - what code configurations: all - - what platforms/compilers: all - - nature of change: roundoff - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - Introduced temporary code to overwrite dzmin(j), dzmax_l(j), and - dzmax_u(j) with their original values when different by less than - 1e-13 from their original values for all but the bottom snow layer. - The bottom layer was left as dzmax_l = dzmax_u(j) = huge(1._8), i.e. - the new value. The test resulted in bit-for-bit same answers. - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): - https://github.com/ESCOMP/ctsm/pull/792 - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev063 -Originator(s): erik (Erik Kluzek) -Date: Thu Sep 5 21:28:02 MDT 2019 -One-line Summary: Two answer changing fixes (fire, DWT_SLASH) and fix for urban streams for Clm45 - -Purpose of changes ------------------- - -Fire bug fix and DWT_SLASH change and fix urban stream years for clm4_5. -The latitude used in an expression for Bgc-Fire model Li2016 (used in Clm50) -had latitude in degrees rather than in radians as it should have been. The -term is used for ignition and the cosine was being taken in degrees rather -than radians, hence the spatial pattern for ignition with latitude was incorrect. - -The history field DWT_SLASH_CFLUX was being calculated on the column, but -really should have been a patch level variable. In the same way other fields -were handled we made DWT_SLASH_CFLUX a grid-cell variable, and added -DWT_SLASH_CFLUX_PATCH on the patch level that could be added to output. The same -is true of the C13_ and C14_ versions of it. - -Clm45 was setting urbantv to year 2000, rather than 1850 or historical as it should -have. The urbantv file for Clm45 doesn't actually change, so this doesn't actually -make a difference. But, it does make the namelist look wrong. - -Note, that SP cases, Vic cases and Fates cases do NOT change answers. Or if fire is -off, or certain single-point cases. Some cold-start cases don't seem to be sensitive -to it either. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): #175, #787, #780 - fixes #175 urban stream years for clm4_5 - fixes #787 DWT_SLASH field - fixes #780 Bug in CN Fire Li 2016 which used latitude in degrees rather than radians - -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_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): Defaults for urbantv for clm4_5 - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: None - -Code reviewed by: self, @olywon - - -CTSM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS (62 compare fail due to namelist changes) - - regular tests (aux_clm): - - cheyenne ---- OK - izumi ------- OK - -If the tag used for baseline comparisons was NOT the previous tag, note that here: previous - - -Answer changes --------------- - -Changes answers relative to baseline: Yes! - - Summarize any changes to answers, i.e., - - what code configurations: Clm50Bgc and some Clm45Bgc cases - - what platforms/compilers: All - - nature of change: similar climate (but fire ignition pattern changes by latitude) - DWT_SLASH_* history fields change because moved to gridcell quantity (so change is relatively minor) - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: - oleson/clm50_cesm20R_2deg_GSWP3V1_issue780_hist (for the fire change) - - URL for LMWG diagnostics output used to validate new climate: -http://webext.cgd.ucar.edu/I20TR/clm50_cesm20R_2deg_GSWP3V1_issue780_hist/lnd/clm50_cesm20R_2deg_GSWP3V1_issue780_hist.1995_2014-clm50_cesm20R_2deg_GSWP3V1_hist.1995_2014/setsIndex.html - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None - -Pull Requests that document the changes (include PR ids): #802 -(https://github.com/ESCOMP/ctsm/pull) - #802 -- Three answer changing fixes (fire, DWT_SLASH, urban streams for clm4_5) - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev062 -Originator(s): sacks (Bill Sacks) -Date: Tue Sep 3 16:04:28 MDT 2019 -One-line Summary: Move hobart tests to izumi - -Purpose of changes ------------------- - -Move all hobart testing to izumi. - - -Bugs fixed or introduced ------------------------- - -Known bugs introduced in this tag (include github issue ID): -- Recurrence of ESCOMP/ctsm#174 (ne30 case fails on hobart_nag due to floating overflow) - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): -- Testing should now be run on izumi, not hobart - -Changes to tests or testing: -- All hobart tests moved to izumi - -Code reviewed by: self - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- not run - izumi ------- pass - - Also ran prealpha and prebeta tests that I moved from hobart to izumi. These passed except: - - ERP_D_Ld5.ne30_g16.I1850Clm50BgcCrop.izumi_nag.clm-default (#174) - - ERP_Ld5.f19_g17.I2000Clm50SpRtmFl.izumi_pgi.clm-default - - SMS_D_Ld1.f19_g17.I1850Clm45Cn.izumi_pgi.clm-default - - The last two failed with errors like: - - i011.unified.ucar.edu.44619hfi_userinit: mmap of status page (dabbad0008040000) failed: Operation not permitted - - I wonder if the issue is that multi-node pgi cases don't work on izumi? - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: NO - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): -- cime: cime5.8.3_chint17-04 -> cime5.8.3_chint17-05 - Minor change on izumi to allow using run_sys_tests - -Pull Requests that document the changes (include PR ids): none - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev061 -Originator(s): erik (Erik Kluzek) -Date: Sun Sep 1 22:37:07 MDT 2019 -One-line Summary: Simple b4b fixes: new params file, remove override_nsrest/anoxia_wtsat, DV deprecated - -Purpose of changes ------------------- - -New clm5 paramsfile that has the bad date of 631 changed to 701. Along with some simple bit for -bit changes. Removing some problematic options. Making Dynamic Vegetation a deprecated option -that requires you to use -ignore_warnings with it. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): #463 #79 #97 #98 #104 #122 #173 #794 #795 #796 - - Fixes #463 bad date on params file that didn't allow using ESMF library with Crop - Fixes #79 correct documentation of qflx_evap_tot - Fixes #97 remove override_nsrest - Fixes #98 add warning when using single instance of a startup file for multi-instance cases - Fixes #104 use get_step_size_real when putting into a real variable - Fixes #122 decomp pool arrays should not start at 0 but 1 - Fixes #173 remove psi_soil_ref as not used - Fixes #794 remove anoxia_wtsat - Fixes #795 Correct documentation of -light_res - Fixes #796 Deprecate Dynamic Vegetation - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): Remove namelist items - Remove namelist items: anoxia_wtsat, override_nsrest - Turning dynamic Vegetation on, now displays a warning, and requires using -ignore_warnings in CLM_BLDNML_OPTS - -Changes made to namelist defaults (e.g., changed parameter values): New paramdata files - -Changes to the datasets (e.g., parameter, surface or initial files): - clm5 paramdata file has correct date for crop of 701 (rather than incorrect 631) - clm5 and clm4_5 paramdata file removed an unused variable - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: DV tests removed or changed - -Code reviewed by: self - -CTSM testing: regular - - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS (compare shows changes becausse of paramdata files) - - regular tests (aux_clm): - - cheyenne ---- OK - hobart ------ OK - -An additional fail is ERP_P36x2_D_Ld5.f10_f10_musgs.I2000Clm50Cn.cheyenne_gnu.clm-default, because -of #798. Because it's an issue with cime, I'm not marking it as an expected error. - -If the tag used for baseline comparisons was NOT the previous tag, note that here: previous - - -Answer changes --------------- - -Changes answers relative to baseline: No bit-for-bit - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None - -Pull Requests that document the changes (include PR ids): #797 -(https://github.com/ESCOMP/ctsm/pull) - - #797 -- Simple b4b fixes: new params file, remove override_nsrest/anoxia_wtsat, DV deprecated - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev060 -Originator(s): sacks (Bill Sacks) -Date: Thu Aug 29 11:18:20 MDT 2019 -One-line Summary: In SnowWater, truncate small h2osoi residuals - -Purpose of changes ------------------- - -Previously, in the handling of sublimation and evaporation from the snow -pack, if these fluxes led to negative h2osoi_ice or h2osoi_liq, these -negative values would be passed down the snow pack until they found a -layer with a large enough positive state to absorb them. This logic was -going to be a challenge for adding water tracers. - -I have done some tests to verify that these negative values never exceed -roundoff-level in either an absolute or relative sense (with tolerance -of 1.e-13). Specifically, I ran the full aux_clm test suite with the -diffs below and verified that the endrun calls were never triggered. - -So here, I simplify this logic: After truncating any near-zero states to -exactly zero, I check to confirm that the states are never negative. I -then removed the code that passed these negative values down the snow -pack: if they are only roundoff-level negative, then it seems safe to -just throw them away rather than trying to handle them. - -Here were the diffs used to verify that the negative values are never -greater than roundoff-level; these endrun calls were never triggered in -a run of the full aux_clm test suite: - - diff --git a/src/biogeophys/SnowHydrologyMod.F90 b/src/biogeophys/SnowHydrologyMod.F90 - index 3dd555cc..07776123 100644 - --- a/src/biogeophys/SnowHydrologyMod.F90 - +++ b/src/biogeophys/SnowHydrologyMod.F90 - @@ -970,6 +970,8 @@ subroutine SnowWater(bounds, & - real(r8) :: vol_ice(bounds%begc:bounds%endc,-nlevsno+1:0) ! partial volume of ice lens in layer - real(r8) :: eff_porosity(bounds%begc:bounds%endc,-nlevsno+1:0) ! effective porosity = porosity - vol_ice - real(r8) :: mss_liqice(bounds%begc:bounds%endc,-nlevsno+1:0) ! mass of liquid+ice in a layer - + real(r8) :: h2osoi_ice_orig - + real(r8) :: h2osoi_liq_orig - !----------------------------------------------------------------------- - - associate( & - @@ -1017,10 +1019,23 @@ subroutine SnowWater(bounds, & - c = filter_snowc(fc) - l=col%landunit(c) - - + h2osoi_ice_orig = h2osoi_ice(c,snl(c)+1) - + h2osoi_liq_orig = h2osoi_liq(c,snl(c)+1) - + - wgdif = h2osoi_ice(c,snl(c)+1) & - + frac_sno_eff(c) * (qflx_dew_snow(c) - qflx_sub_snow(c)) * dtime - h2osoi_ice(c,snl(c)+1) = wgdif - if (wgdif < 0._r8) then - + if (wgdif < -1.e-13_r8) then - + write(iulog,*) 'WJS: big abs wgdif ice: ', c, wgdif, h2osoi_ice_orig - + call endrun('WJS: big abs wgdif ice') - + end if - + if (h2osoi_ice_orig > 0._r8) then - + if (abs(wgdif / h2osoi_ice_orig) > 1.e-13_r8) then - + write(iulog,*) 'WJS: big rel wgdif ice: ', c, wgdif, h2osoi_ice_orig - + call endrun('WJS: big rel wgdif ice') - + end if - + end if - h2osoi_ice(c,snl(c)+1) = 0._r8 - h2osoi_liq(c,snl(c)+1) = h2osoi_liq(c,snl(c)+1) + wgdif - end if - @@ -1030,6 +1045,16 @@ subroutine SnowWater(bounds, & - - ! if negative, reduce deeper layer's liquid water content sequentially - if(h2osoi_liq(c,snl(c)+1) < 0._r8) then - + if (h2osoi_liq(c,snl(c)+1) < -1.e-13_r8) then - + write(iulog,*) 'WJS: big abs wgdif liq: ', c, h2osoi_liq(c,snl(c)+1), h2osoi_liq_orig - + call endrun('WJS: big abs wgdif liq') - + end if - + if (h2osoi_liq_orig > 0._r8) then - + if (abs(h2osoi_liq(c,snl(c)+1) / h2osoi_liq_orig) > 1.e-13_r8) then - + write(iulog,*) 'WJS: big rel wgdif liq: ', c, h2osoi_liq(c,snl(c)+1), h2osoi_liq_orig - + call endrun('WJS: big rel wgdif liq') - + end if - + end if - do j = snl(c)+1, 1 - wgdif=h2osoi_liq(c,j) - if (wgdif >= 0._r8) exit - -Bugs fixed or introduced ------------------------- - -None - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): -- It's possible that the extra error checks I have added (to ensure we - don't have greater-than-roundoff-level negative residuals) will be - triggered in rare circumstances in a production run, even though they - were never triggered in the test suite. - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none -Although there was a very small increase in total lnd run time, the -timing of hydro_without_drainage actually decreased slightly in the PFS -test relative to the last tag. - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): -- It's possible that the extra error checks I have added (to ensure we - don't have greater-than-roundoff-level negative residuals) will be - triggered in rare circumstances in a production run, even though they - were never triggered in the test suite. - -Changes to tests or testing: none - -Code reviewed by: self - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- ok - hobart ------ ok - - ok means tests passed, some answer changes as expected - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: potentially all, though only show up in - a few tests - - what platforms/compilers: potentially all, though only show up in - a few tests - - nature of change (roundoff; larger than roundoff/same climate; new climate): roundoff - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - First, I did some preliminary analyses as documented above, to - ensure that any negative residuals were no greater than roundoff. - - Second, note that the use of truncate_small_values can only - introduce roundoff-level changes (by truncating values that are - roundoff-level different from zero to exactly zero). - - Third, only a few tests showed answer changes, and these were only - in limited fields, and were fairly small RMS differences: - - ERP_Ly3_P72x2.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-cropMonthOutput - ERS_Ly3.f10_f10_musgs.I1850Clm50BgcCropCmip6.cheyenne_intel.clm-basic - ERS_Ly3_P72x2.f10_f10_musgs.IHistClm50BgcCropG.cheyenne_intel.clm-cropMonthOutput - ERS_Ly5_P144x1.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-cropMonthOutput - - I actually expected more tests to show differences, but most tests - were bit-for-bit. I'm guessing this is because the code added a - roundoff-level term to a larger term, and this ended up not - changing the larger term. - - Finally, as an extra precaution, I ran the test suite twice, on - two different implementations of the truncation: the final one - (which uses truncate_small_values), and one in which I did the - truncation using custom, inline code (commit 0d21ccb5). These two - were bit-for-bit with each other, giving me more confidence that I - didn't make a mistake with either implementation. - - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): none - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev059 -Originator(s): sacks (Bill Sacks) -Date: Sat Aug 24 15:14:06 MDT 2019 -One-line Summary: Continue adding water tracers to LakeHydrology - -Purpose of changes ------------------- - -Finish implementing water tracers for initial snow-related code in -LakeHydrology. This involved refactoring code in order to reuse existing -code in SnowHydrology rather than having near-duplicates of that code in -LakeHydrology. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Resolves ESCOMP/ctsm#775 (Implement water tracers for initial - snow-related code in LakeHydrology) - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none -Many tests took longer, including the PFS test. However, by looking at -more detailed timing numbers in the PFS test, the main increases in time -were in initialization and atm run: lnd run only showed a very small -increase. This suggests that glade slowness was probably primarily -responsible for the increased time. - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: Increased allowed wallclock time for a few tests -These tests took longer, likely due to machine variability. Increasing -their wallclock time to prevent them from timing out. - -Code reviewed by: self - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- pass - hobart ------ pass - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: NO - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): none - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev058 -Originator(s): slevis (Samuel Levis,SLevis Consulting LLC,303-665-1310) -Date: Thu Aug 22 10:02:49 MDT 2019 -One-line Summary: Soil texture interpolation bug-fix - -Purpose of changes ------------------- - - When assigning soil texture values from dataset soil levels to model - soil levels, we should be comparing zsoi (NOT zisoi) in the model with - zisoi on the file, i.e. we should be asking whether the node - center (NOT interface) of a given model level falls between two - interface depths on the file. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): #772 - - -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_0 - -[X] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: - Unexpected failure of test - SMS_D_Ld10.f10_f10_musgs.I2000Clm50BgcCropGs.hobart_nag.clm-tracer_consistency - Bill Sacks did some follow-up testing and concluded that this may be a - compiler-specific issue, so he changed the test from "nag" to "intel" - and generated the new test's corresponding baseline - -Code reviewed by: @billsacks - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - - - tools-tests (test/tools): - - cheyenne - - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - - - regular tests (aux_clm): - - cheyenne ---- OK - hobart ------ OK - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: - - Summarize any changes to answers, i.e., - - what code configurations: not clm45 - - what platforms/compilers: all - - nature of change: larger than roundoff/same climate - based on the assumption that shifting soil texture assignments by - one level in model soil levels below the top-most level should not - generate climate-changing differences. - -Detailed list of changes ------------------------- - 1. Changed zisoi to zsoi as described in the Purpose section above. - This caused the larger than roundoff changes. Before the fix some - model soil levels were getting assigned soil textures from a deeper - soil level in the dataset than they should. - 2. In the same section of code I completed the if-block to address all - zsoi vs. zisoifl comparisons. This ensures explicit assignment of - soil textures for all model soil levels and avoids leaving some - model soil levels with the texture assignment of the previous model - soil level. - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull/788) - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev057 -Originator(s): sacks (Bill Sacks) -Date: Tue Aug 20 13:17:39 MDT 2019 -One-line Summary: Fix frac_sno bugs - -Purpose of changes ------------------- - -Two bug fixes related to frac_sno, and a third change involving -replacing a frac_sno calculation with a simpler equation that is -algebraically equivalent: - -(1) Fix lake frac_sno always being 0 - (https://github.com/ESCOMP/ctsm/issues/783). This fixes the albedo - calculation (and possibly others) over snow-covered lake surfaces. - -(2) Fix threshold for explicit snow pack initiation to use frac_sno_eff, - not frac_sno (https://github.com/ESCOMP/ctsm/issues/785). For - standard runs (which have use_subgrid_fluxes = .true.), this just - changes answers for urban columns. This also changes answers more - widely for runs with use_subgrid_fluxes = .false. - -(3) Rewrite Swenson & Lawrence 2012 frac_sno equation to be more - straightforward and less sensitive to roundoff errors - (https://github.com/ESCOMP/ctsm/issues/784) - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Resolves ESCOMP/ctsm#783 (frac_sno is always 0 for lake points) -- Resolves ESCOMP/ctsm#785 (Threshold for explicit snow pack initiation - should use frac_sno_eff, not frac_sno) -- Resolves ESCOMP/ctsm#784 (Suggested algebraic rework of frac_sno - calculation) - -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_0 - -[X] ctsm5_0-nwp - -[X] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: self - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- ok - hobart ------ ok - - ok means tests pass, answers change as expected - - Ran most testing on 95dad328 (before 8f1263a7, which removes a - temporary endrun error check). Just reran - SMS_Ld5_D_P48x1.f10_f10_musgs.IHistClm50Bgc.hobart_nag.clm-decStart - on the final version. - - There was a memleak for this test: - - FAIL SMS_D_Ld10.f10_f10_musgs.I2000Clm50BgcCropGs.hobart_nag.clm-tracer_consistency MEMLEAK memleak detected, memory went from 1250.830000 to 1518.500000 in 8 days - - I have had memleak issues for this test before - (https://github.com/ESCOMP/ctsm/issues/763), which I have chalked up - to a compiler-specific issue. I have simply increased the tolerance - for memleaks for this test moving forward. - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: all - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Larger than roundoff; expected to be same climate in general, - because the only impacts are on urban and lake points, which - represent a small fraction of most grid cells. However, this needs - further investigation. - - See above (under "Purpose of changes") for a description of the - different answer changes in this tag. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - I verified that change (3) is no greater than roundoff by - temporarily putting in an endrun if the new frac_sno differs from - the old by more than 1e-13; this was not triggered for any test in - the aux_clm test suite. - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A (Keith Oleson will run this) - - URL for LMWG diagnostics output used to validate new climate: N/A (Keith Oleson will run this) - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): none - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev056 -Originator(s): sacks (Bill Sacks) -Date: Fri Aug 16 11:44:43 MDT 2019 -One-line Summary: Start adding water tracers to LakeHydrology, and related refactoring - -Purpose of changes ------------------- - -Start adding water tracers to LakeHydrology, beginning with some initial -things done for snow. - -This also includes some significant refactoring to allow LakeHydrology -to reuse some of the same snow code used for non-lake columns. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Partially addresses ESCOMP/ctsm#775 (Implement water tracers for - initial snow-related code in LakeHydrology) - -Known bugs found since the previous tag (include github issue ID): -The following will be fixed in an upcoming tag: -- ESCOMP/ctsm#783 (frac_sno is always 0 for lake points) -- ESCOMP/ctsm#784 (Suggested algebraic rework of frac_sno calculation) -- ESCOMP/ctsm#785 (Threshold for explicit snow pack initiation should - use frac_sno_eff, not frac_sno) - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: self - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- ok - hobart ------ ok - - ok means tests pass, answers change as expected - - Note: Did most testing on 054dc95b (before the small change in - 7e4e52a9); just ran - LWISO_Ld10.f10_f10_musgs.I2000Clm50BgcCropGs.cheyenne_gnu.clm-coldStart - on the final commit - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: all - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): roundoff - - There are two answer-changes here: - - (1) Roundoff-level changes due to changing some order of operations - for the updating of snow_depth and dz for lakes: The previous - code effectively used (qflx_snow_grnd(c)/bifall(c))*dtime, - whereas the new code uses (qflx_snow_grnd(c)*dtime)/bifall(c); - similarly, the dz update differs. - - (2) A change in FSNO_EFF for lakes: previously, this was set to 0 - when there was no snow. Now this is set consistently with other - landunits, for which it is 1 even if there is no snow. Note that - this only affects the FSNO_EFF diagnostic field, and nothing - else. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - I confirmed that the order-of-operations change is the only - answer-changing part of this tag by comparing against a one-off - from master with the following diffs; this comparison was - bit-for-bit except for changes in the FSNO_EFF diagnostic field: - - diff --git a/src/biogeophys/LakeHydrologyMod.F90 b/src/biogeophys/LakeHydrologyMod.F90 - index 91ddfc79..9711dad7 100644 - --- a/src/biogeophys/LakeHydrologyMod.F90 - +++ b/src/biogeophys/LakeHydrologyMod.F90 - @@ -126,6 +126,8 @@ subroutine LakeHydrology(bounds, & - real(r8) :: heatsum(bounds%begc:bounds%endc) ! used in case above [J/m^2] - real(r8) :: snowmass ! liquid+ice snow mass in a layer [kg/m2] - real(r8) :: snowcap_scl_fct ! temporary factor used to correct for snow capping - + real(r8) :: temp_snow_depth - + real(r8) :: newsnow - real(r8), parameter :: snow_bd = 250._r8 ! assumed snow bulk density (for lakes w/out resolved snow layers) [kg/m^3] - ! Should only be used for frost below. - !----------------------------------------------------------------------- - @@ -246,8 +248,10 @@ subroutine LakeHydrology(bounds, & - ! U.S.Department of Agriculture Forest Service, Project F, - ! Progress Rep. 1, Alta Avalanche Study Center:Snow Layer Densification. - - - dz_snowf = qflx_snow_grnd(c)/bifall(c) - - snow_depth(c) = snow_depth(c) + dz_snowf*dtime - + temp_snow_depth = snow_depth(c) - + newsnow = qflx_snow_grnd(c)*dtime - + snow_depth(c) = snow_depth(c) + newsnow/bifall(c) - + dz_snowf = (snow_depth(c) - temp_snow_depth)/dtime - if (snl(c) == 0) then - h2osno_no_layers(c) = h2osno_no_layers(c) + qflx_snow_grnd(c)*dtime ! snow water equivalent (mm) - else - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): none - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev055 -Originator(s): sacks (Bill Sacks) -Date: Tue Aug 6 14:06:50 MDT 2019 -One-line Summary: Modularize snow cover fraction method - -Purpose of changes ------------------- - -This tag moves the calculation of frac_sno - and the related updates of -snow_depth - into a new set of classes, with one class for each -parameterization (Niu & Yang 2007 and Swenson & Lawrence 2012). - -Previously, the code always calculated frac_sno the new way, but then -possibly overwrote it if using the older Niu & Yang method. The new code -cleans this up, only doing the calculations that are needed for each -method. - -In addition, other code that is specific to one of the two methods is -now moved to a home that makes this dependence on method explicit. This -includes the addition of newsnow to int_snow: previously, int_snow was -always updated using an equation specific to the newer CLM5 -parameterization of frac_sno, which was not appropriate if using the Niu -& Yang parameterization; this doesn't make a difference currently, since -int_snow is only referenced if using the Swenson & Lawrence -parameterization, but this clears up some confusion. Also, time-constant -parameters read from namelist or the netCDF parameter file now reside in -the appropriate class rather than being more global. - -This tag also renames two namelist options to increase clarity: -- subgridflag is renamed to use_subgrid_fluxes, and is now a logical -- oldfflag is renamed to snow_cover_fraction_method, and is now a string - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Resolves ESCOMP/ctsm#502 (oldfflag can NOT be used with - subgridflag==1, and rename subgridflag) -- Resolves ESCOMP/ctsm#503 (Clean up CanopyHydrology) - - This tag does the last piece of cleanup called for in that issue -- Resolves ESCOMP/ctsm#571 (Add a system test: turning on water isotopes - shouldn't change answers) - - This is unrelated to the other changes in this tag - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): -This tag renames two namelist options to increase clarity: -- subgridflag is renamed to use_subgrid_fluxes, and is now a logical -- oldfflag is renamed to snow_cover_fraction_method, and is now a string - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: -- Added a LWISO test, which confirms that turning on water isotopes - doesn't change answers for bulk -- Added a test with the newer snow cover fraction method but - use_subgrid_fluxes false (testmod no_subgrid_fluxes) - -Code reviewed by: Sean Swenson, Erik Kluzek - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - ok - - Tests pass; baseline comparisons not done (baseline comparisons - expected to differ) - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- pass - hobart ------ pass - - Additional tests: Compared both of these against ctsm1.0.dev052 (which - should be bit-for-bit with ctsm1.0.dev054): Both were bit-for-bit: - - ERP_D_P36x2_Ld3.f10_f10_musgs.I2000Clm45BgcCrop.cheyenne_gnu.clm-no_subgrid_fluxes - This is a new test, so did not have baselines; I created baselines - from ctsm1.0.dev052 and compared against those - SMS_Ly3.f10_f10_musgs.I2000Clm45BgcCrop.cheyenne_intel.clm-oldhyd_monthly - This was a temporary test for the sake of running a longer test with - the oldhyd testmod. This testmod was created as a one-off by - changing the current oldhyd testmod to inherit from monthly rather - than default. I ran baselines like this from ctsm1.0.dev052 then ran - this test from this branch and compared against those baselines. - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: NO - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -https://github.com/ESCOMP/ctsm/pull/769 - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev054 -Originator(s): sacks (Bill Sacks) -Date: Fri Aug 2 07:57:51 MDT 2019 -One-line Summary: Fix interpolation of surfdat soil layers so we can use interpolation for 10SL case - -Purpose of changes ------------------- - -Previously, on master, there was special-purpose code for the 10SL case -that avoided doing interpolation from the surface dataset to the soil -variables in the model. It would be cleaner - especially now that we -allow user-defined soil layer structures - if we could use the general -interpolation code always, rather than sometimes having special-purpose -code that avoids doing the interpolation. - -This tag accomplishes that generality. In order to preserve answers for -clm45 cases, I needed to make three changes: - -1. The constant 0.025 needed an _r8 appended to it; otherwise, zisoifl - could differ by roundoff from zisoi. - -2. I changed which level is used when zisoi(lev) is exactly equal to - zisoifl(j) for some j: I changed the conditional in the following: - - if (zisoi(lev) >= zisoifl(j) .AND. zisoi(lev) < zisoifl(j+1)) then - clay = clay3d(g,j+1) - sand = sand3d(g,j+1) - om_frac = organic3d(g,j+1)/organic_max - endif - - to: - - if (zisoi(lev) > zisoifl(j) .AND. zisoi(lev) <= zisoifl(j+1)) then - - Previously, when the zisoi values in the model exactly lined up with - the zisoi values in the file, we would set clay in model level j - equal to the value from level j+1 from the surface dataset (and - similarly for sand and om_frac); in the new code, we use level j from - the surface dataset for model level j in this case. - -3. I changed the way zisoifl is calculated for the lowest layer, so that - it matches zisoi(nlevsoi) when running with 10SL_3.5m. Previously, we - had: - - zisoi(10) = 0.38018819123227207690E+01 - zisoifl(10) = 0.34330930154359391437E+01 - - This tag changes zisoifl(10) to match zisoi(10). - -Bugs fixed or introduced ------------------------- - -Known bugs found since the previous tag (include github issue ID): -- #772: Interpolation of clay, sand and om_frac can use the wrong layer - (points out more fundamental issues with this interpolation of layers - from the surface dataset) - - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: Sam Levis - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- pass - hobart ------ pass - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: NO (but see note below) - - In principle, the changes in this tag could change answers for some - soil layer structures, but there were no answer changes for any of - the cases covered by the test suite. - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -https://github.com/ESCOMP/ctsm/pull/771 - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev053 -Originator(s): slevis (Samuel Levis,SLevis Consulting LLC,303-665-1310) -Date: Thu Aug 1 16:56:09 MDT 2019 -One-line Summary: Soil layer definition clean-up and user-defined option - -Purpose of changes ------------------- - - Code clean-up clarifes that there are two types of soil layer - definition: the node-based and the thickness-based. - - User-defined option allows user to specify a soil layer profile in the - form of a dzsoi vector (values in meters) in the thickness-based - approach. - - Default nlevsoi for NWP configurations had to change from 5 to 4 for - consistency with the new error check described in known bugs below. - - Other code clean-up removes a couple of sections of repeating code. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): #279 #728 - -Known bugs found since the previous tag (include github issue ID): - #759 (this PR) bug causes model to abort when nlevsoi = nlevgrnd; - bug has been corrected with an error check - - -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.] - -[ ] clm5_0 - -[X] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): - if neither soil_layerstruct_predefined nor soil_layerstruct_userdefined - get specified in the namelist, then the model sets - soil_layerstruct_predefined to the old default setting for - soil_layerstruct (clm5: 20SL_8.5m, clm4.5: 10SL_3.5m) - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): - renamed soil_layerstruct to soil_layerstruct_predefined and added - soil_layerstruct_userdefined - -Changes made to namelist defaults (e.g., changed parameter values): - Default nlevsoi for NWP configurations had to change from 5 to 4 for - consistency with the new error check described in known bugs below - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -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 - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: - 1) New test... - ERP_P36x2_D_Ld5.f10_f10_musgs.I2000Ctsm50NwpBgcCropGswpGs.cheyenne_intel.clm-default - replaces existing test - ERS_D_Ld10.f10_f10_musgs.I2000Clm50BgcCropGs.cheyenne_intel.clm-rm_indiv_lunits_and_collapse_to_dom - to check the correction described in known bugs above; the new test - together with existing unit tests cover what the old test was testing - - 2) New test and new test type... - SOILSTRUCTUD_Ld5.f10_f10_musgs.I2000Clm50BgcCropGs.cheyenne_intel.clm-default - ensures that soil_layerstruct_userdefined gives bfb same answers as - soil_layerstruct_predefined = '4SL_2m' when set with the same dzsoi - values. The new test type was put together by: - - listing the test in (1) testlist_clm.xml (as all tests) and (2) config_tests.xml - - creating the file .../cime_config/SystemTests/soilstructud.py named after the test in lower case - -Code reviewed by: @billsacks - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - - - tools-tests (test/tools): - - cheyenne - - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - - - regular tests (aux_clm): - - cheyenne ---- OK - hobart ------ OK - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: YES (just for NWP configurations) - - Summarize any changes to answers, i.e., - - what code configurations: nwp - - what platforms/compilers: all - - nature of change: larger than roundoff/same climate - This is due to the change of nlevsoi from 5 to 4 (more info above). - I confirmed that nwp does return bfb same answers when I revert this - change. - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): - https://github.com/ESCOMP/ctsm/pull/759 - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev052 -Originator(s): sacks (Bill Sacks) -Date: Mon Jul 22 14:02:43 MDT 2019 -One-line Summary: Fix rare soil color bug in mksurfdata_map - -Purpose of changes ------------------- - -Under rare conditions, mksurfdata_map could put the default soil color -in an output cell where there is actually more information. This tag -fixes that issue. None of the out-of-the-box surface datasets are -impacted by this bug, so I have not recreated any surface datasets. (I -checked all out-of-the-box surface datasets except for -surfdata_0.125x0.125_mp24_simyr2000_c150114.nc, because it doesn't get -remade cleanly out of the box.) - -Also: - -- Add some unit tests for the creation of soil color in mksurfdata_map - -- Point to correct (existing) surface dataset for year-1850 at f05 - resolution - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Resolves ESCOMP/ctsm#4 (Minor bug in creation of soil color in - mksurfdata_map: points can be given the default soil color, when they - should have a real color) -- Resolves ESCOMP/ctsm#765 (Year-1850 f05 surface dataset missing from - inputdata repository) - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): -- Year-1850 f05 surface dataset now points to a file that actually exists - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - -Changes to tests or testing: none - -Code reviewed by: self - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - ok - - Most tests pass, including baseline comparisons. The following tests fail, but also failed for me on master: - - 019 smiS4 TSMscript_tools.sh ncl_scripts getregional_datasets.pl getregional ....................\c - rc=6 FAIL - 020 bliS4 TBLscript_tools.sh ncl_scripts getregional_datasets.pl getregional ....................\c - rc=4 FAIL - 027 smf84 TSMscript_tools.sh PTCLM PTCLMmkdata PTCLM_USUMB_clm4_5^buildtools ....................\c - rc=6 FAIL - 028 blf84 TBLscript_tools.sh PTCLM PTCLMmkdata PTCLM_USUMB_clm4_5^buildtools ....................\c - rc=4 FAIL - 029 smfc4 TSMscript_tools.sh PTCLM PTCLMmkdata PTCLM_USUMB_Cycle_clm4_5^buildtools ..............\c - rc=6 FAIL - 030 blfc4 TBLscript_tools.sh PTCLM PTCLMmkdata PTCLM_USUMB_Cycle_clm4_5^buildtools ..............\c - rc=4 FAIL - 031 smfg4 TSMscript_tools.sh PTCLM PTCLMmkdata PTCLM_USUMB_Global_clm4_5^buildtools .............\c - rc=6 FAIL - 032 blfg4 TBLscript_tools.sh PTCLM PTCLMmkdata PTCLM_USUMB_Global_clm4_5^buildtools .............\c - rc=4 FAIL - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- not run - hobart ------ not run - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: NO - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): none - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev051 -Originator(s): sacks (Bill Sacks) -Date: Fri Jul 19 13:26:25 MDT 2019 -One-line Summary: Update water tracers for remainder of first stage of hydrology - -Purpose of changes ------------------- - -Main change is to do tracer updates for final pieces of first stage of -hydrology: HandleNewSnow and UpdateFracH2oSfc. Along with this, I have -introduced greater modularity into these routines (breaking the -operations down into more granular steps). - -Other changes included here (somewhat related to the main changes) are: - -- Added a routine that resets checked tracers to bulk*ratio to allow - running the tracer consistency check for more than one time step; we - now run it for 10 days - -- Change logic for rain-snow conversion terms: Use rain diff in rain to - snow, snow diff in snow to rain. This is less sensitive to roundoff - errors, and was needed in order to get the 10-day tracer consistency - test to pass. - -- Setting of qflx_snow_h2osfc moved to CanopyInterceptionAndThroughfall - -- Add col%lun_itype. col%lun_itype(ci) is the same as - lun%itype(col%landunit(ci)), but is often a more convenient way to - access this type. I got tired of having to get the landunit index just - for the sake of getting the landunit's type of a given column. I have - NOT gone through the code and replaced lun%itype(l) with - col%lun_itype(c) where applicable, but this will be useful for the - future. - -- Removed unnecessary code for backwards compatibility of FH2OSFC from - restart files - -- Point to slightly modified initial conditions files for two CLm45 - initial conditions files. These two had FH2OSFC > 0 for some glc_mec - points. I'm not sure how that came to be, but Sean Swenson and I think - that shouldn't be the case. This caused soil balance errors in these - tests: - - ERS_Ly5_P72x1.f10_f10_musgs.IHistClm45BgcCrop.cheyenne_intel.clm-cropMonthOutput - SMS_D_Ld1.f09_g17.I1850Clm45BgcCruGs.cheyenne_intel.clm-default - - I'm fixing the problem by pointing to updated files with FH2OSFC set - to 0 for special landunits, using the following python: - - ctypel = dat.variables['cols1d_ityplun'][:] - dat.variables['FH2OSFC'][ctypel > 2] = 0 - -- Small cime update to fix the SHAREDLIBBUILD phase of - ERS_D_Ln9_P480x3.f19_g16.I2000Clm50SpGs.cheyenne_intel.clm-waccmx_offline - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Resolves ESCOMP/ctsm#718 (Implement water tracers for HandleNewSnow - and FracH2oSfc) -- Resolves ESCOMP/ctsm#498 (Do tracer consistency checks every time - step, not just first) - -CIME Issues fixed (include issue #): -- ESCMI/cime#3717 (Cheyenne ESMF missing for WACCM X) - -Known bugs introduced in this tag (include github issue ID): -- ESCOMP/ctsm#762 (Water tracers: Make sure calls to ResetCheckedTracers - are removed) - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): -- If you have an initial conditions file with non-zero FH2OSFC for - glacier (this was the case for some out-of-the-box clm45 files, which - are now fixed), may run into soil balance errors. To fix this, set - FH2OSFC to 0 in your restart file for all special landunits. - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): -- Point to slightly modified initial conditions files for two CLm45 - initial conditions files: see above for details. - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: -- Changed tracer consistency test to 10 days rather than a single time step - -Code reviewed by: self - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- ok - hobart ------ ok - - ok means tests pass, some roundoff-level diffs in baseline - comparisons, as noted below - - Also, in order to have a more powerful test of the changes in - SurfaceWaterMod (since the relevant code isn't triggered very often), - I introduced the following diffs: - - diff --git a/src/biogeophys/SurfaceWaterMod.F90 b/src/biogeophys/SurfaceWaterMod.F90 - index 1bc03cae..be656a15 100644 - --- a/src/biogeophys/SurfaceWaterMod.F90 - +++ b/src/biogeophys/SurfaceWaterMod.F90 - @@ -12,6 +12,7 @@ module SurfaceWaterMod - use shr_spfn_mod , only : erf => shr_spfn_erf - use clm_varcon , only : denh2o, denice, roverg, wimp, tfrz, pc, mu, rpi - use clm_varpar , only : nlevsno, nlevgrnd - + use clm_varctl , only : iulog - use clm_time_manager , only : get_step_size - use column_varcon , only : icol_roof, icol_road_imperv, icol_sunwall, icol_shadewall, icol_road_perv - use decompMod , only : bounds_type - @@ -201,7 +202,7 @@ subroutine BulkDiag_FracH2oSfc(bounds, num_soilc, filter_soilc, & - SHR_ASSERT_FL((ubound(qflx_too_small_h2osfc_to_soil, 1) == bounds%endc), sourcefile, __LINE__) - - ! arbitrary lower limit on h2osfc for safer numerics... - - min_h2osfc=1.e-8_r8 - + min_h2osfc=1.e0_r8 - - do f = 1, num_soilc - c = filter_soilc(f) - @@ -230,6 +231,9 @@ subroutine BulkDiag_FracH2oSfc(bounds, num_soilc, filter_soilc, & - - else - frac_h2osfc(c) = 0._r8 - + if (h2osfc(c) > 0._r8) then - + write(iulog,*) 'WJS: in else' - + end if - qflx_too_small_h2osfc_to_soil(c) = h2osfc(c) / dtime - ! The update of h2osfc is deferred to later, keeping with our standard - ! separation of flux calculations from state updates, and because the state - - With those diffs, I ran the tracer consistency test; it passed. In - addition, I ran - SMS_D_Ld1_P4x1.f10_f10_musgs.I2000Clm50BgcCropQianRsGs.bishorn_gnu.clm-default - with comparison against master, with the following diffs on master - (the first change changes behavior to force the relevant code to be - triggered, and is the same on master and on the branch; the second - change on master divides then multiplies by dtime to avoid - roundoff-level diffs): - - diff --git a/src/biogeophys/SurfaceWaterMod.F90 b/src/biogeophys/SurfaceWaterMod.F90 - index 959d539b..4a4a4824 100644 - --- a/src/biogeophys/SurfaceWaterMod.F90 - +++ b/src/biogeophys/SurfaceWaterMod.F90 - @@ -77,7 +77,7 @@ subroutine FracH2oSfc(bounds, num_nolakec, filter_nolakec, & - ) - - ! arbitrary lower limit on h2osfc for safer numerics... - - min_h2osfc=1.e-8_r8 - + min_h2osfc=1.e0_r8 - - call waterstatebulk_inst%CalculateTotalH2osno(bounds, num_nolakec, filter_nolakec, & - caller = 'FracH2oSfc', & - @@ -112,7 +112,7 @@ subroutine FracH2oSfc(bounds, num_nolakec, filter_nolakec, & - - else - frac_h2osfc(c) = 0._r8 - - h2osoi_liq(c,1) = h2osoi_liq(c,1) + h2osfc(c) - + h2osoi_liq(c,1) = h2osoi_liq(c,1) + (h2osfc(c) / get_step_size()) * get_step_size() - h2osfc(c)=0._r8 - endif - - This test passed and was bit-for-bit with master with the above changes. - - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: Many/all - - what platforms/compilers: All - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Roundoff: just roundoff-level changes in FSH_PRECIP_CONVERSION, - FSH_TO_COUPLER, l2x_Fall_sen due to refactored calculation of - FSH_PRECIP_CONVERSION - - If bitwise differences were observed, how did you show they were no worse - than roundoff? via summarize_cprnc_diffs - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): -- cime: branch_tags/cime5.8.3_chint17-03 -> branch_tags/cime5.8.3_chint17-04 - Fixes ESMCI/cime#3171 - -Pull Requests that document the changes (include PR ids): none - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev050 -Originator(s): slevis (Samuel Levis,SLevisConsulting LLC,303-665-1310) -Date: Mon Jul 15 11:40:09 MDT 2019 -One-line Summary: dz --> dz_lake bug-fix in LakeTemperatureMod.F90 line 960 - -Purpose of changes ------------------- - - Bug-fix to prevent the model from aborting when running with fewer soil - layers than lake layers; not to imply that this was not a bug when the - model wasn't aborting. It was. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): #760 - -Known bugs found since the previous tag (include github issue ID): #759 bug causing model to abort when nlevsoi = nlevgrnd - - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -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 - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: @dlawrenncar @billsacks - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - - - tools-tests (test/tools): - - cheyenne - - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - - - regular tests (aux_clm): - - cheyenne ---- OK - hobart ------ OK - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: - - Summarize any changes to answers, i.e., - - what code configurations: use_lch4 = .true. - - what platforms/compilers: all - - nature of change: diagnostic variable WTGQ only - Confirmed this on cheynne and hobart by running - ./summarize_cprnc_diffs -baseline .../tests_0712... -testid '*' - and inspecting the file cprnc.summary.*.by_varname - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): - https://github.com/ESCOMP/ctsm/pull/761 - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev049 -Originator(s): erik (Erik Kluzek) -Date: Sun Jun 23 20:56:55 MDT 2019 -One-line Summary: Update mosart and intel to intel-19 on cheyenne - -Purpose of changes ------------------- - -Update mosart to trunk tag (that has a roundoff change to history file -output). And update intel compiler on cheyenne to intel-19. - -Bugs fixed or introduced None ------------------------- - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: [For timing changes, can check PFS test(s) in the test suite] None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: None - -Code reviewed by: self - -CTSM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - regular tests (aux_clm): - - cheyenne ---- OK - hobart ------ OK - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: Yes - - Summarize any changes to answers, i.e., - - what code configurations: some compsets with mosart - - what platforms/compilers: cheyenne/intel - - nature of change: roundoff - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cime, and mosart - mosart to mosart1_0_33 - cime to branch_tags/cime5.8.3_chint17-03 - -Pull Requests that document the changes (include PR ids): #753 -(https://github.com/ESCOMP/ctsm/pull) - #753 -- Update cheyenne to intel/19 and update mosart - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev048 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Sun Jun 23 15:16:01 MDT 2019 -One-line Summary: Updates for buildlib changes and cime and externals updates - -Purpose of changes ------------------- - -Update of most externals: cime, mosart, rtm, cism. The cime update also includes a required CESM-wide -change in buildlib. Uses a function to get the Macros filename "get_standard_makefile_args". -The cime update brought in some answer chagnes, with an update of the intel compiler (but we backed those -out by using a cime branch). There is also a roundoff change by going to the trunk version of RTM. - -Bugs fixed or introduced None ------------------------- - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: None - -Code reviewed by: @jedwards, self - - -CTSM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - tools-tests (test/tools): - - cheyenne - PASS - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - PASS - - python testing (see instructions in python/README.md; document testing done): - - cheyenne - PASS (for python3) - - regular tests (aux_clm): - - cheyenne ---- OK - hobart ------ OK - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: Yes, but only for a few cases (compsets with RTM) - - Summarize any changes to answers, i.e., - - what code configurations: With RTM - - what platforms/compilers: All - - nature of change: roundoff - fieldlist is different for CISM in some cases - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cime, mosart, rtm, cism - cime to branch_tags/cime5.8.3_chint17-02 - cism to cism2_0_68 - rtm to rtm1_0_68 - mosart to nldas-grid.n02_mosart1_0_31 - -Pull Requests that document the changes (include PR ids): #752 -(https://github.com/ESCOMP/ctsm/pull) - - #752 -- buildlib, cime and externals update - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev047 -Originator(s): sacks (Bill Sacks) -Date: Sun Jun 16 13:04:38 MDT 2019 -One-line Summary: Fix negative snow compaction during snow melt - -Purpose of changes ------------------- - -Fix an issue reported by @kjetilaas: In the presence of surface water, -the old and new snow cover fractions are inconsistently calculated in -subroutine "SnowCompaction". This can result in significant negative -compaction (snow depth increase) during snow melt. - -More details from @kjetilaas (copied from -https://github.com/escomp/ctsm/issues/573): - -There is an inconsistency in the calculation of snow cover fraction -(FSNO) in the SnowCompaction subroutine when there is surface water -present. The actual snow cover is limited to 0.99 when surface water is -present (and the surface water fraction is set to 0.01). However, -SnowCompaction recalculates the old FSNO without accounting for this -limitation. This results in an apparent decrease in FSNO, and -corresponding negative snow compaction from snow melt (ddz3). - -This can result in substantial, artificial increase in snow depth during -summer (can be more than 0.5 m during a single season). - -The problem might be masked in monthly output, but could be significant -whenever snow cover is close to 1 and surface water present. Snow mass -is indirectly affected by this as radiation and temperature fluxes in -the snow pack will be affected by artificially thick snow layers. - -This tag fixes this issue. The fix was implemented and tested by -@swensosc (Sean Swenson). - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Resolves ESCOMP/ctsm#573 (Snow depth increase due to inconsistent snow - cover fraction calculation) - - -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_0 - -[X] ctsm5_0-nwp - -[X] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: Sean Swenson, @kjetilaas, Bill Sacks - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- ok - hobart ------ ok - - ok means tests pass, answers change as expected - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: all - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Larger than roundoff/same climate - - Sean Swenson ran the LMWG diagnostics package and looked at the - results with Keith Oleson. Their main findings were: - - - Snow depth is a bit smaller over Greenland and polar regions on - average, as expected (up to 5-10% decrease in average snow depth - averaged over the Canadian Arctic) - - - There is a small increase in h2osno over Greenland: about 30 mm - averaged over Greenland; it looks like the main changes are - around the coasts (which makes sense given that this bug only - affects vegetated landunits) - - - There are small changes in runoff over Greenland - - - Changes in snow cover fraction are tiny - - - Overall, this doesn't look climate changing, but could - potentially have a significant impact on select grid cells, and - on some variables in polar regions - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): none - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev046 -Originator(s): sacks (Bill Sacks) -Date: Sat Jun 15 15:54:44 MDT 2019 -One-line Summary: Separate the two uses of h2osno - -Purpose of changes ------------------- - -Until now, h2osno has been used in two ways: - -1. When there are explicit snow layers, h2osno is the sum of snow - (liquid + ice) in all layers - -2. When there is a little bit of snow, but not enough to create a snow - layer, h2osno gives the amount of this very thin snow pack (assumed - to be all ice) - -This is confusing and complicates the addition of water tracers to the -code. This tag separates h2osno into two different variables: - -1. h2osno_no_layers is a fundamental state variable that gives the - amount of snow in the case where we don't have explicit snow layers - -2. h2osno_total is purely a diagnostic variable that is the sum of snow - in all explicit layers, plus h2osno_unresolved. This exists in - waterdiagnosticbulk_type, but the version there is just set once at - the end of the time step, so that version is only meant for - diagnostic (history) output. Code that needs the current sum of - h2osno at a given point now computes it locally, via a new method on - waterstate_type: CalculateTotalH2osno. If running in debug mode, that - routine also performs some consistency checks. - -Also, an unrelated change to prevent user from trying to interpolate a -file onto itself. - -Also, add a compset for testing, which is good for use on my mac. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Resolves ESCOMP/ctsm#733 (Make h2osno purely a diagnostic variable) -- Resolves ESCOMP/ctsm#749 (h2osno inconsistent when interpolating from - initial conditions with different snow layers) -- Resolves ESCOMP/ctsm#750 (Prevent user from trying to use the same - filename for init_interp source and destination files) - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none (possibly a small improvement -in timing based on PFS run time) - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: self - - -CTSM testing: - - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- ok - hobart ------ ok - - ok means tests pass; baseline comparisons fail as expected - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: all - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Mostly roundoff; greater than roundoff/same climate for cases for - which number of snow layers is less in the case than in its - initial conditions file, due to fixing #749 - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - There was one point where h2osno_total differed from the old h2osno - by roundoff, as verified by a run of the test suite (where I verified - that (a) it only differed by 1e-11 or less, and (b) if I reset it, - there were just roundoff-level changes in a few diagnostic - fields). That one place with roundoff-level diffs can lead to - propagation of diffs, causing differences in many fields in the final - run of the test suite. In particular: I ran the test suite on - 69823de4 (which had this temporary check and reset of h2osno_total - vs. old h2osno). For nearly all tests, there were only roundoff-level - changes in a few diagnostic fields. I then removed the temporary - check and reset and ran the test suite on the result - (4353cc90). Finally, I ran the test suite on the final, cleaned-up - code, with comparison against 4353cc90 and verified bfb. - - In my testing on 69823de4: There were a few tests with greater than - roundoff-level changes due just to differences in the initial value - of h2osno_total (which was incorrect in the old due to #749). I - verified that these only had roundoff-level changes in a few - diagnostic fields if I used the following diffs in both the baseline - and my branch, indicating that the diffs just arose due to the fix of - #749: - - diff --git a/src/main/clm_initializeMod.F90 b/src/main/clm_initializeMod.F90 - index 793b36ac..f10ee5e1 100644 - --- a/src/main/clm_initializeMod.F90 - +++ b/src/main/clm_initializeMod.F90 - @@ -762,6 +762,18 @@ subroutine initialize2( ) - !$OMP END PARALLEL DO - end if - + do c = bounds_proc%begc, bounds_proc%endc - + if (col%snl(c) < 0) then - + water_inst%waterstatebulk_inst%h2osno_col(c) = 0._r8 - + do j = col%snl(c)+1, 0 - + water_inst%waterstatebulk_inst%h2osno_col(c) = & - + water_inst%waterstatebulk_inst%h2osno_col(c) + & - + water_inst%waterstatebulk_inst%h2osoi_ice_col(c,j) + & - + water_inst%waterstatebulk_inst%h2osoi_liq_col(c,j) - + end do - + end if - + end do - + - end subroutine initialize2 - end module clm_initializeMod - - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: n/a - - URL for LMWG diagnostics output used to validate new climate: n/a - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): none - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev045 -Originator(s): sacks (Bill Sacks) -Date: Thu Jun 6 12:26:57 MDT 2019 -One-line Summary: Recalculate h2osno for the sake of SnowCapping - -Purpose of changes ------------------- - -SnowCapping decides whether to remove excess snow based on -h2osno. However, at the point where this is called,h2osno is out of sync -with (h2osoi_liq + h2osoi_ice): Those variables can be changed slightly -in SnowWater (which is called before SnowCapping), yet h2osno isn't -recalculated based on those changes. - -I don't think this causes a big problem in practice, but it seems like -it would improve code understandability if we had the general rule that -any code that references h2osno is using a version of h2osno that is in -sync with (h2osoi_liq + h2osoi_ice). This is also needed to prevent -answer changes in an upcoming major refactor. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Resolves ESCOMP/ctsm#736 - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: Sean Swenson signed off on the change, but didn't -review the final code - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - not run - - regular tests (aux_clm): - - cheyenne ---- ok - hobart ------ ok - - ok means tests pass, answers change as expected - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: all - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Larger than roundoff/same climate - - Answer changes are expected to be small, since this should just - change the timing of snow capping a bit, but I haven't looked - closely at the magnitude of the answer changes. - - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): none - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev044 -Originator(s): sacks (Bill Sacks) -Date: Thu Jun 6 12:14:39 MDT 2019 -One-line Summary: Make wetland snow resetting behavior more explicit - -Purpose of changes ------------------- - -There is some code that zeroes out h2osno over thawed wetlands. It seems -like the intended behavior here is to zero out the entire snow -pack. Currently, however, this only zeros out a very thin (zero-layer) -snow pack. For now, I'm adding an snl==0 conditional to make this -behavior explicit; long-term, we'd like to change this to actually zero -out the whole snow pack. (At that time, this code block should probably -be moved to a more appropriate home, as noted in comments in issue -ESCOMP/ctsm#735.) - -Also, unrelated change in run_sys_tests: support machine-specific -baseline directory, in order to support new default location for CTSM -baselines on cheyenne. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Partially addresses, but does NOT fix, ESCOMP/ctsm#735 - -Known bugs introduced in this tag (include github issue ID): -- Partially addresses, but does NOT fix, ESCOMP/ctsm#735 - - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: Sean Swenson and Keith Oleson approved this change, -though didn't actually review the final code. - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - python testing (see instructions in python/README.md; document testing done): - - (any machine) - pass on cgdm-bishorn - make python=python2 test - make pyhton=python3 test - make lint - - regular tests (aux_clm): - - cheyenne ---- pass - hobart ------ pass - - Also ran SMS_Ly1.f09_g17.I2000Clm50SpGs.cheyenne_intel.clm-monthly - with comparison against baselines: passed and bit-for-bit. - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: NO (but see notes below) - - It seems theoretically possible for this to change answers, but no - answer changes were observed in the aux_clm test suite or - SMS_Ly1.f09_g17.I2000Clm50SpGs.cheyenne_intel.clm-monthly. - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): none - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev043 -Originator(s): erik (Erik Kluzek) -Date: Wed Jun 5 10:17:06 MDT 2019 -One-line Summary: Fix FUN bug (frac_ideal_C_use was backwards in regard to delta_CN), and replace Ball-Berry mbbopt with the CLM4.5 version - -Purpose of changes ------------------- - -Carbon allocation to uptake responds to CN(uptake-cost) and CN(actual). The intended implementation is: For C:N -less than the target C:N, C allocation is reduced with cost. For C:N greater than the target C:N, C allocation -is increased with high C:N. However, the actual implementation is reversed. This change fixes that problem. - -Also the Ball-Berry mbbopt values had been changed in the creation of CLM5.0, as part of the tuning, but the new -values don't work well (as our final tuning uses Medlyn photosynshesis rather than Ball-Berry). This brings the values -for Ball-Berry for CLM5.0 back to the CLM4.5 values. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): #704 #705 - - Fixes #705 -- Ball-Berry parameters in CLM5.0 should go back to the previous values in CLM4.5 - Fixes #704 -- FUN code logic to reduce or increase carbon allocation used for uptake is reversed - -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_0 - -[X] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): New clm5.0 paramdata file - -Changes to the datasets (e.g., parameter, surface or initial files): mbbopt now use the clm4_5 values - rather than the pretuned clm5_0 values (before Medlyn was being used) - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: None - -Code reviewed by: self, olyson - - -CTSM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS (134 tests are different from baseline as expected) - - regular tests (aux_clm): - - cheyenne ---- OK - hobart ------ OK - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: Yes! - - Summarize any changes to answers, i.e., - - what code configurations: Anything with use_FUN=T (so Clm50Bgc compsets) - Also with Clm5.0 and Ball-Berry (stomatalcond_method='Ball-Berry1987') (so Clm50Nwp compsets) - - what platforms/compilers: All - - nature of change: climate is similar - - "Our assessment is that the impact is relatively small, but would affect climate; - however it doesn’t appear to strongly affect transient C response." - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - Experiments were done on the release branch - - casename: oleson/clm50_release-clm5.0.15_delta_CN_FUNbug_2deg_GSWP3V1_1850 - oleson/clm50_release-clm5.0.15_delta_CN_FUNbug_2deg_GSWP3V1_hist - - URL for LMWG diagnostics output used to validate new climate: - -http://webext.cgd.ucar.edu/I1850/clm50_release-clm5.0.15_delta_CN_FUNbug_2deg_GSWP3V1_1850/lnd/clm50_release-clm5.0.15_delta_CN_FUNbug_2deg_GSWP3V1_1850.21_40-clm50_release-clm5.0.15_2deg_GSWP3V1_1850.21_40/setsIndex.html - -We've also completed a historical run. Diagnostics are here: - -http://webext.cgd.ucar.edu/I20TR/clm50_release-clm5.0.15_delta_CN_FUNbug_2deg_GSWP3V1_hist/lnd/clm50_release-clm5.0.15_delta_CN_FUNbug_2deg_GSWP3V1_hist.1995_2014-clm50_release-clm5.0.15_2deg_GSWP3V1_hist.1995_2014/setsIndex.html - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None - -Pull Requests that document the changes (include PR ids): #727 -(https://github.com/ESCOMP/ctsm/pull) - - #727 -- Fix the FUN bug, where an if statement was backwards - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev042 -Originator(s): slevis (Samuel Levis,SLevis Consulting LLC,303-665-1310) -Date: Tue May 21 23:29:31 MDT 2019 -One-line Summary: Rename, correct, and simplify parameters dewmx and sno_stor_max - -Purpose of changes ------------------- - - To rename - dewmx to liq_canopy_storage_scalar - sno_stor_max to sno_canopy_storage_scalar - in the code and in the clm45 and clm50 param files. - - To change snocanmx, liqcanmx, and fcansno to... - snocanmx = params_inst%snow_canopy_storage_scalar(p) * (elai(p) + esai(p)) - liqcanmx = params_inst%liq_canopy_storage_scalar(p) * (elai(p) + esai(p)) - fcansno(p) = (snocan(p) / (vegt * params_inst%sno_stor_max))**0.15_r8 - - Rewrote fwet(p) to follow the same format as fcansno(p). - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): #710 - Fixes #710 -- rename dewmx - - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): New default parameter file - -Changes to the datasets (e.g., parameter, surface or initial files): - Pointing to new clm45 and clm50 param files containing the two renamed - parameters listed above. - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: None - -Code reviewed by: - @billsacks - -CTSM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS (196 different because of new param file) - - regular tests (aux_clm): - - cheyenne ---- OK - hobart ------ OK - Roundoff changes were expected. - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: Yes! - - Summarize any changes to answers, i.e., - - what code configurations: ALL - - what platforms/compilers: ALL - - nature of change: roundoff - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - The code modifications causing the change were of the order-of-calculations - type in two lines of code. - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None - -Pull Requests that document the changes (include PR ids): - https://github.com/ESCOMP/ctsm/pull/719 - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev041 -Originator(s): sacks (Bill Sacks) -Date: Fri May 17 06:02:38 MDT 2019 -One-line Summary: Add water tracers to CanopyHydrologyMod - -Purpose of changes ------------------- - -Major overhaul of CanopyHydrologyMod in order to support water tracers. - -The part of CanopyHydrology that was actually dealing with canopy -hydrology has now been broken out into a number of small routines in -order to separate flux calculations from state updates. This is needed -in order to calculate tracer versions of the relevant variables, which -is now done here. - -The parts of CanopyHydrology that were NOT dealing with canopy hydrology -have been moved to more appropriate homes. They have not yet been -tracerized, but will be soon. - -This also makes some minor changes to diagnostic fields related to -canopy hydrology. Of particular note: QDRIP now has a different meaning: -it now corresponds to the excess liquid water that runs off from the -canopy (and is inactive by default). - -The design of this broken-out code was developed in consultation with -Mike Barlage, Erik Kluzek, Negin Sobhani, Sean Swenson and Mariana -Vertenstein. We plan to apply this design moving forward to other parts -of the code that need tracerization. See also -. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Resolves ESCOMP/ctsm#360 - Implement water isotopes for - CanopyHydrology -- Resolves ESCOMP/ctsm#709 - QDRIP diagnostic field misleadingly named -- Partially addresses ESCOMP/ctsm#503 - Clean up CanopyHydrology - (We still need to clean up / tracerize the parts that have now been - moved elsewhere.) - - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): -- Changed meaning of QDRIP diagnostic field: it now corresponds to - qflx_liqcanfall rather than qflx_prec_grnd_patch, and is default - inactive. (There is no longer a diagnostic field corresponding to - qflx_prec_grnd_patch, but there are separate diagnostic fields for the - rain and snow portions of this, both default inactive.) - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none -- checked timing of hydro1 timer vs. previous canhydro timer from my - dev039 testing: differences are negligible - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: -- Design reviewed by Mike Barlage, Erik Kluzek, Negin Sobhani, Sean - Swenson and Mariana Vertenstein -- Final code reviewed only by self - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne ---- ok - hobart ------ ok - - ok means tests pass, baseline comparisons fail as expected - -If the tag used for baseline comparisons was NOT the previous tag, note that here: - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: all - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - roundoff - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - Ensured no-greater-than-roundoff-level by: - - First, generated baselines using code with these diffs (note extra - parentheses in multiplication): - - diff --git a/src/biogeophys/CanopyHydrologyMod.F90 b/src/biogeophys/CanopyHydrologyMod.F90 - index f848f520..31c8c550 100644 - --- a/src/biogeophys/CanopyHydrologyMod.F90 - +++ b/src/biogeophys/CanopyHydrologyMod.F90 - @@ -338,8 +338,8 @@ subroutine CanopyHydrology(bounds, & - ! Intercepted precipitation [mm/s] - qflx_prec_intr(p) = forc_snow(c)*fpisnow + qflx_liq_above_canopy(p)*fpi - ! storage of intercepted snowfall, rain, and dew - - snocan(p) = max(0._r8, snocan(p) + dtime*forc_snow(c)*fpisnow) - - liqcan(p) = max(0._r8, liqcan(p) + dtime*qflx_liq_above_canopy(p)*fpi) - + snocan(p) = max(0._r8, snocan(p) + dtime*(forc_snow(c)*fpisnow)) - + liqcan(p) = max(0._r8, liqcan(p) + dtime*(qflx_liq_above_canopy(p)*fpi)) - - ! Initialize rate of canopy runoff and snow falling off canopy - qflx_snocanfall(p) = 0._r8 - - - Then ran test suite on 1cc9d38a. This is very close to the final - branch, but had a few small tweaks in place to get bit-for-bit: - - 1. Under some conditions, the final branch code resets slightly - negative snocan and liqcan to 0, where master did not. This - commit puts in place temporary code to maintain the slightly - negative values under these conditions, along with a check to - ensure that the values are really always only slightly negative - in this situation. - - 2. When snocan > snocanmx, master reset snocan to exactly snocanmx, - whereas the final branch code can result in snocan being - roundoff-level different from snocanmx, and similar for - liqcan. This commit puts in place temporary code to set snocan - to snocanmx under appropriate circumstances, and liqcan to - liqcanmx, along with a check to ensure that this is only leading - to roundoff-level changes in these state variables. - - 3. Multiplies then divides a flux by dtime in one place - - 4. Has parentheses around a partial sum to ensure same order of - operations as before - - This was bfb with the baselines generated with the diff noted - above, except for roundoff-level changes in SNOCAN in one grid cell - in just one test - (SMS_D_Ld1.f19_g17.I1850Clm45Cn.hobart_gnu.clm-default; old: - -8.15e-322, new: -2e-323). - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -None. But see -https://github.com/billsacks/prototypes-ctsm-canopyhydrology_tracers, -which was the source of our design discussions and contains notes from -these discussions. - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev040 -Originator(s): slevis (Samuel Levis,SLevis Consulting LLC,303-665-1310) -Date: Fri May 03 10:34:46 MDT 2019 -One-line Summary: Move some hard-coded parameters from code to params.nc file - -Purpose of changes ------------------- - - Reduce the number of parameters that get hardwired directly in the code - by placing in the params.nc file where they become visible and easier - to modify. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): #680 - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users: - None - -Changes to CTSM's user interface: - Parameters that were hardwired in the code can now be seen and changed - in the params.nc file. - -Changes made to namelist defaults (e.g., changed parameter values): - None - -Changes to the datasets (e.g., parameter, surface or initial files): - Various parameters have moved out of the code and into the params.nc file. - -Substantial timing or memory changes: [For timing changes, can check PFS test(s) in the test suite] - -Notes of particular relevance for developers: - None ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - None - -Changes to tests or testing: - None - -Code reviewed by: - @ekluzek - @billsacks - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - - - tools-tests (test/tools): - - cheyenne - - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - - - regular tests (aux_clm): - - cheyenne ---- OK - hobart ------ OK - Answers change as expected. - -CTSM tag used for the baseline comparisons: - ctsm1.0.dev039 - -Answer changes --------------- - -Changes answers relative to baseline: YES - Summarize any changes to answers, i.e., - - what code configurations: ALL - - what platforms/compilers: ALL - - nature of change: single-precision roundoff - Changes are due to four parameters: - accum_factor - ko25_coef - kc25_coef - frac_sat_soil_dsl_init - that were not declared "_r8" when hardwired in the code, - while now they are declared "double" in the params.nc files. I - showed that the change was no greater than single-precision roundoff - by writing the new and old values to the lnd and cesm log files and - confirming differences smaller than 1.e-6. - -Detailed list of changes ------------------------- - - - Updated the clm5 and clm4.5 params.nc files to contain the previously - hard-coded parameters that Katie Dagon recommended moving out of the - code (listed here: https://docs.google.com/spreadsheets/d/1cRmcB0xz7CjVP6ljUoCehJx49Usxsore5ma4mWcvQwM/edit#gid=0) - - Now read the parameters in the modules that use them - -Pull Requests that document the changes (include PR ids): - https://github.com/ESCOMP/ctsm/pull/684 - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev039 -Originator(s): sacks (Bill Sacks) -Date: Wed May 1 11:12:34 MDT 2019 -One-line Summary: Remove excess canopy liquid/snow regardless of temperature - -Purpose of changes ------------------- - -Previously: if it was above freezing, snow was allowed to accumulate on -the canopy beyond the specified capacity, and if it was below freezing, -liquid was allowed to accumulate beyond the specified capacity. Sean -Swenson, Keith Oleson and Dave Lawrence agreed that this seems wrong. - -This tag changes the behavior so that both liquid and snow canopy -capacities are enforced regardless of temperature. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Resolves ESCOMP/ctsm#699 (Canopy liquid and snow capacities not - enforced consistently?) - - -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_0 - -[X] ctsm5_0-nwp - -[X] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: Keith Oleson - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne ---- ok - hobart ------ ok - - ok means tests pass, answers change as expected - -CTSM tag used for the baseline comparisons: ctsm1.0.dev038 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: all - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - larger than roundoff; likely same climate, but this still requires - investigation - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A (Keith Oleson will run this soon) - - URL for LMWG diagnostics output used to validate new climate: N/A - (Keith Oleson will run this soon) - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -https://github.com/ESCOMP/ctsm/pull/703 - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev038 -Originator(s): sacks (Bill Sacks) -Date: Wed May 1 10:53:02 MDT 2019 -One-line Summary: Support for NWP configuration, NLDAS grid and NLDAS datm forcing - -Purpose of changes ------------------- - -This tag includes a set of changes that, together, provide support for -running an initial Numerical Weather Prediction version of CTSM over the -Continental U.S. - -(1) NWP configuration: The changes in this configuration relative to the - climate (CLM5) configuration mainly target decreasing runtime by - removing features that are expensive and not as important for NWP - time scales (days to months rather than many years) and space scales - (high resolution): - - - Single dominant landunit; if vegetated, single dominant PFT - - - Only 5 soil layers, down to 3 m - - - Only 5 snow layers - - - Plant hydraulic stress off - - - Ball-Berry rather than Medlyn stomatal conductance method (this is - a side-effect of turning plant hydraulic stress off, and is not - itself a critical aspect of the NWP configuration) - - - Maximum of 3 iterations to compute canopy fluxes - - - MEGAN is off - - Note that the NWP compset triggers changes in two new xml variables: - CLM_CONFIGURATION ('clm' vs. 'nwp'; this controls things of a more - scientific nature, like whether plant hydraulic stress is on or - off), and CLM_STRUCTURE ('standard' vs. 'fast'; this controls - structural things like the maximum number of landunits per grid cell - and the soil layer structure). Thus, you can create a case that is a - hybrid between the CLM and NWP configurations by changing these two - xml variables independently. - -(2) NLDAS2 regional grid: 0.125 deg grid over the Continental U.S. - -(3) Updated version of MOSART with support for the same NLDAS2 regional - grid - -(4) NLDAS2 data atmosphere forcing: over the same regional grid; forcing - data are available from 1980 - 2018. (We have excluded 1979 because - a small amount of data were missing for that year, and we didn't - have a good way to handle those missing data.) - -These changes can be used independently or all together. However, note -that you will get garbage if you try to use the new NLDAS2 datm forcing -for a run that extends beyond the boundaries of the NLDAS2 domain. - -There are three new NWP compsets: -- I2000Ctsm50NwpSpGswpGs: GSWP3 datm forcing; meant for global runs or - regional runs outside the NLDAS domain -- I2000Ctsm50NwpSpNldasGs: NLDAS2 datm forcing; meant for regional runs - over the NLDAS domain or some portion of it -- I2000Ctsm50NwpSpNldasRsGs: Same as above, but with a stub runoff model - in place of MOSART, for runs that aren't interested in having a runoff - model and for which you want improved throughput - -The alias for the new grid is: nldas2_rnldas2_mnldas2 (indicating that -we're using the nldas2 grid for land/atmosphere, runoff ('r') and the -ocean mask ('m'). - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Resolves ESCOMP/ctsm#451 (Add NWP physics option) -- Resolves ESCOMP/ctsm#452 (Add an NWP compset) - - -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.] - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): -- The NWP configuration is still a work in progress -- The NLDAS surface data set is still a work in progress (will soon - update this to use high-res PFTs) - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): -- New xml variables: - - CLM_CONFIGURATION (will eventually be renamed to CTSM_CONFIGURATION) - - CLM_STRUCTURE (will eventually be renamed to CTSM_STRUCTURE) -- New namelist variable: - - itmax_canopy_fluxes - -Changes made to namelist defaults (e.g., changed parameter values): -No changes for existing CLM compsets; new defaults for NWP compsets - -Changes to the datasets (e.g., parameter, surface or initial files): -No changes for existing grids; new surface dataset for nldas2 grid - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: -- New tests covering NWP compsets, nldas grid and nldas datm forcing - -Code reviewed by: Mike Barlage, Erik Kluzek - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - ok - - tests pass; namelists change as expected - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne ---- pass - hobart ------ pass - -CTSM tag used for the baseline comparisons: ctsm1.0.dev037 - - -Answer changes --------------- - -Changes answers relative to baseline: NO - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): -- MOSART: release-cesm2.0.00 -> nldas-grid.n01_mosart1_0_31 -- CIME: ctsm/ctsm1.0/cime5.7.9/n04 -> ctsm/ctsm1.0/cime5.7.9/n05 - -Pull Requests that document the changes (include PR ids): -- https://github.com/ESCOMP/ctsm/pull/682 -- https://github.com/ESCOMP/ctsm/pull/685 - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev037 -Originator(s): sacks (Bill Sacks) -Date: Mon Apr 29 16:11:47 MDT 2019 -One-line Summary: Change year alignment for present-day I compsets - -Purpose of changes ------------------- - -Change year alignment for present-day I compsets (typically, these -compsets have aliases beginning with "I2000"), in order to work better -for cases that are meant to replicate particular years. - -(1) Start the model in year 2000 rather than year 1 - -(2) Change datm's year alignment so that model year 2000 uses -observations from year 2000, model year 2001 uses observations from year -2001, etc. - -(This change was requested by Sean Swenson and supported by Dave -Lawrence.) - - -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.] - -[ ] clm5_0 - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): -- Year-2000 compsets now start in model year 2000 rather than 1 - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: cime changes reviewed by Erik Kluzek and others - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne ---- ok - hobart ------ ok - - ok means tests pass, year-2000 cases change answers as expected - -CTSM tag used for the baseline comparisons: ctsm1.0.dev036 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: Present-day compsets (I2000, I1Pt; also I2010 once those compsets are added) - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - larger than roundoff/same climate - - This changes the year alignment of datm. Climatological averages - should be the same as before, but the alignment of model year to - datm year changes. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): -- cime: ctsm/ctsm1.0/cime5.7.9/n03 -> ctsm/ctsm1.0/cime5.7.9/n04 - -Pull Requests that document the changes (include PR ids): -- cime changes documented in https://github.com/ESMCI/cime/pull/3093 - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev036 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Fri Apr 26 01:20:57 MDT 2019 -One-line Summary: Fix carbon isotope bug that caused wrong answers for isotopes under transient land-use change - -Purpose of changes ------------------- - -We currently have a bug so that for transient land-use change cases answers are different starting in soil -carbon when Carbon isotopes (use_c13, or use_c14) are on versus off. Answers are identical if there is no -land-use change. The bug does cause bulk Carbon (C12) to be slightly different, but qualitatively the same. -There is a significant impact to the Carbon isotope simulation however. The bug was causing changes in isotopic -pools to be directed to the bulk Carbon. Because, isotopes are so much smaller than bulk Carbon, this doesn't -cause a marked difference in the bulk Carbon simulation. But, the lack of the change in the isotopic pool -does have a meaningful impact on the simulation of the Carbon isotopic fields. - -Also added a general test for this and specific one to catch this case. And did some updates on documentation -files, and a small bug fix for run_sys_tests. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): #692 #675 #686 - #675 -- Answers differ when carbon isotopes are on under transient cases - #686 -- Add a system test to make sure turning on carbon isotopes doesn't change answers - #692 -- run_sys_test issue - -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_0 - -[X] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: Added LCISO test type and a 13 month Hist test to make sure carbon isotopes - don't cause a change to answers - -Code reviewed by: dlawren, billsacks, klindsey, bishtgautum - -CTSM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - tools-tests (test/tools): - - cheyenne - PASS - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - PASS (compare tests fail, because of namelist updates) - - regular tests (aux_clm): - - cheyenne ---- OK - hobart ------ OK - -CTSM tag used for the baseline comparisons: ctsm1.0.dev035 - - -Answer changes --------------- - -Changes answers relative to baseline: Only for Carbon isotopes on under transient land-use change! - - Summarize any changes to answers, i.e., - - what code configurations: Bgc with use_c13 or use_c14 T and with a transient land-use change after each year boundary - - what platforms/compilers: All - - nature of change: same climate for bulk Carbon, isotopic Carbon is quite different for regions with land-use change - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: - - URL for LMWG diagnostics output used to validate new climate: - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cime - cime from -- ctsm/ctsm1.0/cime5.7.9/n01 to ctsm/ctsm1.0/cime5.7.9/n03 - cime update allows the new test to work and starts adding NLDAS grid in - -Pull Requests that document the changes (include PR ids): #696 #694 -(https://github.com/ESCOMP/ctsm/pull) - #696 -- run_sys_test small fix - #694 -- Carbon isotope fix - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev035 -Originator(s): sacks (Bill Sacks) -Date: Mon Apr 22 20:17:40 MDT 2019 -One-line Summary: Change h2ocan to a purely diagnostic variable - -Purpose of changes ------------------- - -Previously, h2ocan_patch was maintained through the driver loop as the -sum of liqcan_patch and snocan_patch. However, there were places where -it was updated separately (though consistently) - i.e., it was not -simply a matter of 'h2ocan = liqcan + snocan'. This made the code -more complex, especially for the upcoming addition of water tracers. - -This tag changes h2ocan_patch to be a purely diagnostic variable, set -once at the end of the driver loop. Prognostic equations that used to -use h2ocan now use liqcan and snocan, either directly or indirectly via -a temporary variable set equal to the current value of liqcan+snocan. - -This tag also completely removes support for snowveg_flag = 'OFF' in -order to clean up the code. - -In addition, this tag renames the namelist variable snowveg_flag to -snowveg_affects_radiation (now a logical). - -Finally, this tag includes a minor change to always compute fcansno, -even if snowveg_affects_radiation is false, in order to simplify the -code. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Resolves ESCOMP/ctsm#199 - - -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.] - -[ ] clm5_0 - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): -- snowveg_flag renamed to snowveg_affects_radiation, and changed to a - logical flag - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: -- Answer-changing portion of these changes reviewed by Keith Oleson and - (at least to some extent) Sean Swenson - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne ---- ok - hobart ------ ok - - ok means tests pass, answers change as expected - -CTSM tag used for the baseline comparisons: ctsm1.0.dev034 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: all - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - roundoff - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - I split these changes into two pieces: (1) an answer-changing piece - where I made minimal changes to replace uses of h2ocan_patch with - liqcan+snocan (via temporary h2ocan variables holding this sum), - and (2) non-answer-changing code cleanup. (1) consisted of the - first two commits on this branch (461cafea and f195c105). With the - changes in (1), I added checks near each change to ensure that the - new expression differed by no more than roundoff from the old - (using an absolute cutoff of 1e-13). I ran the full test suite with - these checks in place, and generated new baselines. I then compared - the changes in (2) with the baselines from (1); this cleanup step - was bit-for-bit except for roundoff-level changes in the - now-diagnostic-only field H2OCAN. - - As noted in ESCOMP/ctsm#689, the changes in (1) were larger than I - expected, presumably because initially roundoff-level differences - can lead to divergent code behavior. The most obvious example of - this is in the check of h2ocan > 0 in subroutine FracWet. I have - found that, due to roundoff errors, it is possible for h2ocan_patch - > 0 by roundoff, while (liqcan_patch + snocan_patch) <= 0 by - roundoff. (Presumably the reverse could also be true, though I - haven't seen that – but I haven't spent much time looking for it.) - - Soon, we plan to do a more rigorous test to double check that this - change is not climate-changing. - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -- First part of changes in https://github.com/ESCOMP/ctsm/pull/689 - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev034 -Originator(s): sacks (Bill Sacks) -Date: Sat Apr 20 06:11:23 MDT 2019 -One-line Summary: Change clm4_5: Use Justin Perket snow on vegetation - -Purpose of changes ------------------- - -This tag changes the behavior of clm4_5, making it now use Justin -Perket's snow on vegetation parameterization. This parameterization was -originally introduced in clm4_5_1_r112. At the time it was only used for -clm5_0 cases. This tag uses that parameterization for clm4_5 cases, too, -so that (like clm5_0) they use snowveg_flag = 'ON_RAD' (i.e., vegetation -snow canopy on with albedo influence). - -This changes climate for clm4_5, mainly through albedo changes, -particularly in the shoulder seasons. - -The reason for this change is to allow an upcoming cleanup of the -relationship between h2ocan, snocan and liqcan. (See -https://github.com/escomp/ctsm/issues/199 for details.) - -This tag also no longer allows snowveg_flag = 'OFF'. However, code -cleanup is deferred to a follow-on tag, in order to separate the answer -changes in this tag from the no-greater-than-roundoff-level changes in -the follow-on tag. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- First step towards addressing ESCOMP/ctsm#199 (Clean up relationship - between h2ocan, snocan and liqcan) - - -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.] - -[ ] clm5_0 - -[X] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): -- Changes the scientific configuration of clm4_5 cases, as noted above - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): -- For clm4_5: snowveg_flag = 'ON_RAD' rather than 'OFF' - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): -- Need to clean up code involving snowveg_flag, liqcan, snocan and - h2ocan. I will do this in a follow-on tag. - -Changes to tests or testing: -- Added a test with snowveg_flag = 'ON'. (At least some of the code - paths triggered by this setting were previously covered by clm45 - cases. Now that both clm45 and clm50 use snowveg_flag = 'ON_RAD', - there was some uncovered code. This new test covers this code.) -- Changed long single-point tests to use Qian forcing: With the default - GSWP3 forcing, the vast majority of the runtime was being spent in - datm. In addition, I was getting repeated failures of - ERS_Lm54_Mmpi-serial.1x1_numaIA.I2000Clm50BgcCropGs.cheyenne_intel.clm-cropMonthOutput, - I think due to memory issues; I'm hopeful that changing the datm - forcing will help with that. - -Code reviewed by: self - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne ---- ok - hobart ------ ok - - ok means tests pass; NLCOMP and BASELINE failures for Clm45 cases, - as expected - -CTSM tag used for the baseline comparisons: ctsm1.0.dev033 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: Clm45 compsets - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - New climate (as in clm4_5_1_r112 for clm5_0); the main impact is - through albedo changes, particularly in the shoulder seasons. - - Changes in clm4_5 cases are due to: - - (1) Using snowveg_flag = 'ON_RAD' rather than 'OFF' - - (2) Changed initial conditions for canopy water: Rather than using - H2OCAN, which is the meaningful state variable on previous - clm4_5 initial conditions files, now we use LIQCAN and - SNOCAN. These may be 0, although at least some clm4_5 initial - conditions files (including the two non-Fates out-of-the-box - clm4_5 initial conditions files) have non-zero (though still - reasonable) LIQCAN for reasons I can't understand. - - (Also changes answers for - ERS_D_Ln9_P480x3.f19_g16.I2000Clm50SpGs.cheyenne_intel.clm-waccmx_offline, - which uses a clm45 initial file.) - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): none - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev033 -Originator(s): slevis (Samuel Levis, SLevis Consulting LLC, 303-665-1310) -Date: Thu Apr 11 10:51:29 MDT 2019 -One-line Summary: Limit landunit presence with thresholds set in the namelist - -Purpose of changes ------------------- - - Faster simulations. Motivated by NWP applications: - - Introduce user-defined namelist parameters to use as thresholds - above which landunit areas are kept and - below which landunit areas are removed. - - Introduce user-defined logical namelist parameter to collapse the up to - three urban landunits to the dominant urban landunit. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): #581 - Fixes #581 -- Allow zeroing out special landunits if their area is below some threshold - - -Significant changes to scientifically-supported configurations --------------------------------------------------------------- - -Does this tag change answers significantly for any of the following physics configurations? No - -Notes of particular relevance for users ---------------------------------------- - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): - - New namelist variables with valid real values from 0._r8 to 100._r8, where - 0 means "do nothing" and other values determine the threshold above - which to keep the landunit in a gridcell. The new variables are: - toosmall_soil - toosmall_crop - toosmall_glacier - toosmall_lake - toosmall_wetland - toosmall_urban - - New logical namelist variable collapse_urban. If .true. then the up to - three urban landunits collapse to the dominant urban landunit. - ---------------------------------------------- -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - There's a typo in the name for n_dom_landunits (missing the s) in bld/CLMBuildNamelist.pm - build-namelist doesn't check for toosmall_* below 0 or above 100, but the code does - -Changes to tests or testing: Yes - New unit tests subroutine test_collapse_individual_lunits and - test_collapse_all_lunit_opts_active in test_surfrdUtils.pf - Modified standard suite test - ERS_D_Ld10.f10_f10_musgs.IHistClm50BgcCropGs.cheyenne_intel.clm-collapse_to_dominant_decStart - to - ERS_D_Ld10.f10_f10_musgs.I2000Clm50BgcCropGs.cheyenne_intel.clm-rm_indiv_lunits_and_collapse_to_dom - and introduced fatal error message when namelist parameters toosmall_* > 0 or - n_dom_* > 0 in transient simulations - -Code reviewed by: Erik Kluzek, Bill Sacks - -CTSM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS (384 differences because of new namelist items) - - regular tests (aux_clm): - - cheyenne ---- ok - hobart ------ ok - -CTSM tag used for the baseline comparisons: - cheyenne ctsm1.0.dev031 - hobart ctsm1.0.dev032 - - -Answer changes --------------- - -Changes answers relative to baseline: No - Note: Comparison to baseline gives NLCOMP failures because the new namelist - parameters always appear in the namelist now, even when they have not been - changed from their default value by the user. - -Detailed list of changes ------------------------- - - Introduced call to new subroutine collapse_individual_lunits that uses - the user-defined namelist variables listed above to determine whether - a landunit gets kept or removed from a gridcell. - - Introduced new call to collapse_to_dominant for when collapse_urban = .true. - - Introduced error checks that do not allow coexistence of transient - simulations and the toosmall_* variables OR the n_dom_pfts/n_dom_landunits - variables OR the collapse_urban parameter. - -Pull Requests that document the changes (include PR ids): #641 - https://github.com/ESCOMP/ctsm/pull/641 - #641 -- Ability to remove individual landunits for faster runs - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev032 -Originator(s): negins (Negin Sobhani,UCAR/CSEG,303-497-1224) -Date: Mon Apr 8 08:26:57 MDT 2019 -One-line Summary: Fixing the balance check to check for possible errors over all columns/patches - -Purpose of changes ------------------- -Up until now, the BalanceCheckMod code in biogeophysics did not check all -the possible errors over all columns or patches with the error threshold for -aborting clm and it merely compared the last column/patch found (where -warning threshold is met) with the error threshold. -Therefore, there was always a possibility that the abort is not triggered -when it should have been. This issue was first mentioned in ctsm issue #55 -for soil energy balance check, but a similar issue is also present for -other balance checks in BalanceCheckMod.F90 . - -Below is the list of the balance checks with a similar issue: -1. Water balance check -2. Snow balance check -3. Solar radiation energy balance check -4. Longwave radiation energy balance check -5. Surface energy balance check -6. Soil energy balance check (Issue #55) - -For remediating this issue, we used MAXVAL and MAXLOC Fortran intrinsic functions -to compare the largest error with the warning and error thresholds instead -of checking the last column or looping over all columns. - - -In addition, this PR also makes slight changes to ./run_sys_tests outputi/case -directory structure. Previously for each case in a test suite, there were -two set of directories created by run_sys_tests as follows: - * one directory which included run/ and bld/ and named as $SCRATCH/[case-name].... - * The case directory which included logs , timings, CaseDocs/, and misc. scripts - for ./case.build, ./case.submit... under $SCRATCH/tests-[testID]/[case-name].... - -This made debugging confusing and populated many folders in user's scratch. -Now, for every case in a test, all directories related to that case -including bld/ and run/ directories are nested under the case directory under $SCRATCH/tests-[testID]/[case-name].... -This is now similar to ./create_test output folder structure. - - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Resolves ESCOMP/ctsm issue#55 - -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.] - -[ ] clm5_0 - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - -Changes to tests or testing: - - ./run_sys_test is changed so that it nests bld/ and run/ directories under the case directory as $SCRATCH/tests-[testID]/[case-name]... - The output folder structure now is similar to ./create_test for each case in a test. - -Code reviewed by: Bill Sacks - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne ---- ok - hobart ------ ok - - -CTSM tag used for the baseline comparisons: ctsm1.0.dev031 - - -Answer changes --------------- - -Changes answers relative to baseline: No - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None - -Pull Requests that document the changes (include PR ids): -https://github.com/ESCOMP/ctsm/pull/670 - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev031 -Originator(s): sacks (Bill Sacks) -Date: Wed Mar 13 15:03:42 MDT 2019 -One-line Summary: Subtract virtual states to reduce dynbal fluxes for transient glaciers - -Purpose of changes ------------------- - -Up until now, when computing the dynbal correction (conservation) fluxes -for transient glacier columns, we have been (1) counting the mass and -energy in the ice column as if that is a real state, but on the other -hand (2) NOT accounting for the fact that glacier columns don't -represent the soil under glacier. These two issues work in opposite -directions, but (1) dominates, because there is much more ice (and -energy, I think) in the roughly 50 m of glacial ice than there is in a -typical 50 m soil column. - -In discussing this issue with Bill Lipscomb, we came up with the idea of -subtracting some baseline value from each glacier column. I think that, -as long as we subtract the same baseline value throughout an entire -simulation for a given column, we will still conserve mass and energy -through dynamic landunit transitions. - -So, here we subtract baseline values from glacier columns, accounting -for the two issues mentioned above: (1) we subtract the water and energy -in the glacier ice, because this is a virtual state in CTSM, and (2) we -add the water and energy from the vegetated column(s), to account for -the fact that we don't have an explicit representation of -soil-under-glacier (this carries the assumption that the -soil-under-glacier has the same state as the initial vegetated state in -that grid cell). We set these baselines in initialization, so they begin -equal to the cold start state. Water and ice in the glacial ice stay -fixed over the course of a simulation, so the cold start values should -be the same as the current values at any point in time. The heat content -of the glacial ice does change over time, but by subtracting this -baseline value, we can potentially reduce the dynbal sensible heat -fluxes (however, note that it's also possible that these sensible heat -fluxes could increase when subtracting the cold start value, if ice -temperatures are closer to 0 deg C than to the cold start value, -currently 250 K). - -In addition, this introduces a new namelist flag, -reset_dynbal_baselines, which allows the user to reset these baselines -at some desired point in the simulation. I think that, in general, this -resetting would break conservation. But as long as it is done before the -onset of transient glaciers, I think this should be okay. In this way, -the user can minimize dynbal fluxes even further, by resetting the -baselines after the system has spun up. If the states haven't changed -much from this point to the point when glacier dynamics occur, then the -dynbal fluxes should now be very small. (See the documentation of this -flag in namelist_definition_ctsm.xml for more details.) - -Without this change, dynbal fluxes for a grid cell that undergoes 100% -glaciation / deglaciation in a single year are around 50 m ice, 1 m -liquid water, and a few tens of W m-2 (where those quantities of ice and -water are dribbled throughout the year, so we end up with an ice flux of -about 1.5e-6 mm/s throughout the year; and the energy flux is applied -evenly throughout the year - i.e., tens of W m-2 every time step for a -year). With this change, and with reset_dynbal_baselines set at an -appropriate time, these fluxes can be reduced to close to zero. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Partially addresses ESCOMP/ctsm#274 (Dynamic landunits: improve water - and energy conservation) - -CIME Issues fixed (include issue #): -- Fixes three issues related to inputdata checksum: - - ESCMI/cime#3033 - - ESCMI/cime#3034 - - ESCMI/cime#3036 - -Known bugs introduced in this tag (include github issue ID): -- ESCOMP/ctsm#659 (Subtract dynbal baselines from begwb and endwb) - - This can't be fixed until we're okay having this answer change on - master - -Known bugs found since the previous tag (include github issue ID): -- ESCOMP/ctsm#658 (Methane should not depend on gridcell-level TWS) - -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_0 - -[X] clm4_5 - -Significant answer changes for runs with transient glaciers. - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): -- For runs with transient glaciers, careful thought should be given to - when to set reset_dynbal_baselines -- Inconsistency between begwb/endwb and liq1/liq2/ice1/ice2 (see ESCOMP/ctsm#659) - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): -- New namelist variable: reset_dynbal_baselines - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): -- Inconsistency between begwb/endwb and liq1/liq2/ice1/ice2 (see ESCOMP/ctsm#659) - -Changes to tests or testing: -- Tweaked a test with transient glacier areas, including adding this new - flag to the test - -Code reviewed by: Bill Lipscomb reviewed the conceptual ideas, but -nobody has reviewed the actual code - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne ---- ok - hobart ------ ok - - ok means tests pass, answers change as expected - -CTSM tag used for the baseline comparisons: ctsm1.0.dev030 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: ALL, but different configurations show - different levels of changes, as noted below - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - new climate (at least regionally) for some configurations; - roundoff for others: see below - - There are three levels of changes here: - - (1) For runs with transient glaciers, there are large answer changes - in regions with changing glacier area. These answer changes are - in the various dynbal fluxes - for liquid water and ice runoff, - and for the dynbal sensible heat flux. - - (2) For runs with transient vegetation (Hist, Dv and Fates), there - are roundoff-level changes in the dynbal fluxes. For liquid - water and ice, these changes appear to only occur in grid cells - where there is some glacier area (because now both the before - and after gridcell water contents have changed by the same fixed - amount, which changes the difference at the roundoff level). For - heat, there are roundoff-level changes everywhere (because of - changes in the order of operations). - - (3) All runs have large changes in the diagnostic variables, - ICE_CONTENT1, LIQUID_CONTENT1 and HEAT_CONTENT1, over grid cells - containing some glacier area. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): -- cime: cime5.7.9 -> ctsm/ctsm1.0/cime5.7.9/n01 - - Fixes issues related to inputdata checksum - -Pull Requests that document the changes (include PR ids): -- https://github.com/ESCOMP/ctsm/pull/650 - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev030 -Originator(s): sacks (Bill Sacks) -Date: Fri Mar 8 15:08:34 MST 2019 -One-line Summary: Update CIME; hookup expected test fails - -Purpose of changes ------------------- - -Two main changes: - -(1) Update to latest cime (from ctsm/ctsm1.0/cime5.7.5/n01 to - cime5.7.9). Some of the important changes are: - - Fix for recent cheyenne system changes - - New domain file for f19_g17 (changes answers at the roundoff - level) - - New domain file for T31_g37 (changes answers by greater than - roundoff) - -(2) In system tests: Annotate cs.status output with expected failures - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Fixes ESCOMP/ctsm#654 - -CIME Issues fixed (include issue #): (Many) - - -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.] - -[ ] clm5_0 - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none? - The PFS test showed a significant speedup (170s in the previous tag, - 124s in this tag). However, some other tests showed either a slowdown - or not much change. So I'm not sure there is a consistent pattern of - speedup in this tag. - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: Erik Kluzek - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne ---- ok - hobart ------ ok - - ok means tests pass, some baselines failed as noted below - - Most testing done with cime at eb2eb704f - excluded PR #3030, which - updated support for CAM-SE grids (but the changes in this PR were - very limited). Ran SSP tests with the final version of cime (so I'd - have a few tests covering the latest cime). - -CTSM tag used for the baseline comparisons: ctsm1.0.dev029 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: f19_g17, T31_g37 - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - - f19_g17: roundoff-level, presumably due to new domain file (some - diffs grew to greater than roundoff-level: some methane - variables in a long test - - SMS_Lm13.f19_g17.I2000Clm50BgcCrop.cheyenne_intel.clm-cropMonthOutput; - and many variables in test with flooding - - ERP_P180x2_D.f19_g17.I2000Clm50SpRtmFl.cheyenne_intel.clm-default) - - - T31_g37: greater than roundoff-level, presumably due to new - domain file from cime commit 4fcf592ee - - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): -- cime: ctsm/ctsm1.0/cime5.7.5/n01 -> cime5.7.9 - -Pull Requests that document the changes (include PR ids): -- https://github.com/ESCOMP/ctsm/pull/602 - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev029 -Originator(s): slevis (Samuel Levis, SLevis Consulting LLC, 303-665-1310) -Date: Tue Feb 26 23:42:39 MST 2019 -One-line Summary: Collapse landunits to the N most dominant - -Purpose of changes ------------------- - - Allows the collapse to fewer landunits using the concept of - N most dominant for the purpose of faster runs, eg in the context - of NWP (Numerical Weather Prediction). - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): #581 - - -Significant changes to scientifically-supported configurations --------------------------------------------------------------- - -Does this tag change answers significantly for any of the following physics configurations? No - - [Put an [X] in the box for any configuration with significant answer changes.] - -[ ] clm5_0 - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): - New namelist variable n_dom_landunits with valid integer values from 0 to - max_lunit currently equal to 9, where 0 means “do nothing” and other - values determine the number of active landunits when running the model. - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - There is a question left in on whether the collapse call needs to also - be moved to inside dynamic landunits reading. - -Changes to tests or testing: Yes - ERS_D_Ld10.f10_f10_musgs.IHistClm50BgcCropGs.cheyenne_intel.clm-collapse_to_dominant_decStart - now replaces (by combining with) this test introduced in ctsm1.0.dev026 - ERS_D_Ld10.f10_f10_musgs.IHistClm50BgcCropGs.cheyenne_intel.clm-collapse_nat_pfts_decStart - I added subroutine test_collapse_to_dom_landunits to test_surfrdUtils.pf - to include new Unit Tests. In same file I renamed - subroutine test_collapse_nat_pfts to test_collapse_to_dom_pfts - to accurately describe the contents of the subroutine. - -Code reviewed by: Erik Kluzek - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - regular tests (aux_clm): - - cheyenne ---- OK - hobart ------ OK - -CTSM tag used for the baseline comparisons: - ctsm1.0.dev028 - - -Answer changes --------------- - -Changes answers relative to baseline: No - -Detailed list of changes ------------------------- - - Replaced existing subroutine collapse_nat_pfts with - subroutine collapse_to_dominant which can collapse to the - N dominant landunits or N dominant pfts by performing the - same actions on the data. - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None - -Pull Requests that document the changes (include PR ids): #639 - https://github.com/ESCOMP/ctsm/pull/639 - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev028 -Originator(s): sacks (Bill Sacks) -Date: Tue Feb 26 14:35:01 MST 2019 -One-line Summary: Interpolate out-of-the-box initial conditions and remove expensive tests - -Purpose of changes ------------------- - -Two main changes (plus some small additional changes): - -1. Removed / reworked some expensive tests - -2. Interpolated all out-of-the-box initial conditions, so that the - out-of-the-box version is now compatible with our current - configuration. The changes from before were (a) our standard - configuration now uses the gx1v7 rather than gx1v6 land mask; (b) - many inactive points are now absent in memory. - -See https://github.com/ESCOMP/ctsm/pull/622 for details. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Resolves ESCOMP/ctsm#312 -- Partially addresses ESCOMP/ctsm#275 (just a bit) - - -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.] - -[ ] clm5_0 - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): -- New finidat files - -Substantial timing or memory changes: -- Faster initialization times for cases that no longer need to interpolate initial conditions - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: -- Removed or reworked expensive tests: see details in https://github.com/ESCOMP/ctsm/pull/622 - -Code reviewed by: Erik Kluzek - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne ---- ok - hobart ------ ok - - ok: tests pass, baselines fail as expected - -CTSM tag used for the baseline comparisons: ctsm1.0.dev027 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: all configurations that still need use_init_interp = .true. - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Not investigated carefully, but expected to be larger than roundoff/same climate - - Answers change for cases that still need to do interpolation from - these out-of-the-box finidat files. - - I first confirmed that the new finidat files are good via: - - - Compared `ncdump -h` of old vs. new initial conditions files - - - Ran the following tests, with comparison against master; verified that - these all pass and are bit-for-bit, that they use the new initial - conditions files, and that they now have `use_init_interp` unset - (whereas they used to have `use_init_interp` set to `.true.`); note - that these cover 6 of the 7 new initial conditions files: - - ``` - SMS_Ld1.f09_g17.I1850Clm45BgcGs.cheyenne_intel.clm-default - SMS_Ld1.f09_g17.I1850Clm45BgcCruGs.cheyenne_intel.clm-default - SMS_Ld1.f09_g17.I1850Clm50Sp.cheyenne_intel.clm-default - SMS_Ld1.f09_g17.I1850Clm50BgcCrop.cheyenne_intel.clm-ciso - SMS_Ld1.f09_g17.I1850Clm50BgcCropCru.cheyenne_intel.clm-ciso - SMS_Ld1.f09_g17.I1850Clm50SpCru.cheyenne_intel.clm-default - ``` - - - To cover the last new initial conditions file, ran the following test - (with the same checks as above: passes and bit-for-bit, checked - finidat, and checked `use_init_interp`), with `./xmlchange - LND_TUNING_MODE=clm5_0_cam6.0` (for the baseline for this test, I set - `init_interp_method = 'use_finidat_areas'`, which I also used in - interpolating this initial conditions file): - - ``` - SMS_Ld1.f09_g17.I1850Clm50BgcCrop.cheyenne_intel - ``` - - Details on answer changes: - - As noted above, these changes are bit-for-bit for configurations - that can now use the out-of-the-box initial conditions without - interpolation. However, answers change for configurations that still - require interpolation of the out-of-the-box initial conditions - (e.g., because they are at a different resolution than the finidat - file). - - I expected these answer changes around the Caspian Sea, due to the - fact that we are now effectively interpolating twice from the - original file: once to produce the new out-of-the-box file (which - includes an interpolation from `gx1v6` to `gx1v7`, and so - interpolates onto the Caspian Sea region) and once to go from - `f09_g17` to the target resolution (rather than interpolating - directly from `f09_g16` to the target resolution). - - However, when I ran a test with comparison to baselines - - `ERP_Ld5.f19_g17.I1850Clm50Bgc.cheyenne_intel.clm-default` - I saw - changes in regions further afield than simply around the Caspian - Sea. See images in https://github.com/ESCOMP/ctsm/pull/622 for - details. It's possible that the other differences are also due to - the Caspian Sea change, but it's also possible that there is some - other cause here that I don't understand. But Erik Kluzek and I - agreed that it isn't worth trying to understand these other - (isolated) differences. - - Also note: While most f09_g17 tests are bit-for-bit with the earlier - tag (because now use_init_interp is .false. for those tests), - `SMS_Ld2_D.f09_g17.I1850Clm50BgcCropCmip6.cheyenne_intel.clm-basic_interp` - differs in some glc forcing fields for a few grid cells in - Antarctica. This is perhaps not surprising, since this test needs to - use interpolation to get fields for the Antarctica virtual columns; - so, while I don't completely understand the cause of these answer - changes, I suspect the root cause is similar to the isolated answer - changes I saw sprinkled around the world for - `ERP_Ld5.f19_g17.I1850Clm50Bgc.cheyenne_intel.clm-default`. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -- https://github.com/ESCOMP/ctsm/pull/622 - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev027 -Originator(s): negins (Negin Sobhani,UCAR/CSEG,303-497-1224) -Date: Tue Feb 19 12:57:12 MST 2019 -One-line Summary: Non-constant time initialization for soil hydrology types are moved to SoilHydrologyType.F90. - -Purpose of changes ------------------- - -Initalization of time-varying `zwt`, `zwt_perched`, and `frost_table` are moved to `InitCold` in `SoilHydrologyType.F90`. - -Previously, `zwt`, `zwt_perched`, and `frost_table` were initialized in `SoilHydrologyInitTimeConstMod.F90`, which caused confusions. - -Bugs fixed or introduced ------------------------- -Issues fixed (include CTSM Issue #): -- Resolves ESCOMP/ctsm#575 ("Some variables initialized in SoilHydrologyInitTimeConstMod are not time-constant") - -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.] - -[ ] clm5_0 - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: Updated a test. The test added in previous tag included decStart with transient glaciers, which would not work. Hence, this test is modified so the compset does not include G. -Test IHistClm50SpG is updated to IHistClm50Sp. - -Code reviewed by: -Bill Sacks -Erik Kluzek - -CTSM testing: - - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne ---- ok - hobart ------ ok - - ok means tests pass, except for the expected failures. - -CTSM tag used for the baseline comparisons: -ctsm1.0.dev026 - -Answer changes -------------- - -Changes answers relative to baseline: no - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): - -Pull Requests that document the changes (include PR ids): -PR #631 Soil hydrology initialization of time-constant variables moved to SoilHydrologyType -https://github.com/ESCOMP/ctsm/pull/631 - - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev026 -Originator(s): slevis (Samuel Levis, SLevis Consulting LLC, 303-665-1310) -Date: Tue Feb 5 17:08:48 MST 2019 -One-line Summary: Collapse unmanaged PFTs to the N most dominant - -Purpose of changes ------------------- - -To run simulations fast for applications such as NWP (Numerical Weather -Prediction), allow collapsing natural PFT's to the number the user wants. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): 457 - - -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.] - -[ ] clm5_0 - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): -New namelist parameter n_dom_pfts with valid integer values from 0 to -14, where 0 means “do nothing” and other values determine the number -of active pfts when running the model - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None (unless new option invoked) - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in ../CTSMMasterChecklist as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: updated tests, added new test -Updated standard testing test to include decStart -(December start). Confirmed that answers were bit-for-bit same with -baseline before introducing the change. -Added standard testing test to test n_dom_pfts = 2 in a -transient vegetation case with December start. -Added subroutine test_collapse_nat_pfts to test_surfrdUtils.pf to -include new Unit Tests. - -Code reviewed by: -Erik Kluzek -Bill Sacks - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - regular tests (aux_clm): - - cheyenne ---- OK - hobart ------ OK - -CTSM tag used for the baseline comparisons: -ctsm1.0.dev025 - -Answer changes --------------- - -Changes answers relative to baseline: No (bit-for-bit) - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None - -Pull Requests that document the changes (include PR ids): -https://github.com/ESCOMP/ctsm/pull/588 -- NWP collapse pfts to the N most dominant -https://github.com/ESCOMP/ctsm/pull/583 -- Add routine to find indices of max k values in data - -Added new subroutines collapse_nat_pfts and collapse_crop_var and called -them from surfrdMod.F90. The second of these subroutines is not needed -when collapsing unmanaged PFTs; however, I created it early in the PR -and decided to keep it for use soon with crop-related variables like -irrigation water and fertilizer. - -Bill Sacks made changes to include subroutine find_k_max_indices for the -benefit of this PR (#583) - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev025 -Originator(s): Keith Oleson, Bill Sacks -Date: Wed Jan 23 10:48:01 MST 2019 -One-line Summary: History fields for vertically-resolved sums of soil C and N, and minor fixes - -Purpose of changes ------------------- - -Main change is from Keith Oleson: Add history fields for -vertically-resolved sums of SOIL1C, SOIL2C, and SOIL3C for C12, C13, -C14, and similarly for N. New fields are SOILC_vr, C13_SOILC_vr, and -C14_SOILC_vr, and SOILN_vr. For runs that use the output_bgc usermods, -including cmip6 runs, we no longer output 'SOIL1C_vr', 'SOIL1N_vr', -'SOIL2C_vr', 'SOIL2N_vr', 'SOIL3C_vr', 'SOIL3N_vr'; instead we output -'SOILC_vr', 'SOILN_vr', and similarly for C isotopes. - -Also minor fixes: -- Output cpl hist files in SSP test (resolves ESCOMP/ctsm#61) -- Remove FATES-related commented-out code in OzoneMod (this has been - moved to https://github.com/ESCOMP/ctsm/issues/618) -- Minor tweak to run_sys_tests - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Resolves ESCOMP/ctsm#61 - -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.] - -[ ] clm5_0 - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): -- For runs that use the output_bgc usermods, including cmip6 runs, we no - longer output 'SOIL1C_vr', 'SOIL1N_vr', 'SOIL2C_vr', 'SOIL2N_vr', - 'SOIL3C_vr', 'SOIL3N_vr'; instead we output 'SOILC_vr', 'SOILN_vr', - and similarly for C isotopes. - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in ../CTSMMasterChecklist as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: Bill Sacks; Erik Kluzek reviewed the changes to the SSP test - - -CTSM testing: - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne ---- pass - hobart ------ pass - -CTSM tag used for the baseline comparisons: ctsm1.0.dev024 - - -Answer changes --------------- - -Changes answers relative to baseline: NO - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -https://github.com/ESCOMP/ctsm/pull/551 - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev024 -Originator(s): slevis (Samuel Levis,SLevis Consulting, LLC, 303-665-1310) -Date: Mon Jan 14 11:07:04 MST 2019 -One-line Summary: Remove unnecessary restart variables - -Purpose of changes ------------------- - -Remove unnecessary restart variables to conserve on computing resources -and disk space - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): 285 - - -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.] - -[ ] clm5_0 - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): - -Changes made to namelist defaults (e.g., changed parameter values): - -Changes to the datasets (e.g., parameter, surface or initial files): - -Substantial timing or memory changes: - -Notes of particular relevance for developers: -Code reviewed by Bill Sacks. -Standard testing (cheyenne and hobart) OK -Unit testing PASS ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - -Changes to tests or testing: - -Code reviewed by: Bill Sacks - -CTSM testing: -Regular testing (cheyenne and hobart) OK -Unit testing PASS - -CTSM tag used for the baseline comparisons: -ctsm1.0.dev023 - - -Answer changes --------------- - -Changes answers relative to baseline: NO (bfb) - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): - -Pull Requests that document the changes (include PR ids): -https://github.com/ESCOMP/ctsm/pull/598 - -Variables removed from restart: -plant_nalloc -pot_f_nit_vr* -f_nit_vr* -root_depth -qflx_floodg -snounload -qflx_snofrz_lyr -sminn_to_plant_fun_patch - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev023 -Originator(s): sacks (Bill Sacks) -Date: Thu Jan 10 13:00:42 MST 2019 -One-line Summary: Remove CLM4.0 - -Purpose of changes ------------------- - -Remove CLM4.0. This consists of removing code and other files that are -specific to CLM4.0, and doing some resulting cleanup of code that was -shared between CLM4.0 and later versions (primarily in build-namelist). - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Resolves #455 (Remove CLM4.0) - - -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.] - -[ ] clm5_0 - -[ ] clm4_5 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): -- Can no longer run CLM4.0 cases - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): -- CLM4.0 compsets no longer supported - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in ../CTSMMasterChecklist as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: Removed CLM4.0 tests - -Code reviewed by: Erik Kluzek - - -CTSM testing: - - build-namelist tests: - - cheyenne - pass - - tools-tests (test/tools): - - cheyenne - pass - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - ok - - Total number of tests = 52 - Number of tests that PASS = 51 - Number of tests that Fail = 1 - Number of compare tests that PASS = 37 - Number of compare tests that Fail = 4 - Number of tests without compare = 11 - - The one failing test is: - FAIL fail-no_towerdata.-d+/glade/p/cesmdata/cseg/inputdata++-s+RF-Bra+--debug+--pftgrid+--soilgrid. - - These same failures occurred in ctsm1.0.dev022 (including the - compare tests that Fail). Erik Kluzek says these failures are - okay. - - regular tests (aux_clm): - - cheyenne ---- pass - hobart ------ pass - - Notes on testing: - - - Most testing done on b5380c7e8. Since then, updated to a version of - cime that fixes cime's configure tool (but this isn't invoked in - system tests, so I didn't rerun the system tests) and pointed cime - to a tag rather than a hash. - - - For tools tests: In baseline, cherry-picked commit 148bc2158 into - cime - -CTSM tag used for the baseline comparisons: ctsm1.0.dev022 - - -Answer changes --------------- - -Changes answers relative to baseline: NO - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): -- cime: points to branch tag off of cime5.7.5 - (ctsm/ctsm1.0/cime5.7.5/n01), with changes for: - (1) Removal of support for CLM4.0 (equivalent to the changes in - https://github.com/ESMCI/cime/pull/2968) - - (2) Fix for cime configure (cherry-picked 148bc2158) - -Pull Requests that document the changes (include PR ids): -- https://github.com/ESCOMP/ctsm/pull/609 (Remove CLM4.0) -- https://github.com/ESCOMP/ctsm/pull/601 (Print git status and related - info when running run_sys_tests) - - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev022 -Originator(s): sacks (Bill Sacks) -Date: Tue Jan 8 11:01:38 MST 2019 -One-line Summary: Set tracer version of irrigation fluxes - -Purpose of changes ------------------- - -Set tracer version of irrigation fluxes. - -This required a substantial rewrite of ApplyIrrigation (now renamed to -CalcIrrigationFluxes). The problem was that the code was written to -compute the total irrigation withdrawal from groundwater, then use this -to compute the application fluxes (drip/sprinkler), then later divide -this total withdrawal by layer. But for tracer fluxes to be computed -correctly, we needed to reorder this, so that the per-layer withdrawals -are determined before determining the application fluxes. This is -because the application flux needs to know the tracer concentrations of -the source, which requires knowing which layers the source is drawing -from. This was made more challenging because of the mix of patch-level -and column-level variables at play: irrigation demand is patch-level, -groundwater availability and extraction is column-level, but application -is back to patch-level. - -In a somewhat-related change, I also reworked the passing of information -between soil hydrology (groundwater availability) and irrigation: -Previously, there was some near-duplicate code in -CalcAvailableUnconfinedAquifer (which was called prior to -ApplyIrrigation) and WithdrawGroundwaterIrrigation (which was called -after ApplyIrrigation). I have reworked the code to remove this -duplication, calling the new CalcIrrigWithdrawals in the midst of -CalcIrrigationFluxes. In doing so, I reconciled an accidental -discrepancy between the two original routines (see -https://github.com/escomp/ctsm/issues/595). - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Resolves ESCOMP/ctsm#521 (Set tracer versions of fluxes set by - ApplyIrrigation) -- Resolves ESCOMP/ctsm#593 (Generalize groundwater irrigation availability to - handle multiple patches per column) -- Resolves ESCOMP/ctsm#595 (Inconsistency between CalcAvailableUnconfinedAquifer - and WithdrawGroundwaterIrrigation) - - -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.] - -[ ] clm5_0 - -[ ] clm4_5 - -[ ] clm4_0 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: - -- Sean Swenson reviewed the initial parts of the rework of - ApplyIrrigation and the passing of information between soil hydrology - and irrigation - -CTSM testing: - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne ---- ok - hobart ------ ok - - ok means tests pass, expected baseline failures as noted below - - Additional manual testing: - - - Out of the box, the one-timestep tracer consistency test - (SMS_D_Ln1.f10_f10_musgs.I2000Clm50BgcCropGs.hobart_nag.clm-tracer_consistency) - passed when the new check was inserted after the irrigation call, - even without the changes in this tag. Presumably this is because no - irrigation was being done in the first time step of this test. To - confirm that the changes here were both necessary and effective, I - hacked the code to force irrigation of all types (surface and - groundwater) on the first time step (see - https://github.com/billsacks/ctsm/commit/d28a03145). I confirmed - that this test, with those code hacks, failed before the changes in - this tag, and passed with these changes in place. - - - I used a multi-step process to confirm that these changes are only - roundoff-level different for groundwater irrigation (because - feedbacks in the system result in - SMS_D_Ld5.f10_f10_musgs.I2000Clm50BgcCrop.hobart_nag.clm-irrig_alternate - looking greater-than-roundoff-level different from the baseline): - - (1) Confirmed that e507fe603 is only roundoff-level different from - baseline using cprnc output from this test. - - (2) Confirmed that a4a1a626c is only roundoff-level different from - e507fe603. This was the tricky part. I did this by introducing - some temporary code that (a) computed some fluxes in both the - old and new ways, (b) compared the old and new methods for each - point and time step, confirming that they were no more than - roundoff-level different, then (c) set the fluxes to the old - method. I confirmed that this was bit-for-bit with e507fe603, - and the checks for greater-than-roundoff-level differences - between the old and new methods were never triggered. (See - https://github.com/billsacks/ctsm/commit/7d23e9e and the earlier - commits on that branch.) - - (3) Confirmed that remaining changes an the branch are bit-for-bit - with a4a1a626c. - -CTSM tag used for the baseline comparisons: ctsm1.0.dev021 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: - - - Small answer changes when groundwater irrigation is enabled. In - principle, could change answers by greater than roundoff due to - fix of #595, but I didn't see any answer changes in my 7-month - test due to that change. Other than that, just roundoff-level - changes. - - - Answer changes when tracers are enabled. - - - Roundoff-level changes in the diagnostic field, - QIRRIG_FROM_SURFACE, for many tests - - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - See notes under "what code configurations" for details. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -https://github.com/ESCOMP/ctsm/pull/600 - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev021 -Originator(s): mvr (Mathew Rothstein,UCAR/CSEG,303-497-1304) -Date: Wed Dec 26 16:29:06 MST 2018 -One-line Summary: Added tracer ratio capability and included it in consistency checks - -Purpose of changes ------------------- - -These changes are needed to support the implementation of water isotopes by ensuring -that isotope-related variables are being updated consistently throughout the model. -The consistency checks include the testing of a bulk tracer that should always be -equal to the bulk, and also test tracers that maintain a fixed ratio (other than -one) to the bulk. This commit includes fixes to the cold start initialization for -the water tracers with ratios other than one. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): [If none, remove this line] -#541 Only do water tracer consistency checks on tracers that are - supposed to maintain a fixed ratio -#459 Fix cold start initialization of water tracers -#508 Remove unused variables in new Water types -#357 Put in place Water isotope consistency checks - - - -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.] - -[ ] clm5_0 - -[ ] clm4_5 - -[ ] clm4_0 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in ../CTSMMasterChecklist as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: added unit tests - -Code reviewed by: bill sacks - - -CTSM testing: - - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne ---- PASS - hobart ------ PASS - -CTSM tag used for the baseline comparisons: ctsm1.0.dev020 - - -Answer changes --------------- - -Changes answers relative to baseline: no, b4b - - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): #599 Adding isotope - tracer ratios -(https://github.com/ESCOMP/ctsm/pull) - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev020 -Originator(s): Sean Swenson, Bill Sacks -Date: Mon Dec 3 11:51:24 MST 2018 -One-line Summary: New options for irrigation and crop fsat - -Purpose of changes ------------------- - -Introduce three new options: - -(1) Ability to withdraw irrigation water from groundwater if not enough - water is available from rivers. This is controlled via new namelist - flag, use_groundwater_irrigation. Water can be withdrawn from both - the unconfined (from the soil column) and confined (from wa) - aquifers. - -(2) Irrigation method: sprinkler (above canopy) vs. drip (below - canopy). This can be set on a per-crop and per-gridcell basis on the - surface dataset, but out-of-the-box support for creating the - necessary surface dataset field is not yet in place (see - ESCOMP/ctsm#565). For now, it can be controlled globally via a new - namelist flag, irrig_method_default. The default is drip, which was - what we were previously using implicitly. - -(3) Set crop fsat to zero. This is controlled by a new namelist option, - crop_fsat_equals_zero. - -Default behavior is the same as before for all three options. - -Also: - -- If use_aquifer_layer is false (which is the default for CLM50), no - longer reset wa_col every time step - -- Adds indices to vector history files giving column, landunit and - gridcell indices for each patch, etc. (Resolves ESCOMP/ctsm#81: - "Restart files are different for CLM when run over different number of - tasks" (issue name is a misnomer of the remaining to-dos in that - issue.) - -- Writes 3d time-constant fields on first history file for all tapes, - not just the first - -- Small performance improvements to irrigation - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Resolves ESCOMP/ctsm#81 ("Restart files are different for CLM when run - over different number of tasks", but that name was a misnomer for the - remaining work needed on the issue) - -Known bugs introduced in this tag (include github issue ID): -- ESCOMP/ctsm#565: Surface dataset enhancements needed for irrigation method - - -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.] - -[ ] clm5_0 - -[ ] clm4_5 - -[ ] clm4_0 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): -- New namelist variables: - - use_groundwater_irrigation - - irrig_method_default - - crop_fsat_equals_zero -- Partial support for new surface dataset field: irrigation_method - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in ../CTSMMasterChecklist as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - -Changes to tests or testing: -- Added two tests of the new irrigation options -- Added an _includes directory to hold things that should be included by - testmods (not used directly) - - -Code reviewed by: Bill Sacks and Sean Swenson reviewed each other's code - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - ok - - Tests pass, namelists differ as expected - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne ---- ok - hobart ------ pass - - ok: tests pass, some answers change as noted below - -CTSM tag used for the baseline comparisons: ctsm1.0.dev019 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: Some CLM50 cases that are either cold start - or (unusually) use a CLM45 initial conditions file; it's possible - that non-cold-start configurations would see differences rarely. - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Larger than roundoff, same climate - - Differences arise due to no longer resetting wa_col to - aquifer_water_baseline every time step in BeginWaterBalanceSingle - if use_aquifer_layer is false (which is the default for - CLM50). (This change is needed to conserve water properly with the - new groundwater-based irrigation.) For the most part, wa_col - wasn't being changed when use_aquifer_layer is false (so no longer - resetting it has no effect if groundwater irrigation isn't being - used), but the one exception is the "work around of the negative - liquid water" added by Jinyun Tang in subroutine SoilWater (dated - Jan 14, 2015), which can be exercised when use_flexibleCN is - true. Sean Swenson did some experimentation, and found that the - code that updates wa_col is only exercised in the first time step - of a cold start run, and that finding is borne out in the test - suite results. However, it's possible that there are rare cases - when this is exercised later in a run. - - I have confirmed that this branch is bit-for-bit with the baseline - if I revert the addition of the use_aquifer_layer conditional - around the wa_col resetting in - BeginWaterBalanceSingle. Alternatively, nearly all tests are - bit-for-bit with the baseline if I remove the one line updating - wa_col in subroutine SoilWater (and also remove the endrun for - water balance errors from BalanceCheck); the one exception is the - waccmx_offline test, which uses a CLM45 initial conditions file in - a CLM50 configuration. - - The following tests had baseline failures: - - Cold start tests: - - ERP_D_Ld5.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-allActive - ERP_D_P36x2_Ld3.f10_f10_musgs.I2000Clm50BgcCrop.cheyenne_intel.clm-cropColdStart - ERP_P180x2_D_Ld5.f19_g17.I2000Clm50BgcDvCrop.cheyenne_intel.clm-crop - ERP_P36x2_Lm25.f10_f10_musgs.I2000Clm50BgcDvCrop.cheyenne_intel.clm-monthly - ERP_P72x2_Lm25.f10_f10_musgs.I2000Clm50BgcDvCrop.cheyenne_intel.clm-monthly - - Test that uses a CLM45 initial conditions file in a CLM50 - configuration: - - ERS_D_Ln9_P480x3.f19_g16.I2000Clm50SpGs.cheyenne_intel.clm-waccmx_offline - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -https://github.com/ESCOMP/ctsm/pull/523 - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev019 -Originator(s): sacks (Bill Sacks) -Date: Fri Nov 30 13:36:57 MST 2018 -One-line Summary: Rework cold start initialization of wa and zwt - -Purpose of changes ------------------- - -Rework cold start initialization of wa and zwt when use_aquifer_layer is -false to reduce answer changes in upcoming groundwater_irrigation -branch. - -In the groundwater_irrigation branch -(https://github.com/ESCOMP/ctsm/pull/523), Sean Swenson has stopped -resetting wa_col each time step if use_aquifer_layer is false. However, -this leads to having a substantially different value of wa_col when -use_aquifer_layer is false: previously, it was reset to -aquifer_water_baseline each time step, but with Sean's changes, it stays -close to its initial values, which have been 4000 in most places. This -tag changes the initial values to match the value it was being reset to, -so it simply starts at aquifer_water_baseline - so the -every-time-step-resetting to aquifer_water_baseline can be removed -without massively changing the value of wa_col. - -In addition to changing the cold start initialization of wa_col, we are -also changing the cold start initialization of zwt in this case where -use_aquifer_layer is false: The old initialization of zwt wouldn't work -as intended now that we have changed the initial value of wa_col; Sean -Swenson suggested this new initialization method instead. This -initialization to zi(c,nbedrock(c)) is correct if there are no saturated -layers, and close enough for a decent cold start even if there are. - - -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.] - -[ ] clm5_0 - -[ ] clm4_5 - -[ ] clm4_0 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in ../CTSMMasterChecklist as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: Sean Swenson - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne ---- ok - hobart ------ ok - - ok means tests pass, answers change as expected for some cases - -CTSM tag used for the baseline comparisons: ctsm1.0.dev018 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: CLM50 cold start or transient (Hist) cases - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - Larger than roundoff, same climate (not investigated completely - rigorously through long simulations, but Sean Swenson and Bill - Sacks are both pretty confident that the resulting changes will be - small, partly based on difference statistics from the test suite, - and partly based on the fact that the only change in this tag is - in cold start initialization of some values). - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -https://github.com/ESCOMP/ctsm/pull/577 - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev018 -Originator(s): sacks (Bill Sacks) -Date: Thu Nov 29 16:03:50 MST 2018 -One-line Summary: Water tracer updates for initial things in driver loop - -Purpose of changes ------------------- - -Update water tracers for initial stuff done in driver loop. This includes -atm2lnd forcings (non-downscaled and downscaled), balance check initialization, -and dyn subgrid updates. - -Broadly speaking, the changes here are: - -(1) Reworked WaterType to make it easier / more robust for other code to loop - over tracers or bulk+tracers - -(2) The most interesting changes are probably the code to update the atm2lnd - water tracers (in Wateratm2lndType.F90 and WaterTracerUtils.F90) - -(3) In various other places, do some infrastructurey stuff (initializing water - balance, doing dyn subgrid stuff) for tracers as well as bulk - -(4) Supporting unit tests and unit test infrastructure - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -Resolves ESCOMP/ctsm#487 -Resolves ESCOMP/ctsm#488 -Resolves ESCOMP/ctsm#489 - - -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.] - -[ ] clm5_0 - -[ ] clm4_5 - -[ ] clm4_0 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in ../CTSMMasterChecklist as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): -- We have chosen not to set all water tracers as soon as possible, but instead - to do these tracer settings later in the driver loop. This keeps the driver - loop cleaner, but means that you cannot arbitrarily sprinkle calls to - TracerConsistencyCheck throughout the driver. Specifically for this tag: the - non-downscaled, gridcell-level atm2lnd water tracers are not updated until - after the call to downscale_forcings, so tracer consistency checks before that - point would fail. - -Changes to tests or testing: -- Added a PFS test - -Code reviewed by: Portions of the design (and possibly code) have been reviewed -by Mat Rothstein, David Noone and Mariana Vertenstein - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne ---- ok - hobart ------ ok - - ok means tests pass, some answers change as expected - -CTSM tag used for the baseline comparisons: ctsm1.0.dev017 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: many - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - roundoff-level changes in sensible heat flux from precip conversion due to - refactoring this calculation; everything else bit-for-bit - - If bitwise differences were observed, how did you show they were no worse - than roundoff? via summarize_cprnc_diffs to see differences in the test suite - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -https://github.com/ESCOMP/ctsm/pull/572 - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev017 -Originator(s): slevis (Samuel Levis, Slevis Consulting LLC,303-665-1310) -Date: Wed Nov 28 14:27:50 MST 2018 -One-line Summary: Merge the collapse2gencrop branch - -Purpose of changes ------------------- - -These changes allow the model to not need to read 16-pft -datasets and rather read 78-pft datasets. The 78-pft datasets were -developed for use with prognostic crops originally. The current changes -allow the model to use the 78-pft datasets in 16-pft runs by -collapsing the crop pfts (cfts) from specific types to the model's -generic crop types. The changes are generic so that the model may still -read 16-pft datasets for 16-pft runs. Ultimately these changes will -permit users to run with any number of pfts, while the ctsm group -maintains a single set of input pft data. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): Fixes #509 (partial) - #509 -- irrigate in 1850 is off for runs with use_crop but on for those without - -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.) - -[ ] clm5_0 - -[ ] clm4_5 - -[ ] clm4_0 - -Notes of particular relevance for users ---------------------------------------- - -Changes made to namelist defaults (e.g., changed parameter values): -- maxpatch_pft made obsolete -- nnegcrit was increased because of failure in the TRENDY simulations. -This was done in the source, rather than the namelist but does have an -effect on user behavior. - -Substantial timing or memory changes: No - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in ../CTSMMasterChecklist as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - - The "irrigate" attribute should now be removed from all fsurdat files for namelist generation. - Thus irrigate on or off is now an option for non-crop cases. - - -Renamed parameters: -maxpatch_pft is obsolete; remove from namelist-related scripts in future PR -numpft + 1 ---> maxsoil_patches -maxpatch_pft ---> maxsoil_patches in CNDV -numpft ---> maxveg -numpft_ed ---> maxveg_fates - -Several modules were made default private. The list of variables in them -that are public are explicitly listed now: -LakeCon.F90 -clm_initializeMod.F90 -clm_instMod.F90 -clm_varpar.F90 -pftconMod.F90 -subgridAveMod.F90 - -Changes to tests or testing: -New test -New unit tests in test_surfrdUtils.pf, all containing the prefix -test_collapse_crop_types_* - -Code reviewed by: -Erik Kluzek and Bill Sacks - -CTSM testing: -Regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- PASS - hobart_pgi -------- OK - hobart_intel ------ PASS - -CTSM tag used for the baseline comparisons: ctsm1.0.dev016 - -Answer changes --------------- - -Changes answers relative to baseline: NO - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None - -Pull Requests that document the changes (include PR ids): #483 - -Sam Levis cloned Erik Kluzek's collapse2gencrop branch and then -tested, corrected errors, resolved conflicts, added unit tests, while -updating to newer tags as needed. - - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev016 -Originator(s): sacks (Bill Sacks) -Date: Thu Nov 1 07:27:48 MDT 2018 -One-line Summary: Update cime, fix FATES DEBUG token, add script to easily run system tests - -Purpose of changes ------------------- - -(1) Update to latest version of cime master - -(2) Update FATES with a minor change: change DEBUG to debug, to allow - working with a preprocessor-defined DEBUG token - -(3) Add a script (run_sys_tests) that allows easily running all system - tests (see - https://github.com/ESCOMP/ctsm/wiki/System-Testing-Guide#running-test-suites-with-the-run-sys-tests-wrapper - for details) - -(4) As part of (3), start work on a CTSM python library and associated - test infrastructure. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Fixes ESCOMP/ctsm#535 (Run Fortran unit tests as part of create_test) - -CIME Issues fixed (include issue #): -- Various - see CIME ChangeLog for details - - -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_0 - -[X] clm4_5 - -[X] clm4_0 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in ../CTSMMasterChecklist as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: -- New run_sys_tests wrapper -- Fortran unit tests now run as part of aux_clm - -Code reviewed by: Erik Kluzek - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - tools-tests (test/tools): - - cheyenne - not run - - PTCLM testing (tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne ---- ok - hobart ------ ok - - ok means tests pass, baselines fail as expected - -CTSM tag used for the baseline comparisons: ctsm1.0.dev015 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: All I compsets (except spinup test that uses cplhist datm forcing) - - what platforms/compilers: All - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Potentially new climate - - Changes answers for I compsets due to datm update as part of the cime - update: new presaero and CO2 datasets - (https://github.com/esmci/cime/pull/2828) - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): -- cime: cime5.7.3 -> cime5.7.5 -- fates: fates_s1.8.1_a3.0.0 -> fates_s1.8.1_a3.0.0_rev2 - -Pull Requests that document the changes (include PR ids): -- https://github.com/escomp/ctsm/pull/493 (Wrapper to system tests, and - start of a ctsm python library) - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev015 -Originator(s): sacks (Bill Sacks) -Date: Sun Oct 28 14:29:30 MDT 2018 -One-line Summary: CMIP6 compset modifiers, usermods for typical output, and other output enhancements - -Purpose of changes ------------------- - -(1) Support %BGC-CROP-CMIP6DECK and %BGC-CROP-CMIP6WACCMDECK compset - modifiers, so that we can turn on the necessary options - (output-related and others) via new CMIP6-specific compsets. - -(2) Turn on carbon isotopes in CMIP6 runs (from Erik Kluzek) - -(3) Remove setting of CCSM_BGC=CO2A in the cmip6 usermods - -(4) Add usermods directories for getting typical extra output that's - wanted in many cases: output_crop, output_crop_highfreq, output_bgc, - output_bgc_highfreq, output_sp, and output_sp_highfreq. These can be - enabled by adding something like '--user-mods-dir output_crop' on - the create_newcase line (that short-hand works for an I compset; for - F or B compsets, you need to provide the full path to the usermod - directory). - -(4) Allow holes in the number of history tapes. Holes are cases where, - for example, we have h0, h1 and h3 tapes, but no h2 tape (because - there are no fields on the h2 tape). (This is needed for (3).) - -(5) Fix reading and writing of 1-d logical global arrays. This fixes - ESCOMP/ctsm#24 for real (rather than just preventing an attempt to - read/write 1-d logical arrays, as was done in the previous 'fix'). - -(6) Add C13_NBP and C14_NBP diagnostic fields (from Keith Oleson) - -(7) Make a bunch of carbon isotope diagnostic fields inactive by default - -(8) Don't allow interpolation (use_init_interp) from a case without - carbon isotopes to a case with carbon isotopes: Due to - https://github.com/ESCOMP/ctsm/issues/67, interpolation from a case - without carbon isotopes to a case with carbon isotopes yields - incorrect initialization values for the carbon isotopes. Now that - we're turning carbon isotopes on via some semi-out-of-the-box - usermods (for cmip6), it is becoming more important to check to make - sure someone doesn't shoot themselves in the foot this way. - -(9) Add tests of the new output usermods as well as of the CMIP6 compset - modifiers - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Fixes #24 for real (ncd_io_1d_log_glob is broken) -- Fixes #529 (Organize usermods_dirs to facilitate running cases with - the right output) - - -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.] - -[ ] clm5_0 - -[ ] clm4_5 - -[ ] clm4_0 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): -- New namelist variable, just for testing purposes: - for_testing_allow_interp_non_ciso_to_ciso. This bypasses an error - check, and should only be used in tests. - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in ../CTSMMasterChecklist as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: -- Reworked tests of cmip6_deck usermods to use the new - %BGC-CROP-CMIP6DECK compset modifier, and changed f09_g16 to f09_g17 -- Added a test of the %BGC-CROP-CMIP6WACCMDECK compset modifier -- Added tests of output_crop_highfreq, output_bgc_highfreq and - output_sp_highfreq usermods directories -- Note that there are NO tests covering the cmip6_evolving_icesheet - usermods: this usermod directory adds very little beyond cmip6_deck, - so it didn't seem worth its own test - -Code reviewed by: Erik Kluzek - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - unit-tests (components/clm/src): - - cheyenne - pass - - tools-tests (components/clm/test/tools): - - cheyenne - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne_intel ---- pass - cheyenne_gnu ------ pass - hobart_nag -------- pass - hobart_pgi -------- pass - hobart_intel ------ pass - - ERI_D_Ld9.T31_g37.I2000Clm50Sp.cheyenne_intel.clm-SNICARFRC - initially failed COMPARE_base_hybrid, COMPARE_base_rest and BASELINE - comparisons. I reran it and it passed. - - Manually compared all history files from - ERS_Ly3.f10_f10_musgs.I1850Clm50BgcCropCmip6.cheyenne_intel.clm-basic - with baseline - ERS_Ly3.f10_f10_musgs.I1850Clm50BgcCrop.cheyenne_intel.clm-cmip6. They - were all identical. Also compared all history files from - SMS_Ld5_D.f09_g17.I1850Clm50BgcCropCmip6.cheyenne_intel.clm-basic - with baseline - SMS_Ld5_D.f09_g17.I1850Clm50BgcCrop.cheyenne_intel.clm-cmip6. They - were all identical (but note that this basically just compared the - cpl.hi file: the test was too short to produce monthly files.) - -CTSM tag used for the baseline comparisons: ctsm1.0.dev014 - - -Answer changes --------------- - -Changes answers relative to baseline: NO - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -- https://github.com/ESCOMP/ctsm/pull/536 - Allow holes in the number of - history tapes and reorganize cmip6 usermods (main PR containing all of - these changes) -- https://github.com/ESCOMP/ctsm/pull/527 - Add carbon_isotope user-mod - directory to turn on c13 and c14 -- https://github.com/ESCOMP/ctsm/pull/539 - Support a %CMIP6DECK compset - modifier - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev014 -Originator(s): sacks (Bill Sacks) -Date: Fri Oct 26 06:20:34 MDT 2018 -One-line Summary: Miscellaneous minor, bit-for-bit bug fixes - -Purpose of changes ------------------- - -Four miscellaneous minor, bit-for-bit bug fixes: - -(1) Py3 pylint check and address cime issue ESMCI/cime#2822 (from Jim - Edwards: ESCOMP/ctsm#526) - -(2) Change uppercase DEBUG variables to lowercase debug (requested by - Jim Edwards to avoid conflicting with the DEBUG CPP token) - (Fixes ESCOMP/ctsm#534) - -(3) Remove unnecessary line of code in LunaMod.F90 that was causing - problems with some compilers due to an uninitialized variable - (Fixes ESCOMP/ctsm#322) - -(4) Add r8 to 0 constant to fix build issue with XLF compiler (from Jim - Edwards: ESCOMP/ctsm#531) - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Fixes ESCOMP/ctsm#322 (ERS_D_Ld5.f19_g16.I2000Clm50BgcCruGs run FAIL (intel)) -- Fixes ESCOMP/ctsm#534 (Rename DEBUG to debug in a few places) - - -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.] - -[ ] clm5_0 - -[ ] clm4_5 - -[ ] clm4_0 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in ../CTSMMasterChecklist as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - -Changes to tests or testing: none - -Code reviewed by: different pieces reviewed by different people - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - unit-tests (components/clm/src): - - cheyenne - pass - - tools-tests (components/clm/test/tools): - - cheyenne - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne_intel ---- ok - cheyenne_gnu ------ ok - hobart_nag -------- ok - hobart_pgi -------- ok - hobart_intel ------ ok - - ok means tests and baseline comparisons pass. There were unexpected - NLCOMP diffs. From spot-checking a few tests, I see the following: - - - (1) On both cheyenne and hobart: Diffs in logfile. This looks like a - problem in cime: it says: - - BASE: logfile = 'rof.log.136342.hobart.cgd.ucar.edu - COMP: logfile = 'rof.log - - (2) On hobart: Diffs in pio_typename: netcdf vs. pnetcdf (says that - new uses pnetcdf): but when I compare files by hand, they look - the same in this respect (both baseline and new use netcdf), so - maybe this is due to a problem in the timing of when nlcomp is - run? - - Since these both look like problems in the comparison script rather - than in the tag, I'm letting these go, but will open a cime issue if - we see this again. - - -CTSM tag used for the baseline comparisons: ctsm1.0.dev013 - - -Answer changes --------------- - -Changes answers relative to baseline: NO - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -- https://github.com/ESCOMP/ctsm/pull/531 (fix build issue with xlf compiler) -- https://github.com/ESCOMP/ctsm/pull/526 (fix cime issue 2822 and pylint chk) - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev013 -Originator(s): erik (Erik Kluzek)/slevisconsulting -Date: Thu Oct 25 18:09:47 MDT 2018 -One-line Summary: Fix the fact that transient Bgc and SP cases had constant crop area in time - -Purpose of changes ------------------- - -Fix transient non-crop cases that had constant crop area so that crop area will change in time -(and hence natural veg area will also change corresponding to it). - -Also bring in changes to update mksurfdata_map to handle SSP-RCP future scenarios. Right now -it can handle SSP5-8.5 out of the box. Also add a new test for that. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): #538 - #538 -- In transient pft simulations with use_crop=.false., %crop does not advance from 1850 values - -Known bugs found since the previous tag (include github issue ID): #545 - #545 -- Antarctica ice shelves are being treated as wetlands rather than glaciers - - -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_0 - -[X] clm4_5 - -[ ] clm4_0 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): A few more namelist checks - Added a check to make sure do_transient_pfts was the same as do_transient_crops - Don't allow use_fertilizer for non-crop case - namelist checks that create_crop_landunit=T except for FATES - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): - New -ssp_rcp option to mksurfdata.pl - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): New mksrfpft datasets in XML for SSP5-8.5 - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in ../CTSMMasterChecklist as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - Now, do_transient_pfts and do_transient_crops only work in unison, and hence - should be simplified to one logical called do_transient_veg - -Changes to tests or testing: Add new SSP5-8.5 mksurf test - -Code reviewed by: self, slevisconsulting, billsacks - -CTSM testing: regular, tools - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS (18 of the transient test namelists are different to baseline as expected) - - unit-tests (components/clm/src): - - cheyenne - PASS - - tools-tests (components/clm/test/tools): - - cheyenne - OK (PTCLM tests fail) - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CTSM tag used for the baseline comparisons: ctsm1.0.dev012 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes! - - Summarize any changes to answers, i.e., - - what code configurations: clm4_5/clm5_0 transient simulations without Crop (either Bgc or SP) - - what platforms/compilers: All - - nature of change: crop areas increase in time and impact simulations - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: dll/clm50_r267_1deg_GSWP3V1_iso_hist_nocrop_transientfix - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None - -Pull Requests that document the changes (include PR ids): #546, #540 -(https://github.com/ESCOMP/ctsm/pull) - - #546 -- Add in ability for mksurfdata_map to handle ssp_rcp scenarios and specifically SSP5-8.5 - $540 -- Transient PFT issue - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev012 -Originator(s): erik (Erik Kluzek) -Date: Sat Sep 29 11:49:35 MDT 2018 -One-line Summary: Add snow-free fields for snowmip, fix several issues - -Purpose of changes ------------------- - -Bring in new diagnostic fields added by Justin Perket, Sean Swenson and Mark Flanner -for Snow-MIP. Most of those are fields that represent "Snow Free" data. - -Also bring in fixes for a list of issues. Add handling of the new CO2 which includes -both latitude-band and global average versions. Add some changes to make it easier -for input data processing including NOT doing the slow 1km map file creation. Have -the number of steps that are skipped at startup dependent on the time-step size. Add -a test for some requirements of WACCMX (time-step and use of ESMF). Calculations of -local time are now done in a global subroutine, that can handle negative longitudes. -Fix how FFIX_TO_SMINN is handled for history output. The namelist logical "calc_human_stress_indices" -changed from logical to a character string of three values: FAST, NONE, ALL. FAST -is the default so the less expensive ones are output, NONE turns them all off, and ] -ALL does all of them including the expensive ones. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): #428, #474, #475, #476, #450, #482, #481, #491 - Fix #428 -- Update getco2_historical.ncl to handle latitude varying CO2 - Fix #474 -- Add ability to send GRIDFILE to regridbatch.sh script - Fix #475 -- Have number of steps to skip balance-check based on time - Fix #476 -- Add a test for WACCMX standalone - Fix #450 -- Add option to use global average of terrain standard deviation on surfdata files - (partial fix with simplest option) - Fix #482 -- Add extra field on CO2 streams file for global/time-averaged data - Fix #481 -- FFIX_TO_SMINN needs to be output when FUN is on - Fix #491 -- Calculations of local noon assume that longitude is 0 to 360 rather than -180 to 180 - -Known bugs introduced in this tag (include github issue ID): cime#2801 - cime#2801 -- Problem building with ESMF_LIB - -Known bugs found since the previous tag (include github issue ID): #507, #505 - #507 -- Albedo's are bad at night with negative longitudes - #505 -- CTSM input data-set tools can only work on 0-360 grids, and require monotone increasing longitude - - -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.] - -[ ] clm5_0 - -[ ] clm4_5 - -[ ] clm4_0 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): - - New namelist: - use_ssre -- Turn on show free fields needed for SnowMIP - - Changed namelist: - calc_human_stress_indices changed from logical to character with options: ALL, FAST, NONE - - New history fields: - Mostly added Snow Free (SF) fields - ALBDSF - ALBISF - FSRSF - FSRSFND - FSRSFNDLN - FSRSFNI - FSRSFVD - FSRSFVDLN - FSRSFVI - SSRE_FSR - SSRE_FSRND - SSRE_FSRNDLN - SSRE_FSRNI - SSRE_FSRVD - SSRE_FSRVDLN - SSRE_FSRVI - -Changes made to namelist defaults (e.g., changed parameter values): - calc_human_stress_indices = 'FAST' is now the default - -Changes to the datasets (e.g., parameter, surface or initial files): - mkghg_bndtvghg -- Update with new CO2 files, both monthly, lat-bands and yearly, global - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in .CTSMTrunkChecklist as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - I was able to reduce the duplication in SurfaceAlbedoMod where the original implementation added a cut - and paste copy of code. But, there is still a lot of duplication in this file that could be improved, by - making smaller functions/subroutines to do sections of code that are essentially repeated many times. - There's a bit of an increase in complexity to reduce the duplication, but reducing the duplication was worth it. - -Changes to tests or testing: - Add a new waccmx_offline test mods and test with it - New test expected fail because of cime issue: ERS_D_Ln9_P480x3.f19_g16.I2000Clm50SpGs.cheyenne_intel.clm-waccmx_offline - Turn use_ssre on for most tests, off for reducedOutput - And set calc_human_stress_indices=NONE for reducedOutput, FAST for most, and ALL for KitchenSink and KSMOut tests - -Code reviewed by: self, @olyson, @billsacks - - -CTSM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CTSM tag used for the baseline comparisons: ctsm1.0.dev011 - - -Answer changes --------------- - -Changes answers relative to baseline: no bit-for-bit - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): No - -Pull Requests that document the changes (include PR ids): #462 #449 -(https://github.com/ESCOMP/ctsm/pull) - - #462 -- Add namelist item to calculate all heat stress indices only if requested; to speed up model - #449 -- Bring in snowmip diagnostic fields - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev011 -Originator(s): sacks (Bill Sacks), mvr (Mathew Rothstein) -Date: Wed Sep 12 10:50:31 MDT 2018 -One-line Summary: Add water tracer consistency checks, and other water tracer work - -Purpose of changes ------------------- - -1. Add water tracer consistency checks - -2. Add infrastructure for looping over all water tracers - currently - just used for the tracer consistency checks - -3. Breakout of atm2lnd and lnd2atm water variables, needed for water tracers - -4. Add some namelist control over the addition of water tracers - -5. Add a system test that exercises the water tracer consistency checks - -6. Add a 'ratio' variable for each water tracer - -7. Add some unit tests of the new water tracer infrastructure - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Partially addresses #357 -- Resolves #479 -- Resolves #492 - -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.] - -[ ] clm5_0 - -[ ] clm4_5 - -[ ] clm4_0 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): -- Don't be fooled by the new namelist variable, enable_water_isotopes: - This is just a place-holder for now, not implying that water isotopes - are actually working. - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): -- New namelist variables: enable_water_tracer_consistency_checks and - enable_water_isotopes. The latter is just a place-holder for now. - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in .CTSMTrunkChecklist as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: New test that runs the water tracer consistency check - I ran this test on cheyenne_gnu and cheyenne_intel along with the - out-of-the-box hobart_nag version - -Code reviewed by: Mat Rothstein and I have worked together on many of -these changes, but not all code has been reviewed by the other. - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - ok (tests pass, clm4_5 and clm5_0 namelists differ from - baseline as expected) - - unit-tests (components/clm/src): - - cheyenne - pass - - tools-tests (components/clm/test/tools): - - cheyenne - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne_intel ---- pass - cheyenne_gnu ------ pass - hobart_nag -------- pass - hobart_pgi -------- pass - hobart_intel ------ pass - -CTSM tag used for the baseline comparisons: ctsm1.0.dev010 - - -Answer changes --------------- - -Changes answers relative to baseline: NO - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -- https://github.com/ESCOMP/ctsm/pull/497 - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev010 -Originator(s): sacks (Bill Sacks) -Date: Thu Aug 30 17:14:28 MDT 2018 -One-line Summary: Update cime to cime5.7.3 - -Purpose of changes ------------------- - -Update cime from cime5.6.10 to cime5.7.3. To support this change, there -are also minor code changes related to the pause-resume implementation -(from Erik Kluzek). - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- ESCOMP/ctsm#384 (VIC test is failing at f09 resolution with signal) - (I'm not sure what fixed this, but it's passing now) - -CIME Issues fixed (include issue #): many - - -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.] - -[ ] clm5_0 - -[ ] clm4_5 - -[ ] clm4_0 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in .CTSMTrunkChecklist as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: self - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - unit-tests (components/clm/src): - - cheyenne - pass - - tools-tests (components/clm/test/tools): - - cheyenne - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne_intel ---- pass - cheyenne_gnu ------ pass - hobart_nag -------- pass - hobart_pgi -------- pass - hobart_intel ------ pass - -CTSM tag used for the baseline comparisons: ctsm1.0.dev009 - - -Answer changes --------------- - -Changes answers relative to baseline: NO - bit-for-bit - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): -cime: cime5.6.10 -> cime5.7.3 - -Pull Requests that document the changes (include PR ids): none - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev009 -Originator(s): sacks (Bill Sacks) -Date: Wed Aug 22 20:32:36 MDT 2018 -One-line Summary: Fix initialization of AnnET in InitAccVars - -Purpose of changes ------------------- - -InitAccVars was mistakenly setting qflx_evap_tot_col rather than -AnnET. This fix allows us to remove now-redundant cold start and restart -code for AnnET. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Fixes #480 -- Partially addresses #285 - - -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.] - -[ ] clm5_0 - -[ ] clm4_5 - -[ ] clm4_0 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in .CTSMTrunkChecklist as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: basic proposed changes reviewed by Erik Kluzek - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - unit-tests (components/clm/src): - - cheyenne - pass - - tools-tests (components/clm/test/tools): - - cheyenne - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne_intel ---- pass - cheyenne_gnu ------ pass - hobart_nag -------- pass - hobart_pgi -------- pass - hobart_intel ------ pass - -CTSM tag used for the baseline comparisons: ctsm1.0.dev008 - - -Answer changes --------------- - -Changes answers relative to baseline: NO - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): none - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev008 -Originator(s): erik (Erik Kluzek) -Date: Tue Aug 14 10:25:12 MDT 2018 -One-line Summary: Update 1850 ndep file and last year for streams for Historical transient cases - -Purpose of changes ------------------- - -Bring in changes from release-clm5.0.05. Update to latest Nitrogen Deposition file from simulations with WACCM for 1850. -Also fix an issue with the last year for historical transient cases. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): 461 - #461 -- increase last year in streams for transient - -Known bugs found since the previous tag (include github issue ID): [If none, remove this line] - #478 -- Bare soil g1 should be missing value or zero - - -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.] - -[ ] clm5_0 - -[ ] clm4_5 - -[ ] clm4_0 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): Last year extended for transient datasets - -Changes to the datasets (e.g., parameter, surface or initial files): New ndep dataset for 1850 - -Substantial timing or memory changes: - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in .CTSMTrunkChecklist as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: Lengthen some tests - -Code reviewed by: self - - -CTSM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS (11 show differences for 1850_control and 20thC_transient) - - unit-tests (components/clm/src): - - cheyenne - PASS - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CTSM tag used for the baseline comparisons: ctsm1.0.dev007 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes! - - Summarize any changes to answers, i.e., - - what code configurations: 1850_control or 20thC_transient for Clm50 - - what platforms/compilers: all - - nature of change: similar climate - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - - #477 -- Move changes from release-clm5.0.05 onto master - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev007 -Originator(s): sacks (Bill Sacks) -Date: Sun Aug 5 21:03:28 MDT 2018 -One-line Summary: Avoid glacier dynamic landunit adjustments in first time step - -Purpose of changes ------------------- - -Always avoid generating dynamic landunit adjustments for glacier area -changes in the first timestep of a startup or hybrid run - not just for -cold start or interpolated start. See the detailed discussion in -https://github.com/ESCOMP/ctsm/issues/340 for rationale. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Fixes #340 (Avoid generating dynamic landunit adjustment fluxes for - glacier changes in the first timestep) - - -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.] - -[ ] clm5_0 - -[ ] clm4_5 - -[ ] clm4_0 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in .CTSMTrunkChecklist as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: Erik Kluzek - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - unit-tests (components/clm/src): - - cheyenne - not run - - tools-tests (components/clm/test/tools): - - cheyenne - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne_intel ---- ok - cheyenne_gnu ------ pass - hobart_nag -------- pass - hobart_pgi -------- pass - hobart_intel ------ pass - - ok means tests pass; baseline failures as expected in these two - tests that do not use init_interp: - - FAIL ERI_N2_Ld9.f19_g17.I2000Clm50BgcCrop.cheyenne_intel.clm-default BASELINE ctsm1.0.dev006 - FAIL SMS_Lm13.f19_g17.I2000Clm50BgcCrop.cheyenne_intel.clm-cropMonthOutput BASELINE ctsm1.0.dev006 - - (The glacier area on the finidat file used in these tests - - clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c180715.nc - - seems to have come from an finidat_interp_dest file, and thus does - not match the glacier area from CISM.) - -CTSM tag used for the baseline comparisons: ctsm1.0.dev006 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: Startup / Hybrid runs that include CISM - (even NOEVOLVE) and do not use init_interp, due to: - - different PE layout in new case vs. the one that generated the - finidat (roundoff-level diffs) - - different glacier area on finidat file vs. what's in CISM - (greater than roundoff-level diffs) - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Roundoff-level for different PE layout, larger than roundoff but - should be same climate when there is different glacier area on the - finidat file vs. what's in CISM - - The differences arise from dynamic landunit adjustments of the - below-ground C and N states in the old code, as CTSM adjusts its - areas to match CISM's. In the new code, there are no C and N - adjustments in the first time step from this adjustment. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -- #470 (Avoid glacier dynamic landunit adjustments in first time step) - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev006 -Originator(s): sacks (Bill Sacks) -Date: Sat Aug 4 07:48:09 MDT 2018 -One-line Summary: Minor bug fixes, cleanup, documentation and enhancements - -Purpose of changes ------------------- - -A collection of minor bug fixes, code cleanup, documentation and -enhancements, all bit-for-bit. See list of issues fixed below for -details. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Fixes #24 (ncd_io_1d_log_glob is broken) -- Fixes #120 (Incorrect comments in Biogeophysics1Mod.F90 -- Fixes #217 (Change some cheyenne_gnu tests to cheyenne_intel) -- Fixes #245 (Put all .gitignore entries in top-level file) -- Fixes #272 (Code should error on missing mxsoil_color when SOIL_COLOR - is used) -- Fixes #283 (Add more helpful message about need to do init_interp with - wrong number of vertical layers) -- Fixes #367 (For cmip6 runs: Turn on cpl hist output needed to drive a - TG compset) -- Fixes #412 (Fix documentation of init_interp_method) -- Fixes #419 (Do not allow SOYFIXN diagnostic field with FUN) -- Fixes #464 (Some lines longer than 132 characters) -- Fixes #465 (Remove backwards compatibility check for snw_rds) -- Fixes #467 (Increase wallclock limit for test) - - -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.] - -[ ] clm5_0 - -[ ] clm4_5 - -[ ] clm4_0 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in .CTSMTrunkChecklist as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: -- Changed a single-point test from gnu to intel to get better debugging - information - (SMS_D_Ly6_Mmpi-serial.1x1_smallvilleIA.IHistClm45BgcCropQianGs.cheyenne_intel.clm-cropMonthOutput) -- For some single-point tests on both gnu and intel: removed one - compiler, keeping the tests on just one - -Code reviewed by: self - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - unit-tests (components/clm/src): - - cheyenne - pass - - tools-tests (components/clm/test/tools): - - cheyenne - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne_intel ---- pass - cheyenne_gnu ------ pass - hobart_nag -------- pass - hobart_pgi -------- pass - hobart_intel ------ pass - - NLCOMP failures as expected for tests with the cmip6 test mod - - Some long single-point gnu tests failed due to running out of - wallclock time; I have removed these, just keeping them on intel - (along with removing a few other tests after I ran the testing - see - commit 5c226bdf): - - FAIL ERS_Lm54_Mmpi-serial.1x1_numaIA.I2000Clm50BgcCropGs.cheyenne_gnu.clm-cropMonthOutput RUN time=4803 - FAIL ERS_Ly6_Mmpi-serial.1x1_smallvilleIA.IHistClm50BgcCropGs.cheyenne_gnu.clm-cropMonthOutput RUN time=6024 - - -CTSM tag used for the baseline comparisons: ctsm1.0.dev005 - - -Answer changes --------------- - -Changes answers relative to baseline: NO - bit-for-bit - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -- #392 (Remove old code for snw_rds restart that looks no longer needed) -- (Other changes not documented in PRs) - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev005 -Originator(s): sacks (Bill Sacks), mvr (Mathew Rothstein) -Date: Fri Aug 3 07:54:59 MDT 2018 -One-line Summary: Rework water data types to accommodate isotopes and other tracers - -Purpose of changes ------------------- - -This tag reworks the various water data types to allow having multiple -instances of variables that are needed for isotopes and other water -tracers. - -Specific changes include: - -(1) Separated "water state" variables into state, diagnostic and balance - check-related variables. This separation was not essential for the - work here, but was desired by Martyn Clark and others. - -(2) For each of water state, diagnostic and flux variables, separated - variables into those needed for both bulk and tracers vs. those only - needed for bulk. This way, we can have multiple instances of the - variables needed by tracers, but only a single instance of variables - that only apply to bulk water. This follows the design laid out in - https://github.com/escomp/ctsm/pull/395. The separation was based - largely on what was done in the old water isotope branch; we didn't - put a lot of thought into this, because the new design allows us to - easily migrate variables between bulk-only and bulk-and-tracer as - needed. - -(3) Moved water fluxes that were defined in science modules back into - waterflux_type or waterfluxbulk_type. This was needed for (2); there - is more discussion on this in - https://github.com/escomp/ctsm/pull/395 and the log message for - commit 711e5cd7. - -(4) Introduced a top-level water_type that holds instances of all of the - other water-related objects. This follows the design laid out in - https://github.com/escomp/ctsm/pull/395. This is particularly - valuable for the tracer instances: the logic related to number of - tracers can be encapsulated in water_type, rather than infiltrating - clm_instMod. - -(5) Added placeholders for water tracer instances - -(6) Added infrastructure to generate history / restart field names for - the tracer instances. Eventually, the isotope class can also hold - information specific to each isotope. - -This work was a joint effort between Mathew Rothstein and myself; Mat -gets much of the credit for the actual refactoring done here. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Fixes #358 (Separate WaterStateType into multiple types) -- Fixes #434 (Separate WaterFluxType into a base class and a class that just applies to bulk) -- Fixes #359 (Set up infrastructure for multiple instances of WaterState and WaterFlux types) -- Fixes #458 (Implement handling of history and restart variables for water tracers) - -Known bugs introduced in this tag (include github issue ID): -- #464 (Some lines longer than 132 characters) -- #456 (Remove backwards compatibility check for snw_rds) (not a - newly-introduced issue, but it's more important to fix this with the - separation of waterstate_type) - -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.] - -[ ] clm5_0 - -[ ] clm4_5 - -[ ] clm4_0 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in .CTSMTrunkChecklist as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): -- Water tracers are not yet functional - they are just placeholders -- Whether to use water tracers and which water tracers to use are - currently hard-coded; eventually, this should be namelist-controlled - -Changes to tests or testing: none - -Code reviewed by: Mathew Rothstein and Bill Sacks worked together on -these changes and reviewed each other's changes to some extent. The -high-level design was also reviewed and co-developed by Mariana -Vertenstein. Martyn Clark contributed substantially to the breakout of -water state into state, diagnostic and balance check-related variables. - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - unit-tests (components/clm/src): - - cheyenne - pass - - tools-tests (components/clm/test/tools): - - cheyenne - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne_intel ---- pass - cheyenne_gnu ------ pass - hobart_nag -------- pass - hobart_pgi -------- pass - hobart_intel ------ pass - -CTSM tag used for the baseline comparisons: ctsm1.0.dev004 - - -Answer changes --------------- - -Changes answers relative to baseline: NO - bit-for-bit - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -- https://github.com/escomp/ctsm/pull/395 (documents the high-level design) - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev004 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Wed Jul 18 02:10:23 MDT 2018 -One-line Summary: Add some new diagnostic fields, fix a few issues, update cmip6 output - -Purpose of changes ------------------- - -Add some new diagnostic fields. Some needed for CMIP6. Update the CMIP6 user-mods output. -Fix a couple issues. Get full list of history tapes working correctly. Check for valid range -of CO2. New IC file interpolated from the previous one for f19_g17_gl4 for 2000 Clm50BgcCrop. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): $210, #427, #429 - #210 -- increase number of history tapes - $427 -- Check for zero CO2 - #429 -- New IC for present day - -Significant changes to scientifically-supported configurations --------------------------------------------------------------- - -Does this tag change answers significantly for any of the following physics configurations? No -(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.] - -[ ] clm5_0 - -[ ] clm4_5 - -[ ] clm4_0 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): New history fields - TSKIN --- skin temperature - TSL ----- temperature of near-surface soil layer - GSSUNLN - sunlit leaf stomatal conductance at local noon - GSSHALN - shaded leaf stomatal conductance at local noon - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): New finidat file f19_g17_gl4 2000 Clm50BgcCrop - New file is just interpolate from the previous file to a f19_g17_gl4 gridfor Clm50BgcCrop and 2000 simulation year - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in .CLMTrunkChecklist as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - -Changes to tests or testing: None - -Code reviewed by: self, oleson, abtawfik - - -CTSM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - OK (95 are different because of finidat file change) - - unit-tests (components/clm/src): - - cheyenne - PASS - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- PASS - hobart_pgi -------- FAIL - hobart_intel ------ PASS - -CTSM tag used for the baseline comparisons: ctsm1.0.dev003 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes -- only 2000 cases because of new IC - - Summarize any changes to answers, i.e., - - what code configurations: Just 2000 cases - - what platforms/compilers: All - - nature of change: same climate - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - - - #338 -- Radtemp and other new diagnostic fields - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev003 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Sun Jul 15 00:26:46 MDT 2018 -One-line Summary: Update cime/cism to work on upgraded hobart and with glade changes on cheyenne - -Purpose of changes ------------------- - -Update cime and cism so can work on upgraded hobart. Also fix an issue that the Nag6.2 compiler found -in CTSM. Also get working with glade changes that happened on cheyenne, DIN_LOC_ROOT_CLMFORC was -changed to a new directory. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): [If none, remove this line] - #441 -- Changes in glade invalidate previous softlinks and data locations - #438 -- Illegal argument aliasing caught by nag6.2 - #433 -- with hobart upgrade CTSM not working - -Known bugs introduced in this tag (include github issue ID): - #444 -- PGI fails on cheyenne and hobart - -Known bugs found since the previous tag (include github issue ID): - #443 -- Wood C:N ratios - #440 -- leafcn_max < target leafcn? - -Significant changes to scientifically-supported configurations --------------------------------------------------------------- - -Does this tag change answers significantly for any of the following physics configurations? No -(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.] - -[ ] clm5_0 - -[ ] clm4_5 - -[ ] clm4_0 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): DIN_LOC_ROOT_CLMFORC on cheyenne - DIN_LOC_ROOT_CLMFORC was change on cheyenne - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in .CTSMTrunkChecklist as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: path for cheyenne specific test had to be changed - Add some gnu tests on hobart - Lengthen wallclock on a test - Fix path for DA test_mod - -Code reviewed by: self - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - tools-tests (components/clm/test/tools): - - cheyenne - PASS - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - OK - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- FAIL - hobart_gnu -------- PASS - hobart_intel ------ PASS - -CLM tag used for the baseline comparisons: ctsm1.0.dev002 - - -Answer changes --------------- - -Changes answers relative to baseline: No bit-for-bit - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cime, cism - cism-wrapper to release-cesm2.0.04 - cime to cime5.6.10 - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - #444 -- Get working on upgraded hobart and with glade changes on cheyenne - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev002 -Originator(s): erik (Erik Kluzek) -Date: Fri Jul 6 16:33:03 MDT 2018 -One-line Summary: Fix NFIX flux variables so special land-units are zeroed out, tools update, add some *_MAX fields on mksurfdata_map for transient cases - -Purpose of changes ------------------- - -Nitrogen Fixation flux arrays were being set to missing value over non-vegetated landunits. This sets them to zero everywhere -and averages in the zero's at the gridcell level for history output. It also reads in restarts with missing values and converts -them to zero's. - -There are also some tools updates, getting the tools working on the new upgraded hobart.cgd.ucar.edu. - -And mksurfdata_map is updated to add some *_MAX files on the landuse.timeseries files that will allow us to conserve memory -for transient cases. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): #435, #436, #433 (for tools) - #435 -- intel build for tools - #426 -- Nitrogen Fixation flux variables - #433 -- hobart broken, got it working for tools - -Known bugs found since the previous tag (include github issue ID): #433, #431 - - #433 -- with hobart upgrade, hobart build isn't working - #431 -- When set_* options are used to hist_addfld be careful of ordering - -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_0 - -[ ] clm4_5 - -[ ] clm4_0 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): ndep file updated for clm5_0 for 1850 - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in .CLMTrunkChecklist as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): NFIX flux variables - NFIX flux variables when read from restart have special-values (missing on non veg landunits) converted to zero's - They are now initialized to zero everywhere. - -Changes to tests or testing: None - -Code reviewed by: self, wwieder, and lawrence, sacks (mksurfdata_map code) - -CLM testing: regular (although none on hobart!) - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS (5 tests differ from previous version) - - unit-tests (components/clm/src): - - cheyenne - PASS - - tools-tests (components/clm/test/tools): - - cheyenne - PASS - hobart --- PASS - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - -CLM tag used for the baseline comparisons: ctsm1.0.dev001 - - -Answer changes --------------- - -Changes answers relative to baseline: clm5_0 BGC configurations with FUN and clm5_0 with BGC for new 1850 ndep file - - Summarize any changes to answers, i.e., - - what code configurations: All clm5_0 BGC due to NFIX fields, and clm5_0 1850 BGC due to new ndep file - - what platforms/compilers: All - - nature of change: similar climate - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - - #437 -- ChangeLog template - #432 -- nfix - #331 -- _MAX fields on mksurfdata_map - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev001 -Originator(s): sacks (Bill Sacks) -Date: Fri Jun 22 07:31:43 MDT 2018 -One-line Summary: Begin separating SoilHydrology flux calculations - -Note the new tag naming: Starting with this tag, we are naming tags -"ctsm..." rather than "clm...". We are starting with ctsm version 1, -which for now is nearly the same as clm version 5. We are moving to this -new tag naming now because: - -(1) The changes in this tag represent the first step towards - implementing the CTSM vision (separating the biogeophysics flux - calculations from state updates, making it easier to plug in - alternative parameterizations, etc.). - -(2) This tag changes answers relative to the CLM5 release. (We expect - the climate to be the same, but we haven't tested this carefully - yet.) - -Purpose of changes ------------------- - -First steps toward separating various flux calculations in the soil -hydrology code. The focus here is on saturated surface runoff and -infiltration excess runoff. The changes here separate flux calculations -from state updates and extract various calculations into their own -subroutines to facilitate swapping in alternative parameterizations. - -Most of the changes here are refactorings that are either bit-for-bit or -just introduce roundoff-level differences. However, there are also a few -larger answer changes, as described below. - -These are the greater-than-roundoff-level answer changes: - -(A1) Use full qflx_surf in BGC code. Previously, the subroutines ch4 and - SoilBiogeochemNLeaching had been using a flux that excluded surface - water runoff (qflx_h2osfc_surf). That was deemed to be incorrect - (by Dave Lawrence and others), so these BGC subroutines have been - changed to use the full surface runoff (saturated excess runoff + - infiltration excess runoff + h2osfc runoff). - - Configurations affected: BGC compsets - - Magnitude of change: Larger than roundoff; expected to be same - climate, but not investigated carefully - -(A2) VIC: Don't ever use the TOPModel formulation for SurfaceRunoff - - The code was using the TOPModel-based formulation for SurfaceRunoff - if frost_table > zwt_perched. Sean Swenson felt this shouldn't be - done, and refactoring will be easier if VIC always uses the - vic-looking formulation, so I'm stopping applying this formulation - when using VIC. - - Configurations affected: VIC compsets - - Magnitude of change: Larger than roundoff; not investigated carefully - -(A3) VIC: Remove infiltration excess runoff - - Martyn Clark reviewed the VIC implementation, and felt that the - current implementation of infiltration excess runoff is - inconsistent with the standard VIC implementation. It appears that - what was being called VIC's infiltration excess runoff was actually - just an attempt to give a better numerical approximation to the - solution for saturated surface excess runoff. So deleting this - leaves only a first-order approximation to VIC's saturated surface - excess runoff. - - Eventually we may want to put in place a more accurate solution for - VIC's saturated surface excess runoff. But Martyn's feeling is that - this can come in with other changes we want to make regarding - numerical solutions in CTSM. - - Configurations affected: VIC compsets - - Magnitude of change: Larger than roundoff; expected to be same - climate, but not investigated carefully - -(A4) Change in QOVER diagnostic field: now includes QH2OSFC. - -These are the major refactorings (either bit-for-bit or just -roundoff-level differences): - -(R1) Extract surface runoff to its own module, and other modularization - related to what used to be subroutine SurfaceRunoff: extract a - subroutine for each fsat method, move urban surface runoff code - into different routines. - -(R2) Extract infiltration excess runoff to its own module, and other - modularization related to what used to be subroutine Infiltration. - -NOTE: For a detailed breakdown of changes, including documentation of -which changed changed answers, see the file ChangeLog_branch which was -deleted from this branch shortly before it was merged to master. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Fixes #424 (decStart testmod is missing an `--append` in an xmlchange command) - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): - -Changes made to namelist defaults (e.g., changed parameter values): - -Changes to the datasets (e.g., parameter, surface or initial files): - -Substantial timing or memory changes: - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in .CLMTrunkChecklist as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - -Changes to tests or testing: -- Shortened a 25-month f19 test to 13-months - (SMS_Lm13.f19_g17.I2000Clm50BgcCrop.cheyenne_intel.clm-cropMonthOutput): - This test took a long time to run, and we already have long tests of - this configuration at coarse-resolution. I suggested removing this - test entirely, but Erik Kluzek wanted to maintain a shortened version - of it. Erik's comments were: - - How about either flip it to f45 (because Rosie is using that - resolution for science) -- or leave it at f19 and have it run for 9 - months? The 25 months was to take it just past the 2-year spinup - time. From spunup initial conditions 9-months pretty much does a - full harvest cycle. f19 and f09 are the main configurations for - science and it would be good to have something longer than just - really short tests. - - I decided on Lm13, because this still completes in significantly less - than 2-hours, and if we're running for 9 months anyway, it seems - valuable to finish out the year and run a bit into the next year, - since some crop stuff triggers at the end of the year. - -Code reviewed by: Various code reviews done last Fall, when these -changes were first implemented. - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - unit-tests (components/clm/src): - - cheyenne - PASS - - tools-tests (components/clm/test/tools): - - cheyenne - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - - OK means tests pass, answers change as expected. - -CLM tag used for the baseline comparisons: clm5.0.dev013 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: Essentially all (except CLM4) - - what platforms/compilers: All - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - Roundoff-level changes for nearly all configurations (except CLM4). - - Greater-than-roundoff-level changes for the following - configurations: - - BGC: see (A1) note above (expected to be same climate, but not - investigated carefully) - - VIC: see (A2) and (A3) notes above (magnitude of change not - investigated carefully) - - QOVER diagnostic field: see (A4) note above - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -- https://github.com/ESCOMP/ctsm/pull/244 -- https://github.com/ESCOMP/ctsm/pull/190 -- Other PRs that existed on the old NCAR/clm-ctsm repository (which has - been deleted), which were not migrated to the new repository - -=============================================================== diff --git a/doc/ChangeSum b/doc/ChangeSum index 205a0e665a..6dc5b4fc0d 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,25 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.1.dev020 erik 12/30/2020 Potential roundoff changes in preparation for bio-mass heat storage option + ctsm5.1.dev019 sacks 12/19/2020 Fix ndep from coupler + ctsm5.1.dev018 slevis 12/08/2020 Add ACTIVE (T/F) column to master hist fields table and alphabetize + ctsm5.1.dev017 slevis 11/17/2020 Write history fields master list to separate optional file + ctsm5.1.dev016 multiple 11/17/2020 Updates for nuopc + ctsm5.1.dev015 sacks 11/13/2020 A few small fixes + ctsm5.1.dev014 dll/oles 11/07/2020 Grass/crop snow burial fraction fix, and some other fixes + ctsm5.1.dev013 jedwards 11/04/2020 Allow pnetcdf for vector history files + ctsm5.1.dev012 oleson/s 11/03/2020 Allow nlevgrnd < nlevurb + ctsm5.1.dev011 sacks 11/02/2020 Change CISM2%NOEVOLVE compsets to use SGLC; documentation updates + ctsm5.1.dev010 sacks/je 10/23/2020 Fix reading netcdf variable into a different data type + ctsm5.1.dev009 negins 10/21/2020 BFB changes for Perturbed Parameter Ensemble and Hydraulic redistribution + ctsm5.1.dev008 erik 10/07/2020 Two answer changes: Clm45/50/51 with crop, and for 2000Clm51 + ctsm5.1.dev007 sacks 10/06/2020 CNFire: btran2 fixes and general cleanup + ctsm5.1.dev006 sacks 10/03/2020 Call correct routine to calculate btran2 for CNFireLi2021 + ctsm5.1.dev005 sacks 10/02/2020 Answer changing bug fixes for clm51: fire and organic_frac_squared + ctsm5.1.dev004 oleson 09/30/2020 Improve robustness of onset and offset counters when changing dt + ctsm5.1.dev003 ivanderk 09/29/2020 Add capability for dynamic lakes + ctsm5.1.dev002 slevis 09/25/2020 Reduce duplication between caps + ctsm5.1.dev001 erik 09/23/2020 Start the clm5_1 physics series, with some changes to the fire model from Fang Li ctsm1.0.dev113 negins 09/08/2020 Some bit-for-bit changes needed for the Perturbed Parameter Ensemble work ctsm1.0.dev112 sacks/ww 08/28/2020 Small changes to mksurfdata_map, singlept tool and run_sys_tests ctsm1.0.dev111 erik 08/28/2020 Compsets don't use 2014 for GSWP3 forcing, LUNA prevyr changed back diff --git a/doc/Makefile b/doc/Makefile index 47304542de..9b2c2dcd0d 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -12,12 +12,12 @@ BUILDDIR = build help: @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -# Before building html or pdf, obtain all of the images. This is needed -# because we have configured this repository (via an .lfsconfig file at -# the top level) to NOT automatically fetch any of the large files when -# cloning / fetching. -html: fetch-images -latexpdf: fetch-images +# 'make fetch-images' should be run before building the +# documentation. (If building via https://github.com/ESMCI/doc-builder, +# this is run automatically for you.) This is needed because we have +# configured this repository (via an .lfsconfig file at the top level) +# to NOT automatically fetch any of the large files when cloning / +# fetching. fetch-images: git lfs pull --exclude="" diff --git a/doc/build_docs b/doc/build_docs new file mode 100755 index 0000000000..97fb7aa9b2 --- /dev/null +++ b/doc/build_docs @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +if [ -f doc-builder/build_docs ]; then + echo "Running: doc-builder/build_docs --fetch-images $@" + doc-builder/build_docs --fetch-images "$@" +else + echo "Obtain doc-builder by running ./manage_externals/checkout_externals -o from the top-level" +fi diff --git a/doc/ctsm1_0_ChangeLog b/doc/ctsm1_0_ChangeLog new file mode 100644 index 0000000000..e02561d30a --- /dev/null +++ b/doc/ctsm1_0_ChangeLog @@ -0,0 +1,14843 @@ +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev113 +Originator(s): negins (Negin Sobhani,UCAR/TSS,303-497-1224) +Date: Tue Sep 8 15:57:49 MDT 2020 +One-line Summary: Some bit-for-bit changes needed for the Perturbed Parameter Ensemble work + +Purpose of changes +------------------ + +Some BFB fixes including bug fixes needed for PPE simulations. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/CTSM#1060 (Some code cleanup of luna bug fixes) +- Resolves ESCOMP/CTSM#1062 (PPE namelist parameter defaults) +- Resolves ESCOMP/CTSM#1053 (Non-standard namelist parameter) +- Resolves ESCOMP/CTSM#1055 (Expand potential vcmax:jmax ratio) + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): +cmb_cmplt_fact was a parameter under namelist control pertaining to the fire +model (combusion completion factor [unitless]), which previously included an array. +This parameter is now splitted into two real values i.e. cmb_cmplt_fact_litter and +cmb_cmplt_fact_cwd. +If the users have cmb_cmplt_fact in a user_nl_clm file that worked before, it +won't work anymore since it is now splitted into cmb_cmplt_fact_litter +and cmb_cmplt_fact_cwd. + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): +Previously, denitrif_nitrateconc_exponent and denitrif_nitrateconc_coefficient +were on the params file but ALSO on the namelist. They are now removed from the namelist. + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): None + +Substantial timing or memory changes: [For timing changes, can check PFS +test(s) in the test suite] None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double +maintenance): None + +Changes to tests or testing: None + + +CTSM testing: + + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- PASS (except for NLCOMP) + izumi ------- PASS (except for NLCOMP) + +If the tag used for baseline comparisons was NOT the previous tag, note that here: +ctsm1.0.dev111 + + +Answer changes +-------------- + +Changes answers relative to baseline: None + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): +None + +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/CTSM/pull/1102 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev112 +Originator(s): sacks (Bill Sacks), wwieder (Will Wieder) +Date: Fri Aug 28 17:10:57 MDT 2020 +One-line Summary: Small changes to mksurfdata_map, singlept tool and run_sys_tests + +Purpose of changes +------------------ + +(1) Move mksurfdata_map rounding of special landunits to before wetland + fill: I think this may be important to avoid errors and/or wrong + behavior in some edge cases where we have < 0.5% cover of glacier + and/or lake, and other cases. See + https://github.com/ESCOMP/CTSM/issues/1118 for detailed + thoughts. May change answers in rare cases, but no answer changes + observed for present-day surface datasets at standard resolutions + (f09, f19, f10, f45). + +(2) run_sys_tests: record command-line arguments in SRCROOT_GIT_STATUS + file + +(3) (From Will Wieder) Updates to current surfdata & landuse files in + tools/contrib/singlept + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/CTSM#1118 (mksurfdata_map rounding/truncation of + special landunits should happen before wetland filling) + + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: self + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - PASS + + Note: ran tools testing on code based off of ctsm1.0.dev110 (before + merging with ctsm1.0.dev111) + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - PASS on mac (bishorn) + + regular tests (aux_clm): + + cheyenne ---- not run + izumi ------- not run + +If the tag used for baseline comparisons was NOT the previous tag, note that here: ctsm1.0.dev110 + +Answer changes +-------------- + +Changes answers relative to baseline: NO + +In principle, the changes to mksurfdata_map could change answers for +rare cases. No answer changes were observed for present-day surface +datasets at resolutions f09, f19, f10 or f45. Also note that no surface +datasets were actually updated in this tag, so if any answer changes +appear from these changes, they would appear the next time we update +surface datasets. + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/CTSM/pull/1119 +https://github.com/ESCOMP/CTSM/pull/1120 +https://github.com/ESCOMP/CTSM/pull/1122 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev111 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Fri Aug 28 14:08:25 MDT 2020 +One-line Summary: Compsets don't use 2014 for GSWP3 forcing, LUNA prevyr changed back + +Purpose of changes +------------------ + +Update cime so that default end year for GSWP3 forcing is 2013 because 2014 data is bad. Also update +the prevyr default for vcmax/jmax to what it was before ctsm1.0.dev102. + +Fix some issues for finding initial condition files for Clm45 compsets. Also bring in updated CDEPS/CMEPS +as they were required with the cime update. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): + Fixes #1107 -- Change initial values of LUNA back to previous global values + Fixes #1067 -- Stop using PIO2 in the LILAC build + Fixes #1121 -- FMOZ test fails + +CIME Issues fixed (include issue #): + Fixes ESMCI/cime#3683 -- Avoid artificial limit on string lengths in shr_string_listMerge + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): + Last time-step in Dec/2013 for GSWP3 data still has zero humidity + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): None + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): None + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + cime is pointing to a branch_tag we should update it to a trunk tag as soon as possible + +Changes to tests or testing: build-namelist unit testing improved to find problems like #1121 a #1125 + +Code reviewed by: self + + +CTSM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS (all identical to previous tag) + + tools-tests (test/tools): + + cheyenne - PASS + + python testing (see instructions in python/README.md; document testing done): + + cheyenne - PASS + + regular tests (aux_clm): + + cheyenne ---- OK + izumi ------- PASS + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes (similar climate) + + Summarize any changes to answers, i.e., + - what code configurations: (2010 and SSP compsets) and Clm50 with LUNA on (Bgc or Sp) + - what platforms/compilers: All + - nature of change: similar climate + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cime, cmeps, cdeps + (fox removed as a separate checkout) + cime to branch_tags/cime5.8.31_a01 + +Pull Requests that document the changes (include PR ids): #1114 +(https://github.com/ESCOMP/ctsm/pull) + #1114 -- Update cime so default end year for GSWP3 forcing is 2013 and change prevyr default for vcmax/jmax + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev110 +Originator(s): jedwards (Jim Edwards) +Date: Fri Aug 21 10:49:08 MDT 2020 +One-line Summary: Fixes needed for PIO2 + +Purpose of changes +------------------ + +Fixes needed for CTSM to work with PIO2. There is an additional fix +needed in PIO2 itself; this is available in a later version of cime that +we will bring in soon. + +Note that this PR also includes a change in config_files.xml that is +needed for a newer version of cime when running compsets with dlnd, slnd +or xlnd; this may be incompatible with the current version of the cime +external, but this does not impact compsets with CTSM. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +The changes in this tag, together with a cime update that will be coming +in soon, resolve the following issues (I'm not sure off-hand which +issues are resolved by the changes here alone and which ones require the +cime update): +- Resolves ESCOMP/CTSM#1029 (FATES tests fail with PIO2) +- Resolves ESCOMP/CTSM#1030 (mpi-serial nag case fails with pio2 when + defining h1 history restart file) + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): +- May not be able to run configurations with dlnd, slnd or xlnd from this tag + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: Not investigated, but almost definitely not + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: Bill Sacks + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- PASS + izumi ------- PASS + + Note: Standard testing was done using PIO1 (as this is still the + default), but separate testing was also done using PIO2 (using an + updated cime) and tests were found to pass. + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: NO + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/CTSM/pull/1095 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev109 +Originator(s): negins (Negin Sobhani,UCAR/TSS,303-497-1224) +Date: Thu Aug 20 11:40:07 MDT 2020 +One-line Summary: Allow for resorbtion in transition from live to dead wood N + +Purpose of changes +------------------ + +This PR allows for resorbtion in transition from live to dead wood N, which also move +to NPOOL for free. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): Issue #443 + + +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.) + +[x] clm5_0 + +[x] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist +variables): None + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): None + +Substantial timing or memory changes: [For timing changes, can check PFS test(s) in the test suite] + +Notes of particular relevance for developers: None +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + +Changes to tests or testing: None + +Code reviewed by: Erik Kluzek + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- PASS + izumi ------- PASS + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: YES (similar climate) + + Summarize any changes to answers, i.e., + - what code configurations: Clm50 with Bgc or Cn + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new + climate): larger than roundoff/same climate + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + + Will Wieder thought the changes were small enough that we didn't need to do + a long simulation. Erik Kluzek thinks the changes were verified with single + point simulations. + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev108 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Wed Aug 19 17:23:47 MDT 2020 +One-line Summary: Update default PE layouts for new SE/FV3 grids + +Purpose of changes +------------------ + +Change PE layouts for new high resolution SE/FV3 grids. Have a version for cheyenne and a default one +as well. + +Update externals: cime, cism, CMEPS, CDEPS +Change single point tests to use stub ROF +Change tests to use gx1v7 rather than gx1v6 +Update waccmx_offline to use START=1979 + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): + Fixes #1108 Change single point tests to use stub ROF + Fixes #1098 ARCTICGRIS PE layout is very slow + Fixes #1105 Default new FV3/SE grid PE layouts are problematic + Fixes #1103 Some changes to prevent missing file for WACCMX testing + Fixes #1113 ARCTIC test is failing + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? No +(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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): None + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): None + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + Some tests were chagned to use stub ROF and one to stub GLC. @billsacks suggest we should also change + other tests in this same way. + +Changes to tests or testing: Yes + +Code reviewed by: self + + +CTSM testing: regular, tools + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + tools-tests (test/tools): + + cheyenne - PASS + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - OK + + python testing (see instructions in python/README.md; document testing done): + + cheyenne -- PASS + + regular tests (aux_clm): + + cheyenne ---- PASS + izumi ------- PASS + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: No (except for waccmx_offline test) + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cime, cism, CDEPS, CMEPS + cism to cism2_1_69 + cime to cime5.8.30 + Update hash for CDEPS and CMEPS (so that nuopc test will run) + +Pull Requests that document the changes (include PR ids): #1111 +(https://github.com/ESCOMP/ctsm/pull) + + #1111 -- Adjust FV3/SE PE layouts + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev107 +Originator(s): erik (Erik Kluzek) +Date: Mon Aug 10 02:21:12 MDT 2020 +One-line Summary: Answer changes needed for CESM2.2.0 + +Purpose of changes +------------------ + +A list of small answer changes needed for CESM2.2.0. Nitrogen deposition file now properly +ends in 2015 rather than 2005. Have 2010_control compset match the 2000 IOC file rather than 2010. +Modify the waccmx_offline tests to more closely match the CAM tests. + +Interpolate IC files for an exact match. Answers are identical for an exact match, but different +when used for other resolutions. + +Two small bit-for-bit changes remove levurb and string_len dimensions on restart files. +Remove xsmrpool_loss when use_crop is NOT true. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): [If none, remove this line] + Answer changing fixes: + Fixes #1004 -- stream_year_last_ndep is set to 2005 instead of 2015 for historical with ctsm1.0.dev093 + Fixes #1012 -- Help prevent problems with WACCM-X testing by modifying our waccmx_offline test + Fixes #1090 -- Have 2010_control compset match 2000 simulation-year rather than 2010 + Fixes #1089 -- Failure in FXHIST test when running with CAM + Fixes #1037 -- Interpolate out-of-the-box initial conditions files for CESM2.2 release + (only changes answers for resolutions other than IC file resolution) + + Bit-for-bit changes: + Fixes #1101 -- levurb and string_len dimensions no longer needed on the restart files + Fixes #1097 -- xsmrpool_loss should only be written to the restart file if use_crop is true + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? No +(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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): + 2010_control doesn't match 2010 finidat file + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): Interpolated IC files + Add f19 2003 IC file, f09 and 19 1979 IC file + Remove 2010 IC file + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): None + +Changes to tests or testing: waccm_offline test changed to more closely match the FXHIST CAM test + +Code reviewed by: self + + +CTSM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS (115 tests are different than before) + + python testing (see instructions in python/README.md; document testing done): + + cheyenne - PASS + + regular tests (aux_clm): + + cheyenne ---- PASS + izumi ------- PASS + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes! (very small) + + Hist and SSP BGC compsets change answers because of the correction of the end year for ndep. + You wouldn't think this would matter until you get to the end of the time-sequence -- but it + does for the first time-step. + + The 2010 compset changes answers because of using the 2000 finidat file rather than 2010 + + Some finidat files interpolated to the resolution they are designed for. This causes an apparent + change of answers when these datasets are used for other resolutions (even though it does NOT for + the resolution it's interpolated to) + + waccm_offline tests are also changed in order to more closely match the FXHIST tests in CAM. + + Summarize any changes to answers, i.e., + - what code configurations: Hist, SSP, 2010 compsets, Clm45 and some f10, 1x1 because of IC files + - what platforms/compilers: All + - nature of change: same climate + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None + +Pull Requests that document the changes (include PR ids): #1100 +(https://github.com/ESCOMP/ctsm/pull) + #1100 -- Answer changes needed for CESM2.2.0 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev106 +Originator(s): erik (Erik Kluzek) +Date: Thu Aug 6 15:35:47 MDT 2020 +One-line Summary: Bit-for-bit updates for the CESM2.2.0 release + +Purpose of changes +------------------ + +Fix some bit-for-bit things needed for the CESM2.2.0 release +Bring changes needed from release-clm5.0.31-34 to trunk. ndep change. +Brings in some changes for PtVg datasets for no-anthro compset. +Do some refactoring of Fire class so that it makes sense for FATES to use the base class. +Update RTM and MOSART with NUOPC changes and an update of a NetCDF-4 file to NetCDF-5 +needed for the cesm2.2.0 release. + +The 2010 finidat file is now set in the 2010_control use-case rather than relying on the +finidat dataset matching. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): + Fixes #1087 -- wrong finidat file + Fixes #1096 -- failing tests + Fixes #1036 -- ne30 case fails + Fixes #946 --- better error message + Fixes #983 --- Fire method renames + Fixes #938 --- mscripgrid issue + +Known bugs found since the previous tag (include github issue ID): + #1098 -- ARCTICGRIS PE-layout is very slow... + #1097 -- xsmrpool_loss should only be written to the restart file if use_crop is true + + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? No +(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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): + if ndep file isn't found die with a warning rather than fatal error. + The warning allows you to override with CLM_BLDNML_OPTS="-ignore_warnings" + + finidat file matching will now use the sim_year rather than start-year + for a control case (transient cases used the start-year) + Add 2010 f09 finidat file for clm5_0_cam6.0 + +Changes made to namelist defaults (e.g., changed parameter values): + +Changes to the datasets (e.g., parameter, surface or initial files): + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + +Changes to tests or testing: + Add clm45cam6LndTuningMode testmod + Some tests needed more wallclock + +Code reviewed by: self + + +CTSM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS (one test is different than ctsm1.0.dev105) + + python testing (see instructions in python/README.md; document testing done): + + cheyenne -= PASS + + regular tests (aux_clm): + + cheyenne ---- PASS + izumi ------- PASS + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: No (bit-for-bit) + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): rtm, mosart + RTM to rtm1_0_72 + MOSART to mosart1_0_37 + +Pull Requests that document the changes (include PR ids): #1079 +(https://github.com/ESCOMP/ctsm/pull) + #1079 -- Bit-for-bit updates for the CESM2.2.0 release + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev105 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) / Chris Fischer +Date: Thu Jul 23 08:59:37 MDT 2020 +One-line Summary: Bring in some new SE grids for CAM as well as initial condition files for them + +Purpose of changes +------------------ + Add new SE (Spectral Element) grids: ne30np4.pg2, ne30np4.pg3, ne30np4, ne60np4, ne120np4, ne120np4.pg2, ne120np4.pg3, + ne0np4CONUS.ne30x8, ne0np4.ARCTIC.ne30x4, ne0np4.ARCTICGRIS.ne30x8 + Add new datasets for them, some new tests, and add support for their creation. + + Also add some new initial condition (IC) files for 1979, 2000, and 2013 for use when coupled to CAM + + The process for picking initial condition files was improved so that there can be more than one year that matches + and it will do the best to pick the best match. Also added the possibility for 1982 and 2013 simulation years for + specific grid matches. + + Also update cime to a newer version that supports these new grids. And update CMEPS (and hence add in fox, CDEPS) + to latest used on the nuopc_dev branch. Testing with nuopc wouldn't work without this update. The cime version updates + the tables for dry-deposition and changes answers for dry-deposition when it's turned on. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): #992 #994 + Fixes #992 -- New initial conditions for 1979, 2000 + Fixes #994 -- New CAM SE grids + Fixes #888 -- Add support for various "physics grids" needed by CAM +CIME Issues fixed (include issue #): #3593, #3569, #3564, PR#3557 + cime/#3593 -- Fix mapping files for new grids + cime/#3569 -- Fix cime regression testing + cime/#3564 -- Change alias for arctic grids + cime/#3557 -- updates to dry deposition data (PR) + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? No +(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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): + Initial conditions (IC) for 1979 start date is technically 1982 + New initial condition files are ONLY for when coupled to CAM (B and F compsets) + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): Allow for new grids + User updates to cime: + - Allow a user supplied config_grids.xml file. + - Improved error message for incorrect setting of cime model. + +Changes made to namelist defaults (e.g., changed parameter values): Add IC files for 1982 and 2013 years + +Changes to the datasets (e.g., parameter, surface or initial files): New SE grid datasets + Remove conus_30_x8 grid (previous name for new ne0np4CONUS.ne30x8 grid + Add new grids: ne30np4.pg2, ne30np4.pg3, ne30np4, ne60np4, ne120np4, ne120np4.pg2, ne120np4.pg3, + ne0np4CONUS.ne30x8, ne0np4.ARCTIC.ne30x4, ne0np4.ARCTICGRIS.ne30x8 + Add new mask: tx0.1v3 + New IC files: 1982 for ARCTIC and ARCTICGRIS, ne120np4 for 2000 and 2013 for CONUS all when coupled to CAM + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + Initial condition picking will pick the file it finds with the closet simulation year to the request + for the lnd_tuning_mode desired. It will pick based on year over an exact match in resolution. + You can get around this by setting use_init_interp to be specific for a resolution + + Also realized that there is a dependence between the namelist_defaults_ctsm.xml file and namelist_defaults_overall.xml + for the clm_start_type item. It must be coordinated with use_init_interp, init_interp_attributes and finidat + to work properly. I added a comment about this. We should probably just move them into the same file. + +Changes to tests or testing: Added tests for new grids + +Code reviewed by: self, fischer-ncar, adamrher + + +CTSM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - OK (130 tests fail comparison to previous verison due to new IC files) + + tools-tests (test/tools): + + izumi - OK + + PTCLM testing (tools/shared/PTCLM/test): + + izumi - OK + + python testing (see instructions in python/README.md; document testing done): + + izumi -- PASS + + regular tests (aux_clm): + + cheyenne ---- OK + izumi ------- PASS + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: No bit-for-bit (unless running with CAM because of new finidat files) + Running with nuopc changes answers because of updates to nuopc drivers + Dry-deposition changes answers when turned on (but doesn't effect anything else) + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cime, cmeps, cdeps, fox + cime updated to cime5.8.28 (from branch_tags/cime5.8.24_a01) + fox, and cdeps added in + cmeps, cdeps and fox updated to hashes used in the nuopc_dev branch of CESM + +Pull Requests that document the changes (include PR ids): #1038 +(https://github.com/ESCOMP/ctsm/pull) + #1038 -- New fsufdat and landuse time series files for ne grids + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev104 +Originator(s): sacks (Bill Sacks) +Date: Mon Jul 6 09:58:15 MDT 2020 +One-line Summary: Add LILAC + +Purpose of changes +------------------ + +Add LILAC: The Lightweight Infrastructure for Land-Atmosphere +Coupling. This infrastructure consists of two major pieces: + +(1) A lightweight coupling infrastructure built on top of ESMF that + makes it easier for atmosphere models to call CTSM directly, rather + than using the hub-and-spoke architecture that is used by CESM. + +(2) A set of python-based tools for building CTSM and creating its + runtime inputs when running in an atmosphere model via + LILAC. Although these tools are built on top of cime, details of the + create_newcase / case.setup / case.build process are hidden from the + user, because many of the aspects of this workflow don't make sense + in the LILAC context. + +So far we have used LILAC to couple CTSM to WRF. There are plans to use +the same infrastructure to couple CTSM to other regional atmosphere +models. + +Documentation of LILAC is provided in +https://escomp.github.io/ctsm-docs/versions/master/html/lilac/index.html +(though there are still some missing sections), as well as in various +presentations on the wiki +(https://github.com/ESCOMP/CTSM/wiki/Presentations). + +There have been many contributors besides myself to the development, +testing and documentation of LILAC; chief among them being Mariana +Vertenstein, Negin Sobhani, Joe Hamman, Sam Levis, Mike Barlage and Dave +Lawrence. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- See issues in the Done column of https://github.com/ESCOMP/CTSM/projects/23 + +Known bugs introduced in this tag (include github issue ID): +- Although LILAC is working to first order, there is still some work to +do. See outstanding issues in https://github.com/ESCOMP/CTSM/projects/23 + + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): +- dtime no longer specified on the namelist: just obtained from driver + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: +- Added LILACSMOKE test + +Code reviewed by: self + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - ok + + Baseline comparisons fail as expected. One test failed, but it also + failed for me on master (https://github.com/ESCOMP/CTSM/issues/1074) + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - pass on my mac + + regular tests (aux_clm): + + cheyenne ---- pass + izumi ------- pass + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: NO + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/CTSM/pull/1068 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev103 +Originator(s): slevis (Samuel Levis, SLevis Consulting LLC,303-665-1310) +Date: Mon Jun 29 17:16:29 MDT 2020 +One-line Summary: Gridcell-level balance-check for methane (CH4) + +Purpose of changes +------------------ + + Bracket the model time-step loop to calculate balance checks at the + gridcell level, as detailed in issue #315. The column-level check + remains unchanged. + + Subroutine ch4_init_balance_check is replaced with + ch4_init_column_balance_check. Subroutine + ch4_init_gridcell_balance_check is added. + + The implementation is similar to the one for carbon and nitrogen (see + tag ctsm1.0.dev096). + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): #315 + + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): + None + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): + None + +Changes made to namelist defaults (e.g., changed parameter values): + None + +Changes to the datasets (e.g., parameter, surface or initial files): + None + +Substantial timing or memory changes: + No + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + None + +Changes to tests or testing: + None + +Code reviewed by: + @billsacks + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - + + tools-tests (test/tools): + + cheyenne - + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - + + regular tests (aux_clm): + + cheyenne ---- PASS + izumi ------- PASS + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: No + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): + None + +Pull Requests that document the changes (include PR ids): + https://github.com/ESCOMP/CTSM/pull/1022 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev102 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Fri Jun 26 01:32:04 MDT 2020 +One-line Summary: Some important fixes for LUNA in clm5_0, and small urban issue in clm5_0 + +Purpose of changes +------------------ + +Fix some important issues that were found in LUNA for the arctic. These changes were large enough +that we had to re-tune the clm5_0 parameters to give a similar simulation. Leah Birch noticed +that the formulations in the code disagreed with the paper. Correcting this caused arctic plants +to be less productive. In order to compensate parameters for leafcn, and slatop were adjusted for +broadleaf_deciduous_boreal_shrub and c3_arctic_grass for clm5_0. + +The total vegetation carbon threshold on exit_spinup (from accelerated decomposition (AD) mode) was +increased from 0.1 to 1.0. Without this change some PFT's can die out in exit spinup even when +they have significant carbon stores from the AD spinup mode. + +There is an implicit assumption in the urban building energy model that building width equals +street width. However, this assumption can/should be relaxed and building width can be derived +from the morphology dataset. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): #738 #803 #953 #958 #1056 + Fixes #1056 -- Remove allpfts dimension + Fixes #953 -- Incorrect formula in LUNA uses day time rather than average of day/night + Fixes #958 -- LUNA day length factor missing + Fixes #738 -- Totvegc threshold increased from 0.1 to 1. + Fixes #803 -- No longer assume building width + +Known bugs introduced in this tag (include github issue ID): #1060 + #1060 -- Some code cleanup of luna bug fixes + +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_0 + +[x] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): clm5_0 climate adjusted for arctic plants + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): + +Changes to the datasets (e.g., parameter, surface or initial files): New parameter files + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): We + chose some bad names for variables, so we'll clean this up in a seperate step (see #1060) + +Changes to tests or testing: None + +Code reviewed by: self, olyson, bill-sacks, wweider + + +CTSM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS (266 compare differently because of update in paramsfile and jmaxb1) + + python testing (see instructions in python/README.md; document testing done): + + cheyenne - PASS + + regular tests (aux_clm): + + cheyenne ---- PASS + izumi ------- PASS + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes for clm5_0 (important change required retuning) + + Summarize any changes to answers, i.e., + - what code configurations: clm5_0 when Luna on as well as smaller changes for urban + - what platforms/compilers: all + - nature of change: climate changing, but tuned to respond similar to clm5.0 + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + luna changes: oleson case clm50_ctsm10d089_2deg_GSWP3V1_luna3_jmaxb1-0.17_slatopA_leafcnA_hist + + URL for LMWG diagnostics output used to validate new climate: + + urban changes: + + +http://webext.cgd.ucar.edu/I2000/clm50_ctsm10d098_1deg_GSWP3V1_CON_FIXBUILDENERGY_2000/lnd/clm50_ctsm10d098_1deg_GSWP3V1_CON_FIXBUILDENERGY_2000.1991_2010-clm50_ctsm10d098_1deg_GSWP3V1_CON_2000.1991_2010/setsIndex.html + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None + +Pull Requests that document the changes (include PR ids): #1034 and #962 +(https://github.com/ESCOMP/ctsm/pull) + #1034 -- Building energy fix + #962 --- Fixes for the LUNA dayl bugs + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev101 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326), oleson (Keith Oleson) +Date: Wed Jun 17 23:51:22 MDT 2020 +One-line Summary: Changes from Keith to bring a list of variables to the parameter file + +Purpose of changes +------------------ + +Change some hardcoded parameters to go on the parameter files. This is needed in preparation +of running the Perturbed Parameter Ensemble. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): #995 #138, #206 + +Fixes #995 -- Soil turnover times are on paramfile and hardcoded +Fixes #138 -- use tau_ values on paramfile +Fixes #206 -- add prh30 to paramfile +Some work on #290 -- LUNA refactoring + + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? No +(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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): None + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): paramfile for both clm4_5 and clm5_0 + Add 51 new parameters to the paramsfile: + bsw_adjustfactor,cpha,csol_clay,csol_om,csol_sand,denitrif_nitrateconc_coefficient,denitrif_nitrateconc_exponent, + denitrif_respiration_coefficient,denitrif_respiration_exponent,drift_gs,e_ice,enzyme_turnover_daily,eta0_anderson, + eta0_vionnet,fnps,hksat_adjustfactor,ignition_efficiency,jmaxb0,jmaxha,jmaxhd,kcha,koha,kp25ratio,lmrha,lmrhd, + lmrse,luna_theta_cj,minrelh,n_baseflow,pd,perched_baseflow_scalar,prh30,relhExp,ssi,sucsat_adjustfactor,theta_cj, + theta_ip,theta_psii,tpuha,tpuhd,tkd_clay,tkd_om,tkd_sand,tkm_om,tpu25ratio,vcmaxha,vcmaxhd,watsat_adjustfactor, + wc2wjb0,wimp,wind_min + k_nitr_max removed and replaced with k_nitr_max_perday + meta-data for the tau_* variables changed, and a roundoff difference in the clm4_5 paramfile + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): prh30 not used for clm4_5 + prh30 was added in but won't be used for the CNFireLi2014 formulation. + It's only used for the clm5_0 and following formulations + +Changes to tests or testing: None + +Code reviewed by: self, oleson + + +CTSM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS (170 tests differ from baseline because of new paramfiles) + + python testing (see instructions in python/README.md; document testing done): + + cheyenne - PASS + + regular tests (aux_clm): + + cheyenne ---- OK + izumi ------- OK + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: No bit-for-bit + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None + +Pull Requests that document the changes (include PR ids): #1039 +(https://github.com/ESCOMP/ctsm/pull) + #1039 -- move hardcoded parameters to paramfile + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev100 +Originator(s): sacks (Bill Sacks) +Date: Tue Jun 9 06:15:15 MDT 2020 +One-line Summary: Deallocate memory after running init_interp + +Purpose of changes +------------------ + +Many of the pointer arrays in init_interp were not being deallocated +when init_interp finished. This was a particular problem because some of +these arrays were allocated for the full global source grid on each +processor, so the memory use was significant. This tag fixes this issue. + +This issue is documented in https://github.com/ESCOMP/CTSM/issues/1010 +and https://github.com/ESCOMP/CTSM/issues/1032. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/CTSM#1032 (Memory isn't deallocated in some of the + init_interp code) + +Known bugs found since the previous tag (include github issue ID): +- This does NOT resolve ESCOMP/CTSM#1010 (WACCMX test fails with + ctsm1.0.dev093 in cesm2_2_alpha05c), even though that was the original + hope. + + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none +- The initial run of the PFS test showed a very long time taken in + initialization. However, it appears that this was a system issue: + rerunning twice showed times back to normal. + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: self + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - pass (on my mac) + + regular tests (aux_clm): + + cheyenne ---- pass + izumi ------- pass + + Most testing was done on f332fafc. After that, I made a minor change + that was needed for the unit tests to pass. I then reran (1) + clm_short on cheyenne, and (2) this subset of the test list on + izumi: + + SMS.f10_f10_musgs.I2000Clm50BgcCrop.izumi_gnu.clm-crop + SMS_D.f10_f10_musgs.I2000Clm50BgcCrop.izumi_gnu.clm-crop + PEM_Ld1.f10_f10_musgs.I2000Clm50BgcCropGs.izumi_intel.clm-crop + SMS_D.f10_f10_musgs.I2000Clm50BgcCrop.izumi_intel.clm-crop + SMS.f10_f10_musgs.I2000Clm50BgcCrop.izumi_pgi.clm-crop + SMS_D.f10_f10_musgs.I2000Clm50BgcCrop.izumi_pgi.clm-crop + SMS_Ld5_D_P48x1.f10_f10_musgs.IHistClm50Bgc.izumi_nag.clm-monthly + ERP_Ld5_P48x1.f10_f10_musgs.I1850Clm50Bgc.izumi_nag.clm-default + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: NO + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): none + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev099 +Originator(s): sacks (Bill Sacks) +Date: Mon Jun 8 09:29:38 MDT 2020 +One-line Summary: Update cime, needed for izumi machine updates + +Purpose of changes +------------------ + +Update cime. The most important change here is an update for izumi, +which is needed for the recent izumi machine updates. + +Also: Change izumi PEM test to use SGLC (after the machine updates, the +PEM test was failing; see also +https://github.com/ESCOMP/CTSM/issues/840). + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: not investigated; none expected + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: +- Changed izumi PEM test to use SGLC (after the machine updates, the PEM +test was failing; see also https://github.com/ESCOMP/CTSM/issues/840). + +Code reviewed by: self + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- pass + izumi ------- ok + + izumi: tests pass, some baselines fail as expected + + ERP_D_Ld3.f09_g17.I2000Clm50SpGs.cheyenne_intel.clm-prescribed + showed differences from the stored baselines, but it appears that + the stored baselines were incorrect: when I reran this test from + master, the master version differed from the stored baselines and + was identical to this branch. + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: YES, just on izumi due to machine updates + + Summarize any changes to answers, i.e., + - what code configurations: some izumi tests + - what platforms/compilers: izumi gnu & pgi + - nature of change (roundoff; larger than roundoff/same climate; new climate): + not investigated; expected to be roundoff + + Answer changes were observed in these tests: + - SMS_D.f10_f10_musgs.I2000Clm50BgcCrop.izumi_gnu.clm-crop + - SMS_D.f10_f10_musgs.I2000Clm50BgcCrop.izumi_pgi.clm-crop + - SMS.f10_f10_musgs.I2000Clm50BgcCrop.izumi_pgi.clm-crop + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): +- cime: branch_tags/cime5.8.23_a01 -> branch_tags/cime5.8.24_a01 + Point to a cime branch tag that is equivalent to cime5.8.24 but uses + pio1 rather than pio2, even for mpi-serial cases (the changes in + branch_tags/cime5.8.24_a01 relative to cime5.8.24 are equivalent to the + changes in branch_tags/cime5.8.23_a01 relative to cime5.8.23). + +Pull Requests that document the changes (include PR ids): none + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev098 +Originator(s): John Truesdale,UCAR/AMP,303-497-1386 +Date: Thu May 28 14:39:27 MDT 2020 +One-line Summary: Bring in GFDL fv3 cubed sphere grids C24, C48, C96, C192, C384 + +Purpose of changes +------------------ + +Add support for new GFDL fv3 curbed sphere grids. Low resolution C24, and C48 +Moderate resolution C96, and high resolution C192 and C384. Add in mapping files +so all can be created. Make C96 a default resolution created with new surface +datasets. For all of these only the crop versions of surface and landuse.timeseries +are in place, as non-crop can run in CLM without needing different datasets. Also for +historical landuse.timeseries we use the SSP5-8.5 timeseries files, so that it can be +used for future, historical and beyond 2015 present day. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): #1025 + Fixes #1025 -- By default only create crop version of surface/landuse.timeseries datasets + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): None + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): New surface and landuse.timeseries files + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): None + +Changes to tests or testing: Add C96 tests + +Code reviewed by: @ekluzek + +CTSM testing: regular, tools + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS (15 new tests for new resolutions) + + tools-tests (test/tools): + + cheyenne - OK + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - PASS (cheyenne) + + regular tests (aux_clm): + + cheyenne ---- PASS + izumi ------- PASS + +If the tag used for baseline comparisons was NOT the previous tag, note that here: previous + + +Answer changes +-------------- + +Changes answers relative to baseline: No bit-for-bit + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None + +Pull Requests that document the changes (include PR ids): #891 +(https://github.com/ESCOMP/ctsm/pull) + + #891 -- add definitions/defaults for GFDL fv3 cubed sphere grids C24, C48, C96, C192, C384 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev097 +Originator(s): ycheng (Yanyan Cheng); final changes & testing by Bill Sacks +Date: Mon May 25 15:14:56 MDT 2020 +One-line Summary: Add two bioenergy crops (switchgrass and miscanthus) + +Purpose of changes +------------------ + +Main change is from Yanyan Cheng: adding parameters and code for two +bioenergy crops, switchgrass and miscanthus. Along with this, there is a +new potential flux from crop leaves and stems to the crop product pool +at harvest, representing biofuel products; a new pft-specific parameter +controls this flux (biofuel_harvfrac). Currently, the out-of-the-box +surface datasets do not specify any area for these crops, but the new +parameter file will allow them to be present if specified on the surface +dataset or landuse_timeseries file. Note that this is only an option for +CLM5.0, NOT for CLM4.5. (See https://github.com/ESCOMP/CTSM/pull/884 for +details.) + +Also, some minor fixes from Bill Sacks: See notes under "bugs fixed" +below. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/CTSM#203 - Fixes creation of harvest-related variables + on surface datasets created with the all_veg option - smallville, + PTCLM, etc. (documented in https://github.com/ESCOMP/CTSM/pull/1019) +- Resolves ESCOMP/CTSM#930 - Makes gindex_ocn intent(inout) rather than + intent(out) +- Resolves ESCOMP/CTSM#1021 - Changes SSP test to only do symlink if + needed + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): +- For transient crop cases, now more crops in memory. This creates a + need for interpolation of initial conditions for initial conditions + generated from a transient case. + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): +- Changed parameter values for switchgrass and miscanthus (only for clm5.0) +- New pft-specific parameter, biofuel_harvfrac (for both clm4.5 and clm5.0) + +Changes to the datasets (e.g., parameter, surface or initial files): +- New parameter files with the above changes + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: +- Changed smallville ERS_Lm20 test to be cold start (see comment in + commit 8368f222 for details) +- Added a multi-year smallville test that includes these new crops + +Code reviewed by: Bill Sacks, Danica Lombardozzi + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - ok + + Pass except for expected baseline failures + + Ran on 633be0eb, with comparison against ctsm1.0.dev095; tests pass + except these expected baseline failures: + + 030 blf84 TBLscript_tools.sh PTCLM PTCLMmkdata PTCLM_USUMB_clm4_5^buildtools ....................\c + rc=7 FAIL + + 032 blfc4 TBLscript_tools.sh PTCLM PTCLMmkdata PTCLM_USUMB_Cycle_clm4_5^buildtools ..............\c + rc=7 FAIL + + Diffs for these are just in the harvest-related fields on the surface dataset, as expected. + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- ok + izumi ------- pass + + For cheyenne testing: a few tests had baseline failures. The + differences just arise in the h1 (vector) files, due to differences + in dimension sizes. These differences are expected. See below for + details. + + Ran most testing on 8309c213. Reran two SSP tests on 4665c9ce + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: YES, but diagnostic only due to +change in dimension sizes - does not change answers in any meaningful +way + + Summarize any changes to answers, i.e., + - what code configurations: Transient CLM50 cases with crops; just + changes dimensions on vector (h1) history files + - what platforms/compilers: All + - nature of change (roundoff; larger than roundoff/same climate; new climate): + diagnostic change only + + Differences were observed in the following tests: + + ERS_Ly3_Mmpi-serial.1x1_smallvilleIA.IHistClm50BgcCropQianGs.cheyenne_gnu.clm-cropMonthOutput + SMS_Ld5.f10_f10_musgs.ISSP245Clm50BgcCrop.cheyenne_gnu.clm-ciso_dec2050Start + SMS_Ld5.f10_f10_musgs.ISSP370Clm50BgcCrop.cheyenne_gnu.clm-ciso_dec2050Start + ERP_D_Ld10_P36x2.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-ciso_decStart + ERP_D_Ld5.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-allActive + ERP_Ly3_P72x2.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-cropMonthOutput + ERS_D_Ld7_Mmpi-serial.1x1_smallvilleIA.IHistClm50BgcCropGs.cheyenne_intel.clm-decStart1851_noinitial + ERS_Ly3_P72x2.f10_f10_musgs.IHistClm50BgcCropG.cheyenne_intel.clm-cropMonthOutput + ERS_Ly5_P144x1.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-cropMonthOutput + ERS_Ly6_Mmpi-serial.1x1_smallvilleIA.IHistClm50BgcCropQianGs.cheyenne_intel.clm-cropMonthOutput + LCISO_Lm13.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-ciso_monthly + SMS_Ld5.f10_f10_musgs.ISSP585Clm50BgcCrop.cheyenne_intel.clm-ciso_dec2050Start + + The differences just arise in the h1 files, due to differences in + dimension sizes. I reran these tests with a paramfile where I + reverted the mergeToPft variable; then they were all bfb with + master. + + Other than this, there were FIELDLIST differences, as expected. + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +- https://github.com/ESCOMP/CTSM/pull/884 +- https://github.com/ESCOMP/CTSM/pull/1019 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev096 +Originator(s): slevis (Samuel Levis,SLevis Consulting LLC,303-665-1310) +Date: Thu May 21 19:18:24 MDT 2020 +One-line Summary: Gridcell-level balance checks for carbon and nitrogen + +Purpose of changes +------------------ + + Bracket the model's time-step loop to calculate balance checks at the + gridcell level because there are terms in the carbon and nitrogen + cycles not accounted for at the column level. Balance checks at the + column level remain unchanged for now. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): #314 + + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): None + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): None + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): None + +Changes to tests or testing: None + +Code reviewed by: + @billsacks + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - + + tools-tests (test/tools): + + cheyenne - + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - + + regular tests (aux_clm): + + cheyenne ---- OK + izumi ------- PASS + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: No + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None + +Pull Requests that document the changes (include PR ids): + https://github.com/ESCOMP/CTSM/pull/984 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev095 +Originator(s): sacks (Bill Sacks) +Date: Thu May 21 10:25:16 MDT 2020 +One-line Summary: Update cime and cmeps externals; rework initialization of CNFire object + +Purpose of changes +------------------ + +Main change is to update cime and cmeps externals. cime is now +essentially at the version used in cesm2_2_beta05 (but with one change +backed out); cmeps is at latest master. + +Also, reworks initialization of CNFire object to avoid occasional +segmentation faults. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/CTSM#1018 (Occasional seg faults when initializing + CNFire object) + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none +- Note: Because of a change in cime, datm now uses netcdf rather than + pnetcdf, but it doesn't seem that that impacts performance + significantly + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: self + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- ok + izumi ------- pass + + cheyenne tests pass; some answer changes as expected (as noted below) + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: YES (small) + + Summarize any changes to answers, i.e., + - what code configurations: + - cheyenne_gnu - due to compiler version update + - nuopc - presumably due to the major cmeps update + - what platforms/compilers: see above + - nature of change (roundoff; larger than roundoff/same climate; new climate): + - Not investigated + + I have verified that gnu tests in 59d1dd4a are identical to those + in dcaad375 - i.e., the rework of the initialization logic for fire + didn't change answers + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): +- cime: cime5.8.19 -> branch_tags/cime5.8.23_a01 + (same as cime5.8.23, but reverts to using pio1 for mpi-serial cases, + since some mpi-serial cases failed with pio2) +- cmeps + +Pull Requests that document the changes (include PR ids): none + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev094 +Originator(s): sacks (Bill Sacks) +Date: Fri May 15 13:41:01 MDT 2020 +One-line Summary: Minor bug fixes needed for latest cime + +Purpose of changes +------------------ + +(1) Refactor a conditional to avoid divide by 0 (ESCOMP/CTSM#1013) + +(2) Remove some FATES coordinate variables that were writing garbage + (temporary workaround for ESCOMP/CTSM#1014) + +(3) Minor update to manage_externals + +(4) Document authorship in README.md and .zenodo.json + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/CTSM#1013 +- Workaround for ESCOMP/CTSM#1014, but doesn't properly resolve that issue + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: not checked; none expected + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: self + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- pass + izumi ------- pass + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: NO + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +- https://github.com/ESCOMP/ctsm/pull/1006 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev093 +Originator(s): erik (Erik Kluzek) +Date: Fri May 1 22:27:16 MDT 2020 +One-line Summary: Bring in changes from release-clm5.0 branch to master + +Purpose of changes +------------------ + +Move changes from release-clm5.0.12.13/14/16/17/18/20/21/22/23/24/25/26/27/28/29/30 to master +(note excludes release-clm5.0.15, release-clm5.0.19) + +Answer changing! +Updates FATES with PARTEH option. + +Remove CRUNCEP half degree, ne120np4, f05 surface datasets +Landuse-timeseries files for just: f09, f19, f10, ne30np4, 1x1_numaIA, 1x1_smallvilleIA, 1x1_brazil +Add datasets needed for SSP scenarios (only Tier I for ndep). Add ZWT_inversion dataset for methane. + +Add new ability to use prescribed soil moisture data (from streams files based on an earlier CTSM simulation). + +Add new MODISv2 mapping files for mksurfdata_map. Remove T5 and T21 mapping files. Add conus_30_x8 mapping files, +and T62 mapping files + +Add contrib directory to tools with contributed tools and scripts. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): 31 issues.... + #873 -- Release clm5.0.12 changes + #871 -- don't check for valid resolution for CESM cases by default + #836 -- add izumi as a place that can run tools tests + #831 -- add namelist tint_algo settings for input streams + #817 -- Have clm4_5 use the same ndep file as clm5_0 for 1850 + #809 -- mkmapdata using an old version of intel + #804 -- mksurfdata option + #791 -- fix threading for prescribed LAI and soil-moisture + #786 -- allow use_init_interp for a branch + #746 -- Some CLM45 configurations use CLM50 initial conditions files + #741 -- C13_HR, C13_NBP, FPI values result in numeric conversion not representable error (changes answers) + #734 -- Isotope historical files off of NetCDF-4 + #716 -- 2 degree CMIP6WACCMDECK needs Carbon isotopes off + #707 -- Missing mapping files for hirespft + #673 -- Ice shelf wetland fix in mksurfdata_map can lead to glacier+lake > 100% on surface datasets (changes surface dataset creation) + #653 -- To save disk on fsurdat files use zwt0 on finindated file + #629 -- Remove unused fields from surface datasets + #624 -- QSNOEVAP history output incorrect + #621 -- Fully remove rcp in place of only ssp_rcp + #608 -- Odd (blocky) spatial patterns in generic crop leafc for BGC simulation when initialized from BGC-Crop (changes answers) + #589 -- Existence of content in the lai_streams namelist makes it confusing to users + #557 -- no-anthro compset and options + #553 -- More robust mksurfdata_map logic for determining where to put wetlands + #547 -- Add conus_30_x8 grid as valid option for CTSM and mksurfdata_map + #545 -- Antarctica ice shelves are being treated as wetlands rather than glaciers + #544 -- Transient cases are matching wrong IC file + #533 -- Add -no-anthro option to mksurfdata + #276 -- Tests for pre_alpha/pre_beta + #262 -- hirespft option to mksurfdata.pl + #175 -- Set stream_year_first_urbantv/last for CLM4.5 + #150 -- mksurfdata code cleanup + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): New surface datasets do mean initial conditions + will need to be interpolated + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): Add 2010 compset option + New namelist items: ndep_tintalgo, lai_tintalgo, lightng_tintalgo, urbantv_tintalgo, dribble_crophrv_xsmrpool_2atm + New soil moisture namelist items: use_soil_moisture_streams, stream_year_first_soilm, stream_year_last_soilm, model_year_align_soilm, + model_year_align_soilm, soilm_tintalgo, soilm_offset, soilm_ignore_data_if_missing + New namelist items for FATES: fates_parteh_mode + New 2010, no-anthro, SSP use cases + New compsets: I2010Clm50Sp, I2000Clm50BgcCropQianGs, I1850Clm50BgcNoAnthro, I1850Clm50SpNoAnthro, IHistClm50SpCru, IHistClm50SpCru, + IHistClm45SpGs, IHistClm45SpGs + New SSP compsets: ISSP585Clm50BgcCrop, ISSP126Clm50BgcCrop, ISSP126Clm50BgcCrop, ISSP245Clm50BgcCrop, ISSP370Clm50BgcCrop, + ISSP434Clm50BgcCrop, ISSP460Clm50BgcCrop, ISSP460Clm50BgcCrop + LAI streams options don't show up in the namelist unless you ask for them + finundation comes from streams files, no longer from the surface dataset + FATES adds a list of new history variables and dimension types + +Changes made to namelist defaults (e.g., changed parameter values): New fsurdat files, SSP C13/C14 files + Add PtVg surface dataset + most finidat files now need to be interpolated, a few added in to get testing to work + New ndep datasets + +Changes to the datasets (e.g., parameter, surface or initial files): + New fsurdat files, finidat files need to be interpolated from now + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + Threshold to reseed dead vegetation increased from zero to 1.0 as a hard coded parameter. + Reseeding also happens for generic crop types and not just natural vegetation now. + The ability to read in 3D streams was added (input files have to be at the same resolution as the model) + +Changes to tests or testing: + Add no-anthro, 2010, f19 waccm and SSP tests + Make sure prealpha/prebeta tests are also run by aux_clm + Add prescribed soil moisture test + Lengthen waccm_offline test + Remove hcru_hcru and edison tests + Add some aux_cime_baseline tests + +Code reviewed by: self + + +CTSM testing: regular, tools + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS (345 are different than baseline) + + tools-tests (test/tools): + + cheyenne - OK + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - OK + + python testing (see instructions in python/README.md; document testing done): + + cheyennne -- PASS (when ncar_pylib run) + + regular tests (aux_clm): + + cheyenne ---- OK + izumi ------- OK + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes (small) + + Updates in all fsurdat files leads to changes in answers + Also there are updated finidat files as they had to be interpolated + to work with the new fsurdat files + Reseeding change can effect answers on startup if activated + Extra call to SoilBiogeochemPrecisionControl can cause a small answer change + + Summarize any changes to answers, i.e., + - what code configurations: all global + - what platforms/compilers: all + - nature of change: Main change is around Antarctica + + CMIP6 simulations and release branch simulations were run with these surface datasets + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): fates, PTCLM + + fates to sci.1.30.0_api.8.0.0 + PTCLM to PTCLM2_20200121 + + FATES now points to the NGEET repository rather than the NCAR fates-release + +Pull Requests that document the changes (include PR ids): #998, #883, #849, #567, #564, #561 +(https://github.com/ESCOMP/ctsm/pull) + #998 -- Remove Copyright file + #883 -- Bring changes on release-clm5.0 branch to master PR status: ready priority: high type: enhancement + #849 -- Fix link to new forums + #567 -- Ignore patterns for vim + #564 -- Update mksurfdata_map to include glaciers outside of pft landmask + #561 -- Add list of checks that should be done when making new surface datasets + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev092 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Mon Apr 27 14:51:21 MDT 2020 +One-line Summary: Update cime to version in cesm2_2_beta04 + +Purpose of changes +------------------ + +Update cime to latest in cesm2.2 beta tag (cesm2_2_beta04) +Fix two small issues that had gone on the release-clm5.0 branch. +Update manage_externals (to manic-v1.1.8) + +NOTE: Part of the reason for updating cime, was because of some problems +Mike Mills was having on cheyenne with inputdata files being deleted out +from under him before setting up his cases. We think system issues were +interacting with issues with cime putting in place zero length +missing files for the version of cime he was using. Those issues went +away with a cime update, so we hope updating to a newer cime version here +will help prevent those issues for CTSM users. + +cime updates: + +some cleanup from the last maint-5.6 update +Add ne5np4.pg4 grid. +case.setup: Add --keep option +Add omip as option to DATM_CO2_TSERIES + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): #974 #966 + Fixes #974 -- python 3 problem in ssp test + Fixes #966 -- a few history fields need to be made CF compliant +CIME Issues fixed (include issue #): 3459 3466 + 3459 -- case.setup refuses to fix corrupted env_mach_specfic.xml + 3466 -- fix for aquap + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): + ./case.setup now has a --keep option + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): None + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): None + +Changes to tests or testing: None + +Code reviewed by: self + + +CTSM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + tools-tests (test/tools): + + cheyenne - OK + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - OK + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - + + regular tests (aux_clm): + + cheyenne ---- OK + izumi ------- OK + +If the tag used for baseline comparisons was NOT the previous tag, note that here: previous + + +Answer changes +-------------- + +Changes answers relative to baseline: None bit-for-bit + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cime + cime to cime5.8.19 + (NOTE: CMEPS is pointing to a newer hash than used in the beta tag) + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + #996 -- Update cime to latest cesm2.2 beta tag + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev091 +Originator(s): sacks (Bill Sacks) +Date: Fri Apr 24 07:43:46 MDT 2020 +One-line Summary: Increase tolerance on near-zero truncation for a snow state update + +Purpose of changes +------------------ + +In UpdateState_TopLayerFluxes, the tolerance of 1.e-13 was occasionally +exceeded. Although I haven't done a careful analysis, it seems okay to +me to increase this tolerance slightly. Here I increase it to 1.e-12. + +Previously, if top-layer h2osoi_ice or h2osoi_liq were reduced to less +than 1e-13 times the original value (in an absolute value sense), these +masses were set to 0; now we set these masses to 0 if they are reduced +to less than 1e-12 times the original. So we can now occasionally set a +value to exactly 0 when before it was left at slightly different from +zero. If the previous code led to a small positive value, between 1e-13 +and 1e-12 times the original, this tag will change answers slightly. If +the previous code led to a small negative number, it would cause the +model to abort, leading to the issue reported in ESCOMP/CTSM#988; this +change should fix those occasional aborts. + +This tag also introduces the general ability to set tolerances to a +custom value in calls to truncate_small_values. + +See ESCOMP/CTSM#988 for details. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/CTSM#988 + + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none expected (not checked) + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: Erik Kluzek + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- pass + izumi ------- pass + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: YES, in theory (but none in test suite) + + Summarize any changes to answers, i.e., + - what code configurations: potentially all, but very rarely + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + Roundoff + + Potentially changes answers by roundoff (see notes above), but no + changes were observed in any test in the test suite + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/CTSM/pull/989 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev090 +Originator(s): negins (Negin Sobhani,UCAR/CSEG,303-497-1224) +Date: Thu Apr 23 09:21:18 MDT 2020 +One-line Summary: Refactoring banded diagonal matrix and solve system in SoilTemperature module + +Purpose of changes +------------------ + +Previously, the SoilTemperature module has a high level of nested subroutine +calls, which hurt its performance and readability. There were many +redundancies, logical issues, and nested conditionals in the modular code +as discussed in issue #323. In this PR, SoilTemperature module is optimized +and rewritten for better readability and performance while maintaining bfb +compatibility. + + +This PR addresses issue ESCOMP/ctsm#323 + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): + -ESCOMP/ctsm#323 + +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.) + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: The revised code improved the +performance of the previous code by ~1.5-2x. + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: Bill Sacks + + +CTSM testing: + + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- OK + izumi ------- PASS + +Externals used for the testing: + [cism] + tag = cism2_1_68 + [rtm] + tag = rtm1_0_70 + [mosart] + tag = mosart1_0_35 + [cime] + tag = branch_tags/cime5.8.15_a01 + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: NO + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/CTSM/pull/979) + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev089 +Originator(s): sacks (Bill Sacks) +Date: Tue Apr 7 12:01:59 MDT 2020 +One-line Summary: Bring documentation source to master + +Purpose of changes +------------------ + +1. Bring documentation source to master: Pulls in the source from + https://github.com/escomp/ctsm-docs. This is important so that + documentation can remain in sync with changes in the model + code. Images are stored here using git-lfs (Git Large File + Storage). I also made some minor fixes to get the pdf build of the + tech note working. + +2. Use a different documentation theme that supports a version dropdown + menu, and add the code needed to support this versioning on the + documentation web pages. At a high level, the way the versioned + documentation works is to have separate subdirectories in the + gh-pages branch of the ctsm-docs repository for each version of the + documentation we want to support. There is then a bit of JavaScript + code which uses a json file in the gh-pages branch to determine which + versions exist and how these should be named in the dropdown + menu. Most of these changes were borrowed from ESMCI/cime#3439, which + in turn borrowed from ESCOMP/CISM-wrapper#23, which in turn was a + slight modification of an implementation provided by @mnlevy1981 for + the MARBL documentation, which in turn borrowed from an + implementation put together by Unidata (credit where credit is due). + + I am not aware of out-of-the-box support for a version pull-down in + out-of-the-box sphinx themes (though the last time I looked was in + Fall, 2018, so there may be something available now). However, + support for a version dropdown exists in an open PR in the sphinx + readthedocs theme repository: readthedocs/sphinx_rtd_theme#438. I + have pushed this branch to a new repository in ESMCI + (https://github.com/ESMCI/sphinx_rtd_theme) to facilitate long-term + maintenance of this branch in case it disappears from the official + sphinx_rtd_theme repository. I have also cherry-picked a commit onto + that branch, which is needed to fix search functionality in sphinx1.8 + (from readthedocs/sphinx_rtd_theme#672) (which is another reason for + maintaining our own copy of this branch). The branch in this + repository is now named version-dropdown-with-fixes (branching off of + the version-dropdown branch in the sphinx_rtd_theme repository). In + the long-term, I am a little concerned about using this theme that + isn't showing any signs of being merged to the main branch of the + readthedocs theme, but this has been working for us in other projects + for the last 2 years, so I feel this is a reasonable approach in the + short-medium term. + +The new process for building the documentation is given here: +https://github.com/ESCOMP/CTSM/wiki/Directions-for-editing-CLM-documentation-on-github-and-sphinx + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/ctsm#239 (Move documentation source to master) + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: Erik Kluzek + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- not run! + izumi ------- not run! + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: NO + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/CTSM/pull/954 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev088 +Originator(s): sacks (Bill Sacks) +Date: Tue Apr 7 10:43:03 MDT 2020 +One-line Summary: Fix bug in snow aerosol numerics (causes occasional HUGE aerosol values) + +Purpose of changes +------------------ + +Multiplications / divisions by dtime were missing in a few places, in +some code that ensures that aerosol mass fluxes between the snow layers +don't exceed the total mass. This bug was introduced in ctsm1.0.dev065, +when a term was changed from a mass to a flux (per unit time), but some +of the code wasn't changed correspondingly. + +In one case this bug caused a crash, but in other cases it just causes +incorrect answers. The issue can be seen by examining the history +variables SNOBCMCL, SNOOCMCL and SNODSTMCL. In the case that led to the +crash, SNOBCMCL and SNOOCMCL became huge in one grid cell (~ 10^12) for +a long period before the crash. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/ctsm#965 (Bug in snow aerosol numerics can cause + aerosol masses to blow up, starting with ctsm1.0.dev065) + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none (not checked, but none expected) + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: Erik Kluzek, Keith Oleson + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- ok + izumi ------- pass + + ok means tests pass, some answer changes as expected + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: YES (Small) + + Summarize any changes to answers, i.e., + - what code configurations: all + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + larger than roundoff/same climate + + Answer changes arise due to a bug fix for a condition that only + appears infrequently. When it does appear, answer changes can + potentially be enormous (e.g., snow aerosol concentrations 20 + orders of magnitude too large), though answer changes observed in + the test suite all appear relatively small. + + Answer changes just appeared for the following tests: + + FAIL ERP_D_P36x2_Ld3.f10_f10_musgs.I2000Clm45BgcCrop.cheyenne_gnu.clm-no_subgrid_fluxes BASELINE ctsm1.0.dev087: DIFF + FAIL SMS_Ld1.nldas2_rnldas2_mnldas2.I2000Ctsm50NwpSpNldasGs.cheyenne_gnu.clm-default BASELINE ctsm1.0.dev087: DIFF + FAIL SMS_Ld1.nldas2_rnldas2_mnldas2.I2000Ctsm50NwpSpNldasRsGs.cheyenne_gnu.clm-default BASELINE ctsm1.0.dev087: DIFF + FAIL ERI_D_Ld9.ne30_g16.I2000Clm50BgcCruGs.cheyenne_intel.clm-vrtlay BASELINE ctsm1.0.dev087: DIFF + FAIL ERI_D_Ld9.T31_g37.I2000Clm50Sp.cheyenne_intel.clm-SNICARFRC BASELINE ctsm1.0.dev087: DIFF + FAIL ERI_Ld9.f45_g37.I2000Clm50BgcCruGs.cheyenne_intel.clm-nofire BASELINE ctsm1.0.dev087: DIFF + FAIL ERI_N2_Ld9.f19_g17.I2000Clm50BgcCrop.cheyenne_intel.clm-default BASELINE ctsm1.0.dev087: DIFF + FAIL SMS_D_Lm6.f45_f45_mg37.I2000Clm50Fates.cheyenne_intel.clm-FatesColdDef BASELINE ctsm1.0.dev087: DIFF + FAIL SMS_D_Lm6_P144x1.f45_f45_mg37.I2000Clm50Fates.cheyenne_intel.clm-FatesColdDef BASELINE ctsm1.0.dev087: DIFF + FAIL SMS_Lm13.f19_g17.I2000Clm50BgcCrop.cheyenne_intel.clm-cropMonthOutput BASELINE ctsm1.0.dev087: DIFF + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/CTSM/pull/971 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev087 +Originator(s): sacks (Bill Sacks) +Date: Mon Apr 6 11:23:51 MDT 2020 +One-line Summary: Change hard-coded soil layers in phenology to use a target depth + +Purpose of changes +------------------ + +Adds infrastructure for finding the soil layer containing a given depth +(covered by unit tests). + +In phenology code, replaces hard-coded level 3 with a target soil +depth. This value is read from the parameter file. The default value is +set in a way that is bit-for-bit for standard CLM45 and CLM50 +configurations, but this will change answers for non-SP configurations +using the NWP soil layer structure or non-standard soil layer +structures. + +This is important for the sake of supporting flexible soil layers, as in +the NWP configuration. + +Also, some cleanup of the CNPhenology parameter reading code. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/ctsm#952 (Change hard coded soil layers in phenology + to use a target depth) + + +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.] + +[ ] clm5_0 + +[X] ctsm5_0-nwp -- only for non-SP cases + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): +- New parameter added to NetCDF parameter file: phenology_soil_depth + +Substantial timing or memory changes: none expected (not checked) + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: Erik Kluzek + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- ok + izumi ------- pass + + ok means tests pass, a few answer changes as expected + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes (only Non-SP cases with NWP) + + Summarize any changes to answers, i.e., + - what code configurations: Non-SP cases with NWP or non-standard + soil layer structures + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + larger than roundoff; same vs. new climate not investigated + + Differences in non-SP cases with soil layer structure different + from that of standard clm45 or clm50. Differences observed in + tests + ERS_D_Ld3.f10_f10_musgs.I2000Clm50BgcCruGs.cheyenne_intel.clm-deepsoil_bedrock + and + SOILSTRUCTUD_Ld5.f10_f10_musgs.I2000Clm50BgcCropGs.cheyenne_intel.clm-default. + + ERP_P36x2_D_Ld5.f10_f10_musgs.I2000Ctsm50NwpBgcCropGswpGs.cheyenne_intel.clm-default + had no differences; I'm guessing this is just because there didn't + happen to be the appropriate PFTs present to show differences in + this short, coarse-resolution test. + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/CTSM/pull/963 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev086 +Originator(s): mvertens (Mariana Vertenstein) +Date: Thu Mar 19 16:03:26 MDT 2020 +One-line Summary: Updates to NUOPC cap and minor fixes to ncdio_pio + +Purpose of changes +------------------ + +This tag has updates to the NUOPC cap that are needed for the latest +version of CMEPS. + +Now each component NUOPC cap needs to compute possibly time varying +orbital parameters. Before, in cpl7, this was done in the driver and +passed to the components via seq_infodata. However, now the driver is +really just a simple ascii file - so those calculations needed to +migrate to the component caps. + +In addition, this tag contains changes to ncdio_pio.F90 that improve +performance in some situations. + +This also updates MOSART and RTM tags to include fixes for the NUOPC cap +for MOSART and implementation of an initial NUOPC cap for RTM. + +Also, I1Pt compsets now use SROF rather than using an active runoff +model in 'null' mode. This leads to differences in namelists, but not in +results. + +Mariana Vertenstein implemented most of the changes in this tag; Jim +Edwards implemented the ncdio_pio changes; Bill Sacks did final testing +and integration. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/ctsm#943 (NUOPC tests will fail in ctsm1.0.dev085) + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: +- I1Pt tests and cases now use SROF rather than an active runoff model + with a null grid (only impacts namelists, not results) +- Changed nuopc test to use MOSART rather than SROF +- Changed finidat file used by LII test to solve a problem that was + uncovered with the ncdio_pio changes in this tag + +Code reviewed by: Bill Sacks + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- pass + izumi ------- pass + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: YES (just for NUOPC configurations) + + Summarize any changes to answers, i.e., + - what code configurations: Just some NUOPC configurations + - what platforms/compilers: + - nature of change (roundoff; larger than roundoff/same climate; new climate): + Not investigated carefully, but likely to be larger than roundoff + / same climate (due to introduction of time-varying orbital parameters) + + Differences are expected in NUOPC configurations using time-varying + orbital parameters. Note that no differences showed up in the test + suite, however, because the only nuopc test in the test suite is + new in this tag (so did not have baselines). + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): +- mosart: mosart1_0_35 -> mosart1_0_36 +- rtm: rtm1_0_70 -> rtm1_0_71 +- cmeps + +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/CTSM/issues/943 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev085 +Originator(s): sacks (Bill Sacks) +Date: Mon Mar 16 09:19:57 MDT 2020 +One-line Summary: Update cime + +Purpose of changes +------------------ + +Update to latest version of cime master + +Bugs fixed or introduced +------------------------ + +Known bugs introduced in this tag (include github issue ID): +- https://github.com/ESCOMP/CTSM/issues/943 - NUOPC tests will fail in ctsm1.0.dev085 + + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): +- NUOPC cases will fail from a standalone checkout + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: self + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- ok + izumi ------- pass + + Two test failures: + + PEND SMS_D_Vnuopc.f10_f10_musgs.I2000Clm50SpRsGs.cheyenne_intel.clm-default SHAREDLIB_BUILD + I have added this to the expected fails list for now + FAIL SMS_P720x1_Ln6.hcru_hcru.I2000Clm50BgcCruGs.cheyenne_intel.clm-coldStart BASELINE ctsm1.0.dev084: ERROR BFAIL baseline directory '/glade/p/cgd/tss/ctsm_baselines/ctsm1.0.dev084/SMS_P720x1_Ln6.hcru_hcru.I2000Clm50BgcCruGs.cheyenne_intel.clm-coldStart' does not exist + This test was added in the previous tag, but apparently wasn't run from there + + Note: I did testing using cime hash + 4f1880756a66ff12d304937d3c166d451ea50cf9, then updated to the tag + (cime5.8.17). The two are identical except for the cime ChangeLog. + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: NO + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): +cime: branch_tags/cime5.8.15_a01 -> cime5.8.17 + +Pull Requests that document the changes (include PR ids): none + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev084 +Originator(s): negins (Negin Sobhani,UCAR/CSEG,303-497-1224) +Date: Wed Feb 19 15:05:03 MST 2020 +One-line Summary: Bounds assertion for C isotopes when threading is on + +Purpose of changes +------------------ + +Previously, the bounds of c13 and c14 in subroutines TruncateCStates and +TruncateCandNStates were not checked when threading was on. This PR allows us +to handle c13 and c14 arrays like everything else in CTSM including (bounds +checking). + +This PR resolves issue ESCOMP/ctsm#811 + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): + -ESCOMP/ctsm#811 + +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.) + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: + - There was an issue (wrong wallclock time ) for one of the tests in the test + definitions which got fixed: (SMS_D_Vnuopc.f10_f10_musgs.I2000Clm50SpRsGs..) + - Also, I tried making the wallclocktime for all tests in + cime_config/testdefs/testlist_clm.xml consistent in the format of hh:mm:ss. + +Code reviewed by: Bill Sacks + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- OK + izumi ------- PASS + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: NO + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/CTSM/pull/923) + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev083 +Originator(s): negins (Negin Sobhani,UCAR/CSEG,303-497-1224) +Date: Thu Feb 6 12:12:26 MST 2020 +One-line Summary: Some BFB Fixes: Resolve issues #683, # 874, #878, # 885, # 745, #838 + +Purpose of changes +------------------ + +Resolved issues: + +ESCOMP/ctsm#683 : Writing out FATES parameters only on masterproc. +ESCOMP/ctsm#874 : Changing the number of timesteps to run for + SMS_P720x1_Ln3.hcru_hcru.I2000Clm50BgcCruGs.cheyenne_intel.clm-coldStar + to prevent failing with CMEPS. +ESCOMP/ctsm#878 : Removing the unused atm2lnd field. +ESCOMP/ctsm#885 : Changing the defaults for br_root in namelist_defaults to + enable FUN with CLM4.5. +ESCOMP/ctsm#745 : Removing ReadNL private subroutine from initVerticalMod.F90. +ESCOMP/ctsm#838 : Clarifying ZISNO in the variable long name. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +Resolves : + - ESCOMP/ctsm#683 + - ESCOMP/ctsm#874 + - ESCOMP/ctsm#878 + - ESCOMP/ctsm#885 + - ESCOMP/ctsm#745 + - ESCOMP/ctsm#838 + + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): + Not any changes in parameter values. + changing the default for br_root in namelist_defaults to enable FUN with + CLM4.5. + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: + Changed the number of timesteps from Ln3 to Ln6 for + SMS_P720x1_Ln3.hcru_hcru.I2000Clm50BgcCruGs.cheyenne_intel.clm-coldStar + +Code reviewed by: Bill Sacks + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- OK + izumi ------- PASS + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: NO + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/CTSM/pull/897 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev082 +Originator(s): oleson (Keith Oleson) +Date: Sat Feb 1 09:28:41 MST 2020 +One-line Summary: Rename variables to avoid confusion; fix QSNOEVAP diagnostic + +Purpose of changes +------------------ + +Renamed variables as discussed in ESCOMP/ctsm#118 throughout the code. + +Also made a couple of minor changes to fix a couple of potential +problems with these variables as described in the branch commit logs. + +Tested for bfb before changing the history field variables +themselves. These changes are all bfb (with the exception of QSNOEVAP) +for a 1 month global 2deg simulation, but may not be bfb under all +conditions. QSNOEVAP is not bfb because I've added in qflx_ev_snow for +lakes. + +Also, update cime slightly with a fix for izumi machine updates + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/ctsm#118 + + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none expected (not checked) + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: Bill Sacks + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- ok + izumi ------- ok + + ok: tests pass, answer changes in QSNOEVAP but nothing else (as expected) + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: YES (only one diagnostic field) + + Summarize any changes to answers, i.e., + - what code configurations: all + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + + Larger than roundoff, but only in the diagnostic field QSNOEVAP + + Possibility of other answer changes in rare circumstances, not + observed in testing. + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): +- cime: cime5.8.15 -> branch_tags/cime5.8.15_a01 + Minor update for izumi machine changes + +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/CTSM/pull/893 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev081 +Originator(s): slevis (Samuel Levis,SLevis Consulting LLC,303-665-1310) +Date: Mon Jan 13 15:37:07 MST 2020 +One-line Summary: Speed up restart writes + +Purpose of changes +------------------ + + E3SM#3163 made some changes to speed up restart writes. I use E3SM#3163 + function GetGlobalIndexArray in place of GetGlobalIndex so as to get + global indices by array rather than looping over every element. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): #801 + + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: Limited testing did not show substantial timing changes + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: + @billsacks + @bishtgautam + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - + + tools-tests (test/tools): + + cheyenne - + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - + + regular tests (aux_clm): + + cheyenne ---- OK + izumi ------- PASS + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: No + + @billsacks recommended running a global test in the branch vs. in master (i.e. + with vs. without the code mods) to compare restart files because the test suite + does not compare restart files and an error in the subgrid indices on the + restart file might go undetected. I ran this test: + ERS_D_Ld6.f10_f10_musgs.I1850Clm45BgcCrop.cheyenne_intel.clm-clm50CMIP6frc + and got identical values for all variables in the two restart files. + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): + https://github.com/ESCOMP/ctsm/pull/880 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev080 +Originator(s): sacks (Bill Sacks) +Date: Mon Dec 2 12:23:22 MST 2019 +One-line Summary: Update externals, minor fixes to work with latest cime, get nuopc cap working + +Purpose of changes +------------------ + +(1) Update to latest version of externals. This includes a significant + cime update. + +(2) Minor fixes to get things working with the latest version of cime. + +(3) Fix from Mariana Vertenstein to get NUOPC cap working, fixes to + externals cfg files to allow running NUOPC cases out of the box, and + add a NUOPC test. + + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): +CIME update brings in some changes, e.g., in mapping files; otherwise, none. + +Substantial timing or memory changes: not investigated + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: +- Added NUOPC test: + SMS_D_Vnuopc.f10_f10_musgs.I2000Clm50SpRsGs.cheyenne_intel.clm-default + +Code reviewed by: self + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- ok + izumi ------- ok + + ok means tests passed, some baseline comparisons failed as expected + + Note: Most testing was done on ad1ad752; then, from the latest + version, I ran a 2-test test list of: + - SMS_D_Vnuopc.f10_f10_musgs.I2000Clm50SpRsGs.cheyenne_intel.clm-default + - SMS_D.f10_f10_musgs.I2000Clm50SpRsGs.cheyenne_intel.clm-default + + In addition to verifying that the above tests passed, I also + inspected the sharedlib build area to verify that separate builds of + the clm library were done for mct and nuopc. + +If the tag used for baseline comparisons was NOT the previous tag, note that here: +- cheyenne tests compared against ctsm1.0.dev078, since cheyenne testing +was not run on ctsm1.0.dev079. + + +Answer changes +-------------- + +Changes answers relative to baseline: YES (only f10, same climate) + + Summarize any changes to answers, i.e., + - what code configurations: Cases at f10 resolution + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + Larger than roundoff, but probably same climate + + Answer changes are due to https://github.com/esmci/cime/pull/3186 + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): +- cime: branch_tags/cime5.8.3_chint17-05 -> cime5.8.15 +- rtm: rtm1_0_68 -> rtm1_0_70 +- mosart: mosart1_0_34 -> mosart1_0_35 +- cmeps: 471ac52 -> 181ff1ed9dfb279e619e8a2173f43baf7bf1dce3 + Also, note that cmeps is now checked out automatically + + +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/CTSM/pull/845 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev079 +Originator(s): sacks (Bill Sacks) +Date: Mon Nov 4 14:41:41 MST 2019 +One-line Summary: Change a few uses of shr_kind + +Purpose of changes +------------------ + +Change a few uses of shr_kind to work with latest cime. These changes +are from Mariana Vertenstein. + + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: Bill Sacks + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- NOT RUN! + izumi ------- pass + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: NO + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): none + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev078 +Originator(s): oleson (Keith Oleson) +Date: Thu Oct 31 12:30:00 MDT 2019 +One-line Summary: Fix rootr calculation with use_hydrstress true + +Purpose of changes +------------------ + +In cases with use_hydrstress=.true., both rootr_patch and rootr_col had +problems. This affected the diagnostic fields ROOTR and ROOTR_COLUMN, +and (in BGC cases) fed back on other parts of the system via affecting +the methane code. See https://github.com/ESCOMP/CTSM/issues/812 for more +details. + +This tag fixes this issue via these specific changes: + +1. Calculate btran in SoilMoistStressMod.F90 regardless of + use_hydrstress + +2. Comment on the applicability of this calculation and that of rootr in + SoilMoistStressMod.F90 + +3. Add the following comment to uses of rootr and rootr_col throughout + the code: "SMS method only" + +4. Allow ROOTR_COL history field only if use_hydrstress = .false. + +5. Remove the calculation of rootr_col in subroutine + Compute_EffecRootFrac_And_VertTranSink_HydStress within module + SoilWaterPlantSinkMod.F90 since that calculation is invalid for PHS. + +6. Normalize root resistances for pervious road over nlevgrnd, not + nlevsoi + +Note that the rootr calculation is done using the non-PHS (i.e., SMS) +method. So rootr is not really consistent with PHS; this is something +that should probably be revisited later. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Fixes ESCOMP/ctsm#812 (Problems with rootr when use_hydrstress=.true.) + + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: not checked; none expected + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: Bill Sacks + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- ok + izumi ------- ok + + ok means tests pass, answers change as expected + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: YES (PHS and methane) (same climate) + + Summarize any changes to answers, i.e., + - what code configurations: Clm50Bgc (cases with both use_hydrstress=.true. and methane active) + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + larger than roundoff / same climate + + For details on differences, see + https://github.com/ESCOMP/CTSM/issues/812#issuecomment-547924289 + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + - casename: clm50_ctsm10d074_2deg_GSWP3V1_rootr_hist + + URL for LMWG diagnostics output used to validate new climate: + http://webext.cgd.ucar.edu/I20TR/clm50_ctsm10d074_2deg_GSWP3V1_rootr_hist/lnd/clm50_ctsm10d074_2deg_GSWP3V1_rootr_hist.1995_2014-clm50_ctsm10d074_2deg_GSWP3V1_hist.1995_2014/setsIndex.html + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): none + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev077 +Originator(s): sacks (Bill Sacks) +Date: Sun Oct 27 16:23:39 MDT 2019 +One-line Summary: Consistently use frac_sno_eff rather than frac_sno in qg calculations + +Purpose of changes +------------------ + +Consistently use frac_sno_eff rather than frac_sno in qg calculations + +The change here only changes answers for (1) urban pervious road, and +(2) more broadly with use_subgrid_fluxes = .false. + +Previously, code in CalculateSurfaceHumidity was inconsistent regarding +the use of frac_sno vs. frac_sno_eff. I wanted to make this consistent +to facilitate upcoming cleanup of CalculateSurfaceHumidity. I went back +and forth as to which one we should use here. (See also +https://github.com/ESCOMP/CTSM/issues/822). + +Argument for frac_sno_eff: This is consistent with the use of +frac_sno_eff elsewhere in the calculation of surface fluxes. + +Argument for frac_sno: Even in CLM4.0 (prior to the introduction of +frac_sno_eff and frac_h2osfc), frac_sno was used to calculate surface +relative humidity. That makes me think that the parameterizations were +improved by using frac_sno here, even though frac_sno at that point was +mainly just used for albedo / radiation calculations. So sticking with +frac_sno would be more consistent with what has been done for a long +time, and would presumably be a bit better scientifically. + +However, when I tried changing this to use frac_sno rather than +frac_sno_eff: + + qg(c) = frac_sno_eff(c)*qg_snow(c) + (1._r8 - frac_sno_eff(c) - frac_h2osfc(c))*qg_soil(c) & + + frac_h2osfc(c) * qg_h2osfc(c) + +I got a crash with use_subgrid_fluxes false (test +SMS_D_Ld1_P4x1.f10_f10_musgs.I2000Clm45BgcCropQianRsGs.bishorn_gnu.clm-no_subgrid_fluxes), +due to a check I put in relatively recently to ensure that the top-layer +soil liquid never goes significantly negative: + +WJS 218: frac_sno, frac_sno_eff, frac_h2osfc, snl = 6.6447358408778726E-005 1.0000000000000000 0.0000000000000000 -1 + qg_snow, qg_soil, qg_h2osfc, qg = 3.8414454029812475E-003 3.6634834595404343E-003 3.6635176705822736E-003 3.6634952846414733E-003 + ERROR: In UpdateState_TopLayerFluxes, h2osoi_liq has gone significantly negative + Bulk/tracer name = bulk + c, lev_top(c) = 218 0 + h2osoi_liq_top_orig = 6.6448689668604415E-004 + h2osoi_liq = -2.6754040213948407E-004 + frac_sno_eff = 1.0000000000000000 + qflx_liq_grnd*dtime = 0.0000000000000000 + qflx_dew_grnd*dtime = 0.0000000000000000 + qflx_evap_grnd*dtime = 9.3202729882552822E-004 + ENDRUN: + ERROR: In UpdateState_TopLayerFluxes, h2osoi_liq has gone significantly negative + +What seems to be going on is: With a little bit of snow present, when I +use frac_sno rather than frac_sno_eff, we end up with a qg value very +close to that of soil. But I think the later evaporation happens from +the snow, at which point I guess the dryer air above leads to there +being too large evaporation from the snow. + +So in the end, I decided to consistently use frac_sno_eff, even though +this might be a small step backwards in terms of the accuracy of surface +humidity for urban pervious road and with use_subgrid_fluxes = .false. + + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: self (but approved conceptually by Sean Swenson and +Keith Oleson) + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- ok + izumi ------- ok + + ok means tests pass, answers change as expected + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: YES (Small) + + Summarize any changes to answers, i.e., + - what code configurations: all + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + Expected to be larger than roundoff/same climate, but not + investigated carefully + + For the default configuration with use_subgrid_fluxes = .true., + differences are restricted to urban pervious road. I spot-checked + a few tests to ensure that we only saw differences in FSH for + urban landunits; this was generally true, with the exception of + ERP_Ly3_P72x2.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-cropMonthOutput, + which also had differences over crop and natural veg + landunits. This spillover effect seems to be related to the + non-local interactions that arise from methane's dependence on + TWS, though I don't understand why I only saw this in a transient + case, and not in similar non-transient cases. See + https://github.com/ESCOMP/CTSM/issues/658#issuecomment-546740771 + for more details. + + For the non-default use_subgrid_fluxes = .false., there + differences in the natural vegetation and crop landunits, too. + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): none + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev076 +Originator(s): sacks (Bill Sacks) +Date: Fri Oct 25 16:04:20 MDT 2019 +One-line Summary: Set frac_sno_eff=0 if frac_sno is 0; avoid unnecessary calls to QSat + +Purpose of changes +------------------ + +Two changes that are bit-for-bit except for changes in the FSNO_EFF +diagnostic field, both with an eye towards cleaning up +SurfaceHumidityMod in preparation for adding water tracers to that +module: + +(1) Set frac_sno_eff to 0 if frac_sno is 0. Previously, for cases where + frac_sno_eff was a binary 0/1 rather than being set equal to + frac_sno, frac_sno_eff was always being set to 1, even if there was + no snow. Sean Swenson thinks that didn't matter, but I found it + confusing, and it could be more problematic with some upcoming + changes I plan to make (where I'm going to use frac_sno_eff as a + weighting factor in calculating qg terms, including for landunits + that use a binary 0/1 frac_sno_eff.) + +(2) Avoid unnecessary calls to QSat, since this function is relatively + expensive. + + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: No substantial changes; from a +single run of PFS_Ld20.f09_g17.I2000Clm50BgcCrop.cheyenne_intel, max +timing of the main changed section (bgp1) decreased by about 10%; this +may be within machine variability, though. + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: self + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- ok + izumi ------- ok + + ok means tests pass, answer changes as expected just for FSNO_EFF + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: YES, but just for the diagnostic field FSNO_EFF + + Summarize any changes to answers, i.e., + - what code configurations: all + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + diagnostic only: just changes FSNO_EFF + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): none + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev075 +Originator(s): sacks (Bill Sacks) +Date: Fri Oct 25 15:44:52 MDT 2019 +One-line Summary: Lakes: Adjust frac_sno after updating 0-layer snow pack for dew & sublimation + +Purpose of changes +------------------ + +Main change is: for lakes, possibly adjust frac_sno after updating +0-layer snow pack for dew & sub, ensuring that zero vs. non-zero values +of frac_sno agree with whether the snow pack has zero or non-zero +amounts of snow. The main motivation for this is to ensure that, if we +have any snow, then frac_sno should be non-zero. Along with this, I'm +also ensuring that, if we go down to 0 snow, then we also go down to 0 +frac_sno. + +A related change was to move the code ensuring that h2osno_no_layers +doesn't go negative: I have moved this to before h2osno_no_layers is +referenced, to assure we don't get a slightly negative snow depth. (I +haven't noticed any problems due to the old placement, but it seems +safer to put the limiting before the reference to h2osno_no_layers.) + +Also, an unrelated change in run_sys_tests: Add option for rerunning +existing failed tests. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/ctsm#827 (Lake frac_sno can remain 0 even when there + is some snow addition from frost) + + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: None expected + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: self + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - pass (on my mac: 'make test' with python2 & python3 and 'make lint') + + regular tests (aux_clm): + + cheyenne ---- ok + izumi ------- ok + + ok means tests pass, answers change as expected + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: YES (Small) + + Summarize any changes to answers, i.e., + - what code configurations: all + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + Expected to be larger than roundoff/same climate + + Changes are introduced only over lake columns, and these changes + should be small, since they only relate to the setting of frac_sno + when there is dew or sublimation on a very thin snow + pack. + + Although the direct changes should only affect lakes, I did + observe changes in crop columns in a transient test that I + spot-checked + (ERP_Ly3_P72x2.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-cropMonthOutput) + - maybe due to some of the non-local interactions in + https://github.com/ESCOMP/CTSM/wiki/Parameterizations-that-can-cause-nonlocal-interactions, + or maybe due to some other non-local interaction, either known or + buggy. (In non-transient tests that I spot checked + (ERP_P72x2_Lm36.f10_f10_musgs.I2000Clm50BgcCrop.cheyenne_intel.clm-clm50cropIrrigMonth_interp + and + SMS_Lm13.f19_g17.I2000Clm50BgcCrop.cheyenne_intel.clm-cropMonthOutput): + diffs in FSH in h1 file are just over lake landunits, as + expected.) + + Update: it seems that these changes in crop columns arise from + the nonlocal interactions caused by the dependence of methane + on TWS, though I don't understand why I only saw this in a + transient case, and not in similar non-transient cases. See + https://github.com/ESCOMP/CTSM/issues/658#issuecomment-546740771 + for more details. + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): none + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev074 +Originator(s): sacks (Bill Sacks) +Date: Wed Oct 23 19:25:21 MDT 2019 +One-line Summary: For lakes: when reading finidat, set frac_sno=1 if h2osno_total > 0 + +Purpose of changes +------------------ + +Due to ESCOMP/ctsm#783, frac_sno used to be 0 for all lake points. That +was mostly fixed, but the issue is still present on initial conditions +files that were generated prior to that fix (which includes most or all +of our out-of-the-box restart files). This causes frac_sno to be 0 for +lake points at the start of the simulation, even if there is a snow pack +present. Currently this doesn't cause significant problems, but I'd like +to change the calculation of frac_sno_eff so that it is 0 if frac_sno is +0 - and then this frac_sno problem becomes an issue (causing divide by 0 +in at least one place). + +However, further problems were introduced if I tried to always apply +this correction: It appears that sometimes the restart file legitimately +has frac_sno == 0 for lake columns with non-zero snow cover. To avoid +changing answers for newer restart files, I am writing metadata to the +restart file documenting whether the fix has already been applied on +that restart file, and if so, we avoid reapplying the fix. + +Getting this restart metadata correct was tricky, especially when +running init_interp. I have introduced a new module to encapsulate this +complexity. This can be used in general for writing / reading metadata +on which issues have been fixed on a given restart file. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): [If none, remove this line] +- Resolves ESCOMP/ctsm#783 + + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): +- The setting of initial lake frac_sno to 1 isn't exactly correct, but + it's better than the old value of 0. + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none +- I didn't check the PFS test, but the only change that could have + likely led to performance changes was the addition of a metadata copy + in init_interp. I checked the timing of this piece, and found it to be + a negligible portion of the total init_interp time + (https://github.com/ESCOMP/CTSM/pull/825#issuecomment-545219601). + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: Erik Kluzek gave this an initial look and gave general +approval for the restart file metadata mechanism I have added. He may +give it a more careful look, possibly accompanied by a further cleanup +tag addressing any issues he finds. + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- ok + izumi ------- ok + + ok means tests passed, baselines fail as expected. + + Note that the FUNIT test failed initially; I got it passing on my + Mac, but didn't rerun it on cheyenne. + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: YES (same climate, only at startup) + + Summarize any changes to answers, i.e., + - what code configurations: all + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + Larger than roundoff/same climate + + The only change is in initial lake frac_sno. This should only + affect the start of the simulation, and only over lake points. I + verified that changes are only over lake points via: For both + SMS_D_Ld1.f09_g17.I1850Clm50Sp.cheyenne_intel.clm-default (which + doesn't use init_interp) and + SMS_D_Ld3.f10_f10_musgs.I2000Clm50BgcCruGs.cheyenne_gnu.clm-default + (which uses init_interp): I checked which points have differences + in FSH in the h1 (vector) history file. Diffs were only over lake + points. + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/CTSM/pull/825 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev073 +Originator(s): sacks (Bill Sacks) +Date: Tue Oct 22 06:14:24 MDT 2019 +One-line Summary: Fix bug in calculation of dqgdT + +Purpose of changes +------------------ + +The calculation of dqgdT, which gives the derivative, d(qg)/dT, was +incorrect for soil/crop landunits when there is no snow. This tag fixes +that bug. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/CTSM#824 (dqgdT incorrect when there is no snow) + + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: not checked, but none expected + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: Sean Swenson reviewed and approved my plan, though not the final code + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- ok + izumi ------- ok + + ok means tests pass, answers change as expected + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: YES (small) + + Summarize any changes to answers, i.e., + - what code configurations: all + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + Larger than roundoff/same climate + + I checked the impact from one-day averages in test + SMS_D_Ld1_P4x1.f10_f10_musgs.I2000Clm50BgcCropQianRsGs.bishorn_gnu.clm-default, + by looking at differences in EFLX_LH_TOT. The impact is small: + daily-average differences in that variable are typically 0.01 W + m-2 or less; most grid cells have significantly less difference + than that; only one or a few f10 grid cells have significantly + greater differences, with the biggest difference being about 0.1 W + m-2. + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): none + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev072 +Originator(s): mvertens (Mariana Vertenstein) +Date: Tue Oct 15 09:41:50 MDT 2019 +One-line Summary: Add NUOPC cap + +Purpose of changes +------------------ + +Add NUOPC cap in order to run with the new NUOPC driver/mediator. There +was some code movement / refactoring of existing code to support this, +with the biggest change being the introduction of a new subdirectory +under src/cpl. + +Most changes are from Mariana Vertenstein and Jim Edwards. + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none expected (not checked) + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): +- NUOPC cap currently does not have any tests in the aux_clm test suite +- There are currently no tests ensuring that the nuopc and mct caps give + bit-for-bit answers, though the nuopc_cap_bfb testmod could be used to + support such a test + +Changes to tests or testing: none + +Code reviewed by: Bill Sacks + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- pass + izumi ------- pass + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: NO + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): +- mosart: mosart1_0_33 -> mosart1_0_34 (supports nuopc cap) + +Pull Requests that document the changes (include PR ids): none + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev071 +Originator(s): sacks (Bill Sacks) +Date: Fri Oct 11 07:03:40 MDT 2019 +One-line Summary: Split CanopyTemperature into separate pieces + +Purpose of changes +------------------ + +CanopyTemperature was doing a few unrelated things, none of which +actually had anything to do with calculating canopy temperature. At the +driver level, I have split CanopyTemperature into BiogeophysPreFluxCalcs +and CalculateSurfaceHumidity. BiogeophysPreFluxCalcs calls out to a +number of separate routines, some in that same module and some +elsewhere, including a new routine in FrictionVelocityMod. + +Also some minor related cleanup, including + +- Made FrictionVelocityMod object-oriented + +- A bit of rework of how qflx_evap_veg and qflx_tran_veg are set. This + changes answers for the (default inactive) QFLX_EVAP_VEG history field + (see also ESCOMP/ctsm#816). + +- Removed qsat conditionals that should never be invoked + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Fixes ESCOMP/ctsm#816 (QFLX_EVAP_VEG should be 0 over lakes) + + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: self + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- pass + izumi ------- pass + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: YES, but only for the (default-inactive) field QFLX_EVAP_VEG + + Summarize any changes to answers, i.e., + - what code configurations: all + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + larger than roundoff, but only for the default-inactive field QFLX_EVAP_VEG + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): none + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev070 +Originator(s): sacks (Bill Sacks) +Date: Wed Oct 9 06:16:39 MDT 2019 +One-line Summary: Fix for writing 0-d variables with PIO2 + +Purpose of changes +------------------ + +Previously, there were problems when writing 0-d (scalar) variables with +PIO2 in DEBUG mode. This change fixes that issue. + +Jim Edwards put in place an initial fix; I put in place the final fix +based on changes Mariana Vertenstein made in MOSART. I have not tested +this with PIO2, but am hopeful that it fixes the PIO2 problem since the +similar MOSART changes fixed that problem. + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: self; earlier version reviewed by Erik Kluzek and Mariana Vertenstein + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- pass + izumi ------- pass + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: NO + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/CTSM/pull/810 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev069 +Originator(s): sacks (Bill Sacks) +Date: Mon Oct 7 10:22:22 MDT 2019 +One-line Summary: Misc. code cleanup and minor bug fixes + +Purpose of changes +------------------ + +Resolve a variety of "simple bfb" issues. Note that some of these result +in answer changes for select diagnostic fields. See specific notes below +for details, under "Issues fixed" and answer changes. + +The fix for ESCOMP/ctsm#27 changes answers for some diagnostic fields, +as noted below. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/ctsm#27 (BTRAN should be spval over all special + landunits) + - Also fixed some related fields, as noted below, under answer changes + +- Resolves ESCOMP/ctsm#31 (some CLM history fields don't restart + properly) + - This was mostly resolved previously; here I just did some final + cleanup and fixing of NFIRE + +- Resolves ESCOMP/ctsm#48 (code for initializing some isotope carbon + state variables looks wrong) + - Removed the incorrect code, which was never being exercised + +- Resolves ESCOMP/ctsm#58 (Change SHR_ASSERT calls to avoid using + errMsg) + - Purpose was to speed up DEBUG runs on some machines/compilers + +- Resolves ESCOMP/ctsm#111 (Precision of constants in + SoilTemperature.F90 is not double) + - No answer changes, because 1 (single prec) = 1 (double prec) + +- Resolves ESCOMP/ctsm#334 (Introduce a new activelayer_type) + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: potentially speeds up debug runs on some machines/compilers + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: self + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- ok + izumi ------- ok + + ok means tests pass, some baseline comparisons fail as expected + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: YES, but just for select diagnostic fields + + Summarize any changes to answers, i.e., + - what code configurations: ALL + - what platforms/compilers: ALL + - nature of change (roundoff; larger than roundoff/same climate; new climate): + Greater than roundoff, but only in select diagnostic field - no impact on climate + + There were changes in the following diagnostic fields, which are + now averaged over only vegetated landunits (see ESCOMP/ctsm#27): + - BTRAN + - BTRANMN + - RSSHA + - RSSUN + - ROOTR (inactive by default) + - ROOTR_COLUMN (inactive by default) + - RRESIS (inactive by default) + + Changes are also possible in rare circumstances for the NFIRE + diagnostic field, in transient cases, although no differences were + observed for this field in the test suite (see ESCOMP/ctsm#31). + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): none + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev068 +Originator(s): sacks (Bill Sacks) +Date: Mon Sep 30 09:57:04 MDT 2019 +One-line Summary: Add water tracers to CombineSnowLayers, DivideSnowLayers, ZeroEmptySnowLayers + +Purpose of changes +------------------ + +Add water tracers to CombineSnowLayers, DivideSnowLayers and +ZeroEmptySnowLayers. This completes the tracerization of the core snow +code: most or all of the code in SnowHydrologyMod is now tracerized. + +In contrast to most routines that I have tracerized, the tracerization +of these routines is done by embedding loops over tracers inside +existing code structures, rather than splitting out separate routines +that operate on bulk or tracer quantities. This is because (1) it didn't +make sense to introduce explicit fluxes for the state updates done here, +so we didn't have the extra need of having separate routines for flux +calculations vs. state updates; (2) the state updates were embedded in +loops over levels and conditionals in a way that would have been awkward +and messy to try to separately update bulk-and-tracer quantities +(h2osoi_liq, h2osoi_ice, etc.) from bulk-only quantities (dz, etc.). + +Also, a bit of reordering of LakeHydrologyMod in order to keep the snow +code more together. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/ctsm#778 (Implement water tracers for combining and + dividing snow layers) + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: I don't think so + Based on the changes introduced, I expect *very* small increases in + runtime of the modified routines (which would show up in the + hydro_without_drainage timer), even for cases without water tracers, + but I wouldn't expect this to have a significant impact. From PFS + test, and specifically looking at the timing of + hydro_without_drainage in that test, I see a possible small increase + (a few percent) in the timing of that section, though the differences + are within typical machine variability, so don't seem necessarily + significant. + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: self + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- pass + izumi ------- pass + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: NO + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): none + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev067 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Thu Sep 26 15:02:39 MDT 2019 +One-line Summary: Add config_archive.xml to CTSM cime_config -- no testing + +Purpose of changes +------------------ + +Add config_archive.xml to cime_config for CTSM. Update the CODE_OF_CONDUCT +to the August/2019 UCAR version. + +No testing done. + +Bugs fixed or introduced +------------------------ + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): None + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): None + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): None + +Changes to tests or testing: None + +Code reviewed by: self + + +CTSM testing: doc (no standard testing done) + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + src unit-tests: + + cheyenne - PASS + + regular tests (aux_clm): None + +If the tag used for baseline comparisons was NOT the previous tag, note that here: previous + + +Answer changes +-------------- + +Changes answers relative to baseline: No! + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None + +Pull Requests that document the changes (include PR ids): None +(https://github.com/ESCOMP/ctsm/pull) + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev066 +Originator(s): sacks (Bill Sacks) +Date: Fri Sep 20 09:07:23 MDT 2019 +One-line Summary: Add water tracers to SnowCapping + +Purpose of changes +------------------ + +Update water tracer terms in SnowCapping. As I have done elsewhere, this +has involved splitting each piece of SnowCapping into its own subroutine, +which operates either on bulk, tracers, or bulk + tracers. + +This is supported by calls to ResetCheckedTracers prior to the call to +SnowCapping, since some intervening code is not yet tracerized. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/ctsm#777 (Implement water tracers for SnowCapping) + + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + Small increase in total runtime of PFS test, but the relevant timing + section, hydro_without_drainage, took slightly *less* time compared + with the last tag. + + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: self + + +CTSM testing: + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- pass + izumi ------- pass + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: NO + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): none + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev065 +Originator(s): sacks (Bill Sacks) +Date: Sat Sep 14 12:52:42 MDT 2019 +One-line Summary: Add water tracers to SnowWater + +Purpose of changes +------------------ + +Update water tracer terms in SnowWater. As I have done elsewhere, this +has involved splitting each piece of SnowWater into its own subroutine, +which operates either on bulk, tracers, or bulk + tracers. + +This is supported by calls to ResetCheckedTracers prior to the call to +SnowWater, since some intervening code is not yet tracerized. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/ctsm#776 (Implement water tracers for SnowWater) + + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: self + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- ok + izumi ------- ok + + ok means tests pass, baselines fail as expected + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: YES (roundoff) + + Summarize any changes to answers, i.e., + - what code configurations: all + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + + Roundoff level: answer changes just arise because I have made + qflx_snow_percolation_col a true flux, with units of + per-unit-time; this involved dividing by dtime, and later + multiplying by dtime when it is applied to states. Previously, the + corresponding variable (qout / qin) was not per-unit-time. + + If bitwise differences were observed, how did you show they were no worse + than roundoff? + + I ran comparisons against a version off of master that had the + minimal changes to exhibit these roundoff-level changes. Diffs for + this are below. My branch is bit-for-bit with this version. + + diff --git a/src/biogeophys/SnowHydrologyMod.F90 b/src/biogeophys/SnowHydrologyMod.F90 + index cad47e28..0abcc49f 100644 + --- a/src/biogeophys/SnowHydrologyMod.F90 + +++ b/src/biogeophys/SnowHydrologyMod.F90 + @@ -1140,17 +1140,17 @@ subroutine SnowWater(bounds, & + c = filter_snowc(fc) + if (j >= snl(c)+1) then + + - h2osoi_liq(c,j) = h2osoi_liq(c,j) + qin(c) + + h2osoi_liq(c,j) = h2osoi_liq(c,j) + qin(c)*dtime + + - mss_bcphi(c,j) = mss_bcphi(c,j) + qin_bc_phi(c) + - mss_bcpho(c,j) = mss_bcpho(c,j) + qin_bc_pho(c) + - mss_ocphi(c,j) = mss_ocphi(c,j) + qin_oc_phi(c) + - mss_ocpho(c,j) = mss_ocpho(c,j) + qin_oc_pho(c) + + mss_bcphi(c,j) = mss_bcphi(c,j) + qin_bc_phi(c)*dtime + + mss_bcpho(c,j) = mss_bcpho(c,j) + qin_bc_pho(c)*dtime + + mss_ocphi(c,j) = mss_ocphi(c,j) + qin_oc_phi(c)*dtime + + mss_ocpho(c,j) = mss_ocpho(c,j) + qin_oc_pho(c)*dtime + + - mss_dst1(c,j) = mss_dst1(c,j) + qin_dst1(c) + - mss_dst2(c,j) = mss_dst2(c,j) + qin_dst2(c) + - mss_dst3(c,j) = mss_dst3(c,j) + qin_dst3(c) + - mss_dst4(c,j) = mss_dst4(c,j) + qin_dst4(c) + + mss_dst1(c,j) = mss_dst1(c,j) + qin_dst1(c)*dtime + + mss_dst2(c,j) = mss_dst2(c,j) + qin_dst2(c)*dtime + + mss_dst3(c,j) = mss_dst3(c,j) + qin_dst3(c)*dtime + + mss_dst4(c,j) = mss_dst4(c,j) + qin_dst4(c)*dtime + + if (j <= -1) then + ! No runoff over snow surface, just ponding on surface + @@ -1167,8 +1167,8 @@ subroutine SnowWater(bounds, & + qout(c) = max(0._r8,(vol_liq(c,j) & + - ssi*eff_porosity(c,j))*dz(c,j)*frac_sno_eff(c)) + end if + - qout(c) = qout(c)*1000._r8 + - h2osoi_liq(c,j) = h2osoi_liq(c,j) - qout(c) + + qout(c) = (qout(c)*1000._r8)/dtime + + h2osoi_liq(c,j) = h2osoi_liq(c,j) - qout(c)*dtime + qin(c) = qout(c) + + ! mass of ice+water: in extremely rare circumstances, this can + @@ -1187,7 +1187,7 @@ subroutine SnowWater(bounds, & + if (qout_bc_phi(c) > mss_bcphi(c,j)) then + qout_bc_phi(c) = mss_bcphi(c,j) + endif + - mss_bcphi(c,j) = mss_bcphi(c,j) - qout_bc_phi(c) + + mss_bcphi(c,j) = mss_bcphi(c,j) - qout_bc_phi(c)*dtime + qin_bc_phi(c) = qout_bc_phi(c) + + ! BCPHO: + @@ -1196,7 +1196,7 @@ subroutine SnowWater(bounds, & + if (qout_bc_pho(c) > mss_bcpho(c,j)) then + qout_bc_pho(c) = mss_bcpho(c,j) + endif + - mss_bcpho(c,j) = mss_bcpho(c,j) - qout_bc_pho(c) + + mss_bcpho(c,j) = mss_bcpho(c,j) - qout_bc_pho(c)*dtime + qin_bc_pho(c) = qout_bc_pho(c) + + ! OCPHI: + @@ -1205,7 +1205,7 @@ subroutine SnowWater(bounds, & + if (qout_oc_phi(c) > mss_ocphi(c,j)) then + qout_oc_phi(c) = mss_ocphi(c,j) + endif + - mss_ocphi(c,j) = mss_ocphi(c,j) - qout_oc_phi(c) + + mss_ocphi(c,j) = mss_ocphi(c,j) - qout_oc_phi(c)*dtime + qin_oc_phi(c) = qout_oc_phi(c) + + ! OCPHO: + @@ -1214,7 +1214,7 @@ subroutine SnowWater(bounds, & + if (qout_oc_pho(c) > mss_ocpho(c,j)) then + qout_oc_pho(c) = mss_ocpho(c,j) + endif + - mss_ocpho(c,j) = mss_ocpho(c,j) - qout_oc_pho(c) + + mss_ocpho(c,j) = mss_ocpho(c,j) - qout_oc_pho(c)*dtime + qin_oc_pho(c) = qout_oc_pho(c) + + ! DUST 1: + @@ -1223,7 +1223,7 @@ subroutine SnowWater(bounds, & + if (qout_dst1(c) > mss_dst1(c,j)) then + qout_dst1(c) = mss_dst1(c,j) + endif + - mss_dst1(c,j) = mss_dst1(c,j) - qout_dst1(c) + + mss_dst1(c,j) = mss_dst1(c,j) - qout_dst1(c)*dtime + qin_dst1(c) = qout_dst1(c) + + ! DUST 2: + @@ -1232,7 +1232,7 @@ subroutine SnowWater(bounds, & + if (qout_dst2(c) > mss_dst2(c,j)) then + qout_dst2(c) = mss_dst2(c,j) + endif + - mss_dst2(c,j) = mss_dst2(c,j) - qout_dst2(c) + + mss_dst2(c,j) = mss_dst2(c,j) - qout_dst2(c)*dtime + qin_dst2(c) = qout_dst2(c) + + ! DUST 3: + @@ -1241,7 +1241,7 @@ subroutine SnowWater(bounds, & + if (qout_dst3(c) > mss_dst3(c,j)) then + qout_dst3(c) = mss_dst3(c,j) + endif + - mss_dst3(c,j) = mss_dst3(c,j) - qout_dst3(c) + + mss_dst3(c,j) = mss_dst3(c,j) - qout_dst3(c)*dtime + qin_dst3(c) = qout_dst3(c) + + ! DUST 4: + @@ -1250,7 +1250,7 @@ subroutine SnowWater(bounds, & + if (qout_dst4(c) > mss_dst4(c,j)) then + qout_dst4(c) = mss_dst4(c,j) + endif + - mss_dst4(c,j) = mss_dst4(c,j) - qout_dst4(c) + + mss_dst4(c,j) = mss_dst4(c,j) - qout_dst4(c)*dtime + qin_dst4(c) = qout_dst4(c) + + end if + @@ -1280,9 +1280,9 @@ subroutine SnowWater(bounds, & + do fc = 1, num_snowc + c = filter_snowc(fc) + ! Qout from snow bottom + - qflx_snow_drain(c) = qflx_snow_drain(c) + (qout(c) / dtime) + + qflx_snow_drain(c) = qflx_snow_drain(c) + qout(c) + + - qflx_rain_plus_snomelt(c) = (qout(c) / dtime) & + + qflx_rain_plus_snomelt(c) = qout(c) & + + (1.0_r8 - frac_sno_eff(c)) * qflx_liq_grnd(c) + int_snow(c) = int_snow(c) + frac_sno_eff(c) & + * (qflx_dew_snow(c) + qflx_dew_grnd(c) + qflx_liq_grnd(c)) * dtime + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): none + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev064 +Originator(s): slevis (Samuel Levis,SLevis Consulting LLC,303-665-1310) +Date: Mon Sep 9 13:14:51 MDT 2019 +One-line Summary: User defined top-two snow layers + +Purpose of changes +------------------ + + Instead of hardcoding, we now set: + + dzmin(1) = snow_dzmin_1 + dzmax_l(1) = snow_dzmax_l_1 + dzmax_u(1) = snow_dzmax_u_1 + dzmin(2) = snow_dzmin_2 + dzmax_l(2) = snow_dzmax_l_2 + dzmax_u(2) = snow_dzmax_u_2 + + where the right-hand-side variables get namelist-defined values and the + model calculates dzmin and dzmax_* for the remaining snow layers using + recursive formulas. The calculation is intended to match the previously + hardcoded values, except for the bottom snow layer when nlevsno < 12. + The bottom layer now always gets dzmax_* = huge(1._r8). The formulas + appear in a document titled "A firn model for CLM" that is linked to + #729. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): #729 + + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): + New namelist parameters for specifying the top-two snow layers: + snow_dzmin_1, snow_dzmax_l_1, snow_dzmax_u_1 + snow_dzmin_2, snow_dzmax_l_2, snow_dzmax_u_2 + +Changes made to namelist defaults (e.g., changed parameter values): + Introduced default values for the new parameters so as to maintain + same answers to within roundoff + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: @billsacks + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - + + tools-tests (test/tools): + + cheyenne - + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - + + regular tests (aux_clm): + + cheyenne ---- OK + izumi ------- OK + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: YES (roundoff) + + Summarize any changes to answers, i.e., + - what code configurations: all + - what platforms/compilers: all + - nature of change: roundoff + + If bitwise differences were observed, how did you show they were no worse + than roundoff? + Introduced temporary code to overwrite dzmin(j), dzmax_l(j), and + dzmax_u(j) with their original values when different by less than + 1e-13 from their original values for all but the bottom snow layer. + The bottom layer was left as dzmax_l = dzmax_u(j) = huge(1._8), i.e. + the new value. The test resulted in bit-for-bit same answers. + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): + https://github.com/ESCOMP/ctsm/pull/792 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev063 +Originator(s): erik (Erik Kluzek) +Date: Thu Sep 5 21:28:02 MDT 2019 +One-line Summary: Two answer changing fixes (fire, DWT_SLASH) and fix for urban streams for Clm45 + +Purpose of changes +------------------ + +Fire bug fix and DWT_SLASH change and fix urban stream years for clm4_5. +The latitude used in an expression for Bgc-Fire model Li2016 (used in Clm50) +had latitude in degrees rather than in radians as it should have been. The +term is used for ignition and the cosine was being taken in degrees rather +than radians, hence the spatial pattern for ignition with latitude was incorrect. + +The history field DWT_SLASH_CFLUX was being calculated on the column, but +really should have been a patch level variable. In the same way other fields +were handled we made DWT_SLASH_CFLUX a grid-cell variable, and added +DWT_SLASH_CFLUX_PATCH on the patch level that could be added to output. The same +is true of the C13_ and C14_ versions of it. + +Clm45 was setting urbantv to year 2000, rather than 1850 or historical as it should +have. The urbantv file for Clm45 doesn't actually change, so this doesn't actually +make a difference. But, it does make the namelist look wrong. + +Note, that SP cases, Vic cases and Fates cases do NOT change answers. Or if fire is +off, or certain single-point cases. Some cold-start cases don't seem to be sensitive +to it either. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): #175, #787, #780 + fixes #175 urban stream years for clm4_5 + fixes #787 DWT_SLASH field + fixes #780 Bug in CN Fire Li 2016 which used latitude in degrees rather than radians + +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_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): None + +Changes made to namelist defaults (e.g., changed parameter values): Defaults for urbantv for clm4_5 + +Changes to the datasets (e.g., parameter, surface or initial files): None + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): None + +Changes to tests or testing: None + +Code reviewed by: self, @olywon + + +CTSM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS (62 compare fail due to namelist changes) + + regular tests (aux_clm): + + cheyenne ---- OK + izumi ------- OK + +If the tag used for baseline comparisons was NOT the previous tag, note that here: previous + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes! (important clm5_0-BGC) + + Summarize any changes to answers, i.e., + - what code configurations: Clm50Bgc and some Clm45Bgc cases + - what platforms/compilers: All + - nature of change: similar climate (but fire ignition pattern changes by latitude) + DWT_SLASH_* history fields change because moved to gridcell quantity (so change is relatively minor) + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + - casename: oleson/clm50_cesm20R_2deg_GSWP3V1_issue780_hist (for the fire change) + + URL for LMWG diagnostics output used to validate new climate: +http://webext.cgd.ucar.edu/I20TR/clm50_cesm20R_2deg_GSWP3V1_issue780_hist/lnd/clm50_cesm20R_2deg_GSWP3V1_issue780_hist.1995_2014-clm50_cesm20R_2deg_GSWP3V1_hist.1995_2014/setsIndex.html + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None + +Pull Requests that document the changes (include PR ids): #802 +(https://github.com/ESCOMP/ctsm/pull) + #802 -- Three answer changing fixes (fire, DWT_SLASH, urban streams for clm4_5) + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev062 +Originator(s): sacks (Bill Sacks) +Date: Tue Sep 3 16:04:28 MDT 2019 +One-line Summary: Move hobart tests to izumi + +Purpose of changes +------------------ + +Move all hobart testing to izumi. + + +Bugs fixed or introduced +------------------------ + +Known bugs introduced in this tag (include github issue ID): +- Recurrence of ESCOMP/ctsm#174 (ne30 case fails on hobart_nag due to floating overflow) + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): +- Testing should now be run on izumi, not hobart + +Changes to tests or testing: +- All hobart tests moved to izumi + +Code reviewed by: self + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- not run + izumi ------- pass + + Also ran prealpha and prebeta tests that I moved from hobart to izumi. These passed except: + - ERP_D_Ld5.ne30_g16.I1850Clm50BgcCrop.izumi_nag.clm-default (#174) + - ERP_Ld5.f19_g17.I2000Clm50SpRtmFl.izumi_pgi.clm-default + - SMS_D_Ld1.f19_g17.I1850Clm45Cn.izumi_pgi.clm-default + + The last two failed with errors like: + + i011.unified.ucar.edu.44619hfi_userinit: mmap of status page (dabbad0008040000) failed: Operation not permitted + + I wonder if the issue is that multi-node pgi cases don't work on izumi? + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: NO + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): +- cime: cime5.8.3_chint17-04 -> cime5.8.3_chint17-05 + Minor change on izumi to allow using run_sys_tests + +Pull Requests that document the changes (include PR ids): none + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev061 +Originator(s): erik (Erik Kluzek) +Date: Sun Sep 1 22:37:07 MDT 2019 +One-line Summary: Simple b4b fixes: new params file, remove override_nsrest/anoxia_wtsat, DV deprecated + +Purpose of changes +------------------ + +New clm5 paramsfile that has the bad date of 631 changed to 701. Along with some simple bit for +bit changes. Removing some problematic options. Making Dynamic Vegetation a deprecated option +that requires you to use -ignore_warnings with it. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): #463 #79 #97 #98 #104 #122 #173 #794 #795 #796 + + Fixes #463 bad date on params file that didn't allow using ESMF library with Crop + Fixes #79 correct documentation of qflx_evap_tot + Fixes #97 remove override_nsrest + Fixes #98 add warning when using single instance of a startup file for multi-instance cases + Fixes #104 use get_step_size_real when putting into a real variable + Fixes #122 decomp pool arrays should not start at 0 but 1 + Fixes #173 remove psi_soil_ref as not used + Fixes #794 remove anoxia_wtsat + Fixes #795 Correct documentation of -light_res + Fixes #796 Deprecate Dynamic Vegetation + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): Remove namelist items + Remove namelist items: anoxia_wtsat, override_nsrest + Turning dynamic Vegetation on, now displays a warning, and requires using -ignore_warnings in CLM_BLDNML_OPTS + +Changes made to namelist defaults (e.g., changed parameter values): New paramdata files + +Changes to the datasets (e.g., parameter, surface or initial files): + clm5 paramdata file has correct date for crop of 701 (rather than incorrect 631) + clm5 and clm4_5 paramdata file removed an unused variable + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): None + +Changes to tests or testing: DV tests removed or changed + +Code reviewed by: self + +CTSM testing: regular + + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS (compare shows changes becausse of paramdata files) + + regular tests (aux_clm): + + cheyenne ---- OK + hobart ------ OK + +An additional fail is ERP_P36x2_D_Ld5.f10_f10_musgs.I2000Clm50Cn.cheyenne_gnu.clm-default, because +of #798. Because it's an issue with cime, I'm not marking it as an expected error. + +If the tag used for baseline comparisons was NOT the previous tag, note that here: previous + + +Answer changes +-------------- + +Changes answers relative to baseline: No bit-for-bit + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None + +Pull Requests that document the changes (include PR ids): #797 +(https://github.com/ESCOMP/ctsm/pull) + + #797 -- Simple b4b fixes: new params file, remove override_nsrest/anoxia_wtsat, DV deprecated + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev060 +Originator(s): sacks (Bill Sacks) +Date: Thu Aug 29 11:18:20 MDT 2019 +One-line Summary: In SnowWater, truncate small h2osoi residuals + +Purpose of changes +------------------ + +Previously, in the handling of sublimation and evaporation from the snow +pack, if these fluxes led to negative h2osoi_ice or h2osoi_liq, these +negative values would be passed down the snow pack until they found a +layer with a large enough positive state to absorb them. This logic was +going to be a challenge for adding water tracers. + +I have done some tests to verify that these negative values never exceed +roundoff-level in either an absolute or relative sense (with tolerance +of 1.e-13). Specifically, I ran the full aux_clm test suite with the +diffs below and verified that the endrun calls were never triggered. + +So here, I simplify this logic: After truncating any near-zero states to +exactly zero, I check to confirm that the states are never negative. I +then removed the code that passed these negative values down the snow +pack: if they are only roundoff-level negative, then it seems safe to +just throw them away rather than trying to handle them. + +Here were the diffs used to verify that the negative values are never +greater than roundoff-level; these endrun calls were never triggered in +a run of the full aux_clm test suite: + + diff --git a/src/biogeophys/SnowHydrologyMod.F90 b/src/biogeophys/SnowHydrologyMod.F90 + index 3dd555cc..07776123 100644 + --- a/src/biogeophys/SnowHydrologyMod.F90 + +++ b/src/biogeophys/SnowHydrologyMod.F90 + @@ -970,6 +970,8 @@ subroutine SnowWater(bounds, & + real(r8) :: vol_ice(bounds%begc:bounds%endc,-nlevsno+1:0) ! partial volume of ice lens in layer + real(r8) :: eff_porosity(bounds%begc:bounds%endc,-nlevsno+1:0) ! effective porosity = porosity - vol_ice + real(r8) :: mss_liqice(bounds%begc:bounds%endc,-nlevsno+1:0) ! mass of liquid+ice in a layer + + real(r8) :: h2osoi_ice_orig + + real(r8) :: h2osoi_liq_orig + !----------------------------------------------------------------------- + + associate( & + @@ -1017,10 +1019,23 @@ subroutine SnowWater(bounds, & + c = filter_snowc(fc) + l=col%landunit(c) + + + h2osoi_ice_orig = h2osoi_ice(c,snl(c)+1) + + h2osoi_liq_orig = h2osoi_liq(c,snl(c)+1) + + + wgdif = h2osoi_ice(c,snl(c)+1) & + + frac_sno_eff(c) * (qflx_dew_snow(c) - qflx_sub_snow(c)) * dtime + h2osoi_ice(c,snl(c)+1) = wgdif + if (wgdif < 0._r8) then + + if (wgdif < -1.e-13_r8) then + + write(iulog,*) 'WJS: big abs wgdif ice: ', c, wgdif, h2osoi_ice_orig + + call endrun('WJS: big abs wgdif ice') + + end if + + if (h2osoi_ice_orig > 0._r8) then + + if (abs(wgdif / h2osoi_ice_orig) > 1.e-13_r8) then + + write(iulog,*) 'WJS: big rel wgdif ice: ', c, wgdif, h2osoi_ice_orig + + call endrun('WJS: big rel wgdif ice') + + end if + + end if + h2osoi_ice(c,snl(c)+1) = 0._r8 + h2osoi_liq(c,snl(c)+1) = h2osoi_liq(c,snl(c)+1) + wgdif + end if + @@ -1030,6 +1045,16 @@ subroutine SnowWater(bounds, & + + ! if negative, reduce deeper layer's liquid water content sequentially + if(h2osoi_liq(c,snl(c)+1) < 0._r8) then + + if (h2osoi_liq(c,snl(c)+1) < -1.e-13_r8) then + + write(iulog,*) 'WJS: big abs wgdif liq: ', c, h2osoi_liq(c,snl(c)+1), h2osoi_liq_orig + + call endrun('WJS: big abs wgdif liq') + + end if + + if (h2osoi_liq_orig > 0._r8) then + + if (abs(h2osoi_liq(c,snl(c)+1) / h2osoi_liq_orig) > 1.e-13_r8) then + + write(iulog,*) 'WJS: big rel wgdif liq: ', c, h2osoi_liq(c,snl(c)+1), h2osoi_liq_orig + + call endrun('WJS: big rel wgdif liq') + + end if + + end if + do j = snl(c)+1, 1 + wgdif=h2osoi_liq(c,j) + if (wgdif >= 0._r8) exit + +Bugs fixed or introduced +------------------------ + +None + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): +- It's possible that the extra error checks I have added (to ensure we + don't have greater-than-roundoff-level negative residuals) will be + triggered in rare circumstances in a production run, even though they + were never triggered in the test suite. + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none +Although there was a very small increase in total lnd run time, the +timing of hydro_without_drainage actually decreased slightly in the PFS +test relative to the last tag. + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): +- It's possible that the extra error checks I have added (to ensure we + don't have greater-than-roundoff-level negative residuals) will be + triggered in rare circumstances in a production run, even though they + were never triggered in the test suite. + +Changes to tests or testing: none + +Code reviewed by: self + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- ok + hobart ------ ok + + ok means tests passed, some answer changes as expected + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: YES (roundoff) + + Summarize any changes to answers, i.e., + - what code configurations: potentially all, though only show up in + a few tests + - what platforms/compilers: potentially all, though only show up in + a few tests + - nature of change (roundoff; larger than roundoff/same climate; new climate): roundoff + + If bitwise differences were observed, how did you show they were no worse + than roundoff? + + First, I did some preliminary analyses as documented above, to + ensure that any negative residuals were no greater than roundoff. + + Second, note that the use of truncate_small_values can only + introduce roundoff-level changes (by truncating values that are + roundoff-level different from zero to exactly zero). + + Third, only a few tests showed answer changes, and these were only + in limited fields, and were fairly small RMS differences: + + ERP_Ly3_P72x2.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-cropMonthOutput + ERS_Ly3.f10_f10_musgs.I1850Clm50BgcCropCmip6.cheyenne_intel.clm-basic + ERS_Ly3_P72x2.f10_f10_musgs.IHistClm50BgcCropG.cheyenne_intel.clm-cropMonthOutput + ERS_Ly5_P144x1.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-cropMonthOutput + + I actually expected more tests to show differences, but most tests + were bit-for-bit. I'm guessing this is because the code added a + roundoff-level term to a larger term, and this ended up not + changing the larger term. + + Finally, as an extra precaution, I ran the test suite twice, on + two different implementations of the truncation: the final one + (which uses truncate_small_values), and one in which I did the + truncation using custom, inline code (commit 0d21ccb5). These two + were bit-for-bit with each other, giving me more confidence that I + didn't make a mistake with either implementation. + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): none + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev059 +Originator(s): sacks (Bill Sacks) +Date: Sat Aug 24 15:14:06 MDT 2019 +One-line Summary: Continue adding water tracers to LakeHydrology + +Purpose of changes +------------------ + +Finish implementing water tracers for initial snow-related code in +LakeHydrology. This involved refactoring code in order to reuse existing +code in SnowHydrology rather than having near-duplicates of that code in +LakeHydrology. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/ctsm#775 (Implement water tracers for initial + snow-related code in LakeHydrology) + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none +Many tests took longer, including the PFS test. However, by looking at +more detailed timing numbers in the PFS test, the main increases in time +were in initialization and atm run: lnd run only showed a very small +increase. This suggests that glade slowness was probably primarily +responsible for the increased time. + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: Increased allowed wallclock time for a few tests +These tests took longer, likely due to machine variability. Increasing +their wallclock time to prevent them from timing out. + +Code reviewed by: self + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- pass + hobart ------ pass + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: NO + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): none + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev058 +Originator(s): slevis (Samuel Levis,SLevis Consulting LLC,303-665-1310) +Date: Thu Aug 22 10:02:49 MDT 2019 +One-line Summary: Soil texture interpolation bug-fix + +Purpose of changes +------------------ + + When assigning soil texture values from dataset soil levels to model + soil levels, we should be comparing zsoi (NOT zisoi) in the model with + zisoi on the file, i.e. we should be asking whether the node + center (NOT interface) of a given model level falls between two + interface depths on the file. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): #772 + + +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_0 + +[X] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: + Unexpected failure of test + SMS_D_Ld10.f10_f10_musgs.I2000Clm50BgcCropGs.hobart_nag.clm-tracer_consistency + Bill Sacks did some follow-up testing and concluded that this may be a + compiler-specific issue, so he changed the test from "nag" to "intel" + and generated the new test's corresponding baseline + +Code reviewed by: @billsacks + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - + + tools-tests (test/tools): + + cheyenne - + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - + + regular tests (aux_clm): + + cheyenne ---- OK + hobart ------ OK + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes (clm5) small + + Summarize any changes to answers, i.e., + - what code configurations: not clm45 (clm5_0 and ctsm5_0-nwp) + - what platforms/compilers: all + - nature of change: larger than roundoff/same climate + based on the assumption that shifting soil texture assignments by + one level in model soil levels below the top-most level should not + generate climate-changing differences. + +Detailed list of changes +------------------------ + 1. Changed zisoi to zsoi as described in the Purpose section above. + This caused the larger than roundoff changes. Before the fix some + model soil levels were getting assigned soil textures from a deeper + soil level in the dataset than they should. + 2. In the same section of code I completed the if-block to address all + zsoi vs. zisoifl comparisons. This ensures explicit assignment of + soil textures for all model soil levels and avoids leaving some + model soil levels with the texture assignment of the previous model + soil level. + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull/788) + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev057 +Originator(s): sacks (Bill Sacks) +Date: Tue Aug 20 13:17:39 MDT 2019 +One-line Summary: Fix frac_sno bugs + +Purpose of changes +------------------ + +Two bug fixes related to frac_sno, and a third change involving +replacing a frac_sno calculation with a simpler equation that is +algebraically equivalent: + +(1) Fix lake frac_sno always being 0 + (https://github.com/ESCOMP/ctsm/issues/783). This fixes the albedo + calculation (and possibly others) over snow-covered lake surfaces. + +(2) Fix threshold for explicit snow pack initiation to use frac_sno_eff, + not frac_sno (https://github.com/ESCOMP/ctsm/issues/785). For + standard runs (which have use_subgrid_fluxes = .true.), this just + changes answers for urban columns. This also changes answers more + widely for runs with use_subgrid_fluxes = .false. + +(3) Rewrite Swenson & Lawrence 2012 frac_sno equation to be more + straightforward and less sensitive to roundoff errors + (https://github.com/ESCOMP/ctsm/issues/784) + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/ctsm#783 (frac_sno is always 0 for lake points) +- Resolves ESCOMP/ctsm#785 (Threshold for explicit snow pack initiation + should use frac_sno_eff, not frac_sno) +- Resolves ESCOMP/ctsm#784 (Suggested algebraic rework of frac_sno + calculation) + +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_0 + +[X] ctsm5_0-nwp + +[X] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: self + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- ok + hobart ------ ok + + ok means tests pass, answers change as expected + + Ran most testing on 95dad328 (before 8f1263a7, which removes a + temporary endrun error check). Just reran + SMS_Ld5_D_P48x1.f10_f10_musgs.IHistClm50Bgc.hobart_nag.clm-decStart + on the final version. + + There was a memleak for this test: + + FAIL SMS_D_Ld10.f10_f10_musgs.I2000Clm50BgcCropGs.hobart_nag.clm-tracer_consistency MEMLEAK memleak detected, memory went from 1250.830000 to 1518.500000 in 8 days + + I have had memleak issues for this test before + (https://github.com/ESCOMP/ctsm/issues/763), which I have chalked up + to a compiler-specific issue. I have simply increased the tolerance + for memleaks for this test moving forward. + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: YES (small) + + Summarize any changes to answers, i.e., + - what code configurations: all + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + Larger than roundoff; expected to be same climate in general, + because the only impacts are on urban and lake points, which + represent a small fraction of most grid cells. However, this needs + further investigation. + + See above (under "Purpose of changes") for a description of the + different answer changes in this tag. + + If bitwise differences were observed, how did you show they were no worse + than roundoff? + + I verified that change (3) is no greater than roundoff by + temporarily putting in an endrun if the new frac_sno differs from + the old by more than 1e-13; this was not triggered for any test in + the aux_clm test suite. + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): none + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev056 +Originator(s): sacks (Bill Sacks) +Date: Fri Aug 16 11:44:43 MDT 2019 +One-line Summary: Start adding water tracers to LakeHydrology, and related refactoring + +Purpose of changes +------------------ + +Start adding water tracers to LakeHydrology, beginning with some initial +things done for snow. + +This also includes some significant refactoring to allow LakeHydrology +to reuse some of the same snow code used for non-lake columns. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Partially addresses ESCOMP/ctsm#775 (Implement water tracers for + initial snow-related code in LakeHydrology) + +Known bugs found since the previous tag (include github issue ID): +The following will be fixed in an upcoming tag: +- ESCOMP/ctsm#783 (frac_sno is always 0 for lake points) +- ESCOMP/ctsm#784 (Suggested algebraic rework of frac_sno calculation) +- ESCOMP/ctsm#785 (Threshold for explicit snow pack initiation should + use frac_sno_eff, not frac_sno) + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: self + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- ok + hobart ------ ok + + ok means tests pass, answers change as expected + + Note: Did most testing on 054dc95b (before the small change in + 7e4e52a9); just ran + LWISO_Ld10.f10_f10_musgs.I2000Clm50BgcCropGs.cheyenne_gnu.clm-coldStart + on the final commit + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: YES (small) + + Summarize any changes to answers, i.e., + - what code configurations: all + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): roundoff + + There are two answer-changes here: + + (1) Roundoff-level changes due to changing some order of operations + for the updating of snow_depth and dz for lakes: The previous + code effectively used (qflx_snow_grnd(c)/bifall(c))*dtime, + whereas the new code uses (qflx_snow_grnd(c)*dtime)/bifall(c); + similarly, the dz update differs. + + (2) A change in FSNO_EFF for lakes: previously, this was set to 0 + when there was no snow. Now this is set consistently with other + landunits, for which it is 1 even if there is no snow. Note that + this only affects the FSNO_EFF diagnostic field, and nothing + else. + + If bitwise differences were observed, how did you show they were no worse + than roundoff? + + I confirmed that the order-of-operations change is the only + answer-changing part of this tag by comparing against a one-off + from master with the following diffs; this comparison was + bit-for-bit except for changes in the FSNO_EFF diagnostic field: + + diff --git a/src/biogeophys/LakeHydrologyMod.F90 b/src/biogeophys/LakeHydrologyMod.F90 + index 91ddfc79..9711dad7 100644 + --- a/src/biogeophys/LakeHydrologyMod.F90 + +++ b/src/biogeophys/LakeHydrologyMod.F90 + @@ -126,6 +126,8 @@ subroutine LakeHydrology(bounds, & + real(r8) :: heatsum(bounds%begc:bounds%endc) ! used in case above [J/m^2] + real(r8) :: snowmass ! liquid+ice snow mass in a layer [kg/m2] + real(r8) :: snowcap_scl_fct ! temporary factor used to correct for snow capping + + real(r8) :: temp_snow_depth + + real(r8) :: newsnow + real(r8), parameter :: snow_bd = 250._r8 ! assumed snow bulk density (for lakes w/out resolved snow layers) [kg/m^3] + ! Should only be used for frost below. + !----------------------------------------------------------------------- + @@ -246,8 +248,10 @@ subroutine LakeHydrology(bounds, & + ! U.S.Department of Agriculture Forest Service, Project F, + ! Progress Rep. 1, Alta Avalanche Study Center:Snow Layer Densification. + + - dz_snowf = qflx_snow_grnd(c)/bifall(c) + - snow_depth(c) = snow_depth(c) + dz_snowf*dtime + + temp_snow_depth = snow_depth(c) + + newsnow = qflx_snow_grnd(c)*dtime + + snow_depth(c) = snow_depth(c) + newsnow/bifall(c) + + dz_snowf = (snow_depth(c) - temp_snow_depth)/dtime + if (snl(c) == 0) then + h2osno_no_layers(c) = h2osno_no_layers(c) + qflx_snow_grnd(c)*dtime ! snow water equivalent (mm) + else + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): none + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev055 +Originator(s): sacks (Bill Sacks) +Date: Tue Aug 6 14:06:50 MDT 2019 +One-line Summary: Modularize snow cover fraction method + +Purpose of changes +------------------ + +This tag moves the calculation of frac_sno - and the related updates of +snow_depth - into a new set of classes, with one class for each +parameterization (Niu & Yang 2007 and Swenson & Lawrence 2012). + +Previously, the code always calculated frac_sno the new way, but then +possibly overwrote it if using the older Niu & Yang method. The new code +cleans this up, only doing the calculations that are needed for each +method. + +In addition, other code that is specific to one of the two methods is +now moved to a home that makes this dependence on method explicit. This +includes the addition of newsnow to int_snow: previously, int_snow was +always updated using an equation specific to the newer CLM5 +parameterization of frac_sno, which was not appropriate if using the Niu +& Yang parameterization; this doesn't make a difference currently, since +int_snow is only referenced if using the Swenson & Lawrence +parameterization, but this clears up some confusion. Also, time-constant +parameters read from namelist or the netCDF parameter file now reside in +the appropriate class rather than being more global. + +This tag also renames two namelist options to increase clarity: +- subgridflag is renamed to use_subgrid_fluxes, and is now a logical +- oldfflag is renamed to snow_cover_fraction_method, and is now a string + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/ctsm#502 (oldfflag can NOT be used with + subgridflag==1, and rename subgridflag) +- Resolves ESCOMP/ctsm#503 (Clean up CanopyHydrology) + - This tag does the last piece of cleanup called for in that issue +- Resolves ESCOMP/ctsm#571 (Add a system test: turning on water isotopes + shouldn't change answers) + - This is unrelated to the other changes in this tag + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): +This tag renames two namelist options to increase clarity: +- subgridflag is renamed to use_subgrid_fluxes, and is now a logical +- oldfflag is renamed to snow_cover_fraction_method, and is now a string + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: +- Added a LWISO test, which confirms that turning on water isotopes + doesn't change answers for bulk +- Added a test with the newer snow cover fraction method but + use_subgrid_fluxes false (testmod no_subgrid_fluxes) + +Code reviewed by: Sean Swenson, Erik Kluzek + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - ok + + Tests pass; baseline comparisons not done (baseline comparisons + expected to differ) + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- pass + hobart ------ pass + + Additional tests: Compared both of these against ctsm1.0.dev052 (which + should be bit-for-bit with ctsm1.0.dev054): Both were bit-for-bit: + + ERP_D_P36x2_Ld3.f10_f10_musgs.I2000Clm45BgcCrop.cheyenne_gnu.clm-no_subgrid_fluxes + This is a new test, so did not have baselines; I created baselines + from ctsm1.0.dev052 and compared against those + SMS_Ly3.f10_f10_musgs.I2000Clm45BgcCrop.cheyenne_intel.clm-oldhyd_monthly + This was a temporary test for the sake of running a longer test with + the oldhyd testmod. This testmod was created as a one-off by + changing the current oldhyd testmod to inherit from monthly rather + than default. I ran baselines like this from ctsm1.0.dev052 then ran + this test from this branch and compared against those baselines. + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: NO + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/ctsm/pull/769 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev054 +Originator(s): sacks (Bill Sacks) +Date: Fri Aug 2 07:57:51 MDT 2019 +One-line Summary: Fix interpolation of surfdat soil layers so we can use interpolation for 10SL case + +Purpose of changes +------------------ + +Previously, on master, there was special-purpose code for the 10SL case +that avoided doing interpolation from the surface dataset to the soil +variables in the model. It would be cleaner - especially now that we +allow user-defined soil layer structures - if we could use the general +interpolation code always, rather than sometimes having special-purpose +code that avoids doing the interpolation. + +This tag accomplishes that generality. In order to preserve answers for +clm45 cases, I needed to make three changes: + +1. The constant 0.025 needed an _r8 appended to it; otherwise, zisoifl + could differ by roundoff from zisoi. + +2. I changed which level is used when zisoi(lev) is exactly equal to + zisoifl(j) for some j: I changed the conditional in the following: + + if (zisoi(lev) >= zisoifl(j) .AND. zisoi(lev) < zisoifl(j+1)) then + clay = clay3d(g,j+1) + sand = sand3d(g,j+1) + om_frac = organic3d(g,j+1)/organic_max + endif + + to: + + if (zisoi(lev) > zisoifl(j) .AND. zisoi(lev) <= zisoifl(j+1)) then + + Previously, when the zisoi values in the model exactly lined up with + the zisoi values in the file, we would set clay in model level j + equal to the value from level j+1 from the surface dataset (and + similarly for sand and om_frac); in the new code, we use level j from + the surface dataset for model level j in this case. + +3. I changed the way zisoifl is calculated for the lowest layer, so that + it matches zisoi(nlevsoi) when running with 10SL_3.5m. Previously, we + had: + + zisoi(10) = 0.38018819123227207690E+01 + zisoifl(10) = 0.34330930154359391437E+01 + + This tag changes zisoifl(10) to match zisoi(10). + +Bugs fixed or introduced +------------------------ + +Known bugs found since the previous tag (include github issue ID): +- #772: Interpolation of clay, sand and om_frac can use the wrong layer + (points out more fundamental issues with this interpolation of layers + from the surface dataset) + + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: Sam Levis + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- pass + hobart ------ pass + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: NO (but see note below) + + In principle, the changes in this tag could change answers for some + soil layer structures, but there were no answer changes for any of + the cases covered by the test suite. + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/ctsm/pull/771 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev053 +Originator(s): slevis (Samuel Levis,SLevis Consulting LLC,303-665-1310) +Date: Thu Aug 1 16:56:09 MDT 2019 +One-line Summary: Soil layer definition clean-up and user-defined option + +Purpose of changes +------------------ + + Code clean-up clarifes that there are two types of soil layer + definition: the node-based and the thickness-based. + + User-defined option allows user to specify a soil layer profile in the + form of a dzsoi vector (values in meters) in the thickness-based + approach. + + Default nlevsoi for NWP configurations had to change from 5 to 4 for + consistency with the new error check described in known bugs below. + + Other code clean-up removes a couple of sections of repeating code. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): #279 #728 + +Known bugs found since the previous tag (include github issue ID): + #759 (this PR) bug causes model to abort when nlevsoi = nlevgrnd; + bug has been corrected with an error check + + +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.] + +[ ] clm5_0 + +[X] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): + if neither soil_layerstruct_predefined nor soil_layerstruct_userdefined + get specified in the namelist, then the model sets + soil_layerstruct_predefined to the old default setting for + soil_layerstruct (clm5: 20SL_8.5m, clm4.5: 10SL_3.5m) + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): + renamed soil_layerstruct to soil_layerstruct_predefined and added + soil_layerstruct_userdefined + +Changes made to namelist defaults (e.g., changed parameter values): + Default nlevsoi for NWP configurations had to change from 5 to 4 for + consistency with the new error check described in known bugs below + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +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 + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: + 1) New test... + ERP_P36x2_D_Ld5.f10_f10_musgs.I2000Ctsm50NwpBgcCropGswpGs.cheyenne_intel.clm-default + replaces existing test + ERS_D_Ld10.f10_f10_musgs.I2000Clm50BgcCropGs.cheyenne_intel.clm-rm_indiv_lunits_and_collapse_to_dom + to check the correction described in known bugs above; the new test + together with existing unit tests cover what the old test was testing + + 2) New test and new test type... + SOILSTRUCTUD_Ld5.f10_f10_musgs.I2000Clm50BgcCropGs.cheyenne_intel.clm-default + ensures that soil_layerstruct_userdefined gives bfb same answers as + soil_layerstruct_predefined = '4SL_2m' when set with the same dzsoi + values. The new test type was put together by: + - listing the test in (1) testlist_clm.xml (as all tests) and (2) config_tests.xml + - creating the file .../cime_config/SystemTests/soilstructud.py named after the test in lower case + +Code reviewed by: @billsacks + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - + + tools-tests (test/tools): + + cheyenne - + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - + + regular tests (aux_clm): + + cheyenne ---- OK + hobart ------ OK + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: YES (just for NWP configurations) + + Summarize any changes to answers, i.e., + - what code configurations: nwp + - what platforms/compilers: all + - nature of change: larger than roundoff/same climate + This is due to the change of nlevsoi from 5 to 4 (more info above). + I confirmed that nwp does return bfb same answers when I revert this + change. + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): + https://github.com/ESCOMP/ctsm/pull/759 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev052 +Originator(s): sacks (Bill Sacks) +Date: Mon Jul 22 14:02:43 MDT 2019 +One-line Summary: Fix rare soil color bug in mksurfdata_map + +Purpose of changes +------------------ + +Under rare conditions, mksurfdata_map could put the default soil color +in an output cell where there is actually more information. This tag +fixes that issue. None of the out-of-the-box surface datasets are +impacted by this bug, so I have not recreated any surface datasets. (I +checked all out-of-the-box surface datasets except for +surfdata_0.125x0.125_mp24_simyr2000_c150114.nc, because it doesn't get +remade cleanly out of the box.) + +Also: + +- Add some unit tests for the creation of soil color in mksurfdata_map + +- Point to correct (existing) surface dataset for year-1850 at f05 + resolution + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/ctsm#4 (Minor bug in creation of soil color in + mksurfdata_map: points can be given the default soil color, when they + should have a real color) +- Resolves ESCOMP/ctsm#765 (Year-1850 f05 surface dataset missing from + inputdata repository) + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): +- Year-1850 f05 surface dataset now points to a file that actually exists + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + +Changes to tests or testing: none + +Code reviewed by: self + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - ok + + Most tests pass, including baseline comparisons. The following tests fail, but also failed for me on master: + + 019 smiS4 TSMscript_tools.sh ncl_scripts getregional_datasets.pl getregional ....................\c + rc=6 FAIL + 020 bliS4 TBLscript_tools.sh ncl_scripts getregional_datasets.pl getregional ....................\c + rc=4 FAIL + 027 smf84 TSMscript_tools.sh PTCLM PTCLMmkdata PTCLM_USUMB_clm4_5^buildtools ....................\c + rc=6 FAIL + 028 blf84 TBLscript_tools.sh PTCLM PTCLMmkdata PTCLM_USUMB_clm4_5^buildtools ....................\c + rc=4 FAIL + 029 smfc4 TSMscript_tools.sh PTCLM PTCLMmkdata PTCLM_USUMB_Cycle_clm4_5^buildtools ..............\c + rc=6 FAIL + 030 blfc4 TBLscript_tools.sh PTCLM PTCLMmkdata PTCLM_USUMB_Cycle_clm4_5^buildtools ..............\c + rc=4 FAIL + 031 smfg4 TSMscript_tools.sh PTCLM PTCLMmkdata PTCLM_USUMB_Global_clm4_5^buildtools .............\c + rc=6 FAIL + 032 blfg4 TBLscript_tools.sh PTCLM PTCLMmkdata PTCLM_USUMB_Global_clm4_5^buildtools .............\c + rc=4 FAIL + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- not run + hobart ------ not run + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: NO + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): none + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev051 +Originator(s): sacks (Bill Sacks) +Date: Fri Jul 19 13:26:25 MDT 2019 +One-line Summary: Update water tracers for remainder of first stage of hydrology + +Purpose of changes +------------------ + +Main change is to do tracer updates for final pieces of first stage of +hydrology: HandleNewSnow and UpdateFracH2oSfc. Along with this, I have +introduced greater modularity into these routines (breaking the +operations down into more granular steps). + +Other changes included here (somewhat related to the main changes) are: + +- Added a routine that resets checked tracers to bulk*ratio to allow + running the tracer consistency check for more than one time step; we + now run it for 10 days + +- Change logic for rain-snow conversion terms: Use rain diff in rain to + snow, snow diff in snow to rain. This is less sensitive to roundoff + errors, and was needed in order to get the 10-day tracer consistency + test to pass. + +- Setting of qflx_snow_h2osfc moved to CanopyInterceptionAndThroughfall + +- Add col%lun_itype. col%lun_itype(ci) is the same as + lun%itype(col%landunit(ci)), but is often a more convenient way to + access this type. I got tired of having to get the landunit index just + for the sake of getting the landunit's type of a given column. I have + NOT gone through the code and replaced lun%itype(l) with + col%lun_itype(c) where applicable, but this will be useful for the + future. + +- Removed unnecessary code for backwards compatibility of FH2OSFC from + restart files + +- Point to slightly modified initial conditions files for two CLm45 + initial conditions files. These two had FH2OSFC > 0 for some glc_mec + points. I'm not sure how that came to be, but Sean Swenson and I think + that shouldn't be the case. This caused soil balance errors in these + tests: + + ERS_Ly5_P72x1.f10_f10_musgs.IHistClm45BgcCrop.cheyenne_intel.clm-cropMonthOutput + SMS_D_Ld1.f09_g17.I1850Clm45BgcCruGs.cheyenne_intel.clm-default + + I'm fixing the problem by pointing to updated files with FH2OSFC set + to 0 for special landunits, using the following python: + + ctypel = dat.variables['cols1d_ityplun'][:] + dat.variables['FH2OSFC'][ctypel > 2] = 0 + +- Small cime update to fix the SHAREDLIBBUILD phase of + ERS_D_Ln9_P480x3.f19_g16.I2000Clm50SpGs.cheyenne_intel.clm-waccmx_offline + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/ctsm#718 (Implement water tracers for HandleNewSnow + and FracH2oSfc) +- Resolves ESCOMP/ctsm#498 (Do tracer consistency checks every time + step, not just first) + +CIME Issues fixed (include issue #): +- ESCMI/cime#3717 (Cheyenne ESMF missing for WACCM X) + +Known bugs introduced in this tag (include github issue ID): +- ESCOMP/ctsm#762 (Water tracers: Make sure calls to ResetCheckedTracers + are removed) + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): +- If you have an initial conditions file with non-zero FH2OSFC for + glacier (this was the case for some out-of-the-box clm45 files, which + are now fixed), may run into soil balance errors. To fix this, set + FH2OSFC to 0 in your restart file for all special landunits. + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): +- Point to slightly modified initial conditions files for two CLm45 + initial conditions files: see above for details. + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: +- Changed tracer consistency test to 10 days rather than a single time step + +Code reviewed by: self + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- ok + hobart ------ ok + + ok means tests pass, some roundoff-level diffs in baseline + comparisons, as noted below + + Also, in order to have a more powerful test of the changes in + SurfaceWaterMod (since the relevant code isn't triggered very often), + I introduced the following diffs: + + diff --git a/src/biogeophys/SurfaceWaterMod.F90 b/src/biogeophys/SurfaceWaterMod.F90 + index 1bc03cae..be656a15 100644 + --- a/src/biogeophys/SurfaceWaterMod.F90 + +++ b/src/biogeophys/SurfaceWaterMod.F90 + @@ -12,6 +12,7 @@ module SurfaceWaterMod + use shr_spfn_mod , only : erf => shr_spfn_erf + use clm_varcon , only : denh2o, denice, roverg, wimp, tfrz, pc, mu, rpi + use clm_varpar , only : nlevsno, nlevgrnd + + use clm_varctl , only : iulog + use clm_time_manager , only : get_step_size + use column_varcon , only : icol_roof, icol_road_imperv, icol_sunwall, icol_shadewall, icol_road_perv + use decompMod , only : bounds_type + @@ -201,7 +202,7 @@ subroutine BulkDiag_FracH2oSfc(bounds, num_soilc, filter_soilc, & + SHR_ASSERT_FL((ubound(qflx_too_small_h2osfc_to_soil, 1) == bounds%endc), sourcefile, __LINE__) + + ! arbitrary lower limit on h2osfc for safer numerics... + - min_h2osfc=1.e-8_r8 + + min_h2osfc=1.e0_r8 + + do f = 1, num_soilc + c = filter_soilc(f) + @@ -230,6 +231,9 @@ subroutine BulkDiag_FracH2oSfc(bounds, num_soilc, filter_soilc, & + + else + frac_h2osfc(c) = 0._r8 + + if (h2osfc(c) > 0._r8) then + + write(iulog,*) 'WJS: in else' + + end if + qflx_too_small_h2osfc_to_soil(c) = h2osfc(c) / dtime + ! The update of h2osfc is deferred to later, keeping with our standard + ! separation of flux calculations from state updates, and because the state + + With those diffs, I ran the tracer consistency test; it passed. In + addition, I ran + SMS_D_Ld1_P4x1.f10_f10_musgs.I2000Clm50BgcCropQianRsGs.bishorn_gnu.clm-default + with comparison against master, with the following diffs on master + (the first change changes behavior to force the relevant code to be + triggered, and is the same on master and on the branch; the second + change on master divides then multiplies by dtime to avoid + roundoff-level diffs): + + diff --git a/src/biogeophys/SurfaceWaterMod.F90 b/src/biogeophys/SurfaceWaterMod.F90 + index 959d539b..4a4a4824 100644 + --- a/src/biogeophys/SurfaceWaterMod.F90 + +++ b/src/biogeophys/SurfaceWaterMod.F90 + @@ -77,7 +77,7 @@ subroutine FracH2oSfc(bounds, num_nolakec, filter_nolakec, & + ) + + ! arbitrary lower limit on h2osfc for safer numerics... + - min_h2osfc=1.e-8_r8 + + min_h2osfc=1.e0_r8 + + call waterstatebulk_inst%CalculateTotalH2osno(bounds, num_nolakec, filter_nolakec, & + caller = 'FracH2oSfc', & + @@ -112,7 +112,7 @@ subroutine FracH2oSfc(bounds, num_nolakec, filter_nolakec, & + + else + frac_h2osfc(c) = 0._r8 + - h2osoi_liq(c,1) = h2osoi_liq(c,1) + h2osfc(c) + + h2osoi_liq(c,1) = h2osoi_liq(c,1) + (h2osfc(c) / get_step_size()) * get_step_size() + h2osfc(c)=0._r8 + endif + + This test passed and was bit-for-bit with master with the above changes. + + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes (roundoff level) + + Summarize any changes to answers, i.e., + - what code configurations: Many/all + - what platforms/compilers: All + - nature of change (roundoff; larger than roundoff/same climate; new climate): + Roundoff: just roundoff-level changes in FSH_PRECIP_CONVERSION, + FSH_TO_COUPLER, l2x_Fall_sen due to refactored calculation of + FSH_PRECIP_CONVERSION + + If bitwise differences were observed, how did you show they were no worse + than roundoff? via summarize_cprnc_diffs + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): +- cime: branch_tags/cime5.8.3_chint17-03 -> branch_tags/cime5.8.3_chint17-04 + Fixes ESMCI/cime#3171 + +Pull Requests that document the changes (include PR ids): none + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev050 +Originator(s): slevis (Samuel Levis,SLevisConsulting LLC,303-665-1310) +Date: Mon Jul 15 11:40:09 MDT 2019 +One-line Summary: dz --> dz_lake bug-fix in LakeTemperatureMod.F90 line 960 + +Purpose of changes +------------------ + + Bug-fix to prevent the model from aborting when running with fewer soil + layers than lake layers; not to imply that this was not a bug when the + model wasn't aborting. It was. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): #760 + +Known bugs found since the previous tag (include github issue ID): #759 bug causing model to abort when nlevsoi = nlevgrnd + + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +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 + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: @dlawrenncar @billsacks + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - + + tools-tests (test/tools): + + cheyenne - + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - + + regular tests (aux_clm): + + cheyenne ---- OK + hobart ------ OK + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes (when methane on) (diagnostic only) + + Summarize any changes to answers, i.e., + - what code configurations: use_lch4 = .true. + - what platforms/compilers: all + - nature of change: diagnostic variable WTGQ only + Confirmed this on cheynne and hobart by running + ./summarize_cprnc_diffs -baseline .../tests_0712... -testid '*' + and inspecting the file cprnc.summary.*.by_varname + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): + https://github.com/ESCOMP/ctsm/pull/761 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev049 +Originator(s): erik (Erik Kluzek) +Date: Sun Jun 23 20:56:55 MDT 2019 +One-line Summary: Update mosart and intel to intel-19 on cheyenne + +Purpose of changes +------------------ + +Update mosart to trunk tag (that has a roundoff change to history file +output). And update intel compiler on cheyenne to intel-19. + +Bugs fixed or introduced None +------------------------ + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): None + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): None + +Substantial timing or memory changes: [For timing changes, can check PFS test(s) in the test suite] None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): None + +Changes to tests or testing: None + +Code reviewed by: self + +CTSM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + regular tests (aux_clm): + + cheyenne ---- OK + hobart ------ OK + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes (roundoff level change when MOSART on) + + Summarize any changes to answers, i.e., + - what code configurations: some compsets with mosart + - what platforms/compilers: cheyenne/intel + - nature of change: roundoff + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cime, and mosart + mosart to mosart1_0_33 + cime to branch_tags/cime5.8.3_chint17-03 + +Pull Requests that document the changes (include PR ids): #753 +(https://github.com/ESCOMP/ctsm/pull) + #753 -- Update cheyenne to intel/19 and update mosart + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev048 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Sun Jun 23 15:16:01 MDT 2019 +One-line Summary: Updates for buildlib changes and cime and externals updates + +Purpose of changes +------------------ + +Update of most externals: cime, mosart, rtm, cism. The cime update also includes a required CESM-wide +change in buildlib. Uses a function to get the Macros filename "get_standard_makefile_args". +The cime update brought in some answer chagnes, with an update of the intel compiler (but we backed those +out by using a cime branch). There is also a roundoff change by going to the trunk version of RTM. + +Bugs fixed or introduced None +------------------------ + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): None + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): None + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): None + +Changes to tests or testing: None + +Code reviewed by: @jedwards, self + + +CTSM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + tools-tests (test/tools): + + cheyenne - PASS + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - PASS + + python testing (see instructions in python/README.md; document testing done): + + cheyenne - PASS (for python3) + + regular tests (aux_clm): + + cheyenne ---- OK + hobart ------ OK + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes, but only for a few cases (compsets with RTM) + + Summarize any changes to answers, i.e., + - what code configurations: With RTM + - what platforms/compilers: All + - nature of change: roundoff + fieldlist is different for CISM in some cases + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cime, mosart, rtm, cism + cime to branch_tags/cime5.8.3_chint17-02 + cism to cism2_0_68 + rtm to rtm1_0_68 + mosart to nldas-grid.n02_mosart1_0_31 + +Pull Requests that document the changes (include PR ids): #752 +(https://github.com/ESCOMP/ctsm/pull) + + #752 -- buildlib, cime and externals update + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev047 +Originator(s): sacks (Bill Sacks) +Date: Sun Jun 16 13:04:38 MDT 2019 +One-line Summary: Fix negative snow compaction during snow melt + +Purpose of changes +------------------ + +Fix an issue reported by @kjetilaas: In the presence of surface water, +the old and new snow cover fractions are inconsistently calculated in +subroutine "SnowCompaction". This can result in significant negative +compaction (snow depth increase) during snow melt. + +More details from @kjetilaas (copied from +https://github.com/escomp/ctsm/issues/573): + +There is an inconsistency in the calculation of snow cover fraction +(FSNO) in the SnowCompaction subroutine when there is surface water +present. The actual snow cover is limited to 0.99 when surface water is +present (and the surface water fraction is set to 0.01). However, +SnowCompaction recalculates the old FSNO without accounting for this +limitation. This results in an apparent decrease in FSNO, and +corresponding negative snow compaction from snow melt (ddz3). + +This can result in substantial, artificial increase in snow depth during +summer (can be more than 0.5 m during a single season). + +The problem might be masked in monthly output, but could be significant +whenever snow cover is close to 1 and surface water present. Snow mass +is indirectly affected by this as radiation and temperature fluxes in +the snow pack will be affected by artificially thick snow layers. + +This tag fixes this issue. The fix was implemented and tested by +@swensosc (Sean Swenson). + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/ctsm#573 (Snow depth increase due to inconsistent snow + cover fraction calculation) + + +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_0 + +[X] ctsm5_0-nwp + +[X] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: Sean Swenson, @kjetilaas, Bill Sacks + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- ok + hobart ------ ok + + ok means tests pass, answers change as expected + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: YES (similar climate) + + Summarize any changes to answers, i.e., + - what code configurations: all + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + Larger than roundoff/same climate + + Sean Swenson ran the LMWG diagnostics package and looked at the + results with Keith Oleson. Their main findings were: + + - Snow depth is a bit smaller over Greenland and polar regions on + average, as expected (up to 5-10% decrease in average snow depth + averaged over the Canadian Arctic) + + - There is a small increase in h2osno over Greenland: about 30 mm + averaged over Greenland; it looks like the main changes are + around the coasts (which makes sense given that this bug only + affects vegetated landunits) + + - There are small changes in runoff over Greenland + + - Changes in snow cover fraction are tiny + + - Overall, this doesn't look climate changing, but could + potentially have a significant impact on select grid cells, and + on some variables in polar regions + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): none + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev046 +Originator(s): sacks (Bill Sacks) +Date: Sat Jun 15 15:54:44 MDT 2019 +One-line Summary: Separate the two uses of h2osno + +Purpose of changes +------------------ + +Until now, h2osno has been used in two ways: + +1. When there are explicit snow layers, h2osno is the sum of snow + (liquid + ice) in all layers + +2. When there is a little bit of snow, but not enough to create a snow + layer, h2osno gives the amount of this very thin snow pack (assumed + to be all ice) + +This is confusing and complicates the addition of water tracers to the +code. This tag separates h2osno into two different variables: + +1. h2osno_no_layers is a fundamental state variable that gives the + amount of snow in the case where we don't have explicit snow layers + +2. h2osno_total is purely a diagnostic variable that is the sum of snow + in all explicit layers, plus h2osno_unresolved. This exists in + waterdiagnosticbulk_type, but the version there is just set once at + the end of the time step, so that version is only meant for + diagnostic (history) output. Code that needs the current sum of + h2osno at a given point now computes it locally, via a new method on + waterstate_type: CalculateTotalH2osno. If running in debug mode, that + routine also performs some consistency checks. + +Also, an unrelated change to prevent user from trying to interpolate a +file onto itself. + +Also, add a compset for testing, which is good for use on my mac. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/ctsm#733 (Make h2osno purely a diagnostic variable) +- Resolves ESCOMP/ctsm#749 (h2osno inconsistent when interpolating from + initial conditions with different snow layers) +- Resolves ESCOMP/ctsm#750 (Prevent user from trying to use the same + filename for init_interp source and destination files) + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none (possibly a small improvement +in timing based on PFS run time) + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: self + + +CTSM testing: + + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- ok + hobart ------ ok + + ok means tests pass; baseline comparisons fail as expected + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes (mostly roundoff) + + Summarize any changes to answers, i.e., + - what code configurations: all + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + Mostly roundoff; greater than roundoff/same climate for cases for + which number of snow layers is less in the case than in its + initial conditions file, due to fixing #749 + + If bitwise differences were observed, how did you show they were no worse + than roundoff? + + There was one point where h2osno_total differed from the old h2osno + by roundoff, as verified by a run of the test suite (where I verified + that (a) it only differed by 1e-11 or less, and (b) if I reset it, + there were just roundoff-level changes in a few diagnostic + fields). That one place with roundoff-level diffs can lead to + propagation of diffs, causing differences in many fields in the final + run of the test suite. In particular: I ran the test suite on + 69823de4 (which had this temporary check and reset of h2osno_total + vs. old h2osno). For nearly all tests, there were only roundoff-level + changes in a few diagnostic fields. I then removed the temporary + check and reset and ran the test suite on the result + (4353cc90). Finally, I ran the test suite on the final, cleaned-up + code, with comparison against 4353cc90 and verified bfb. + + In my testing on 69823de4: There were a few tests with greater than + roundoff-level changes due just to differences in the initial value + of h2osno_total (which was incorrect in the old due to #749). I + verified that these only had roundoff-level changes in a few + diagnostic fields if I used the following diffs in both the baseline + and my branch, indicating that the diffs just arose due to the fix of + #749: + + diff --git a/src/main/clm_initializeMod.F90 b/src/main/clm_initializeMod.F90 + index 793b36ac..f10ee5e1 100644 + --- a/src/main/clm_initializeMod.F90 + +++ b/src/main/clm_initializeMod.F90 + @@ -762,6 +762,18 @@ subroutine initialize2( ) + !$OMP END PARALLEL DO + end if + + do c = bounds_proc%begc, bounds_proc%endc + + if (col%snl(c) < 0) then + + water_inst%waterstatebulk_inst%h2osno_col(c) = 0._r8 + + do j = col%snl(c)+1, 0 + + water_inst%waterstatebulk_inst%h2osno_col(c) = & + + water_inst%waterstatebulk_inst%h2osno_col(c) + & + + water_inst%waterstatebulk_inst%h2osoi_ice_col(c,j) + & + + water_inst%waterstatebulk_inst%h2osoi_liq_col(c,j) + + end do + + end if + + end do + + + end subroutine initialize2 + end module clm_initializeMod + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): none + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev045 +Originator(s): sacks (Bill Sacks) +Date: Thu Jun 6 12:26:57 MDT 2019 +One-line Summary: Recalculate h2osno for the sake of SnowCapping + +Purpose of changes +------------------ + +SnowCapping decides whether to remove excess snow based on +h2osno. However, at the point where this is called,h2osno is out of sync +with (h2osoi_liq + h2osoi_ice): Those variables can be changed slightly +in SnowWater (which is called before SnowCapping), yet h2osno isn't +recalculated based on those changes. + +I don't think this causes a big problem in practice, but it seems like +it would improve code understandability if we had the general rule that +any code that references h2osno is using a version of h2osno that is in +sync with (h2osoi_liq + h2osoi_ice). This is also needed to prevent +answer changes in an upcoming major refactor. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/ctsm#736 + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: Sean Swenson signed off on the change, but didn't +review the final code + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- ok + hobart ------ ok + + ok means tests pass, answers change as expected + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: YES (should be small) + + Summarize any changes to answers, i.e., + - what code configurations: all + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + Larger than roundoff/same climate + + Answer changes are expected to be small, since this should just + change the timing of snow capping a bit, but I haven't looked + closely at the magnitude of the answer changes. + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): none + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev044 +Originator(s): sacks (Bill Sacks) +Date: Thu Jun 6 12:14:39 MDT 2019 +One-line Summary: Make wetland snow resetting behavior more explicit + +Purpose of changes +------------------ + +There is some code that zeroes out h2osno over thawed wetlands. It seems +like the intended behavior here is to zero out the entire snow +pack. Currently, however, this only zeros out a very thin (zero-layer) +snow pack. For now, I'm adding an snl==0 conditional to make this +behavior explicit; long-term, we'd like to change this to actually zero +out the whole snow pack. (At that time, this code block should probably +be moved to a more appropriate home, as noted in comments in issue +ESCOMP/ctsm#735.) + +Also, unrelated change in run_sys_tests: support machine-specific +baseline directory, in order to support new default location for CTSM +baselines on cheyenne. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Partially addresses, but does NOT fix, ESCOMP/ctsm#735 + +Known bugs introduced in this tag (include github issue ID): +- Partially addresses, but does NOT fix, ESCOMP/ctsm#735 + + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: Sean Swenson and Keith Oleson approved this change, +though didn't actually review the final code. + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - pass on cgdm-bishorn + make python=python2 test + make pyhton=python3 test + make lint + + regular tests (aux_clm): + + cheyenne ---- pass + hobart ------ pass + + Also ran SMS_Ly1.f09_g17.I2000Clm50SpGs.cheyenne_intel.clm-monthly + with comparison against baselines: passed and bit-for-bit. + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: NO (but see notes below) + + It seems theoretically possible for this to change answers, but no + answer changes were observed in the aux_clm test suite or + SMS_Ly1.f09_g17.I2000Clm50SpGs.cheyenne_intel.clm-monthly. + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): none + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev043 +Originator(s): erik (Erik Kluzek) +Date: Wed Jun 5 10:17:06 MDT 2019 +One-line Summary: Fix FUN bug (frac_ideal_C_use was backwards in regard to delta_CN), and replace Ball-Berry mbbopt with the CLM4.5 version + +Purpose of changes +------------------ + +Carbon allocation to uptake responds to CN(uptake-cost) and CN(actual). The intended implementation is: For C:N +less than the target C:N, C allocation is reduced with cost. For C:N greater than the target C:N, C allocation +is increased with high C:N. However, the actual implementation is reversed. This change fixes that problem. + +Also the Ball-Berry mbbopt values had been changed in the creation of CLM5.0, as part of the tuning, but the new +values don't work well (as our final tuning uses Medlyn photosynshesis rather than Ball-Berry). This brings the values +for Ball-Berry for CLM5.0 back to the CLM4.5 values. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): #704 #705 + + Fixes #705 -- Ball-Berry parameters in CLM5.0 should go back to the previous values in CLM4.5 + Fixes #704 -- FUN code logic to reduce or increase carbon allocation used for uptake is reversed + +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_0 + +[X] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): None + +Changes made to namelist defaults (e.g., changed parameter values): New clm5.0 paramdata file + +Changes to the datasets (e.g., parameter, surface or initial files): mbbopt now use the clm4_5 values + rather than the pretuned clm5_0 values (before Medlyn was being used) + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): None + +Changes to tests or testing: None + +Code reviewed by: self, olyson + + +CTSM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS (134 tests are different from baseline as expected) + + regular tests (aux_clm): + + cheyenne ---- OK + hobart ------ OK + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes! (Important when FUN model on) + + Summarize any changes to answers, i.e., + - what code configurations: Anything with use_FUN=T (so Clm50Bgc compsets) + Also with Clm5.0 and Ball-Berry (stomatalcond_method='Ball-Berry1987') (so Clm50Nwp compsets) + - what platforms/compilers: All + - nature of change: climate is similar + + "Our assessment is that the impact is relatively small, but would affect climate; + however it doesn’t appear to strongly affect transient C response." + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + Experiments were done on the release branch + - casename: oleson/clm50_release-clm5.0.15_delta_CN_FUNbug_2deg_GSWP3V1_1850 + oleson/clm50_release-clm5.0.15_delta_CN_FUNbug_2deg_GSWP3V1_hist + + URL for LMWG diagnostics output used to validate new climate: + +http://webext.cgd.ucar.edu/I1850/clm50_release-clm5.0.15_delta_CN_FUNbug_2deg_GSWP3V1_1850/lnd/clm50_release-clm5.0.15_delta_CN_FUNbug_2deg_GSWP3V1_1850.21_40-clm50_release-clm5.0.15_2deg_GSWP3V1_1850.21_40/setsIndex.html + +We've also completed a historical run. Diagnostics are here: + +http://webext.cgd.ucar.edu/I20TR/clm50_release-clm5.0.15_delta_CN_FUNbug_2deg_GSWP3V1_hist/lnd/clm50_release-clm5.0.15_delta_CN_FUNbug_2deg_GSWP3V1_hist.1995_2014-clm50_release-clm5.0.15_2deg_GSWP3V1_hist.1995_2014/setsIndex.html + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None + +Pull Requests that document the changes (include PR ids): #727 +(https://github.com/ESCOMP/ctsm/pull) + + #727 -- Fix the FUN bug, where an if statement was backwards + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev042 +Originator(s): slevis (Samuel Levis,SLevis Consulting LLC,303-665-1310) +Date: Tue May 21 23:29:31 MDT 2019 +One-line Summary: Rename, correct, and simplify parameters dewmx and sno_stor_max + +Purpose of changes +------------------ + + To rename + dewmx to liq_canopy_storage_scalar + sno_stor_max to sno_canopy_storage_scalar + in the code and in the clm45 and clm50 param files. + + To change snocanmx, liqcanmx, and fcansno to... + snocanmx = params_inst%snow_canopy_storage_scalar(p) * (elai(p) + esai(p)) + liqcanmx = params_inst%liq_canopy_storage_scalar(p) * (elai(p) + esai(p)) + fcansno(p) = (snocan(p) / (vegt * params_inst%sno_stor_max))**0.15_r8 + + Rewrote fwet(p) to follow the same format as fcansno(p). + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): #710 + Fixes #710 -- rename dewmx + + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): None + +Changes made to namelist defaults (e.g., changed parameter values): New default parameter file + +Changes to the datasets (e.g., parameter, surface or initial files): + Pointing to new clm45 and clm50 param files containing the two renamed + parameters listed above. + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): None + +Changes to tests or testing: None + +Code reviewed by: + @billsacks + +CTSM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS (196 different because of new param file) + + regular tests (aux_clm): + + cheyenne ---- OK + hobart ------ OK + Roundoff changes were expected. + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes! (roundoff) + + Summarize any changes to answers, i.e., + - what code configurations: ALL + - what platforms/compilers: ALL + - nature of change: roundoff + + If bitwise differences were observed, how did you show they were no worse + than roundoff? + The code modifications causing the change were of the order-of-calculations + type in two lines of code. + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None + +Pull Requests that document the changes (include PR ids): + https://github.com/ESCOMP/ctsm/pull/719 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev041 +Originator(s): sacks (Bill Sacks) +Date: Fri May 17 06:02:38 MDT 2019 +One-line Summary: Add water tracers to CanopyHydrologyMod + +Purpose of changes +------------------ + +Major overhaul of CanopyHydrologyMod in order to support water tracers. + +The part of CanopyHydrology that was actually dealing with canopy +hydrology has now been broken out into a number of small routines in +order to separate flux calculations from state updates. This is needed +in order to calculate tracer versions of the relevant variables, which +is now done here. + +The parts of CanopyHydrology that were NOT dealing with canopy hydrology +have been moved to more appropriate homes. They have not yet been +tracerized, but will be soon. + +This also makes some minor changes to diagnostic fields related to +canopy hydrology. Of particular note: QDRIP now has a different meaning: +it now corresponds to the excess liquid water that runs off from the +canopy (and is inactive by default). + +The design of this broken-out code was developed in consultation with +Mike Barlage, Erik Kluzek, Negin Sobhani, Sean Swenson and Mariana +Vertenstein. We plan to apply this design moving forward to other parts +of the code that need tracerization. See also +. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/ctsm#360 - Implement water isotopes for + CanopyHydrology +- Resolves ESCOMP/ctsm#709 - QDRIP diagnostic field misleadingly named +- Partially addresses ESCOMP/ctsm#503 - Clean up CanopyHydrology + (We still need to clean up / tracerize the parts that have now been + moved elsewhere.) + + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): +- Changed meaning of QDRIP diagnostic field: it now corresponds to + qflx_liqcanfall rather than qflx_prec_grnd_patch, and is default + inactive. (There is no longer a diagnostic field corresponding to + qflx_prec_grnd_patch, but there are separate diagnostic fields for the + rain and snow portions of this, both default inactive.) + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none +- checked timing of hydro1 timer vs. previous canhydro timer from my + dev039 testing: differences are negligible + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: +- Design reviewed by Mike Barlage, Erik Kluzek, Negin Sobhani, Sean + Swenson and Mariana Vertenstein +- Final code reviewed only by self + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne ---- ok + hobart ------ ok + + ok means tests pass, baseline comparisons fail as expected + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: YES (roundoff) + + Summarize any changes to answers, i.e., + - what code configurations: all + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + roundoff + + If bitwise differences were observed, how did you show they were no worse + than roundoff? + + Ensured no-greater-than-roundoff-level by: + + First, generated baselines using code with these diffs (note extra + parentheses in multiplication): + + diff --git a/src/biogeophys/CanopyHydrologyMod.F90 b/src/biogeophys/CanopyHydrologyMod.F90 + index f848f520..31c8c550 100644 + --- a/src/biogeophys/CanopyHydrologyMod.F90 + +++ b/src/biogeophys/CanopyHydrologyMod.F90 + @@ -338,8 +338,8 @@ subroutine CanopyHydrology(bounds, & + ! Intercepted precipitation [mm/s] + qflx_prec_intr(p) = forc_snow(c)*fpisnow + qflx_liq_above_canopy(p)*fpi + ! storage of intercepted snowfall, rain, and dew + - snocan(p) = max(0._r8, snocan(p) + dtime*forc_snow(c)*fpisnow) + - liqcan(p) = max(0._r8, liqcan(p) + dtime*qflx_liq_above_canopy(p)*fpi) + + snocan(p) = max(0._r8, snocan(p) + dtime*(forc_snow(c)*fpisnow)) + + liqcan(p) = max(0._r8, liqcan(p) + dtime*(qflx_liq_above_canopy(p)*fpi)) + + ! Initialize rate of canopy runoff and snow falling off canopy + qflx_snocanfall(p) = 0._r8 + + + Then ran test suite on 1cc9d38a. This is very close to the final + branch, but had a few small tweaks in place to get bit-for-bit: + + 1. Under some conditions, the final branch code resets slightly + negative snocan and liqcan to 0, where master did not. This + commit puts in place temporary code to maintain the slightly + negative values under these conditions, along with a check to + ensure that the values are really always only slightly negative + in this situation. + + 2. When snocan > snocanmx, master reset snocan to exactly snocanmx, + whereas the final branch code can result in snocan being + roundoff-level different from snocanmx, and similar for + liqcan. This commit puts in place temporary code to set snocan + to snocanmx under appropriate circumstances, and liqcan to + liqcanmx, along with a check to ensure that this is only leading + to roundoff-level changes in these state variables. + + 3. Multiplies then divides a flux by dtime in one place + + 4. Has parentheses around a partial sum to ensure same order of + operations as before + + This was bfb with the baselines generated with the diff noted + above, except for roundoff-level changes in SNOCAN in one grid cell + in just one test + (SMS_D_Ld1.f19_g17.I1850Clm45Cn.hobart_gnu.clm-default; old: + -8.15e-322, new: -2e-323). + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +None. But see +https://github.com/billsacks/prototypes-ctsm-canopyhydrology_tracers, +which was the source of our design discussions and contains notes from +these discussions. + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev040 +Originator(s): slevis (Samuel Levis,SLevis Consulting LLC,303-665-1310) +Date: Fri May 03 10:34:46 MDT 2019 +One-line Summary: Move some hard-coded parameters from code to params.nc file + +Purpose of changes +------------------ + + Reduce the number of parameters that get hardwired directly in the code + by placing in the params.nc file where they become visible and easier + to modify. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): #680 + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users: + None + +Changes to CTSM's user interface: + Parameters that were hardwired in the code can now be seen and changed + in the params.nc file. + +Changes made to namelist defaults (e.g., changed parameter values): + None + +Changes to the datasets (e.g., parameter, surface or initial files): + Various parameters have moved out of the code and into the params.nc file. + +Substantial timing or memory changes: [For timing changes, can check PFS test(s) in the test suite] + +Notes of particular relevance for developers: + None +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + None + +Changes to tests or testing: + None + +Code reviewed by: + @ekluzek + @billsacks + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - + + tools-tests (test/tools): + + cheyenne - + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - + + regular tests (aux_clm): + + cheyenne ---- OK + hobart ------ OK + Answers change as expected. + +CTSM tag used for the baseline comparisons: + ctsm1.0.dev039 + +Answer changes +-------------- + +Changes answers relative to baseline: YES (single precision roundoff) + Summarize any changes to answers, i.e., + - what code configurations: ALL + - what platforms/compilers: ALL + - nature of change: single-precision roundoff + Changes are due to four parameters: + accum_factor + ko25_coef + kc25_coef + frac_sat_soil_dsl_init + that were not declared "_r8" when hardwired in the code, + while now they are declared "double" in the params.nc files. I + showed that the change was no greater than single-precision roundoff + by writing the new and old values to the lnd and cesm log files and + confirming differences smaller than 1.e-6. + +Detailed list of changes +------------------------ + + - Updated the clm5 and clm4.5 params.nc files to contain the previously + hard-coded parameters that Katie Dagon recommended moving out of the + code (listed here: https://docs.google.com/spreadsheets/d/1cRmcB0xz7CjVP6ljUoCehJx49Usxsore5ma4mWcvQwM/edit#gid=0) + - Now read the parameters in the modules that use them + +Pull Requests that document the changes (include PR ids): + https://github.com/ESCOMP/ctsm/pull/684 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev039 +Originator(s): sacks (Bill Sacks) +Date: Wed May 1 11:12:34 MDT 2019 +One-line Summary: Remove excess canopy liquid/snow regardless of temperature + +Purpose of changes +------------------ + +Previously: if it was above freezing, snow was allowed to accumulate on +the canopy beyond the specified capacity, and if it was below freezing, +liquid was allowed to accumulate beyond the specified capacity. Sean +Swenson, Keith Oleson and Dave Lawrence agreed that this seems wrong. + +This tag changes the behavior so that both liquid and snow canopy +capacities are enforced regardless of temperature. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/ctsm#699 (Canopy liquid and snow capacities not + enforced consistently?) + + +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_0 + +[X] ctsm5_0-nwp + +[X] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: Keith Oleson + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne ---- ok + hobart ------ ok + + ok means tests pass, answers change as expected + +CTSM tag used for the baseline comparisons: ctsm1.0.dev038 + + +Answer changes +-------------- + +Changes answers relative to baseline: YES (small) + + Summarize any changes to answers, i.e., + - what code configurations: all + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + larger than roundoff; likely same climate, but this still requires + investigation + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/ctsm/pull/703 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev038 +Originator(s): sacks (Bill Sacks) +Date: Wed May 1 10:53:02 MDT 2019 +One-line Summary: Support for NWP configuration, NLDAS grid and NLDAS datm forcing + +Purpose of changes +------------------ + +This tag includes a set of changes that, together, provide support for +running an initial Numerical Weather Prediction version of CTSM over the +Continental U.S. + +(1) NWP configuration: The changes in this configuration relative to the + climate (CLM5) configuration mainly target decreasing runtime by + removing features that are expensive and not as important for NWP + time scales (days to months rather than many years) and space scales + (high resolution): + + - Single dominant landunit; if vegetated, single dominant PFT + + - Only 5 soil layers, down to 3 m + + - Only 5 snow layers + + - Plant hydraulic stress off + + - Ball-Berry rather than Medlyn stomatal conductance method (this is + a side-effect of turning plant hydraulic stress off, and is not + itself a critical aspect of the NWP configuration) + + - Maximum of 3 iterations to compute canopy fluxes + + - MEGAN is off + + Note that the NWP compset triggers changes in two new xml variables: + CLM_CONFIGURATION ('clm' vs. 'nwp'; this controls things of a more + scientific nature, like whether plant hydraulic stress is on or + off), and CLM_STRUCTURE ('standard' vs. 'fast'; this controls + structural things like the maximum number of landunits per grid cell + and the soil layer structure). Thus, you can create a case that is a + hybrid between the CLM and NWP configurations by changing these two + xml variables independently. + +(2) NLDAS2 regional grid: 0.125 deg grid over the Continental U.S. + +(3) Updated version of MOSART with support for the same NLDAS2 regional + grid + +(4) NLDAS2 data atmosphere forcing: over the same regional grid; forcing + data are available from 1980 - 2018. (We have excluded 1979 because + a small amount of data were missing for that year, and we didn't + have a good way to handle those missing data.) + +These changes can be used independently or all together. However, note +that you will get garbage if you try to use the new NLDAS2 datm forcing +for a run that extends beyond the boundaries of the NLDAS2 domain. + +There are three new NWP compsets: +- I2000Ctsm50NwpSpGswpGs: GSWP3 datm forcing; meant for global runs or + regional runs outside the NLDAS domain +- I2000Ctsm50NwpSpNldasGs: NLDAS2 datm forcing; meant for regional runs + over the NLDAS domain or some portion of it +- I2000Ctsm50NwpSpNldasRsGs: Same as above, but with a stub runoff model + in place of MOSART, for runs that aren't interested in having a runoff + model and for which you want improved throughput + +The alias for the new grid is: nldas2_rnldas2_mnldas2 (indicating that +we're using the nldas2 grid for land/atmosphere, runoff ('r') and the +ocean mask ('m'). + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/ctsm#451 (Add NWP physics option) +- Resolves ESCOMP/ctsm#452 (Add an NWP compset) + + +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.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): +- The NWP configuration is still a work in progress +- The NLDAS surface data set is still a work in progress (will soon + update this to use high-res PFTs) + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): +- New xml variables: + - CLM_CONFIGURATION (will eventually be renamed to CTSM_CONFIGURATION) + - CLM_STRUCTURE (will eventually be renamed to CTSM_STRUCTURE) +- New namelist variable: + - itmax_canopy_fluxes + +Changes made to namelist defaults (e.g., changed parameter values): +No changes for existing CLM compsets; new defaults for NWP compsets + +Changes to the datasets (e.g., parameter, surface or initial files): +No changes for existing grids; new surface dataset for nldas2 grid + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: +- New tests covering NWP compsets, nldas grid and nldas datm forcing + +Code reviewed by: Mike Barlage, Erik Kluzek + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - ok + + tests pass; namelists change as expected + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne ---- pass + hobart ------ pass + +CTSM tag used for the baseline comparisons: ctsm1.0.dev037 + + +Answer changes +-------------- + +Changes answers relative to baseline: NO + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): +- MOSART: release-cesm2.0.00 -> nldas-grid.n01_mosart1_0_31 +- CIME: ctsm/ctsm1.0/cime5.7.9/n04 -> ctsm/ctsm1.0/cime5.7.9/n05 + +Pull Requests that document the changes (include PR ids): +- https://github.com/ESCOMP/ctsm/pull/682 +- https://github.com/ESCOMP/ctsm/pull/685 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev037 +Originator(s): sacks (Bill Sacks) +Date: Mon Apr 29 16:11:47 MDT 2019 +One-line Summary: Change year alignment for present-day I compsets + +Purpose of changes +------------------ + +Change year alignment for present-day I compsets (typically, these +compsets have aliases beginning with "I2000"), in order to work better +for cases that are meant to replicate particular years. + +(1) Start the model in year 2000 rather than year 1 + +(2) Change datm's year alignment so that model year 2000 uses +observations from year 2000, model year 2001 uses observations from year +2001, etc. + +(This change was requested by Sean Swenson and supported by Dave +Lawrence.) + + +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.] + +[ ] clm5_0 + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): +- Year-2000 compsets now start in model year 2000 rather than 1 + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: cime changes reviewed by Erik Kluzek and others + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne ---- ok + hobart ------ ok + + ok means tests pass, year-2000 cases change answers as expected + +CTSM tag used for the baseline comparisons: ctsm1.0.dev036 + + +Answer changes +-------------- + +Changes answers relative to baseline: YES (small) + + Summarize any changes to answers, i.e., + - what code configurations: Present-day compsets (I2000, I1Pt; also I2010 once those compsets are added) + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + larger than roundoff/same climate + + This changes the year alignment of datm. Climatological averages + should be the same as before, but the alignment of model year to + datm year changes. + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): +- cime: ctsm/ctsm1.0/cime5.7.9/n03 -> ctsm/ctsm1.0/cime5.7.9/n04 + +Pull Requests that document the changes (include PR ids): +- cime changes documented in https://github.com/ESMCI/cime/pull/3093 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev036 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Fri Apr 26 01:20:57 MDT 2019 +One-line Summary: Fix carbon isotope bug that caused wrong answers for isotopes under transient land-use change + +Purpose of changes +------------------ + +We currently have a bug so that for transient land-use change cases answers are different starting in soil +carbon when Carbon isotopes (use_c13, or use_c14) are on versus off. Answers are identical if there is no +land-use change. The bug does cause bulk Carbon (C12) to be slightly different, but qualitatively the same. +There is a significant impact to the Carbon isotope simulation however. The bug was causing changes in isotopic +pools to be directed to the bulk Carbon. Because, isotopes are so much smaller than bulk Carbon, this doesn't +cause a marked difference in the bulk Carbon simulation. But, the lack of the change in the isotopic pool +does have a meaningful impact on the simulation of the Carbon isotopic fields. + +Also added a general test for this and specific one to catch this case. And did some updates on documentation +files, and a small bug fix for run_sys_tests. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): #692 #675 #686 + #675 -- Answers differ when carbon isotopes are on under transient cases + #686 -- Add a system test to make sure turning on carbon isotopes doesn't change answers + #692 -- run_sys_test issue + +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_0 + +[X] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): None + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): None + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +Caveats for developers (e.g., code that is duplicated that requires double maintenance): None + +Changes to tests or testing: Added LCISO test type and a 13 month Hist test to make sure carbon isotopes + don't cause a change to answers + +Code reviewed by: dlawren, billsacks, klindsey, bishtgautum + +CTSM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + tools-tests (test/tools): + + cheyenne - PASS + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - PASS (compare tests fail, because of namelist updates) + + regular tests (aux_clm): + + cheyenne ---- OK + hobart ------ OK + +CTSM tag used for the baseline comparisons: ctsm1.0.dev035 + + +Answer changes +-------------- + +Changes answers relative to baseline: Only for Carbon isotopes on under transient land-use change! + + Summarize any changes to answers, i.e., + - what code configurations: Bgc with use_c13 or use_c14 T and with a transient land-use change after each year boundary + - what platforms/compilers: All + - nature of change: same climate for bulk Carbon, isotopic Carbon is quite different for regions with land-use change + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cime + cime from -- ctsm/ctsm1.0/cime5.7.9/n01 to ctsm/ctsm1.0/cime5.7.9/n03 + cime update allows the new test to work and starts adding NLDAS grid in + +Pull Requests that document the changes (include PR ids): #696 #694 +(https://github.com/ESCOMP/ctsm/pull) + #696 -- run_sys_test small fix + #694 -- Carbon isotope fix + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev035 +Originator(s): sacks (Bill Sacks) +Date: Mon Apr 22 20:17:40 MDT 2019 +One-line Summary: Change h2ocan to a purely diagnostic variable + +Purpose of changes +------------------ + +Previously, h2ocan_patch was maintained through the driver loop as the +sum of liqcan_patch and snocan_patch. However, there were places where +it was updated separately (though consistently) - i.e., it was not +simply a matter of 'h2ocan = liqcan + snocan'. This made the code +more complex, especially for the upcoming addition of water tracers. + +This tag changes h2ocan_patch to be a purely diagnostic variable, set +once at the end of the driver loop. Prognostic equations that used to +use h2ocan now use liqcan and snocan, either directly or indirectly via +a temporary variable set equal to the current value of liqcan+snocan. + +This tag also completely removes support for snowveg_flag = 'OFF' in +order to clean up the code. + +In addition, this tag renames the namelist variable snowveg_flag to +snowveg_affects_radiation (now a logical). + +Finally, this tag includes a minor change to always compute fcansno, +even if snowveg_affects_radiation is false, in order to simplify the +code. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/ctsm#199 + + +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.] + +[ ] clm5_0 + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): +- snowveg_flag renamed to snowveg_affects_radiation, and changed to a + logical flag + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: +- Answer-changing portion of these changes reviewed by Keith Oleson and + (at least to some extent) Sean Swenson + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne ---- ok + hobart ------ ok + + ok means tests pass, answers change as expected + +CTSM tag used for the baseline comparisons: ctsm1.0.dev034 + + +Answer changes +-------------- + +Changes answers relative to baseline: YES (roundoff) + + Summarize any changes to answers, i.e., + - what code configurations: all + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + roundoff + + If bitwise differences were observed, how did you show they were no worse + than roundoff? + + I split these changes into two pieces: (1) an answer-changing piece + where I made minimal changes to replace uses of h2ocan_patch with + liqcan+snocan (via temporary h2ocan variables holding this sum), + and (2) non-answer-changing code cleanup. (1) consisted of the + first two commits on this branch (461cafea and f195c105). With the + changes in (1), I added checks near each change to ensure that the + new expression differed by no more than roundoff from the old + (using an absolute cutoff of 1e-13). I ran the full test suite with + these checks in place, and generated new baselines. I then compared + the changes in (2) with the baselines from (1); this cleanup step + was bit-for-bit except for roundoff-level changes in the + now-diagnostic-only field H2OCAN. + + As noted in ESCOMP/ctsm#689, the changes in (1) were larger than I + expected, presumably because initially roundoff-level differences + can lead to divergent code behavior. The most obvious example of + this is in the check of h2ocan > 0 in subroutine FracWet. I have + found that, due to roundoff errors, it is possible for h2ocan_patch + > 0 by roundoff, while (liqcan_patch + snocan_patch) <= 0 by + roundoff. (Presumably the reverse could also be true, though I + haven't seen that – but I haven't spent much time looking for it.) + + Soon, we plan to do a more rigorous test to double check that this + change is not climate-changing. + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +- First part of changes in https://github.com/ESCOMP/ctsm/pull/689 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev034 +Originator(s): sacks (Bill Sacks) +Date: Sat Apr 20 06:11:23 MDT 2019 +One-line Summary: Change clm4_5: Use Justin Perket snow on vegetation + +Purpose of changes +------------------ + +This tag changes the behavior of clm4_5, making it now use Justin +Perket's snow on vegetation parameterization. This parameterization was +originally introduced in clm4_5_1_r112. At the time it was only used for +clm5_0 cases. This tag uses that parameterization for clm4_5 cases, too, +so that (like clm5_0) they use snowveg_flag = 'ON_RAD' (i.e., vegetation +snow canopy on with albedo influence). + +This changes climate for clm4_5, mainly through albedo changes, +particularly in the shoulder seasons. + +The reason for this change is to allow an upcoming cleanup of the +relationship between h2ocan, snocan and liqcan. (See +https://github.com/escomp/ctsm/issues/199 for details.) + +This tag also no longer allows snowveg_flag = 'OFF'. However, code +cleanup is deferred to a follow-on tag, in order to separate the answer +changes in this tag from the no-greater-than-roundoff-level changes in +the follow-on tag. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- First step towards addressing ESCOMP/ctsm#199 (Clean up relationship + between h2ocan, snocan and liqcan) + + +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.] + +[ ] clm5_0 + +[X] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): +- Changes the scientific configuration of clm4_5 cases, as noted above + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): +- For clm4_5: snowveg_flag = 'ON_RAD' rather than 'OFF' + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): +- Need to clean up code involving snowveg_flag, liqcan, snocan and + h2ocan. I will do this in a follow-on tag. + +Changes to tests or testing: +- Added a test with snowveg_flag = 'ON'. (At least some of the code + paths triggered by this setting were previously covered by clm45 + cases. Now that both clm45 and clm50 use snowveg_flag = 'ON_RAD', + there was some uncovered code. This new test covers this code.) +- Changed long single-point tests to use Qian forcing: With the default + GSWP3 forcing, the vast majority of the runtime was being spent in + datm. In addition, I was getting repeated failures of + ERS_Lm54_Mmpi-serial.1x1_numaIA.I2000Clm50BgcCropGs.cheyenne_intel.clm-cropMonthOutput, + I think due to memory issues; I'm hopeful that changing the datm + forcing will help with that. + +Code reviewed by: self + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne ---- ok + hobart ------ ok + + ok means tests pass; NLCOMP and BASELINE failures for Clm45 cases, + as expected + +CTSM tag used for the baseline comparisons: ctsm1.0.dev033 + + +Answer changes +-------------- + +Changes answers relative to baseline: YES (clm4_5) Important + + Summarize any changes to answers, i.e., + - what code configurations: Clm45 compsets + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + + New climate (as in clm4_5_1_r112 for clm5_0); the main impact is + through albedo changes, particularly in the shoulder seasons. + + Changes in clm4_5 cases are due to: + + (1) Using snowveg_flag = 'ON_RAD' rather than 'OFF' + + (2) Changed initial conditions for canopy water: Rather than using + H2OCAN, which is the meaningful state variable on previous + clm4_5 initial conditions files, now we use LIQCAN and + SNOCAN. These may be 0, although at least some clm4_5 initial + conditions files (including the two non-Fates out-of-the-box + clm4_5 initial conditions files) have non-zero (though still + reasonable) LIQCAN for reasons I can't understand. + + (Also changes answers for + ERS_D_Ln9_P480x3.f19_g16.I2000Clm50SpGs.cheyenne_intel.clm-waccmx_offline, + which uses a clm45 initial file.) + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): none + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev033 +Originator(s): slevis (Samuel Levis, SLevis Consulting LLC, 303-665-1310) +Date: Thu Apr 11 10:51:29 MDT 2019 +One-line Summary: Limit landunit presence with thresholds set in the namelist + +Purpose of changes +------------------ + + Faster simulations. Motivated by NWP applications: + - Introduce user-defined namelist parameters to use as thresholds + above which landunit areas are kept and + below which landunit areas are removed. + - Introduce user-defined logical namelist parameter to collapse the up to + three urban landunits to the dominant urban landunit. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): #581 + Fixes #581 -- Allow zeroing out special landunits if their area is below some threshold + + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? No + +Notes of particular relevance for users +--------------------------------------- + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): + - New namelist variables with valid real values from 0._r8 to 100._r8, where + 0 means "do nothing" and other values determine the threshold above + which to keep the landunit in a gridcell. The new variables are: + toosmall_soil + toosmall_crop + toosmall_glacier + toosmall_lake + toosmall_wetland + toosmall_urban + - New logical namelist variable collapse_urban. If .true. then the up to + three urban landunits collapse to the dominant urban landunit. + +--------------------------------------------- +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + There's a typo in the name for n_dom_landunits (missing the s) in bld/CLMBuildNamelist.pm + build-namelist doesn't check for toosmall_* below 0 or above 100, but the code does + +Changes to tests or testing: Yes + New unit tests subroutine test_collapse_individual_lunits and + test_collapse_all_lunit_opts_active in test_surfrdUtils.pf + Modified standard suite test + ERS_D_Ld10.f10_f10_musgs.IHistClm50BgcCropGs.cheyenne_intel.clm-collapse_to_dominant_decStart + to + ERS_D_Ld10.f10_f10_musgs.I2000Clm50BgcCropGs.cheyenne_intel.clm-rm_indiv_lunits_and_collapse_to_dom + and introduced fatal error message when namelist parameters toosmall_* > 0 or + n_dom_* > 0 in transient simulations + +Code reviewed by: Erik Kluzek, Bill Sacks + +CTSM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS (384 differences because of new namelist items) + + regular tests (aux_clm): + + cheyenne ---- ok + hobart ------ ok + +CTSM tag used for the baseline comparisons: + cheyenne ctsm1.0.dev031 + hobart ctsm1.0.dev032 + + +Answer changes +-------------- + +Changes answers relative to baseline: No + Note: Comparison to baseline gives NLCOMP failures because the new namelist + parameters always appear in the namelist now, even when they have not been + changed from their default value by the user. + +Detailed list of changes +------------------------ + - Introduced call to new subroutine collapse_individual_lunits that uses + the user-defined namelist variables listed above to determine whether + a landunit gets kept or removed from a gridcell. + - Introduced new call to collapse_to_dominant for when collapse_urban = .true. + - Introduced error checks that do not allow coexistence of transient + simulations and the toosmall_* variables OR the n_dom_pfts/n_dom_landunits + variables OR the collapse_urban parameter. + +Pull Requests that document the changes (include PR ids): #641 + https://github.com/ESCOMP/ctsm/pull/641 + #641 -- Ability to remove individual landunits for faster runs + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev032 +Originator(s): negins (Negin Sobhani,UCAR/CSEG,303-497-1224) +Date: Mon Apr 8 08:26:57 MDT 2019 +One-line Summary: Fixing the balance check to check for possible errors over all columns/patches + +Purpose of changes +------------------ +Up until now, the BalanceCheckMod code in biogeophysics did not check all +the possible errors over all columns or patches with the error threshold for +aborting clm and it merely compared the last column/patch found (where +warning threshold is met) with the error threshold. +Therefore, there was always a possibility that the abort is not triggered +when it should have been. This issue was first mentioned in ctsm issue #55 +for soil energy balance check, but a similar issue is also present for +other balance checks in BalanceCheckMod.F90 . + +Below is the list of the balance checks with a similar issue: +1. Water balance check +2. Snow balance check +3. Solar radiation energy balance check +4. Longwave radiation energy balance check +5. Surface energy balance check +6. Soil energy balance check (Issue #55) + +For remediating this issue, we used MAXVAL and MAXLOC Fortran intrinsic functions +to compare the largest error with the warning and error thresholds instead +of checking the last column or looping over all columns. + + +In addition, this PR also makes slight changes to ./run_sys_tests outputi/case +directory structure. Previously for each case in a test suite, there were +two set of directories created by run_sys_tests as follows: + * one directory which included run/ and bld/ and named as $SCRATCH/[case-name].... + * The case directory which included logs , timings, CaseDocs/, and misc. scripts + for ./case.build, ./case.submit... under $SCRATCH/tests-[testID]/[case-name].... + +This made debugging confusing and populated many folders in user's scratch. +Now, for every case in a test, all directories related to that case +including bld/ and run/ directories are nested under the case directory under $SCRATCH/tests-[testID]/[case-name].... +This is now similar to ./create_test output folder structure. + + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/ctsm issue#55 + +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.] + +[ ] clm5_0 + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): None + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): None + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + +Changes to tests or testing: + - ./run_sys_test is changed so that it nests bld/ and run/ directories under the case directory as $SCRATCH/tests-[testID]/[case-name]... + The output folder structure now is similar to ./create_test for each case in a test. + +Code reviewed by: Bill Sacks + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne ---- ok + hobart ------ ok + + +CTSM tag used for the baseline comparisons: ctsm1.0.dev031 + + +Answer changes +-------------- + +Changes answers relative to baseline: No + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None + +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/ctsm/pull/670 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev031 +Originator(s): sacks (Bill Sacks) +Date: Wed Mar 13 15:03:42 MDT 2019 +One-line Summary: Subtract virtual states to reduce dynbal fluxes for transient glaciers + +Purpose of changes +------------------ + +Up until now, when computing the dynbal correction (conservation) fluxes +for transient glacier columns, we have been (1) counting the mass and +energy in the ice column as if that is a real state, but on the other +hand (2) NOT accounting for the fact that glacier columns don't +represent the soil under glacier. These two issues work in opposite +directions, but (1) dominates, because there is much more ice (and +energy, I think) in the roughly 50 m of glacial ice than there is in a +typical 50 m soil column. + +In discussing this issue with Bill Lipscomb, we came up with the idea of +subtracting some baseline value from each glacier column. I think that, +as long as we subtract the same baseline value throughout an entire +simulation for a given column, we will still conserve mass and energy +through dynamic landunit transitions. + +So, here we subtract baseline values from glacier columns, accounting +for the two issues mentioned above: (1) we subtract the water and energy +in the glacier ice, because this is a virtual state in CTSM, and (2) we +add the water and energy from the vegetated column(s), to account for +the fact that we don't have an explicit representation of +soil-under-glacier (this carries the assumption that the +soil-under-glacier has the same state as the initial vegetated state in +that grid cell). We set these baselines in initialization, so they begin +equal to the cold start state. Water and ice in the glacial ice stay +fixed over the course of a simulation, so the cold start values should +be the same as the current values at any point in time. The heat content +of the glacial ice does change over time, but by subtracting this +baseline value, we can potentially reduce the dynbal sensible heat +fluxes (however, note that it's also possible that these sensible heat +fluxes could increase when subtracting the cold start value, if ice +temperatures are closer to 0 deg C than to the cold start value, +currently 250 K). + +In addition, this introduces a new namelist flag, +reset_dynbal_baselines, which allows the user to reset these baselines +at some desired point in the simulation. I think that, in general, this +resetting would break conservation. But as long as it is done before the +onset of transient glaciers, I think this should be okay. In this way, +the user can minimize dynbal fluxes even further, by resetting the +baselines after the system has spun up. If the states haven't changed +much from this point to the point when glacier dynamics occur, then the +dynbal fluxes should now be very small. (See the documentation of this +flag in namelist_definition_ctsm.xml for more details.) + +Without this change, dynbal fluxes for a grid cell that undergoes 100% +glaciation / deglaciation in a single year are around 50 m ice, 1 m +liquid water, and a few tens of W m-2 (where those quantities of ice and +water are dribbled throughout the year, so we end up with an ice flux of +about 1.5e-6 mm/s throughout the year; and the energy flux is applied +evenly throughout the year - i.e., tens of W m-2 every time step for a +year). With this change, and with reset_dynbal_baselines set at an +appropriate time, these fluxes can be reduced to close to zero. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Partially addresses ESCOMP/ctsm#274 (Dynamic landunits: improve water + and energy conservation) + +CIME Issues fixed (include issue #): +- Fixes three issues related to inputdata checksum: + - ESCMI/cime#3033 + - ESCMI/cime#3034 + - ESCMI/cime#3036 + +Known bugs introduced in this tag (include github issue ID): +- ESCOMP/ctsm#659 (Subtract dynbal baselines from begwb and endwb) + - This can't be fixed until we're okay having this answer change on + master + +Known bugs found since the previous tag (include github issue ID): +- ESCOMP/ctsm#658 (Methane should not depend on gridcell-level TWS) + +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_0 + +[X] clm4_5 + +Significant answer changes for runs with transient glaciers. + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): +- For runs with transient glaciers, careful thought should be given to + when to set reset_dynbal_baselines +- Inconsistency between begwb/endwb and liq1/liq2/ice1/ice2 (see ESCOMP/ctsm#659) + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): +- New namelist variable: reset_dynbal_baselines + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): +- Inconsistency between begwb/endwb and liq1/liq2/ice1/ice2 (see ESCOMP/ctsm#659) + +Changes to tests or testing: +- Tweaked a test with transient glacier areas, including adding this new + flag to the test + +Code reviewed by: Bill Lipscomb reviewed the conceptual ideas, but +nobody has reviewed the actual code + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne ---- ok + hobart ------ ok + + ok means tests pass, answers change as expected + +CTSM tag used for the baseline comparisons: ctsm1.0.dev030 + + +Answer changes +-------------- + +Changes answers relative to baseline: YES (Important) + + Summarize any changes to answers, i.e., + - what code configurations: ALL, but different configurations show + different levels of changes, as noted below + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + - new climate (at least regionally) for some configurations; + roundoff for others: see below + + There are three levels of changes here: + + (1) For runs with transient glaciers, there are large answer changes + in regions with changing glacier area. These answer changes are + in the various dynbal fluxes - for liquid water and ice runoff, + and for the dynbal sensible heat flux. + + (2) For runs with transient vegetation (Hist, Dv and Fates), there + are roundoff-level changes in the dynbal fluxes. For liquid + water and ice, these changes appear to only occur in grid cells + where there is some glacier area (because now both the before + and after gridcell water contents have changed by the same fixed + amount, which changes the difference at the roundoff level). For + heat, there are roundoff-level changes everywhere (because of + changes in the order of operations). + + (3) All runs have large changes in the diagnostic variables, + ICE_CONTENT1, LIQUID_CONTENT1 and HEAT_CONTENT1, over grid cells + containing some glacier area. + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): +- cime: cime5.7.9 -> ctsm/ctsm1.0/cime5.7.9/n01 + - Fixes issues related to inputdata checksum + +Pull Requests that document the changes (include PR ids): +- https://github.com/ESCOMP/ctsm/pull/650 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev030 +Originator(s): sacks (Bill Sacks) +Date: Fri Mar 8 15:08:34 MST 2019 +One-line Summary: Update CIME; hookup expected test fails + +Purpose of changes +------------------ + +Two main changes: + +(1) Update to latest cime (from ctsm/ctsm1.0/cime5.7.5/n01 to + cime5.7.9). Some of the important changes are: + - Fix for recent cheyenne system changes + - New domain file for f19_g17 (changes answers at the roundoff + level) + - New domain file for T31_g37 (changes answers by greater than + roundoff) + +(2) In system tests: Annotate cs.status output with expected failures + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Fixes ESCOMP/ctsm#654 + +CIME Issues fixed (include issue #): (Many) + + +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.] + +[ ] clm5_0 + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none? + The PFS test showed a significant speedup (170s in the previous tag, + 124s in this tag). However, some other tests showed either a slowdown + or not much change. So I'm not sure there is a consistent pattern of + speedup in this tag. + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: Erik Kluzek + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne ---- ok + hobart ------ ok + + ok means tests pass, some baselines failed as noted below + + Most testing done with cime at eb2eb704f - excluded PR #3030, which + updated support for CAM-SE grids (but the changes in this PR were + very limited). Ran SSP tests with the final version of cime (so I'd + have a few tests covering the latest cime). + +CTSM tag used for the baseline comparisons: ctsm1.0.dev029 + + +Answer changes +-------------- + +Changes answers relative to baseline: YES (f19_g17, T31_g37 small) + + Summarize any changes to answers, i.e., + - what code configurations: f19_g17, T31_g37 + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + + - f19_g17: roundoff-level, presumably due to new domain file (some + diffs grew to greater than roundoff-level: some methane + variables in a long test - + SMS_Lm13.f19_g17.I2000Clm50BgcCrop.cheyenne_intel.clm-cropMonthOutput; + and many variables in test with flooding - + ERP_P180x2_D.f19_g17.I2000Clm50SpRtmFl.cheyenne_intel.clm-default) + + - T31_g37: greater than roundoff-level, presumably due to new + domain file from cime commit 4fcf592ee + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): +- cime: ctsm/ctsm1.0/cime5.7.5/n01 -> cime5.7.9 + +Pull Requests that document the changes (include PR ids): +- https://github.com/ESCOMP/ctsm/pull/602 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev029 +Originator(s): slevis (Samuel Levis, SLevis Consulting LLC, 303-665-1310) +Date: Tue Feb 26 23:42:39 MST 2019 +One-line Summary: Collapse landunits to the N most dominant + +Purpose of changes +------------------ + + Allows the collapse to fewer landunits using the concept of + N most dominant for the purpose of faster runs, eg in the context + of NWP (Numerical Weather Prediction). + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): #581 + + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? No + + [Put an [X] in the box for any configuration with significant answer changes.] + +[ ] clm5_0 + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): + New namelist variable n_dom_landunits with valid integer values from 0 to + max_lunit currently equal to 9, where 0 means “do nothing” and other + values determine the number of active landunits when running the model. + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): None + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + There is a question left in on whether the collapse call needs to also + be moved to inside dynamic landunits reading. + +Changes to tests or testing: Yes + ERS_D_Ld10.f10_f10_musgs.IHistClm50BgcCropGs.cheyenne_intel.clm-collapse_to_dominant_decStart + now replaces (by combining with) this test introduced in ctsm1.0.dev026 + ERS_D_Ld10.f10_f10_musgs.IHistClm50BgcCropGs.cheyenne_intel.clm-collapse_nat_pfts_decStart + I added subroutine test_collapse_to_dom_landunits to test_surfrdUtils.pf + to include new Unit Tests. In same file I renamed + subroutine test_collapse_nat_pfts to test_collapse_to_dom_pfts + to accurately describe the contents of the subroutine. + +Code reviewed by: Erik Kluzek + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + regular tests (aux_clm): + + cheyenne ---- OK + hobart ------ OK + +CTSM tag used for the baseline comparisons: + ctsm1.0.dev028 + + +Answer changes +-------------- + +Changes answers relative to baseline: No + +Detailed list of changes +------------------------ + + Replaced existing subroutine collapse_nat_pfts with + subroutine collapse_to_dominant which can collapse to the + N dominant landunits or N dominant pfts by performing the + same actions on the data. + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None + +Pull Requests that document the changes (include PR ids): #639 + https://github.com/ESCOMP/ctsm/pull/639 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev028 +Originator(s): sacks (Bill Sacks) +Date: Tue Feb 26 14:35:01 MST 2019 +One-line Summary: Interpolate out-of-the-box initial conditions and remove expensive tests + +Purpose of changes +------------------ + +Two main changes (plus some small additional changes): + +1. Removed / reworked some expensive tests + +2. Interpolated all out-of-the-box initial conditions, so that the + out-of-the-box version is now compatible with our current + configuration. The changes from before were (a) our standard + configuration now uses the gx1v7 rather than gx1v6 land mask; (b) + many inactive points are now absent in memory. + +See https://github.com/ESCOMP/ctsm/pull/622 for details. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/ctsm#312 +- Partially addresses ESCOMP/ctsm#275 (just a bit) + + +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.] + +[ ] clm5_0 + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): +- New finidat files + +Substantial timing or memory changes: +- Faster initialization times for cases that no longer need to interpolate initial conditions + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: +- Removed or reworked expensive tests: see details in https://github.com/ESCOMP/ctsm/pull/622 + +Code reviewed by: Erik Kluzek + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne ---- ok + hobart ------ ok + + ok: tests pass, baselines fail as expected + +CTSM tag used for the baseline comparisons: ctsm1.0.dev027 + + +Answer changes +-------------- + +Changes answers relative to baseline: YES (just for initial conditions) + + Summarize any changes to answers, i.e., + - what code configurations: all configurations that still need use_init_interp = .true. + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + Not investigated carefully, but expected to be larger than roundoff/same climate + + Answers change for cases that still need to do interpolation from + these out-of-the-box finidat files. + + I first confirmed that the new finidat files are good via: + + - Compared `ncdump -h` of old vs. new initial conditions files + + - Ran the following tests, with comparison against master; verified that + these all pass and are bit-for-bit, that they use the new initial + conditions files, and that they now have `use_init_interp` unset + (whereas they used to have `use_init_interp` set to `.true.`); note + that these cover 6 of the 7 new initial conditions files: + + ``` + SMS_Ld1.f09_g17.I1850Clm45BgcGs.cheyenne_intel.clm-default + SMS_Ld1.f09_g17.I1850Clm45BgcCruGs.cheyenne_intel.clm-default + SMS_Ld1.f09_g17.I1850Clm50Sp.cheyenne_intel.clm-default + SMS_Ld1.f09_g17.I1850Clm50BgcCrop.cheyenne_intel.clm-ciso + SMS_Ld1.f09_g17.I1850Clm50BgcCropCru.cheyenne_intel.clm-ciso + SMS_Ld1.f09_g17.I1850Clm50SpCru.cheyenne_intel.clm-default + ``` + + - To cover the last new initial conditions file, ran the following test + (with the same checks as above: passes and bit-for-bit, checked + finidat, and checked `use_init_interp`), with `./xmlchange + LND_TUNING_MODE=clm5_0_cam6.0` (for the baseline for this test, I set + `init_interp_method = 'use_finidat_areas'`, which I also used in + interpolating this initial conditions file): + + ``` + SMS_Ld1.f09_g17.I1850Clm50BgcCrop.cheyenne_intel + ``` + + Details on answer changes: + + As noted above, these changes are bit-for-bit for configurations + that can now use the out-of-the-box initial conditions without + interpolation. However, answers change for configurations that still + require interpolation of the out-of-the-box initial conditions + (e.g., because they are at a different resolution than the finidat + file). + + I expected these answer changes around the Caspian Sea, due to the + fact that we are now effectively interpolating twice from the + original file: once to produce the new out-of-the-box file (which + includes an interpolation from `gx1v6` to `gx1v7`, and so + interpolates onto the Caspian Sea region) and once to go from + `f09_g17` to the target resolution (rather than interpolating + directly from `f09_g16` to the target resolution). + + However, when I ran a test with comparison to baselines - + `ERP_Ld5.f19_g17.I1850Clm50Bgc.cheyenne_intel.clm-default` - I saw + changes in regions further afield than simply around the Caspian + Sea. See images in https://github.com/ESCOMP/ctsm/pull/622 for + details. It's possible that the other differences are also due to + the Caspian Sea change, but it's also possible that there is some + other cause here that I don't understand. But Erik Kluzek and I + agreed that it isn't worth trying to understand these other + (isolated) differences. + + Also note: While most f09_g17 tests are bit-for-bit with the earlier + tag (because now use_init_interp is .false. for those tests), + `SMS_Ld2_D.f09_g17.I1850Clm50BgcCropCmip6.cheyenne_intel.clm-basic_interp` + differs in some glc forcing fields for a few grid cells in + Antarctica. This is perhaps not surprising, since this test needs to + use interpolation to get fields for the Antarctica virtual columns; + so, while I don't completely understand the cause of these answer + changes, I suspect the root cause is similar to the isolated answer + changes I saw sprinkled around the world for + `ERP_Ld5.f19_g17.I1850Clm50Bgc.cheyenne_intel.clm-default`. + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +- https://github.com/ESCOMP/ctsm/pull/622 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev027 +Originator(s): negins (Negin Sobhani,UCAR/CSEG,303-497-1224) +Date: Tue Feb 19 12:57:12 MST 2019 +One-line Summary: Non-constant time initialization for soil hydrology types are moved to SoilHydrologyType.F90. + +Purpose of changes +------------------ + +Initalization of time-varying `zwt`, `zwt_perched`, and `frost_table` are moved to `InitCold` in `SoilHydrologyType.F90`. + +Previously, `zwt`, `zwt_perched`, and `frost_table` were initialized in `SoilHydrologyInitTimeConstMod.F90`, which caused confusions. + +Bugs fixed or introduced +------------------------ +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/ctsm#575 ("Some variables initialized in SoilHydrologyInitTimeConstMod are not time-constant") + +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.] + +[ ] clm5_0 + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: Updated a test. The test added in previous tag included decStart with transient glaciers, which would not work. Hence, this test is modified so the compset does not include G. +Test IHistClm50SpG is updated to IHistClm50Sp. + +Code reviewed by: +Bill Sacks +Erik Kluzek + +CTSM testing: + + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne ---- ok + hobart ------ ok + + ok means tests pass, except for the expected failures. + +CTSM tag used for the baseline comparisons: +ctsm1.0.dev026 + +Answer changes +------------- + +Changes answers relative to baseline: no + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): + +Pull Requests that document the changes (include PR ids): +PR #631 Soil hydrology initialization of time-constant variables moved to SoilHydrologyType +https://github.com/ESCOMP/ctsm/pull/631 + + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev026 +Originator(s): slevis (Samuel Levis, SLevis Consulting LLC, 303-665-1310) +Date: Tue Feb 5 17:08:48 MST 2019 +One-line Summary: Collapse unmanaged PFTs to the N most dominant + +Purpose of changes +------------------ + +To run simulations fast for applications such as NWP (Numerical Weather +Prediction), allow collapsing natural PFT's to the number the user wants. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): 457 + + +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.] + +[ ] clm5_0 + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): +New namelist parameter n_dom_pfts with valid integer values from 0 to +14, where 0 means “do nothing” and other values determine the number +of active pfts when running the model + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): None + +Substantial timing or memory changes: None (unless new option invoked) + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in ../CTSMMasterChecklist as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: updated tests, added new test +Updated standard testing test to include decStart +(December start). Confirmed that answers were bit-for-bit same with +baseline before introducing the change. +Added standard testing test to test n_dom_pfts = 2 in a +transient vegetation case with December start. +Added subroutine test_collapse_nat_pfts to test_surfrdUtils.pf to +include new Unit Tests. + +Code reviewed by: +Erik Kluzek +Bill Sacks + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + regular tests (aux_clm): + + cheyenne ---- OK + hobart ------ OK + +CTSM tag used for the baseline comparisons: +ctsm1.0.dev025 + +Answer changes +-------------- + +Changes answers relative to baseline: No (bit-for-bit) + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None + +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/ctsm/pull/588 -- NWP collapse pfts to the N most dominant +https://github.com/ESCOMP/ctsm/pull/583 -- Add routine to find indices of max k values in data + +Added new subroutines collapse_nat_pfts and collapse_crop_var and called +them from surfrdMod.F90. The second of these subroutines is not needed +when collapsing unmanaged PFTs; however, I created it early in the PR +and decided to keep it for use soon with crop-related variables like +irrigation water and fertilizer. + +Bill Sacks made changes to include subroutine find_k_max_indices for the +benefit of this PR (#583) + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev025 +Originator(s): Keith Oleson, Bill Sacks +Date: Wed Jan 23 10:48:01 MST 2019 +One-line Summary: History fields for vertically-resolved sums of soil C and N, and minor fixes + +Purpose of changes +------------------ + +Main change is from Keith Oleson: Add history fields for +vertically-resolved sums of SOIL1C, SOIL2C, and SOIL3C for C12, C13, +C14, and similarly for N. New fields are SOILC_vr, C13_SOILC_vr, and +C14_SOILC_vr, and SOILN_vr. For runs that use the output_bgc usermods, +including cmip6 runs, we no longer output 'SOIL1C_vr', 'SOIL1N_vr', +'SOIL2C_vr', 'SOIL2N_vr', 'SOIL3C_vr', 'SOIL3N_vr'; instead we output +'SOILC_vr', 'SOILN_vr', and similarly for C isotopes. + +Also minor fixes: +- Output cpl hist files in SSP test (resolves ESCOMP/ctsm#61) +- Remove FATES-related commented-out code in OzoneMod (this has been + moved to https://github.com/ESCOMP/ctsm/issues/618) +- Minor tweak to run_sys_tests + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/ctsm#61 + +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.] + +[ ] clm5_0 + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): +- For runs that use the output_bgc usermods, including cmip6 runs, we no + longer output 'SOIL1C_vr', 'SOIL1N_vr', 'SOIL2C_vr', 'SOIL2N_vr', + 'SOIL3C_vr', 'SOIL3N_vr'; instead we output 'SOILC_vr', 'SOILN_vr', + and similarly for C isotopes. + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in ../CTSMMasterChecklist as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: Bill Sacks; Erik Kluzek reviewed the changes to the SSP test + + +CTSM testing: + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne ---- pass + hobart ------ pass + +CTSM tag used for the baseline comparisons: ctsm1.0.dev024 + + +Answer changes +-------------- + +Changes answers relative to baseline: NO + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/ctsm/pull/551 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev024 +Originator(s): slevis (Samuel Levis,SLevis Consulting, LLC, 303-665-1310) +Date: Mon Jan 14 11:07:04 MST 2019 +One-line Summary: Remove unnecessary restart variables + +Purpose of changes +------------------ + +Remove unnecessary restart variables to conserve on computing resources +and disk space + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): 285 + + +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.] + +[ ] clm5_0 + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): + +Changes made to namelist defaults (e.g., changed parameter values): + +Changes to the datasets (e.g., parameter, surface or initial files): + +Substantial timing or memory changes: + +Notes of particular relevance for developers: +Code reviewed by Bill Sacks. +Standard testing (cheyenne and hobart) OK +Unit testing PASS +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + +Changes to tests or testing: + +Code reviewed by: Bill Sacks + +CTSM testing: +Regular testing (cheyenne and hobart) OK +Unit testing PASS + +CTSM tag used for the baseline comparisons: +ctsm1.0.dev023 + + +Answer changes +-------------- + +Changes answers relative to baseline: NO (bfb) + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): + +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/ctsm/pull/598 + +Variables removed from restart: +plant_nalloc +pot_f_nit_vr* +f_nit_vr* +root_depth +qflx_floodg +snounload +qflx_snofrz_lyr +sminn_to_plant_fun_patch + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev023 +Originator(s): sacks (Bill Sacks) +Date: Thu Jan 10 13:00:42 MST 2019 +One-line Summary: Remove CLM4.0 + +Purpose of changes +------------------ + +Remove CLM4.0. This consists of removing code and other files that are +specific to CLM4.0, and doing some resulting cleanup of code that was +shared between CLM4.0 and later versions (primarily in build-namelist). + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves #455 (Remove CLM4.0) + + +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.] + +[ ] clm5_0 + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): +- Can no longer run CLM4.0 cases + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): +- CLM4.0 compsets no longer supported + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in ../CTSMMasterChecklist as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: Removed CLM4.0 tests + +Code reviewed by: Erik Kluzek + + +CTSM testing: + + build-namelist tests: + + cheyenne - pass + + tools-tests (test/tools): + + cheyenne - pass + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - ok + + Total number of tests = 52 + Number of tests that PASS = 51 + Number of tests that Fail = 1 + Number of compare tests that PASS = 37 + Number of compare tests that Fail = 4 + Number of tests without compare = 11 + + The one failing test is: + FAIL fail-no_towerdata.-d+/glade/p/cesmdata/cseg/inputdata++-s+RF-Bra+--debug+--pftgrid+--soilgrid. + + These same failures occurred in ctsm1.0.dev022 (including the + compare tests that Fail). Erik Kluzek says these failures are + okay. + + regular tests (aux_clm): + + cheyenne ---- pass + hobart ------ pass + + Notes on testing: + + - Most testing done on b5380c7e8. Since then, updated to a version of + cime that fixes cime's configure tool (but this isn't invoked in + system tests, so I didn't rerun the system tests) and pointed cime + to a tag rather than a hash. + + - For tools tests: In baseline, cherry-picked commit 148bc2158 into + cime + +CTSM tag used for the baseline comparisons: ctsm1.0.dev022 + + +Answer changes +-------------- + +Changes answers relative to baseline: NO + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): +- cime: points to branch tag off of cime5.7.5 + (ctsm/ctsm1.0/cime5.7.5/n01), with changes for: + (1) Removal of support for CLM4.0 (equivalent to the changes in + https://github.com/ESMCI/cime/pull/2968) + + (2) Fix for cime configure (cherry-picked 148bc2158) + +Pull Requests that document the changes (include PR ids): +- https://github.com/ESCOMP/ctsm/pull/609 (Remove CLM4.0) +- https://github.com/ESCOMP/ctsm/pull/601 (Print git status and related + info when running run_sys_tests) + + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev022 +Originator(s): sacks (Bill Sacks) +Date: Tue Jan 8 11:01:38 MST 2019 +One-line Summary: Set tracer version of irrigation fluxes + +Purpose of changes +------------------ + +Set tracer version of irrigation fluxes. + +This required a substantial rewrite of ApplyIrrigation (now renamed to +CalcIrrigationFluxes). The problem was that the code was written to +compute the total irrigation withdrawal from groundwater, then use this +to compute the application fluxes (drip/sprinkler), then later divide +this total withdrawal by layer. But for tracer fluxes to be computed +correctly, we needed to reorder this, so that the per-layer withdrawals +are determined before determining the application fluxes. This is +because the application flux needs to know the tracer concentrations of +the source, which requires knowing which layers the source is drawing +from. This was made more challenging because of the mix of patch-level +and column-level variables at play: irrigation demand is patch-level, +groundwater availability and extraction is column-level, but application +is back to patch-level. + +In a somewhat-related change, I also reworked the passing of information +between soil hydrology (groundwater availability) and irrigation: +Previously, there was some near-duplicate code in +CalcAvailableUnconfinedAquifer (which was called prior to +ApplyIrrigation) and WithdrawGroundwaterIrrigation (which was called +after ApplyIrrigation). I have reworked the code to remove this +duplication, calling the new CalcIrrigWithdrawals in the midst of +CalcIrrigationFluxes. In doing so, I reconciled an accidental +discrepancy between the two original routines (see +https://github.com/escomp/ctsm/issues/595). + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/ctsm#521 (Set tracer versions of fluxes set by + ApplyIrrigation) +- Resolves ESCOMP/ctsm#593 (Generalize groundwater irrigation availability to + handle multiple patches per column) +- Resolves ESCOMP/ctsm#595 (Inconsistency between CalcAvailableUnconfinedAquifer + and WithdrawGroundwaterIrrigation) + + +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.] + +[ ] clm5_0 + +[ ] clm4_5 + +[ ] clm4_0 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: + +- Sean Swenson reviewed the initial parts of the rework of + ApplyIrrigation and the passing of information between soil hydrology + and irrigation + +CTSM testing: + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne ---- ok + hobart ------ ok + + ok means tests pass, expected baseline failures as noted below + + Additional manual testing: + + - Out of the box, the one-timestep tracer consistency test + (SMS_D_Ln1.f10_f10_musgs.I2000Clm50BgcCropGs.hobart_nag.clm-tracer_consistency) + passed when the new check was inserted after the irrigation call, + even without the changes in this tag. Presumably this is because no + irrigation was being done in the first time step of this test. To + confirm that the changes here were both necessary and effective, I + hacked the code to force irrigation of all types (surface and + groundwater) on the first time step (see + https://github.com/billsacks/ctsm/commit/d28a03145). I confirmed + that this test, with those code hacks, failed before the changes in + this tag, and passed with these changes in place. + + - I used a multi-step process to confirm that these changes are only + roundoff-level different for groundwater irrigation (because + feedbacks in the system result in + SMS_D_Ld5.f10_f10_musgs.I2000Clm50BgcCrop.hobart_nag.clm-irrig_alternate + looking greater-than-roundoff-level different from the baseline): + + (1) Confirmed that e507fe603 is only roundoff-level different from + baseline using cprnc output from this test. + + (2) Confirmed that a4a1a626c is only roundoff-level different from + e507fe603. This was the tricky part. I did this by introducing + some temporary code that (a) computed some fluxes in both the + old and new ways, (b) compared the old and new methods for each + point and time step, confirming that they were no more than + roundoff-level different, then (c) set the fluxes to the old + method. I confirmed that this was bit-for-bit with e507fe603, + and the checks for greater-than-roundoff-level differences + between the old and new methods were never triggered. (See + https://github.com/billsacks/ctsm/commit/7d23e9e and the earlier + commits on that branch.) + + (3) Confirmed that remaining changes an the branch are bit-for-bit + with a4a1a626c. + +CTSM tag used for the baseline comparisons: ctsm1.0.dev021 + + +Answer changes +-------------- + +Changes answers relative to baseline: YES (small) + + Summarize any changes to answers, i.e., + - what code configurations: + + - Small answer changes when groundwater irrigation is enabled. In + principle, could change answers by greater than roundoff due to + fix of #595, but I didn't see any answer changes in my 7-month + test due to that change. Other than that, just roundoff-level + changes. + + - Answer changes when tracers are enabled. + + - Roundoff-level changes in the diagnostic field, + QIRRIG_FROM_SURFACE, for many tests + + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + See notes under "what code configurations" for details. + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/ctsm/pull/600 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev021 +Originator(s): mvr (Mathew Rothstein,UCAR/CSEG,303-497-1304) +Date: Wed Dec 26 16:29:06 MST 2018 +One-line Summary: Added tracer ratio capability and included it in consistency checks + +Purpose of changes +------------------ + +These changes are needed to support the implementation of water isotopes by ensuring +that isotope-related variables are being updated consistently throughout the model. +The consistency checks include the testing of a bulk tracer that should always be +equal to the bulk, and also test tracers that maintain a fixed ratio (other than +one) to the bulk. This commit includes fixes to the cold start initialization for +the water tracers with ratios other than one. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): [If none, remove this line] +#541 Only do water tracer consistency checks on tracers that are + supposed to maintain a fixed ratio +#459 Fix cold start initialization of water tracers +#508 Remove unused variables in new Water types +#357 Put in place Water isotope consistency checks + + + +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.] + +[ ] clm5_0 + +[ ] clm4_5 + +[ ] clm4_0 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in ../CTSMMasterChecklist as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: added unit tests + +Code reviewed by: bill sacks + + +CTSM testing: + + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne ---- PASS + hobart ------ PASS + +CTSM tag used for the baseline comparisons: ctsm1.0.dev020 + + +Answer changes +-------------- + +Changes answers relative to baseline: no, b4b + + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): #599 Adding isotope + tracer ratios +(https://github.com/ESCOMP/ctsm/pull) + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev020 +Originator(s): Sean Swenson, Bill Sacks +Date: Mon Dec 3 11:51:24 MST 2018 +One-line Summary: New options for irrigation and crop fsat + +Purpose of changes +------------------ + +Introduce three new options: + +(1) Ability to withdraw irrigation water from groundwater if not enough + water is available from rivers. This is controlled via new namelist + flag, use_groundwater_irrigation. Water can be withdrawn from both + the unconfined (from the soil column) and confined (from wa) + aquifers. + +(2) Irrigation method: sprinkler (above canopy) vs. drip (below + canopy). This can be set on a per-crop and per-gridcell basis on the + surface dataset, but out-of-the-box support for creating the + necessary surface dataset field is not yet in place (see + ESCOMP/ctsm#565). For now, it can be controlled globally via a new + namelist flag, irrig_method_default. The default is drip, which was + what we were previously using implicitly. + +(3) Set crop fsat to zero. This is controlled by a new namelist option, + crop_fsat_equals_zero. + +Default behavior is the same as before for all three options. + +Also: + +- If use_aquifer_layer is false (which is the default for CLM50), no + longer reset wa_col every time step + +- Adds indices to vector history files giving column, landunit and + gridcell indices for each patch, etc. (Resolves ESCOMP/ctsm#81: + "Restart files are different for CLM when run over different number of + tasks" (issue name is a misnomer of the remaining to-dos in that + issue.) + +- Writes 3d time-constant fields on first history file for all tapes, + not just the first + +- Small performance improvements to irrigation + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/ctsm#81 ("Restart files are different for CLM when run + over different number of tasks", but that name was a misnomer for the + remaining work needed on the issue) + +Known bugs introduced in this tag (include github issue ID): +- ESCOMP/ctsm#565: Surface dataset enhancements needed for irrigation method + + +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.] + +[ ] clm5_0 + +[ ] clm4_5 + +[ ] clm4_0 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): +- New namelist variables: + - use_groundwater_irrigation + - irrig_method_default + - crop_fsat_equals_zero +- Partial support for new surface dataset field: irrigation_method + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in ../CTSMMasterChecklist as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + +Changes to tests or testing: +- Added two tests of the new irrigation options +- Added an _includes directory to hold things that should be included by + testmods (not used directly) + + +Code reviewed by: Bill Sacks and Sean Swenson reviewed each other's code + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - ok + + Tests pass, namelists differ as expected + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne ---- ok + hobart ------ pass + + ok: tests pass, some answers change as noted below + +CTSM tag used for the baseline comparisons: ctsm1.0.dev019 + + +Answer changes +-------------- + +Changes answers relative to baseline: YES (same climate) + + Summarize any changes to answers, i.e., + - what code configurations: Some CLM50 cases that are either cold start + or (unusually) use a CLM45 initial conditions file; it's possible + that non-cold-start configurations would see differences rarely. + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + Larger than roundoff, same climate + + Differences arise due to no longer resetting wa_col to + aquifer_water_baseline every time step in BeginWaterBalanceSingle + if use_aquifer_layer is false (which is the default for + CLM50). (This change is needed to conserve water properly with the + new groundwater-based irrigation.) For the most part, wa_col + wasn't being changed when use_aquifer_layer is false (so no longer + resetting it has no effect if groundwater irrigation isn't being + used), but the one exception is the "work around of the negative + liquid water" added by Jinyun Tang in subroutine SoilWater (dated + Jan 14, 2015), which can be exercised when use_flexibleCN is + true. Sean Swenson did some experimentation, and found that the + code that updates wa_col is only exercised in the first time step + of a cold start run, and that finding is borne out in the test + suite results. However, it's possible that there are rare cases + when this is exercised later in a run. + + I have confirmed that this branch is bit-for-bit with the baseline + if I revert the addition of the use_aquifer_layer conditional + around the wa_col resetting in + BeginWaterBalanceSingle. Alternatively, nearly all tests are + bit-for-bit with the baseline if I remove the one line updating + wa_col in subroutine SoilWater (and also remove the endrun for + water balance errors from BalanceCheck); the one exception is the + waccmx_offline test, which uses a CLM45 initial conditions file in + a CLM50 configuration. + + The following tests had baseline failures: + + Cold start tests: + + ERP_D_Ld5.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-allActive + ERP_D_P36x2_Ld3.f10_f10_musgs.I2000Clm50BgcCrop.cheyenne_intel.clm-cropColdStart + ERP_P180x2_D_Ld5.f19_g17.I2000Clm50BgcDvCrop.cheyenne_intel.clm-crop + ERP_P36x2_Lm25.f10_f10_musgs.I2000Clm50BgcDvCrop.cheyenne_intel.clm-monthly + ERP_P72x2_Lm25.f10_f10_musgs.I2000Clm50BgcDvCrop.cheyenne_intel.clm-monthly + + Test that uses a CLM45 initial conditions file in a CLM50 + configuration: + + ERS_D_Ln9_P480x3.f19_g16.I2000Clm50SpGs.cheyenne_intel.clm-waccmx_offline + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/ctsm/pull/523 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev019 +Originator(s): sacks (Bill Sacks) +Date: Fri Nov 30 13:36:57 MST 2018 +One-line Summary: Rework cold start initialization of wa and zwt + +Purpose of changes +------------------ + +Rework cold start initialization of wa and zwt when use_aquifer_layer is +false to reduce answer changes in upcoming groundwater_irrigation +branch. + +In the groundwater_irrigation branch +(https://github.com/ESCOMP/ctsm/pull/523), Sean Swenson has stopped +resetting wa_col each time step if use_aquifer_layer is false. However, +this leads to having a substantially different value of wa_col when +use_aquifer_layer is false: previously, it was reset to +aquifer_water_baseline each time step, but with Sean's changes, it stays +close to its initial values, which have been 4000 in most places. This +tag changes the initial values to match the value it was being reset to, +so it simply starts at aquifer_water_baseline - so the +every-time-step-resetting to aquifer_water_baseline can be removed +without massively changing the value of wa_col. + +In addition to changing the cold start initialization of wa_col, we are +also changing the cold start initialization of zwt in this case where +use_aquifer_layer is false: The old initialization of zwt wouldn't work +as intended now that we have changed the initial value of wa_col; Sean +Swenson suggested this new initialization method instead. This +initialization to zi(c,nbedrock(c)) is correct if there are no saturated +layers, and close enough for a decent cold start even if there are. + + +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.] + +[ ] clm5_0 + +[ ] clm4_5 + +[ ] clm4_0 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in ../CTSMMasterChecklist as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: Sean Swenson + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne ---- ok + hobart ------ ok + + ok means tests pass, answers change as expected for some cases + +CTSM tag used for the baseline comparisons: ctsm1.0.dev018 + + +Answer changes +-------------- + +Changes answers relative to baseline: YES (small) + + Summarize any changes to answers, i.e., + - what code configurations: CLM50 cold start or transient (Hist) cases + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + + Larger than roundoff, same climate (not investigated completely + rigorously through long simulations, but Sean Swenson and Bill + Sacks are both pretty confident that the resulting changes will be + small, partly based on difference statistics from the test suite, + and partly based on the fact that the only change in this tag is + in cold start initialization of some values). + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/ctsm/pull/577 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev018 +Originator(s): sacks (Bill Sacks) +Date: Thu Nov 29 16:03:50 MST 2018 +One-line Summary: Water tracer updates for initial things in driver loop + +Purpose of changes +------------------ + +Update water tracers for initial stuff done in driver loop. This includes +atm2lnd forcings (non-downscaled and downscaled), balance check initialization, +and dyn subgrid updates. + +Broadly speaking, the changes here are: + +(1) Reworked WaterType to make it easier / more robust for other code to loop + over tracers or bulk+tracers + +(2) The most interesting changes are probably the code to update the atm2lnd + water tracers (in Wateratm2lndType.F90 and WaterTracerUtils.F90) + +(3) In various other places, do some infrastructurey stuff (initializing water + balance, doing dyn subgrid stuff) for tracers as well as bulk + +(4) Supporting unit tests and unit test infrastructure + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +Resolves ESCOMP/ctsm#487 +Resolves ESCOMP/ctsm#488 +Resolves ESCOMP/ctsm#489 + + +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.] + +[ ] clm5_0 + +[ ] clm4_5 + +[ ] clm4_0 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in ../CTSMMasterChecklist as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): +- We have chosen not to set all water tracers as soon as possible, but instead + to do these tracer settings later in the driver loop. This keeps the driver + loop cleaner, but means that you cannot arbitrarily sprinkle calls to + TracerConsistencyCheck throughout the driver. Specifically for this tag: the + non-downscaled, gridcell-level atm2lnd water tracers are not updated until + after the call to downscale_forcings, so tracer consistency checks before that + point would fail. + +Changes to tests or testing: +- Added a PFS test + +Code reviewed by: Portions of the design (and possibly code) have been reviewed +by Mat Rothstein, David Noone and Mariana Vertenstein + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne ---- ok + hobart ------ ok + + ok means tests pass, some answers change as expected + +CTSM tag used for the baseline comparisons: ctsm1.0.dev017 + + +Answer changes +-------------- + +Changes answers relative to baseline: YES (roundoff) + + Summarize any changes to answers, i.e., + - what code configurations: many + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + roundoff-level changes in sensible heat flux from precip conversion due to + refactoring this calculation; everything else bit-for-bit + + If bitwise differences were observed, how did you show they were no worse + than roundoff? via summarize_cprnc_diffs to see differences in the test suite + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/ctsm/pull/572 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev017 +Originator(s): slevis (Samuel Levis, Slevis Consulting LLC,303-665-1310) +Date: Wed Nov 28 14:27:50 MST 2018 +One-line Summary: Merge the collapse2gencrop branch + +Purpose of changes +------------------ + +These changes allow the model to not need to read 16-pft +datasets and rather read 78-pft datasets. The 78-pft datasets were +developed for use with prognostic crops originally. The current changes +allow the model to use the 78-pft datasets in 16-pft runs by +collapsing the crop pfts (cfts) from specific types to the model's +generic crop types. The changes are generic so that the model may still +read 16-pft datasets for 16-pft runs. Ultimately these changes will +permit users to run with any number of pfts, while the ctsm group +maintains a single set of input pft data. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): Fixes #509 (partial) + #509 -- irrigate in 1850 is off for runs with use_crop but on for those without + +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.) + +[ ] clm5_0 + +[ ] clm4_5 + +[ ] clm4_0 + +Notes of particular relevance for users +--------------------------------------- + +Changes made to namelist defaults (e.g., changed parameter values): +- maxpatch_pft made obsolete +- nnegcrit was increased because of failure in the TRENDY simulations. +This was done in the source, rather than the namelist but does have an +effect on user behavior. + +Substantial timing or memory changes: No + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in ../CTSMMasterChecklist as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + + The "irrigate" attribute should now be removed from all fsurdat files for namelist generation. + Thus irrigate on or off is now an option for non-crop cases. + + +Renamed parameters: +maxpatch_pft is obsolete; remove from namelist-related scripts in future PR +numpft + 1 ---> maxsoil_patches +maxpatch_pft ---> maxsoil_patches in CNDV +numpft ---> maxveg +numpft_ed ---> maxveg_fates + +Several modules were made default private. The list of variables in them +that are public are explicitly listed now: +LakeCon.F90 +clm_initializeMod.F90 +clm_instMod.F90 +clm_varpar.F90 +pftconMod.F90 +subgridAveMod.F90 + +Changes to tests or testing: +New test +New unit tests in test_surfrdUtils.pf, all containing the prefix +test_collapse_crop_types_* + +Code reviewed by: +Erik Kluzek and Bill Sacks + +CTSM testing: +Regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- PASS + hobart_pgi -------- OK + hobart_intel ------ PASS + +CTSM tag used for the baseline comparisons: ctsm1.0.dev016 + +Answer changes +-------------- + +Changes answers relative to baseline: NO + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None + +Pull Requests that document the changes (include PR ids): #483 + +Sam Levis cloned Erik Kluzek's collapse2gencrop branch and then +tested, corrected errors, resolved conflicts, added unit tests, while +updating to newer tags as needed. + + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev016 +Originator(s): sacks (Bill Sacks) +Date: Thu Nov 1 07:27:48 MDT 2018 +One-line Summary: Update cime, fix FATES DEBUG token, add script to easily run system tests + +Purpose of changes +------------------ + +(1) Update to latest version of cime master + +(2) Update FATES with a minor change: change DEBUG to debug, to allow + working with a preprocessor-defined DEBUG token + +(3) Add a script (run_sys_tests) that allows easily running all system + tests (see + https://github.com/ESCOMP/ctsm/wiki/System-Testing-Guide#running-test-suites-with-the-run-sys-tests-wrapper + for details) + +(4) As part of (3), start work on a CTSM python library and associated + test infrastructure. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Fixes ESCOMP/ctsm#535 (Run Fortran unit tests as part of create_test) + +CIME Issues fixed (include issue #): +- Various - see CIME ChangeLog for details + + +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_0 + +[X] clm4_5 + +[X] clm4_0 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in ../CTSMMasterChecklist as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: +- New run_sys_tests wrapper +- Fortran unit tests now run as part of aux_clm + +Code reviewed by: Erik Kluzek + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne ---- ok + hobart ------ ok + + ok means tests pass, baselines fail as expected + +CTSM tag used for the baseline comparisons: ctsm1.0.dev015 + + +Answer changes +-------------- + +Changes answers relative to baseline: YES (new presaesro and CO2 datasets) + + Summarize any changes to answers, i.e., + - what code configurations: All I compsets (except spinup test that uses cplhist datm forcing) + - what platforms/compilers: All + - nature of change (roundoff; larger than roundoff/same climate; new climate): + Potentially new climate + + Changes answers for I compsets due to datm update as part of the cime + update: new presaero and CO2 datasets + (https://github.com/esmci/cime/pull/2828) + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): +- cime: cime5.7.3 -> cime5.7.5 +- fates: fates_s1.8.1_a3.0.0 -> fates_s1.8.1_a3.0.0_rev2 + +Pull Requests that document the changes (include PR ids): +- https://github.com/escomp/ctsm/pull/493 (Wrapper to system tests, and + start of a ctsm python library) + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev015 +Originator(s): sacks (Bill Sacks) +Date: Sun Oct 28 14:29:30 MDT 2018 +One-line Summary: CMIP6 compset modifiers, usermods for typical output, and other output enhancements + +Purpose of changes +------------------ + +(1) Support %BGC-CROP-CMIP6DECK and %BGC-CROP-CMIP6WACCMDECK compset + modifiers, so that we can turn on the necessary options + (output-related and others) via new CMIP6-specific compsets. + +(2) Turn on carbon isotopes in CMIP6 runs (from Erik Kluzek) + +(3) Remove setting of CCSM_BGC=CO2A in the cmip6 usermods + +(4) Add usermods directories for getting typical extra output that's + wanted in many cases: output_crop, output_crop_highfreq, output_bgc, + output_bgc_highfreq, output_sp, and output_sp_highfreq. These can be + enabled by adding something like '--user-mods-dir output_crop' on + the create_newcase line (that short-hand works for an I compset; for + F or B compsets, you need to provide the full path to the usermod + directory). + +(4) Allow holes in the number of history tapes. Holes are cases where, + for example, we have h0, h1 and h3 tapes, but no h2 tape (because + there are no fields on the h2 tape). (This is needed for (3).) + +(5) Fix reading and writing of 1-d logical global arrays. This fixes + ESCOMP/ctsm#24 for real (rather than just preventing an attempt to + read/write 1-d logical arrays, as was done in the previous 'fix'). + +(6) Add C13_NBP and C14_NBP diagnostic fields (from Keith Oleson) + +(7) Make a bunch of carbon isotope diagnostic fields inactive by default + +(8) Don't allow interpolation (use_init_interp) from a case without + carbon isotopes to a case with carbon isotopes: Due to + https://github.com/ESCOMP/ctsm/issues/67, interpolation from a case + without carbon isotopes to a case with carbon isotopes yields + incorrect initialization values for the carbon isotopes. Now that + we're turning carbon isotopes on via some semi-out-of-the-box + usermods (for cmip6), it is becoming more important to check to make + sure someone doesn't shoot themselves in the foot this way. + +(9) Add tests of the new output usermods as well as of the CMIP6 compset + modifiers + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Fixes #24 for real (ncd_io_1d_log_glob is broken) +- Fixes #529 (Organize usermods_dirs to facilitate running cases with + the right output) + + +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.] + +[ ] clm5_0 + +[ ] clm4_5 + +[ ] clm4_0 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): +- New namelist variable, just for testing purposes: + for_testing_allow_interp_non_ciso_to_ciso. This bypasses an error + check, and should only be used in tests. + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in ../CTSMMasterChecklist as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: +- Reworked tests of cmip6_deck usermods to use the new + %BGC-CROP-CMIP6DECK compset modifier, and changed f09_g16 to f09_g17 +- Added a test of the %BGC-CROP-CMIP6WACCMDECK compset modifier +- Added tests of output_crop_highfreq, output_bgc_highfreq and + output_sp_highfreq usermods directories +- Note that there are NO tests covering the cmip6_evolving_icesheet + usermods: this usermod directory adds very little beyond cmip6_deck, + so it didn't seem worth its own test + +Code reviewed by: Erik Kluzek + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + unit-tests (components/clm/src): + + cheyenne - pass + + tools-tests (components/clm/test/tools): + + cheyenne - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne_intel ---- pass + cheyenne_gnu ------ pass + hobart_nag -------- pass + hobart_pgi -------- pass + hobart_intel ------ pass + + ERI_D_Ld9.T31_g37.I2000Clm50Sp.cheyenne_intel.clm-SNICARFRC + initially failed COMPARE_base_hybrid, COMPARE_base_rest and BASELINE + comparisons. I reran it and it passed. + + Manually compared all history files from + ERS_Ly3.f10_f10_musgs.I1850Clm50BgcCropCmip6.cheyenne_intel.clm-basic + with baseline + ERS_Ly3.f10_f10_musgs.I1850Clm50BgcCrop.cheyenne_intel.clm-cmip6. They + were all identical. Also compared all history files from + SMS_Ld5_D.f09_g17.I1850Clm50BgcCropCmip6.cheyenne_intel.clm-basic + with baseline + SMS_Ld5_D.f09_g17.I1850Clm50BgcCrop.cheyenne_intel.clm-cmip6. They + were all identical (but note that this basically just compared the + cpl.hi file: the test was too short to produce monthly files.) + +CTSM tag used for the baseline comparisons: ctsm1.0.dev014 + + +Answer changes +-------------- + +Changes answers relative to baseline: NO + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +- https://github.com/ESCOMP/ctsm/pull/536 - Allow holes in the number of + history tapes and reorganize cmip6 usermods (main PR containing all of + these changes) +- https://github.com/ESCOMP/ctsm/pull/527 - Add carbon_isotope user-mod + directory to turn on c13 and c14 +- https://github.com/ESCOMP/ctsm/pull/539 - Support a %CMIP6DECK compset + modifier + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev014 +Originator(s): sacks (Bill Sacks) +Date: Fri Oct 26 06:20:34 MDT 2018 +One-line Summary: Miscellaneous minor, bit-for-bit bug fixes + +Purpose of changes +------------------ + +Four miscellaneous minor, bit-for-bit bug fixes: + +(1) Py3 pylint check and address cime issue ESMCI/cime#2822 (from Jim + Edwards: ESCOMP/ctsm#526) + +(2) Change uppercase DEBUG variables to lowercase debug (requested by + Jim Edwards to avoid conflicting with the DEBUG CPP token) + (Fixes ESCOMP/ctsm#534) + +(3) Remove unnecessary line of code in LunaMod.F90 that was causing + problems with some compilers due to an uninitialized variable + (Fixes ESCOMP/ctsm#322) + +(4) Add r8 to 0 constant to fix build issue with XLF compiler (from Jim + Edwards: ESCOMP/ctsm#531) + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Fixes ESCOMP/ctsm#322 (ERS_D_Ld5.f19_g16.I2000Clm50BgcCruGs run FAIL (intel)) +- Fixes ESCOMP/ctsm#534 (Rename DEBUG to debug in a few places) + + +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.] + +[ ] clm5_0 + +[ ] clm4_5 + +[ ] clm4_0 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in ../CTSMMasterChecklist as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + +Changes to tests or testing: none + +Code reviewed by: different pieces reviewed by different people + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + unit-tests (components/clm/src): + + cheyenne - pass + + tools-tests (components/clm/test/tools): + + cheyenne - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne_intel ---- ok + cheyenne_gnu ------ ok + hobart_nag -------- ok + hobart_pgi -------- ok + hobart_intel ------ ok + + ok means tests and baseline comparisons pass. There were unexpected + NLCOMP diffs. From spot-checking a few tests, I see the following: + + + (1) On both cheyenne and hobart: Diffs in logfile. This looks like a + problem in cime: it says: + + BASE: logfile = 'rof.log.136342.hobart.cgd.ucar.edu + COMP: logfile = 'rof.log + + (2) On hobart: Diffs in pio_typename: netcdf vs. pnetcdf (says that + new uses pnetcdf): but when I compare files by hand, they look + the same in this respect (both baseline and new use netcdf), so + maybe this is due to a problem in the timing of when nlcomp is + run? + + Since these both look like problems in the comparison script rather + than in the tag, I'm letting these go, but will open a cime issue if + we see this again. + + +CTSM tag used for the baseline comparisons: ctsm1.0.dev013 + + +Answer changes +-------------- + +Changes answers relative to baseline: NO + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +- https://github.com/ESCOMP/ctsm/pull/531 (fix build issue with xlf compiler) +- https://github.com/ESCOMP/ctsm/pull/526 (fix cime issue 2822 and pylint chk) + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev013 +Originator(s): erik (Erik Kluzek)/slevisconsulting +Date: Thu Oct 25 18:09:47 MDT 2018 +One-line Summary: Fix the fact that transient Bgc and SP cases had constant crop area in time + +Purpose of changes +------------------ + +Fix transient non-crop cases that had constant crop area so that crop area will change in time +(and hence natural veg area will also change corresponding to it). + +Also bring in changes to update mksurfdata_map to handle SSP-RCP future scenarios. Right now +it can handle SSP5-8.5 out of the box. Also add a new test for that. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): #538 + #538 -- In transient pft simulations with use_crop=.false., %crop does not advance from 1850 values + +Known bugs found since the previous tag (include github issue ID): #545 + #545 -- Antarctica ice shelves are being treated as wetlands rather than glaciers + + +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_0 + +[X] clm4_5 + +[ ] clm4_0 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): A few more namelist checks + Added a check to make sure do_transient_pfts was the same as do_transient_crops + Don't allow use_fertilizer for non-crop case + namelist checks that create_crop_landunit=T except for FATES + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): + New -ssp_rcp option to mksurfdata.pl + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): New mksrfpft datasets in XML for SSP5-8.5 + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in ../CTSMMasterChecklist as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + Now, do_transient_pfts and do_transient_crops only work in unison, and hence + should be simplified to one logical called do_transient_veg + +Changes to tests or testing: Add new SSP5-8.5 mksurf test + +Code reviewed by: self, slevisconsulting, billsacks + +CTSM testing: regular, tools + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS (18 of the transient test namelists are different to baseline as expected) + + unit-tests (components/clm/src): + + cheyenne - PASS + + tools-tests (components/clm/test/tools): + + cheyenne - OK (PTCLM tests fail) + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + +CTSM tag used for the baseline comparisons: ctsm1.0.dev012 + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes! (Important) + + Summarize any changes to answers, i.e., + - what code configurations: clm4_5/clm5_0 transient simulations without Crop (either Bgc or SP) + - what platforms/compilers: All + - nature of change: crop areas increase in time and impact simulations + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + - casename: dll/clm50_r267_1deg_GSWP3V1_iso_hist_nocrop_transientfix + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None + +Pull Requests that document the changes (include PR ids): #546, #540 +(https://github.com/ESCOMP/ctsm/pull) + + #546 -- Add in ability for mksurfdata_map to handle ssp_rcp scenarios and specifically SSP5-8.5 + $540 -- Transient PFT issue + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev012 +Originator(s): erik (Erik Kluzek) +Date: Sat Sep 29 11:49:35 MDT 2018 +One-line Summary: Add snow-free fields for snowmip, fix several issues + +Purpose of changes +------------------ + +Bring in new diagnostic fields added by Justin Perket, Sean Swenson and Mark Flanner +for Snow-MIP. Most of those are fields that represent "Snow Free" data. + +Also bring in fixes for a list of issues. Add handling of the new CO2 which includes +both latitude-band and global average versions. Add some changes to make it easier +for input data processing including NOT doing the slow 1km map file creation. Have +the number of steps that are skipped at startup dependent on the time-step size. Add +a test for some requirements of WACCMX (time-step and use of ESMF). Calculations of +local time are now done in a global subroutine, that can handle negative longitudes. +Fix how FFIX_TO_SMINN is handled for history output. The namelist logical "calc_human_stress_indices" +changed from logical to a character string of three values: FAST, NONE, ALL. FAST +is the default so the less expensive ones are output, NONE turns them all off, and ] +ALL does all of them including the expensive ones. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): #428, #474, #475, #476, #450, #482, #481, #491 + Fix #428 -- Update getco2_historical.ncl to handle latitude varying CO2 + Fix #474 -- Add ability to send GRIDFILE to regridbatch.sh script + Fix #475 -- Have number of steps to skip balance-check based on time + Fix #476 -- Add a test for WACCMX standalone + Fix #450 -- Add option to use global average of terrain standard deviation on surfdata files + (partial fix with simplest option) + Fix #482 -- Add extra field on CO2 streams file for global/time-averaged data + Fix #481 -- FFIX_TO_SMINN needs to be output when FUN is on + Fix #491 -- Calculations of local noon assume that longitude is 0 to 360 rather than -180 to 180 + +Known bugs introduced in this tag (include github issue ID): cime#2801 + cime#2801 -- Problem building with ESMF_LIB + +Known bugs found since the previous tag (include github issue ID): #507, #505 + #507 -- Albedo's are bad at night with negative longitudes + #505 -- CTSM input data-set tools can only work on 0-360 grids, and require monotone increasing longitude + + +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.] + +[ ] clm5_0 + +[ ] clm4_5 + +[ ] clm4_0 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): + + New namelist: + use_ssre -- Turn on show free fields needed for SnowMIP + + Changed namelist: + calc_human_stress_indices changed from logical to character with options: ALL, FAST, NONE + + New history fields: + Mostly added Snow Free (SF) fields + ALBDSF + ALBISF + FSRSF + FSRSFND + FSRSFNDLN + FSRSFNI + FSRSFVD + FSRSFVDLN + FSRSFVI + SSRE_FSR + SSRE_FSRND + SSRE_FSRNDLN + SSRE_FSRNI + SSRE_FSRVD + SSRE_FSRVDLN + SSRE_FSRVI + +Changes made to namelist defaults (e.g., changed parameter values): + calc_human_stress_indices = 'FAST' is now the default + +Changes to the datasets (e.g., parameter, surface or initial files): + mkghg_bndtvghg -- Update with new CO2 files, both monthly, lat-bands and yearly, global + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in .CTSMTrunkChecklist as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + I was able to reduce the duplication in SurfaceAlbedoMod where the original implementation added a cut + and paste copy of code. But, there is still a lot of duplication in this file that could be improved, by + making smaller functions/subroutines to do sections of code that are essentially repeated many times. + There's a bit of an increase in complexity to reduce the duplication, but reducing the duplication was worth it. + +Changes to tests or testing: + Add a new waccmx_offline test mods and test with it + New test expected fail because of cime issue: ERS_D_Ln9_P480x3.f19_g16.I2000Clm50SpGs.cheyenne_intel.clm-waccmx_offline + Turn use_ssre on for most tests, off for reducedOutput + And set calc_human_stress_indices=NONE for reducedOutput, FAST for most, and ALL for KitchenSink and KSMOut tests + +Code reviewed by: self, @olyson, @billsacks + + +CTSM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + +CTSM tag used for the baseline comparisons: ctsm1.0.dev011 + + +Answer changes +-------------- + +Changes answers relative to baseline: no bit-for-bit + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): No + +Pull Requests that document the changes (include PR ids): #462 #449 +(https://github.com/ESCOMP/ctsm/pull) + + #462 -- Add namelist item to calculate all heat stress indices only if requested; to speed up model + #449 -- Bring in snowmip diagnostic fields + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev011 +Originator(s): sacks (Bill Sacks), mvr (Mathew Rothstein) +Date: Wed Sep 12 10:50:31 MDT 2018 +One-line Summary: Add water tracer consistency checks, and other water tracer work + +Purpose of changes +------------------ + +1. Add water tracer consistency checks + +2. Add infrastructure for looping over all water tracers - currently + just used for the tracer consistency checks + +3. Breakout of atm2lnd and lnd2atm water variables, needed for water tracers + +4. Add some namelist control over the addition of water tracers + +5. Add a system test that exercises the water tracer consistency checks + +6. Add a 'ratio' variable for each water tracer + +7. Add some unit tests of the new water tracer infrastructure + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Partially addresses #357 +- Resolves #479 +- Resolves #492 + +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.] + +[ ] clm5_0 + +[ ] clm4_5 + +[ ] clm4_0 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): +- Don't be fooled by the new namelist variable, enable_water_isotopes: + This is just a place-holder for now, not implying that water isotopes + are actually working. + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): +- New namelist variables: enable_water_tracer_consistency_checks and + enable_water_isotopes. The latter is just a place-holder for now. + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in .CTSMTrunkChecklist as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: New test that runs the water tracer consistency check + I ran this test on cheyenne_gnu and cheyenne_intel along with the + out-of-the-box hobart_nag version + +Code reviewed by: Mat Rothstein and I have worked together on many of +these changes, but not all code has been reviewed by the other. + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - ok (tests pass, clm4_5 and clm5_0 namelists differ from + baseline as expected) + + unit-tests (components/clm/src): + + cheyenne - pass + + tools-tests (components/clm/test/tools): + + cheyenne - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne_intel ---- pass + cheyenne_gnu ------ pass + hobart_nag -------- pass + hobart_pgi -------- pass + hobart_intel ------ pass + +CTSM tag used for the baseline comparisons: ctsm1.0.dev010 + + +Answer changes +-------------- + +Changes answers relative to baseline: NO + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +- https://github.com/ESCOMP/ctsm/pull/497 + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev010 +Originator(s): sacks (Bill Sacks) +Date: Thu Aug 30 17:14:28 MDT 2018 +One-line Summary: Update cime to cime5.7.3 + +Purpose of changes +------------------ + +Update cime from cime5.6.10 to cime5.7.3. To support this change, there +are also minor code changes related to the pause-resume implementation +(from Erik Kluzek). + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- ESCOMP/ctsm#384 (VIC test is failing at f09 resolution with signal) + (I'm not sure what fixed this, but it's passing now) + +CIME Issues fixed (include issue #): many + + +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.] + +[ ] clm5_0 + +[ ] clm4_5 + +[ ] clm4_0 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in .CTSMTrunkChecklist as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: self + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + unit-tests (components/clm/src): + + cheyenne - pass + + tools-tests (components/clm/test/tools): + + cheyenne - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne_intel ---- pass + cheyenne_gnu ------ pass + hobart_nag -------- pass + hobart_pgi -------- pass + hobart_intel ------ pass + +CTSM tag used for the baseline comparisons: ctsm1.0.dev009 + + +Answer changes +-------------- + +Changes answers relative to baseline: NO - bit-for-bit + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): +cime: cime5.6.10 -> cime5.7.3 + +Pull Requests that document the changes (include PR ids): none + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev009 +Originator(s): sacks (Bill Sacks) +Date: Wed Aug 22 20:32:36 MDT 2018 +One-line Summary: Fix initialization of AnnET in InitAccVars + +Purpose of changes +------------------ + +InitAccVars was mistakenly setting qflx_evap_tot_col rather than +AnnET. This fix allows us to remove now-redundant cold start and restart +code for AnnET. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Fixes #480 +- Partially addresses #285 + + +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.] + +[ ] clm5_0 + +[ ] clm4_5 + +[ ] clm4_0 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in .CTSMTrunkChecklist as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: basic proposed changes reviewed by Erik Kluzek + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + unit-tests (components/clm/src): + + cheyenne - pass + + tools-tests (components/clm/test/tools): + + cheyenne - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne_intel ---- pass + cheyenne_gnu ------ pass + hobart_nag -------- pass + hobart_pgi -------- pass + hobart_intel ------ pass + +CTSM tag used for the baseline comparisons: ctsm1.0.dev008 + + +Answer changes +-------------- + +Changes answers relative to baseline: NO + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): none + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev008 +Originator(s): erik (Erik Kluzek) +Date: Tue Aug 14 10:25:12 MDT 2018 +One-line Summary: Update 1850 ndep file and last year for streams for Historical transient cases + +Purpose of changes +------------------ + +Bring in changes from release-clm5.0.05. Update to latest Nitrogen Deposition file from simulations with WACCM for 1850. +Also fix an issue with the last year for historical transient cases. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): 461 + #461 -- increase last year in streams for transient + +Known bugs found since the previous tag (include github issue ID): [If none, remove this line] + #478 -- Bare soil g1 should be missing value or zero + + +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.] + +[ ] clm5_0 + +[ ] clm4_5 + +[ ] clm4_0 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): None + +Changes made to namelist defaults (e.g., changed parameter values): Last year extended for transient datasets + +Changes to the datasets (e.g., parameter, surface or initial files): New ndep dataset for 1850 + +Substantial timing or memory changes: + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in .CTSMTrunkChecklist as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): None + +Changes to tests or testing: Lengthen some tests + +Code reviewed by: self + + +CTSM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS (11 show differences for 1850_control and 20thC_transient) + + unit-tests (components/clm/src): + + cheyenne - PASS + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + +CTSM tag used for the baseline comparisons: ctsm1.0.dev007 + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes! (ndep files, and steams years) + + Summarize any changes to answers, i.e., + - what code configurations: 1850_control or 20thC_transient for Clm50 + - what platforms/compilers: all + - nature of change: similar climate + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + + #477 -- Move changes from release-clm5.0.05 onto master + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev007 +Originator(s): sacks (Bill Sacks) +Date: Sun Aug 5 21:03:28 MDT 2018 +One-line Summary: Avoid glacier dynamic landunit adjustments in first time step + +Purpose of changes +------------------ + +Always avoid generating dynamic landunit adjustments for glacier area +changes in the first timestep of a startup or hybrid run - not just for +cold start or interpolated start. See the detailed discussion in +https://github.com/ESCOMP/ctsm/issues/340 for rationale. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Fixes #340 (Avoid generating dynamic landunit adjustment fluxes for + glacier changes in the first timestep) + + +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.] + +[ ] clm5_0 + +[ ] clm4_5 + +[ ] clm4_0 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in .CTSMTrunkChecklist as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: Erik Kluzek + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + unit-tests (components/clm/src): + + cheyenne - not run + + tools-tests (components/clm/test/tools): + + cheyenne - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne_intel ---- ok + cheyenne_gnu ------ pass + hobart_nag -------- pass + hobart_pgi -------- pass + hobart_intel ------ pass + + ok means tests pass; baseline failures as expected in these two + tests that do not use init_interp: + + FAIL ERI_N2_Ld9.f19_g17.I2000Clm50BgcCrop.cheyenne_intel.clm-default BASELINE ctsm1.0.dev006 + FAIL SMS_Lm13.f19_g17.I2000Clm50BgcCrop.cheyenne_intel.clm-cropMonthOutput BASELINE ctsm1.0.dev006 + + (The glacier area on the finidat file used in these tests - + clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c180715.nc + - seems to have come from an finidat_interp_dest file, and thus does + not match the glacier area from CISM.) + +CTSM tag used for the baseline comparisons: ctsm1.0.dev006 + + +Answer changes +-------------- + +Changes answers relative to baseline: YES (small) + + Summarize any changes to answers, i.e., + - what code configurations: Startup / Hybrid runs that include CISM + (even NOEVOLVE) and do not use init_interp, due to: + - different PE layout in new case vs. the one that generated the + finidat (roundoff-level diffs) + - different glacier area on finidat file vs. what's in CISM + (greater than roundoff-level diffs) + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + Roundoff-level for different PE layout, larger than roundoff but + should be same climate when there is different glacier area on the + finidat file vs. what's in CISM + + The differences arise from dynamic landunit adjustments of the + below-ground C and N states in the old code, as CTSM adjusts its + areas to match CISM's. In the new code, there are no C and N + adjustments in the first time step from this adjustment. + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +- #470 (Avoid glacier dynamic landunit adjustments in first time step) + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev006 +Originator(s): sacks (Bill Sacks) +Date: Sat Aug 4 07:48:09 MDT 2018 +One-line Summary: Minor bug fixes, cleanup, documentation and enhancements + +Purpose of changes +------------------ + +A collection of minor bug fixes, code cleanup, documentation and +enhancements, all bit-for-bit. See list of issues fixed below for +details. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Fixes #24 (ncd_io_1d_log_glob is broken) +- Fixes #120 (Incorrect comments in Biogeophysics1Mod.F90 +- Fixes #217 (Change some cheyenne_gnu tests to cheyenne_intel) +- Fixes #245 (Put all .gitignore entries in top-level file) +- Fixes #272 (Code should error on missing mxsoil_color when SOIL_COLOR + is used) +- Fixes #283 (Add more helpful message about need to do init_interp with + wrong number of vertical layers) +- Fixes #367 (For cmip6 runs: Turn on cpl hist output needed to drive a + TG compset) +- Fixes #412 (Fix documentation of init_interp_method) +- Fixes #419 (Do not allow SOYFIXN diagnostic field with FUN) +- Fixes #464 (Some lines longer than 132 characters) +- Fixes #465 (Remove backwards compatibility check for snw_rds) +- Fixes #467 (Increase wallclock limit for test) + + +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.] + +[ ] clm5_0 + +[ ] clm4_5 + +[ ] clm4_0 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in .CTSMTrunkChecklist as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: +- Changed a single-point test from gnu to intel to get better debugging + information + (SMS_D_Ly6_Mmpi-serial.1x1_smallvilleIA.IHistClm45BgcCropQianGs.cheyenne_intel.clm-cropMonthOutput) +- For some single-point tests on both gnu and intel: removed one + compiler, keeping the tests on just one + +Code reviewed by: self + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + unit-tests (components/clm/src): + + cheyenne - pass + + tools-tests (components/clm/test/tools): + + cheyenne - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne_intel ---- pass + cheyenne_gnu ------ pass + hobart_nag -------- pass + hobart_pgi -------- pass + hobart_intel ------ pass + + NLCOMP failures as expected for tests with the cmip6 test mod + + Some long single-point gnu tests failed due to running out of + wallclock time; I have removed these, just keeping them on intel + (along with removing a few other tests after I ran the testing - see + commit 5c226bdf): + + FAIL ERS_Lm54_Mmpi-serial.1x1_numaIA.I2000Clm50BgcCropGs.cheyenne_gnu.clm-cropMonthOutput RUN time=4803 + FAIL ERS_Ly6_Mmpi-serial.1x1_smallvilleIA.IHistClm50BgcCropGs.cheyenne_gnu.clm-cropMonthOutput RUN time=6024 + + +CTSM tag used for the baseline comparisons: ctsm1.0.dev005 + + +Answer changes +-------------- + +Changes answers relative to baseline: NO - bit-for-bit + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +- #392 (Remove old code for snw_rds restart that looks no longer needed) +- (Other changes not documented in PRs) + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev005 +Originator(s): sacks (Bill Sacks), mvr (Mathew Rothstein) +Date: Fri Aug 3 07:54:59 MDT 2018 +One-line Summary: Rework water data types to accommodate isotopes and other tracers + +Purpose of changes +------------------ + +This tag reworks the various water data types to allow having multiple +instances of variables that are needed for isotopes and other water +tracers. + +Specific changes include: + +(1) Separated "water state" variables into state, diagnostic and balance + check-related variables. This separation was not essential for the + work here, but was desired by Martyn Clark and others. + +(2) For each of water state, diagnostic and flux variables, separated + variables into those needed for both bulk and tracers vs. those only + needed for bulk. This way, we can have multiple instances of the + variables needed by tracers, but only a single instance of variables + that only apply to bulk water. This follows the design laid out in + https://github.com/escomp/ctsm/pull/395. The separation was based + largely on what was done in the old water isotope branch; we didn't + put a lot of thought into this, because the new design allows us to + easily migrate variables between bulk-only and bulk-and-tracer as + needed. + +(3) Moved water fluxes that were defined in science modules back into + waterflux_type or waterfluxbulk_type. This was needed for (2); there + is more discussion on this in + https://github.com/escomp/ctsm/pull/395 and the log message for + commit 711e5cd7. + +(4) Introduced a top-level water_type that holds instances of all of the + other water-related objects. This follows the design laid out in + https://github.com/escomp/ctsm/pull/395. This is particularly + valuable for the tracer instances: the logic related to number of + tracers can be encapsulated in water_type, rather than infiltrating + clm_instMod. + +(5) Added placeholders for water tracer instances + +(6) Added infrastructure to generate history / restart field names for + the tracer instances. Eventually, the isotope class can also hold + information specific to each isotope. + +This work was a joint effort between Mathew Rothstein and myself; Mat +gets much of the credit for the actual refactoring done here. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Fixes #358 (Separate WaterStateType into multiple types) +- Fixes #434 (Separate WaterFluxType into a base class and a class that just applies to bulk) +- Fixes #359 (Set up infrastructure for multiple instances of WaterState and WaterFlux types) +- Fixes #458 (Implement handling of history and restart variables for water tracers) + +Known bugs introduced in this tag (include github issue ID): +- #464 (Some lines longer than 132 characters) +- #456 (Remove backwards compatibility check for snw_rds) (not a + newly-introduced issue, but it's more important to fix this with the + separation of waterstate_type) + +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.] + +[ ] clm5_0 + +[ ] clm4_5 + +[ ] clm4_0 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in .CTSMTrunkChecklist as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): +- Water tracers are not yet functional - they are just placeholders +- Whether to use water tracers and which water tracers to use are + currently hard-coded; eventually, this should be namelist-controlled + +Changes to tests or testing: none + +Code reviewed by: Mathew Rothstein and Bill Sacks worked together on +these changes and reviewed each other's changes to some extent. The +high-level design was also reviewed and co-developed by Mariana +Vertenstein. Martyn Clark contributed substantially to the breakout of +water state into state, diagnostic and balance check-related variables. + + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + unit-tests (components/clm/src): + + cheyenne - pass + + tools-tests (components/clm/test/tools): + + cheyenne - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne_intel ---- pass + cheyenne_gnu ------ pass + hobart_nag -------- pass + hobart_pgi -------- pass + hobart_intel ------ pass + +CTSM tag used for the baseline comparisons: ctsm1.0.dev004 + + +Answer changes +-------------- + +Changes answers relative to baseline: NO - bit-for-bit + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +- https://github.com/escomp/ctsm/pull/395 (documents the high-level design) + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev004 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Wed Jul 18 02:10:23 MDT 2018 +One-line Summary: Add some new diagnostic fields, fix a few issues, update cmip6 output + +Purpose of changes +------------------ + +Add some new diagnostic fields. Some needed for CMIP6. Update the CMIP6 user-mods output. +Fix a couple issues. Get full list of history tapes working correctly. Check for valid range +of CO2. New IC file interpolated from the previous one for f19_g17_gl4 for 2000 Clm50BgcCrop. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): $210, #427, #429 + #210 -- increase number of history tapes + $427 -- Check for zero CO2 + #429 -- New IC for present day + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? No +(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.] + +[ ] clm5_0 + +[ ] clm4_5 + +[ ] clm4_0 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): New history fields + TSKIN --- skin temperature + TSL ----- temperature of near-surface soil layer + GSSUNLN - sunlit leaf stomatal conductance at local noon + GSSHALN - shaded leaf stomatal conductance at local noon + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): New finidat file f19_g17_gl4 2000 Clm50BgcCrop + New file is just interpolate from the previous file to a f19_g17_gl4 gridfor Clm50BgcCrop and 2000 simulation year + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in .CLMTrunkChecklist as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + +Changes to tests or testing: None + +Code reviewed by: self, oleson, abtawfik + + +CTSM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - OK (95 are different because of finidat file change) + + unit-tests (components/clm/src): + + cheyenne - PASS + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- PASS + hobart_pgi -------- FAIL + hobart_intel ------ PASS + +CTSM tag used for the baseline comparisons: ctsm1.0.dev003 + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes -- only 2000 cases because of new IC + + Summarize any changes to answers, i.e., + - what code configurations: Just 2000 cases + - what platforms/compilers: All + - nature of change: same climate + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + + + #338 -- Radtemp and other new diagnostic fields + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev003 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Sun Jul 15 00:26:46 MDT 2018 +One-line Summary: Update cime/cism to work on upgraded hobart and with glade changes on cheyenne + +Purpose of changes +------------------ + +Update cime and cism so can work on upgraded hobart. Also fix an issue that the Nag6.2 compiler found +in CTSM. Also get working with glade changes that happened on cheyenne, DIN_LOC_ROOT_CLMFORC was +changed to a new directory. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): [If none, remove this line] + #441 -- Changes in glade invalidate previous softlinks and data locations + #438 -- Illegal argument aliasing caught by nag6.2 + #433 -- with hobart upgrade CTSM not working + +Known bugs introduced in this tag (include github issue ID): + #444 -- PGI fails on cheyenne and hobart + +Known bugs found since the previous tag (include github issue ID): + #443 -- Wood C:N ratios + #440 -- leafcn_max < target leafcn? + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? No +(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.] + +[ ] clm5_0 + +[ ] clm4_5 + +[ ] clm4_0 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): DIN_LOC_ROOT_CLMFORC on cheyenne + DIN_LOC_ROOT_CLMFORC was change on cheyenne + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): None + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in .CTSMTrunkChecklist as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): None + +Changes to tests or testing: path for cheyenne specific test had to be changed + Add some gnu tests on hobart + Lengthen wallclock on a test + Fix path for DA test_mod + +Code reviewed by: self + +CLM testing: regular + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + + tools-tests (components/clm/test/tools): + + cheyenne - PASS + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - OK + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- FAIL + hobart_gnu -------- PASS + hobart_intel ------ PASS + +CLM tag used for the baseline comparisons: ctsm1.0.dev002 + + +Answer changes +-------------- + +Changes answers relative to baseline: No bit-for-bit + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cime, cism + cism-wrapper to release-cesm2.0.04 + cime to cime5.6.10 + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + #444 -- Get working on upgraded hobart and with glade changes on cheyenne + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev002 +Originator(s): erik (Erik Kluzek) +Date: Fri Jul 6 16:33:03 MDT 2018 +One-line Summary: Fix NFIX flux variables so special land-units are zeroed out, tools update, add some *_MAX fields on mksurfdata_map for transient cases + +Purpose of changes +------------------ + +Nitrogen Fixation flux arrays were being set to missing value over non-vegetated landunits. This sets them to zero everywhere +and averages in the zero's at the gridcell level for history output. It also reads in restarts with missing values and converts +them to zero's. + +There are also some tools updates, getting the tools working on the new upgraded hobart.cgd.ucar.edu. + +And mksurfdata_map is updated to add some *_MAX files on the landuse.timeseries files that will allow us to conserve memory +for transient cases. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): #435, #436, #433 (for tools) + #435 -- intel build for tools + #426 -- Nitrogen Fixation flux variables + #433 -- hobart broken, got it working for tools + +Known bugs found since the previous tag (include github issue ID): #433, #431 + + #433 -- with hobart upgrade, hobart build isn't working + #431 -- When set_* options are used to hist_addfld be careful of ordering + +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_0 + +[ ] clm4_5 + +[ ] clm4_0 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None + +Changes made to namelist defaults (e.g., changed parameter values): ndep file updated for clm5_0 for 1850 + +Changes to the datasets (e.g., parameter, surface or initial files): None + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in .CLMTrunkChecklist as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): NFIX flux variables + NFIX flux variables when read from restart have special-values (missing on non veg landunits) converted to zero's + They are now initialized to zero everywhere. + +Changes to tests or testing: None + +Code reviewed by: self, wwieder, and lawrence, sacks (mksurfdata_map code) + +CLM testing: regular (although none on hobart!) + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS (5 tests differ from previous version) + + unit-tests (components/clm/src): + + cheyenne - PASS + + tools-tests (components/clm/test/tools): + + cheyenne - PASS + hobart --- PASS + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + +CLM tag used for the baseline comparisons: ctsm1.0.dev001 + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes, clm5_0 BGC configurations with FUN and clm5_0 with BGC for new 1850 ndep file + + Summarize any changes to answers, i.e., + - what code configurations: All clm5_0 BGC due to NFIX fields, and clm5_0 1850 BGC due to new ndep file + - what platforms/compilers: All + - nature of change: similar climate + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + + #437 -- ChangeLog template + #432 -- nfix + #331 -- _MAX fields on mksurfdata_map + +=============================================================== +=============================================================== +Tag name: ctsm1.0.dev001 +Originator(s): sacks (Bill Sacks) +Date: Fri Jun 22 07:31:43 MDT 2018 +One-line Summary: Begin separating SoilHydrology flux calculations + +Note the new tag naming: Starting with this tag, we are naming tags +"ctsm..." rather than "clm...". We are starting with ctsm version 1, +which for now is nearly the same as clm version 5. We are moving to this +new tag naming now because: + +(1) The changes in this tag represent the first step towards + implementing the CTSM vision (separating the biogeophysics flux + calculations from state updates, making it easier to plug in + alternative parameterizations, etc.). + +(2) This tag changes answers relative to the CLM5 release. (We expect + the climate to be the same, but we haven't tested this carefully + yet.) + +Purpose of changes +------------------ + +First steps toward separating various flux calculations in the soil +hydrology code. The focus here is on saturated surface runoff and +infiltration excess runoff. The changes here separate flux calculations +from state updates and extract various calculations into their own +subroutines to facilitate swapping in alternative parameterizations. + +Most of the changes here are refactorings that are either bit-for-bit or +just introduce roundoff-level differences. However, there are also a few +larger answer changes, as described below. + +These are the greater-than-roundoff-level answer changes: + +(A1) Use full qflx_surf in BGC code. Previously, the subroutines ch4 and + SoilBiogeochemNLeaching had been using a flux that excluded surface + water runoff (qflx_h2osfc_surf). That was deemed to be incorrect + (by Dave Lawrence and others), so these BGC subroutines have been + changed to use the full surface runoff (saturated excess runoff + + infiltration excess runoff + h2osfc runoff). + + Configurations affected: BGC compsets + + Magnitude of change: Larger than roundoff; expected to be same + climate, but not investigated carefully + +(A2) VIC: Don't ever use the TOPModel formulation for SurfaceRunoff + + The code was using the TOPModel-based formulation for SurfaceRunoff + if frost_table > zwt_perched. Sean Swenson felt this shouldn't be + done, and refactoring will be easier if VIC always uses the + vic-looking formulation, so I'm stopping applying this formulation + when using VIC. + + Configurations affected: VIC compsets + + Magnitude of change: Larger than roundoff; not investigated carefully + +(A3) VIC: Remove infiltration excess runoff + + Martyn Clark reviewed the VIC implementation, and felt that the + current implementation of infiltration excess runoff is + inconsistent with the standard VIC implementation. It appears that + what was being called VIC's infiltration excess runoff was actually + just an attempt to give a better numerical approximation to the + solution for saturated surface excess runoff. So deleting this + leaves only a first-order approximation to VIC's saturated surface + excess runoff. + + Eventually we may want to put in place a more accurate solution for + VIC's saturated surface excess runoff. But Martyn's feeling is that + this can come in with other changes we want to make regarding + numerical solutions in CTSM. + + Configurations affected: VIC compsets + + Magnitude of change: Larger than roundoff; expected to be same + climate, but not investigated carefully + +(A4) Change in QOVER diagnostic field: now includes QH2OSFC. + +These are the major refactorings (either bit-for-bit or just +roundoff-level differences): + +(R1) Extract surface runoff to its own module, and other modularization + related to what used to be subroutine SurfaceRunoff: extract a + subroutine for each fsat method, move urban surface runoff code + into different routines. + +(R2) Extract infiltration excess runoff to its own module, and other + modularization related to what used to be subroutine Infiltration. + +NOTE: For a detailed breakdown of changes, including documentation of +which changed changed answers, see the file ChangeLog_branch which was +deleted from this branch shortly before it was merged to master. + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Fixes #424 (decStart testmod is missing an `--append` in an xmlchange command) + + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): + +Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): + +Changes made to namelist defaults (e.g., changed parameter values): + +Changes to the datasets (e.g., parameter, surface or initial files): + +Substantial timing or memory changes: + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in .CLMTrunkChecklist as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + +Changes to tests or testing: +- Shortened a 25-month f19 test to 13-months + (SMS_Lm13.f19_g17.I2000Clm50BgcCrop.cheyenne_intel.clm-cropMonthOutput): + This test took a long time to run, and we already have long tests of + this configuration at coarse-resolution. I suggested removing this + test entirely, but Erik Kluzek wanted to maintain a shortened version + of it. Erik's comments were: + + How about either flip it to f45 (because Rosie is using that + resolution for science) -- or leave it at f19 and have it run for 9 + months? The 25 months was to take it just past the 2-year spinup + time. From spunup initial conditions 9-months pretty much does a + full harvest cycle. f19 and f09 are the main configurations for + science and it would be good to have something longer than just + really short tests. + + I decided on Lm13, because this still completes in significantly less + than 2-hours, and if we're running for 9 months anyway, it seems + valuable to finish out the year and run a bit into the next year, + since some crop stuff triggers at the end of the year. + +Code reviewed by: Various code reviews done last Fall, when these +changes were first implemented. + +CLM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + unit-tests (components/clm/src): + + cheyenne - PASS + + tools-tests (components/clm/test/tools): + + cheyenne - not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + + OK means tests pass, answers change as expected. + +CLM tag used for the baseline comparisons: clm5.0.dev013 + + +Answer changes +-------------- + +Changes answers relative to baseline: YES (roundoff) + + Summarize any changes to answers, i.e., + - what code configurations: Essentially all (except CLM4) + - what platforms/compilers: All + - nature of change (roundoff; larger than roundoff/same climate; new climate): + + Roundoff-level changes for nearly all configurations (except CLM4). + + Greater-than-roundoff-level changes for the following + configurations: + - BGC: see (A1) note above (expected to be same climate, but not + investigated carefully) + - VIC: see (A2) and (A3) notes above (magnitude of change not + investigated carefully) + - QOVER diagnostic field: see (A4) note above + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +- https://github.com/ESCOMP/ctsm/pull/244 +- https://github.com/ESCOMP/ctsm/pull/190 +- Other PRs that existed on the old NCAR/clm-ctsm repository (which has + been deleted), which were not migrated to the new repository + +=============================================================== diff --git a/doc/source/conf.py b/doc/source/conf.py index 540abade16..bee524164a 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -65,6 +65,16 @@ version = u'CTSM1' # The full version, including alpha/beta/rc tags. release = u'CTSM master' +# CTSM-specific: version label used at the top of some pages. +version_label = 'the latest development code' + +# version_label is not a standard sphinx variable, so we need some custom rst to allow +# pages to use it. We need a separate replacement for the bolded version because it +# doesn't work to have variable replacements within formatting. +rst_epilog = """ +.. |version_label| replace:: {version_label} +.. |version_label_bold| replace:: **{version_label}** +""".format(version_label=version_label) # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/doc/source/index.rst b/doc/source/index.rst index 9a9d8016ef..4059b6f89f 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -3,8 +3,15 @@ You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -Welcome to the CTSM documentation -================================== +Welcome to the CTSM documentation for |version_label| +===================================================== + +.. important:: + + **You are viewing the documentation for** |version_label_bold|. **There are separate + versions of this documentation for each maintained CTSM release (e.g., CLM5.0) and for + the latest development code. Use the menu at the top left to select the version of CTSM + you are using.** This document has three major sections. diff --git a/doc/source/lilac/index.rst b/doc/source/lilac/index.rst index 3aac77f9ef..7badf94d00 100644 --- a/doc/source/lilac/index.rst +++ b/doc/source/lilac/index.rst @@ -4,6 +4,13 @@ CTSM-LILAC User's Guide ####################### +.. important:: + + **You are viewing the documentation for** |version_label_bold|. **There are separate + versions of this documentation for each maintained CTSM release (e.g., CLM5.0) and for + the latest development code. Use the menu at the top left to select the version of CTSM + you are using.** + .. toctree:: :maxdepth: 2 diff --git a/doc/source/lilac/obtaining-building-and-running/ctsm_lilac_runtime_file_workflow.svg b/doc/source/lilac/obtaining-building-and-running/ctsm_lilac_runtime_file_workflow.svg index a0d2cf6d07..7dd2f63995 100644 --- a/doc/source/lilac/obtaining-building-and-running/ctsm_lilac_runtime_file_workflow.svg +++ b/doc/source/lilac/obtaining-building-and-running/ctsm_lilac_runtime_file_workflow.svg @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3d86cfb661a03c99574ec626db8be97d8875884f1c3879db9cab935bd0dee7a7 -size 17275 +oid sha256:73b7f4567783717f844f57e9ad2d7f0faa543e0ce1b22d83309b11c06d8fe611 +size 17487 diff --git a/doc/source/lilac/obtaining-building-and-running/setting-ctsm-runtime-options.rst b/doc/source/lilac/obtaining-building-and-running/setting-ctsm-runtime-options.rst index a338324e07..c298972710 100644 --- a/doc/source/lilac/obtaining-building-and-running/setting-ctsm-runtime-options.rst +++ b/doc/source/lilac/obtaining-building-and-running/setting-ctsm-runtime-options.rst @@ -6,9 +6,6 @@ Setting CTSM runtime options ============================== -Overview and quick start -======================== - This section describes the process for creating the runtime input text files for CTSM and LILAC. These files, which are in Fortran namelist format, have hard-coded file names. These files must exist with the expected names in the directory from which the @@ -51,8 +48,8 @@ also illustrated in :numref:`Figure ctsm_lilac_runtime_file_workflow`: unnecessary if all of the needed input data already exists. However, it doesn't hurt to run it in this case.) -#. Copy ``lnd_in``, ``lnd_modelio.nml`` and ``lilac_in`` to the directory from which you - will be running the model. +#. Copy or create links to ``lnd_in``, ``lnd_modelio.nml`` and ``lilac_in`` in the + directory from which you will be running the model. .. _Figure ctsm_lilac_runtime_file_workflow: @@ -119,7 +116,7 @@ The first set of options in this file specifies key file names: NWP / prediction applications, you will typically want a customized initial condition file. The process for generating this file will depend on your atmosphere model and workflow, but an example for WRF is given in section - :numref:`wrf-create-input-namelists-for-ctsm-and-lilac`. + :numref:`wrf-set-ctsm-runtime-options`. The remainder of this file specifies a variety of high-level options, each of which sets the default values for a number of CTSM's runtime parameters. The default values should be @@ -233,7 +230,8 @@ files (and not to CTSM's standard input files), then this is nothing to worry ab Copying the necessary files to the model's run directory ======================================================== -Finally, copy the following files to the directory from which you will run the model: +Finally, copy or create links to the following files in the directory from which you will +run the model: - ``lnd_in``: This is the main namelist input file for CTSM @@ -241,6 +239,12 @@ Finally, copy the following files to the directory from which you will run the m - ``lilac_in``: This namelist controls the operation of LILAC +.. note:: + + We recommend using symbolic links (via ``ln -s``) rather than copying these files: This + way, if you later update these files in the ``runtime_inputs`` directory, you do not + need to re-copy them. + .. note:: We have not discussed ``lnd_modelio.nml`` above. This is because, if you have run diff --git a/doc/source/lilac/specific-atm-models/index.rst b/doc/source/lilac/specific-atm-models/index.rst index 04a1976253..b5c3d2bc08 100644 --- a/doc/source/lilac/specific-atm-models/index.rst +++ b/doc/source/lilac/specific-atm-models/index.rst @@ -1,10 +1,12 @@ .. _specific-atm-models: -===================================== - Notes on specific atmosphere models -===================================== +============================================================== + Instructions on using CTSM with specific atmosphere models +============================================================== .. toctree:: :maxdepth: 2 wrf.rst + wrf-nesting.rst + wrf-tools.rst diff --git a/doc/source/lilac/specific-atm-models/wrf-nesting.rst b/doc/source/lilac/specific-atm-models/wrf-nesting.rst new file mode 100644 index 0000000000..b21593029b --- /dev/null +++ b/doc/source/lilac/specific-atm-models/wrf-nesting.rst @@ -0,0 +1,262 @@ +.. _wrf: + +.. highlight:: shell + +======================================== + Using CTSM with WRF (Nested Model Runs) +======================================== + +This section includes instructions on how to run WRF coupled with CTSM for a +nested domain. + +A nested domain is usually used to have a finer-resolution domain within the +coarser model domain. A nested simulation enables running at a higher +resolution over a smaller domain + +.. note:: + A nest should cover a portion of the parent domain and is fully contained by + the parent domain, so that it is driven along its lateral boundaries by the + parent domain. + +.. todo:: + Negin wants to add a flowchart showing the workflow of a nested case. + +There are currently two types of nesting available within WRF: + +#. **One-way nesting:** + In One-way nesting, the boundary conditions are fed to the inner (child) domain from the outer (parent) domain. + +#. **Two-way nesting:** + In two-way nesting, two things are being done: + + - Exactly similar to 1-way nesting the boundary conditions are fed to the inner domain from the outer (parent) domain. + - Also, the averaged values from the inner domain are being sent back to the outer domain at the corresponding grid points. + +.. important:: + Currently, the WRF-CTSM coupling infrastructure only support one-way nesting. + This example clarifies the workflow for running a nested WRF-CTSM case using one-way nesting with ``ndown.exe``. + +The procedure for running a nested simulation for WRF with CTSM is +similar to the workflow for running WRF real cases, except that it requires +additional steps to (1) clone the CTSM repository, (2) build +CTSM and LILAC, and (3) define namelist options reuired for CTSM. + +A full description of all steps for a WRF-CTSM run are included here. + +.. important:: + + This section assumes the user has completed all the steps required for + WRF-CTSM simulation single domain. + Therefore, we are not repeating the steps necessary for building WRF and + CTSM. + + +In this example we use a nested domain over the CONUS as shows below: + + +.. _Figure ctsm-ndown: + +.. figure:: ndown_ctsm_diagram.svg + + Flowchart for WRF-CTSM one-way nested simulations + +Nested Simulations : Pre-processing (geogrid.exe) +------------------------------------------------- +In the WPS/ directory, edit `namelist.wps` for a nested simulation over your +desired domains. Make sure to change `max_dom=2`. + +First, use geogrid.exe to define the domain and interpolate static geographical data +to the grids:: + + ./geogrid.exe >& log.geogrid + +This step creates two files `geo_em.d01.nc` & `geo_em.d02.nc` which includes +the domain definition for each domain. + +If the geogrid step finishes successfully, you should see the following message in the log file:: + + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! Successful completion of geogrid. ! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +The basic difference here with a non-nested case is the namelist.wps should +have a column for each domain with `max_dom=2`. For example:: + + &share + wrf_core = 'ARW', + max_dom = 2, + start_date = '2013-04-01_00:00:00','2013-04-01_00:00:00', + end_date = '2013-04-30_00:00:00','2013-04-30_00:00:00', + interval_seconds = 21600 + io_form_geogrid = 2, + / + + &geogrid + parent_id = 1, 1, + parent_grid_ratio = 1, 3, + i_parent_start = 1, 61, + j_parent_start = 1, 57, + e_we = 200, 103, + e_sn = 140, 103, + +Therefore ``geogrid.exe`` creates two files corresponding to each domain. + +Nested Simulations : Pre-processing (ungrib.exe) +------------------------------------------------- +As mentioned previously, the purpose of the ungrib script is to unpack GRIB +meteorological data and pack it into an intermediate file format. +This step is exactly identical to a non-nested simulation. + +Run ungrib to get gribbed data into usable format to be ingested by WRF. + +To run ungrib.exe, first link the GRIB data files that are going to be used:: + + ./link_grib.csh $your_GRIB_data_path + +Based on your GRIB data type, link or copy the appropriate VTable to your WPS directory. +WRF has some prepared VTable under ``/ungrib/Variable_tables/`` folder. + +Extract meteorological fields from GRIB-formatted files:: + + ./ungrib.exe >& log.ungrib + +Check ungrib log for the following message showing successful completion of ungrib step:: + + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! Successful completion of ungrib. ! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +At this point, you should see ungrib output (intermediate files) in your WPS directory. + + +Nested Simulations : Pre-processing (metgrid.exe) +------------------------------------------------- +Ensure that the `start_date` and `end_date` for domain two is set correctly for +your simulation. +Next, run ``metgrid.exe``:: + + ./metgrid.exe >& log.metgrid + +Check the metgrid log for the following message showing successful completion of +metgrid step:: + + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! Successful completion of metgrid. ! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + +Running metgrid for two domains will create files like +below:: + met_em.d01.* + met_em.d02.* + + + +Nested Simulations : real.exe +------------------------------ + +In this step, run ``real.exe`` to generate initial and boundary conditions for +both domains. + +In summary, complete the following steps: + +Move or link WPS output files (``met_em.d01*`` and ``met_em.d02`` files) to your WRF test directory. + +Edit namelist.input for your WRF domain and desirable configurations. +This should be the same domain as WPS namelist. Make sure you set ``max_dom = +2,`` in the namelist. + +To run WRF-CTSM, in your namelist change land-surface option to 6 for both +domains:: + + sf_surface_physics = 6, 6, + + +Run real.exe (if compiled parallel submit a batch job) to generate +initail and boundary condition files for both domain. +Make sure the following three files have been created in your directory:: + + wrfinput_d01 + wrfinput_d02 + wrfbdy_d01 + +The boundary condition file is only created for the outer domain. + +Check the last line of the real log file for the following message:: + +Rename wrfinput_d02 +------------------- +Next, rename the ``wrfinput_d02`` file to ``wrfndi_d02``:: + + mv wrfinput_d02 wrfndi_d02 + +Run ndown.exe +------------- +In this step, we run ndown.exe to create initial and boundary condition for +domain 2 based on the domain 1 (outer domain). + +Add the following into your namelist.input file under ``&time_control``:: + + io_form_auxinput2 = 2 + +Run ndown.exe to create ``wrfinput_d02`` and ``wrfbdy_d02``. + +Run WRF for coarser domain +--------------------------- +In this step, run WRF for the outer domain. +Make sure that ``max_dom = 1`` to run only for the coarser domain. + +This step is exactly identical as the previous example and only creates the +``wrfout*`` files for the coarser domain. + +Please make sure to copy ``lnd_in`` , ``lilac_in``, and ``lnd_modelio`` for the +coarser domain in this directory. + +Create CTSM runtime files for the fine domain +--------------------------------------------- +This step is in addition creating CTSM runtime files for coarser domain which +was explained here. For succesfully completing the previous step you should +have already created these files for the coarser domain. + +.. seealso:: + + The instructions for setting CTSM runtime options, are discussed in depth + in section :numref:`setting-ctsm-runtime-options`. For creating the runtime + files for the finer domain you should follow the steps in section + :numref:`setting-ctsm-runtime-options`. + + +Again, the goal here is to create files that determine CTSM runtime options which +are defined within these three files: + +- ``lnd_in``: This is the main namelist input file for CTSM inner domain + +- ``lnd_modelio.nml``: This sets CTSM's PIO (parallel I/O library) configuration settings + +- ``lilac_in``: This namelist controls the operation of LILAC + + +Run WRF for the finer domain +----------------------------- +First, save (rename or move) the data from the coarser domain simulation +(``wrfout_d01_*`` files). +Next, rename ``wrfinput_d02`` and ``wrfbdy_d02`` to ``wrfinput_d01`` and ``wrfbdy_d01``, respectively. + + +Edit namelist.input, moving all of the fine-grid domain data from column 2 to column 1 +so that this run will be for the fine-grid domain only. Make sure you set +`max_dom=1` and set your `time_step` based on the finer domain. + +.. note:: + It may be beneficial to save namelist.input to something else prior to this step in case you need to repeat this + process in the future. Save the newly-edited namelist as namelist.input . + +Now run wrf.exe by submitting a job similar to a not-nested case. + +.. important:: + + The output for the finer domain is wrfout_d01_* not wrfout_d02_* and although + in the name it is saying d01 it is technically d02 domain. + + + diff --git a/doc/source/lilac/specific-atm-models/wrf-tools.rst b/doc/source/lilac/specific-atm-models/wrf-tools.rst new file mode 100644 index 0000000000..8b3c423a58 --- /dev/null +++ b/doc/source/lilac/specific-atm-models/wrf-tools.rst @@ -0,0 +1,80 @@ +.. _wrf: + +.. highlight:: shell + +============================= + WRF-CTSM Tools and Utilities +============================= + +This section includes instructions on tools and utilities developed for +WRF-CTSM simulations. + + + +Generate CTSM surface dataset for a WRF domain +---------------------------------------------- + +Before this step, make sure you have successfully created geo_em* files for +your specific WRF domain using WPS. Instructions on how to run ``geogrid.exe`` +is described in here. + + +1. Create SCRIP grid file from WRF ``geo_em*`` files, using the following ncl + script:: + + ncl create_scrip_file.ncl + + This creates two files that are complements of each other only in the mask field + +2. Create mapping files by using ``mkmapdata`` code under + ``CTSM/tools/mkmapdata/``. + + Using environment variables set the following environment varibales needed + by ``mkunitymap.ncl`` code:: + + setenv GRIDFILE1 wrf2clm_ocean_noneg.nc + setenv GRIDFILE2 wrf2clm_land_noneg.nc + setenv MAPFILE wrf2clm_mapping_noneg.nc + setenv PRINT TRUE + + ncl mkunitymap.ncl + + +.. warning:: + + This will throw some git errors if not run in a repository. + +3. Create ESMF mapping files by running ``regridbatch.sh``:: + + qsub regridbatch.sh + +4. In your ctsm repository directory, build:: + + ../../../configure --macros-format Makefile --mpilib mpi-serial + + +5. Generate CTSM domain files using ``get_domain`` tool:: + + ./gen_domain -m /glade/work/$USER/ctsm/nldas_grid/scrip/wrf2clm_mapping_noneg.nc -o wrf2clm_ocn_noneg -l wrf2clm_lnd_noneg + +6. Create surface datasets in ``tools/mksurfdata_map``:: + + ./mksurfdata.pl -res usrspec -usr_gname "nldas" -usr_gdate "190124" -usr_mapdir "/glade/work/$USER/ctsm/nldas_grid/map" -y 2000 -exedir "/glade/u/home/$USER/src/ctsm/ctsm_surfdata/tools/mksurfdata_map" -no-crop + + + +Merge WRF initial conditions into an existing CTSM initial condition file +-------------------------------------------------------------------------- + +The following procedure is if you'd wish to merget WRF inital conditions from +``wrfinput`` file into CTSM initial condition file :: + + + ncl transfer_wrfinput_to_ctsm_with_snow.ncl 'finidat="the_existing_finidat_file.nc"' 'wrfinput="your_wrfinput_file"' 'merged="the_merged_finidat_file.nc"' + + +.. todo:: + + Sam, can you please make the above ncl script available. + + diff --git a/doc/source/lilac/specific-atm-models/wrf.rst b/doc/source/lilac/specific-atm-models/wrf.rst index cb590f24fc..f1118973e9 100644 --- a/doc/source/lilac/specific-atm-models/wrf.rst +++ b/doc/source/lilac/specific-atm-models/wrf.rst @@ -6,95 +6,110 @@ Using CTSM with WRF ===================== -This section includes instructions on how to use WRF with CTSM using LILAC. -The procedure for building and running the CTSM library and its dependencies -repeats some information from earlier sections but with minimal explanation. +This section includes instructions on how to run WRF coupled with CTSM via LILAC +framework. + +The procedure for running WRF with CTSM is similar to the +workflow for running WRF real cases, except that it requires +additional steps to (1) clone the CTSM repository, (2) build +CTSM and LILAC, and (3) define namelist options reuired for CTSM. + +A full description of all steps for a WRF-CTSM run are included here. + +Specific new steps that would not be completed in a standard WRF real case +are described in sections :numref:`clone-WRF-CTSM-repositories`, +:numref:`build-CTSM-and-dependencies` , +and :numref:`wrf-set-ctsm-runtime-options`. .. important:: This section assumes use of a machine that has been ported to CIME. - In this example we assume NCAR’s cheyenne computer in particular. + If CIME is not ported to your machine, please see `instructions on porting CIME + `_. + + In this example we assume NCAR’s ``Cheyenne`` HPC system in particular. +.. _clone-WRF-CTSM-repositories: + Clone WRF and CTSM Repositories ------------------------------- -Clone the WRF CTSM feature branch:: - - git clone https://github.com/billsacks/WRF.git - cd WRF - git checkout lilac_dev +Clone the WRF repository and checkout ``develop`` branch:: -.. todo:: + git clone https://github.com/wrf-model/WRF.git WRF-CTSM + cd WRF-CTSM + git checkout develop - update the git address to WRF feature branch... Clone the CTSM repository:: git clone https://github.com/ESCOMP/CTSM.git cd CTSM - git checkout lilac_cap ./manage_externals/checkout_externals -.. todo:: - - Remove "git checkout lilac_cap" from the above when ready +.. _build-CTSM-and-dependencies: Build CTSM and its dependencies ------------------------------- -Build CTSM and its dependencies based on the instructions from previous sections :: +In your CTSM directory, build CTSM and its dependencies based on the +instructions from section :numref:`obtaining-and-building-ctsm`:: ./lilac/build_ctsm /PATH/TO/CTSM/BUILD --machine MACHINE --compiler COMPILER -For example on `Cheyenne:` for `Intel` compiler:: +For example on ``Cheyenne`` and for ``Intel`` compiler:: - ./lilac/build_ctsm /glade/scratch/$USER/ctsm_build_dir --compiler intel --machine cheyenne + ./lilac/build_ctsm ctsm_build_dir --compiler intel --machine cheyenne -.. note:: - - Run ./lilac/build_ctsm -h to see all options available, - for example if you would like to run with threading support you can use `--build-with-openmp` - .. warning:: The directory you provided for the build script (``/PATH/TO/CTSM/BUILD``) must *not* exist. Alternatively, you can use ``--rebuild`` option. +.. note:: + + Run ``./lilac/build_ctsm -h`` to see all options available. + For example if you would like to run with threading support you can use ``--build-with-openmp``. + + Building WRF with CTSM ---------------------- First, load the same modules and set the same environments as used for CTSM build by -sourcing ctsm_build_environment.sh for Bash:: +sourcing ``ctsm_build_environment.sh`` for Bash:: - source /glade/scratch/$USER/ctsm_build_dir/ctsm_build_environment.sh + source ctsm_build_dir/ctsm_build_environment.sh -or sourcing ctsm_build_environment.csh for Cshell: +or sourcing ``ctsm_build_environment.csh`` for Cshell: .. code-block:: Tcsh - source /glade/scratch/$USER/ctsm_build_dir/ctsm_build_environment.csh + source ctsm_build_dir/ctsm_build_environment.csh Set makefile variables from CTSM needed for the WRF build by setting the following environment. For example for Bash:: - export WRF_CTSM_MKFILE=/glade/scratch/$USER/ctsm_build_dir/bld/ctsm.mk + export WRF_CTSM_MKFILE=/glade/scratch/$USER/WRF-CTSM/CTSM/ctsm_build_dir/bld/ctsm.mk or for Cshell: .. code-block:: Tcsh - setenv WRF_CTSM_MKFILE /glade/scratch/$USER/ctsm_build_dir/bld/ctsm.mk + setenv WRF_CTSM_MKFILE /glade/scratch/$USER/WRF-CTSM/CTSM/ctsm_build_dir/bld/ctsm.mk +.. warning:: + Please note that you should point to the absolute path of the ``ctsm.mk`` file. There are also few other environmental setting that should be set for building WRF. Some of these are not required, but might help if you face any compilation errors. -For more information check WRF Users' Guide. +For more information check +`WRF Users' Guide `_. -Explicitly define which model core to build by (Bash):: +Explicitly define the model core to build by (Bash):: export WRF_EM_CORE=1 @@ -105,7 +120,7 @@ or (Cshell): setenv WRF_EM_CORE 1 -Explicilty turn off data assimilation by:: +Explicilty turn off data assimilation by (Bash):: export WRF_DA_CORE=0 @@ -115,23 +130,24 @@ or (Cshell): setenv WRF_DA_CORE 0 -Now configure and build WRF for your machine and intended compiler:: +Now in your WRF directory configure and build WRF for your machine +and intended compiler:: ./clean -a ./configure - At the prompt choose one of the options, based on the compiler used for building CTSM. Then you should choose if you'd like to build serially or -in parallel. +in parallel. For example, you can choose to build with ``intel`` compiler with +distributed memory parallelization (``dmpar``). .. tip:: - dmpar or distributed memory parallelization is the most highly tested and + ``dmpar`` or distributed memory parallelization is the most highly tested and recommended for compiling WRF. The next prompt requests an option for nesting. Currently nesting is not -available for WRF-CTSM so enter 1. +available for WRF-CTSM so select option ``1 (basic)``. Now compile em_real and save the log:: @@ -139,32 +155,24 @@ Now compile em_real and save the log:: ./compile em_real >& compile.log -Check the bottom of your log file for a successful compilation message -or search the file for the string "Error" with a capital E. +Check the bottom of your log file for a successful compilation message. .. note:: - The ./compile step may take more than 30 minutes to complete. - While you wait, follow the instructions in Section 3.2.2 (next) + The ``./compile`` step may take more than 30 minutes to complete. .. tip:: Optional: One may use ``tmux`` or ``nohup`` for configuring and compiling. Try ``man nohup`` for more information. -.. seealso:: - - For further detail on preparing the CTSM, including how to - recompile when making code changes to the CTSM, read `Section 3.2. - `__ - Compile WRF Preprocessing System (WPS) -------------------------------------- The WRF Preprocessing System (WPS) is a set of programs to prepare inputs to the real program executable (real.exe) for WRF real-data simulations. If you wish to complete the offered example with preexisting inputs, then -skip to the next section, which is titled "Run WRF." +skip to section :numref:`wrf-set-ctsm-runtime-options`. .. warning:: @@ -191,7 +199,7 @@ Then, compile WPS:: .. note:: - If wps builds succesfully you should see geogrid.exe, ungrib.exe, and metgrid.exe. + If wps builds succesfully you should see ``geogrid.exe``, ``ungrib.exe``, and ``metgrid.exe``. Alternatively, you can check the log for successful build messages. @@ -212,7 +220,6 @@ If the geogrid step finishes successfully, you should see the following message ! Successful completion of geogrid. ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - Next, run ungrib to get gribbed data into usable format to be ingested by WRF. To run ungrib.exe, first link the GRIB data files that are going to be used:: @@ -232,7 +239,6 @@ Check ungrib log for the following message showing successful completion of ungr ! Successful completion of ungrib. ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - At this point, you should see ungrib output (intermediate files) in your WPS directory. Horizontally interpolate the meteorological fields extracted by ungrib to @@ -240,7 +246,6 @@ the model grids defined in geogrid:: ./metgrid.exe >& log.metgrid - Check the metgrid log for the following message showing successful completion of metgrid step:: @@ -249,8 +254,6 @@ metgrid step:: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - Run real.exe ------------ @@ -265,19 +268,10 @@ Edit namelist.input for your WRF domain and desirable configurations. This should be the same domain as WPS namelist. -.. todo:: - - update the option number of wrf namelist. - +To run WRF-CTSM, in your namelist change land-surface option to 6:: -To run WRF-CTSM, in your namelist change land-surface option to 51:: + sf_surface_physics = 6 - sf_surface_physics = 51 - - -.. todo:: - - add the link and adding some note that nested run is not possible.... Run real.exe (if compiled parallel submit a batch job) to generate ``wrfinput`` and ``wrfbdy`` files. @@ -287,42 +281,73 @@ Check the last line of the real log file for the following message:: SUCCESS COMPLETE REAL_EM INIT +.. _wrf-set-ctsm-runtime-options: + + Set CTSM runtime options ------------------------ -Now follow the instructions in this Section:: +.. seealso:: + + The instructions for setting CTSM runtime options, are discussed in depth + in section :numref:`setting-ctsm-runtime-options`. + +The goal here is to create files that determine CTSM runtime options which +are defined within these three files: + +- ``lnd_in``: This is the main namelist input file for CTSM + +- ``lnd_modelio.nml``: This sets CTSM's PIO (parallel I/O library) configuration settings + +- ``lilac_in``: This namelist controls the operation of LILAC + + +The basic process for creating the necessary input files are summarized as +follows: - https:../obtaining-building-and-running/setting-ctsm-runtime-options.html +Go to ``runtime_inputs`` directory:: -In step 3 of that Section we used for this example:: + cd CTSM/ctsm_build_dir/runtime_inputs + +Next, modify and fill in the ``ctsm.cfg`` file to set high-level options to CTSM. +A few options should be filled in; most can be left at their default values or changed if +desired. + +The following is the recommended CTSM options to run WRF:: + + configuration = nwp + structure = fast + bgc_mode = sp + +In ``ctsm.cfg`` you should specify CTSM domain file, surface dataset and finidat file. +For this example (US domain), you can use the following settings:: lnd_domain_file = /glade/work/slevis/barlage_wrf_ctsm/conus/gen_domain_files/domain.lnd.wrf2ctsm_lnd_wrf2ctsm_ocn.191211.nc fsurdat = /glade/work/slevis/git_wrf/ctsm_surf/surfdata_conus_hist_16pfts_Irrig_CMIP6_simyr2000_c191212.nc finidat = /glade/work/slevis/git_wrf/ctsm_init/finidat_interp_dest_wrfinit_snow_ERAI_12month.nc -In step 4 of that Section we used for this example:: - - atm_mesh_filename = '/glade/work/slevis/barlage_wrf_ctsm/conus/mesh/wrf2ctsm_land_conus_ESMFMesh_c20191216.nc' - lnd_mesh_filename = '/glade/work/slevis/barlage_wrf_ctsm/conus/mesh/wrf2ctsm_land_conus_ESMFMesh_c20191216.nc' - -In step 6 of that Section you will copy some files to your WRF/run -directory. Then you will be ready to continue. +Run the script ``make_runtime_inputs`` to create ``lnd_in`` and +``clm.input_data_list``:: -.. note:: + ./make_runtime_inputs - If you wish to merge your WRF initial conditions from a wrfinput file - into the existing CTSM initial condition file, complete the following step. +Modify ``lilac_in`` as needed. For this example, you can use the following options:: -Type:: + atm_mesh_filename = '/glade/work/slevis/barlage_wrf_ctsm/conus/mesh/wrf2ctsm_land_conus_ESMFMesh_c20191216.nc' + lnd_mesh_filename = '/glade/work/slevis/barlage_wrf_ctsm/conus/mesh/wrf2ctsm_land_conus_ESMFMesh_c20191216.nc' - module load ncl - ncl transfer_wrfinput_to_ctsm_with_snow.ncl 'finidat="the_existing_finidat_file.nc"' 'wrfinput="your_wrfinput_file"' 'merged="the_merged_finidat_file.nc"' -.. todo:: +Run ``download_input_data`` script to download any of CTSM's standard input +files that are needed based on settings in ``lnd_in`` and ``lilac_in``:: - Make the above ncl script available. + ./download_input_data +Next, copy or link ``lnd_in``, ``lnd_modelio.nml`` and ``lilac_in`` to the direcotory +from which you will be running the model (e.g. WRF/run) :: + ln -sf /glade/scratch/$USER/WRF-CTSM/CTSM/ctsm_build_dir/runtime_inputs/lnd_in . + ln -sf /glade/scratch/$USER/WRF-CTSM/CTSM/ctsm_build_dir/runtime_inputs/lilac_in . + ln -sf /glade/scratch/$USER/WRF-CTSM/CTSM/ctsm_build_dir/runtime_inputs/lnd_modelio.nml . Run wrf.exe ----------- @@ -331,17 +356,17 @@ If real.exe completed successfully, we should have ``wrfinput`` and ``wrfbdy`` f in our directory. If you plan to use this example's preexisting files, copy -the following files to your WRF/run directory:: +the following files to your WRF run directory:: - /glade/work/slevis/git_wrf/WRF/test/em_real/namelist.input.ctsm.2013.d01.12month - /glade/work/slevis/git_wrf/WRF/test/em_real/wrfinput_d01.ERAI.12month - /glade/work/slevis/git_wrf/WRF/test/em_real/wrfbdy_d01.ERAI.12month + cp /glade/scratch/negins/wrf_ctsm_files/namelist.input . + cp /glade/scratch/negins/wrf_ctsm_files/wrfinput_d01 . + cp /glade/scratch/negins/wrf_ctsm_files/wrfbdy_d01 . Now run WRF-CTSM. On Cheyenne this means submitting a batch job to PBS (Pro workload management system). -For detailed instructions on running a batch job on Cheyenne, please check: -https://www2.cisl.ucar.edu/resources/computational-systems/cheyenne/running-jobs/submitting-jobs-pbs +Please check NCAR CISL's `instructions on running a batch job on Cheyenne. +`__ -A simple PBS script to run WRF-CTSM on Cheyenne looks like this: +A simple PBS script to run WRF-CTSM on ``Cheyenne`` looks like this: .. code-block:: Tcsh @@ -356,15 +381,12 @@ A simple PBS script to run WRF-CTSM on Cheyenne looks like this: #PBS -M your_email_address #PBS -l select=2:ncpus=36:mpiprocs=36 - ### Set TMPDIR as recommended - setenv TMPDIR /glade/scratch/$USER/temp - mkdir -p $TMPDIR - source /glade/scratch/$USER/ctsm_build_dir/ctsm_build_environment.csh - ### Run the executable mpiexec_mpt ./wrf.exe -If you named this script run_wrf_ctsm.csh, submit the job like this:: +To submit a batch job to the ``Cheyenne`` queues, use ``qsub`` command followed +by the PBS script name. +For example, if you named this script ``run_wrf_ctsm.csh``, submit the job like this:: qsub run_wrf_ctsm.csh diff --git a/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst b/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst index d90c8cab40..a60baebffa 100644 --- a/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst +++ b/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst @@ -438,10 +438,10 @@ precipitation :math:`q_{rain}` and solid precipitation However, in CLM5, the atmosphere's partitioning into liquid and solid precipitation is ignored. Instead, CLM repartitions total precipitation using a linear ramp. For most landunits, this ramp generates all snow -below :math:`0 \textdegree C`, all rain above :math:`2 \textdegree C`, +below :math:`0 ^{\circ} C`, all rain above :math:`2 ^{\circ} C`, and a mix of rain and snow for intermediate temperatures. For glaciers, -the end points of the ramp are :math:`-2 \textdegree C` and :math:`0 -\textdegree C`, respectively. Changes to the phase of precipitation are +the end points of the ramp are :math:`-2 ^{\circ} C` and :math:`0 +^{\circ} C`, respectively. Changes to the phase of precipitation are accompanied by a sensible heat flux (positive or negative) to conserve energy. diff --git a/doc/source/tech_note/index.rst b/doc/source/tech_note/index.rst index 5f72de7d9b..5baaa61540 100644 --- a/doc/source/tech_note/index.rst +++ b/doc/source/tech_note/index.rst @@ -5,9 +5,16 @@ .. _tech_note: -##################################### +################## CLM Technical Note -##################################### +################## + +.. important:: + + **You are viewing the documentation for** |version_label_bold|. **There are separate + versions of this documentation for each maintained CTSM release (e.g., CLM5.0) and for + the latest development code. Use the menu at the top left to select the version of CTSM + you are using.** .. toctree:: :maxdepth: 2 diff --git a/doc/source/users_guide/index.rst b/doc/source/users_guide/index.rst index f4cf0e5123..45afc39c72 100644 --- a/doc/source/users_guide/index.rst +++ b/doc/source/users_guide/index.rst @@ -7,9 +7,16 @@ .. include:: substitutions.rst -##################################### +###################### |version| User's Guide -##################################### +###################### + +.. important:: + + **You are viewing the documentation for** |version_label_bold|. **There are separate + versions of this documentation for each maintained CTSM release (e.g., CLM5.0) and for + the latest development code. Use the menu at the top left to select the version of CTSM + you are using.** .. toctree:: :maxdepth: 2 diff --git a/doc/source/users_guide/running-special-cases/Running-with-anomaly-forcing.rst b/doc/source/users_guide/running-special-cases/Running-with-anomaly-forcing.rst new file mode 100644 index 0000000000..10af089814 --- /dev/null +++ b/doc/source/users_guide/running-special-cases/Running-with-anomaly-forcing.rst @@ -0,0 +1,45 @@ +.. _running-with-anomaly-forcing: + +.. include:: ../substitutions.rst + +============================== + Running with anomaly forcing +============================== +Because performing fully coupled climate simulations is computationally expensive, an alternate method of running land-only simulations forced by future climate projections was developed for CTSM called 'anomaly forcing'. The anomaly forcing method uses a previously completed fully coupled simulation to create monthly anomalies, relative to the present day, of near-surface atmospheric states and fluxes. These anomalies, representing the evolution of future climate projections, are applied to a repeating cycle of present day atmospheric forcing data, either as an additive (for states) or multiplicative (for fluxes) quantity. Thus, high-frequency variability is obtained from the present day atmospheric forcing data, while the long-term evolution of the climate is determined by the anomaly forcing dataset. + +To enable anomaly forcing in a CTSM simulation, the following namelist variable can be added to the user\_nl\_datm file: + + anomaly\_forcing = 'Anomaly.Forcing.Precip','Anomaly.Forcing.Temperature','Anomaly.Forcing.Pressure','Anomaly.Forcing.Humidity','Anomaly.Forcing.Uwind','Anomaly.Forcing.Vwind','Anomaly.Forcing.Shortwave','Anomaly.Forcing.Longwave' + +Any combination or subset of forcing variables can be used, e.g. to modify only a single atmospheric forcing variable, one could use: + + anomaly\_forcing = 'Anomaly.Forcing.Temperature' + +which will only adjust the temperature (TBOT). + +After the namelist has been created, the run directory will be populated with files such as these: + + datm.streams.txt.Anomaly.Forcing.Temperature + +which will contain the location of the default anomaly forcing datasets. To use alternative data, copy these files to the case directory with the 'user\_' prefix, and modify the 'user\_*' files accordingly, e.g.: + + user\_datm.streams.txt.Anomaly.Forcing.Temperature + + For example, one could use the user\_datm.streams.txt.Anomaly.Forcing.* files to point to these SSP-derived anomaly forcing datasets: + + /glade/p/cesmdata/cseg/inputdata/atm/datm7/anomaly\_forcing/CMIP6-SSP3-7.0 + + af.huss.cesm2.SSP3-7.0.2015-2100\_c20200329.nc + af.pr.cesm2.SSP3-7.0.2015-2100\_c20200329.nc + af.ps.cesm2.SSP3-7.0.2015-2100\_c20200329.nc + af.rlds.cesm2.SSP3-7.0.2015-2100\_c20200329.nc + af.rsds.cesm2.SSP3-7.0.2015-2100\_c20200329.nc + af.tas.cesm2.SSP3-7.0.2015-2100\_c20200329.nc + +Users may wish to also update files such as the landuse\_timeseries and aerosol and Ndepostion files to correspond to the appropriate SSP. + +For single point simulations, the global anomaly forcing files can be used, but the map_algo namelist variable should be appended with nearest neighbor values for each of the anomaly forcing fields, e.g. + + mapalgo = 'nn','nn','nn','nn','nn','nn','nn','nn','nn','nn','nn','nn','nn' (the number of 'nn' values will depend on the number of original streams plus the number of anomaly forcing streams) + +The cycling of the present-day (base) climate is controlled through the DATM\_CLMNCEP\_YR\_START and DATM_CLMNCEP\_YR\_END variables in env\_run.xml. diff --git a/doc/source/users_guide/running-special-cases/index.rst b/doc/source/users_guide/running-special-cases/index.rst index f063992c67..f84b7706fb 100644 --- a/doc/source/users_guide/running-special-cases/index.rst +++ b/doc/source/users_guide/running-special-cases/index.rst @@ -22,3 +22,4 @@ Running Special Cases Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst + Running-with-anomaly-forcing.rst diff --git a/doc/source/users_guide/setting-up-and-running-a-case/README_master_list_file b/doc/source/users_guide/setting-up-and-running-a-case/README_master_list_file new file mode 100644 index 0000000000..ac9fa73864 --- /dev/null +++ b/doc/source/users_guide/setting-up-and-running-a-case/README_master_list_file @@ -0,0 +1,9 @@ +2020/11/16 slevis + +The file master_list_file.rst contains a table of the history fields, +active and inactive, available in the CTSM case that gets generated by +this test: +ERP_P36x2_D_Ld3.f10_f10_musgs.I1850Clm50BgcCrop.cheyenne_gnu.clm-extra_outputs + +To reproduce master_list_file.rst, run the above test and the file +will appear in the run directory. diff --git a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.rst b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.rst index 93f30f8a29..2712c70ae7 100644 --- a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.rst +++ b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.rst @@ -43,7 +43,7 @@ Included in the table are the following pieces of information: Table 1-3. CLM History Fields ----------------------------- -Table goes here. +For Table, please see :doc:`master_list_file`. --------------------------------------------- diff --git a/doc/source/users_guide/setting-up-and-running-a-case/index.rst b/doc/source/users_guide/setting-up-and-running-a-case/index.rst index 3fb9a41391..4703223c73 100644 --- a/doc/source/users_guide/setting-up-and-running-a-case/index.rst +++ b/doc/source/users_guide/setting-up-and-running-a-case/index.rst @@ -18,4 +18,5 @@ Setting Up and Running a Case customizing-the-clm-configuration.rst customizing-the-clm-namelist.rst customizing-the-datm-namelist.rst + master_list_file diff --git a/doc/source/users_guide/setting-up-and-running-a-case/master_list_file.rst b/doc/source/users_guide/setting-up-and-running-a-case/master_list_file.rst new file mode 100644 index 0000000000..610975876b --- /dev/null +++ b/doc/source/users_guide/setting-up-and-running-a-case/master_list_file.rst @@ -0,0 +1,1274 @@ +=================== +CTSM History Fields +=================== + +==== =================================== ============================================================================================== ================================================================= ======= +CTSM History Fields +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + # Variable Name Long Description Units Active? +==== =================================== ============================================================================================== ================================================================= ======= + 1 A10TMIN 10-day running mean of min 2-m temperature K F + 2 A5TMIN 5-day running mean of min 2-m temperature K F + 3 ACTUAL_IMMOB actual N immobilization gN/m^2/s T + 4 ACTUAL_IMMOB_NH4 immobilization of NH4 gN/m^3/s F + 5 ACTUAL_IMMOB_NO3 immobilization of NO3 gN/m^3/s F + 6 ACTUAL_IMMOB_vr actual N immobilization gN/m^3/s F + 7 AGNPP aboveground NPP gC/m^2/s T + 8 ALBD surface albedo (direct) proportion T + 9 ALBDSF diagnostic snow-free surface albedo (direct) proportion T + 10 ALBGRD ground albedo (direct) proportion F + 11 ALBGRI ground albedo (indirect) proportion F + 12 ALBI surface albedo (indirect) proportion T + 13 ALBISF diagnostic snow-free surface albedo (indirect) proportion T + 14 ALPHA alpha coefficient for VOC calc non F + 15 ALT current active layer thickness m T + 16 ALTMAX maximum annual active layer thickness m T + 17 ALTMAX_LASTYEAR maximum prior year active layer thickness m F + 18 ANNAVG_T2M annual average 2m air temperature K F + 19 ANNMAX_RETRANSN annual max of retranslocated N pool gN/m^2 F + 20 ANNSUM_COUNTER seconds since last annual accumulator turnover s F + 21 ANNSUM_NPP annual sum of NPP gC/m^2/yr F + 22 ANNSUM_POTENTIAL_GPP annual sum of potential GPP gN/m^2/yr F + 23 APPAR_TEMP 2 m apparent temperature C T + 24 APPAR_TEMP_R Rural 2 m apparent temperature C T + 25 APPAR_TEMP_U Urban 2 m apparent temperature C T + 26 AR autotrophic respiration (MR + GR) gC/m^2/s T + 27 ATM_TOPO atmospheric surface height m T + 28 AVAILC C flux available for allocation gC/m^2/s F + 29 AVAIL_RETRANSN N flux available from retranslocation pool gN/m^2/s F + 30 AnnET Annual ET mm/s F + 31 BAF_CROP fractional area burned for crop s-1 T + 32 BAF_PEATF fractional area burned in peatland s-1 T + 33 BCDEP total BC deposition (dry+wet) from atmosphere kg/m^2/s T + 34 BETA coefficient of convective velocity none F + 35 BGLFR background litterfall rate 1/s F + 36 BGNPP belowground NPP gC/m^2/s T + 37 BGTR background transfer growth rate 1/s F + 38 BTRANMN daily minimum of transpiration beta factor unitless T + 39 CANNAVG_T2M annual average of 2m air temperature K F + 40 CANNSUM_NPP annual sum of column-level NPP gC/m^2/s F + 41 CGRND deriv. of soil energy flux wrt to soil temp W/m^2/K F + 42 CGRNDL deriv. of soil latent heat flux wrt soil temp W/m^2/K F + 43 CGRNDS deriv. of soil sensible heat flux wrt soil temp W/m^2/K F + 44 CH4PROD Gridcell total production of CH4 gC/m2/s T + 45 CH4_EBUL_TOTAL_SAT ebullition surface CH4 flux; (+ to atm) mol/m2/s F + 46 CH4_EBUL_TOTAL_UNSAT ebullition surface CH4 flux; (+ to atm) mol/m2/s F + 47 CH4_SURF_AERE_SAT aerenchyma surface CH4 flux for inundated area; (+ to atm) mol/m2/s T + 48 CH4_SURF_AERE_UNSAT aerenchyma surface CH4 flux for non-inundated area; (+ to atm) mol/m2/s T + 49 CH4_SURF_DIFF_SAT diffusive surface CH4 flux for inundated / lake area; (+ to atm) mol/m2/s T + 50 CH4_SURF_DIFF_UNSAT diffusive surface CH4 flux for non-inundated area; (+ to atm) mol/m2/s T + 51 CH4_SURF_EBUL_SAT ebullition surface CH4 flux for inundated / lake area; (+ to atm) mol/m2/s T + 52 CH4_SURF_EBUL_UNSAT ebullition surface CH4 flux for non-inundated area; (+ to atm) mol/m2/s T + 53 COL_CTRUNC column-level sink for C truncation gC/m^2 F + 54 COL_FIRE_CLOSS total column-level fire C loss for non-peat fires outside land-type converted region gC/m^2/s T + 55 COL_FIRE_NLOSS total column-level fire N loss gN/m^2/s T + 56 COL_NTRUNC column-level sink for N truncation gN/m^2 F + 57 CONC_CH4_SAT CH4 soil Concentration for inundated / lake area mol/m3 F + 58 CONC_CH4_UNSAT CH4 soil Concentration for non-inundated area mol/m3 F + 59 CONC_O2_SAT O2 soil Concentration for inundated / lake area mol/m3 T + 60 CONC_O2_UNSAT O2 soil Concentration for non-inundated area mol/m3 T + 61 COST_NACTIVE Cost of active uptake gN/gC T + 62 COST_NFIX Cost of fixation gN/gC T + 63 COST_NRETRANS Cost of retranslocation gN/gC T + 64 COSZEN cosine of solar zenith angle none F + 65 CPHASE crop phenology phase 0-not planted, 1-planted, 2-leaf emerge, 3-grain fill, 4-harvest T + 66 CPOOL temporary photosynthate C pool gC/m^2 T + 67 CPOOL_DEADCROOT_GR dead coarse root growth respiration gC/m^2/s F + 68 CPOOL_DEADCROOT_STORAGE_GR dead coarse root growth respiration to storage gC/m^2/s F + 69 CPOOL_DEADSTEM_GR dead stem growth respiration gC/m^2/s F + 70 CPOOL_DEADSTEM_STORAGE_GR dead stem growth respiration to storage gC/m^2/s F + 71 CPOOL_FROOT_GR fine root growth respiration gC/m^2/s F + 72 CPOOL_FROOT_STORAGE_GR fine root growth respiration to storage gC/m^2/s F + 73 CPOOL_LEAF_GR leaf growth respiration gC/m^2/s F + 74 CPOOL_LEAF_STORAGE_GR leaf growth respiration to storage gC/m^2/s F + 75 CPOOL_LIVECROOT_GR live coarse root growth respiration gC/m^2/s F + 76 CPOOL_LIVECROOT_STORAGE_GR live coarse root growth respiration to storage gC/m^2/s F + 77 CPOOL_LIVESTEM_GR live stem growth respiration gC/m^2/s F + 78 CPOOL_LIVESTEM_STORAGE_GR live stem growth respiration to storage gC/m^2/s F + 79 CPOOL_TO_DEADCROOTC allocation to dead coarse root C gC/m^2/s F + 80 CPOOL_TO_DEADCROOTC_STORAGE allocation to dead coarse root C storage gC/m^2/s F + 81 CPOOL_TO_DEADSTEMC allocation to dead stem C gC/m^2/s F + 82 CPOOL_TO_DEADSTEMC_STORAGE allocation to dead stem C storage gC/m^2/s F + 83 CPOOL_TO_FROOTC allocation to fine root C gC/m^2/s F + 84 CPOOL_TO_FROOTC_STORAGE allocation to fine root C storage gC/m^2/s F + 85 CPOOL_TO_GRESP_STORAGE allocation to growth respiration storage gC/m^2/s F + 86 CPOOL_TO_LEAFC allocation to leaf C gC/m^2/s F + 87 CPOOL_TO_LEAFC_STORAGE allocation to leaf C storage gC/m^2/s F + 88 CPOOL_TO_LIVECROOTC allocation to live coarse root C gC/m^2/s F + 89 CPOOL_TO_LIVECROOTC_STORAGE allocation to live coarse root C storage gC/m^2/s F + 90 CPOOL_TO_LIVESTEMC allocation to live stem C gC/m^2/s F + 91 CPOOL_TO_LIVESTEMC_STORAGE allocation to live stem C storage gC/m^2/s F + 92 CROOT_PROF profile for litter C and N inputs from coarse roots 1/m F + 93 CROPPROD1C 1-yr crop product (grain+biofuel) C gC/m^2 T + 94 CROPPROD1C_LOSS loss from 1-yr crop product pool gC/m^2/s T + 95 CROPPROD1N 1-yr crop product (grain+biofuel) N gN/m^2 T + 96 CROPPROD1N_LOSS loss from 1-yr crop product pool gN/m^2/s T + 97 CROPSEEDC_DEFICIT C used for crop seed that needs to be repaid gC/m^2 T + 98 CROPSEEDN_DEFICIT N used for crop seed that needs to be repaid gN/m^2 F + 99 CROP_SEEDC_TO_LEAF crop seed source to leaf gC/m^2/s F + 100 CROP_SEEDN_TO_LEAF crop seed source to leaf gN/m^2/s F + 101 CURRENT_GR growth resp for new growth displayed in this timestep gC/m^2/s F + 102 CWDC CWD C gC/m^2 T + 103 CWDC_1m CWD C to 1 meter gC/m^2 F + 104 CWDC_LOSS coarse woody debris C loss gC/m^2/s T + 105 CWDC_TO_LITR2C decomp. of coarse woody debris C to litter 2 C gC/m^2/s F + 106 CWDC_TO_LITR2C_vr decomp. of coarse woody debris C to litter 2 C gC/m^3/s F + 107 CWDC_TO_LITR3C decomp. of coarse woody debris C to litter 3 C gC/m^2/s F + 108 CWDC_TO_LITR3C_vr decomp. of coarse woody debris C to litter 3 C gC/m^3/s F + 109 CWDC_vr CWD C (vertically resolved) gC/m^3 T + 110 CWDN CWD N gN/m^2 T + 111 CWDN_1m CWD N to 1 meter gN/m^2 F + 112 CWDN_TO_LITR2N decomp. of coarse woody debris N to litter 2 N gN/m^2 F + 113 CWDN_TO_LITR2N_vr decomp. of coarse woody debris N to litter 2 N gN/m^3 F + 114 CWDN_TO_LITR3N decomp. of coarse woody debris N to litter 3 N gN/m^2 F + 115 CWDN_TO_LITR3N_vr decomp. of coarse woody debris N to litter 3 N gN/m^3 F + 116 CWDN_vr CWD N (vertically resolved) gN/m^3 T + 117 C_ALLOMETRY C allocation index none F + 118 DAYL daylength s F + 119 DAYS_ACTIVE number of days since last dormancy days F + 120 DEADCROOTC dead coarse root C gC/m^2 T + 121 DEADCROOTC_STORAGE dead coarse root C storage gC/m^2 F + 122 DEADCROOTC_STORAGE_TO_XFER dead coarse root C shift storage to transfer gC/m^2/s F + 123 DEADCROOTC_XFER dead coarse root C transfer gC/m^2 F + 124 DEADCROOTC_XFER_TO_DEADCROOTC dead coarse root C growth from storage gC/m^2/s F + 125 DEADCROOTN dead coarse root N gN/m^2 T + 126 DEADCROOTN_STORAGE dead coarse root N storage gN/m^2 F + 127 DEADCROOTN_STORAGE_TO_XFER dead coarse root N shift storage to transfer gN/m^2/s F + 128 DEADCROOTN_XFER dead coarse root N transfer gN/m^2 F + 129 DEADCROOTN_XFER_TO_DEADCROOTN dead coarse root N growth from storage gN/m^2/s F + 130 DEADSTEMC dead stem C gC/m^2 T + 131 DEADSTEMC_STORAGE dead stem C storage gC/m^2 F + 132 DEADSTEMC_STORAGE_TO_XFER dead stem C shift storage to transfer gC/m^2/s F + 133 DEADSTEMC_XFER dead stem C transfer gC/m^2 F + 134 DEADSTEMC_XFER_TO_DEADSTEMC dead stem C growth from storage gC/m^2/s F + 135 DEADSTEMN dead stem N gN/m^2 T + 136 DEADSTEMN_STORAGE dead stem N storage gN/m^2 F + 137 DEADSTEMN_STORAGE_TO_XFER dead stem N shift storage to transfer gN/m^2/s F + 138 DEADSTEMN_XFER dead stem N transfer gN/m^2 F + 139 DEADSTEMN_XFER_TO_DEADSTEMN dead stem N growth from storage gN/m^2/s F + 140 DENIT total rate of denitrification gN/m^2/s T + 141 DGNETDT derivative of net ground heat flux wrt soil temp W/m^2/K F + 142 DISCOI 2 m Discomfort Index C T + 143 DISCOIS 2 m Stull Discomfort Index C T + 144 DISCOIS_R Rural 2 m Stull Discomfort Index C T + 145 DISCOIS_U Urban 2 m Stull Discomfort Index C T + 146 DISCOI_R Rural 2 m Discomfort Index C T + 147 DISCOI_U Urban 2 m Discomfort Index C T + 148 DISPLA displacement height m F + 149 DISPVEGC displayed veg carbon, excluding storage and cpool gC/m^2 T + 150 DISPVEGN displayed vegetation nitrogen gN/m^2 T + 151 DLRAD downward longwave radiation below the canopy W/m^2 F + 152 DORMANT_FLAG dormancy flag none F + 153 DOWNREG fractional reduction in GPP due to N limitation proportion F + 154 DPVLTRB1 turbulent deposition velocity 1 m/s F + 155 DPVLTRB2 turbulent deposition velocity 2 m/s F + 156 DPVLTRB3 turbulent deposition velocity 3 m/s F + 157 DPVLTRB4 turbulent deposition velocity 4 m/s F + 158 DSL dry surface layer thickness mm T + 159 DSTDEP total dust deposition (dry+wet) from atmosphere kg/m^2/s T + 160 DSTFLXT total surface dust emission kg/m2/s T + 161 DT_VEG change in t_veg, last iteration K F + 162 DWT_CONV_CFLUX conversion C flux (immediate loss to atm) (0 at all times except first timestep of year) gC/m^2/s T + 163 DWT_CONV_CFLUX_DRIBBLED conversion C flux (immediate loss to atm), dribbled throughout the year gC/m^2/s T + 164 DWT_CONV_CFLUX_PATCH patch-level conversion C flux (immediate loss to atm) (0 at all times except first timestep of gC/m^2/s F + 165 DWT_CONV_NFLUX conversion N flux (immediate loss to atm) (0 at all times except first timestep of year) gN/m^2/s T + 166 DWT_CONV_NFLUX_PATCH patch-level conversion N flux (immediate loss to atm) (0 at all times except first timestep of gN/m^2/s F + 167 DWT_CROPPROD1C_GAIN landcover change-driven addition to 1-year crop product pool gC/m^2/s T + 168 DWT_CROPPROD1N_GAIN landcover change-driven addition to 1-year crop product pool gN/m^2/s T + 169 DWT_DEADCROOTC_TO_CWDC dead coarse root to CWD due to landcover change gC/m^2/s F + 170 DWT_DEADCROOTN_TO_CWDN dead coarse root to CWD due to landcover change gN/m^2/s F + 171 DWT_FROOTC_TO_LITR_CEL_C fine root to litter due to landcover change gC/m^2/s F + 172 DWT_FROOTC_TO_LITR_LIG_C fine root to litter due to landcover change gC/m^2/s F + 173 DWT_FROOTC_TO_LITR_MET_C fine root to litter due to landcover change gC/m^2/s F + 174 DWT_FROOTN_TO_LITR_CEL_N fine root to litter due to landcover change gN/m^2/s F + 175 DWT_FROOTN_TO_LITR_LIG_N fine root to litter due to landcover change gN/m^2/s F + 176 DWT_FROOTN_TO_LITR_MET_N fine root to litter due to landcover change gN/m^2/s F + 177 DWT_LIVECROOTC_TO_CWDC live coarse root to CWD due to landcover change gC/m^2/s F + 178 DWT_LIVECROOTN_TO_CWDN live coarse root to CWD due to landcover change gN/m^2/s F + 179 DWT_PROD100C_GAIN landcover change-driven addition to 100-yr wood product pool gC/m^2/s F + 180 DWT_PROD100N_GAIN landcover change-driven addition to 100-yr wood product pool gN/m^2/s F + 181 DWT_PROD10C_GAIN landcover change-driven addition to 10-yr wood product pool gC/m^2/s F + 182 DWT_PROD10N_GAIN landcover change-driven addition to 10-yr wood product pool gN/m^2/s F + 183 DWT_SEEDC_TO_DEADSTEM seed source to patch-level deadstem gC/m^2/s F + 184 DWT_SEEDC_TO_DEADSTEM_PATCH patch-level seed source to patch-level deadstem (per-area-gridcell; only makes sense with dov2 gC/m^2/s F + 185 DWT_SEEDC_TO_LEAF seed source to patch-level leaf gC/m^2/s F + 186 DWT_SEEDC_TO_LEAF_PATCH patch-level seed source to patch-level leaf (per-area-gridcell; only makes sense with dov2xy=. gC/m^2/s F + 187 DWT_SEEDN_TO_DEADSTEM seed source to patch-level deadstem gN/m^2/s T + 188 DWT_SEEDN_TO_DEADSTEM_PATCH patch-level seed source to patch-level deadstem (per-area-gridcell; only makes sense with dov2 gN/m^2/s F + 189 DWT_SEEDN_TO_LEAF seed source to patch-level leaf gN/m^2/s T + 190 DWT_SEEDN_TO_LEAF_PATCH patch-level seed source to patch-level leaf (per-area-gridcell; only makes sense with dov2xy=. gN/m^2/s F + 191 DWT_SLASH_CFLUX slash C flux (to litter diagnostic only) (0 at all times except first timestep of year) gC/m^2/s T + 192 DWT_SLASH_CFLUX_PATCH patch-level slash C flux (to litter diagnostic only) (0 at all times except first timestep of gC/m^2/s F + 193 DWT_WOODPRODC_GAIN landcover change-driven addition to wood product pools gC/m^2/s T + 194 DWT_WOODPRODN_GAIN landcover change-driven addition to wood product pools gN/m^2/s T + 195 DWT_WOOD_PRODUCTC_GAIN_PATCH patch-level landcover change-driven addition to wood product pools(0 at all times except first gC/m^2/s F + 196 DYN_COL_ADJUSTMENTS_CH4 Adjustments in ch4 due to dynamic column areas; only makes sense at the column level: should n gC/m^2 F + 197 DYN_COL_SOIL_ADJUSTMENTS_C Adjustments in soil carbon due to dynamic column areas; only makes sense at the column level: gC/m^2 F + 198 DYN_COL_SOIL_ADJUSTMENTS_N Adjustments in soil nitrogen due to dynamic column areas; only makes sense at the column level gN/m^2 F + 199 DYN_COL_SOIL_ADJUSTMENTS_NH4 Adjustments in soil NH4 due to dynamic column areas; only makes sense at the column level: sho gN/m^2 F + 200 DYN_COL_SOIL_ADJUSTMENTS_NO3 Adjustments in soil NO3 due to dynamic column areas; only makes sense at the column level: sho gN/m^2 F + 201 EFF_POROSITY effective porosity = porosity - vol_ice proportion F + 202 EFLXBUILD building heat flux from change in interior building air temperature W/m^2 T + 203 EFLX_DYNBAL dynamic land cover change conversion energy flux W/m^2 T + 204 EFLX_GNET net heat flux into ground W/m^2 F + 205 EFLX_GRND_LAKE net heat flux into lake/snow surface, excluding light transmission W/m^2 T + 206 EFLX_LH_TOT total latent heat flux [+ to atm] W/m^2 T + 207 EFLX_LH_TOT_ICE total latent heat flux [+ to atm] (ice landunits only) W/m^2 F + 208 EFLX_LH_TOT_R Rural total evaporation W/m^2 T + 209 EFLX_LH_TOT_U Urban total evaporation W/m^2 F + 210 EFLX_SOIL_GRND soil heat flux [+ into soil] W/m^2 F + 211 ELAI exposed one-sided leaf area index m^2/m^2 T + 212 EMG ground emissivity proportion F + 213 EMV vegetation emissivity proportion F + 214 EOPT Eopt coefficient for VOC calc non F + 215 EPT 2 m Equiv Pot Temp K T + 216 EPT_R Rural 2 m Equiv Pot Temp K T + 217 EPT_U Urban 2 m Equiv Pot Temp K T + 218 ER total ecosystem respiration, autotrophic + heterotrophic gC/m^2/s T + 219 ERRH2O total water conservation error mm T + 220 ERRH2OSNO imbalance in snow depth (liquid water) mm T + 221 ERRSEB surface energy conservation error W/m^2 T + 222 ERRSOI soil/lake energy conservation error W/m^2 T + 223 ERRSOL solar radiation conservation error W/m^2 T + 224 ESAI exposed one-sided stem area index m^2/m^2 T + 225 EXCESSC_MR excess C maintenance respiration gC/m^2/s F + 226 EXCESS_CFLUX C flux not allocated due to downregulation gC/m^2/s F + 227 FAREA_BURNED timestep fractional area burned s-1 T + 228 FCANSNO fraction of canopy that is wet proportion F + 229 FCEV canopy evaporation W/m^2 T + 230 FCH4 Gridcell surface CH4 flux to atmosphere (+ to atm) kgC/m2/s T + 231 FCH4TOCO2 Gridcell oxidation of CH4 to CO2 gC/m2/s T + 232 FCH4_DFSAT CH4 additional flux due to changing fsat, natural vegetated and crop landunits only kgC/m2/s T + 233 FCO2 CO2 flux to atmosphere (+ to atm) kgCO2/m2/s F + 234 FCOV fractional impermeable area unitless T + 235 FCTR canopy transpiration W/m^2 T + 236 FDRY fraction of foliage that is green and dry proportion F + 237 FERTNITRO Nitrogen fertilizer for each crop gN/m2/yr F + 238 FERT_COUNTER time left to fertilize seconds F + 239 FERT_TO_SMINN fertilizer to soil mineral N gN/m^2/s F + 240 FFIX_TO_SMINN free living N fixation to soil mineral N gN/m^2/s T + 241 FGEV ground evaporation W/m^2 T + 242 FGR heat flux into soil/snow including snow melt and lake / snow light transmission W/m^2 T + 243 FGR12 heat flux between soil layers 1 and 2 W/m^2 T + 244 FGR_ICE heat flux into soil/snow including snow melt and lake / snow light transmission (ice landunits W/m^2 F + 245 FGR_R Rural heat flux into soil/snow including snow melt and snow light transmission W/m^2 F + 246 FGR_SOIL_R Rural downward heat flux at interface below each soil layer watt/m^2 F + 247 FGR_U Urban heat flux into soil/snow including snow melt W/m^2 F + 248 FH2OSFC fraction of ground covered by surface water unitless T + 249 FH2OSFC_NOSNOW fraction of ground covered by surface water (if no snow present) unitless F + 250 FINUNDATED fractional inundated area of vegetated columns unitless T + 251 FINUNDATED_LAG time-lagged inundated fraction of vegetated columns unitless F + 252 FIRA net infrared (longwave) radiation W/m^2 T + 253 FIRA_ICE net infrared (longwave) radiation (ice landunits only) W/m^2 F + 254 FIRA_R Rural net infrared (longwave) radiation W/m^2 T + 255 FIRA_U Urban net infrared (longwave) radiation W/m^2 F + 256 FIRE emitted infrared (longwave) radiation W/m^2 T + 257 FIRE_ICE emitted infrared (longwave) radiation (ice landunits only) W/m^2 F + 258 FIRE_R Rural emitted infrared (longwave) radiation W/m^2 T + 259 FIRE_U Urban emitted infrared (longwave) radiation W/m^2 F + 260 FLDS atmospheric longwave radiation (downscaled to columns in glacier regions) W/m^2 T + 261 FLDS_ICE atmospheric longwave radiation (downscaled to columns in glacier regions) (ice landunits only) W/m^2 F + 262 FMAX_DENIT_CARBONSUBSTRATE FMAX_DENIT_CARBONSUBSTRATE gN/m^3/s F + 263 FMAX_DENIT_NITRATE FMAX_DENIT_NITRATE gN/m^3/s F + 264 FPI fraction of potential immobilization proportion T + 265 FPI_vr fraction of potential immobilization proportion F + 266 FPSN photosynthesis umol m-2 s-1 T + 267 FPSN24 24 hour accumulative patch photosynthesis starting from mid-night umol CO2/m^2 ground/day F + 268 FPSN_WC Rubisco-limited photosynthesis umol m-2 s-1 F + 269 FPSN_WJ RuBP-limited photosynthesis umol m-2 s-1 F + 270 FPSN_WP Product-limited photosynthesis umol m-2 s-1 F + 271 FRAC_ICEOLD fraction of ice relative to the tot water proportion F + 272 FREE_RETRANSN_TO_NPOOL deployment of retranslocated N gN/m^2/s T + 273 FROOTC fine root C gC/m^2 T + 274 FROOTC_ALLOC fine root C allocation gC/m^2/s T + 275 FROOTC_LOSS fine root C loss gC/m^2/s T + 276 FROOTC_STORAGE fine root C storage gC/m^2 F + 277 FROOTC_STORAGE_TO_XFER fine root C shift storage to transfer gC/m^2/s F + 278 FROOTC_TO_LITTER fine root C litterfall gC/m^2/s F + 279 FROOTC_XFER fine root C transfer gC/m^2 F + 280 FROOTC_XFER_TO_FROOTC fine root C growth from storage gC/m^2/s F + 281 FROOTN fine root N gN/m^2 T + 282 FROOTN_STORAGE fine root N storage gN/m^2 F + 283 FROOTN_STORAGE_TO_XFER fine root N shift storage to transfer gN/m^2/s F + 284 FROOTN_TO_LITTER fine root N litterfall gN/m^2/s F + 285 FROOTN_XFER fine root N transfer gN/m^2 F + 286 FROOTN_XFER_TO_FROOTN fine root N growth from storage gN/m^2/s F + 287 FROOT_MR fine root maintenance respiration gC/m^2/s F + 288 FROOT_PROF profile for litter C and N inputs from fine roots 1/m F + 289 FROST_TABLE frost table depth (natural vegetated and crop landunits only) m F + 290 FSA absorbed solar radiation W/m^2 T + 291 FSAT fractional area with water table at surface unitless T + 292 FSA_ICE absorbed solar radiation (ice landunits only) W/m^2 F + 293 FSA_R Rural absorbed solar radiation W/m^2 F + 294 FSA_U Urban absorbed solar radiation W/m^2 F + 295 FSD24 direct radiation (last 24hrs) K F + 296 FSD240 direct radiation (last 240hrs) K F + 297 FSDS atmospheric incident solar radiation W/m^2 T + 298 FSDSND direct nir incident solar radiation W/m^2 T + 299 FSDSNDLN direct nir incident solar radiation at local noon W/m^2 T + 300 FSDSNI diffuse nir incident solar radiation W/m^2 T + 301 FSDSVD direct vis incident solar radiation W/m^2 T + 302 FSDSVDLN direct vis incident solar radiation at local noon W/m^2 T + 303 FSDSVI diffuse vis incident solar radiation W/m^2 T + 304 FSDSVILN diffuse vis incident solar radiation at local noon W/m^2 T + 305 FSH sensible heat not including correction for land use change and rain/snow conversion W/m^2 T + 306 FSH_G sensible heat from ground W/m^2 T + 307 FSH_ICE sensible heat not including correction for land use change and rain/snow conversion (ice landu W/m^2 F + 308 FSH_PRECIP_CONVERSION Sensible heat flux from conversion of rain/snow atm forcing W/m^2 T + 309 FSH_R Rural sensible heat W/m^2 T + 310 FSH_RUNOFF_ICE_TO_LIQ sensible heat flux generated from conversion of ice runoff to liquid W/m^2 T + 311 FSH_TO_COUPLER sensible heat sent to coupler (includes corrections for land use change, rain/snow conversion W/m^2 T + 312 FSH_U Urban sensible heat W/m^2 F + 313 FSH_V sensible heat from veg W/m^2 T + 314 FSI24 indirect radiation (last 24hrs) K F + 315 FSI240 indirect radiation (last 240hrs) K F + 316 FSM snow melt heat flux W/m^2 T + 317 FSM_ICE snow melt heat flux (ice landunits only) W/m^2 F + 318 FSM_R Rural snow melt heat flux W/m^2 F + 319 FSM_U Urban snow melt heat flux W/m^2 F + 320 FSNO fraction of ground covered by snow unitless T + 321 FSNO_EFF effective fraction of ground covered by snow unitless T + 322 FSNO_ICE fraction of ground covered by snow (ice landunits only) unitless F + 323 FSR reflected solar radiation W/m^2 T + 324 FSRND direct nir reflected solar radiation W/m^2 T + 325 FSRNDLN direct nir reflected solar radiation at local noon W/m^2 T + 326 FSRNI diffuse nir reflected solar radiation W/m^2 T + 327 FSRSF reflected solar radiation W/m^2 T + 328 FSRSFND direct nir reflected solar radiation W/m^2 T + 329 FSRSFNDLN direct nir reflected solar radiation at local noon W/m^2 T + 330 FSRSFNI diffuse nir reflected solar radiation W/m^2 T + 331 FSRSFVD direct vis reflected solar radiation W/m^2 T + 332 FSRSFVDLN direct vis reflected solar radiation at local noon W/m^2 T + 333 FSRSFVI diffuse vis reflected solar radiation W/m^2 T + 334 FSRVD direct vis reflected solar radiation W/m^2 T + 335 FSRVDLN direct vis reflected solar radiation at local noon W/m^2 T + 336 FSRVI diffuse vis reflected solar radiation W/m^2 T + 337 FSR_ICE reflected solar radiation (ice landunits only) W/m^2 F + 338 FSUN sunlit fraction of canopy proportion F + 339 FSUN24 fraction sunlit (last 24hrs) K F + 340 FSUN240 fraction sunlit (last 240hrs) K F + 341 FUELC fuel load gC/m^2 T + 342 FV friction velocity for dust model m/s F + 343 FWET fraction of canopy that is wet proportion F + 344 F_DENIT denitrification flux gN/m^2/s T + 345 F_DENIT_BASE F_DENIT_BASE gN/m^3/s F + 346 F_DENIT_vr denitrification flux gN/m^3/s F + 347 F_N2O_DENIT denitrification N2O flux gN/m^2/s T + 348 F_N2O_NIT nitrification N2O flux gN/m^2/s T + 349 F_NIT nitrification flux gN/m^2/s T + 350 F_NIT_vr nitrification flux gN/m^3/s F + 351 FireComp_BC fire emissions flux of BC kg/m2/sec F + 352 FireComp_OC fire emissions flux of OC kg/m2/sec F + 353 FireComp_SO2 fire emissions flux of SO2 kg/m2/sec F + 354 FireEmis_TOT Total fire emissions flux gC/m2/sec F + 355 FireEmis_ZTOP Top of vertical fire emissions distribution m F + 356 FireMech_SO2 fire emissions flux of SO2 kg/m2/sec F + 357 FireMech_bc_a1 fire emissions flux of bc_a1 kg/m2/sec F + 358 FireMech_pom_a1 fire emissions flux of pom_a1 kg/m2/sec F + 359 GAMMA total gamma for VOC calc non F + 360 GAMMAA gamma A for VOC calc non F + 361 GAMMAC gamma C for VOC calc non F + 362 GAMMAL gamma L for VOC calc non F + 363 GAMMAP gamma P for VOC calc non F + 364 GAMMAS gamma S for VOC calc non F + 365 GAMMAT gamma T for VOC calc non F + 366 GDD0 Growing degree days base 0C from planting ddays F + 367 GDD020 Twenty year average of growing degree days base 0C from planting ddays F + 368 GDD10 Growing degree days base 10C from planting ddays F + 369 GDD1020 Twenty year average of growing degree days base 10C from planting ddays F + 370 GDD8 Growing degree days base 8C from planting ddays F + 371 GDD820 Twenty year average of growing degree days base 8C from planting ddays F + 372 GDDHARV Growing degree days (gdd) needed to harvest ddays F + 373 GDDPLANT Accumulated growing degree days past planting date for crop ddays F + 374 GDDTSOI Growing degree-days from planting (top two soil layers) ddays F + 375 GPP gross primary production gC/m^2/s T + 376 GR total growth respiration gC/m^2/s T + 377 GRAINC grain C (does not equal yield) gC/m^2 T + 378 GRAINC_TO_FOOD grain C to food gC/m^2/s T + 379 GRAINC_TO_SEED grain C to seed gC/m^2/s T + 380 GRAINN grain N gN/m^2 T + 381 GRESP_STORAGE growth respiration storage gC/m^2 F + 382 GRESP_STORAGE_TO_XFER growth respiration shift storage to transfer gC/m^2/s F + 383 GRESP_XFER growth respiration transfer gC/m^2 F + 384 GROSS_NMIN gross rate of N mineralization gN/m^2/s T + 385 GROSS_NMIN_vr gross rate of N mineralization gN/m^3/s F + 386 GSSHA shaded leaf stomatal conductance umol H20/m2/s T + 387 GSSHALN shaded leaf stomatal conductance at local noon umol H20/m2/s T + 388 GSSUN sunlit leaf stomatal conductance umol H20/m2/s T + 389 GSSUNLN sunlit leaf stomatal conductance at local noon umol H20/m2/s T + 390 H2OCAN intercepted water mm T + 391 H2OSFC surface water depth mm T + 392 H2OSNO snow depth (liquid water) mm T + 393 H2OSNO_ICE snow depth (liquid water, ice landunits only) mm F + 394 H2OSNO_TOP mass of snow in top snow layer kg/m2 T + 395 H2OSOI volumetric soil water (natural vegetated and crop landunits only) mm3/mm3 T + 396 HBOT canopy bottom m F + 397 HEAT_CONTENT1 initial gridcell total heat content J/m^2 T + 398 HEAT_CONTENT1_VEG initial gridcell total heat content - natural vegetated and crop landunits only J/m^2 F + 399 HEAT_CONTENT2 post land cover change total heat content J/m^2 F + 400 HEAT_FROM_AC sensible heat flux put into canyon due to heat removed from air conditioning W/m^2 T + 401 HIA 2 m NWS Heat Index C T + 402 HIA_R Rural 2 m NWS Heat Index C T + 403 HIA_U Urban 2 m NWS Heat Index C T + 404 HK hydraulic conductivity (natural vegetated and crop landunits only) mm/s F + 405 HR total heterotrophic respiration gC/m^2/s T + 406 HR_vr total vertically resolved heterotrophic respiration gC/m^3/s T + 407 HTOP canopy top m T + 408 HUMIDEX 2 m Humidex C T + 409 HUMIDEX_R Rural 2 m Humidex C T + 410 HUMIDEX_U Urban 2 m Humidex C T + 411 ICE_CONTENT1 initial gridcell total ice content mm T + 412 ICE_CONTENT2 post land cover change total ice content mm F + 413 ICE_MODEL_FRACTION Ice sheet model fractional coverage unitless F + 414 INIT_GPP GPP flux before downregulation gC/m^2/s F + 415 INT_SNOW accumulated swe (natural vegetated and crop landunits only) mm F + 416 INT_SNOW_ICE accumulated swe (ice landunits only) mm F + 417 JMX25T canopy profile of jmax umol/m2/s T + 418 Jmx25Z maximum rate of electron transport at 25 Celcius for canopy layers umol electrons/m2/s T + 419 KROOT root conductance each soil layer 1/s F + 420 KSOIL soil conductance in each soil layer 1/s F + 421 K_CWD coarse woody debris potential loss coefficient 1/s F + 422 K_LITR1 litter 1 potential loss coefficient 1/s F + 423 K_LITR2 litter 2 potential loss coefficient 1/s F + 424 K_LITR3 litter 3 potential loss coefficient 1/s F + 425 K_NITR K_NITR 1/s F + 426 K_NITR_H2O K_NITR_H2O unitless F + 427 K_NITR_PH K_NITR_PH unitless F + 428 K_NITR_T K_NITR_T unitless F + 429 K_SOIL1 soil 1 potential loss coefficient 1/s F + 430 K_SOIL2 soil 2 potential loss coefficient 1/s F + 431 K_SOIL3 soil 3 potential loss coefficient 1/s F + 432 LAI240 240hr average of leaf area index m^2/m^2 F + 433 LAISHA shaded projected leaf area index m^2/m^2 T + 434 LAISUN sunlit projected leaf area index m^2/m^2 T + 435 LAKEICEFRAC lake layer ice mass fraction unitless F + 436 LAKEICEFRAC_SURF surface lake layer ice mass fraction unitless T + 437 LAKEICETHICK thickness of lake ice (including physical expansion on freezing) m T + 438 LAND_USE_FLUX total C emitted from land cover conversion (smoothed over the year) and wood and grain product gC/m^2/s T + 439 LATBASET latitude vary base temperature for gddplant degree C F + 440 LEAFC leaf C gC/m^2 T + 441 LEAFCN Leaf CN ratio used for flexible CN gC/gN T + 442 LEAFCN_OFFSET Leaf C:N used by FUN unitless F + 443 LEAFCN_STORAGE Storage Leaf CN ratio used for flexible CN gC/gN F + 444 LEAFC_ALLOC leaf C allocation gC/m^2/s T + 445 LEAFC_CHANGE C change in leaf gC/m^2/s T + 446 LEAFC_LOSS leaf C loss gC/m^2/s T + 447 LEAFC_STORAGE leaf C storage gC/m^2 F + 448 LEAFC_STORAGE_TO_XFER leaf C shift storage to transfer gC/m^2/s F + 449 LEAFC_STORAGE_XFER_ACC Accumulated leaf C transfer gC/m^2 F + 450 LEAFC_TO_BIOFUELC leaf C to biofuel C gC/m^2/s T + 451 LEAFC_TO_LITTER leaf C litterfall gC/m^2/s F + 452 LEAFC_TO_LITTER_FUN leaf C litterfall used by FUN gC/m^2/s T + 453 LEAFC_XFER leaf C transfer gC/m^2 F + 454 LEAFC_XFER_TO_LEAFC leaf C growth from storage gC/m^2/s F + 455 LEAFN leaf N gN/m^2 T + 456 LEAFN_STORAGE leaf N storage gN/m^2 F + 457 LEAFN_STORAGE_TO_XFER leaf N shift storage to transfer gN/m^2/s F + 458 LEAFN_STORAGE_XFER_ACC Accmulated leaf N transfer gN/m^2 F + 459 LEAFN_TO_LITTER leaf N litterfall gN/m^2/s T + 460 LEAFN_TO_RETRANSN leaf N to retranslocated N pool gN/m^2/s F + 461 LEAFN_XFER leaf N transfer gN/m^2 F + 462 LEAFN_XFER_TO_LEAFN leaf N growth from storage gN/m^2/s F + 463 LEAF_MR leaf maintenance respiration gC/m^2/s T + 464 LEAF_PROF profile for litter C and N inputs from leaves 1/m F + 465 LFC2 conversion area fraction of BET and BDT that burned per sec T + 466 LGSF long growing season factor proportion F + 467 LIQCAN intercepted liquid water mm T + 468 LIQUID_CONTENT1 initial gridcell total liq content mm T + 469 LIQUID_CONTENT2 post landuse change gridcell total liq content mm F + 470 LIQUID_WATER_TEMP1 initial gridcell weighted average liquid water temperature K F + 471 LITFALL litterfall (leaves and fine roots) gC/m^2/s T + 472 LITFIRE litter fire losses gC/m^2/s F + 473 LITR1C LITR1 C gC/m^2 T + 474 LITR1C_1m LITR1 C to 1 meter gC/m^2 F + 475 LITR1C_TNDNCY_VERT_TRANS litter 1 C tendency due to vertical transport gC/m^3/s F + 476 LITR1C_TO_SOIL1C decomp. of litter 1 C to soil 1 C gC/m^2/s F + 477 LITR1C_TO_SOIL1C_vr decomp. of litter 1 C to soil 1 C gC/m^3/s F + 478 LITR1C_vr LITR1 C (vertically resolved) gC/m^3 T + 479 LITR1N LITR1 N gN/m^2 T + 480 LITR1N_1m LITR1 N to 1 meter gN/m^2 F + 481 LITR1N_TNDNCY_VERT_TRANS litter 1 N tendency due to vertical transport gN/m^3/s F + 482 LITR1N_TO_SOIL1N decomp. of litter 1 N to soil 1 N gN/m^2 F + 483 LITR1N_TO_SOIL1N_vr decomp. of litter 1 N to soil 1 N gN/m^3 F + 484 LITR1N_vr LITR1 N (vertically resolved) gN/m^3 T + 485 LITR1_HR Het. Resp. from litter 1 gC/m^2/s F + 486 LITR1_HR_vr Het. Resp. from litter 1 gC/m^3/s F + 487 LITR2C LITR2 C gC/m^2 T + 488 LITR2C_1m LITR2 C to 1 meter gC/m^2 F + 489 LITR2C_TNDNCY_VERT_TRANS litter 2 C tendency due to vertical transport gC/m^3/s F + 490 LITR2C_TO_SOIL1C decomp. of litter 2 C to soil 1 C gC/m^2/s F + 491 LITR2C_TO_SOIL1C_vr decomp. of litter 2 C to soil 1 C gC/m^3/s F + 492 LITR2C_vr LITR2 C (vertically resolved) gC/m^3 T + 493 LITR2N LITR2 N gN/m^2 T + 494 LITR2N_1m LITR2 N to 1 meter gN/m^2 F + 495 LITR2N_TNDNCY_VERT_TRANS litter 2 N tendency due to vertical transport gN/m^3/s F + 496 LITR2N_TO_SOIL1N decomp. of litter 2 N to soil 1 N gN/m^2 F + 497 LITR2N_TO_SOIL1N_vr decomp. of litter 2 N to soil 1 N gN/m^3 F + 498 LITR2N_vr LITR2 N (vertically resolved) gN/m^3 T + 499 LITR2_HR Het. Resp. from litter 2 gC/m^2/s F + 500 LITR2_HR_vr Het. Resp. from litter 2 gC/m^3/s F + 501 LITR3C LITR3 C gC/m^2 T + 502 LITR3C_1m LITR3 C to 1 meter gC/m^2 F + 503 LITR3C_TNDNCY_VERT_TRANS litter 3 C tendency due to vertical transport gC/m^3/s F + 504 LITR3C_TO_SOIL2C decomp. of litter 3 C to soil 2 C gC/m^2/s F + 505 LITR3C_TO_SOIL2C_vr decomp. of litter 3 C to soil 2 C gC/m^3/s F + 506 LITR3C_vr LITR3 C (vertically resolved) gC/m^3 T + 507 LITR3N LITR3 N gN/m^2 T + 508 LITR3N_1m LITR3 N to 1 meter gN/m^2 F + 509 LITR3N_TNDNCY_VERT_TRANS litter 3 N tendency due to vertical transport gN/m^3/s F + 510 LITR3N_TO_SOIL2N decomp. of litter 3 N to soil 2 N gN/m^2 F + 511 LITR3N_TO_SOIL2N_vr decomp. of litter 3 N to soil 2 N gN/m^3 F + 512 LITR3N_vr LITR3 N (vertically resolved) gN/m^3 T + 513 LITR3_HR Het. Resp. from litter 3 gC/m^2/s F + 514 LITR3_HR_vr Het. Resp. from litter 3 gC/m^3/s F + 515 LITTERC_HR litter C heterotrophic respiration gC/m^2/s T + 516 LITTERC_LOSS litter C loss gC/m^2/s T + 517 LIVECROOTC live coarse root C gC/m^2 T + 518 LIVECROOTC_STORAGE live coarse root C storage gC/m^2 F + 519 LIVECROOTC_STORAGE_TO_XFER live coarse root C shift storage to transfer gC/m^2/s F + 520 LIVECROOTC_TO_DEADCROOTC live coarse root C turnover gC/m^2/s F + 521 LIVECROOTC_XFER live coarse root C transfer gC/m^2 F + 522 LIVECROOTC_XFER_TO_LIVECROOTC live coarse root C growth from storage gC/m^2/s F + 523 LIVECROOTN live coarse root N gN/m^2 T + 524 LIVECROOTN_STORAGE live coarse root N storage gN/m^2 F + 525 LIVECROOTN_STORAGE_TO_XFER live coarse root N shift storage to transfer gN/m^2/s F + 526 LIVECROOTN_TO_DEADCROOTN live coarse root N turnover gN/m^2/s F + 527 LIVECROOTN_TO_RETRANSN live coarse root N to retranslocated N pool gN/m^2/s F + 528 LIVECROOTN_XFER live coarse root N transfer gN/m^2 F + 529 LIVECROOTN_XFER_TO_LIVECROOTN live coarse root N growth from storage gN/m^2/s F + 530 LIVECROOT_MR live coarse root maintenance respiration gC/m^2/s F + 531 LIVESTEMC live stem C gC/m^2 T + 532 LIVESTEMC_STORAGE live stem C storage gC/m^2 F + 533 LIVESTEMC_STORAGE_TO_XFER live stem C shift storage to transfer gC/m^2/s F + 534 LIVESTEMC_TO_BIOFUELC livestem C to biofuel C gC/m^2/s T + 535 LIVESTEMC_TO_DEADSTEMC live stem C turnover gC/m^2/s F + 536 LIVESTEMC_XFER live stem C transfer gC/m^2 F + 537 LIVESTEMC_XFER_TO_LIVESTEMC live stem C growth from storage gC/m^2/s F + 538 LIVESTEMN live stem N gN/m^2 T + 539 LIVESTEMN_STORAGE live stem N storage gN/m^2 F + 540 LIVESTEMN_STORAGE_TO_XFER live stem N shift storage to transfer gN/m^2/s F + 541 LIVESTEMN_TO_DEADSTEMN live stem N turnover gN/m^2/s F + 542 LIVESTEMN_TO_RETRANSN live stem N to retranslocated N pool gN/m^2/s F + 543 LIVESTEMN_XFER live stem N transfer gN/m^2 F + 544 LIVESTEMN_XFER_TO_LIVESTEMN live stem N growth from storage gN/m^2/s F + 545 LIVESTEM_MR live stem maintenance respiration gC/m^2/s F + 546 LNC leaf N concentration gN leaf/m^2 T + 547 LWdown atmospheric longwave radiation (downscaled to columns in glacier regions) W/m^2 F + 548 LWup upwelling longwave radiation W/m^2 F + 549 MEG_acetaldehyde MEGAN flux kg/m2/sec T + 550 MEG_acetic_acid MEGAN flux kg/m2/sec T + 551 MEG_acetone MEGAN flux kg/m2/sec T + 552 MEG_carene_3 MEGAN flux kg/m2/sec T + 553 MEG_ethanol MEGAN flux kg/m2/sec T + 554 MEG_formaldehyde MEGAN flux kg/m2/sec T + 555 MEG_isoprene MEGAN flux kg/m2/sec T + 556 MEG_methanol MEGAN flux kg/m2/sec T + 557 MEG_pinene_a MEGAN flux kg/m2/sec T + 558 MEG_thujene_a MEGAN flux kg/m2/sec T + 559 MR maintenance respiration gC/m^2/s T + 560 M_CWDC_TO_FIRE coarse woody debris C fire loss gC/m^2/s F + 561 M_CWDC_TO_FIRE_vr coarse woody debris C fire loss gC/m^3/s F + 562 M_CWDN_TO_FIRE coarse woody debris N fire loss gN/m^2 F + 563 M_CWDN_TO_FIRE_vr coarse woody debris N fire loss gN/m^3 F + 564 M_DEADCROOTC_STORAGE_TO_LITTER dead coarse root C storage mortality gC/m^2/s F + 565 M_DEADCROOTC_STORAGE_TO_LITTER_FIRE dead coarse root C storage fire mortality to litter gC/m^2/s F + 566 M_DEADCROOTC_TO_LITTER dead coarse root C mortality gC/m^2/s F + 567 M_DEADCROOTC_XFER_TO_LITTER dead coarse root C transfer mortality gC/m^2/s F + 568 M_DEADCROOTN_STORAGE_TO_FIRE dead coarse root N storage fire loss gN/m^2/s F + 569 M_DEADCROOTN_STORAGE_TO_LITTER dead coarse root N storage mortality gN/m^2/s F + 570 M_DEADCROOTN_TO_FIRE dead coarse root N fire loss gN/m^2/s F + 571 M_DEADCROOTN_TO_LITTER dead coarse root N mortality gN/m^2/s F + 572 M_DEADCROOTN_TO_LITTER_FIRE dead coarse root N fire mortality to litter gN/m^2/s F + 573 M_DEADCROOTN_XFER_TO_FIRE dead coarse root N transfer fire loss gN/m^2/s F + 574 M_DEADCROOTN_XFER_TO_LITTER dead coarse root N transfer mortality gN/m^2/s F + 575 M_DEADROOTC_STORAGE_TO_FIRE dead root C storage fire loss gC/m^2/s F + 576 M_DEADROOTC_STORAGE_TO_LITTER_FIRE dead root C storage fire mortality to litter gC/m^2/s F + 577 M_DEADROOTC_TO_FIRE dead root C fire loss gC/m^2/s F + 578 M_DEADROOTC_TO_LITTER_FIRE dead root C fire mortality to litter gC/m^2/s F + 579 M_DEADROOTC_XFER_TO_FIRE dead root C transfer fire loss gC/m^2/s F + 580 M_DEADROOTC_XFER_TO_LITTER_FIRE dead root C transfer fire mortality to litter gC/m^2/s F + 581 M_DEADSTEMC_STORAGE_TO_FIRE dead stem C storage fire loss gC/m^2/s F + 582 M_DEADSTEMC_STORAGE_TO_LITTER dead stem C storage mortality gC/m^2/s F + 583 M_DEADSTEMC_STORAGE_TO_LITTER_FIRE dead stem C storage fire mortality to litter gC/m^2/s F + 584 M_DEADSTEMC_TO_FIRE dead stem C fire loss gC/m^2/s F + 585 M_DEADSTEMC_TO_LITTER dead stem C mortality gC/m^2/s F + 586 M_DEADSTEMC_TO_LITTER_FIRE dead stem C fire mortality to litter gC/m^2/s F + 587 M_DEADSTEMC_XFER_TO_FIRE dead stem C transfer fire loss gC/m^2/s F + 588 M_DEADSTEMC_XFER_TO_LITTER dead stem C transfer mortality gC/m^2/s F + 589 M_DEADSTEMC_XFER_TO_LITTER_FIRE dead stem C transfer fire mortality to litter gC/m^2/s F + 590 M_DEADSTEMN_STORAGE_TO_FIRE dead stem N storage fire loss gN/m^2/s F + 591 M_DEADSTEMN_STORAGE_TO_LITTER dead stem N storage mortality gN/m^2/s F + 592 M_DEADSTEMN_TO_FIRE dead stem N fire loss gN/m^2/s F + 593 M_DEADSTEMN_TO_LITTER dead stem N mortality gN/m^2/s F + 594 M_DEADSTEMN_TO_LITTER_FIRE dead stem N fire mortality to litter gN/m^2/s F + 595 M_DEADSTEMN_XFER_TO_FIRE dead stem N transfer fire loss gN/m^2/s F + 596 M_DEADSTEMN_XFER_TO_LITTER dead stem N transfer mortality gN/m^2/s F + 597 M_FROOTC_STORAGE_TO_FIRE fine root C storage fire loss gC/m^2/s F + 598 M_FROOTC_STORAGE_TO_LITTER fine root C storage mortality gC/m^2/s F + 599 M_FROOTC_STORAGE_TO_LITTER_FIRE fine root C storage fire mortality to litter gC/m^2/s F + 600 M_FROOTC_TO_FIRE fine root C fire loss gC/m^2/s F + 601 M_FROOTC_TO_LITTER fine root C mortality gC/m^2/s F + 602 M_FROOTC_TO_LITTER_FIRE fine root C fire mortality to litter gC/m^2/s F + 603 M_FROOTC_XFER_TO_FIRE fine root C transfer fire loss gC/m^2/s F + 604 M_FROOTC_XFER_TO_LITTER fine root C transfer mortality gC/m^2/s F + 605 M_FROOTC_XFER_TO_LITTER_FIRE fine root C transfer fire mortality to litter gC/m^2/s F + 606 M_FROOTN_STORAGE_TO_FIRE fine root N storage fire loss gN/m^2/s F + 607 M_FROOTN_STORAGE_TO_LITTER fine root N storage mortality gN/m^2/s F + 608 M_FROOTN_TO_FIRE fine root N fire loss gN/m^2/s F + 609 M_FROOTN_TO_LITTER fine root N mortality gN/m^2/s F + 610 M_FROOTN_XFER_TO_FIRE fine root N transfer fire loss gN/m^2/s F + 611 M_FROOTN_XFER_TO_LITTER fine root N transfer mortality gN/m^2/s F + 612 M_GRESP_STORAGE_TO_FIRE growth respiration storage fire loss gC/m^2/s F + 613 M_GRESP_STORAGE_TO_LITTER growth respiration storage mortality gC/m^2/s F + 614 M_GRESP_STORAGE_TO_LITTER_FIRE growth respiration storage fire mortality to litter gC/m^2/s F + 615 M_GRESP_XFER_TO_FIRE growth respiration transfer fire loss gC/m^2/s F + 616 M_GRESP_XFER_TO_LITTER growth respiration transfer mortality gC/m^2/s F + 617 M_GRESP_XFER_TO_LITTER_FIRE growth respiration transfer fire mortality to litter gC/m^2/s F + 618 M_LEAFC_STORAGE_TO_FIRE leaf C storage fire loss gC/m^2/s F + 619 M_LEAFC_STORAGE_TO_LITTER leaf C storage mortality gC/m^2/s F + 620 M_LEAFC_STORAGE_TO_LITTER_FIRE leaf C fire mortality to litter gC/m^2/s F + 621 M_LEAFC_TO_FIRE leaf C fire loss gC/m^2/s F + 622 M_LEAFC_TO_LITTER leaf C mortality gC/m^2/s F + 623 M_LEAFC_TO_LITTER_FIRE leaf C fire mortality to litter gC/m^2/s F + 624 M_LEAFC_XFER_TO_FIRE leaf C transfer fire loss gC/m^2/s F + 625 M_LEAFC_XFER_TO_LITTER leaf C transfer mortality gC/m^2/s F + 626 M_LEAFC_XFER_TO_LITTER_FIRE leaf C transfer fire mortality to litter gC/m^2/s F + 627 M_LEAFN_STORAGE_TO_FIRE leaf N storage fire loss gN/m^2/s F + 628 M_LEAFN_STORAGE_TO_LITTER leaf N storage mortality gN/m^2/s F + 629 M_LEAFN_TO_FIRE leaf N fire loss gN/m^2/s F + 630 M_LEAFN_TO_LITTER leaf N mortality gN/m^2/s F + 631 M_LEAFN_XFER_TO_FIRE leaf N transfer fire loss gN/m^2/s F + 632 M_LEAFN_XFER_TO_LITTER leaf N transfer mortality gN/m^2/s F + 633 M_LITR1C_TO_FIRE litter 1 C fire loss gC/m^2/s F + 634 M_LITR1C_TO_FIRE_vr litter 1 C fire loss gC/m^3/s F + 635 M_LITR1C_TO_LEACHING litter 1 C leaching loss gC/m^2/s F + 636 M_LITR1N_TO_FIRE litter 1 N fire loss gN/m^2 F + 637 M_LITR1N_TO_FIRE_vr litter 1 N fire loss gN/m^3 F + 638 M_LITR1N_TO_LEACHING litter 1 N leaching loss gN/m^2/s F + 639 M_LITR2C_TO_FIRE litter 2 C fire loss gC/m^2/s F + 640 M_LITR2C_TO_FIRE_vr litter 2 C fire loss gC/m^3/s F + 641 M_LITR2C_TO_LEACHING litter 2 C leaching loss gC/m^2/s F + 642 M_LITR2N_TO_FIRE litter 2 N fire loss gN/m^2 F + 643 M_LITR2N_TO_FIRE_vr litter 2 N fire loss gN/m^3 F + 644 M_LITR2N_TO_LEACHING litter 2 N leaching loss gN/m^2/s F + 645 M_LITR3C_TO_FIRE litter 3 C fire loss gC/m^2/s F + 646 M_LITR3C_TO_FIRE_vr litter 3 C fire loss gC/m^3/s F + 647 M_LITR3C_TO_LEACHING litter 3 C leaching loss gC/m^2/s F + 648 M_LITR3N_TO_FIRE litter 3 N fire loss gN/m^2 F + 649 M_LITR3N_TO_FIRE_vr litter 3 N fire loss gN/m^3 F + 650 M_LITR3N_TO_LEACHING litter 3 N leaching loss gN/m^2/s F + 651 M_LIVECROOTC_STORAGE_TO_LITTER live coarse root C storage mortality gC/m^2/s F + 652 M_LIVECROOTC_STORAGE_TO_LITTER_FIRE live coarse root C fire mortality to litter gC/m^2/s F + 653 M_LIVECROOTC_TO_LITTER live coarse root C mortality gC/m^2/s F + 654 M_LIVECROOTC_XFER_TO_LITTER live coarse root C transfer mortality gC/m^2/s F + 655 M_LIVECROOTN_STORAGE_TO_FIRE live coarse root N storage fire loss gN/m^2/s F + 656 M_LIVECROOTN_STORAGE_TO_LITTER live coarse root N storage mortality gN/m^2/s F + 657 M_LIVECROOTN_TO_FIRE live coarse root N fire loss gN/m^2/s F + 658 M_LIVECROOTN_TO_LITTER live coarse root N mortality gN/m^2/s F + 659 M_LIVECROOTN_XFER_TO_FIRE live coarse root N transfer fire loss gN/m^2/s F + 660 M_LIVECROOTN_XFER_TO_LITTER live coarse root N transfer mortality gN/m^2/s F + 661 M_LIVEROOTC_STORAGE_TO_FIRE live root C storage fire loss gC/m^2/s F + 662 M_LIVEROOTC_STORAGE_TO_LITTER_FIRE live root C storage fire mortality to litter gC/m^2/s F + 663 M_LIVEROOTC_TO_DEADROOTC_FIRE live root C fire mortality to dead root C gC/m^2/s F + 664 M_LIVEROOTC_TO_FIRE live root C fire loss gC/m^2/s F + 665 M_LIVEROOTC_TO_LITTER_FIRE live root C fire mortality to litter gC/m^2/s F + 666 M_LIVEROOTC_XFER_TO_FIRE live root C transfer fire loss gC/m^2/s F + 667 M_LIVEROOTC_XFER_TO_LITTER_FIRE live root C transfer fire mortality to litter gC/m^2/s F + 668 M_LIVESTEMC_STORAGE_TO_FIRE live stem C storage fire loss gC/m^2/s F + 669 M_LIVESTEMC_STORAGE_TO_LITTER live stem C storage mortality gC/m^2/s F + 670 M_LIVESTEMC_STORAGE_TO_LITTER_FIRE live stem C storage fire mortality to litter gC/m^2/s F + 671 M_LIVESTEMC_TO_DEADSTEMC_FIRE live stem C fire mortality to dead stem C gC/m^2/s F + 672 M_LIVESTEMC_TO_FIRE live stem C fire loss gC/m^2/s F + 673 M_LIVESTEMC_TO_LITTER live stem C mortality gC/m^2/s F + 674 M_LIVESTEMC_TO_LITTER_FIRE live stem C fire mortality to litter gC/m^2/s F + 675 M_LIVESTEMC_XFER_TO_FIRE live stem C transfer fire loss gC/m^2/s F + 676 M_LIVESTEMC_XFER_TO_LITTER live stem C transfer mortality gC/m^2/s F + 677 M_LIVESTEMC_XFER_TO_LITTER_FIRE live stem C transfer fire mortality to litter gC/m^2/s F + 678 M_LIVESTEMN_STORAGE_TO_FIRE live stem N storage fire loss gN/m^2/s F + 679 M_LIVESTEMN_STORAGE_TO_LITTER live stem N storage mortality gN/m^2/s F + 680 M_LIVESTEMN_TO_FIRE live stem N fire loss gN/m^2/s F + 681 M_LIVESTEMN_TO_LITTER live stem N mortality gN/m^2/s F + 682 M_LIVESTEMN_XFER_TO_FIRE live stem N transfer fire loss gN/m^2/s F + 683 M_LIVESTEMN_XFER_TO_LITTER live stem N transfer mortality gN/m^2/s F + 684 M_RETRANSN_TO_FIRE retranslocated N pool fire loss gN/m^2/s F + 685 M_RETRANSN_TO_LITTER retranslocated N pool mortality gN/m^2/s F + 686 M_SOIL1C_TO_LEACHING soil 1 C leaching loss gC/m^2/s F + 687 M_SOIL1N_TO_LEACHING soil 1 N leaching loss gN/m^2/s F + 688 M_SOIL2C_TO_LEACHING soil 2 C leaching loss gC/m^2/s F + 689 M_SOIL2N_TO_LEACHING soil 2 N leaching loss gN/m^2/s F + 690 M_SOIL3C_TO_LEACHING soil 3 C leaching loss gC/m^2/s F + 691 M_SOIL3N_TO_LEACHING soil 3 N leaching loss gN/m^2/s F + 692 NACTIVE Mycorrhizal N uptake flux gN/m^2/s T + 693 NACTIVE_NH4 Mycorrhizal N uptake flux gN/m^2/s T + 694 NACTIVE_NO3 Mycorrhizal N uptake flux gN/m^2/s T + 695 NAM AM-associated N uptake flux gN/m^2/s T + 696 NAM_NH4 AM-associated N uptake flux gN/m^2/s T + 697 NAM_NO3 AM-associated N uptake flux gN/m^2/s T + 698 NBP net biome production, includes fire, landuse, harvest and hrv_xsmrpool flux (latter smoothed o gC/m^2/s T + 699 NDEPLOY total N deployed in new growth gN/m^2/s T + 700 NDEP_PROF profile for atmospheric N deposition 1/m F + 701 NDEP_TO_SMINN atmospheric N deposition to soil mineral N gN/m^2/s T + 702 NECM ECM-associated N uptake flux gN/m^2/s T + 703 NECM_NH4 ECM-associated N uptake flux gN/m^2/s T + 704 NECM_NO3 ECM-associated N uptake flux gN/m^2/s T + 705 NEE net ecosystem exchange of carbon, includes fire and hrv_xsmrpool (latter smoothed over the yea gC/m^2/s T + 706 NEM Gridcell net adjustment to net carbon exchange passed to atm. for methane production gC/m2/s T + 707 NEP net ecosystem production, excludes fire, landuse, and harvest flux, positive for sink gC/m^2/s T + 708 NET_NMIN net rate of N mineralization gN/m^2/s T + 709 NET_NMIN_vr net rate of N mineralization gN/m^3/s F + 710 NFERTILIZATION fertilizer added gN/m^2/s T + 711 NFIRE fire counts valid only in Reg.C counts/km2/sec T + 712 NFIX Symbiotic BNF uptake flux gN/m^2/s T + 713 NFIXATION_PROF profile for biological N fixation 1/m F + 714 NFIX_TO_SMINN symbiotic/asymbiotic N fixation to soil mineral N gN/m^2/s F + 715 NNONMYC Non-mycorrhizal N uptake flux gN/m^2/s T + 716 NNONMYC_NH4 Non-mycorrhizal N uptake flux gN/m^2/s T + 717 NNONMYC_NO3 Non-mycorrhizal N uptake flux gN/m^2/s T + 718 NPASSIVE Passive N uptake flux gN/m^2/s T + 719 NPOOL temporary plant N pool gN/m^2 T + 720 NPOOL_TO_DEADCROOTN allocation to dead coarse root N gN/m^2/s F + 721 NPOOL_TO_DEADCROOTN_STORAGE allocation to dead coarse root N storage gN/m^2/s F + 722 NPOOL_TO_DEADSTEMN allocation to dead stem N gN/m^2/s F + 723 NPOOL_TO_DEADSTEMN_STORAGE allocation to dead stem N storage gN/m^2/s F + 724 NPOOL_TO_FROOTN allocation to fine root N gN/m^2/s F + 725 NPOOL_TO_FROOTN_STORAGE allocation to fine root N storage gN/m^2/s F + 726 NPOOL_TO_LEAFN allocation to leaf N gN/m^2/s F + 727 NPOOL_TO_LEAFN_STORAGE allocation to leaf N storage gN/m^2/s F + 728 NPOOL_TO_LIVECROOTN allocation to live coarse root N gN/m^2/s F + 729 NPOOL_TO_LIVECROOTN_STORAGE allocation to live coarse root N storage gN/m^2/s F + 730 NPOOL_TO_LIVESTEMN allocation to live stem N gN/m^2/s F + 731 NPOOL_TO_LIVESTEMN_STORAGE allocation to live stem N storage gN/m^2/s F + 732 NPP net primary production gC/m^2/s T + 733 NPP_BURNEDOFF C that cannot be used for N uptake gC/m^2/s F + 734 NPP_GROWTH Total C used for growth in FUN gC/m^2/s T + 735 NPP_NACTIVE Mycorrhizal N uptake used C gC/m^2/s T + 736 NPP_NACTIVE_NH4 Mycorrhizal N uptake use C gC/m^2/s T + 737 NPP_NACTIVE_NO3 Mycorrhizal N uptake used C gC/m^2/s T + 738 NPP_NAM AM-associated N uptake used C gC/m^2/s T + 739 NPP_NAM_NH4 AM-associated N uptake use C gC/m^2/s T + 740 NPP_NAM_NO3 AM-associated N uptake use C gC/m^2/s T + 741 NPP_NECM ECM-associated N uptake used C gC/m^2/s T + 742 NPP_NECM_NH4 ECM-associated N uptake use C gC/m^2/s T + 743 NPP_NECM_NO3 ECM-associated N uptake used C gC/m^2/s T + 744 NPP_NFIX Symbiotic BNF uptake used C gC/m^2/s T + 745 NPP_NNONMYC Non-mycorrhizal N uptake used C gC/m^2/s T + 746 NPP_NNONMYC_NH4 Non-mycorrhizal N uptake use C gC/m^2/s T + 747 NPP_NNONMYC_NO3 Non-mycorrhizal N uptake use C gC/m^2/s T + 748 NPP_NRETRANS Retranslocated N uptake flux gC/m^2/s T + 749 NPP_NUPTAKE Total C used by N uptake in FUN gC/m^2/s T + 750 NRETRANS Retranslocated N uptake flux gN/m^2/s T + 751 NRETRANS_REG Retranslocated N uptake flux gN/m^2/s T + 752 NRETRANS_SEASON Retranslocated N uptake flux gN/m^2/s T + 753 NRETRANS_STRESS Retranslocated N uptake flux gN/m^2/s T + 754 NSUBSTEPS number of adaptive timesteps in CLM timestep unitless F + 755 NUPTAKE Total N uptake of FUN gN/m^2/s T + 756 NUPTAKE_NPP_FRACTION frac of NPP used in N uptake - T + 757 N_ALLOMETRY N allocation index none F + 758 O2_DECOMP_DEPTH_UNSAT O2 consumption from HR and AR for non-inundated area mol/m3/s F + 759 OCDEP total OC deposition (dry+wet) from atmosphere kg/m^2/s T + 760 OFFSET_COUNTER offset days counter days F + 761 OFFSET_FDD offset freezing degree days counter C degree-days F + 762 OFFSET_FLAG offset flag none F + 763 OFFSET_SWI offset soil water index none F + 764 ONSET_COUNTER onset days counter days F + 765 ONSET_FDD onset freezing degree days counter C degree-days F + 766 ONSET_FLAG onset flag none F + 767 ONSET_GDD onset growing degree days C degree-days F + 768 ONSET_GDDFLAG onset flag for growing degree day sum none F + 769 ONSET_SWI onset soil water index none F + 770 O_SCALAR fraction by which decomposition is reduced due to anoxia unitless T + 771 PAR240DZ 10-day running mean of daytime patch absorbed PAR for leaves for top canopy layer W/m^2 F + 772 PAR240XZ 10-day running mean of maximum patch absorbed PAR for leaves for top canopy layer W/m^2 F + 773 PAR240_shade shade PAR (240 hrs) umol/m2/s F + 774 PAR240_sun sunlit PAR (240 hrs) umol/m2/s F + 775 PAR24_shade shade PAR (24 hrs) umol/m2/s F + 776 PAR24_sun sunlit PAR (24 hrs) umol/m2/s F + 777 PARVEGLN absorbed par by vegetation at local noon W/m^2 T + 778 PAR_shade shade PAR umol/m2/s F + 779 PAR_sun sunlit PAR umol/m2/s F + 780 PBOT atmospheric pressure at surface (downscaled to columns in glacier regions) Pa T + 781 PBOT_240 10 day running mean of air pressure Pa F + 782 PCH4 atmospheric partial pressure of CH4 Pa T + 783 PCO2 atmospheric partial pressure of CO2 Pa T + 784 PCO2_240 10 day running mean of CO2 pressure Pa F + 785 PFT_CTRUNC patch-level sink for C truncation gC/m^2 F + 786 PFT_FIRE_CLOSS total patch-level fire C loss for non-peat fires outside land-type converted region gC/m^2/s T + 787 PFT_FIRE_NLOSS total patch-level fire N loss gN/m^2/s T + 788 PFT_NTRUNC patch-level sink for N truncation gN/m^2 F + 789 PLANTCN Plant C:N used by FUN unitless F + 790 PLANT_CALLOC total allocated C flux gC/m^2/s F + 791 PLANT_NALLOC total allocated N flux gN/m^2/s F + 792 PLANT_NDEMAND N flux required to support initial GPP gN/m^2/s T + 793 PNLCZ Proportion of nitrogen allocated for light capture unitless F + 794 PO2_240 10 day running mean of O2 pressure Pa F + 795 POTENTIAL_IMMOB potential N immobilization gN/m^2/s T + 796 POTENTIAL_IMMOB_vr potential N immobilization gN/m^3/s F + 797 POT_F_DENIT potential denitrification flux gN/m^2/s T + 798 POT_F_DENIT_vr potential denitrification flux gN/m^3/s F + 799 POT_F_NIT potential nitrification flux gN/m^2/s T + 800 POT_F_NIT_vr potential nitrification flux gN/m^3/s F + 801 PREC10 10-day running mean of PREC MM H2O/S F + 802 PREC60 60-day running mean of PREC MM H2O/S F + 803 PREV_DAYL daylength from previous timestep s F + 804 PREV_FROOTC_TO_LITTER previous timestep froot C litterfall flux gC/m^2/s F + 805 PREV_LEAFC_TO_LITTER previous timestep leaf C litterfall flux gC/m^2/s F + 806 PROD100C 100-yr wood product C gC/m^2 F + 807 PROD100C_LOSS loss from 100-yr wood product pool gC/m^2/s F + 808 PROD100N 100-yr wood product N gN/m^2 F + 809 PROD100N_LOSS loss from 100-yr wood product pool gN/m^2/s F + 810 PROD10C 10-yr wood product C gC/m^2 F + 811 PROD10C_LOSS loss from 10-yr wood product pool gC/m^2/s F + 812 PROD10N 10-yr wood product N gN/m^2 F + 813 PROD10N_LOSS loss from 10-yr wood product pool gN/m^2/s F + 814 PSNSHA shaded leaf photosynthesis umolCO2/m^2/s T + 815 PSNSHADE_TO_CPOOL C fixation from shaded canopy gC/m^2/s T + 816 PSNSUN sunlit leaf photosynthesis umolCO2/m^2/s T + 817 PSNSUN_TO_CPOOL C fixation from sunlit canopy gC/m^2/s T + 818 PSurf atmospheric pressure at surface (downscaled to columns in glacier regions) Pa F + 819 Q2M 2m specific humidity kg/kg T + 820 QBOT atmospheric specific humidity (downscaled to columns in glacier regions) kg/kg T + 821 QCHARGE aquifer recharge rate (natural vegetated and crop landunits only) mm/s T + 822 QDIRECT_THROUGHFALL direct throughfall of liquid (rain + above-canopy irrigation) mm/s F + 823 QDIRECT_THROUGHFALL_SNOW direct throughfall of snow mm/s F + 824 QDRAI sub-surface drainage mm/s T + 825 QDRAI_PERCH perched wt drainage mm/s T + 826 QDRAI_XS saturation excess drainage mm/s T + 827 QDRIP rate of excess canopy liquid falling off canopy mm/s F + 828 QDRIP_SNOW rate of excess canopy snow falling off canopy mm/s F + 829 QFLOOD runoff from river flooding mm/s T + 830 QFLX_EVAP_TOT qflx_evap_soi + qflx_evap_can + qflx_tran_veg kg m-2 s-1 T + 831 QFLX_EVAP_VEG vegetation evaporation mm H2O/s F + 832 QFLX_ICE_DYNBAL ice dynamic land cover change conversion runoff flux mm/s T + 833 QFLX_LIQDEW_TO_TOP_LAYER rate of liquid water deposited on top soil or snow layer (dew) mm H2O/s T + 834 QFLX_LIQEVAP_FROM_TOP_LAYER rate of liquid water evaporated from top soil or snow layer mm H2O/s T + 835 QFLX_LIQ_DYNBAL liq dynamic land cover change conversion runoff flux mm/s T + 836 QFLX_LIQ_GRND liquid (rain+irrigation) on ground after interception mm H2O/s F + 837 QFLX_SNOW_DRAIN drainage from snow pack mm/s T + 838 QFLX_SNOW_DRAIN_ICE drainage from snow pack melt (ice landunits only) mm/s T + 839 QFLX_SNOW_GRND snow on ground after interception mm H2O/s F + 840 QFLX_SOLIDDEW_TO_TOP_LAYER rate of solid water deposited on top soil or snow layer (frost) mm H2O/s T + 841 QFLX_SOLIDEVAP_FROM_TOP_LAYER rate of ice evaporated from top soil or snow layer (sublimation) (also includes bare ice subli mm H2O/s T + 842 QFLX_SOLIDEVAP_FROM_TOP_LAYER_ICE rate of ice evaporated from top soil or snow layer (sublimation) (also includes bare ice subli mm H2O/s F + 843 QH2OSFC surface water runoff mm/s T + 844 QH2OSFC_TO_ICE surface water converted to ice mm/s F + 845 QHR hydraulic redistribution mm/s T + 846 QICE ice growth/melt mm/s T + 847 QICE_FORC qice forcing sent to GLC mm/s F + 848 QICE_FRZ ice growth mm/s T + 849 QICE_MELT ice melt mm/s T + 850 QINFL infiltration mm/s T + 851 QINTR interception mm/s T + 852 QIRRIG_DEMAND irrigation demand mm/s F + 853 QIRRIG_DRIP water added via drip irrigation mm/s F + 854 QIRRIG_FROM_GW_CONFINED water added through confined groundwater irrigation mm/s T + 855 QIRRIG_FROM_GW_UNCONFINED water added through unconfined groundwater irrigation mm/s T + 856 QIRRIG_FROM_SURFACE water added through surface water irrigation mm/s T + 857 QIRRIG_SPRINKLER water added via sprinkler irrigation mm/s F + 858 QOVER total surface runoff (includes QH2OSFC) mm/s T + 859 QOVER_LAG time-lagged surface runoff for soil columns mm/s F + 860 QPHSNEG net negative hydraulic redistribution flux mm/s F + 861 QRGWL surface runoff at glaciers (liquid only), wetlands, lakes; also includes melted ice runoff fro mm/s T + 862 QROOTSINK water flux from soil to root in each soil-layer mm/s F + 863 QRUNOFF total liquid runoff not including correction for land use change mm/s T + 864 QRUNOFF_ICE total liquid runoff not incl corret for LULCC (ice landunits only) mm/s T + 865 QRUNOFF_ICE_TO_COUPLER total ice runoff sent to coupler (includes corrections for land use change) mm/s T + 866 QRUNOFF_ICE_TO_LIQ liquid runoff from converted ice runoff mm/s F + 867 QRUNOFF_R Rural total runoff mm/s F + 868 QRUNOFF_TO_COUPLER total liquid runoff sent to coupler (includes corrections for land use change) mm/s T + 869 QRUNOFF_U Urban total runoff mm/s F + 870 QSNOCPLIQ excess liquid h2o due to snow capping not including correction for land use change mm H2O/s T + 871 QSNOEVAP evaporation from snow (only when snl<0, otherwise it is equal to qflx_ev_soil) mm/s T + 872 QSNOFRZ column-integrated snow freezing rate kg/m2/s T + 873 QSNOFRZ_ICE column-integrated snow freezing rate (ice landunits only) mm/s T + 874 QSNOMELT snow melt rate mm/s T + 875 QSNOMELT_ICE snow melt (ice landunits only) mm/s T + 876 QSNOUNLOAD canopy snow unloading mm/s T + 877 QSNO_TEMPUNLOAD canopy snow temp unloading mm/s T + 878 QSNO_WINDUNLOAD canopy snow wind unloading mm/s T + 879 QSNWCPICE excess solid h2o due to snow capping not including correction for land use change mm H2O/s T + 880 QSOIL Ground evaporation (soil/snow evaporation + soil/snow sublimation - dew) mm/s T + 881 QSOIL_ICE Ground evaporation (ice landunits only) mm/s T + 882 QTOPSOIL water input to surface mm/s F + 883 QVEGE canopy evaporation mm/s T + 884 QVEGT canopy transpiration mm/s T + 885 Qair atmospheric specific humidity (downscaled to columns in glacier regions) kg/kg F + 886 Qh sensible heat W/m^2 F + 887 Qle total evaporation W/m^2 F + 888 Qstor storage heat flux (includes snowmelt) W/m^2 F + 889 Qtau momentum flux kg/m/s^2 F + 890 RAIN atmospheric rain, after rain/snow repartitioning based on temperature mm/s T + 891 RAIN_FROM_ATM atmospheric rain received from atmosphere (pre-repartitioning) mm/s T + 892 RAIN_ICE atmospheric rain, after rain/snow repartitioning based on temperature (ice landunits only) mm/s F + 893 RAM1 aerodynamical resistance s/m F + 894 RAM_LAKE aerodynamic resistance for momentum (lakes only) s/m F + 895 RB10 10 day running mean boundary layer resistance s/m F + 896 RETRANSN plant pool of retranslocated N gN/m^2 T + 897 RETRANSN_TO_NPOOL deployment of retranslocated N gN/m^2/s T + 898 RH atmospheric relative humidity % F + 899 RH2M 2m relative humidity % T + 900 RH2M_R Rural 2m specific humidity % F + 901 RH2M_U Urban 2m relative humidity % F + 902 RH30 30-day running mean of relative humidity % F + 903 RHAF fractional humidity of canopy air fraction F + 904 RHAF10 10 day running mean of fractional humidity of canopy air fraction F + 905 RH_LEAF fractional humidity at leaf surface fraction F + 906 ROOTR effective fraction of roots in each soil layer (SMS method) proportion F + 907 RR root respiration (fine root MR + total root GR) gC/m^2/s T + 908 RRESIS root resistance in each soil layer proportion F + 909 RSSHA shaded leaf stomatal resistance s/m T + 910 RSSUN sunlit leaf stomatal resistance s/m T + 911 Rainf atmospheric rain, after rain/snow repartitioning based on temperature mm/s F + 912 Rnet net radiation W/m^2 F + 913 SABG solar rad absorbed by ground W/m^2 T + 914 SABG_PEN Rural solar rad penetrating top soil or snow layer watt/m^2 T + 915 SABV solar rad absorbed by veg W/m^2 T + 916 SEEDC pool for seeding new PFTs via dynamic landcover gC/m^2 T + 917 SEEDN pool for seeding new PFTs via dynamic landcover gN/m^2 T + 918 SLASH_HARVESTC slash harvest carbon (to litter) gC/m^2/s T + 919 SMINN soil mineral N gN/m^2 T + 920 SMINN_TO_NPOOL deployment of soil mineral N uptake gN/m^2/s T + 921 SMINN_TO_PLANT plant uptake of soil mineral N gN/m^2/s T + 922 SMINN_TO_PLANT_FUN Total soil N uptake of FUN gN/m^2/s T + 923 SMINN_TO_PLANT_vr plant uptake of soil mineral N gN/m^3/s F + 924 SMINN_TO_SOIL1N_L1 mineral N flux for decomp. of LITR1to SOIL1 gN/m^2 F + 925 SMINN_TO_SOIL1N_L1_vr mineral N flux for decomp. of LITR1to SOIL1 gN/m^3 F + 926 SMINN_TO_SOIL1N_L2 mineral N flux for decomp. of LITR2to SOIL1 gN/m^2 F + 927 SMINN_TO_SOIL1N_L2_vr mineral N flux for decomp. of LITR2to SOIL1 gN/m^3 F + 928 SMINN_TO_SOIL1N_S2 mineral N flux for decomp. of SOIL2to SOIL1 gN/m^2 F + 929 SMINN_TO_SOIL1N_S2_vr mineral N flux for decomp. of SOIL2to SOIL1 gN/m^3 F + 930 SMINN_TO_SOIL1N_S3 mineral N flux for decomp. of SOIL3to SOIL1 gN/m^2 F + 931 SMINN_TO_SOIL1N_S3_vr mineral N flux for decomp. of SOIL3to SOIL1 gN/m^3 F + 932 SMINN_TO_SOIL2N_L3 mineral N flux for decomp. of LITR3to SOIL2 gN/m^2 F + 933 SMINN_TO_SOIL2N_L3_vr mineral N flux for decomp. of LITR3to SOIL2 gN/m^3 F + 934 SMINN_TO_SOIL2N_S1 mineral N flux for decomp. of SOIL1to SOIL2 gN/m^2 F + 935 SMINN_TO_SOIL2N_S1_vr mineral N flux for decomp. of SOIL1to SOIL2 gN/m^3 F + 936 SMINN_TO_SOIL3N_S1 mineral N flux for decomp. of SOIL1to SOIL3 gN/m^2 F + 937 SMINN_TO_SOIL3N_S1_vr mineral N flux for decomp. of SOIL1to SOIL3 gN/m^3 F + 938 SMINN_TO_SOIL3N_S2 mineral N flux for decomp. of SOIL2to SOIL3 gN/m^2 F + 939 SMINN_TO_SOIL3N_S2_vr mineral N flux for decomp. of SOIL2to SOIL3 gN/m^3 F + 940 SMINN_vr soil mineral N gN/m^3 T + 941 SMIN_NH4 soil mineral NH4 gN/m^2 T + 942 SMIN_NH4_TO_PLANT plant uptake of NH4 gN/m^3/s F + 943 SMIN_NH4_vr soil mineral NH4 (vert. res.) gN/m^3 T + 944 SMIN_NO3 soil mineral NO3 gN/m^2 T + 945 SMIN_NO3_LEACHED soil NO3 pool loss to leaching gN/m^2/s T + 946 SMIN_NO3_LEACHED_vr soil NO3 pool loss to leaching gN/m^3/s F + 947 SMIN_NO3_MASSDENS SMIN_NO3_MASSDENS ugN/cm^3 soil F + 948 SMIN_NO3_RUNOFF soil NO3 pool loss to runoff gN/m^2/s T + 949 SMIN_NO3_RUNOFF_vr soil NO3 pool loss to runoff gN/m^3/s F + 950 SMIN_NO3_TO_PLANT plant uptake of NO3 gN/m^3/s F + 951 SMIN_NO3_vr soil mineral NO3 (vert. res.) gN/m^3 T + 952 SMP soil matric potential (natural vegetated and crop landunits only) mm T + 953 SNOBCMCL mass of BC in snow column kg/m2 T + 954 SNOBCMSL mass of BC in top snow layer kg/m2 T + 955 SNOCAN intercepted snow mm T + 956 SNODSTMCL mass of dust in snow column kg/m2 T + 957 SNODSTMSL mass of dust in top snow layer kg/m2 T + 958 SNOFSDSND direct nir incident solar radiation on snow W/m^2 F + 959 SNOFSDSNI diffuse nir incident solar radiation on snow W/m^2 F + 960 SNOFSDSVD direct vis incident solar radiation on snow W/m^2 F + 961 SNOFSDSVI diffuse vis incident solar radiation on snow W/m^2 F + 962 SNOFSRND direct nir reflected solar radiation from snow W/m^2 T + 963 SNOFSRNI diffuse nir reflected solar radiation from snow W/m^2 T + 964 SNOFSRVD direct vis reflected solar radiation from snow W/m^2 T + 965 SNOFSRVI diffuse vis reflected solar radiation from snow W/m^2 T + 966 SNOINTABS Fraction of incoming solar absorbed by lower snow layers - T + 967 SNOLIQFL top snow layer liquid water fraction (land) fraction F + 968 SNOOCMCL mass of OC in snow column kg/m2 T + 969 SNOOCMSL mass of OC in top snow layer kg/m2 T + 970 SNORDSL top snow layer effective grain radius m^-6 F + 971 SNOTTOPL snow temperature (top layer) K F + 972 SNOTTOPL_ICE snow temperature (top layer, ice landunits only) K F + 973 SNOTXMASS snow temperature times layer mass, layer sum; to get mass-weighted temperature, divide by (SNO K kg/m2 T + 974 SNOTXMASS_ICE snow temperature times layer mass, layer sum (ice landunits only); to get mass-weighted temper K kg/m2 F + 975 SNOW atmospheric snow, after rain/snow repartitioning based on temperature mm/s T + 976 SNOWDP gridcell mean snow height m T + 977 SNOWICE snow ice kg/m2 T + 978 SNOWICE_ICE snow ice (ice landunits only) kg/m2 F + 979 SNOWLIQ snow liquid water kg/m2 T + 980 SNOWLIQ_ICE snow liquid water (ice landunits only) kg/m2 F + 981 SNOW_DEPTH snow height of snow covered area m T + 982 SNOW_DEPTH_ICE snow height of snow covered area (ice landunits only) m F + 983 SNOW_FROM_ATM atmospheric snow received from atmosphere (pre-repartitioning) mm/s T + 984 SNOW_ICE atmospheric snow, after rain/snow repartitioning based on temperature (ice landunits only) mm/s F + 985 SNOW_PERSISTENCE Length of time of continuous snow cover (nat. veg. landunits only) seconds T + 986 SNOW_SINKS snow sinks (liquid water) mm/s T + 987 SNOW_SOURCES snow sources (liquid water) mm/s T + 988 SNO_ABS Absorbed solar radiation in each snow layer W/m^2 F + 989 SNO_ABS_ICE Absorbed solar radiation in each snow layer (ice landunits only) W/m^2 F + 990 SNO_BW Partial density of water in the snow pack (ice + liquid) kg/m3 F + 991 SNO_BW_ICE Partial density of water in the snow pack (ice + liquid, ice landunits only) kg/m3 F + 992 SNO_EXISTENCE Fraction of averaging period for which each snow layer existed unitless F + 993 SNO_FRZ snow freezing rate in each snow layer kg/m2/s F + 994 SNO_FRZ_ICE snow freezing rate in each snow layer (ice landunits only) mm/s F + 995 SNO_GS Mean snow grain size Microns F + 996 SNO_GS_ICE Mean snow grain size (ice landunits only) Microns F + 997 SNO_ICE Snow ice content kg/m2 F + 998 SNO_LIQH2O Snow liquid water content kg/m2 F + 999 SNO_MELT snow melt rate in each snow layer mm/s F +1000 SNO_MELT_ICE snow melt rate in each snow layer (ice landunits only) mm/s F +1001 SNO_T Snow temperatures K F +1002 SNO_TK Thermal conductivity W/m-K F +1003 SNO_TK_ICE Thermal conductivity (ice landunits only) W/m-K F +1004 SNO_T_ICE Snow temperatures (ice landunits only) K F +1005 SNO_Z Snow layer thicknesses m F +1006 SNO_Z_ICE Snow layer thicknesses (ice landunits only) m F +1007 SNOdTdzL top snow layer temperature gradient (land) K/m F +1008 SOIL1C SOIL1 C gC/m^2 T +1009 SOIL1C_1m SOIL1 C to 1 meter gC/m^2 F +1010 SOIL1C_TNDNCY_VERT_TRANS soil 1 C tendency due to vertical transport gC/m^3/s F +1011 SOIL1C_TO_SOIL2C decomp. of soil 1 C to soil 2 C gC/m^2/s F +1012 SOIL1C_TO_SOIL2C_vr decomp. of soil 1 C to soil 2 C gC/m^3/s F +1013 SOIL1C_TO_SOIL3C decomp. of soil 1 C to soil 3 C gC/m^2/s F +1014 SOIL1C_TO_SOIL3C_vr decomp. of soil 1 C to soil 3 C gC/m^3/s F +1015 SOIL1C_vr SOIL1 C (vertically resolved) gC/m^3 T +1016 SOIL1N SOIL1 N gN/m^2 T +1017 SOIL1N_1m SOIL1 N to 1 meter gN/m^2 F +1018 SOIL1N_TNDNCY_VERT_TRANS soil 1 N tendency due to vertical transport gN/m^3/s F +1019 SOIL1N_TO_SOIL2N decomp. of soil 1 N to soil 2 N gN/m^2 F +1020 SOIL1N_TO_SOIL2N_vr decomp. of soil 1 N to soil 2 N gN/m^3 F +1021 SOIL1N_TO_SOIL3N decomp. of soil 1 N to soil 3 N gN/m^2 F +1022 SOIL1N_TO_SOIL3N_vr decomp. of soil 1 N to soil 3 N gN/m^3 F +1023 SOIL1N_vr SOIL1 N (vertically resolved) gN/m^3 T +1024 SOIL1_HR_S2 Het. Resp. from soil 1 gC/m^2/s F +1025 SOIL1_HR_S2_vr Het. Resp. from soil 1 gC/m^3/s F +1026 SOIL1_HR_S3 Het. Resp. from soil 1 gC/m^2/s F +1027 SOIL1_HR_S3_vr Het. Resp. from soil 1 gC/m^3/s F +1028 SOIL2C SOIL2 C gC/m^2 T +1029 SOIL2C_1m SOIL2 C to 1 meter gC/m^2 F +1030 SOIL2C_TNDNCY_VERT_TRANS soil 2 C tendency due to vertical transport gC/m^3/s F +1031 SOIL2C_TO_SOIL1C decomp. of soil 2 C to soil 1 C gC/m^2/s F +1032 SOIL2C_TO_SOIL1C_vr decomp. of soil 2 C to soil 1 C gC/m^3/s F +1033 SOIL2C_TO_SOIL3C decomp. of soil 2 C to soil 3 C gC/m^2/s F +1034 SOIL2C_TO_SOIL3C_vr decomp. of soil 2 C to soil 3 C gC/m^3/s F +1035 SOIL2C_vr SOIL2 C (vertically resolved) gC/m^3 T +1036 SOIL2N SOIL2 N gN/m^2 T +1037 SOIL2N_1m SOIL2 N to 1 meter gN/m^2 F +1038 SOIL2N_TNDNCY_VERT_TRANS soil 2 N tendency due to vertical transport gN/m^3/s F +1039 SOIL2N_TO_SOIL1N decomp. of soil 2 N to soil 1 N gN/m^2 F +1040 SOIL2N_TO_SOIL1N_vr decomp. of soil 2 N to soil 1 N gN/m^3 F +1041 SOIL2N_TO_SOIL3N decomp. of soil 2 N to soil 3 N gN/m^2 F +1042 SOIL2N_TO_SOIL3N_vr decomp. of soil 2 N to soil 3 N gN/m^3 F +1043 SOIL2N_vr SOIL2 N (vertically resolved) gN/m^3 T +1044 SOIL2_HR_S1 Het. Resp. from soil 2 gC/m^2/s F +1045 SOIL2_HR_S1_vr Het. Resp. from soil 2 gC/m^3/s F +1046 SOIL2_HR_S3 Het. Resp. from soil 2 gC/m^2/s F +1047 SOIL2_HR_S3_vr Het. Resp. from soil 2 gC/m^3/s F +1048 SOIL3C SOIL3 C gC/m^2 T +1049 SOIL3C_1m SOIL3 C to 1 meter gC/m^2 F +1050 SOIL3C_TNDNCY_VERT_TRANS soil 3 C tendency due to vertical transport gC/m^3/s F +1051 SOIL3C_TO_SOIL1C decomp. of soil 3 C to soil 1 C gC/m^2/s F +1052 SOIL3C_TO_SOIL1C_vr decomp. of soil 3 C to soil 1 C gC/m^3/s F +1053 SOIL3C_vr SOIL3 C (vertically resolved) gC/m^3 T +1054 SOIL3N SOIL3 N gN/m^2 T +1055 SOIL3N_1m SOIL3 N to 1 meter gN/m^2 F +1056 SOIL3N_TNDNCY_VERT_TRANS soil 3 N tendency due to vertical transport gN/m^3/s F +1057 SOIL3N_TO_SOIL1N decomp. of soil 3 N to soil 1 N gN/m^2 F +1058 SOIL3N_TO_SOIL1N_vr decomp. of soil 3 N to soil 1 N gN/m^3 F +1059 SOIL3N_vr SOIL3 N (vertically resolved) gN/m^3 T +1060 SOIL3_HR Het. Resp. from soil 3 gC/m^2/s F +1061 SOIL3_HR_vr Het. Resp. from soil 3 gC/m^3/s F +1062 SOILC_CHANGE C change in soil gC/m^2/s T +1063 SOILC_HR soil C heterotrophic respiration gC/m^2/s T +1064 SOILC_vr SOIL C (vertically resolved) gC/m^3 T +1065 SOILICE soil ice (natural vegetated and crop landunits only) kg/m2 T +1066 SOILLIQ soil liquid water (natural vegetated and crop landunits only) kg/m2 T +1067 SOILN_vr SOIL N (vertically resolved) gN/m^3 T +1068 SOILPSI soil water potential in each soil layer MPa F +1069 SOILRESIS soil resistance to evaporation s/m T +1070 SOILWATER_10CM soil liquid water + ice in top 10cm of soil (veg landunits only) kg/m2 T +1071 SOMC_FIRE C loss due to peat burning gC/m^2/s T +1072 SOMFIRE soil organic matter fire losses gC/m^2/s F +1073 SOM_ADV_COEF advection term for vertical SOM translocation m/s F +1074 SOM_C_LEACHED total flux of C from SOM pools due to leaching gC/m^2/s T +1075 SOM_DIFFUS_COEF diffusion coefficient for vertical SOM translocation m^2/s F +1076 SOM_N_LEACHED total flux of N from SOM pools due to leaching gN/m^2/s F +1077 SR total soil respiration (HR + root resp) gC/m^2/s T +1078 SSRE_FSR surface snow effect on reflected solar radiation W/m^2 T +1079 SSRE_FSRND surface snow effect on direct nir reflected solar radiation W/m^2 T +1080 SSRE_FSRNDLN surface snow effect on direct nir reflected solar radiation at local noon W/m^2 T +1081 SSRE_FSRNI surface snow effect on diffuse nir reflected solar radiation W/m^2 T +1082 SSRE_FSRVD surface snow radiatve effect on direct vis reflected solar radiation W/m^2 T +1083 SSRE_FSRVDLN surface snow radiatve effect on direct vis reflected solar radiation at local noon W/m^2 T +1084 SSRE_FSRVI surface snow radiatve effect on diffuse vis reflected solar radiation W/m^2 T +1085 STEM_PROF profile for litter C and N inputs from stems 1/m F +1086 STORAGE_CDEMAND C use from the C storage pool gC/m^2 F +1087 STORAGE_GR growth resp for growth sent to storage for later display gC/m^2/s F +1088 STORAGE_NDEMAND N demand during the offset period gN/m^2 F +1089 STORVEGC stored vegetation carbon, excluding cpool gC/m^2 T +1090 STORVEGN stored vegetation nitrogen gN/m^2 T +1091 SUPPLEMENT_TO_SMINN supplemental N supply gN/m^2/s T +1092 SUPPLEMENT_TO_SMINN_vr supplemental N supply gN/m^3/s F +1093 SWBGT 2 m Simplified Wetbulb Globe Temp C T +1094 SWBGT_R Rural 2 m Simplified Wetbulb Globe Temp C T +1095 SWBGT_U Urban 2 m Simplified Wetbulb Globe Temp C T +1096 SWMP65 2 m Swamp Cooler Temp 65% Eff C T +1097 SWMP65_R Rural 2 m Swamp Cooler Temp 65% Eff C T +1098 SWMP65_U Urban 2 m Swamp Cooler Temp 65% Eff C T +1099 SWMP80 2 m Swamp Cooler Temp 80% Eff C T +1100 SWMP80_R Rural 2 m Swamp Cooler Temp 80% Eff C T +1101 SWMP80_U Urban 2 m Swamp Cooler Temp 80% Eff C T +1102 SWdown atmospheric incident solar radiation W/m^2 F +1103 SWup upwelling shortwave radiation W/m^2 F +1104 SoilAlpha factor limiting ground evap unitless F +1105 SoilAlpha_U urban factor limiting ground evap unitless F +1106 T10 10-day running mean of 2-m temperature K F +1107 TAUX zonal surface stress kg/m/s^2 T +1108 TAUY meridional surface stress kg/m/s^2 T +1109 TBOT atmospheric air temperature (downscaled to columns in glacier regions) K T +1110 TBUILD internal urban building air temperature K T +1111 TBUILD_MAX prescribed maximum interior building temperature K F +1112 TEMPAVG_T2M temporary average 2m air temperature K F +1113 TEMPMAX_RETRANSN temporary annual max of retranslocated N pool gN/m^2 F +1114 TEMPSUM_POTENTIAL_GPP temporary annual sum of potential GPP gC/m^2/yr F +1115 TEQ 2 m Equiv Temp K T +1116 TEQ_R Rural 2 m Equiv Temp K T +1117 TEQ_U Urban 2 m Equiv Temp K T +1118 TFLOOR floor temperature K F +1119 TG ground temperature K T +1120 TG_ICE ground temperature (ice landunits only) K F +1121 TG_R Rural ground temperature K F +1122 TG_U Urban ground temperature K F +1123 TH2OSFC surface water temperature K T +1124 THBOT atmospheric air potential temperature (downscaled to columns in glacier regions) K T +1125 THIC 2 m Temp Hum Index Comfort C T +1126 THIC_R Rural 2 m Temp Hum Index Comfort C T +1127 THIC_U Urban 2 m Temp Hum Index Comfort C T +1128 THIP 2 m Temp Hum Index Physiology C T +1129 THIP_R Rural 2 m Temp Hum Index Physiology C T +1130 THIP_U Urban 2 m Temp Hum Index Physiology C T +1131 TKE1 top lake level eddy thermal conductivity W/(mK) T +1132 TLAI total projected leaf area index m^2/m^2 T +1133 TLAKE lake temperature K T +1134 TOPO_COL column-level topographic height m F +1135 TOPO_COL_ICE column-level topographic height (ice landunits only) m F +1136 TOPO_FORC topograephic height sent to GLC m F +1137 TOPT topt coefficient for VOC calc non F +1138 TOTCOLC total column carbon, incl veg and cpool but excl product pools gC/m^2 T +1139 TOTCOLCH4 total belowground CH4 (0 for non-lake special landunits in the absence of dynamic landunits) gC/m2 T +1140 TOTCOLN total column-level N, excluding product pools gN/m^2 T +1141 TOTECOSYSC total ecosystem carbon, incl veg but excl cpool and product pools gC/m^2 T +1142 TOTECOSYSN total ecosystem N, excluding product pools gN/m^2 T +1143 TOTFIRE total ecosystem fire losses gC/m^2/s F +1144 TOTLITC total litter carbon gC/m^2 T +1145 TOTLITC_1m total litter carbon to 1 meter depth gC/m^2 T +1146 TOTLITN total litter N gN/m^2 T +1147 TOTLITN_1m total litter N to 1 meter gN/m^2 T +1148 TOTPFTC total patch-level carbon, including cpool gC/m^2 T +1149 TOTPFTN total patch-level nitrogen gN/m^2 T +1150 TOTSOILICE vertically summed soil cie (veg landunits only) kg/m2 T +1151 TOTSOILLIQ vertically summed soil liquid water (veg landunits only) kg/m2 T +1152 TOTSOMC total soil organic matter carbon gC/m^2 T +1153 TOTSOMC_1m total soil organic matter carbon to 1 meter depth gC/m^2 T +1154 TOTSOMN total soil organic matter N gN/m^2 T +1155 TOTSOMN_1m total soil organic matter N to 1 meter gN/m^2 T +1156 TOTVEGC total vegetation carbon, excluding cpool gC/m^2 T +1157 TOTVEGN total vegetation nitrogen gN/m^2 T +1158 TOT_WOODPRODC total wood product C gC/m^2 T +1159 TOT_WOODPRODC_LOSS total loss from wood product pools gC/m^2/s T +1160 TOT_WOODPRODN total wood product N gN/m^2 T +1161 TOT_WOODPRODN_LOSS total loss from wood product pools gN/m^2/s T +1162 TPU25T canopy profile of tpu umol/m2/s T +1163 TRAFFICFLUX sensible heat flux from urban traffic W/m^2 F +1164 TRANSFER_DEADCROOT_GR dead coarse root growth respiration from storage gC/m^2/s F +1165 TRANSFER_DEADSTEM_GR dead stem growth respiration from storage gC/m^2/s F +1166 TRANSFER_FROOT_GR fine root growth respiration from storage gC/m^2/s F +1167 TRANSFER_GR growth resp for transfer growth displayed in this timestep gC/m^2/s F +1168 TRANSFER_LEAF_GR leaf growth respiration from storage gC/m^2/s F +1169 TRANSFER_LIVECROOT_GR live coarse root growth respiration from storage gC/m^2/s F +1170 TRANSFER_LIVESTEM_GR live stem growth respiration from storage gC/m^2/s F +1171 TREFMNAV daily minimum of average 2-m temperature K T +1172 TREFMNAV_R Rural daily minimum of average 2-m temperature K F +1173 TREFMNAV_U Urban daily minimum of average 2-m temperature K F +1174 TREFMXAV daily maximum of average 2-m temperature K T +1175 TREFMXAV_R Rural daily maximum of average 2-m temperature K F +1176 TREFMXAV_U Urban daily maximum of average 2-m temperature K F +1177 TROOF_INNER roof inside surface temperature K F +1178 TSA 2m air temperature K T +1179 TSAI total projected stem area index m^2/m^2 T +1180 TSA_ICE 2m air temperature (ice landunits only) K F +1181 TSA_R Rural 2m air temperature K F +1182 TSA_U Urban 2m air temperature K F +1183 TSHDW_INNER shadewall inside surface temperature K F +1184 TSKIN skin temperature K T +1185 TSL temperature of near-surface soil layer (natural vegetated and crop landunits only) K T +1186 TSOI soil temperature (natural vegetated and crop landunits only) K T +1187 TSOI_10CM soil temperature in top 10cm of soil K T +1188 TSOI_ICE soil temperature (ice landunits only) K T +1189 TSRF_FORC surface temperature sent to GLC K F +1190 TSUNW_INNER sunwall inside surface temperature K F +1191 TV vegetation temperature K T +1192 TV24 vegetation temperature (last 24hrs) K F +1193 TV240 vegetation temperature (last 240hrs) K F +1194 TVEGD10 10 day running mean of patch daytime vegetation temperature Kelvin F +1195 TVEGN10 10 day running mean of patch night-time vegetation temperature Kelvin F +1196 TWS total water storage mm T +1197 T_SCALAR temperature inhibition of decomposition unitless T +1198 Tair atmospheric air temperature (downscaled to columns in glacier regions) K F +1199 Tair_from_atm atmospheric air temperature received from atmosphere (pre-downscaling) K F +1200 U10 10-m wind m/s T +1201 U10_DUST 10-m wind for dust model m/s T +1202 U10_ICE 10-m wind (ice landunits only) m/s F +1203 ULRAD upward longwave radiation above the canopy W/m^2 F +1204 URBAN_AC urban air conditioning flux W/m^2 T +1205 URBAN_HEAT urban heating flux W/m^2 T +1206 UST_LAKE friction velocity (lakes only) m/s F +1207 VA atmospheric wind speed plus convective velocity m/s F +1208 VCMX25T canopy profile of vcmax25 umol/m2/s T +1209 VEGWP vegetation water matric potential for sun/sha canopy,xyl,root segments mm T +1210 VEGWPLN vegetation water matric potential for sun/sha canopy,xyl,root at local noon mm T +1211 VEGWPPD predawn vegetation water matric potential for sun/sha canopy,xyl,root mm T +1212 VOCFLXT total VOC flux into atmosphere moles/m2/sec F +1213 VOLR river channel total water storage m3 T +1214 VOLRMCH river channel main channel water storage m3 T +1215 VPD_CAN canopy vapor pressure deficit kPa T +1216 Vcmx25Z canopy profile of vcmax25 predicted by LUNA model umol/m2/s T +1217 WA water in the unconfined aquifer (natural vegetated and crop landunits only) mm T +1218 WASTEHEAT sensible heat flux from heating/cooling sources of urban waste heat W/m^2 T +1219 WBA 2 m Wet Bulb C T +1220 WBA_R Rural 2 m Wet Bulb C T +1221 WBA_U Urban 2 m Wet Bulb C T +1222 WBT 2 m Stull Wet Bulb C T +1223 WBT_R Rural 2 m Stull Wet Bulb C T +1224 WBT_U Urban 2 m Stull Wet Bulb C T +1225 WF soil water as frac. of whc for top 0.05 m proportion F +1226 WFPS WFPS percent F +1227 WIND atmospheric wind velocity magnitude m/s T +1228 WOODC wood C gC/m^2 T +1229 WOODC_ALLOC wood C eallocation gC/m^2/s T +1230 WOODC_LOSS wood C loss gC/m^2/s T +1231 WOOD_HARVESTC wood harvest carbon (to product pools) gC/m^2/s T +1232 WOOD_HARVESTN wood harvest N (to product pools) gN/m^2/s T +1233 WTGQ surface tracer conductance m/s T +1234 W_SCALAR Moisture (dryness) inhibition of decomposition unitless T +1235 Wind atmospheric wind velocity magnitude m/s F +1236 XSMRPOOL temporary photosynthate C pool gC/m^2 T +1237 XSMRPOOL_LOSS temporary photosynthate C pool loss gC/m^2 F +1238 XSMRPOOL_RECOVER C flux assigned to recovery of negative xsmrpool gC/m^2/s T +1239 Z0HG roughness length over ground, sensible heat m F +1240 Z0HV roughness length over vegetation, sensible heat m F +1241 Z0M momentum roughness length m F +1242 Z0MG roughness length over ground, momentum m F +1243 Z0MV roughness length over vegetation, momentum m F +1244 Z0M_TO_COUPLER roughness length, momentum: gridcell average sent to coupler m F +1245 Z0QG roughness length over ground, latent heat m F +1246 Z0QV roughness length over vegetation, latent heat m F +1247 ZBOT atmospheric reference height m T +1248 ZII convective boundary height m F +1249 ZWT water table depth (natural vegetated and crop landunits only) m T +1250 ZWT_CH4_UNSAT depth of water table for methane production used in non-inundated area m T +1251 ZWT_PERCH perched water table depth (natural vegetated and crop landunits only) m T +1252 anaerobic_frac anaerobic_frac m3/m3 F +1253 bsw clap and hornberger B unitless F +1254 currentPatch currentPatch coefficient for VOC calc non F +1255 diffus diffusivity m^2/s F +1256 fr_WFPS fr_WFPS fraction F +1257 n2_n2o_ratio_denit n2_n2o_ratio_denit gN/gN F +1258 r_psi r_psi m F +1259 ratio_k1 ratio_k1 none F +1260 ratio_no3_co2 ratio_no3_co2 ratio F +1261 soil_bulkdensity soil_bulkdensity kg/m3 F +1262 soil_co2_prod soil_co2_prod ug C / g soil / day F +1263 watfc water field capacity m^3/m^3 F +1264 watsat water saturated m^3/m^3 F +==== =================================== ============================================================================================== ================================================================= ======= diff --git a/doc/source/users_guide/trouble-shooting/trouble-shooting.rst b/doc/source/users_guide/trouble-shooting/trouble-shooting.rst index 9af807041f..cdc8f8dc62 100644 --- a/doc/source/users_guide/trouble-shooting/trouble-shooting.rst +++ b/doc/source/users_guide/trouble-shooting/trouble-shooting.rst @@ -6,44 +6,121 @@ Trouble Shooting ********************* -In this chapter we give some guidance on what to do when you encounter some of the most common problems. We can't cover all the problems that a user could potentially have, but we will try to help you recognize some of the most common situations. And we'll give you some suggestions on how to approach the problem to come up with a solution. +In this chapter we give some guidance on what to do when you encounter some of the most common problems. -In general you will run into one of three type of problems: +In general you may run into one of four types of problems: 1. *case-creation* #. *setup-time* #. *build-time* #. *run-time* -See the `CIME Trouble Shooting Guide `_ for some help on the first three. - +Start with the `CIME Trouble Shooting Guide `_ , especially if you encounter one of the first three types of problems. The CIME troubleshooting guide also provides some useful tips regarding run-time errors. If this doesn't identify and solve your problem, then try some of the suggestions below for run-time errors. General Advice on Debugging Run time Problems ============================================= -Here are some suggestions on how to track down a problem while running. In general if the problem still occurs for a simpler case, it will be easier to track down. +The model has been run for thousands and thousands of simulation years in many different configurations, both fully-coupled and in land-only modes, without problems. If you have modified the model in any way, by using either different input datasets or new or modified code, then that is the first place to look if you encounter an error. However, the model is not completely infallible, as noted below. -1. *Run in DEBUG mode* -#. *Run with a smaller set of processors* -#. *Run in serial mode with a single processor* -#. *Run at a lower resolution* -#. *Run a simpler case* -#. *Run with a debugger* +It is important to examine all of the component log files in the run directory for errors. An error in the land model may not appear in the lnd log file, it may show up in the cesm log. In a land-only simulation, errors associated with the data atmosphere model may show up in the atm log or the cesm log, or both. The two logs together may contain useful information about the error. Frequently, the error output in the log files will include a **traceback** of code where the error occurred. Identifying the specific line of code where the error occurred is the first step in diagnosing the error and developing a solution. If a traceback doesn't appear in the log files, then try running in debug mode as noted in the CIME troubleshooting guide. An example of a traceback in the cesm log is given below +:: + +> 398: ERROR: Carbon or Nitrogen patch negative = -60.0630620423182 +> 398: -1.49270707132601 +> 398: ERROR: limits = -60.0000000000000 -6.00000000000000 +> 398: ENDRUN: +> 398: ERROR: +> 398: ERROR: carbon or nitrogen state critically negative ERROR in CNPrecisionControl +> 398: Mod.F90 at line 209 +> 398:Image PC Routine Line Source +> 398:cesm.exe 000000000383B3EA Unknown Unknown Unknown +> 398:cesm.exe 0000000002F1E5D0 shr_abort_mod_mp_ 114 shr_abort_mod.F90 +> 398:cesm.exe 0000000001AF22BF abortutils_mp_end 50 abortutils.F90 +> 398:cesm.exe 0000000001D02677 cnprecisioncontro 693 CNPrecisionControlMod.F90 +> 398:cesm.exe 0000000001CFCC58 cnprecisioncontro 207 CNPrecisionControlMod.F90 +> 398:cesm.exe 00000000021FB4F5 cndrivermod_mp_cn 575 CNDriverMod.F90 +> 398:cesm.exe 0000000001D0F5C7 cnvegetationfacad 866 CNVegetationFacade.F90 +> 398:cesm.exe 0000000001AFEC96 clm_driver_mp_clm 925 clm_driver.F90 +> 398:cesm.exe 0000000001AE744B lnd_comp_mct_mp_l 458 lnd_comp_mct.F90 +> 398:cesm.exe 0000000000429414 component_mod_mp_ 737 component_mod.F90 +> 398:cesm.exe 000000000040AE4B cime_comp_mod_mp_ 2622 cime_comp_mod.F90 +> 398:cesm.exe 000000000042904C MAIN__ 133 cime_driver.F90 +> 398:cesm.exe 0000000000408D22 Unknown Unknown Unknown +> 398:libc.so.6 00002B8B95D306E5 __libc_start_main Unknown Unknown +> 398:cesm.exe 0000000000408C29 Unknown Unknown Unknown + +Here, the output is identifying the sequence of fortran statements involved in the error, starting with line 133 in cime_driver.F90 and ending with line 114 in shr_abort_mod.F90. In this case the run is triggering an error check in the model related to negative carbon/nitrogen at line 693 of CNPrecisionControlMod.F90. In addition, there is additional information related to the error indicating the carbon or nitrogen state is critically negative at line 209 in CNPrecisionControlMod.F90, which is +:: + +> call TruncateCandNStates( bounds, filter_soilp, num_soilp, cs%leafc_patch(bounds%begp:bounds%endp), & +> ns%leafn_patch(bounds%begp:bounds%endp), & +> pc(bounds%begp:), pn(bounds%begp:), __LINE__, & +> num_truncatep, filter_truncatep) + +So here we know that it is either leaf nitrogen (leafn) or leaf carbon (leafc) that has triggered the error. Furthermore, from the information above and looking at the code, we see that it is leaf carbon that is triggering the error, as the value is -60.0630620423182 and the limit is -60. + +At this point it is useful as a next step to identify the particular pft index and perhaps the pft type that is triggering the error. This can be done by inserting the following code before the **endrun** that is called in CNPrecisionControlMod.F90 at line 693. +:: + +> if (abs(carbon_patch(p)) < ccrit) then +> write(iulog,*)'p: ',p +> write(iulog,*)'itype(p): ',patch%itype(p) +> end if + +The pft index and the pft type will appear in either the cesm or lnd log file. In this case, the pft index is 163723 and the pft type is 10. From there, one can use this pft index to write out variables that are used in updating leafc, for example, leafc is updated a number of times in CNCStateUpdate1Mod.F90. +:: -Run in DEBUG mode ------------------ +> if (p .eq. 163723) then +> write(iulog,*)'CNCStateUpdate1Mod leafc: ',cs_veg%leafc_patch(p) +> write(iulog,*)'CNCStateUpdate1Mod +leafc_xfer_to_leafc: ',cf_veg%leafc_xfer_to_leafc_patch(p)*dt +> end if -The first thing to try is to run in DEBUG mode so that float point trapping will be triggered as well as array bounds checking and other things the compiler can turn on to help you find problems. -To do this edit the ``env_build.xml`` file and set DEBUG to TRUE as follows: +By placing these write statements in the code, one can get a sense of how leafc is evolving toward a negative state and why. +This is a very complex example of troubleshooting. To make a long story short, as described `here `_, the error turned out to be caused by a few lines in the phenology code that weren't handling a 20 minute time step properly, thus an actual bug in the code. This was also a good example of where a much less computationally expensive land-only simulation was able to be used for debugging instead of the orginal expensive fully-coupled simulation. + +Another method of troubleshooting is to use the **point_of_interest** module. + +Use the point_of_interest module +-------------------------------- + +It is common, when debugging, to want to print the values of various variables for all patches or columns of certain landunit types within a certain grid cell of interest. For example, one might be able to identify a certain grid cell with an erroneous value for a particular history field variable (e.g., GPP) using for example ncview. Once the latitude and longitude of this grid cell has been determined, the point_of_interest module (**src/utils/point_of_interest.F90**) helps create the logical functions needed to do this. +This module is compiled into every CTSM build, but is not invoked by default. +To use it + +(1) Enter in the latitude/longitude of the point of interest in the function **at_poi** in **point_of_interest.F90** by setting the variables **poi_lat** and **poi_lon**. + +(2) You may customize the **point_of_interest.F90** code by changing the example function (**poi_c**) and/or adding new functions. Look for comments about "Customize" to see what to customize. + +(3) Add calls to these functions in the CTSM code + +The example function in **point_of_interest.F90** is **poi_c**. It finds columns with a given landunit type (in this case, the natural vegetated landunit). That function can be used in a column-level loop to find columns with that landunit within the grid cell of interest. Its typical use in CTSM code is +:: + + > do fc = 1, num_nolakec + > c = filter_nolakec(fc) + > ! Various code here, maybe setting foo and bar variables + > if (poi_c(c)) then + > write(iulog,*) 'DEBUG: foo, bar = ', foo(c), bar(c) + > end if + > end do + +You will also need a **use** statement in the module from which you are calling poi_c :: - > ./xmlchange DEBUG=TRUE +> use point_of_interest, only : poi_c +Here are some other suggestions on how to track down a problem encountered while running. These involve setting up and running simpler cases. In general if the problem still occurs for a simpler case, it will be easier to track down. However, we note that most errors are specific to the case being run. + +#. *Run with a smaller set of processors* +#. *Run in serial mode with a single processor* +#. *Run at a lower resolution* +#. *Run a simpler case* +#. *Run with a debugger* Run with a smaller set of processors ------------------------------------ -Another way to simplify the system is to run with a smaller set of processors. You will need to clean the setup and edit the --env_mach_pes.xml--. For example, to run with four processors: +One way to simplify the system is to run with a smaller set of processors. You will need to clean the setup and edit the --env_mach_pes.xml--. For example, to run with four processors: :: > ./case.setup -clean diff --git a/lilac/bld_templates/ctsm_template.cfg b/lilac/bld_templates/ctsm_template.cfg index 7351b5da71..04ecce49ca 100644 --- a/lilac/bld_templates/ctsm_template.cfg +++ b/lilac/bld_templates/ctsm_template.cfg @@ -26,7 +26,7 @@ finidat = UNSET # High-level configuration options # ------------------------------------------------------------------------ -# ctsm_phys: 'clm4_5' or 'clm5_0' +# ctsm_phys: 'clm4_5', 'clm5_0', or 'clm5_1' ctsm_phys = clm5_0 # configuration: 'nwp' or 'clm' diff --git a/manage_externals/.gitignore b/manage_externals/.gitignore index 411de5d96e..a71ac0cd75 100644 --- a/manage_externals/.gitignore +++ b/manage_externals/.gitignore @@ -12,3 +12,6 @@ components/ # generated python files *.pyc + +# test tmp file +test/tmp diff --git a/manage_externals/.travis.yml b/manage_externals/.travis.yml index 1990cb9604..d9b24c584d 100644 --- a/manage_externals/.travis.yml +++ b/manage_externals/.travis.yml @@ -1,7 +1,6 @@ language: python os: linux -python: - - "2.7" +python: - "3.4" - "3.5" - "3.6" diff --git a/manage_externals/manic/checkout.py b/manage_externals/manic/checkout.py index edc5655954..8dd1798d7a 100755 --- a/manage_externals/manic/checkout.py +++ b/manage_externals/manic/checkout.py @@ -279,6 +279,9 @@ def commandline_arguments(args=None): help='The externals description filename. ' 'Default: %(default)s.') + parser.add_argument('-x', '--exclude', nargs='*', + help='Component(s) listed in the externals file which should be ignored.') + parser.add_argument('-o', '--optional', action='store_true', default=False, help='By default only the required externals ' 'are checked out. This flag will also checkout the ' @@ -362,7 +365,7 @@ def main(args): root_dir = os.path.abspath(os.getcwd()) external_data = read_externals_description_file(root_dir, args.externals) external = create_externals_description( - external_data, components=args.components) + external_data, components=args.components, exclude=args.exclude) for comp in args.components: if comp not in external.keys(): @@ -377,29 +380,37 @@ def main(args): if args.status: # user requested status-only - for comp in sorted(tree_status.keys()): + for comp in sorted(tree_status): tree_status[comp].log_status_message(args.verbose) else: # checkout / update the external repositories. safe_to_update = check_safe_to_update_repos(tree_status) if not safe_to_update: # print status - for comp in sorted(tree_status.keys()): + for comp in sorted(tree_status): tree_status[comp].log_status_message(args.verbose) # exit gracefully msg = """The external repositories labeled with 'M' above are not in a clean state. -The following are two options for how to proceed: +The following are three options for how to proceed: -(1) Go into each external that is not in a clean state and issue either - an 'svn status' or a 'git status' command. Either revert or commit - your changes so that all externals are in a clean state. (Note, - though, that it is okay to have untracked files in your working +(1) Go into each external that is not in a clean state and issue either a 'git status' or + an 'svn status' command (depending on whether the external is managed by git or + svn). Either revert or commit your changes so that all externals are in a clean + state. (To revert changes in git, follow the instructions given when you run 'git + status'.) (Note, though, that it is okay to have untracked files in your working directory.) Then rerun {program_name}. -(2) Alternatively, you do not have to rely on {program_name}. Instead, you - can manually update out-of-sync externals (labeled with 's' above) - as described in the configuration file {config_file}. +(2) Alternatively, you do not have to rely on {program_name}. Instead, you can manually + update out-of-sync externals (labeled with 's' above) as described in the + configuration file {config_file}. (For example, run 'git fetch' and 'git checkout' + commands to checkout the appropriate tags for each external, as given in + {config_file}.) + +(3) You can also use {program_name} to manage most, but not all externals: You can specify + one or more externals to ignore using the '-x' or '--exclude' argument to + {program_name}. Excluding externals labeled with 'M' will allow {program_name} to + update the other, non-excluded externals. The external repositories labeled with '?' above are not under version diff --git a/manage_externals/manic/externals_description.py b/manage_externals/manic/externals_description.py index bd644c9814..918d616e37 100644 --- a/manage_externals/manic/externals_description.py +++ b/manage_externals/manic/externals_description.py @@ -253,9 +253,21 @@ def read_gitmodules_file(root_dir, file_name): ExternalsDescription.REPO_URL, url) externals_description.set(sec_name, ExternalsDescription.REQUIRED, 'True') - git_hash = submods[sec_name]['hash'] - externals_description.set(sec_name, - ExternalsDescription.HASH, git_hash) + if sec_name in submods: + submod_name = sec_name + else: + # The section name does not have to match the path + submod_name = path + + if submod_name in submods: + git_hash = submods[submod_name]['hash'] + externals_description.set(sec_name, + ExternalsDescription.HASH, + git_hash) + else: + emsg = "submodule status has no section, '{}'" + emsg += "\nCheck section names in externals config file" + fatal_error(emsg.format(submod_name)) # Required items externals_description.add_section(DESCRIPTION_SECTION) @@ -264,18 +276,18 @@ def read_gitmodules_file(root_dir, file_name): return externals_description def create_externals_description( - model_data, model_format='cfg', components=None, parent_repo=None): + model_data, model_format='cfg', components=None, exclude=None, parent_repo=None): """Create the a externals description object from the provided data """ externals_description = None if model_format == 'dict': externals_description = ExternalsDescriptionDict( - model_data, components=components) + model_data, components=components, exclude=exclude) elif model_format == 'cfg': major, _, _ = get_cfg_schema_version(model_data) if major == 1: externals_description = ExternalsDescriptionConfigV1( - model_data, components=components, parent_repo=parent_repo) + model_data, components=components, exclude=exclude, parent_repo=parent_repo) else: msg = ('Externals description file has unsupported schema ' 'version "{0}".'.format(major)) @@ -710,7 +722,7 @@ class ExternalsDescriptionDict(ExternalsDescription): """ - def __init__(self, model_data, components=None): + def __init__(self, model_data, components=None, exclude=None): """Parse a native dictionary into a externals description. """ ExternalsDescription.__init__(self) @@ -722,10 +734,15 @@ def __init__(self, model_data, components=None): self._input_patch = 0 self._verify_schema_version() if components: - for key in model_data.items(): + for key in list(model_data.keys()): if key not in components: del model_data[key] + if exclude: + for key in list(model_data.keys()): + if key in exclude: + del model_data[key] + self.update(model_data) self._check_user_input() @@ -736,7 +753,7 @@ class ExternalsDescriptionConfigV1(ExternalsDescription): """ - def __init__(self, model_data, components=None, parent_repo=None): + def __init__(self, model_data, components=None, exclude=None, parent_repo=None): """Convert the config data into a standardized dict that can be used to construct the source objects @@ -749,7 +766,7 @@ def __init__(self, model_data, components=None, parent_repo=None): get_cfg_schema_version(model_data) self._verify_schema_version() self._remove_metadata(model_data) - self._parse_cfg(model_data, components=components) + self._parse_cfg(model_data, components=components, exclude=exclude) self._check_user_input() @staticmethod @@ -761,7 +778,7 @@ def _remove_metadata(model_data): """ model_data.remove_section(DESCRIPTION_SECTION) - def _parse_cfg(self, cfg_data, components=None): + def _parse_cfg(self, cfg_data, components=None, exclude=None): """Parse a config_parser object into a externals description. """ def list_to_dict(input_list, convert_to_lower_case=True): @@ -778,7 +795,7 @@ def list_to_dict(input_list, convert_to_lower_case=True): for section in cfg_data.sections(): name = config_string_cleaner(section.lower().strip()) - if components and name not in components: + if (components and name not in components) or (exclude and name in exclude): continue self[name] = {} self[name].update(list_to_dict(cfg_data.items(section))) diff --git a/manage_externals/manic/sourcetree.py b/manage_externals/manic/sourcetree.py index b9c9c21082..54de763c30 100644 --- a/manage_externals/manic/sourcetree.py +++ b/manage_externals/manic/sourcetree.py @@ -331,12 +331,14 @@ def checkout(self, verbosity, load_all, load_comp=None): printlog('Checking out externals: ', end='') if load_all: - load_comps = self._all_components.keys() + tmp_comps = self._all_components.keys() elif load_comp is not None: - load_comps = [load_comp] + tmp_comps = [load_comp] else: - load_comps = self._required_compnames - + tmp_comps = self._required_compnames + # Sort by path so that if paths are nested the + # parent repo is checked out first. + load_comps = sorted(tmp_comps, key=lambda comp: self._all_components[comp].get_local_path()) # checkout the primary externals for comp in load_comps: if verbosity < VERBOSITY_VERBOSE: @@ -346,8 +348,6 @@ def checkout(self, verbosity, load_all, load_comp=None): # output a newline printlog(EMPTY_STR) self._all_components[comp].checkout(verbosity, load_all) - printlog('') - - # now give each external an opportunitity to checkout it's externals. - for comp in load_comps: + # now give each external an opportunitity to checkout it's externals. self._all_components[comp].checkout_externals(verbosity, load_all) + printlog('') diff --git a/manage_externals/test/test_sys_checkout.py b/manage_externals/test/test_sys_checkout.py index df726f2b70..118bee5308 100644 --- a/manage_externals/test/test_sys_checkout.py +++ b/manage_externals/test/test_sys_checkout.py @@ -38,6 +38,7 @@ import os import os.path import shutil +import sys import unittest from manic.externals_description import ExternalsDescription @@ -85,6 +86,8 @@ CFG_SUB_NAME = 'sub-externals.cfg' README_NAME = 'readme.txt' REMOTE_BRANCH_FEATURE2 = 'feature2' +NESTED_NAME = ['./fred', './fred/wilma', './fred/wilma/barney'] + SVN_TEST_REPO = 'https://github.com/escomp/cesm' @@ -160,6 +163,23 @@ def container_simple_required(self, dest_dir): self.write_config(dest_dir) + def container_nested_required(self, dest_dir, order): + """Create a container externals file with only simple externals. + + """ + self.create_config() + self.create_section(SIMPLE_REPO_NAME, 'simp_tag', nested=True, + tag='tag1', path=NESTED_NAME[order[0]]) + + self.create_section(SIMPLE_REPO_NAME, 'simp_branch', nested=True, + branch=REMOTE_BRANCH_FEATURE2, path=NESTED_NAME[order[1]]) + + self.create_section(SIMPLE_REPO_NAME, 'simp_hash', nested=True, + ref_hash='60b1cc1a38d63', path=NESTED_NAME[order[2]]) + + self.write_config(dest_dir) + + def container_simple_optional(self, dest_dir): """Create a container externals file with optional simple externals @@ -261,7 +281,7 @@ def create_metadata(self): def create_section(self, repo_type, name, tag='', branch='', ref_hash='', required=True, path=EXTERNALS_NAME, externals='', repo_path=None, from_submodule=False, - sparse=''): + sparse='', nested=False): # pylint: disable=too-many-branches """Create a config section with autofilling some items and handling optional items. @@ -270,8 +290,11 @@ def create_section(self, repo_type, name, tag='', branch='', # pylint: disable=R0913 self._config.add_section(name) if not from_submodule: - self._config.set(name, ExternalsDescription.PATH, - os.path.join(path, name)) + if nested: + self._config.set(name, ExternalsDescription.PATH, path) + else: + self._config.set(name, ExternalsDescription.PATH, + os.path.join(path, name)) self._config.set(name, ExternalsDescription.PROTOCOL, ExternalsDescription.PROTOCOL_GIT) @@ -535,12 +558,26 @@ def setUp(self): self._test_id = self.id().split('.')[-1] + # find root + if os.path.exists(os.path.join(os.getcwd(), 'checkout_externals')): + root_dir = os.path.abspath(os.getcwd()) + else: + # maybe we are in a subdir, search up + root_dir = os.path.abspath(os.path.join(os.getcwd(), os.pardir)) + while os.path.basename(root_dir): + if os.path.exists(os.path.join(root_dir, 'checkout_externals')): + break + root_dir = os.path.dirname(root_dir) + + if not os.path.exists(os.path.join(root_dir, 'checkout_externals')): + raise RuntimeError('Cannot find checkout_externals') + # path to the executable - self._checkout = os.path.join('../checkout_externals') - self._checkout = os.path.abspath(self._checkout) + self._checkout = os.path.join(root_dir, 'checkout_externals') # directory where we have test repositories - self._bare_root = os.path.join(os.getcwd(), BARE_REPO_ROOT_NAME) + test_dir = os.path.join(root_dir, 'test') + self._bare_root = os.path.join(test_dir, BARE_REPO_ROOT_NAME) self._bare_root = os.path.abspath(self._bare_root) # set into the environment so var will be expanded in externals files @@ -671,10 +708,16 @@ def _check_simple_tag_empty(self, tree, directory=EXTERNALS_NAME): name = './{0}/simp_tag'.format(directory) self._check_generic_empty_default_required(tree, name) + def _check_nested_tag_empty(self, tree, name=EXTERNALS_NAME): + self._check_generic_empty_default_required(tree, name) + def _check_simple_tag_ok(self, tree, directory=EXTERNALS_NAME): name = './{0}/simp_tag'.format(directory) self._check_generic_ok_clean_required(tree, name) + def _check_nested_tag_ok(self, tree, name=EXTERNALS_NAME): + self._check_generic_ok_clean_required(tree, name) + def _check_simple_tag_dirty(self, tree, directory=EXTERNALS_NAME): name = './{0}/simp_tag'.format(directory) self._check_generic_ok_dirty_required(tree, name) @@ -687,10 +730,16 @@ def _check_simple_branch_empty(self, tree, directory=EXTERNALS_NAME): name = './{0}/simp_branch'.format(directory) self._check_generic_empty_default_required(tree, name) + def _check_nested_branch_empty(self, tree, name=EXTERNALS_NAME): + self._check_generic_empty_default_required(tree, name) + def _check_simple_branch_ok(self, tree, directory=EXTERNALS_NAME): name = './{0}/simp_branch'.format(directory) self._check_generic_ok_clean_required(tree, name) + def _check_nested_branch_ok(self, tree, name=EXTERNALS_NAME): + self._check_generic_ok_clean_required(tree, name) + def _check_simple_branch_modified(self, tree, directory=EXTERNALS_NAME): name = './{0}/simp_branch'.format(directory) self._check_generic_modified_ok_required(tree, name) @@ -699,10 +748,16 @@ def _check_simple_hash_empty(self, tree, directory=EXTERNALS_NAME): name = './{0}/simp_hash'.format(directory) self._check_generic_empty_default_required(tree, name) + def _check_nested_hash_empty(self, tree, name=EXTERNALS_NAME): + self._check_generic_empty_default_required(tree, name) + def _check_simple_hash_ok(self, tree, directory=EXTERNALS_NAME): name = './{0}/simp_hash'.format(directory) self._check_generic_ok_clean_required(tree, name) + def _check_nested_hash_ok(self, tree, name=EXTERNALS_NAME): + self._check_generic_ok_clean_required(tree, name) + def _check_simple_hash_modified(self, tree, directory=EXTERNALS_NAME): name = './{0}/simp_hash'.format(directory) self._check_generic_modified_ok_required(tree, name) @@ -754,6 +809,12 @@ def _check_container_simple_required_pre_checkout(self, overall, tree): self._check_simple_branch_empty(tree) self._check_simple_hash_empty(tree) + def _check_container_nested_required_pre_checkout(self, overall, tree, order): + self.assertEqual(overall, 0) + self._check_nested_tag_empty(tree, name=NESTED_NAME[order[0]]) + self._check_nested_branch_empty(tree, name=NESTED_NAME[order[1]]) + self._check_nested_hash_empty(tree, name=NESTED_NAME[order[2]]) + def _check_container_simple_required_checkout(self, overall, tree): # Note, this is the internal tree status just before checkout self.assertEqual(overall, 0) @@ -761,12 +822,25 @@ def _check_container_simple_required_checkout(self, overall, tree): self._check_simple_branch_empty(tree) self._check_simple_hash_empty(tree) + def _check_container_nested_required_checkout(self, overall, tree, order): + # Note, this is the internal tree status just before checkout + self.assertEqual(overall, 0) + self._check_nested_tag_empty(tree, name=NESTED_NAME[order[0]]) + self._check_nested_branch_empty(tree, name=NESTED_NAME[order[1]]) + self._check_nested_hash_empty(tree, name=NESTED_NAME[order[2]]) + def _check_container_simple_required_post_checkout(self, overall, tree): self.assertEqual(overall, 0) self._check_simple_tag_ok(tree) self._check_simple_branch_ok(tree) self._check_simple_hash_ok(tree) + def _check_container_nested_required_post_checkout(self, overall, tree, order): + self.assertEqual(overall, 0) + self._check_nested_tag_ok(tree, name=NESTED_NAME[order[0]]) + self._check_nested_branch_ok(tree, name=NESTED_NAME[order[1]]) + self._check_nested_hash_ok(tree, name=NESTED_NAME[order[2]]) + def _check_container_simple_required_out_of_sync(self, overall, tree): self.assertEqual(overall, 0) self._check_simple_tag_modified(tree) @@ -819,10 +893,15 @@ def _check_container_component_post_checkout(self, overall, tree): def _check_container_component_post_checkout2(self, overall, tree): self.assertEqual(overall, 0) - self._check_simple_opt_ok(tree) self._check_simple_tag_empty(tree) self._check_simple_branch_ok(tree) + def _check_container_component_post_checkout3(self, overall, tree): + self.assertEqual(overall, 0) + self.assertFalse("simp_opt" in tree) + self._check_simple_tag_ok(tree) + self._check_simple_branch_ok(tree) + def _check_container_full_post_checkout(self, overall, tree): self.assertEqual(overall, 0) self._check_simple_tag_ok(tree) @@ -959,6 +1038,37 @@ def test_container_simple_required(self): self.status_args) self._check_container_simple_required_post_checkout(overall, tree) + def test_container_nested_required(self): + """Verify that a container with nested subrepos + generates the correct initial status. + Tests over all possible permutations + """ + + orders = [[0, 1, 2], [1, 2, 0], [2, 0, 1], + [0, 2, 1], [2, 1, 0], [1, 0, 2]] + for n, order in enumerate(orders): + # create repo + dest_dir = os.path.join(os.environ[MANIC_TEST_TMP_REPO_ROOT], + self._test_id, "test"+str(n)) + under_test_dir = self.setup_test_repo(CONTAINER_REPO_NAME, + dest_dir_in=dest_dir) + self._generator.container_nested_required(under_test_dir, order) + + # status of empty repo + overall, tree = self.execute_cmd_in_dir(under_test_dir, + self.status_args) + self._check_container_nested_required_pre_checkout(overall, tree, order) + + # checkout + overall, tree = self.execute_cmd_in_dir(under_test_dir, + self.checkout_args) + self._check_container_nested_required_checkout(overall, tree, order) + + # status clean checked out + overall, tree = self.execute_cmd_in_dir(under_test_dir, + self.status_args) + self._check_container_nested_required_post_checkout(overall, tree, order) + def test_container_simple_optional(self): """Verify that container with an optional simple subrepos generates the correct initial status. @@ -1347,6 +1457,23 @@ def test_container_component(self): self.status_args) self._check_container_component_post_checkout2(overall, tree) + def test_container_exclude_component(self): + """Verify that exclude component checkout works + """ + # create the test repository + under_test_dir = self.setup_test_repo(CONTAINER_REPO_NAME) + + # create the top level externals file + self._generator.container_full(under_test_dir) + + # inital checkout, exclude simp_opt + checkout_args = ['--exclude', 'simp_opt'] + checkout_args.extend(self.checkout_args) + overall, tree = self.execute_cmd_in_dir(under_test_dir, checkout_args) + checkout_args.append("--status") + overall, tree = self.execute_cmd_in_dir(under_test_dir, checkout_args) + self._check_container_component_post_checkout3(overall, tree) + def test_mixed_simple(self): """Verify that a mixed use repo can serve as a 'full' container, pulling in a set of externals and a seperate set of sub-externals. @@ -1569,7 +1696,7 @@ def setUp(self): """ # Run the basic setup - super(TestSubrepoCheckout, self).setUp() + super().setUp() # create test repo # We need to do this here (rather than have a static repo) because # git submodules do not allow for variables in .gitmodules files @@ -1588,8 +1715,9 @@ def setUp(self): cwd = os.getcwd() fork_repo_dir = os.path.join(self._bare_root, SIMPLE_FORK_NAME) simple_repo_dir = os.path.join(self._bare_root, SIMPLE_REPO_NAME) - self._simple_ext_fork_name = SIMPLE_FORK_NAME.split('.')[0] - self._simple_ext_name = SIMPLE_REPO_NAME.split('.')[0] + self._simple_ext_fork_name = os.path.splitext(SIMPLE_FORK_NAME)[0] + self._simple_ext_name = os.path.join('sourc', + os.path.splitext(SIMPLE_REPO_NAME)[0]) os.chdir(self._repo_dir) # Add a branch with a subrepo cmd = ['git', 'branch', self._bare_branch_name, 'master'] @@ -1610,7 +1738,8 @@ def setUp(self): execute_subprocess(cmd) cmd = ['git', 'checkout', self._config_branch_name] execute_subprocess(cmd) - cmd = ['git', 'submodule', 'add', simple_repo_dir] + cmd = ['git', 'submodule', 'add', '--name', SIMPLE_REPO_NAME, + simple_repo_dir, self._simple_ext_name] execute_subprocess(cmd) # Checkout feature2 os.chdir(self._simple_ext_name) diff --git a/manage_externals/test/test_unit_externals_description.py b/manage_externals/test/test_unit_externals_description.py index 637f760ee5..0b1248f670 100644 --- a/manage_externals/test/test_unit_externals_description.py +++ b/manage_externals/test/test_unit_externals_description.py @@ -342,6 +342,40 @@ def setup_config(self): # NOTE(goldy, 2019-03) Should test other possible keywords such as # fetchRecurseSubmodules, ignore, and shallow + @staticmethod + def setup_dict_config(): + """Create the full container dictionary with simple and mixed use + externals + + """ + rdatat = {ExternalsDescription.PROTOCOL: 'git', + ExternalsDescription.REPO_URL: 'simple-ext.git', + ExternalsDescription.TAG: 'tag1'} + rdatab = {ExternalsDescription.PROTOCOL: 'git', + ExternalsDescription.REPO_URL: 'simple-ext.git', + ExternalsDescription.BRANCH: 'feature2'} + rdatam = {ExternalsDescription.PROTOCOL: 'git', + ExternalsDescription.REPO_URL: 'mixed-cont-ext.git', + ExternalsDescription.BRANCH: 'master'} + desc = {'simp_tag': {ExternalsDescription.REQUIRED: True, + ExternalsDescription.PATH: 'simp_tag', + ExternalsDescription.EXTERNALS: EMPTY_STR, + ExternalsDescription.REPO: rdatat}, + 'simp_branch' : {ExternalsDescription.REQUIRED: True, + ExternalsDescription.PATH: 'simp_branch', + ExternalsDescription.EXTERNALS: EMPTY_STR, + ExternalsDescription.REPO: rdatab}, + 'simp_opt': {ExternalsDescription.REQUIRED: False, + ExternalsDescription.PATH: 'simp_opt', + ExternalsDescription.EXTERNALS: EMPTY_STR, + ExternalsDescription.REPO: rdatat}, + 'mixed_req': {ExternalsDescription.REQUIRED: True, + ExternalsDescription.PATH: 'mixed_req', + ExternalsDescription.EXTERNALS: 'sub-ext.cfg', + ExternalsDescription.REPO: rdatam}} + + return desc + def test_cfg_v1_ok(self): """Test that a correct cfg v1 object is created by create_externals_description @@ -379,6 +413,49 @@ def test_dict(self): ext = create_externals_description(desc, model_format='dict') self.assertIsInstance(ext, ExternalsDescriptionDict) + def test_cfg_component_dict(self): + """Verify that create_externals_description works with a dictionary + """ + # create the top level externals file + desc = self.setup_dict_config() + # Check external with all repos + external = create_externals_description(desc, model_format='dict') + self.assertIsInstance(external, ExternalsDescriptionDict) + self.assertTrue('simp_tag' in external) + self.assertTrue('simp_branch' in external) + self.assertTrue('simp_opt' in external) + self.assertTrue('mixed_req' in external) + + def test_cfg_exclude_component_dict(self): + """Verify that exclude component checkout works with a dictionary + """ + # create the top level externals file + desc = self.setup_dict_config() + # Test an excluded repo + external = create_externals_description(desc, model_format='dict', + exclude=['simp_tag', + 'simp_opt']) + self.assertIsInstance(external, ExternalsDescriptionDict) + self.assertFalse('simp_tag' in external) + self.assertTrue('simp_branch' in external) + self.assertFalse('simp_opt' in external) + self.assertTrue('mixed_req' in external) + + def test_cfg_opt_component_dict(self): + """Verify that exclude component checkout works with a dictionary + """ + # create the top level externals file + desc = self.setup_dict_config() + # Test an excluded repo + external = create_externals_description(desc, model_format='dict', + components=['simp_tag', + 'simp_opt']) + self.assertIsInstance(external, ExternalsDescriptionDict) + self.assertTrue('simp_tag' in external) + self.assertFalse('simp_branch' in external) + self.assertTrue('simp_opt' in external) + self.assertFalse('mixed_req' in external) + def test_cfg_unknown_version(self): """Test that a runtime error is raised when an unknown file version is received diff --git a/python/ctsm/lilac_build_ctsm.py b/python/ctsm/lilac_build_ctsm.py index b13baeba87..4774993e7e 100644 --- a/python/ctsm/lilac_build_ctsm.py +++ b/python/ctsm/lilac_build_ctsm.py @@ -22,7 +22,7 @@ # these are arbitrary, since we only use the case for its build, not any of the runtime # settings; they just need to be valid -_COMPSET = 'I2000Ctsm50NwpSpAsRsGs' +_COMPSET = 'I2000Ctsm50NwpSpAsRs' _RES = 'f10_f10_musgs' _PATH_TO_TEMPLATES = os.path.join(path_to_ctsm_root(), @@ -606,6 +606,9 @@ def _create_case(cime_path, build_dir, compiler, '--res', _RES, '--compiler', compiler, '--driver', 'nuopc', + # Project isn't used for anything in the LILAC workflow, but it + # still needs to be specified on machines that expect it. + '--project', 'UNSET', '--run-unsupported'] create_newcase_cmd.extend(machine_args) if inputdata_path: diff --git a/python/ctsm/lilac_make_runtime_inputs.py b/python/ctsm/lilac_make_runtime_inputs.py index bfe4998c02..5b9a4e1f76 100644 --- a/python/ctsm/lilac_make_runtime_inputs.py +++ b/python/ctsm/lilac_make_runtime_inputs.py @@ -24,7 +24,7 @@ -Specifies clm physics +Specifies ctsm physics """ @@ -172,7 +172,7 @@ def buildnml(cime_path, rundir): finidat = get_config_value(config, 'buildnml_input', 'finidat', ctsm_cfg_path) ctsm_phys = get_config_value(config, 'buildnml_input', 'ctsm_phys', ctsm_cfg_path, - allowed_values=['clm4_5', 'clm5_0']) + allowed_values=['clm4_5', 'clm5_0', 'clm5_1']) configuration = get_config_value(config, 'buildnml_input', 'configuration', ctsm_cfg_path, allowed_values=['nwp', 'clm']) structure = get_config_value(config, 'buildnml_input', 'structure', ctsm_cfg_path, @@ -217,7 +217,7 @@ def buildnml(cime_path, rundir): tempfile.write(env_lilac_text) # remove any existing clm.input_data_list file - inputdatalist_path = os.path.join(rundir, "clm.input_data_list") + inputdatalist_path = os.path.join(rundir, "ctsm.input_data_list") if os.path.exists(inputdatalist_path): os.remove(inputdatalist_path) diff --git a/python/ctsm/run_sys_tests.py b/python/ctsm/run_sys_tests.py index bbde160fe3..7d5d0a2e94 100644 --- a/python/ctsm/run_sys_tests.py +++ b/python/ctsm/run_sys_tests.py @@ -164,7 +164,7 @@ def run_sys_tests(machine, cime_path, if not dry_run: _make_cs_status_non_suite(testroot, testid_base) if testfile: - test_args = ['--testfile', testfile] + test_args = ['--testfile', os.path.abspath(testfile)] elif testlist: test_args = testlist else: diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3e4ab93151..490aa3542a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -35,6 +35,7 @@ add_subdirectory(${CLM_ROOT}/src/biogeophys clm_biogeophys) add_subdirectory(${CLM_ROOT}/src/dyn_subgrid clm_dyn_subgrid) add_subdirectory(${CLM_ROOT}/src/main clm_main) add_subdirectory(${CLM_ROOT}/src/init_interp clm_init_interp) +add_subdirectory(${CLM_ROOT}/src/self_tests clm_self_tests) # Add general unit test directories (stubbed out files, etc.) add_subdirectory(unit_test_stubs) @@ -105,3 +106,4 @@ add_subdirectory(${CLM_ROOT}/src/soilbiogeochem/test clm_soilbiogeochem_test) add_subdirectory(${CLM_ROOT}/src/dyn_subgrid/test clm_dyn_subgrid_test) add_subdirectory(${CLM_ROOT}/src/main/test clm_main_test) add_subdirectory(${CLM_ROOT}/src/init_interp/test clm_init_interp_test) +add_subdirectory(${CLM_ROOT}/src/self_tests/test clm_self_tests_test) \ No newline at end of file diff --git a/src/biogeochem/CNDVDriverMod.F90 b/src/biogeochem/CNDVDriverMod.F90 index 1d01f435f5..b007495849 100644 --- a/src/biogeochem/CNDVDriverMod.F90 +++ b/src/biogeochem/CNDVDriverMod.F90 @@ -419,7 +419,7 @@ character(len=256) function set_dgvm_filename () ! Determine initial dataset filenames ! ! !USES: - use clm_varctl , only : caseid, inst_suffix + use clm_varctl , only : caseid, inst_suffix, compname use clm_time_manager , only : get_curr_date ! ! !ARGUMENTS: @@ -435,7 +435,7 @@ character(len=256) function set_dgvm_filename () call get_curr_date (yr, mon, day, sec) write(cdate,'(i4.4,"-",i2.2,"-",i2.2,"-",i5.5)') yr,mon,day,sec - set_dgvm_filename = "./"//trim(caseid)//".clm2"//trim(inst_suffix)//& + set_dgvm_filename = "./"//trim(caseid)//"."//trim(compname)//trim(inst_suffix)//& ".hv."//trim(cdate)//".nc" end function set_dgvm_filename diff --git a/src/biogeochem/CNDriverMod.F90 b/src/biogeochem/CNDriverMod.F90 index f9f4b4532c..a969349136 100644 --- a/src/biogeochem/CNDriverMod.F90 +++ b/src/biogeochem/CNDriverMod.F90 @@ -40,6 +40,7 @@ module CNDriverMod use EnergyFluxType , only : energyflux_type use SaturatedExcessRunoffMod , only : saturated_excess_runoff_type use ActiveLayerMod , only : active_layer_type + use SoilWaterRetentionCurveMod , only : soil_water_retention_curve_type ! ! !PUBLIC TYPES: implicit none @@ -80,7 +81,8 @@ end subroutine CNDriverInit !----------------------------------------------------------------------- subroutine CNDriverNoLeaching(bounds, & - num_soilc, filter_soilc, num_soilp, filter_soilp, num_pcropp, filter_pcropp, doalb, & + num_soilc, filter_soilc, num_soilp, filter_soilp, num_pcropp, filter_pcropp, & + num_exposedvegp, filter_exposedvegp, num_noexposedvegp, filter_noexposedvegp, doalb, & cnveg_state_inst, & cnveg_carbonflux_inst, cnveg_carbonstate_inst, & c13_cnveg_carbonflux_inst, c13_cnveg_carbonstate_inst, & @@ -94,7 +96,8 @@ subroutine CNDriverNoLeaching(bounds, soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst, & active_layer_inst, & atm2lnd_inst, waterstatebulk_inst, waterdiagnosticbulk_inst, waterfluxbulk_inst, & - wateratm2lndbulk_inst, canopystate_inst, soilstate_inst, temperature_inst, crop_inst, ch4_inst, & + wateratm2lndbulk_inst, canopystate_inst, soilstate_inst, temperature_inst, & + soil_water_retention_curve, crop_inst, ch4_inst, & dgvs_inst, photosyns_inst, saturated_excess_runoff_inst, energyflux_inst, & nutrient_competition_method, cnfire_method, dribble_crophrv_xsmrpool_2atm) ! @@ -146,6 +149,10 @@ subroutine CNDriverNoLeaching(bounds, integer , intent(in) :: filter_soilp(:) ! filter for soil patches integer , intent(in) :: num_pcropp ! number of prog. crop patches in filter integer , intent(in) :: filter_pcropp(:) ! filter for prognostic crop patches + integer , intent(in) :: num_exposedvegp ! number of points in filter_exposedvegp + integer , intent(in) :: filter_exposedvegp(:) ! patch filter for non-snow-covered veg + integer , intent(in) :: num_noexposedvegp ! number of points in filter_noexposedvegp + integer , intent(in) :: filter_noexposedvegp(:) ! patch filter where frac_veg_nosno is 0 logical , intent(in) :: doalb ! true = surface albedo calculation time step type(cnveg_state_type) , intent(inout) :: cnveg_state_inst type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst @@ -178,6 +185,7 @@ subroutine CNDriverNoLeaching(bounds, type(canopystate_type) , intent(inout) :: canopystate_inst type(soilstate_type) , intent(inout) :: soilstate_inst type(temperature_type) , intent(inout) :: temperature_inst + class(soil_water_retention_curve_type) , intent(in) :: soil_water_retention_curve type(crop_type) , intent(inout) :: crop_inst type(ch4_type) , intent(in) :: ch4_inst type(dgvs_type) , intent(inout) :: dgvs_inst @@ -747,7 +755,9 @@ subroutine CNDriverNoLeaching(bounds, call t_startf('CNFire') call cnfire_method%CNFireArea(bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & + num_exposedvegp, filter_exposedvegp, num_noexposedvegp, filter_noexposedvegp, & atm2lnd_inst, energyflux_inst, saturated_excess_runoff_inst, waterdiagnosticbulk_inst, wateratm2lndbulk_inst, & + waterstatebulk_inst, soilstate_inst, soil_water_retention_curve, & cnveg_state_inst, cnveg_carbonstate_inst, & totlitc_col=soilbiogeochem_carbonstate_inst%totlitc_col(begc:endc), & decomp_cpools_vr_col=soilbiogeochem_carbonstate_inst%decomp_cpools_vr_col(begc:endc,1:nlevdecomp_full,1:ndecomp_pools), & diff --git a/src/biogeochem/CNFireBaseMod.F90 b/src/biogeochem/CNFireBaseMod.F90 index 971b2eaba9..1ba0efc4d4 100644 --- a/src/biogeochem/CNFireBaseMod.F90 +++ b/src/biogeochem/CNFireBaseMod.F90 @@ -17,6 +17,7 @@ module CNFireBaseMod use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_CL use shr_log_mod , only : errMsg => shr_log_errMsg use clm_varctl , only : iulog + use clm_varpar , only : nlevgrnd use pftconMod , only : noveg, pftcon use abortutils , only : endrun use decompMod , only : bounds_type @@ -32,6 +33,9 @@ module CNFireBaseMod use SaturatedExcessRunoffMod , only : saturated_excess_runoff_type use WaterDiagnosticBulkType , only : waterdiagnosticbulk_type use Wateratm2lndBulkType , only : wateratm2lndbulk_type + use WaterStateBulkType , only : waterstatebulk_type + use SoilStateType , only : soilstate_type + use SoilWaterRetentionCurveMod , only : soil_water_retention_curve_type use GridcellType , only : grc use ColumnType , only : col use PatchType , only : patch @@ -74,14 +78,21 @@ module CNFireBaseMod type, abstract, extends(fire_base_type) :: cnfire_base_type private ! !PRIVATE MEMBER DATA: + ! !PUBLIC MEMBER DATA (used by extensions of the base class): + real(r8), public, pointer :: btran2_patch (:) ! patch root zone soil wetness factor (0 to 1) contains ! ! !PUBLIC MEMBER FUNCTIONS: - procedure, public :: FireReadNML ! Read in namelist for CNFire - procedure, public :: CNFireReadParams ! Read in constant parameters from the paramsfile - procedure, public :: CNFireArea ! Calculate fire area - procedure, public :: CNFireFluxes ! Calculate fire fluxes + procedure, public :: FireInit => CNFireInit ! Initialization of Fire + procedure, public :: FireReadNML ! Read in namelist for CNFire + procedure, public :: CNFireReadParams ! Read in constant parameters from the paramsfile + procedure, public :: CNFireFluxes ! Calculate fire fluxes + procedure, public :: CNFire_calc_fire_root_wetness_Li2014 ! Calculate CN-fire specific root wetness: original version + procedure, public :: CNFire_calc_fire_root_wetness_Li2021 ! Calculate CN-fire specific root wetness: 2021 version + ! !PRIVATE MEMBER FUNCTIONS: + procedure, private :: InitAllocate ! Memory allocation of Fire + procedure, private :: InitHistory ! History file assignment of fire ! end type cnfire_base_type !----------------------------------------------------------------------- @@ -112,6 +123,198 @@ end function need_lightning_and_popdens_interface contains !----------------------------------------------------------------------- + subroutine CNFireInit( this, bounds, NLFilename ) + ! + ! !DESCRIPTION: + ! Initialize CN Fire module + ! !ARGUMENTS: + class(cnfire_base_type) :: this + type(bounds_type), intent(in) :: bounds + character(len=*), intent(in) :: NLFilename + !----------------------------------------------------------------------- + ! Call the base-class Initialization method + call this%BaseFireInit( bounds, NLFilename ) + + ! Allocate memory + call this%InitAllocate( bounds ) + ! History file + call this%InitHistory( bounds ) + end subroutine CNFireInit + !---------------------------------------------------------------------- + + subroutine InitAllocate( this, bounds ) + ! + ! Initiaze memory allocate's + use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) + ! + ! !ARGUMENTS: + class(cnfire_base_type) :: this + type(bounds_type), intent(in) :: bounds + !----------------------------------------------------------------------- + integer :: begp, endp + !------------------------------------------------------------------------ + begp = bounds%begp; endp= bounds%endp + + allocate(this%btran2_patch (begp:endp)) ; this%btran2_patch (:) = nan + + end subroutine InitAllocate + + !----------------------------------------------------------------------- + subroutine InitHistory( this, bounds ) + ! + ! Initailizae history variables + use clm_varcon , only : spval + use histFileMod , only : hist_addfld1d + ! + ! !ARGUMENTS: + class(cnfire_base_type) :: this + type(bounds_type), intent(in) :: bounds + !----------------------------------------------------------------------- + integer :: begp, endp + !------------------------------------------------------------------------ + begp = bounds%begp; endp= bounds%endp + this%btran2_patch(begp:endp) = spval + call hist_addfld1d(fname='BTRAN2', units='unitless', & + avgflag='A', long_name='root zone soil wetness factor', & + ptr_patch=this%btran2_patch, l2g_scale_type='veg') + end subroutine InitHistory + + !---------------------------------------------------------------------- + subroutine CNFire_calc_fire_root_wetness_Li2014( this, bounds, & + num_exposedvegp, filter_exposedvegp, num_noexposedvegp, filter_noexposedvegp, & + waterstatebulk_inst, soilstate_inst, soil_water_retention_curve ) + ! + ! Calculate the root wetness term that will be used by the fire model + ! + class(cnfire_base_type) :: this + type(bounds_type) , intent(in) :: bounds !bounds + integer , intent(in) :: num_exposedvegp !number of filters + integer , intent(in) :: filter_exposedvegp(:) !filter array + integer , intent(in) :: num_noexposedvegp ! number of points in filter_noexposedvegp + integer , intent(in) :: filter_noexposedvegp(:) ! patch filter where frac_veg_nosno is 0 + type(waterstatebulk_type), intent(in) :: waterstatebulk_inst + type(soilstate_type) , intent(in) :: soilstate_inst + class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve + ! !LOCAL VARIABLES: + real(r8) :: smp_node, s_node !temporary variables + real(r8) :: smp_node_lf !temporary variable + integer :: p, fp, j, c, l !indices + !----------------------------------------------------------------------- + + SHR_ASSERT_ALL_FL((ubound(filter_exposedvegp) >= (/num_exposedvegp/)), sourcefile, __LINE__) + + associate( & + smpso => pftcon%smpso , & ! Input: soil water potential at full stomatal opening (mm) + smpsc => pftcon%smpsc , & ! Input: soil water potential at full stomatal closure (mm) + watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation + btran2 => this%btran2_patch , & ! Output: [real(r8) (:) ] integrated soil water stress square + rootfr => soilstate_inst%rootfr_patch , & ! Input: [real(r8) (:,:) ] fraction of roots in each soil layer + h2osoi_vol => waterstatebulk_inst%h2osoi_vol_col & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] (porosity) (constant) + ) + + do fp = 1, num_noexposedvegp + p = filter_noexposedvegp(fp) + ! Set for the sake of history diagnostics. The "normal" btran is set to 0 over + ! this filter, so we do the same for btran2. + btran2(p) = 0._r8 + end do + + do fp = 1, num_exposedvegp + p = filter_exposedvegp(fp) + btran2(p) = 0._r8 + end do + do j = 1,nlevgrnd + do fp = 1, num_exposedvegp + p = filter_exposedvegp(fp) + c = patch%column(p) + l = patch%landunit(p) + s_node = max(h2osoi_vol(c,j)/watsat(c,j), 0.01_r8) + + call soil_water_retention_curve%soil_suction(c, j, s_node, soilstate_inst, smp_node_lf) + + smp_node_lf = max(smpsc(patch%itype(p)), smp_node_lf) + btran2(p) = btran2(p) +rootfr(p,j)*max(0._r8,min((smp_node_lf - smpsc(patch%itype(p))) / & + (smpso(patch%itype(p)) - smpsc(patch%itype(p))), 1._r8)) + end do + end do + + do fp = 1, num_exposedvegp + p = filter_exposedvegp(fp) + if (btran2(p) > 1._r8) then + btran2(p) = 1._r8 + end if + end do + + end associate + + end subroutine CNFire_calc_fire_root_wetness_Li2014 + + !---------------------------------------------------------------------- + subroutine CNFire_calc_fire_root_wetness_Li2021( this, bounds, & + num_exposedvegp, filter_exposedvegp, num_noexposedvegp, filter_noexposedvegp, & + waterstatebulk_inst, soilstate_inst, soil_water_retention_curve ) + ! + ! Calculate the root wetness term that will be used by the fire model + ! + use pftconMod , only : pftcon + use PatchType , only : patch + class(cnfire_base_type) :: this + type(bounds_type) , intent(in) :: bounds !bounds + integer , intent(in) :: num_exposedvegp !number of filters + integer , intent(in) :: filter_exposedvegp(:) !filter array + integer , intent(in) :: num_noexposedvegp ! number of points in filter_noexposedvegp + integer , intent(in) :: filter_noexposedvegp(:) ! patch filter where frac_veg_nosno is 0 + type(waterstatebulk_type), intent(in) :: waterstatebulk_inst + type(soilstate_type) , intent(in) :: soilstate_inst + class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve + ! !LOCAL VARIABLES: + real(r8) :: s_node !temporary variables + integer :: p, fp, j, c !indices + !----------------------------------------------------------------------- + + SHR_ASSERT_ALL_FL((ubound(filter_exposedvegp) >= (/num_exposedvegp/)), sourcefile, __LINE__) + + associate( & + watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation + btran2 => this%btran2_patch , & ! Output: [real(r8) (:) ] integrated soil water stress square + rootfr => soilstate_inst%rootfr_patch , & ! Input: [real(r8) (:,:) ] fraction of roots in each soil layer + h2osoi_vol => waterstatebulk_inst%h2osoi_vol_col & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] (porosity) (constant) + ) + + do fp = 1, num_noexposedvegp + p = filter_noexposedvegp(fp) + ! Set for the sake of history diagnostics. The "normal" btran is set to 0 over + ! this filter, so we do the same for btran2. + btran2(p) = 0._r8 + end do + + do fp = 1, num_exposedvegp + p = filter_exposedvegp(fp) + btran2(p) = 0._r8 + end do + do j = 1,nlevgrnd + do fp = 1, num_exposedvegp + p = filter_exposedvegp(fp) + c = patch%column(p) + s_node = max(h2osoi_vol(c,j)/watsat(c,j), 0.01_r8) + + btran2(p) = btran2(p) + rootfr(p,j)*s_node + end do + end do + + do fp = 1, num_exposedvegp + p = filter_exposedvegp(fp) + if (btran2(p) > 1._r8) then + btran2(p) = 1._r8 + end if + end do + + end associate + + end subroutine CNFire_calc_fire_root_wetness_Li2021 + !---------------------------------------------------------------------- + + !---------------------------------------------------------------------- subroutine FireReadNML( this, NLFilename ) ! ! !DESCRIPTION: @@ -219,40 +422,6 @@ subroutine FireReadNML( this, NLFilename ) end subroutine FireReadNML - !----------------------------------------------------------------------- - subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - atm2lnd_inst, energyflux_inst, saturated_excess_runoff_inst, & - waterdiagnosticbulk_inst, wateratm2lndbulk_inst, & - cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) - ! - ! !DESCRIPTION: - ! Computes column-level burned area - ! - ! !USES: - ! - ! !ARGUMENTS: - class(cnfire_base_type) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(energyflux_type) , intent(in) :: energyflux_inst - type(saturated_excess_runoff_type) , intent(in) :: saturated_excess_runoff_inst - type(waterdiagnosticbulk_type) , intent(in) :: waterdiagnosticbulk_inst - type(wateratm2lndbulk_type) , intent(in) :: wateratm2lndbulk_inst - type(cnveg_state_type) , intent(inout) :: cnveg_state_inst - type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - real(r8) , intent(in) :: totlitc_col(bounds%begc:) - real(r8) , intent(in) :: decomp_cpools_vr_col(bounds%begc:,1:,1:) - real(r8) , intent(in) :: t_soi17cm_col(bounds%begc:) - ! - - call endrun( 'cnfire_base::CNFireArea: this method MUST be implemented!' ) - - end subroutine CNFireArea - !----------------------------------------------------------------------- subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & dgvs_inst, cnveg_state_inst, & @@ -272,7 +441,6 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte ! ! !USES: use clm_time_manager , only: get_step_size_real,get_days_per_year,get_curr_date - use clm_varpar , only: max_patch_per_col use clm_varctl , only: use_cndv, spinup_state use clm_varcon , only: secspday use pftconMod , only: nc3crop @@ -302,7 +470,7 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte real(r8) , intent(out) :: somc_fire_col(bounds%begc:) ! (gC/m2/s) fire C emissions due to peat burning ! ! !LOCAL VARIABLES: - integer :: g,c,p,j,l,pi,kyr, kmo, kda, mcsec ! indices + integer :: g,c,p,j,l,kyr, kmo, kda, mcsec ! indices integer :: fp,fc ! filter indices real(r8):: f ! rate for fire effects (1/s) real(r8):: m ! acceleration factor for fuel carbon @@ -758,81 +926,75 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte ! fire-induced transfer of carbon and nitrogen pools to litter and cwd do j = 1,nlevdecomp - do pi = 1,max_patch_per_col - do fc = 1,num_soilc - c = filter_soilc(fc) - if (pi <= col%npatches(c)) then - p = col%patchi(c) + pi - 1 - if ( patch%active(p) ) then - - fire_mortality_c_to_cwdc(c,j) = fire_mortality_c_to_cwdc(c,j) + & - m_deadstemc_to_litter_fire(p) * patch%wtcol(p) * stem_prof(p,j) - fire_mortality_c_to_cwdc(c,j) = fire_mortality_c_to_cwdc(c,j) + & - m_deadcrootc_to_litter_fire(p) * patch%wtcol(p) * croot_prof(p,j) - fire_mortality_n_to_cwdn(c,j) = fire_mortality_n_to_cwdn(c,j) + & - m_deadstemn_to_litter_fire(p) * patch%wtcol(p) * stem_prof(p,j) - fire_mortality_n_to_cwdn(c,j) = fire_mortality_n_to_cwdn(c,j) + & - m_deadcrootn_to_litter_fire(p) * patch%wtcol(p) * croot_prof(p,j) - - - fire_mortality_c_to_cwdc(c,j) = fire_mortality_c_to_cwdc(c,j) + & - m_livestemc_to_litter_fire(p) * patch%wtcol(p) * stem_prof(p,j) - fire_mortality_c_to_cwdc(c,j) = fire_mortality_c_to_cwdc(c,j) + & - m_livecrootc_to_litter_fire(p) * patch%wtcol(p) * croot_prof(p,j) - fire_mortality_n_to_cwdn(c,j) = fire_mortality_n_to_cwdn(c,j) + & - m_livestemn_to_litter_fire(p) * patch%wtcol(p) * stem_prof(p,j) - fire_mortality_n_to_cwdn(c,j) = fire_mortality_n_to_cwdn(c,j) + & - m_livecrootn_to_litter_fire(p) * patch%wtcol(p) * croot_prof(p,j) - - - m_c_to_litr_met_fire(c,j)=m_c_to_litr_met_fire(c,j) + & - ((m_leafc_to_litter_fire(p)*lf_flab(patch%itype(p)) & - +m_leafc_storage_to_litter_fire(p) + & - m_leafc_xfer_to_litter_fire(p) + & - m_gresp_storage_to_litter_fire(p) & - +m_gresp_xfer_to_litter_fire(p))*leaf_prof(p,j) + & - (m_frootc_to_litter_fire(p)*fr_flab(patch%itype(p)) & - +m_frootc_storage_to_litter_fire(p) + & - m_frootc_xfer_to_litter_fire(p))*froot_prof(p,j) & - +(m_livestemc_storage_to_litter_fire(p) + & - m_livestemc_xfer_to_litter_fire(p) & - +m_deadstemc_storage_to_litter_fire(p) + & - m_deadstemc_xfer_to_litter_fire(p))* stem_prof(p,j)& - +(m_livecrootc_storage_to_litter_fire(p) + & - m_livecrootc_xfer_to_litter_fire(p) & - +m_deadcrootc_storage_to_litter_fire(p) + & - m_deadcrootc_xfer_to_litter_fire(p))* croot_prof(p,j))* patch%wtcol(p) - m_c_to_litr_cel_fire(c,j)=m_c_to_litr_cel_fire(c,j) + & - (m_leafc_to_litter_fire(p)*lf_fcel(patch%itype(p))*leaf_prof(p,j) + & - m_frootc_to_litter_fire(p)*fr_fcel(patch%itype(p))*froot_prof(p,j))* patch%wtcol(p) - m_c_to_litr_lig_fire(c,j)=m_c_to_litr_lig_fire(c,j) + & - (m_leafc_to_litter_fire(p)*lf_flig(patch%itype(p))*leaf_prof(p,j) + & - m_frootc_to_litter_fire(p)*fr_flig(patch%itype(p))*froot_prof(p,j))* patch%wtcol(p) - - m_n_to_litr_met_fire(c,j)=m_n_to_litr_met_fire(c,j) + & - ((m_leafn_to_litter_fire(p)*lf_flab(patch%itype(p)) & - +m_leafn_storage_to_litter_fire(p) + & - m_leafn_xfer_to_litter_fire(p)+m_retransn_to_litter_fire(p)) & - *leaf_prof(p,j) +(m_frootn_to_litter_fire(p)*fr_flab(patch%itype(p)) & - +m_frootn_storage_to_litter_fire(p) + & - m_frootn_xfer_to_litter_fire(p))*froot_prof(p,j) & - +(m_livestemn_storage_to_litter_fire(p) + & - m_livestemn_xfer_to_litter_fire(p) & - +m_deadstemn_storage_to_litter_fire(p) + & - m_deadstemn_xfer_to_litter_fire(p))* stem_prof(p,j)& - +(m_livecrootn_storage_to_litter_fire(p) + & - m_livecrootn_xfer_to_litter_fire(p) & - +m_deadcrootn_storage_to_litter_fire(p) + & - m_deadcrootn_xfer_to_litter_fire(p))* croot_prof(p,j))* patch%wtcol(p) - m_n_to_litr_cel_fire(c,j)=m_n_to_litr_cel_fire(c,j) + & - (m_leafn_to_litter_fire(p)*lf_fcel(patch%itype(p))*leaf_prof(p,j) + & - m_frootn_to_litter_fire(p)*fr_fcel(patch%itype(p))*froot_prof(p,j))* patch%wtcol(p) - m_n_to_litr_lig_fire(c,j)=m_n_to_litr_lig_fire(c,j) + & - (m_leafn_to_litter_fire(p)*lf_flig(patch%itype(p))*leaf_prof(p,j) + & - m_frootn_to_litter_fire(p)*fr_flig(patch%itype(p))*froot_prof(p,j))* patch%wtcol(p) - end if - end if - end do + do fp = 1, num_soilp + p = filter_soilp(fp) + c = patch%column(p) + + fire_mortality_c_to_cwdc(c,j) = fire_mortality_c_to_cwdc(c,j) + & + m_deadstemc_to_litter_fire(p) * patch%wtcol(p) * stem_prof(p,j) + fire_mortality_c_to_cwdc(c,j) = fire_mortality_c_to_cwdc(c,j) + & + m_deadcrootc_to_litter_fire(p) * patch%wtcol(p) * croot_prof(p,j) + fire_mortality_n_to_cwdn(c,j) = fire_mortality_n_to_cwdn(c,j) + & + m_deadstemn_to_litter_fire(p) * patch%wtcol(p) * stem_prof(p,j) + fire_mortality_n_to_cwdn(c,j) = fire_mortality_n_to_cwdn(c,j) + & + m_deadcrootn_to_litter_fire(p) * patch%wtcol(p) * croot_prof(p,j) + + + fire_mortality_c_to_cwdc(c,j) = fire_mortality_c_to_cwdc(c,j) + & + m_livestemc_to_litter_fire(p) * patch%wtcol(p) * stem_prof(p,j) + fire_mortality_c_to_cwdc(c,j) = fire_mortality_c_to_cwdc(c,j) + & + m_livecrootc_to_litter_fire(p) * patch%wtcol(p) * croot_prof(p,j) + fire_mortality_n_to_cwdn(c,j) = fire_mortality_n_to_cwdn(c,j) + & + m_livestemn_to_litter_fire(p) * patch%wtcol(p) * stem_prof(p,j) + fire_mortality_n_to_cwdn(c,j) = fire_mortality_n_to_cwdn(c,j) + & + m_livecrootn_to_litter_fire(p) * patch%wtcol(p) * croot_prof(p,j) + + + m_c_to_litr_met_fire(c,j)=m_c_to_litr_met_fire(c,j) + & + ((m_leafc_to_litter_fire(p)*lf_flab(patch%itype(p)) & + +m_leafc_storage_to_litter_fire(p) + & + m_leafc_xfer_to_litter_fire(p) + & + m_gresp_storage_to_litter_fire(p) & + +m_gresp_xfer_to_litter_fire(p))*leaf_prof(p,j) + & + (m_frootc_to_litter_fire(p)*fr_flab(patch%itype(p)) & + +m_frootc_storage_to_litter_fire(p) + & + m_frootc_xfer_to_litter_fire(p))*froot_prof(p,j) & + +(m_livestemc_storage_to_litter_fire(p) + & + m_livestemc_xfer_to_litter_fire(p) & + +m_deadstemc_storage_to_litter_fire(p) + & + m_deadstemc_xfer_to_litter_fire(p))* stem_prof(p,j)& + +(m_livecrootc_storage_to_litter_fire(p) + & + m_livecrootc_xfer_to_litter_fire(p) & + +m_deadcrootc_storage_to_litter_fire(p) + & + m_deadcrootc_xfer_to_litter_fire(p))* croot_prof(p,j))* patch%wtcol(p) + m_c_to_litr_cel_fire(c,j)=m_c_to_litr_cel_fire(c,j) + & + (m_leafc_to_litter_fire(p)*lf_fcel(patch%itype(p))*leaf_prof(p,j) + & + m_frootc_to_litter_fire(p)*fr_fcel(patch%itype(p))*froot_prof(p,j))* patch%wtcol(p) + m_c_to_litr_lig_fire(c,j)=m_c_to_litr_lig_fire(c,j) + & + (m_leafc_to_litter_fire(p)*lf_flig(patch%itype(p))*leaf_prof(p,j) + & + m_frootc_to_litter_fire(p)*fr_flig(patch%itype(p))*froot_prof(p,j))* patch%wtcol(p) + + m_n_to_litr_met_fire(c,j)=m_n_to_litr_met_fire(c,j) + & + ((m_leafn_to_litter_fire(p)*lf_flab(patch%itype(p)) & + +m_leafn_storage_to_litter_fire(p) + & + m_leafn_xfer_to_litter_fire(p)+m_retransn_to_litter_fire(p)) & + *leaf_prof(p,j) +(m_frootn_to_litter_fire(p)*fr_flab(patch%itype(p)) & + +m_frootn_storage_to_litter_fire(p) + & + m_frootn_xfer_to_litter_fire(p))*froot_prof(p,j) & + +(m_livestemn_storage_to_litter_fire(p) + & + m_livestemn_xfer_to_litter_fire(p) & + +m_deadstemn_storage_to_litter_fire(p) + & + m_deadstemn_xfer_to_litter_fire(p))* stem_prof(p,j)& + +(m_livecrootn_storage_to_litter_fire(p) + & + m_livecrootn_xfer_to_litter_fire(p) & + +m_deadcrootn_storage_to_litter_fire(p) + & + m_deadcrootn_xfer_to_litter_fire(p))* croot_prof(p,j))* patch%wtcol(p) + m_n_to_litr_cel_fire(c,j)=m_n_to_litr_cel_fire(c,j) + & + (m_leafn_to_litter_fire(p)*lf_fcel(patch%itype(p))*leaf_prof(p,j) + & + m_frootn_to_litter_fire(p)*fr_fcel(patch%itype(p))*froot_prof(p,j))* patch%wtcol(p) + m_n_to_litr_lig_fire(c,j)=m_n_to_litr_lig_fire(c,j) + & + (m_leafn_to_litter_fire(p)*lf_flig(patch%itype(p))*leaf_prof(p,j) + & + m_frootn_to_litter_fire(p)*fr_flig(patch%itype(p))*froot_prof(p,j))* patch%wtcol(p) end do end do ! diff --git a/src/biogeochem/CNFireFactoryMod.F90 b/src/biogeochem/CNFireFactoryMod.F90 index 9ec8f8254d..87616d5280 100644 --- a/src/biogeochem/CNFireFactoryMod.F90 +++ b/src/biogeochem/CNFireFactoryMod.F90 @@ -106,6 +106,7 @@ subroutine create_cnfire_method( NLFilename, cnfire_method ) use CNFireNoFireMod , only : cnfire_nofire_type use CNFireLi2014Mod , only : cnfire_li2014_type use CNFireLi2016Mod , only : cnfire_li2016_type + use CNFireLi2021Mod , only : cnfire_li2021_type use decompMod , only : bounds_type ! ! !ARGUMENTS: @@ -124,6 +125,8 @@ subroutine create_cnfire_method( NLFilename, cnfire_method ) allocate(cnfire_li2014_type :: cnfire_method) case ("li2016crufrc") allocate(cnfire_li2016_type :: cnfire_method) + case ("li2021gswpfrc") + allocate(cnfire_li2021_type :: cnfire_method) case default write(iulog,*) subname//' ERROR: unknown method: ', fire_method diff --git a/src/biogeochem/CNFireLi2014Mod.F90 b/src/biogeochem/CNFireLi2014Mod.F90 index 09a6d52373..a69efbfeae 100644 --- a/src/biogeochem/CNFireLi2014Mod.F90 +++ b/src/biogeochem/CNFireLi2014Mod.F90 @@ -34,8 +34,11 @@ module CNFireLi2014Mod use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con use EnergyFluxType , only : energyflux_type use SaturatedExcessRunoffMod , only : saturated_excess_runoff_type - use WaterDiagnosticBulkType , only : waterdiagnosticbulk_type - use Wateratm2lndBulkType , only : wateratm2lndbulk_type + use WaterDiagnosticBulkType , only : waterdiagnosticbulk_type + use Wateratm2lndBulkType , only : wateratm2lndbulk_type + use WaterStateBulkType , only : waterstatebulk_type + use SoilStateType , only : soilstate_type + use SoilWaterRetentionCurveMod , only : soil_water_retention_curve_type use GridcellType , only : grc use ColumnType , only : col use PatchType , only : patch @@ -79,15 +82,16 @@ end function need_lightning_and_popdens !----------------------------------------------------------------------- subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & + num_exposedvegp, filter_exposedvegp, num_noexposedvegp, filter_noexposedvegp, & atm2lnd_inst, energyflux_inst, saturated_excess_runoff_inst, waterdiagnosticbulk_inst, & - wateratm2lndbulk_inst, cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) + wateratm2lndbulk_inst, waterstatebulk_inst, soilstate_inst, soil_water_retention_curve, & + cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) ! ! !DESCRIPTION: ! Computes column-level burned area ! ! !USES: use clm_time_manager , only: get_step_size_real, get_days_per_year, get_curr_date, get_nstep - use clm_varpar , only: max_patch_per_col use clm_varcon , only: secspday, secsphr use pftconMod , only: nc4_grass, nc3crop, ndllf_evr_tmp_tree use pftconMod , only: nbrdlf_evr_trp_tree, nbrdlf_dcd_trp_tree, nbrdlf_evr_shrub @@ -100,11 +104,18 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ integer , intent(in) :: filter_soilc(:) ! filter for soil columns integer , intent(in) :: num_soilp ! number of soil patches in filter integer , intent(in) :: filter_soilp(:) ! filter for soil patches + integer , intent(in) :: num_exposedvegp ! number of points in filter_exposedvegp + integer , intent(in) :: filter_exposedvegp(:) ! patch filter for non-snow-covered veg + integer , intent(in) :: num_noexposedvegp ! number of points in filter_noexposedvegp + integer , intent(in) :: filter_noexposedvegp(:) ! patch filter where frac_veg_nosno is 0 type(atm2lnd_type) , intent(in) :: atm2lnd_inst type(energyflux_type) , intent(in) :: energyflux_inst type(saturated_excess_runoff_type) , intent(in) :: saturated_excess_runoff_inst - type(waterdiagnosticbulk_type) , intent(in) :: waterdiagnosticbulk_inst - type(wateratm2lndbulk_type) , intent(in) :: wateratm2lndbulk_inst + type(waterdiagnosticbulk_type) , intent(in) :: waterdiagnosticbulk_inst + type(wateratm2lndbulk_type) , intent(in) :: wateratm2lndbulk_inst + type(waterstatebulk_type) , intent(in) :: waterstatebulk_inst + type(soilstate_type) , intent(in) :: soilstate_inst + class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve type(cnveg_state_type) , intent(inout) :: cnveg_state_inst type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst real(r8) , intent(in) :: totlitc_col(bounds%begc:) @@ -160,7 +171,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ fsr_pft => pftcon%fsr_pft , & ! Input: fd_pft => pftcon%fd_pft , & ! Input: - btran2 => energyflux_inst%btran2_patch , & ! Input: [real(r8) (:) ] root zone soil wetness + btran2 => this%cnfire_base_type%btran2_patch , & ! Input: [real(r8) (:) ] root zone soil wetness fsat => saturated_excess_runoff_inst%fsat_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface wf => waterdiagnosticbulk_inst%wf_col , & ! Input: [real(r8) (:) ] soil water as frac. of whc for top 0.05 m wf2 => waterdiagnosticbulk_inst%wf2_col , & ! Input: [real(r8) (:) ] soil water as frac. of whc for top 0.17 m @@ -263,21 +274,17 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ cropf_col(c) = 0._r8 lfwt(c) = 0._r8 end do - do pi = 1,max_patch_per_col - do fc = 1,num_soilc - c = filter_soilc(fc) - if (pi <= col%npatches(c)) then - p = col%patchi(c) + pi - 1 - ! For crop veg types - if( patch%itype(p) > nc4_grass )then - cropf_col(c) = cropf_col(c) + patch%wtcol(p) - end if - ! For natural vegetation (non-crop and non-bare-soil) - if( patch%itype(p) >= ndllf_evr_tmp_tree .and. patch%itype(p) <= nc4_grass )then - lfwt(c) = lfwt(c) + patch%wtcol(p) - end if - end if - end do + do fp = 1, num_soilp + p = filter_soilp(fp) + c = patch%column(p) + ! For crop veg types + if( patch%itype(p) > nc4_grass )then + cropf_col(c) = cropf_col(c) + patch%wtcol(p) + end if + ! For natural vegetation (non-crop and non-bare-soil) + if( patch%itype(p) >= ndllf_evr_tmp_tree .and. patch%itype(p) <= nc4_grass )then + lfwt(c) = lfwt(c) + patch%wtcol(p) + end if end do ! ! Calculate crop fuel @@ -286,22 +293,18 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ c = filter_soilc(fc) fuelc_crop(c)=0._r8 end do - do pi = 1,max_patch_per_col - do fc = 1,num_soilc - c = filter_soilc(fc) - if (pi <= col%npatches(c)) then - p = col%patchi(c) + pi - 1 - ! For crop PFTs, fuel load includes leaf and litter; only - ! column-level litter carbon - ! is available, so we use leaf carbon to estimate the - ! litter carbon for crop PFTs - if( patch%itype(p) > nc4_grass .and. patch%wtcol(p) > 0._r8 .and. leafc_col(c) > 0._r8 )then - fuelc_crop(c)=fuelc_crop(c) + (leafc(p) + leafc_storage(p) + & - leafc_xfer(p))*patch%wtcol(p)/cropf_col(c) + & - totlitc(c)*leafc(p)/leafc_col(c)*patch%wtcol(p)/cropf_col(c) - end if - end if - end do + do fp = 1, num_soilp + p = filter_soilp(fp) + c = patch%column(p) + ! For crop PFTs, fuel load includes leaf and litter; only + ! column-level litter carbon + ! is available, so we use leaf carbon to estimate the + ! litter carbon for crop PFTs + if( patch%itype(p) > nc4_grass .and. patch%wtcol(p) > 0._r8 .and. leafc_col(c) > 0._r8 )then + fuelc_crop(c)=fuelc_crop(c) + (leafc(p) + leafc_storage(p) + & + leafc_xfer(p))*patch%wtcol(p)/cropf_col(c) + & + totlitc(c)*leafc(p)/leafc_col(c)*patch%wtcol(p)/cropf_col(c) + end if end do ! ! Calculate noncrop column variables @@ -322,132 +325,137 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ dtrotr_col(c)=0._r8 end if end do - do pi = 1,max_patch_per_col - do fc = 1,num_soilc - c = filter_soilc(fc) - g = col%gridcell(c) - if (pi <= col%npatches(c)) then - p = col%patchi(c) + pi - 1 - - ! For non-crop -- natural vegetation and bare-soil - if( patch%itype(p) < nc3crop .and. cropf_col(c) < 1.0_r8 )then - if( .not. shr_infnan_isnan(btran2(p))) then - if (btran2(p) <= 1._r8 ) then - btran_col(c) = btran_col(c)+btran2(p)*patch%wtcol(p) - wtlf(c) = wtlf(c)+patch%wtcol(p) - end if - end if - ! NOTE(wjs, 2016-12-15) These calculations of the fraction of evergreen - ! and deciduous tropical trees (used to determine if a column is - ! tropical closed forest) use the current fractions. However, I think - ! they are used in code that applies to land cover change. Note that - ! land cover change is currently generated on the first time step of the - ! year (even though the fire code sees the annually-smoothed dwt). Thus, - ! I think that, for this to be totally consistent, this code should - ! consider the fractional coverage of each PFT prior to the relevant - ! land cover change event. (These fractions could be computed in the - ! code that handles land cover change, so that the fire code remains - ! agnostic to exactly how and when land cover change happens.) - ! - ! For example, if a year started with fractional coverages of - ! nbrdlf_evr_trp_tree = 0.35 and nbrdlf_dcd_trp_tree = 0.35, but then - ! the start-of-year land cover change reduced both of these to 0.2: The - ! current code would consider the column to NOT be tropical closed - ! forest (because nbrdlf_evr_trp_tree+nbrdlf_dcd_trp_tree < 0.6), - ! whereas in fact the land cover change occurred when the column *was* - ! tropical closed forest. - if( patch%itype(p) == nbrdlf_evr_trp_tree .and. patch%wtcol(p) > 0._r8 )then - trotr1_col(c)=trotr1_col(c)+patch%wtcol(p) - end if - if( patch%itype(p) == nbrdlf_dcd_trp_tree .and. patch%wtcol(p) > 0._r8 )then - trotr2_col(c)=trotr2_col(c)+patch%wtcol(p) - end if + ! This subroutine calculates btran2 + call this%CNFire_calc_fire_root_wetness_Li2014(bounds, & + num_exposedvegp, filter_exposedvegp, num_noexposedvegp, filter_noexposedvegp, & + waterstatebulk_inst, soilstate_inst, soil_water_retention_curve) + do fp = 1, num_exposedvegp + p = filter_exposedvegp(fp) + c = patch%column(p) + ! For non-crop -- natural vegetation and bare-soil + if( patch%itype(p) < nc3crop .and. cropf_col(c) < 1.0_r8 )then + btran_col(c) = btran_col(c)+btran2(p)*patch%wtcol(p) + wtlf(c) = wtlf(c)+patch%wtcol(p) + end if + end do - if (transient_landcover) then - if( patch%itype(p) == nbrdlf_evr_trp_tree .or. patch%itype(p) == nbrdlf_dcd_trp_tree )then - if(dwt_smoothed(p) < 0._r8)then - ! Land cover change in CLM happens all at once on the first time - ! step of the year. However, the fire code needs deforestation - ! rates throughout the year, in order to combine these - ! deforestation rates with the current season's climate. So we - ! use a smoothed version of dwt. - ! - ! This isn't ideal, because the carbon stocks that the fire code - ! is operating on will have decreased by the full annual amount - ! before the fire code does anything. But the biggest effect of - ! these deforestation fires is as a trigger for other fires, and - ! the C fluxes are merely diagnostic so don't need to be - ! conservative, so this isn't a big issue. - ! - ! (Actually, it would be even better if the fire code had a - ! realistic breakdown of annual deforestation into the - ! different seasons. But having deforestation spread evenly - ! throughout the year is much better than having it all - ! concentrated on January 1.) - dtrotr_col(c)=dtrotr_col(c)-dwt_smoothed(p) - end if - end if + do fp = 1, num_soilp + p = filter_soilp(fp) + c = patch%column(p) + g = col%gridcell(c) + + ! For non-crop -- natural vegetation and bare-soil + if( patch%itype(p) < nc3crop .and. cropf_col(c) < 1.0_r8 )then + + ! NOTE(wjs, 2016-12-15) These calculations of the fraction of evergreen + ! and deciduous tropical trees (used to determine if a column is + ! tropical closed forest) use the current fractions. However, I think + ! they are used in code that applies to land cover change. Note that + ! land cover change is currently generated on the first time step of the + ! year (even though the fire code sees the annually-smoothed dwt). Thus, + ! I think that, for this to be totally consistent, this code should + ! consider the fractional coverage of each PFT prior to the relevant + ! land cover change event. (These fractions could be computed in the + ! code that handles land cover change, so that the fire code remains + ! agnostic to exactly how and when land cover change happens.) + ! + ! For example, if a year started with fractional coverages of + ! nbrdlf_evr_trp_tree = 0.35 and nbrdlf_dcd_trp_tree = 0.35, but then + ! the start-of-year land cover change reduced both of these to 0.2: The + ! current code would consider the column to NOT be tropical closed + ! forest (because nbrdlf_evr_trp_tree+nbrdlf_dcd_trp_tree < 0.6), + ! whereas in fact the land cover change occurred when the column *was* + ! tropical closed forest. + if( patch%itype(p) == nbrdlf_evr_trp_tree .and. patch%wtcol(p) > 0._r8 )then + trotr1_col(c)=trotr1_col(c)+patch%wtcol(p) + end if + if( patch%itype(p) == nbrdlf_dcd_trp_tree .and. patch%wtcol(p) > 0._r8 )then + trotr2_col(c)=trotr2_col(c)+patch%wtcol(p) + end if + + if (transient_landcover) then + if( patch%itype(p) == nbrdlf_evr_trp_tree .or. patch%itype(p) == nbrdlf_dcd_trp_tree )then + if(dwt_smoothed(p) < 0._r8)then + ! Land cover change in CLM happens all at once on the first time + ! step of the year. However, the fire code needs deforestation + ! rates throughout the year, in order to combine these + ! deforestation rates with the current season's climate. So we + ! use a smoothed version of dwt. + ! + ! This isn't ideal, because the carbon stocks that the fire code + ! is operating on will have decreased by the full annual amount + ! before the fire code does anything. But the biggest effect of + ! these deforestation fires is as a trigger for other fires, and + ! the C fluxes are merely diagnostic so don't need to be + ! conservative, so this isn't a big issue. + ! + ! (Actually, it would be even better if the fire code had a + ! realistic breakdown of annual deforestation into the + ! different seasons. But having deforestation spread evenly + ! throughout the year is much better than having it all + ! concentrated on January 1.) + dtrotr_col(c)=dtrotr_col(c)-dwt_smoothed(p) end if - rootc_col(c) = rootc_col(c) + (frootc(p) + frootc_storage(p) + & - frootc_xfer(p) + deadcrootc(p) + & - deadcrootc_storage(p) + deadcrootc_xfer(p) + & - livecrootc(p)+livecrootc_storage(p) + & - livecrootc_xfer(p))*patch%wtcol(p) - - fsr_col(c) = fsr_col(c) + fsr_pft(patch%itype(p))*patch%wtcol(p)/(1.0_r8-cropf_col(c)) - - if( lfwt(c) /= 0.0_r8 )then - hdmlf=this%forc_hdm(g) - - ! all these constants are in Li et al. BG (2012a,b;2013) - - if( hdmlf > 0.1_r8 )then - ! For NOT bare-soil - if( patch%itype(p) /= noveg )then - ! For shrub and grass (crop already excluded above) - if( patch%itype(p) >= nbrdlf_evr_shrub )then !for shurb and grass - lgdp_col(c) = lgdp_col(c) + (0.1_r8 + 0.9_r8* & - exp(-1._r8*SHR_CONST_PI* & - (gdp_lf(c)/8._r8)**0.5_r8))*patch%wtcol(p) & - /(1.0_r8 - cropf_col(c)) - lgdp1_col(c) = lgdp1_col(c) + (0.2_r8 + 0.8_r8* & - exp(-1._r8*SHR_CONST_PI* & - (gdp_lf(c)/7._r8)))*patch%wtcol(p)/lfwt(c) - lpop_col(c) = lpop_col(c) + (0.2_r8 + 0.8_r8* & - exp(-1._r8*SHR_CONST_PI* & - (hdmlf/450._r8)**0.5_r8))*patch%wtcol(p)/lfwt(c) - else ! for trees - if( gdp_lf(c) > 20._r8 )then - lgdp_col(c) =lgdp_col(c)+cnfire_const%occur_hi_gdp_tree*patch%wtcol(p)/(1.0_r8 - cropf_col(c)) - else - lgdp_col(c) = lgdp_col(c)+patch%wtcol(p)/(1.0_r8 - cropf_col(c)) - end if - if( gdp_lf(c) > 20._r8 )then - lgdp1_col(c) = lgdp1_col(c)+0.62_r8*patch%wtcol(p)/lfwt(c) - else - if( gdp_lf(c) > 8._r8 ) then - lgdp1_col(c)=lgdp1_col(c)+0.83_r8*patch%wtcol(p)/lfwt(c) - else - lgdp1_col(c)=lgdp1_col(c)+patch%wtcol(p)/lfwt(c) - end if - end if - lpop_col(c) = lpop_col(c) + (0.4_r8 + 0.6_r8* & - exp(-1._r8*SHR_CONST_PI* & - (hdmlf/125._r8)))*patch%wtcol(p)/lfwt(c) + end if + end if + rootc_col(c) = rootc_col(c) + (frootc(p) + frootc_storage(p) + & + frootc_xfer(p) + deadcrootc(p) + & + deadcrootc_storage(p) + deadcrootc_xfer(p) + & + livecrootc(p)+livecrootc_storage(p) + & + livecrootc_xfer(p))*patch%wtcol(p) + + fsr_col(c) = fsr_col(c) + fsr_pft(patch%itype(p))*patch%wtcol(p)/(1.0_r8-cropf_col(c)) + + if( lfwt(c) /= 0.0_r8 )then + hdmlf=this%forc_hdm(g) + + ! all these constants are in Li et al. BG (2012a,b;2013) + + if( hdmlf > 0.1_r8 )then + ! For NOT bare-soil + if( patch%itype(p) /= noveg )then + ! For shrub and grass (crop already excluded above) + if( patch%itype(p) >= nbrdlf_evr_shrub )then !for shurb and grass + lgdp_col(c) = lgdp_col(c) + (0.1_r8 + 0.9_r8* & + exp(-1._r8*SHR_CONST_PI* & + (gdp_lf(c)/8._r8)**0.5_r8))*patch%wtcol(p) & + /(1.0_r8 - cropf_col(c)) + lgdp1_col(c) = lgdp1_col(c) + (0.2_r8 + 0.8_r8* & + exp(-1._r8*SHR_CONST_PI* & + (gdp_lf(c)/7._r8)))*patch%wtcol(p)/lfwt(c) + lpop_col(c) = lpop_col(c) + (0.2_r8 + 0.8_r8* & + exp(-1._r8*SHR_CONST_PI* & + (hdmlf/450._r8)**0.5_r8))*patch%wtcol(p)/lfwt(c) + else ! for trees + if( gdp_lf(c) > 20._r8 )then + lgdp_col(c) =lgdp_col(c)+cnfire_const%occur_hi_gdp_tree*patch%wtcol(p)/(1.0_r8 - cropf_col(c)) + else + lgdp_col(c) = lgdp_col(c)+patch%wtcol(p)/(1.0_r8 - cropf_col(c)) + end if + if( gdp_lf(c) > 20._r8 )then + lgdp1_col(c) = lgdp1_col(c)+0.62_r8*patch%wtcol(p)/lfwt(c) + else + if( gdp_lf(c) > 8._r8 ) then + lgdp1_col(c)=lgdp1_col(c)+0.83_r8*patch%wtcol(p)/lfwt(c) + else + lgdp1_col(c)=lgdp1_col(c)+patch%wtcol(p)/lfwt(c) end if end if - else - lgdp_col(c) = lgdp_col(c)+patch%wtcol(p)/(1.0_r8 - cropf_col(c)) - lgdp1_col(c) = lgdp1_col(c)+patch%wtcol(p)/lfwt(c) - lpop_col(c) = lpop_col(c)+patch%wtcol(p)/lfwt(c) + lpop_col(c) = lpop_col(c) + (0.4_r8 + 0.6_r8* & + exp(-1._r8*SHR_CONST_PI* & + (hdmlf/125._r8)))*patch%wtcol(p)/lfwt(c) end if end if - - fd_col(c) = fd_col(c) + fd_pft(patch%itype(p)) * patch%wtcol(p) * secsphr / (1.0_r8-cropf_col(c)) + else + lgdp_col(c) = lgdp_col(c)+patch%wtcol(p)/(1.0_r8 - cropf_col(c)) + lgdp1_col(c) = lgdp1_col(c)+patch%wtcol(p)/lfwt(c) + lpop_col(c) = lpop_col(c)+patch%wtcol(p)/lfwt(c) end if end if - end do + + fd_col(c) = fd_col(c) + fd_pft(patch%itype(p)) * patch%wtcol(p) * secsphr / (1.0_r8-cropf_col(c)) + end if end do ! estimate annual decreased fractional coverage of BET+BDT @@ -483,36 +491,33 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ end if end do - do pi = 1,max_patch_per_col - do fc = 1,num_soilc - c = filter_soilc(fc) - g= col%gridcell(c) - hdmlf=this%forc_hdm(g) - if (pi <= col%npatches(c)) then - p = col%patchi(c) + pi - 1 - ! For crop - if( forc_t(c) >= SHR_CONST_TKFRZ .and. patch%itype(p) > nc4_grass .and. & - kmo == abm_lf(c) .and. forc_rain(c)+forc_snow(c) == 0._r8 .and. & - burndate(p) >= 999 .and. patch%wtcol(p) > 0._r8 )then ! catch crop burn time - - ! calculate human density impact on ag. fire - fhd = 0.04_r8+0.96_r8*exp(-1._r8*SHR_CONST_PI*(hdmlf/350._r8)**0.5_r8) - - ! calculate impact of GDP on ag. fire - fgdp = 0.01_r8+0.99_r8*exp(-1._r8*SHR_CONST_PI*(gdp_lf(c)/10._r8)) - - ! calculate burned area - fb = max(0.0_r8,min(1.0_r8,(fuelc_crop(c)-lfuel)/(ufuel-lfuel))) - - ! crop fire only for generic crop types at this time - ! managed crops are treated as grasses if crop model is turned on - baf_crop(c) = baf_crop(c) + cropfire_a1/secsphr*fb*fhd*fgdp*patch%wtcol(p) - if( fb*fhd*fgdp*patch%wtcol(p) > 0._r8)then - burndate(p)=kda - end if - end if + do fp = 1, num_soilp + p = filter_soilp(fp) + c = patch%column(p) + g = col%gridcell(c) + ! For crop + if( forc_t(c) >= SHR_CONST_TKFRZ .and. patch%itype(p) > nc4_grass .and. & + kmo == abm_lf(c) .and. forc_rain(c)+forc_snow(c) == 0._r8 .and. & + burndate(p) >= 999 .and. patch%wtcol(p) > 0._r8 )then ! catch crop burn time + + hdmlf = this%forc_hdm(g) + + ! calculate human density impact on ag. fire + fhd = 0.04_r8+0.96_r8*exp(-1._r8*SHR_CONST_PI*(hdmlf/350._r8)**0.5_r8) + + ! calculate impact of GDP on ag. fire + fgdp = 0.01_r8+0.99_r8*exp(-1._r8*SHR_CONST_PI*(gdp_lf(c)/10._r8)) + + ! calculate burned area + fb = max(0.0_r8,min(1.0_r8,(fuelc_crop(c)-lfuel)/(ufuel-lfuel))) + + ! crop fire only for generic crop types at this time + ! managed crops are treated as grasses if crop model is turned on + baf_crop(c) = baf_crop(c) + cropfire_a1/secsphr*fb*fhd*fgdp*patch%wtcol(p) + if( fb*fhd*fgdp*patch%wtcol(p) > 0._r8)then + burndate(p)=kda end if - end do + end if end do ! ! calculate peatland fire @@ -642,7 +647,6 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte ! ! !USES: use clm_time_manager , only: get_step_size_real,get_days_per_year,get_curr_date - use clm_varpar , only: max_patch_per_col use clm_varctl , only: use_cndv use clm_varcon , only: secspday use pftconMod , only: nc3crop @@ -1108,81 +1112,75 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte ! fire-induced transfer of carbon and nitrogen pools to litter and cwd do j = 1,nlevdecomp - do pi = 1,max_patch_per_col - do fc = 1,num_soilc - c = filter_soilc(fc) - if (pi <= col%npatches(c)) then - p = col%patchi(c) + pi - 1 - if ( patch%active(p) ) then - - fire_mortality_c_to_cwdc(c,j) = fire_mortality_c_to_cwdc(c,j) + & - m_deadstemc_to_litter_fire(p) * patch%wtcol(p) * stem_prof(p,j) - fire_mortality_c_to_cwdc(c,j) = fire_mortality_c_to_cwdc(c,j) + & - m_deadcrootc_to_litter_fire(p) * patch%wtcol(p) * croot_prof(p,j) - fire_mortality_n_to_cwdn(c,j) = fire_mortality_n_to_cwdn(c,j) + & - m_deadstemn_to_litter_fire(p) * patch%wtcol(p) * stem_prof(p,j) - fire_mortality_n_to_cwdn(c,j) = fire_mortality_n_to_cwdn(c,j) + & - m_deadcrootn_to_litter_fire(p) * patch%wtcol(p) * croot_prof(p,j) - - - fire_mortality_c_to_cwdc(c,j) = fire_mortality_c_to_cwdc(c,j) + & - m_livestemc_to_litter_fire(p) * patch%wtcol(p) * stem_prof(p,j) - fire_mortality_c_to_cwdc(c,j) = fire_mortality_c_to_cwdc(c,j) + & - m_livecrootc_to_litter_fire(p) * patch%wtcol(p) * croot_prof(p,j) - fire_mortality_n_to_cwdn(c,j) = fire_mortality_n_to_cwdn(c,j) + & - m_livestemn_to_litter_fire(p) * patch%wtcol(p) * stem_prof(p,j) - fire_mortality_n_to_cwdn(c,j) = fire_mortality_n_to_cwdn(c,j) + & - m_livecrootn_to_litter_fire(p) * patch%wtcol(p) * croot_prof(p,j) - - - m_c_to_litr_met_fire(c,j)=m_c_to_litr_met_fire(c,j) + & - ((m_leafc_to_litter_fire(p)*lf_flab(patch%itype(p)) & - +m_leafc_storage_to_litter_fire(p) + & - m_leafc_xfer_to_litter_fire(p) + & - m_gresp_storage_to_litter_fire(p) & - +m_gresp_xfer_to_litter_fire(p))*leaf_prof(p,j) + & - (m_frootc_to_litter_fire(p)*fr_flab(patch%itype(p)) & - +m_frootc_storage_to_litter_fire(p) + & - m_frootc_xfer_to_litter_fire(p))*froot_prof(p,j) & - +(m_livestemc_storage_to_litter_fire(p) + & - m_livestemc_xfer_to_litter_fire(p) & - +m_deadstemc_storage_to_litter_fire(p) + & - m_deadstemc_xfer_to_litter_fire(p))* stem_prof(p,j)& - +(m_livecrootc_storage_to_litter_fire(p) + & - m_livecrootc_xfer_to_litter_fire(p) & - +m_deadcrootc_storage_to_litter_fire(p) + & - m_deadcrootc_xfer_to_litter_fire(p))* croot_prof(p,j))* patch%wtcol(p) - m_c_to_litr_cel_fire(c,j)=m_c_to_litr_cel_fire(c,j) + & - (m_leafc_to_litter_fire(p)*lf_fcel(patch%itype(p))*leaf_prof(p,j) + & - m_frootc_to_litter_fire(p)*fr_fcel(patch%itype(p))*froot_prof(p,j))* patch%wtcol(p) - m_c_to_litr_lig_fire(c,j)=m_c_to_litr_lig_fire(c,j) + & - (m_leafc_to_litter_fire(p)*lf_flig(patch%itype(p))*leaf_prof(p,j) + & - m_frootc_to_litter_fire(p)*fr_flig(patch%itype(p))*froot_prof(p,j))* patch%wtcol(p) - - m_n_to_litr_met_fire(c,j)=m_n_to_litr_met_fire(c,j) + & - ((m_leafn_to_litter_fire(p)*lf_flab(patch%itype(p)) & - +m_leafn_storage_to_litter_fire(p) + & - m_leafn_xfer_to_litter_fire(p)+m_retransn_to_litter_fire(p)) & - *leaf_prof(p,j) +(m_frootn_to_litter_fire(p)*fr_flab(patch%itype(p)) & - +m_frootn_storage_to_litter_fire(p) + & - m_frootn_xfer_to_litter_fire(p))*froot_prof(p,j) & - +(m_livestemn_storage_to_litter_fire(p) + & - m_livestemn_xfer_to_litter_fire(p) & - +m_deadstemn_storage_to_litter_fire(p) + & - m_deadstemn_xfer_to_litter_fire(p))* stem_prof(p,j)& - +(m_livecrootn_storage_to_litter_fire(p) + & - m_livecrootn_xfer_to_litter_fire(p) & - +m_deadcrootn_storage_to_litter_fire(p) + & - m_deadcrootn_xfer_to_litter_fire(p))* croot_prof(p,j))* patch%wtcol(p) - m_n_to_litr_cel_fire(c,j)=m_n_to_litr_cel_fire(c,j) + & - (m_leafn_to_litter_fire(p)*lf_fcel(patch%itype(p))*leaf_prof(p,j) + & - m_frootn_to_litter_fire(p)*fr_fcel(patch%itype(p))*froot_prof(p,j))* patch%wtcol(p) - m_n_to_litr_lig_fire(c,j)=m_n_to_litr_lig_fire(c,j) + & - (m_leafn_to_litter_fire(p)*lf_flig(patch%itype(p))*leaf_prof(p,j) + & - m_frootn_to_litter_fire(p)*fr_flig(patch%itype(p))*froot_prof(p,j))* patch%wtcol(p) - end if - end if - end do + do fp = 1, num_soilp + p = filter_soilp(fp) + c = patch%column(p) + + fire_mortality_c_to_cwdc(c,j) = fire_mortality_c_to_cwdc(c,j) + & + m_deadstemc_to_litter_fire(p) * patch%wtcol(p) * stem_prof(p,j) + fire_mortality_c_to_cwdc(c,j) = fire_mortality_c_to_cwdc(c,j) + & + m_deadcrootc_to_litter_fire(p) * patch%wtcol(p) * croot_prof(p,j) + fire_mortality_n_to_cwdn(c,j) = fire_mortality_n_to_cwdn(c,j) + & + m_deadstemn_to_litter_fire(p) * patch%wtcol(p) * stem_prof(p,j) + fire_mortality_n_to_cwdn(c,j) = fire_mortality_n_to_cwdn(c,j) + & + m_deadcrootn_to_litter_fire(p) * patch%wtcol(p) * croot_prof(p,j) + + + fire_mortality_c_to_cwdc(c,j) = fire_mortality_c_to_cwdc(c,j) + & + m_livestemc_to_litter_fire(p) * patch%wtcol(p) * stem_prof(p,j) + fire_mortality_c_to_cwdc(c,j) = fire_mortality_c_to_cwdc(c,j) + & + m_livecrootc_to_litter_fire(p) * patch%wtcol(p) * croot_prof(p,j) + fire_mortality_n_to_cwdn(c,j) = fire_mortality_n_to_cwdn(c,j) + & + m_livestemn_to_litter_fire(p) * patch%wtcol(p) * stem_prof(p,j) + fire_mortality_n_to_cwdn(c,j) = fire_mortality_n_to_cwdn(c,j) + & + m_livecrootn_to_litter_fire(p) * patch%wtcol(p) * croot_prof(p,j) + + + m_c_to_litr_met_fire(c,j)=m_c_to_litr_met_fire(c,j) + & + ((m_leafc_to_litter_fire(p)*lf_flab(patch%itype(p)) & + +m_leafc_storage_to_litter_fire(p) + & + m_leafc_xfer_to_litter_fire(p) + & + m_gresp_storage_to_litter_fire(p) & + +m_gresp_xfer_to_litter_fire(p))*leaf_prof(p,j) + & + (m_frootc_to_litter_fire(p)*fr_flab(patch%itype(p)) & + +m_frootc_storage_to_litter_fire(p) + & + m_frootc_xfer_to_litter_fire(p))*froot_prof(p,j) & + +(m_livestemc_storage_to_litter_fire(p) + & + m_livestemc_xfer_to_litter_fire(p) & + +m_deadstemc_storage_to_litter_fire(p) + & + m_deadstemc_xfer_to_litter_fire(p))* stem_prof(p,j)& + +(m_livecrootc_storage_to_litter_fire(p) + & + m_livecrootc_xfer_to_litter_fire(p) & + +m_deadcrootc_storage_to_litter_fire(p) + & + m_deadcrootc_xfer_to_litter_fire(p))* croot_prof(p,j))* patch%wtcol(p) + m_c_to_litr_cel_fire(c,j)=m_c_to_litr_cel_fire(c,j) + & + (m_leafc_to_litter_fire(p)*lf_fcel(patch%itype(p))*leaf_prof(p,j) + & + m_frootc_to_litter_fire(p)*fr_fcel(patch%itype(p))*froot_prof(p,j))* patch%wtcol(p) + m_c_to_litr_lig_fire(c,j)=m_c_to_litr_lig_fire(c,j) + & + (m_leafc_to_litter_fire(p)*lf_flig(patch%itype(p))*leaf_prof(p,j) + & + m_frootc_to_litter_fire(p)*fr_flig(patch%itype(p))*froot_prof(p,j))* patch%wtcol(p) + + m_n_to_litr_met_fire(c,j)=m_n_to_litr_met_fire(c,j) + & + ((m_leafn_to_litter_fire(p)*lf_flab(patch%itype(p)) & + +m_leafn_storage_to_litter_fire(p) + & + m_leafn_xfer_to_litter_fire(p)+m_retransn_to_litter_fire(p)) & + *leaf_prof(p,j) +(m_frootn_to_litter_fire(p)*fr_flab(patch%itype(p)) & + +m_frootn_storage_to_litter_fire(p) + & + m_frootn_xfer_to_litter_fire(p))*froot_prof(p,j) & + +(m_livestemn_storage_to_litter_fire(p) + & + m_livestemn_xfer_to_litter_fire(p) & + +m_deadstemn_storage_to_litter_fire(p) + & + m_deadstemn_xfer_to_litter_fire(p))* stem_prof(p,j)& + +(m_livecrootn_storage_to_litter_fire(p) + & + m_livecrootn_xfer_to_litter_fire(p) & + +m_deadcrootn_storage_to_litter_fire(p) + & + m_deadcrootn_xfer_to_litter_fire(p))* croot_prof(p,j))* patch%wtcol(p) + m_n_to_litr_cel_fire(c,j)=m_n_to_litr_cel_fire(c,j) + & + (m_leafn_to_litter_fire(p)*lf_fcel(patch%itype(p))*leaf_prof(p,j) + & + m_frootn_to_litter_fire(p)*fr_fcel(patch%itype(p))*froot_prof(p,j))* patch%wtcol(p) + m_n_to_litr_lig_fire(c,j)=m_n_to_litr_lig_fire(c,j) + & + (m_leafn_to_litter_fire(p)*lf_flig(patch%itype(p))*leaf_prof(p,j) + & + m_frootn_to_litter_fire(p)*fr_flig(patch%itype(p))*froot_prof(p,j))* patch%wtcol(p) end do end do ! diff --git a/src/biogeochem/CNFireLi2016Mod.F90 b/src/biogeochem/CNFireLi2016Mod.F90 index 5a36e192b2..b1cdafb4ee 100644 --- a/src/biogeochem/CNFireLi2016Mod.F90 +++ b/src/biogeochem/CNFireLi2016Mod.F90 @@ -34,8 +34,11 @@ module CNFireLi2016Mod use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con use EnergyFluxType , only : energyflux_type use SaturatedExcessRunoffMod , only : saturated_excess_runoff_type - use WaterDiagnosticBulkType , only : waterdiagnosticbulk_type - use Wateratm2lndBulkType , only : wateratm2lndbulk_type + use WaterDiagnosticBulkType , only : waterdiagnosticbulk_type + use Wateratm2lndBulkType , only : wateratm2lndbulk_type + use WaterStateBulkType , only : waterstatebulk_type + use SoilStateType , only : soilstate_type + use SoilWaterRetentionCurveMod , only : soil_water_retention_curve_type use GridcellType , only : grc use ColumnType , only : col use PatchType , only : patch @@ -83,15 +86,16 @@ end function need_lightning_and_popdens !----------------------------------------------------------------------- subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & + num_exposedvegp, filter_exposedvegp, num_noexposedvegp, filter_noexposedvegp, & atm2lnd_inst, energyflux_inst, saturated_excess_runoff_inst, waterdiagnosticbulk_inst, & - wateratm2lndbulk_inst, cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) + wateratm2lndbulk_inst, waterstatebulk_inst, soilstate_inst, soil_water_retention_curve, & + cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) ! ! !DESCRIPTION: ! Computes column-level burned area ! ! !USES: use clm_time_manager , only: get_step_size_real, get_days_per_year, get_curr_date, get_nstep - use clm_varpar , only: max_patch_per_col use clm_varcon , only: secspday, secsphr use clm_varctl , only: spinup_state use pftconMod , only: nc4_grass, nc3crop, ndllf_evr_tmp_tree @@ -105,11 +109,18 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ integer , intent(in) :: filter_soilc(:) ! filter for soil columns integer , intent(in) :: num_soilp ! number of soil patches in filter integer , intent(in) :: filter_soilp(:) ! filter for soil patches + integer , intent(in) :: num_exposedvegp ! number of points in filter_exposedvegp + integer , intent(in) :: filter_exposedvegp(:) ! patch filter for non-snow-covered veg + integer , intent(in) :: num_noexposedvegp ! number of points in filter_noexposedvegp + integer , intent(in) :: filter_noexposedvegp(:) ! patch filter where frac_veg_nosno is 0 type(atm2lnd_type) , intent(in) :: atm2lnd_inst type(energyflux_type) , intent(in) :: energyflux_inst type(saturated_excess_runoff_type) , intent(in) :: saturated_excess_runoff_inst - type(waterdiagnosticbulk_type) , intent(in) :: waterdiagnosticbulk_inst - type(wateratm2lndbulk_type) , intent(in) :: wateratm2lndbulk_inst + type(waterdiagnosticbulk_type) , intent(in) :: waterdiagnosticbulk_inst + type(wateratm2lndbulk_type) , intent(in) :: wateratm2lndbulk_inst + type(waterstatebulk_type) , intent(in) :: waterstatebulk_inst + type(soilstate_type) , intent(in) :: soilstate_inst + class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve type(cnveg_state_type) , intent(inout) :: cnveg_state_inst type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst real(r8) , intent(in) :: totlitc_col(bounds%begc:) @@ -170,7 +181,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ fsr_pft => pftcon%fsr_pft , & ! Input: fd_pft => pftcon%fd_pft , & ! Input: - btran2 => energyflux_inst%btran2_patch , & ! Input: [real(r8) (:) ] root zone soil wetness + btran2 => this%cnfire_base_type%btran2_patch , & ! Input: [real(r8) (:) ] root zone soil wetness fsat => saturated_excess_runoff_inst%fsat_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface wf2 => waterdiagnosticbulk_inst%wf2_col , & ! Input: [real(r8) (:) ] soil water as frac. of whc for top 0.17 m @@ -284,21 +295,17 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ cropf_col(c) = 0._r8 lfwt(c) = 0._r8 end do - do pi = 1,max_patch_per_col - do fc = 1,num_soilc - c = filter_soilc(fc) - if (pi <= col%npatches(c)) then - p = col%patchi(c) + pi - 1 - ! For crop veg types - if( patch%itype(p) > nc4_grass )then - cropf_col(c) = cropf_col(c) + patch%wtcol(p) - end if - ! For natural vegetation (non-crop and non-bare-soil) - if( patch%itype(p) >= ndllf_evr_tmp_tree .and. patch%itype(p) <= nc4_grass )then - lfwt(c) = lfwt(c) + patch%wtcol(p) - end if - end if - end do + do fp = 1, num_soilp + p = filter_soilp(fp) + c = patch%column(p) + ! For crop veg types + if( patch%itype(p) > nc4_grass )then + cropf_col(c) = cropf_col(c) + patch%wtcol(p) + end if + ! For natural vegetation (non-crop and non-bare-soil) + if( patch%itype(p) >= ndllf_evr_tmp_tree .and. patch%itype(p) <= nc4_grass )then + lfwt(c) = lfwt(c) + patch%wtcol(p) + end if end do ! ! Calculate crop fuel @@ -307,22 +314,18 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ c = filter_soilc(fc) fuelc_crop(c)=0._r8 end do - do pi = 1,max_patch_per_col - do fc = 1,num_soilc - c = filter_soilc(fc) - if (pi <= col%npatches(c)) then - p = col%patchi(c) + pi - 1 - ! For crop PFTs, fuel load includes leaf and litter; only - ! column-level litter carbon - ! is available, so we use leaf carbon to estimate the - ! litter carbon for crop PFTs - if( patch%itype(p) > nc4_grass .and. patch%wtcol(p) > 0._r8 .and. leafc_col(c) > 0._r8 )then - fuelc_crop(c)=fuelc_crop(c) + (leafc(p) + leafc_storage(p) + & - leafc_xfer(p))*patch%wtcol(p)/cropf_col(c) + & - totlitc(c)*leafc(p)/leafc_col(c)*patch%wtcol(p)/cropf_col(c) - end if - end if - end do + do fp = 1, num_soilp + p = filter_soilp(fp) + c = patch%column(p) + ! For crop PFTs, fuel load includes leaf and litter; only + ! column-level litter carbon + ! is available, so we use leaf carbon to estimate the + ! litter carbon for crop PFTs + if( patch%itype(p) > nc4_grass .and. patch%wtcol(p) > 0._r8 .and. leafc_col(c) > 0._r8 )then + fuelc_crop(c)=fuelc_crop(c) + (leafc(p) + leafc_storage(p) + & + leafc_xfer(p))*patch%wtcol(p)/cropf_col(c) + & + totlitc(c)*leafc(p)/leafc_col(c)*patch%wtcol(p)/cropf_col(c) + end if end do ! ! Calculate noncrop column variables @@ -343,136 +346,141 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ dtrotr_col(c)=0._r8 end if end do - do pi = 1,max_patch_per_col - do fc = 1,num_soilc - c = filter_soilc(fc) - g = col%gridcell(c) - if (pi <= col%npatches(c)) then - p = col%patchi(c) + pi - 1 - - ! For non-crop -- natural vegetation and bare-soil - if( patch%itype(p) < nc3crop .and. cropf_col(c) < 1.0_r8 )then - if( .not. shr_infnan_isnan(btran2(p))) then - if (btran2(p) <= 1._r8 ) then - btran_col(c) = btran_col(c)+btran2(p)*patch%wtcol(p) - wtlf(c) = wtlf(c)+patch%wtcol(p) - end if - end if - ! NOTE(wjs, 2016-12-15) These calculations of the fraction of evergreen - ! and deciduous tropical trees (used to determine if a column is - ! tropical closed forest) use the current fractions. However, I think - ! they are used in code that applies to land cover change. Note that - ! land cover change is currently generated on the first time step of the - ! year (even though the fire code sees the annually-smoothed dwt). Thus, - ! I think that, for this to be totally consistent, this code should - ! consider the fractional coverage of each PFT prior to the relevant - ! land cover change event. (These fractions could be computed in the - ! code that handles land cover change, so that the fire code remains - ! agnostic to exactly how and when land cover change happens.) - ! - ! For example, if a year started with fractional coverages of - ! nbrdlf_evr_trp_tree = 0.35 and nbrdlf_dcd_trp_tree = 0.35, but then - ! the start-of-year land cover change reduced both of these to 0.2: The - ! current code would consider the column to NOT be tropical closed - ! forest (because nbrdlf_evr_trp_tree+nbrdlf_dcd_trp_tree < 0.6), - ! whereas in fact the land cover change occurred when the column *was* - ! tropical closed forest. - if( patch%itype(p) == nbrdlf_evr_trp_tree .and. patch%wtcol(p) > 0._r8 )then - trotr1_col(c)=trotr1_col(c)+patch%wtcol(p) - end if - if( patch%itype(p) == nbrdlf_dcd_trp_tree .and. patch%wtcol(p) > 0._r8 )then - trotr2_col(c)=trotr2_col(c)+patch%wtcol(p) + ! This subroutine calculates btran2 + call this%CNFire_calc_fire_root_wetness_Li2014(bounds, & + num_exposedvegp, filter_exposedvegp, num_noexposedvegp, filter_noexposedvegp, & + waterstatebulk_inst, soilstate_inst, soil_water_retention_curve) + do fp = 1, num_exposedvegp + p = filter_exposedvegp(fp) + c = patch%column(p) + ! For non-crop -- natural vegetation and bare-soil + if( patch%itype(p) < nc3crop .and. cropf_col(c) < 1.0_r8 )then + btran_col(c) = btran_col(c)+btran2(p)*patch%wtcol(p) + wtlf(c) = wtlf(c)+patch%wtcol(p) + end if + end do + + do fp = 1, num_soilp + p = filter_soilp(fp) + c = patch%column(p) + g = col%gridcell(c) + + ! For non-crop -- natural vegetation and bare-soil + if( patch%itype(p) < nc3crop .and. cropf_col(c) < 1.0_r8 )then + + ! NOTE(wjs, 2016-12-15) These calculations of the fraction of evergreen + ! and deciduous tropical trees (used to determine if a column is + ! tropical closed forest) use the current fractions. However, I think + ! they are used in code that applies to land cover change. Note that + ! land cover change is currently generated on the first time step of the + ! year (even though the fire code sees the annually-smoothed dwt). Thus, + ! I think that, for this to be totally consistent, this code should + ! consider the fractional coverage of each PFT prior to the relevant + ! land cover change event. (These fractions could be computed in the + ! code that handles land cover change, so that the fire code remains + ! agnostic to exactly how and when land cover change happens.) + ! + ! For example, if a year started with fractional coverages of + ! nbrdlf_evr_trp_tree = 0.35 and nbrdlf_dcd_trp_tree = 0.35, but then + ! the start-of-year land cover change reduced both of these to 0.2: The + ! current code would consider the column to NOT be tropical closed + ! forest (because nbrdlf_evr_trp_tree+nbrdlf_dcd_trp_tree < 0.6), + ! whereas in fact the land cover change occurred when the column *was* + ! tropical closed forest. + if( patch%itype(p) == nbrdlf_evr_trp_tree .and. patch%wtcol(p) > 0._r8 )then + trotr1_col(c)=trotr1_col(c)+patch%wtcol(p) + end if + if( patch%itype(p) == nbrdlf_dcd_trp_tree .and. patch%wtcol(p) > 0._r8 )then + trotr2_col(c)=trotr2_col(c)+patch%wtcol(p) + end if + + if (transient_landcover) then + if( patch%itype(p) == nbrdlf_evr_trp_tree .or. patch%itype(p) == nbrdlf_dcd_trp_tree )then + if(dwt_smoothed(p) < 0._r8)then + ! Land cover change in CLM happens all at once on the first time + ! step of the year. However, the fire code needs deforestation + ! rates throughout the year, in order to combine these + ! deforestation rates with the current season's climate. So we + ! use a smoothed version of dwt. + ! + ! This isn't ideal, because the carbon stocks that the fire code + ! is operating on will have decreased by the full annual amount + ! before the fire code does anything. But the biggest effect of + ! these deforestation fires is as a trigger for other fires, and + ! the C fluxes are merely diagnostic so don't need to be + ! conservative, so this isn't a big issue. + ! + ! (Actually, it would be even better if the fire code had a + ! realistic breakdown of annual deforestation into the + ! different seasons. But having deforestation spread evenly + ! throughout the year is much better than having it all + ! concentrated on January 1.) + dtrotr_col(c)=dtrotr_col(c)-dwt_smoothed(p) end if + end if + end if + if (spinup_state == 2) then + rootc_col(c) = rootc_col(c) + (frootc(p) + frootc_storage(p) + & + frootc_xfer(p) + deadcrootc(p) * 10._r8 + & + deadcrootc_storage(p) + deadcrootc_xfer(p) + & + livecrootc(p)+livecrootc_storage(p) + & + livecrootc_xfer(p))*patch%wtcol(p) + else + rootc_col(c) = rootc_col(c) + (frootc(p) + frootc_storage(p) + & + frootc_xfer(p) + deadcrootc(p) + & + deadcrootc_storage(p) + deadcrootc_xfer(p) + & + livecrootc(p)+livecrootc_storage(p) + & + livecrootc_xfer(p))*patch%wtcol(p) + endif + + fsr_col(c) = fsr_col(c) + fsr_pft(patch%itype(p))*patch%wtcol(p)/(1.0_r8-cropf_col(c)) + + hdmlf=this%forc_hdm(g) - if (transient_landcover) then - if( patch%itype(p) == nbrdlf_evr_trp_tree .or. patch%itype(p) == nbrdlf_dcd_trp_tree )then - if(dwt_smoothed(p) < 0._r8)then - ! Land cover change in CLM happens all at once on the first time - ! step of the year. However, the fire code needs deforestation - ! rates throughout the year, in order to combine these - ! deforestation rates with the current season's climate. So we - ! use a smoothed version of dwt. - ! - ! This isn't ideal, because the carbon stocks that the fire code - ! is operating on will have decreased by the full annual amount - ! before the fire code does anything. But the biggest effect of - ! these deforestation fires is as a trigger for other fires, and - ! the C fluxes are merely diagnostic so don't need to be - ! conservative, so this isn't a big issue. - ! - ! (Actually, it would be even better if the fire code had a - ! realistic breakdown of annual deforestation into the - ! different seasons. But having deforestation spread evenly - ! throughout the year is much better than having it all - ! concentrated on January 1.) - dtrotr_col(c)=dtrotr_col(c)-dwt_smoothed(p) + ! all these constants are in Li et al. BG (2012a,b;2013) + + if( hdmlf > 0.1_r8 )then + ! For NOT bare-soil + if( patch%itype(p) /= noveg )then + ! For shrub and grass (crop already excluded above) + if( patch%itype(p) >= nbrdlf_evr_shrub )then !for shurb and grass + lgdp_col(c) = lgdp_col(c) + (0.1_r8 + 0.9_r8* & + exp(-1._r8*SHR_CONST_PI* & + (gdp_lf(c)/8._r8)**0.5_r8))*patch%wtcol(p) & + /(1.0_r8 - cropf_col(c)) + lgdp1_col(c) = lgdp1_col(c) + (0.2_r8 + 0.8_r8* & + exp(-1._r8*SHR_CONST_PI* & + (gdp_lf(c)/7._r8)))*patch%wtcol(p)/(1._r8 - cropf_col(c)) + lpop_col(c) = lpop_col(c) + (0.2_r8 + 0.8_r8* & + exp(-1._r8*SHR_CONST_PI* & + (hdmlf/450._r8)**0.5_r8))*patch%wtcol(p)/(1._r8 - cropf_col(c)) + else ! for trees + if( gdp_lf(c) > 20._r8 )then + lgdp_col(c) =lgdp_col(c)+cnfire_const%occur_hi_gdp_tree*patch%wtcol(p)/(1._r8 - cropf_col(c)) + lgdp1_col(c) =lgdp1_col(c)+0.62_r8*patch%wtcol(p)/(1._r8 - cropf_col(c)) + else + if( gdp_lf(c) > 8._r8 )then + lgdp_col(c)=lgdp_col(c)+0.79_r8*patch%wtcol(p)/(1._r8 - cropf_col(c)) + lgdp1_col(c)=lgdp1_col(c)+0.83_r8*patch%wtcol(p)/(1._r8 - cropf_col(c)) + else + lgdp_col(c) = lgdp_col(c)+patch%wtcol(p)/(1._r8 - cropf_col(c)) + lgdp1_col(c)=lgdp1_col(c)+patch%wtcol(p)/(1._r8 - cropf_col(c)) end if end if + lpop_col(c) = lpop_col(c) + (0.4_r8 + 0.6_r8* & + exp(-1._r8*SHR_CONST_PI* & + (hdmlf/125._r8)))*patch%wtcol(p)/(1._r8 -cropf_col(c)) end if - if (spinup_state == 2) then - rootc_col(c) = rootc_col(c) + (frootc(p) + frootc_storage(p) + & - frootc_xfer(p) + deadcrootc(p) * 10._r8 + & - deadcrootc_storage(p) + deadcrootc_xfer(p) + & - livecrootc(p)+livecrootc_storage(p) + & - livecrootc_xfer(p))*patch%wtcol(p) - else - rootc_col(c) = rootc_col(c) + (frootc(p) + frootc_storage(p) + & - frootc_xfer(p) + deadcrootc(p) + & - deadcrootc_storage(p) + deadcrootc_xfer(p) + & - livecrootc(p)+livecrootc_storage(p) + & - livecrootc_xfer(p))*patch%wtcol(p) - endif - - fsr_col(c) = fsr_col(c) + fsr_pft(patch%itype(p))*patch%wtcol(p)/(1.0_r8-cropf_col(c)) - - hdmlf=this%forc_hdm(g) - - ! all these constants are in Li et al. BG (2012a,b;2013) - - if( hdmlf > 0.1_r8 )then - ! For NOT bare-soil - if( patch%itype(p) /= noveg )then - ! For shrub and grass (crop already excluded above) - if( patch%itype(p) >= nbrdlf_evr_shrub )then !for shurb and grass - lgdp_col(c) = lgdp_col(c) + (0.1_r8 + 0.9_r8* & - exp(-1._r8*SHR_CONST_PI* & - (gdp_lf(c)/8._r8)**0.5_r8))*patch%wtcol(p) & - /(1.0_r8 - cropf_col(c)) - lgdp1_col(c) = lgdp1_col(c) + (0.2_r8 + 0.8_r8* & - exp(-1._r8*SHR_CONST_PI* & - (gdp_lf(c)/7._r8)))*patch%wtcol(p)/(1._r8 - cropf_col(c)) - lpop_col(c) = lpop_col(c) + (0.2_r8 + 0.8_r8* & - exp(-1._r8*SHR_CONST_PI* & - (hdmlf/450._r8)**0.5_r8))*patch%wtcol(p)/(1._r8 - cropf_col(c)) - else ! for trees - if( gdp_lf(c) > 20._r8 )then - lgdp_col(c) =lgdp_col(c)+cnfire_const%occur_hi_gdp_tree*patch%wtcol(p)/(1._r8 - cropf_col(c)) - lgdp1_col(c) =lgdp1_col(c)+0.62_r8*patch%wtcol(p)/(1._r8 - cropf_col(c)) - else - if( gdp_lf(c) > 8._r8 )then - lgdp_col(c)=lgdp_col(c)+0.79_r8*patch%wtcol(p)/(1._r8 - cropf_col(c)) - lgdp1_col(c)=lgdp1_col(c)+0.83_r8*patch%wtcol(p)/(1._r8 - cropf_col(c)) - else - lgdp_col(c) = lgdp_col(c)+patch%wtcol(p)/(1._r8 - cropf_col(c)) - lgdp1_col(c)=lgdp1_col(c)+patch%wtcol(p)/(1._r8 - cropf_col(c)) - end if - end if - lpop_col(c) = lpop_col(c) + (0.4_r8 + 0.6_r8* & - exp(-1._r8*SHR_CONST_PI* & - (hdmlf/125._r8)))*patch%wtcol(p)/(1._r8 -cropf_col(c)) - end if - end if - else - lgdp_col(c) = lgdp_col(c)+patch%wtcol(p)/(1.0_r8 - cropf_col(c)) - lgdp1_col(c) = lgdp1_col(c)+patch%wtcol(p)/(1.0_r8 -cropf_col(c)) - lpop_col(c) = lpop_col(c)+patch%wtcol(p)/(1.0_r8 -cropf_col(c)) - end if - - fd_col(c) = fd_col(c) + fd_pft(patch%itype(p)) * patch%wtcol(p) * secsphr / (1.0_r8-cropf_col(c)) end if + else + lgdp_col(c) = lgdp_col(c)+patch%wtcol(p)/(1.0_r8 - cropf_col(c)) + lgdp1_col(c) = lgdp1_col(c)+patch%wtcol(p)/(1.0_r8 -cropf_col(c)) + lpop_col(c) = lpop_col(c)+patch%wtcol(p)/(1.0_r8 -cropf_col(c)) end if - end do + + fd_col(c) = fd_col(c) + fd_pft(patch%itype(p)) * patch%wtcol(p) * secsphr / (1.0_r8-cropf_col(c)) + end if end do ! estimate annual decreased fractional coverage of BET+BDT @@ -508,36 +516,34 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ end if end do - do pi = 1,max_patch_per_col - do fc = 1,num_soilc - c = filter_soilc(fc) - g= col%gridcell(c) - hdmlf=this%forc_hdm(g) - if (pi <= col%npatches(c)) then - p = col%patchi(c) + pi - 1 - ! For crop - if( forc_t(c) >= SHR_CONST_TKFRZ .and. patch%itype(p) > nc4_grass .and. & - kmo == abm_lf(c) .and. & - burndate(p) >= 999 .and. patch%wtcol(p) > 0._r8 )then ! catch crop burn time - - ! calculate human density impact on ag. fire - fhd = 0.04_r8+0.96_r8*exp(-1._r8*SHR_CONST_PI*(hdmlf/350._r8)**0.5_r8) - - ! calculate impact of GDP on ag. fire - fgdp = 0.01_r8+0.99_r8*exp(-1._r8*SHR_CONST_PI*(gdp_lf(c)/10._r8)) - - ! calculate burned area - fb = max(0.0_r8,min(1.0_r8,(fuelc_crop(c)-lfuel)/(ufuel-lfuel))) - - ! crop fire only for generic crop types at this time - ! managed crops are treated as grasses if crop model is turned on - baf_crop(c) = baf_crop(c) + cropfire_a1/secsphr*fhd*fgdp*patch%wtcol(p) - if( fb*fhd*fgdp*patch%wtcol(p) > 0._r8)then - burndate(p)=kda - end if - end if + do fp = 1, num_soilp + p = filter_soilp(fp) + c = patch%column(p) + g = col%gridcell(c) + + ! For crop + if( forc_t(c) >= SHR_CONST_TKFRZ .and. patch%itype(p) > nc4_grass .and. & + kmo == abm_lf(c) .and. & + burndate(p) >= 999 .and. patch%wtcol(p) > 0._r8 )then ! catch crop burn time + + hdmlf = this%forc_hdm(g) + + ! calculate human density impact on ag. fire + fhd = 0.04_r8+0.96_r8*exp(-1._r8*SHR_CONST_PI*(hdmlf/350._r8)**0.5_r8) + + ! calculate impact of GDP on ag. fire + fgdp = 0.01_r8+0.99_r8*exp(-1._r8*SHR_CONST_PI*(gdp_lf(c)/10._r8)) + + ! calculate burned area + fb = max(0.0_r8,min(1.0_r8,(fuelc_crop(c)-lfuel)/(ufuel-lfuel))) + + ! crop fire only for generic crop types at this time + ! managed crops are treated as grasses if crop model is turned on + baf_crop(c) = baf_crop(c) + cropfire_a1/secsphr*fhd*fgdp*patch%wtcol(p) + if( fb*fhd*fgdp*patch%wtcol(p) > 0._r8)then + burndate(p)=kda end if - end do + end if end do ! ! calculate peatland fire diff --git a/src/biogeochem/CNFireLi2021Mod.F90 b/src/biogeochem/CNFireLi2021Mod.F90 new file mode 100644 index 0000000000..77b0693fca --- /dev/null +++ b/src/biogeochem/CNFireLi2021Mod.F90 @@ -0,0 +1,666 @@ +module CNFireLi2021Mod + +#include "shr_assert.h" + + !----------------------------------------------------------------------- + ! !DESCRIPTION: + ! module for fire dynamics + ! created in Nov, 2012 and revised in Apr, 2013 by F. Li and S. Levis + ! based on Li et al. (2012a,b; 2013) + ! revised in Apr, 2014 according to Li et al.(2014) + ! revised in May, 2015, according to Li et al. (2015, in prep.) + ! Fire-related parameters were calibrated or tuned in May, 2015 based on the + ! 20th Century transient simulations at f19_g16 with a CLM4.5 version + ! (clm50fire), CRUNCEPv5, and climatological lightning data. + ! + ! !USES: + use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_CL + use shr_const_mod , only : SHR_CONST_PI,SHR_CONST_TKFRZ + use shr_infnan_mod , only : shr_infnan_isnan + use clm_varctl , only : iulog + use clm_varpar , only : nlevdecomp, ndecomp_pools, nlevdecomp_full, nlevgrnd + use clm_varcon , only : dzsoi_decomp + use pftconMod , only : noveg, pftcon + use abortutils , only : endrun + use decompMod , only : bounds_type + use subgridAveMod , only : p2c + use atm2lndType , only : atm2lnd_type + use CNDVType , only : dgvs_type + use CNVegStateType , only : cnveg_state_type + use CNVegCarbonStateType , only : cnveg_carbonstate_type + use CNVegCarbonFluxType , only : cnveg_carbonflux_type + use CNVegNitrogenStateType , only : cnveg_nitrogenstate_type + use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type + use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con + use EnergyFluxType , only : energyflux_type + use SaturatedExcessRunoffMod , only : saturated_excess_runoff_type + use WaterDiagnosticBulkType , only : waterdiagnosticbulk_type + use Wateratm2lndBulkType , only : wateratm2lndbulk_type + use WaterStateBulkType , only : waterstatebulk_type + use SoilStateType , only : soilstate_type + use SoilWaterRetentionCurveMod , only : soil_water_retention_curve_type + use GridcellType , only : grc + use ColumnType , only : col + use PatchType , only : patch + use SoilBiogeochemStateType , only : get_spinup_latitude_term + use FireMethodType , only : fire_method_type + use CNFireBaseMod , only : cnfire_base_type, cnfire_const, cnfire_params + ! + implicit none + private + ! + ! !PUBLIC TYPES: + public :: cnfire_li2021_type + ! + type, extends(cnfire_base_type) :: cnfire_li2021_type + private + contains + ! + ! !PUBLIC MEMBER FUNCTIONS: + procedure, public :: need_lightning_and_popdens + procedure, public :: CNFireArea ! Calculate fire area + end type cnfire_li2021_type + + ! + ! !PRIVATE MEMBER DATA: + !----------------------------------------------------------------------- + + character(len=*), parameter, private :: sourcefile = & + __FILE__ + +contains + + !----------------------------------------------------------------------- + function need_lightning_and_popdens(this) + ! !ARGUMENTS: + class(cnfire_li2021_type), intent(in) :: this + logical :: need_lightning_and_popdens ! function result + ! + ! !LOCAL VARIABLES: + + character(len=*), parameter :: subname = 'need_lightning_and_popdens' + !----------------------------------------------------------------------- + + need_lightning_and_popdens = .true. + end function need_lightning_and_popdens + + !----------------------------------------------------------------------- + subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & + num_exposedvegp, filter_exposedvegp, num_noexposedvegp, filter_noexposedvegp, & + atm2lnd_inst, energyflux_inst, saturated_excess_runoff_inst, waterdiagnosticbulk_inst, & + wateratm2lndbulk_inst, waterstatebulk_inst, soilstate_inst, soil_water_retention_curve, & + cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) + ! + ! !DESCRIPTION: + ! Computes column-level burned area + ! + ! !USES: + use clm_time_manager , only: get_step_size_real, get_days_per_year, get_curr_date, get_nstep + use clm_varcon , only: secspday, secsphr + use clm_varctl , only: spinup_state + use pftconMod , only: nc4_grass, nc3crop, ndllf_evr_tmp_tree + use pftconMod , only: nbrdlf_evr_trp_tree, nbrdlf_dcd_trp_tree, nbrdlf_evr_shrub + use dynSubgridControlMod , only : run_has_transient_landcover + ! + ! !ARGUMENTS: + class(cnfire_li2021_type) :: this + type(bounds_type) , intent(in) :: bounds + integer , intent(in) :: num_soilc ! number of soil columns in filter + integer , intent(in) :: filter_soilc(:) ! filter for soil columns + integer , intent(in) :: num_soilp ! number of soil patches in filter + integer , intent(in) :: filter_soilp(:) ! filter for soil patches + integer , intent(in) :: num_exposedvegp ! number of points in filter_exposedvegp + integer , intent(in) :: filter_exposedvegp(:) ! patch filter for non-snow-covered veg + integer , intent(in) :: num_noexposedvegp ! number of points in filter_noexposedvegp + integer , intent(in) :: filter_noexposedvegp(:) ! patch filter where frac_veg_nosno is 0 + type(atm2lnd_type) , intent(in) :: atm2lnd_inst + type(energyflux_type) , intent(in) :: energyflux_inst + type(saturated_excess_runoff_type) , intent(in) :: saturated_excess_runoff_inst + type(waterdiagnosticbulk_type) , intent(in) :: waterdiagnosticbulk_inst + type(wateratm2lndbulk_type) , intent(in) :: wateratm2lndbulk_inst + type(waterstatebulk_type) , intent(in) :: waterstatebulk_inst + type(soilstate_type) , intent(in) :: soilstate_inst + class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve + type(cnveg_state_type) , intent(inout) :: cnveg_state_inst + type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst + real(r8) , intent(in) :: totlitc_col(bounds%begc:) + real(r8) , intent(in) :: decomp_cpools_vr_col(bounds%begc:,1:,1:) + real(r8) , intent(in) :: t_soi17cm_col(bounds%begc:) + ! + ! !LOCAL VARIABLES: + ! + integer :: g,l,c,p,pi,j,fc,fp,kyr, kmo, kda, mcsec ! index variables + real(r8) :: dt ! time step variable (s) + real(r8) :: dayspyr ! days per year + real(r8) :: cli ! effect of climate on deforestation fires (0-1) + real(r8) :: cri ! thresholds used for cli, (mm/d), see Eq.(7) in Li et al.(2013) + real(r8) :: fb ! availability of fuel for regs A and C + real(r8) :: fhd ! impact of hd on agricultural fire + real(r8) :: fgdp ! impact of gdp on agricultural fire + real(r8) :: fire_m ! combustability of fuel for fire occurrence + real(r8) :: spread_m ! combustability of fuel for fire spread + real(r8) :: Lb_lf ! length-to-breadth ratio added by Lifang + integer :: i_cwd ! cwd pool + real(r8) :: lh ! anthro. ignitions (count/km2/hr) + real(r8) :: fs ! hd-dependent fires suppression (0-1) + real(r8) :: ig ! total ignitions (count/km2/hr) + real(r8) :: hdmlf ! human density + real(r8) :: arh, arh30 !combustability of fuel related to RH and RH30 + real(r8) :: afuel !weight for arh and arh30 + real(r8) :: btran_col(bounds%begc:bounds%endc) + logical :: transient_landcover ! whether this run has any prescribed transient landcover + real(r8), target :: prec60_col_target(bounds%begc:bounds%endc) + real(r8), target :: prec10_col_target(bounds%begc:bounds%endc) + real(r8), target :: rh30_col_target(bounds%begc:bounds%endc) + real(r8), pointer :: prec60_col(:) + real(r8), pointer :: prec10_col(:) + real(r8), pointer :: rh30_col(:) + !----------------------------------------------------------------------- + + SHR_ASSERT_ALL_FL((ubound(totlitc_col) == (/bounds%endc/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(decomp_cpools_vr_col) == (/bounds%endc,nlevdecomp_full,ndecomp_pools/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(t_soi17cm_col) == (/bounds%endc/)), sourcefile, __LINE__) + + associate( & + totlitc => totlitc_col , & ! Input: [real(r8) (:) ] (gC/m2) total lit C (column-level mean) + decomp_cpools_vr => decomp_cpools_vr_col , & ! Input: [real(r8) (:,:,:) ] (gC/m3) VR decomp. (litter, cwd, soil) + tsoi17 => t_soi17cm_col , & ! Input: [real(r8) (:) ] (K) soil T for top 0.17 m + + lfuel => cnfire_const%lfuel , & ! Input: [real(r8) ] (gC/m2) Lower threshold of fuel mass + ufuel => cnfire_const%ufuel , & ! Input: [real(r8) ] (gC/m2) Upper threshold of fuel mass + rh_hgh => cnfire_const%rh_hgh , & ! Input: [real(r8) ] (%) High relative humidity + rh_low => cnfire_const%rh_low , & ! Input: [real(r8) ] (%) Low relative humidity + cli_scale => cnfire_const%cli_scale , & ! Input: [real(r8) ] (/d) global constant for deforestation fires + cropfire_a1 => cnfire_const%cropfire_a1 , & ! Input: [real(r8) ] (/hr) a1 parameter for cropland fire + non_boreal_peatfire_c => cnfire_const%non_boreal_peatfire_c , & ! Input: [real(r8) ] (/hr) c parameter for non-boreal peatland fire + pot_hmn_ign_counts_alpha => cnfire_const%pot_hmn_ign_counts_alpha , & ! Input: [real(r8) ] (/person/month) Potential human ignition counts + boreal_peatfire_c => cnfire_const%boreal_peatfire_c , & ! Input: [real(r8) ] (/hr) c parameter for boreal peatland fire + + fsr_pft => pftcon%fsr_pft , & ! Input: + fd_pft => pftcon%fd_pft , & ! Input: + rswf_min => pftcon%rswf_min , & ! Input: + rswf_max => pftcon%rswf_max , & ! Input: + btran2 => this%cnfire_base_type%btran2_patch , & ! Input: [real(r8) (:) ] root zone soil wetness + fsat => saturated_excess_runoff_inst%fsat_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface + wf2 => waterdiagnosticbulk_inst%wf2_col , & ! Input: [real(r8) (:) ] soil water as frac. of whc for top 0.17 m + + is_cwd => decomp_cascade_con%is_cwd , & ! Input: [logical (:) ] TRUE => pool is a cwd pool + spinup_factor => decomp_cascade_con%spinup_factor , & ! Input: [real(r8) (:) ] factor for AD spinup associated with each pool + + forc_rh => wateratm2lndbulk_inst%forc_rh_grc , & ! Input: [real(r8) (:) ] relative humidity + forc_wind => atm2lnd_inst%forc_wind_grc , & ! Input: [real(r8) (:) ] atmospheric wind speed (m/s) + forc_t => atm2lnd_inst%forc_t_downscaled_col , & ! Input: [real(r8) (:) ] downscaled atmospheric temperature (Kelvin) + forc_rain => wateratm2lndbulk_inst%forc_rain_downscaled_col , & ! Input: [real(r8) (:) ] downscaled rain + forc_snow => wateratm2lndbulk_inst%forc_snow_downscaled_col , & ! Input: [real(r8) (:) ] downscaled snow + prec60 => wateratm2lndbulk_inst%prec60_patch , & ! Input: [real(r8) (:) ] 60-day running mean of tot. precipitation + prec10 => wateratm2lndbulk_inst%prec10_patch , & ! Input: [real(r8) (:) ] 10-day running mean of tot. precipitation + rh30 => wateratm2lndbulk_inst%rh30_patch , & ! Input: [real(r8) (:) ] 10-day running mean of tot. precipitation + dwt_smoothed => cnveg_state_inst%dwt_smoothed_patch , & ! Input: [real(r8) (:) ] change in patch weight (-1 to 1) on the gridcell, smoothed over the year + cropf_col => cnveg_state_inst%cropf_col , & ! Input: [real(r8) (:) ] cropland fraction in veg column + gdp_lf => cnveg_state_inst%gdp_lf_col , & ! Input: [real(r8) (:) ] gdp data + peatf_lf => cnveg_state_inst%peatf_lf_col , & ! Input: [real(r8) (:) ] peatland fraction data + abm_lf => cnveg_state_inst%abm_lf_col , & ! Input: [integer (:) ] prescribed crop fire time + baf_crop => cnveg_state_inst%baf_crop_col , & ! Output: [real(r8) (:) ] burned area fraction for cropland (/sec) + baf_peatf => cnveg_state_inst%baf_peatf_col , & ! Output: [real(r8) (:) ] burned area fraction for peatland (/sec) + burndate => cnveg_state_inst%burndate_patch , & ! Output: [integer (:) ] burn date for crop + fbac => cnveg_state_inst%fbac_col , & ! Output: [real(r8) (:) ] total burned area out of conversion (/sec) + fbac1 => cnveg_state_inst%fbac1_col , & ! Output: [real(r8) (:) ] burned area out of conversion region due to land use fire + farea_burned => cnveg_state_inst%farea_burned_col , & ! Output: [real(r8) (:) ] total fractional area burned (/sec) + nfire => cnveg_state_inst%nfire_col , & ! Output: [real(r8) (:) ] fire counts (count/km2/sec), valid only in Reg. C + fsr_col => cnveg_state_inst%fsr_col , & ! Output: [real(r8) (:) ] fire spread rate at column level + fd_col => cnveg_state_inst%fd_col , & ! Output: [real(r8) (:) ] fire duration rate at column level + lgdp_col => cnveg_state_inst%lgdp_col , & ! Output: [real(r8) (:) ] gdp limitation factor for nfire + lgdp1_col => cnveg_state_inst%lgdp1_col , & ! Output: [real(r8) (:) ] gdp limitation factor for baf per fire + lpop_col => cnveg_state_inst%lpop_col , & ! Output: [real(r8) (:) ] pop limitation factor for baf per fire + lfwt => cnveg_state_inst%lfwt_col , & ! Output: [real(r8) (:) ] fractional coverage of non-crop and non-bare-soil Patches + trotr1_col => cnveg_state_inst%trotr1_col , & ! Output: [real(r8) (:) ] patch weight of BET on the column (0-1) + trotr2_col => cnveg_state_inst%trotr2_col , & ! Output: [real(r8) (:) ] patch weight of BDT on the column (0-1) + dtrotr_col => cnveg_state_inst%dtrotr_col , & ! Output: [real(r8) (:) ] decreased frac. coverage of BET+BDT on grid for dt + lfc => cnveg_state_inst%lfc_col , & ! Output: [real(r8) (:) ] conversion area frac. of BET+BDT that haven't burned before + wtlf => cnveg_state_inst%wtlf_col , & ! Output: [real(r8) (:) ] fractional coverage of non-crop Patches + + totvegc => cnveg_carbonstate_inst%totvegc_col , & ! Input: [real(r8) (:) ] totvegc at column level + deadcrootc => cnveg_carbonstate_inst%deadcrootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C + deadcrootc_storage => cnveg_carbonstate_inst%deadcrootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C storage + deadcrootc_xfer => cnveg_carbonstate_inst%deadcrootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C transfer + deadstemc => cnveg_carbonstate_inst%deadstemc_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead stem root C + frootc => cnveg_carbonstate_inst%frootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C + frootc_storage => cnveg_carbonstate_inst%frootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C storage + frootc_xfer => cnveg_carbonstate_inst%frootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C transfer + livecrootc => cnveg_carbonstate_inst%livecrootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C + livecrootc_storage => cnveg_carbonstate_inst%livecrootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C storage + livecrootc_xfer => cnveg_carbonstate_inst%livecrootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C transfer + leafc => cnveg_carbonstate_inst%leafc_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C + leafc_storage => cnveg_carbonstate_inst%leafc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C storage + leafc_xfer => cnveg_carbonstate_inst%leafc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C transfer + rootc_col => cnveg_carbonstate_inst%rootc_col , & ! Output: [real(r8) (:) ] root carbon + leafc_col => cnveg_carbonstate_inst%leafc_col , & ! Output: [real(r8) (:) ] leaf carbon at column level + deadstemc_col => cnveg_carbonstate_inst%deadstemc_col , & ! Output: [real(r8) (:) ] deadstem carbon at column level + fuelc => cnveg_carbonstate_inst%fuelc_col , & ! Output: [real(r8) (:) ] fuel load coutside cropland + fuelc_crop => cnveg_carbonstate_inst%fuelc_crop_col & ! Output: [real(r8) (:) ] fuel load for cropland + ) + + transient_landcover = run_has_transient_landcover() + + !pft to column average + prec10_col =>prec10_col_target + call p2c(bounds, num_soilc, filter_soilc, & + prec10(bounds%begp:bounds%endp), & + prec10_col(bounds%begc:bounds%endc)) + + prec60_col =>prec60_col_target + call p2c(bounds, num_soilc, filter_soilc, & + prec60(bounds%begp:bounds%endp), & + prec60_col(bounds%begc:bounds%endc)) + + rh30_col =>rh30_col_target + call p2c(bounds, num_soilc, filter_soilc, & + rh30(bounds%begp:bounds%endp), & + rh30_col(bounds%begc:bounds%endc)) + + call p2c(bounds, num_soilc, filter_soilc, & + leafc(bounds%begp:bounds%endp), & + leafc_col(bounds%begc:bounds%endc)) + + call p2c(bounds, num_soilc, filter_soilc, & + deadstemc(bounds%begp:bounds%endp), & + deadstemc_col(bounds%begc:bounds%endc)) + + call get_curr_date (kyr, kmo, kda, mcsec) + dayspyr = get_days_per_year() + ! Get model step size + dt = get_step_size_real() + ! + ! On first time-step, just set area burned to zero and exit + ! + if ( get_nstep() == 0 )then + do fc = 1,num_soilc + c = filter_soilc(fc) + farea_burned(c) = 0._r8 + baf_crop(c) = 0._r8 + baf_peatf(c) = 0._r8 + fbac(c) = 0._r8 + fbac1(c) = 0._r8 + cropf_col(c) = 0._r8 + end do + return + end if + ! + ! Calculate fraction of crop (cropf_col) and non-crop and non-bare-soil + ! vegetation (lfwt) in vegetated column + ! + do fc = 1,num_soilc + c = filter_soilc(fc) + cropf_col(c) = 0._r8 + lfwt(c) = 0._r8 + end do + do fp = 1, num_soilp + p = filter_soilp(fp) + c = patch%column(p) + ! For crop veg types + if( patch%itype(p) > nc4_grass )then + cropf_col(c) = cropf_col(c) + patch%wtcol(p) + end if + ! For natural vegetation (non-crop and non-bare-soil) + if( patch%itype(p) >= ndllf_evr_tmp_tree .and. patch%itype(p) <= nc4_grass )then + lfwt(c) = lfwt(c) + patch%wtcol(p) + end if + end do + ! + ! Calculate crop fuel + ! + do fc = 1,num_soilc + c = filter_soilc(fc) + fuelc_crop(c)=0._r8 + end do + do fp = 1, num_soilp + p = filter_soilp(fp) + c = patch%column(p) + ! For crop PFTs, fuel load includes leaf and litter; only + ! column-level litter carbon + ! is available, so we use leaf carbon to estimate the + ! litter carbon for crop PFTs + if( patch%itype(p) > nc4_grass .and. patch%wtcol(p) > 0._r8 .and. leafc_col(c) > 0._r8 )then + fuelc_crop(c)=fuelc_crop(c) + (leafc(p) + leafc_storage(p) + & + leafc_xfer(p))*patch%wtcol(p)/cropf_col(c) + & + totlitc(c)*leafc(p)/leafc_col(c)*patch%wtcol(p)/cropf_col(c) + end if + end do + ! + ! Calculate noncrop column variables + ! + do fc = 1,num_soilc + c = filter_soilc(fc) + fsr_col(c) = 0._r8 + fd_col(c) = 0._r8 + rootc_col(c) = 0._r8 + lgdp_col(c) = 0._r8 + lgdp1_col(c) = 0._r8 + lpop_col(c) = 0._r8 + btran_col(c) = 0._r8 + wtlf(c) = 0._r8 + trotr1_col(c)= 0._r8 + trotr2_col(c)= 0._r8 + if (transient_landcover) then + dtrotr_col(c)=0._r8 + end if + end do + + ! This subroutine calculates btran2 + call this%CNFire_calc_fire_root_wetness_Li2021(bounds, & + num_exposedvegp, filter_exposedvegp, num_noexposedvegp, filter_noexposedvegp, & + waterstatebulk_inst, soilstate_inst, soil_water_retention_curve) + do fp = 1, num_exposedvegp + p = filter_exposedvegp(fp) + c = patch%column(p) + ! For non-crop -- natural vegetation and bare-soil + if( patch%itype(p) < nc3crop .and. cropf_col(c) < 1.0_r8 )then + btran_col(c) = btran_col(c)+max(0._r8, min(1._r8, & + (btran2(p)-rswf_min(patch%itype(p)))/(rswf_max(patch%itype(p)) & + -rswf_min(patch%itype(p)))))*patch%wtcol(p) + wtlf(c) = wtlf(c)+patch%wtcol(p) + end if + end do + + do fp = 1, num_soilp + p = filter_soilp(fp) + c = patch%column(p) + g = col%gridcell(c) + + ! For non-crop -- natural vegetation and bare-soil + if( patch%itype(p) < nc3crop .and. cropf_col(c) < 1.0_r8 )then + + ! NOTE(wjs, 2016-12-15) These calculations of the fraction of evergreen + ! and deciduous tropical trees (used to determine if a column is + ! tropical closed forest) use the current fractions. However, I think + ! they are used in code that applies to land cover change. Note that + ! land cover change is currently generated on the first time step of the + ! year (even though the fire code sees the annually-smoothed dwt). Thus, + ! I think that, for this to be totally consistent, this code should + ! consider the fractional coverage of each PFT prior to the relevant + ! land cover change event. (These fractions could be computed in the + ! code that handles land cover change, so that the fire code remains + ! agnostic to exactly how and when land cover change happens.) + ! + ! For example, if a year started with fractional coverages of + ! nbrdlf_evr_trp_tree = 0.35 and nbrdlf_dcd_trp_tree = 0.35, but then + ! the start-of-year land cover change reduced both of these to 0.2: The + ! current code would consider the column to NOT be tropical closed + ! forest (because nbrdlf_evr_trp_tree+nbrdlf_dcd_trp_tree < 0.6), + ! whereas in fact the land cover change occurred when the column *was* + ! tropical closed forest. + if( patch%itype(p) == nbrdlf_evr_trp_tree .and. patch%wtcol(p) > 0._r8 )then + trotr1_col(c)=trotr1_col(c)+patch%wtcol(p) + end if + if( patch%itype(p) == nbrdlf_dcd_trp_tree .and. patch%wtcol(p) > 0._r8 )then + trotr2_col(c)=trotr2_col(c)+patch%wtcol(p) + end if + + if (transient_landcover) then + if( patch%itype(p) == nbrdlf_evr_trp_tree .or. patch%itype(p) == nbrdlf_dcd_trp_tree )then + if(dwt_smoothed(p) < 0._r8)then + ! Land cover change in CLM happens all at once on the first time + ! step of the year. However, the fire code needs deforestation + ! rates throughout the year, in order to combine these + ! deforestation rates with the current season's climate. So we + ! use a smoothed version of dwt. + ! + ! This isn't ideal, because the carbon stocks that the fire code + ! is operating on will have decreased by the full annual amount + ! before the fire code does anything. But the biggest effect of + ! these deforestation fires is as a trigger for other fires, and + ! the C fluxes are merely diagnostic so don't need to be + ! conservative, so this isn't a big issue. + ! + ! (Actually, it would be even better if the fire code had a + ! realistic breakdown of annual deforestation into the + ! different seasons. But having deforestation spread evenly + ! throughout the year is much better than having it all + ! concentrated on January 1.) + dtrotr_col(c)=dtrotr_col(c)-dwt_smoothed(p) + end if + end if + end if + if (spinup_state == 2) then + rootc_col(c) = rootc_col(c) + (frootc(p) + frootc_storage(p) + & + frootc_xfer(p) + deadcrootc(p) * 10._r8 + & + deadcrootc_storage(p) + deadcrootc_xfer(p) + & + livecrootc(p)+livecrootc_storage(p) + & + livecrootc_xfer(p))*patch%wtcol(p) + else + rootc_col(c) = rootc_col(c) + (frootc(p) + frootc_storage(p) + & + frootc_xfer(p) + deadcrootc(p) + & + deadcrootc_storage(p) + deadcrootc_xfer(p) + & + livecrootc(p)+livecrootc_storage(p) + & + livecrootc_xfer(p))*patch%wtcol(p) + endif + + fsr_col(c) = fsr_col(c) + fsr_pft(patch%itype(p))*patch%wtcol(p)/(1.0_r8-cropf_col(c)) + + hdmlf=this%forc_hdm(g) + + ! all these constants are in Li et al. BG (2012a,b;2013) + + if( hdmlf > 0.1_r8 )then + ! For NOT bare-soil + if( patch%itype(p) /= noveg )then + ! For shrub and grass (crop already excluded above) + if( patch%itype(p) >= nbrdlf_evr_shrub )then !for shurb and grass + lgdp_col(c) = lgdp_col(c) + (0.1_r8 + 0.9_r8* & + exp(-1._r8*SHR_CONST_PI* & + (gdp_lf(c)/8._r8)**0.5_r8))*patch%wtcol(p) & + /(1.0_r8 - cropf_col(c)) + lgdp1_col(c) = lgdp1_col(c) + (0.2_r8 + 0.8_r8* & + exp(-1._r8*SHR_CONST_PI* & + (gdp_lf(c)/7._r8)))*patch%wtcol(p)/(1._r8 - cropf_col(c)) + lpop_col(c) = lpop_col(c) + (0.2_r8 + 0.8_r8* & + exp(-1._r8*SHR_CONST_PI* & + (hdmlf/450._r8)**0.5_r8))*patch%wtcol(p)/(1._r8 - cropf_col(c)) + else ! for trees + if( gdp_lf(c) > 20._r8 )then + lgdp_col(c) =lgdp_col(c)+cnfire_const%occur_hi_gdp_tree*patch%wtcol(p)/(1._r8 - cropf_col(c)) + lgdp1_col(c) =lgdp1_col(c)+0.62_r8*patch%wtcol(p)/(1._r8 - cropf_col(c)) + else + if( gdp_lf(c) > 8._r8 )then + lgdp_col(c)=lgdp_col(c)+0.79_r8*patch%wtcol(p)/(1._r8 - cropf_col(c)) + lgdp1_col(c)=lgdp1_col(c)+0.83_r8*patch%wtcol(p)/(1._r8 - cropf_col(c)) + else + lgdp_col(c) = lgdp_col(c)+patch%wtcol(p)/(1._r8 - cropf_col(c)) + lgdp1_col(c)=lgdp1_col(c)+patch%wtcol(p)/(1._r8 - cropf_col(c)) + end if + end if + lpop_col(c) = lpop_col(c) + (0.4_r8 + 0.6_r8* & + exp(-1._r8*SHR_CONST_PI* & + (hdmlf/125._r8)))*patch%wtcol(p)/(1._r8 -cropf_col(c)) + end if + end if + else + lgdp_col(c) = lgdp_col(c)+patch%wtcol(p)/(1.0_r8 - cropf_col(c)) + lgdp1_col(c) = lgdp1_col(c)+patch%wtcol(p)/(1.0_r8 -cropf_col(c)) + lpop_col(c) = lpop_col(c)+patch%wtcol(p)/(1.0_r8 -cropf_col(c)) + end if + + fd_col(c) = fd_col(c) + fd_pft(patch%itype(p)) * patch%wtcol(p) * secsphr / (1.0_r8-cropf_col(c)) + end if + end do + + ! estimate annual decreased fractional coverage of BET+BDT + ! land cover conversion in CLM4.5 is the same for each timestep except for the beginning + + if (transient_landcover) then + do fc = 1,num_soilc + c = filter_soilc(fc) + if( dtrotr_col(c) > 0._r8 )then + if( kmo == 1 .and. kda == 1 .and. mcsec == 0)then + lfc(c) = 0._r8 + end if + if( kmo == 1 .and. kda == 1 .and. mcsec == dt)then + lfc(c) = dtrotr_col(c)*dayspyr*secspday/dt + end if + else + lfc(c)=0._r8 + end if + end do + end if + ! + ! calculate burned area fraction in cropland + ! + do fc = 1,num_soilc + c = filter_soilc(fc) + baf_crop(c)=0._r8 + end do + + do fp = 1,num_soilp + p = filter_soilp(fp) + if( kmo == 1 .and. kda == 1 .and. mcsec == 0 )then + burndate(p) = 10000 ! init. value; actual range [0 365] + end if + end do + + do fp = 1, num_soilp + p = filter_soilp(fp) + c = patch%column(p) + g = col%gridcell(c) + + ! For crop + if( forc_t(c) >= SHR_CONST_TKFRZ .and. patch%itype(p) > nc4_grass .and. & + kmo == abm_lf(c) .and. & + burndate(p) >= 999 .and. patch%wtcol(p) > 0._r8 )then ! catch crop burn time + + hdmlf = this%forc_hdm(g) + + ! calculate human density impact on ag. fire + fhd = 0.04_r8+0.96_r8*exp(-1._r8*SHR_CONST_PI*(hdmlf/350._r8)**0.5_r8) + + ! calculate impact of GDP on ag. fire + fgdp = 0.01_r8+0.99_r8*exp(-1._r8*SHR_CONST_PI*(gdp_lf(c)/10._r8)) + + ! calculate burned area + fb = max(0.0_r8,min(1.0_r8,(fuelc_crop(c)-lfuel)/(ufuel-lfuel))) + + ! crop fire only for generic crop types at this time + ! managed crops are treated as grasses if crop model is turned on + baf_crop(c) = baf_crop(c) + cropfire_a1/secsphr*fhd*fgdp*patch%wtcol(p) + if( fb*fhd*fgdp*patch%wtcol(p) > 0._r8)then + burndate(p)=kda + end if + end if + end do + ! + ! calculate peatland fire + ! + do fc = 1, num_soilc + c = filter_soilc(fc) + g= col%gridcell(c) + if(grc%latdeg(g) < cnfire_const%borealat )then + baf_peatf(c) = non_boreal_peatfire_c/secsphr*max(0._r8, & + min(1._r8,(4.0_r8-prec60_col(c)*secspday)/ & + 4.0_r8))**2*peatf_lf(c)*(1._r8-fsat(c)) + else + baf_peatf(c) = boreal_peatfire_c/secsphr*exp(-SHR_CONST_PI*(max(wf2(c),0._r8)/0.3_r8))* & + max(0._r8,min(1._r8,(tsoi17(c)-SHR_CONST_TKFRZ)/10._r8))*peatf_lf(c)* & + (1._r8-fsat(c)) + end if + end do + ! + ! calculate other fires + ! + + ! Set the number of timesteps for e-folding. + ! When the simulation has run fewer than this number of steps, + ! re-scale the e-folding time to get a stable early estimate. + + ! find which pool is the cwd pool + i_cwd = 0 + do l = 1, ndecomp_pools + if ( is_cwd(l) ) then + i_cwd = l + endif + end do + + ! + ! begin column loop to calculate fractional area affected by fire + ! + do fc = 1, num_soilc + c = filter_soilc(fc) + g = col%gridcell(c) + hdmlf=this%forc_hdm(g) + nfire(c) = 0._r8 + if( cropf_col(c) < 1._r8 )then + fuelc(c) = totlitc(c)+totvegc(c)-rootc_col(c)-fuelc_crop(c)*cropf_col(c) + if (spinup_state == 2) then + fuelc(c) = fuelc(c) + ((10._r8 - 1._r8)*deadstemc_col(c)) + do j = 1, nlevdecomp + fuelc(c) = fuelc(c)+decomp_cpools_vr(c,j,i_cwd) * dzsoi_decomp(j) * spinup_factor(i_cwd) & + * get_spinup_latitude_term(grc%latdeg(col%gridcell(c))) + end do + else + do j = 1, nlevdecomp + fuelc(c) = fuelc(c)+decomp_cpools_vr(c,j,i_cwd) * dzsoi_decomp(j) + end do + end if + fuelc(c) = fuelc(c)/(1._r8-cropf_col(c)) + fb = max(0.0_r8,min(1.0_r8,(fuelc(c)-lfuel)/(ufuel-lfuel))) + if (trotr1_col(c)+trotr2_col(c)<=0.6_r8) then + afuel =min(1._r8,max(0._r8,(fuelc(c)-2500._r8)/(5000._r8-2500._r8))) + arh=1._r8-max(0._r8, min(1._r8,(forc_rh(g)-rh_low)/(rh_hgh-rh_low))) + arh30=1._r8-max(0.7_r8, min(1._r8,rh30_col(c)/90._r8)) + if (forc_rh(g) < rh_hgh.and. wtlf(c) > 0._r8 .and. tsoi17(c)> SHR_CONST_TKFRZ)then + fire_m = ((afuel*arh30+(1._r8-afuel)*arh)**1.5_r8) & + *((1._r8-btran_col(c)/wtlf(c))**0.5_r8) + else + fire_m = 0._r8 + end if + lh = pot_hmn_ign_counts_alpha*6.8_r8*hdmlf**(0.43_r8)/30._r8/24._r8 + fs = 1._r8-(0.01_r8+0.98_r8*exp(-0.025_r8*hdmlf)) + ig = (lh+this%forc_lnfm(g)/(5.16_r8+2.16_r8* & + cos(SHR_CONST_PI/180._r8*3*min(60._r8,abs(grc%latdeg(g)))))*0.22_r8) & + *(1._r8-fs)*(1._r8-cropf_col(c)) + nfire(c) = ig/secsphr*fb*fire_m*lgdp_col(c) !fire counts/km2/sec + Lb_lf = 1._r8+10._r8*(1._r8-EXP(-0.06_r8*forc_wind(g))) + spread_m = fire_m**0.5_r8 + farea_burned(c) = min(1._r8,(cnfire_const%g0*spread_m*fsr_col(c)* & + fd_col(c)/1000._r8)**2*lgdp1_col(c)* & + lpop_col(c)*nfire(c)*SHR_CONST_PI*Lb_lf+ & + baf_crop(c)+baf_peatf(c)) ! fraction (0-1) per sec + else + farea_burned(c)=min(1._r8,baf_crop(c)+baf_peatf(c)) + end if + ! + ! if landuse change data is used, calculate deforestation fires and + ! add it in the total of burned area fraction + ! + if (transient_landcover) then + if( trotr1_col(c)+trotr2_col(c) > 0.6_r8 )then + if(( kmo == 1 .and. kda == 1 .and. mcsec == 0) .or. & + dtrotr_col(c) <=0._r8 )then + fbac1(c) = 0._r8 + farea_burned(c) = baf_crop(c)+baf_peatf(c) + else + cri = (4.0_r8*trotr1_col(c)+1.8_r8*trotr2_col(c))/(trotr1_col(c)+trotr2_col(c)) + cli = (max(0._r8,min(1._r8,(cri-prec60_col(c)*secspday)/cri))**0.5)* & + (max(0._r8,min(1._r8,(cri-prec10_col(c)*secspday)/cri))**0.5)* & + (15._r8*min(0.0016_r8,dtrotr_col(c)/dt*dayspyr*secspday)+0.009_r8)* & + max(0._r8,min(1._r8,(0.25_r8-(forc_rain(c)+forc_snow(c))*secsphr)/0.25_r8)) + farea_burned(c) = fb*cli*(cli_scale/secspday)+baf_crop(c)+baf_peatf(c) + ! burned area out of conversion region due to land use fire + fbac1(c) = max(0._r8,fb*cli*(cli_scale/secspday) - 2.0_r8*lfc(c)/dt) + end if + ! total burned area out of conversion + fbac(c) = fbac1(c)+baf_crop(c)+baf_peatf(c) + else + fbac(c) = farea_burned(c) + end if + end if + + else + farea_burned(c) = min(1._r8,baf_crop(c)+baf_peatf(c)) + end if + + end do ! end of column loop + + end associate + + end subroutine CNFireArea + +end module CNFireLi2021Mod diff --git a/src/biogeochem/CNFireNoFireMod.F90 b/src/biogeochem/CNFireNoFireMod.F90 index 025d45cbd8..0dc1ee39d1 100644 --- a/src/biogeochem/CNFireNoFireMod.F90 +++ b/src/biogeochem/CNFireNoFireMod.F90 @@ -17,8 +17,11 @@ module CNFireNoFireMod use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type use EnergyFluxType , only : energyflux_type use SaturatedExcessRunoffMod , only : saturated_excess_runoff_type - use WaterDiagnosticBulkType , only : waterdiagnosticbulk_type - use Wateratm2lndBulkType , only : wateratm2lndbulk_type + use WaterDiagnosticBulkType , only : waterdiagnosticbulk_type + use Wateratm2lndBulkType , only : wateratm2lndbulk_type + use WaterStateBulkType , only : waterstatebulk_type + use SoilStateType , only : soilstate_type + use SoilWaterRetentionCurveMod , only : soil_water_retention_curve_type use FireMethodType , only : fire_method_type use CNFireBaseMod , only : cnfire_base_type ! @@ -55,8 +58,10 @@ end function need_lightning_and_popdens !----------------------------------------------------------------------- subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & + num_exposedvegp, filter_exposedvegp, num_noexposedvegp, filter_noexposedvegp, & atm2lnd_inst, energyflux_inst, saturated_excess_runoff_inst, & waterdiagnosticbulk_inst, wateratm2lndbulk_inst, & + waterstatebulk_inst, soilstate_inst, soil_water_retention_curve, & cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) ! ! !DESCRIPTION: @@ -72,11 +77,18 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ integer , intent(in) :: filter_soilc(:) ! filter for soil columns integer , intent(in) :: num_soilp ! number of soil patches in filter integer , intent(in) :: filter_soilp(:) ! filter for soil patches + integer , intent(in) :: num_exposedvegp ! number of points in filter_exposedvegp + integer , intent(in) :: filter_exposedvegp(:) ! patch filter for non-snow-covered veg + integer , intent(in) :: num_noexposedvegp ! number of points in filter_noexposedvegp + integer , intent(in) :: filter_noexposedvegp(:) ! patch filter where frac_veg_nosno is 0 type(atm2lnd_type) , intent(in) :: atm2lnd_inst type(energyflux_type) , intent(in) :: energyflux_inst type(saturated_excess_runoff_type) , intent(in) :: saturated_excess_runoff_inst - type(waterdiagnosticbulk_type) , intent(in) :: waterdiagnosticbulk_inst - type(wateratm2lndbulk_type) , intent(in) :: wateratm2lndbulk_inst + type(waterdiagnosticbulk_type) , intent(in) :: waterdiagnosticbulk_inst + type(wateratm2lndbulk_type) , intent(in) :: wateratm2lndbulk_inst + type(waterstatebulk_type) , intent(in) :: waterstatebulk_inst + type(soilstate_type) , intent(in) :: soilstate_inst + class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve type(cnveg_state_type) , intent(inout) :: cnveg_state_inst type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst real(r8) , intent(in) :: totlitc_col(bounds%begc:) diff --git a/src/biogeochem/CNPhenologyMod.F90 b/src/biogeochem/CNPhenologyMod.F90 index eba25818c5..28c0ff99ec 100644 --- a/src/biogeochem/CNPhenologyMod.F90 +++ b/src/biogeochem/CNPhenologyMod.F90 @@ -772,7 +772,7 @@ subroutine CNSeasonDecidPhenology (num_soilp, filter_soilp , & ! if this is the end of the offset_period, reset phenology ! flags and indices - if (offset_counter(p) == 0.0_r8) then + if (offset_counter(p) < dt/2._r8) then ! this code block was originally handled by call cn_offset_cleanup(p) ! inlined during vectorization @@ -797,7 +797,7 @@ subroutine CNSeasonDecidPhenology (num_soilp, filter_soilp , & ! if this is the end of the onset period, reset phenology ! flags and indices - if (onset_counter(p) == 0.0_r8) then + if (onset_counter(p) < dt/2._r8) then ! this code block was originally handled by call cn_onset_cleanup(p) ! inlined during vectorization @@ -1092,7 +1092,7 @@ subroutine CNStressDecidPhenology (num_soilp, filter_soilp , & ! if this is the end of the offset_period, reset phenology ! flags and indices - if (offset_counter(p) == 0._r8) then + if (offset_counter(p) < dt/2._r8) then ! this code block was originally handled by call cn_offset_cleanup(p) ! inlined during vectorization offset_flag(p) = 0._r8 @@ -1113,7 +1113,7 @@ subroutine CNStressDecidPhenology (num_soilp, filter_soilp , & ! if this is the end of the onset period, reset phenology ! flags and indices - if (onset_counter(p) == 0.0_r8) then + if (onset_counter(p) < dt/2._r8) then ! this code block was originally handled by call cn_onset_cleanup(p) ! inlined during vectorization onset_flag(p) = 0._r8 @@ -2282,7 +2282,7 @@ subroutine CNOnsetGrowth (num_soilp, filter_soilp, & ! The transfer rate is a linearly decreasing function of time, ! going to zero on the last timestep of the onset period - if (onset_counter(p) == dt) then + if (abs(onset_counter(p) - dt) <= dt/2._r8) then t1 = 1.0_r8 / dt else t1 = 2.0_r8 / (onset_counter(p)) @@ -2427,7 +2427,7 @@ subroutine CNOffsetLitterfall (num_soilp, filter_soilp, & ! only calculate fluxes during offset period if (offset_flag(p) == 1._r8) then - if (offset_counter(p) == dt) then + if (abs(offset_counter(p) - dt) <= dt/2._r8) then t1 = 1.0_r8 / dt frootc_to_litter(p) = t1 * frootc(p) + cpool_to_frootc(p) diff --git a/src/biogeochem/CNVegStructUpdateMod.F90 b/src/biogeochem/CNVegStructUpdateMod.F90 index 6f5b19476e..22bbea8614 100644 --- a/src/biogeochem/CNVegStructUpdateMod.F90 +++ b/src/biogeochem/CNVegStructUpdateMod.F90 @@ -74,8 +74,10 @@ subroutine CNVegStructUpdate(num_soilp, filter_soilp, & real(r8) :: tsai_min ! PATCH derived minimum tsai real(r8) :: tsai_alpha ! monthly decay rate of tsai real(r8) :: dt ! radiation time step (sec) + real(r8) :: frac_sno_adjusted ! frac_sno adjusted per frac_sno_threshold real(r8), parameter :: dtsmonth = 2592000._r8 ! number of seconds in a 30 day month (60x60x24x30) + real(r8), parameter :: frac_sno_threshold = 0.999_r8 ! frac_sno values greater than this are treated as 1 !----------------------------------------------------------------------- ! tsai formula from Zeng et. al. 2002, Journal of Climate, p1835 ! @@ -106,7 +108,8 @@ subroutine CNVegStructUpdate(num_soilp, filter_soilp, & nind => dgvs_inst%nind_patch , & ! Input: [real(r8) (:) ] number of individuals (#/m**2) fpcgrid => dgvs_inst%fpcgrid_patch , & ! Input: [real(r8) (:) ] fractional area of patch (pft area/nat veg area) - snow_depth => waterdiagnosticbulk_inst%snow_depth_col , & ! Input: [real(r8) (:) ] snow height (m) + frac_sno => waterdiagnosticbulk_inst%frac_sno_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1) + snow_depth => waterdiagnosticbulk_inst%snow_depth_col , & ! Input: [real(r8) (:) ] snow height (m) forc_hgt_u_patch => frictionvel_inst%forc_hgt_u_patch , & ! Input: [real(r8) (:) ] observational height of wind at patch-level [m] @@ -282,18 +285,29 @@ subroutine CNVegStructUpdate(num_soilp, filter_soilp, & end if ! adjust lai and sai for burying by snow. - ! snow burial fraction for short vegetation (e.g. grasses) as in - ! Wang and Zeng, 2007. + ! snow burial fraction for short vegetation (e.g. grasses, crops) changes with vegetation height + ! accounts for a 20% bending factor, as used in Lombardozzi et al. (2018) GRL 45(18), 9889-9897 + + ! NOTE: The following snow burial code is duplicated in SatellitePhenologyMod. + ! Changes in one place should be accompanied by similar changes in the other. + if (ivt(p) > noveg .and. ivt(p) <= nbrdlf_dcd_brl_shrub ) then ol = min( max(snow_depth(c)-hbot(p), 0._r8), htop(p)-hbot(p)) fb = 1._r8 - ol / max(1.e-06_r8, htop(p)-hbot(p)) else - fb = 1._r8 - max(min(snow_depth(c),0.2_r8),0._r8)/0.2_r8 ! 0.2m is assumed + fb = 1._r8 - (max(min(snow_depth(c),max(0.05,htop(p)*0.8_r8)),0._r8)/(max(0.05,htop(p)*0.8_r8))) !depth of snow required for complete burial of grasses endif - elai(p) = max(tlai(p)*fb, 0.0_r8) - esai(p) = max(tsai(p)*fb, 0.0_r8) + if (frac_sno(c) <= frac_sno_threshold) then + frac_sno_adjusted = frac_sno(c) + else + ! avoid tiny but non-zero elai and esai that can cause radiation and/or photosynthesis code to blow up + frac_sno_adjusted = 1._r8 + end if + + elai(p) = max(tlai(p)*(1.0_r8 - frac_sno_adjusted) + tlai(p)*fb*frac_sno_adjusted, 0.0_r8) + esai(p) = max(tsai(p)*(1.0_r8 - frac_sno_adjusted) + tsai(p)*fb*frac_sno_adjusted, 0.0_r8) ! Fraction of vegetation free of snow if ((elai(p) + esai(p)) > 0._r8) then diff --git a/src/biogeochem/CNVegetationFacade.F90 b/src/biogeochem/CNVegetationFacade.F90 index 341c376972..44e904bf2c 100644 --- a/src/biogeochem/CNVegetationFacade.F90 +++ b/src/biogeochem/CNVegetationFacade.F90 @@ -94,6 +94,7 @@ module CNVegetationFacade use dynCNDVMod , only : dynCNDV_init, dynCNDV_interp use CNPrecisionControlMod , only: CNPrecisionControl use SoilBiogeochemPrecisionControlMod , only: SoilBiogeochemPrecisionControl + use SoilWaterRetentionCurveMod , only : soil_water_retention_curve_type ! implicit none private @@ -873,6 +874,8 @@ subroutine EcosystemDynamicsPreDrainage(this, bounds, & num_soilc, filter_soilc, & num_soilp, filter_soilp, & num_pcropp, filter_pcropp, & + num_exposedvegp, filter_exposedvegp, & + num_noexposedvegp, filter_noexposedvegp, & doalb, & soilbiogeochem_carbonflux_inst, soilbiogeochem_carbonstate_inst, & c13_soilbiogeochem_carbonflux_inst, c13_soilbiogeochem_carbonstate_inst, & @@ -881,7 +884,8 @@ subroutine EcosystemDynamicsPreDrainage(this, bounds, & soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst, & active_layer_inst, & atm2lnd_inst, waterstatebulk_inst, waterdiagnosticbulk_inst, waterfluxbulk_inst, & - wateratm2lndbulk_inst, canopystate_inst, soilstate_inst, temperature_inst, crop_inst, ch4_inst, & + wateratm2lndbulk_inst, canopystate_inst, soilstate_inst, temperature_inst, & + soil_water_retention_curve, crop_inst, ch4_inst, & photosyns_inst, saturated_excess_runoff_inst, energyflux_inst, & nutrient_competition_method, fireemis_inst) ! @@ -902,6 +906,10 @@ subroutine EcosystemDynamicsPreDrainage(this, bounds, & integer , intent(in) :: filter_soilp(:) ! filter for soil patches integer , intent(in) :: num_pcropp ! number of prog. crop patches in filter integer , intent(in) :: filter_pcropp(:) ! filter for prognostic crop patches + integer , intent(in) :: num_exposedvegp ! number of points in filter_exposedvegp + integer , intent(in) :: filter_exposedvegp(:) ! patch filter for non-snow-covered veg + integer , intent(in) :: num_noexposedvegp ! number of points in filter_noexposedvegp + integer , intent(in) :: filter_noexposedvegp(:) ! patch filter where frac_veg_nosno is 0 logical , intent(in) :: doalb ! true = surface albedo calculation time step type(soilbiogeochem_state_type) , intent(inout) :: soilbiogeochem_state_inst type(soilbiogeochem_carbonflux_type) , intent(inout) :: soilbiogeochem_carbonflux_inst @@ -921,6 +929,7 @@ subroutine EcosystemDynamicsPreDrainage(this, bounds, & type(canopystate_type) , intent(inout) :: canopystate_inst type(soilstate_type) , intent(inout) :: soilstate_inst type(temperature_type) , intent(inout) :: temperature_inst + class(soil_water_retention_curve_type) , intent(in) :: soil_water_retention_curve type(crop_type) , intent(inout) :: crop_inst type(ch4_type) , intent(in) :: ch4_inst type(photosyns_type) , intent(in) :: photosyns_inst @@ -939,7 +948,10 @@ subroutine EcosystemDynamicsPreDrainage(this, bounds, & call CNDriverNoLeaching(bounds, & num_soilc, filter_soilc, & num_soilp, filter_soilp, & - num_pcropp, filter_pcropp, doalb, & + num_pcropp, filter_pcropp, & + num_exposedvegp, filter_exposedvegp, & + num_noexposedvegp, filter_noexposedvegp, & + doalb, & this%cnveg_state_inst, & this%cnveg_carbonflux_inst, this%cnveg_carbonstate_inst, & this%c13_cnveg_carbonflux_inst, this%c13_cnveg_carbonstate_inst, & @@ -954,7 +966,8 @@ subroutine EcosystemDynamicsPreDrainage(this, bounds, & soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst, & active_layer_inst, & atm2lnd_inst, waterstatebulk_inst, waterdiagnosticbulk_inst, waterfluxbulk_inst, & - wateratm2lndbulk_inst, canopystate_inst, soilstate_inst, temperature_inst, crop_inst, ch4_inst, & + wateratm2lndbulk_inst, canopystate_inst, soilstate_inst, temperature_inst, & + soil_water_retention_curve, crop_inst, ch4_inst, & this%dgvs_inst, photosyns_inst, saturated_excess_runoff_inst, energyflux_inst, & nutrient_competition_method, this%cnfire_method, this%dribble_crophrv_xsmrpool_2atm) diff --git a/src/biogeochem/FATESFireBase.F90 b/src/biogeochem/FATESFireBase.F90 index fc3f2bd4c5..457e577a7b 100644 --- a/src/biogeochem/FATESFireBase.F90 +++ b/src/biogeochem/FATESFireBase.F90 @@ -5,8 +5,13 @@ module FATESFireBase ! Abstract base class for FATES fire data object ! ! !USES: - use CNFireBaseMod , only: cnfire_base_type - ! + use CNFireBaseMod , only : cnfire_base_type + use shr_kind_mod , only : r8 => shr_kind_r8 + use abortutils , only : endrun + use decompMod , only : bounds_type + use CNVegStateType , only : cnveg_state_type + use CNVegCarbonStateType , only : cnveg_carbonstate_type + implicit none private ! @@ -24,9 +29,16 @@ module FATESFireBase procedure(InitAccBuffer_interface), public, deferred :: InitAccBuffer ! Initialize accumulation processes procedure(InitAccVars_interface), public, deferred :: InitAccVars ! Initialize accumulation variables procedure(UpdateAccVars_interface), public, deferred :: UpdateAccVars ! Update/extract accumulations vars - + ! Interfaces that need to be implemented because they are in the base class + ! They are NOT used when FATES is on + procedure, public :: CNFireReadParams ! Read in parameters (NOT USED FOR FATES) + procedure, public :: CNFireArea ! Calculate fire area (NOT USED FOR FATES) + procedure, public :: CNFireFluxes ! Calculate fire fluxes (NOT USED FOR FATES) + end type fates_fire_base_type + !----------------------- + abstract interface !----------------------------------------------------------------------- @@ -103,6 +115,116 @@ subroutine UpdateAccVars_interface (this, bounds) end subroutine UpdateAccVars_interface end interface - !--------------------------------------------------------------------- + + contains + + !----------------------------------------------------------------------- + ! Implement empty subroutines that are required in the FireMethodType base + ! class, but are NOT used in the FATES version + !----------------------------------------------------------------------- + subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & + dgvs_inst, cnveg_state_inst, & + cnveg_carbonstate_inst, cnveg_carbonflux_inst, cnveg_nitrogenstate_inst, cnveg_nitrogenflux_inst, & + leaf_prof_patch, froot_prof_patch, croot_prof_patch, stem_prof_patch, & + totsomc_col, decomp_cpools_vr_col, decomp_npools_vr_col, somc_fire_col) + ! + ! !DESCRIPTION: + ! Fire effects routine for coupled carbon-nitrogen code (CN). (NOT USED FOR FATES) + ! + ! !USES: + use CNDVType , only : dgvs_type + use CNVegCarbonFluxType , only : cnveg_carbonflux_type + use CNVegNitrogenStateType , only : cnveg_nitrogenstate_type + use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type + ! + ! !ARGUMENTS: + class(fates_fire_base_type) :: this + type(bounds_type) , intent(in) :: bounds + integer , intent(in) :: num_soilc ! number of soil columns in filter + integer , intent(in) :: filter_soilc(:) ! filter for soil columns + integer , intent(in) :: num_soilp ! number of soil patches in filter + integer , intent(in) :: filter_soilp(:) ! filter for soil patches + type(dgvs_type) , intent(inout) :: dgvs_inst + type(cnveg_state_type) , intent(inout) :: cnveg_state_inst + type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst + type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst + type(cnveg_nitrogenstate_type) , intent(in) :: cnveg_nitrogenstate_inst + type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst + real(r8) , intent(in) :: leaf_prof_patch(bounds%begp:,1:) + real(r8) , intent(in) :: froot_prof_patch(bounds%begp:,1:) + real(r8) , intent(in) :: croot_prof_patch(bounds%begp:,1:) + real(r8) , intent(in) :: stem_prof_patch(bounds%begp:,1:) + real(r8) , intent(in) :: totsomc_col(bounds%begc:) + real(r8) , intent(in) :: decomp_cpools_vr_col(bounds%begc:,1:,1:) + real(r8) , intent(in) :: decomp_npools_vr_col(bounds%begc:,1:,1:) + real(r8) , intent(out) :: somc_fire_col(bounds%begc:) + ! + call endrun( "This subroutine should NEVER be called when FATES is active" ) + end subroutine CNFireFluxes + + !----------------------------------------------------------------------- + subroutine CNFireReadParams( this, ncid ) + ! + ! Read in the constant parameters from the input NetCDF parameter file (NOT USED FOR FATES) + ! !USES: + use ncdio_pio , only : file_desc_t + ! + ! !ARGUMENTS: + implicit none + class(fates_fire_base_type) :: this + type(file_desc_t),intent(inout) :: ncid ! pio netCDF file id + ! + call endrun( "This subroutine should NEVER be called when FATES is active" ) + end subroutine CNFireReadParams + + !----------------------------------------------------------------------- + subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & + num_exposedvegp, filter_exposedvegp, num_noexposedvegp, filter_noexposedvegp, & + atm2lnd_inst, energyflux_inst, saturated_excess_runoff_inst, & + waterdiagnosticbulk_inst, wateratm2lndbulk_inst, & + waterstatebulk_inst, soilstate_inst, soil_water_retention_curve, & + cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) + ! + ! !DESCRIPTION: + ! Computes column-level burned area (NOT USED FOR FATES) + ! + ! !USES: + use EnergyFluxType , only : energyflux_type + use SaturatedExcessRunoffMod , only : saturated_excess_runoff_type + use WaterDiagnosticBulkType , only : waterdiagnosticbulk_type + use Wateratm2lndBulkType , only : wateratm2lndbulk_type + use WaterStateBulkType , only : waterstatebulk_type + use SoilStateType , only : soilstate_type + use SoilWaterRetentionCurveMod , only : soil_water_retention_curve_type + use atm2lndType , only : atm2lnd_type + ! + ! !ARGUMENTS: + class(fates_fire_base_type) :: this + type(bounds_type) , intent(in) :: bounds + integer , intent(in) :: num_soilc ! number of soil columns in filter + integer , intent(in) :: filter_soilc(:) ! filter for soil columns + integer , intent(in) :: num_soilp ! number of soil patches in filter + integer , intent(in) :: filter_soilp(:) ! filter for soil patches + integer , intent(in) :: num_exposedvegp ! number of points in filter_exposedvegp + integer , intent(in) :: filter_exposedvegp(:) ! patch filter for non-snow-covered veg + integer , intent(in) :: num_noexposedvegp ! number of points in filter_noexposedvegp + integer , intent(in) :: filter_noexposedvegp(:) ! patch filter where frac_veg_nosno is 0 + type(atm2lnd_type) , intent(in) :: atm2lnd_inst + type(energyflux_type) , intent(in) :: energyflux_inst + type(saturated_excess_runoff_type) , intent(in) :: saturated_excess_runoff_inst + type(waterdiagnosticbulk_type) , intent(in) :: waterdiagnosticbulk_inst + type(wateratm2lndbulk_type) , intent(in) :: wateratm2lndbulk_inst + type(waterstatebulk_type) , intent(in) :: waterstatebulk_inst + type(soilstate_type) , intent(in) :: soilstate_inst + class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve + type(cnveg_state_type) , intent(inout) :: cnveg_state_inst + type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst + real(r8) , intent(in) :: totlitc_col(bounds%begc:) + real(r8) , intent(in) :: decomp_cpools_vr_col(bounds%begc:,1:,1:) + real(r8) , intent(in) :: t_soi17cm_col(bounds%begc:) + ! + call endrun( "This subroutine should NEVER be called when FATES is active" ) + end subroutine CNFireArea + !---------------------------------------------- end module FATESFireBase diff --git a/src/biogeochem/SatellitePhenologyMod.F90 b/src/biogeochem/SatellitePhenologyMod.F90 index 62cc027641..7b5aea35dd 100644 --- a/src/biogeochem/SatellitePhenologyMod.F90 +++ b/src/biogeochem/SatellitePhenologyMod.F90 @@ -4,8 +4,8 @@ module SatellitePhenologyMod !----------------------------------------------------------------------- ! !DESCRIPTION: - ! CLM Satelitte Phenology model (SP) ecosystem dynamics (phenology, vegetation). - ! Allow some subroutines to be used by the CLM Carbon Nitrogen model (CLMCN) + ! CLM Satelitte Phenology model (SP) ecosystem dynamics (phenology, vegetation). + ! Allow some subroutines to be used by the CLM Carbon Nitrogen model (CLMCN) ! so that DryDeposition code can get estimates of LAI differences between months. ! ! !USES: @@ -18,20 +18,20 @@ module SatellitePhenologyMod use decompMod , only : bounds_type use abortutils , only : endrun use clm_varctl , only : scmlat,scmlon,single_column - use clm_varctl , only : iulog, use_lai_streams + use clm_varctl , only : iulog, use_lai_streams, inst_name use clm_varcon , only : grlnd use controlMod , only : NLFilename use decompMod , only : gsmap_lnd_gdc2glo use domainMod , only : ldomain use fileutils , only : getavu, relavu - use PatchType , only : patch + use PatchType , only : patch use CanopyStateType , only : canopystate_type use WaterDiagnosticBulkType , only : waterdiagnosticbulk_type use perf_mod , only : t_startf, t_stopf use spmdMod , only : masterproc use spmdMod , only : mpicom, comp_id use mct_mod - use ncdio_pio + use ncdio_pio ! ! !PUBLIC TYPES: implicit none @@ -66,7 +66,7 @@ module SatellitePhenologyMod !----------------------------------------------------------------------- contains - + !----------------------------------------------------------------------- ! ! lai_init @@ -78,7 +78,6 @@ subroutine lai_init(bounds) ! ! ! !USES: - use clm_varctl , only : inst_name use clm_time_manager , only : get_calendar use ncdio_pio , only : pio_subsystem use shr_pio_mod , only : shr_pio_getiotype @@ -96,10 +95,10 @@ subroutine lai_init(bounds) integer :: i ! index integer :: stream_year_first_lai ! first year in Lai stream to use integer :: stream_year_last_lai ! last year in Lai stream to use - integer :: model_year_align_lai ! align stream_year_first_lai with + integer :: model_year_align_lai ! align stream_year_first_lai with integer :: nu_nml ! unit for namelist file integer :: nml_error ! namelist i/o error flag - type(mct_ggrid) :: dom_clm ! domain information + type(mct_ggrid) :: dom_clm ! domain information character(len=CL) :: stream_fldFileName_lai ! lai stream filename to read character(len=CL) :: lai_mapalgo = 'bilinear' ! Mapping alogrithm character(len=CL) :: lai_tintalgo = 'linear' ! Time interpolation alogrithm @@ -154,9 +153,9 @@ subroutine lai_init(bounds) write(iulog,*) ' ' write(iulog,*) 'lai_stream settings:' - write(iulog,*) ' stream_year_first_lai = ',stream_year_first_lai - write(iulog,*) ' stream_year_last_lai = ',stream_year_last_lai - write(iulog,*) ' model_year_align_lai = ',model_year_align_lai + write(iulog,*) ' stream_year_first_lai = ',stream_year_first_lai + write(iulog,*) ' stream_year_last_lai = ',stream_year_last_lai + write(iulog,*) ' model_year_align_lai = ',model_year_align_lai write(iulog,*) ' stream_fldFileName_lai = ',trim(stream_fldFileName_lai) write(iulog,*) ' lai_tintalgo = ',trim(lai_tintalgo) @@ -170,8 +169,8 @@ subroutine lai_init(bounds) fldList = shr_string_listCreateField( numLaiFields, laiString ) call shr_strdata_create(sdat_lai,name="laidyn", & - pio_subsystem=pio_subsystem, & - pio_iotype=shr_pio_getiotype(inst_name), & + pio_subsystem=pio_subsystem, & + pio_iotype=shr_pio_getiotype(inst_name), & mpicom=mpicom, compid=comp_id, & gsmap=gsmap_lnd_gdc2glo, ggrid=dom_clm, & nxg=ldomain%ni, nyg=ldomain%nj, & @@ -180,10 +179,10 @@ subroutine lai_init(bounds) yearAlign=model_year_align_lai, & offset=0, & domFilePath='', & - domFileName=trim(stream_fldFileName_lai), & + domFileName=trim(stream_fldFileName_lai), & domTvarName='time', & domXvarName='lon' , & - domYvarName='lat' , & + domYvarName='lat' , & domAreaName='area', & domMaskName='mask', & filePath='', & @@ -216,7 +215,7 @@ subroutine lai_advance( bounds ) ! ! !ARGUMENTS: implicit none - type(bounds_type) , intent(in) :: bounds + type(bounds_type) , intent(in) :: bounds ! ! !LOCAL VARIABLES: integer :: g, ig ! Indices @@ -258,7 +257,7 @@ subroutine lai_interp(bounds, canopystate_inst) ! ! !ARGUMENTS: implicit none - type(bounds_type) , intent(in) :: bounds + type(bounds_type) , intent(in) :: bounds type(canopystate_type) , intent(inout) :: canopystate_inst ! ! !LOCAL VARIABLES: @@ -299,7 +298,7 @@ subroutine SatellitePhenologyInit (bounds) use shr_infnan_mod, only : nan => shr_infnan_nan, assignment(=) ! ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds + type(bounds_type), intent(in) :: bounds ! ! !LOCAL VARIABLES: integer :: ier ! error code @@ -342,7 +341,7 @@ subroutine SatellitePhenology(bounds, num_nolakep, filter_nolakep, & use pftconMod, only : noveg, nbrdlf_dcd_brl_shrub ! ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds + type(bounds_type) , intent(in) :: bounds integer , intent(in) :: num_nolakep ! number of column non-lake points in patch filter integer , intent(in) :: filter_nolakep(bounds%endp-bounds%begp+1) ! patch filter for non-lake points type(waterdiagnosticbulk_type) , intent(in) :: waterdiagnosticbulk_inst @@ -355,14 +354,14 @@ subroutine SatellitePhenology(bounds, num_nolakep, filter_nolakep, & !----------------------------------------------------------------------- associate( & - frac_sno => waterdiagnosticbulk_inst%frac_sno_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1) - snow_depth => waterdiagnosticbulk_inst%snow_depth_col , & ! Input: [real(r8) (:) ] snow height (m) - tlai => canopystate_inst%tlai_patch , & ! Output: [real(r8) (:) ] one-sided leaf area index, no burying by snow + frac_sno => waterdiagnosticbulk_inst%frac_sno_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1) + snow_depth => waterdiagnosticbulk_inst%snow_depth_col , & ! Input: [real(r8) (:) ] snow height (m) + tlai => canopystate_inst%tlai_patch , & ! Output: [real(r8) (:) ] one-sided leaf area index, no burying by snow tsai => canopystate_inst%tsai_patch , & ! Output: [real(r8) (:) ] one-sided stem area index, no burying by snow elai => canopystate_inst%elai_patch , & ! Output: [real(r8) (:) ] one-sided leaf area index with burying by snow esai => canopystate_inst%esai_patch , & ! Output: [real(r8) (:) ] one-sided stem area index with burying by snow - htop => canopystate_inst%htop_patch , & ! Output: [real(r8) (:) ] canopy top (m) - hbot => canopystate_inst%hbot_patch , & ! Output: [real(r8) (:) ] canopy bottom (m) + htop => canopystate_inst%htop_patch , & ! Output: [real(r8) (:) ] canopy top (m) + hbot => canopystate_inst%hbot_patch , & ! Output: [real(r8) (:) ] canopy bottom (m) frac_veg_nosno_alb => canopystate_inst%frac_veg_nosno_alb_patch & ! Output: [integer (:) ] fraction of vegetation not covered by snow (0 OR 1) [-] ) @@ -403,19 +402,20 @@ subroutine SatellitePhenology(bounds, num_nolakep, filter_nolakep, & ! are less than 0.05, set equal to zero to prevent numerical ! problems associated with very small lai and sai. - ! snow burial fraction for short vegetation (e.g. grasses) as in - ! Wang and Zeng, 2007. + ! snow burial fraction for short vegetation (e.g. grasses, crops) changes with vegetation height + ! accounts for a 20% bending factor, as used in Lombardozzi et al. (2018) GRL 45(18), 9889-9897 + + ! NOTE: The following snow burial code is duplicated in CNVegStructUpdateMod. + ! Changes in one place should be accompanied by similar changes in the other. if (patch%itype(p) > noveg .and. patch%itype(p) <= nbrdlf_dcd_brl_shrub ) then ol = min( max(snow_depth(c)-hbot(p), 0._r8), htop(p)-hbot(p)) fb = 1._r8 - ol / max(1.e-06_r8, htop(p)-hbot(p)) else - fb = 1._r8 - max(min(snow_depth(c),0.2_r8),0._r8)/0.2_r8 ! 0.2m is assumed - !depth of snow required for complete burial of grasses + fb = 1._r8 - (max(min(snow_depth(c),max(0.05,htop(p)*0.8_r8)),0._r8)/(max(0.05,htop(p)*0.8_r8))) endif ! area weight by snow covered fraction - elai(p) = max(tlai(p)*(1.0_r8 - frac_sno(c)) + tlai(p)*fb*frac_sno(c), 0.0_r8) esai(p) = max(tsai(p)*(1.0_r8 - frac_sno(c)) + tsai(p)*fb*frac_sno(c), 0.0_r8) if (elai(p) < 0.05_r8) elai(p) = 0._r8 @@ -446,7 +446,7 @@ subroutine interpMonthlyVeg (bounds, canopystate_inst) use clm_time_manager, only : get_curr_date, get_step_size_real, get_nstep ! ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds + type(bounds_type), intent(in) :: bounds type(canopystate_type), intent(inout) :: canopystate_inst ! ! !LOCAL VARIABLES: @@ -504,12 +504,12 @@ subroutine readAnnualVegetation (bounds, canopystate_inst) use shr_scam_mod, only : shr_scam_getCloseLatLon ! ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds + type(bounds_type), intent(in) :: bounds type(canopystate_type), intent(inout) :: canopystate_inst ! ! !LOCAL VARIABLES: type(file_desc_t) :: ncid ! netcdf id - real(r8), pointer :: annlai(:,:) ! 12 months of monthly lai from input data set + real(r8), pointer :: annlai(:,:) ! 12 months of monthly lai from input data set real(r8), pointer :: mlai(:,:) ! lai read from input files real(r8):: closelat,closelon ! single column vars integer :: ier ! error code @@ -526,13 +526,13 @@ subroutine readAnnualVegetation (bounds, canopystate_inst) character(len=32) :: subname = 'readAnnualVegetation' !----------------------------------------------------------------------- - annlai => canopystate_inst%annlai_patch + annlai => canopystate_inst%annlai_patch ! Determine necessary indices allocate(mlai(bounds%begg:bounds%endg,0:maxveg), stat=ier) if (ier /= 0) then - write(iulog,*)subname, 'allocation error ' + write(iulog,*)subname, 'allocation error ' call endrun(msg=errMsg(sourcefile, __LINE__)) end if @@ -551,7 +551,7 @@ subroutine readAnnualVegetation (bounds, canopystate_inst) write(iulog,*)trim(subname), 'ldomain%ns,ns,= ',ldomain%ns,ns call endrun(msg=errMsg(sourcefile, __LINE__)) end if - call check_dim(ncid, 'lsmpft', maxsoil_patches) + call check_dim_size(ncid, 'lsmpft', maxsoil_patches) if (single_column) then call shr_scam_getCloseLatLon(locfn, scmlat, scmlon, & @@ -578,7 +578,7 @@ subroutine readAnnualVegetation (bounds, canopystate_inst) else !! non-vegetated pft annlai(k,p) = 0._r8 end if - end do ! end of loop over patches + end do ! end of loop over patches enddo ! months loop @@ -605,7 +605,7 @@ subroutine readMonthlyVegetation (bounds, & use netcdf ! ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds + type(bounds_type) , intent(in) :: bounds character(len=*) , intent(in) :: fveg ! file with monthly vegetation data integer , intent(in) :: months(2) ! months to be interpolated (1 to 12) type(canopystate_type), intent(inout) :: canopystate_inst diff --git a/src/biogeochem/ch4FInundatedStreamType.F90 b/src/biogeochem/ch4FInundatedStreamType.F90 index a0f9dec105..9d38ab8332 100644 --- a/src/biogeochem/ch4FInundatedStreamType.F90 +++ b/src/biogeochem/ch4FInundatedStreamType.F90 @@ -1,16 +1,15 @@ - module ch4FInundatedStreamType #include "shr_assert.h" - !----------------------------------------------------------------------- - ! !DESCRIPTION: + !----------------------------------------------------------------------- + ! !DESCRIPTION: ! Contains methods for reading in finundated streams file for methane code. ! ! !USES use shr_kind_mod , only: r8 => shr_kind_r8, CL => shr_kind_cl use spmdMod , only: mpicom, masterproc - use clm_varctl , only: iulog + use clm_varctl , only: iulog, inst_name use abortutils , only: endrun use decompMod , only: bounds_type use ch4varcon , only: finundation_mtd @@ -60,11 +59,10 @@ module ch4FInundatedStreamType !============================================================================== subroutine Init(this, bounds, NLFilename) - ! + ! ! Initialize the ch4 finundated stream object ! ! Uses: - use clm_varctl , only : inst_name use clm_time_manager , only : get_calendar, get_curr_date use ncdio_pio , only : pio_subsystem use shr_pio_mod , only : shr_pio_getiotype @@ -83,12 +81,12 @@ subroutine Init(this, bounds, NLFilename) ! arguments implicit none class(ch4finundatedstream_type) :: this - type(bounds_type), intent(in) :: bounds + type(bounds_type), intent(in) :: bounds character(len=*), intent(in) :: NLFilename ! Namelist filename ! ! local variables integer :: ig, g ! Indices - type(mct_ggrid) :: dom_clm ! domain information + type(mct_ggrid) :: dom_clm ! domain information type(shr_strdata_type) :: sdat ! input data stream integer :: index_ZWT0 = 0 ! Index of ZWT0 field integer :: index_F0 = 0 ! Index of F0 field @@ -111,8 +109,8 @@ subroutine Init(this, bounds, NLFilename) call clm_domain_mct (bounds, dom_clm) call shr_strdata_create(sdat,name=stream_name,& - pio_subsystem=pio_subsystem, & - pio_iotype=shr_pio_getiotype(inst_name), & + pio_subsystem=pio_subsystem, & + pio_iotype=shr_pio_getiotype(inst_name), & mpicom=mpicom, compid=comp_id, & gsmap=gsmap_lnd_gdc2glo, ggrid=dom_clm, & nxg=ldomain%ni, nyg=ldomain%nj, & @@ -124,7 +122,7 @@ subroutine Init(this, bounds, NLFilename) domFileName=trim(control%stream_fldFileName_ch4finundated), & domTvarName='time', & domXvarName='LONGXY' , & - domYvarName='LATIXY' , & + domYvarName='LATIXY' , & domAreaName='AREA', & domMaskName='LANDMASK', & filePath='', & @@ -191,7 +189,7 @@ end subroutine Init logical function UseStreams(this) ! ! !DESCRIPTION: - ! Return true if + ! Return true if ! ! !USES: ! @@ -201,9 +199,9 @@ logical function UseStreams(this) ! ! !LOCAL VARIABLES: if ( trim(control%stream_fldFileName_ch4finundated) == '' )then - UseStreams = .false. + UseStreams = .false. else - UseStreams = .true. + UseStreams = .true. end if end function UseStreams @@ -246,7 +244,7 @@ subroutine CalcFinundated(this, bounds, num_soilc, filter_soilc, soilhydrology_i waterdiagnosticbulk_inst, qflx_surf_lag_col, finundated ) ! ! !DESCRIPTION: - ! + ! ! Calculate finundated according to the appropriate methodology ! ! !USES: @@ -312,11 +310,10 @@ end subroutine CalcFinundated !============================================================================== subroutine ReadNML(this, bounds, NLFilename) - ! - ! Read the namelist data stream information. + ! + ! Read the namelist data stream information. ! ! Uses: - use clm_varctl , only : inst_name use clm_time_manager , only : get_calendar use ncdio_pio , only : pio_subsystem use shr_pio_mod , only : shr_pio_getiotype @@ -329,7 +326,7 @@ subroutine ReadNML(this, bounds, NLFilename) ! arguments implicit none class(streamcontrol_type) :: this - type(bounds_type), intent(in) :: bounds + type(bounds_type), intent(in) :: bounds character(len=*), intent(in) :: NLFilename ! Namelist filename ! ! local variables diff --git a/src/biogeochem/ch4Mod.F90 b/src/biogeochem/ch4Mod.F90 index 2432b85cf4..0155dd5019 100644 --- a/src/biogeochem/ch4Mod.F90 +++ b/src/biogeochem/ch4Mod.F90 @@ -1251,7 +1251,7 @@ subroutine DynamicColumnAdjustments(this, bounds, clump_index, column_state_upda character(len=*), parameter :: subname = 'DynamicColumnAdjustments' !----------------------------------------------------------------------- - ! BUG(wjs, 2016-02-16, bugz 2283) Need to do some special handling of finundated for + ! BUG(wjs, 2016-02-16, ESCOMP/CTSM#43) Need to do some special handling of finundated for ! increases in lake area, since lakes are assumed to be 100% inundated. Probably it's ! most appropriate for this special handling to happen elsewhere - i.e., within this ! routine, we do the standard adjustments as they are currently done, but then in the diff --git a/src/biogeophys/AerosolMod.F90 b/src/biogeophys/AerosolMod.F90 index 227ebc8f43..05e190c340 100644 --- a/src/biogeophys/AerosolMod.F90 +++ b/src/biogeophys/AerosolMod.F90 @@ -7,7 +7,7 @@ module AerosolMod use shr_log_mod , only : errMsg => shr_log_errMsg use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) use decompMod , only : bounds_type - use clm_varpar , only : nlevsno, nlevgrnd + use clm_varpar , only : nlevsno, nlevgrnd, nlevmaxurbgrnd use clm_time_manager , only : get_step_size_real use atm2lndType , only : atm2lnd_type use WaterFluxBulkType , only : waterfluxbulk_type @@ -373,8 +373,8 @@ subroutine Restart(this, bounds, ncid, flag, & logical :: readvar ! determine if variable is on initial file !----------------------------------------------------------------------- - SHR_ASSERT_ALL_FL((ubound(h2osoi_ice_col) == (/bounds%endc,nlevgrnd/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(h2osoi_liq_col) == (/bounds%endc,nlevgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(h2osoi_ice_col) == (/bounds%endc,nlevmaxurbgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(h2osoi_liq_col) == (/bounds%endc,nlevmaxurbgrnd/)), sourcefile, __LINE__) call restartvar(ncid=ncid, flag=flag, varname='mss_bcpho', xtype=ncd_double, & dim1name='column', dim2name='levsno', switchdim=.true., lowerb2=-nlevsno+1, upperb2=0, & diff --git a/src/biogeophys/BalanceCheckMod.F90 b/src/biogeophys/BalanceCheckMod.F90 index 7d839e2242..15ecb3d56e 100644 --- a/src/biogeophys/BalanceCheckMod.F90 +++ b/src/biogeophys/BalanceCheckMod.F90 @@ -20,6 +20,7 @@ module BalanceCheckMod use SoilHydrologyType , only : soilhydrology_type use SurfaceAlbedoType , only : surfalb_type use WaterStateType , only : waterstate_type + use LakestateType , only : lakestate_type use WaterDiagnosticBulkType, only : waterdiagnosticbulk_type use WaterDiagnosticType, only : waterdiagnostic_type use Wateratm2lndType , only : wateratm2lnd_type @@ -122,7 +123,7 @@ end function GetBalanceCheckSkipSteps !----------------------------------------------------------------------- subroutine BeginWaterBalance(bounds, & num_nolakec, filter_nolakec, num_lakec, filter_lakec, & - water_inst, soilhydrology_inst, & + water_inst, soilhydrology_inst, lakestate_inst, & use_aquifer_layer) ! ! !DESCRIPTION: @@ -136,6 +137,7 @@ subroutine BeginWaterBalance(bounds, & integer , intent(in) :: num_lakec ! number of column lake points in column filter integer , intent(in) :: filter_lakec(:) ! column filter for lake points type(water_type) , intent(inout) :: water_inst + type(lakestate_type) , intent(in) :: lakestate_inst type(soilhydrology_type) , intent(in) :: soilhydrology_inst logical , intent(in) :: use_aquifer_layer ! whether an aquifer layer is used in this run ! @@ -150,6 +152,7 @@ subroutine BeginWaterBalance(bounds, & num_nolakec, filter_nolakec, & num_lakec, filter_lakec, & soilhydrology_inst, & + lakestate_inst, & water_inst%bulk_and_tracers(i)%waterstate_inst, & water_inst%bulk_and_tracers(i)%waterdiagnostic_inst, & water_inst%bulk_and_tracers(i)%waterbalance_inst, & @@ -161,7 +164,8 @@ end subroutine BeginWaterBalance !----------------------------------------------------------------------- subroutine BeginWaterBalanceSingle(bounds, & num_nolakec, filter_nolakec, num_lakec, filter_lakec, & - soilhydrology_inst, waterstate_inst, waterdiagnostic_inst, waterbalance_inst, & + soilhydrology_inst, lakestate_inst, waterstate_inst, & + waterdiagnostic_inst, waterbalance_inst, & use_aquifer_layer) ! ! !DESCRIPTION: @@ -175,6 +179,7 @@ subroutine BeginWaterBalanceSingle(bounds, & integer , intent(in) :: num_lakec ! number of column lake points in column filter integer , intent(in) :: filter_lakec(:) ! column filter for lake points type(soilhydrology_type) , intent(in) :: soilhydrology_inst + type(lakestate_type) , intent(in) :: lakestate_inst class(waterstate_type) , intent(inout) :: waterstate_inst class(waterdiagnostic_type), intent(in) :: waterdiagnostic_inst class(waterbalance_type) , intent(inout) :: waterbalance_inst @@ -210,8 +215,8 @@ subroutine BeginWaterBalanceSingle(bounds, & water_mass = begwb(bounds%begc:bounds%endc)) call ComputeWaterMassLake(bounds, num_lakec, filter_lakec, & - waterstate_inst, & - subtract_dynbal_baselines = .false., & + waterstate_inst, lakestate_inst, & + add_lake_water_and_subtract_dynbal_baselines = .false., & water_mass = begwb(bounds%begc:bounds%endc)) call waterstate_inst%CalculateTotalH2osno(bounds, num_nolakec, filter_nolakec, & diff --git a/src/biogeophys/BareGroundFluxesMod.F90 b/src/biogeophys/BareGroundFluxesMod.F90 index faf6e425b7..6751459246 100644 --- a/src/biogeophys/BareGroundFluxesMod.F90 +++ b/src/biogeophys/BareGroundFluxesMod.F90 @@ -141,9 +141,7 @@ subroutine BareGroundFluxes(bounds, num_noexposedvegp, filter_noexposedvegp, & real(r8) :: z0hg_patch(bounds%begp:bounds%endp) real(r8) :: z0qg_patch(bounds%begp:bounds%endp) real(r8) :: e_ref2m ! 2 m height surface saturated vapor pressure [Pa] - real(r8) :: de2mdT ! derivative of 2 m height surface saturated vapor pressure on t_ref2m real(r8) :: qsat_ref2m ! 2 m height surface saturated specific humidity [kg/kg] - real(r8) :: dqsat2mdT ! derivative of 2 m height surface saturated specific humidity on t_ref2m real(r8) :: www ! surface soil wetness [-] !------------------------------------------------------------------------------ @@ -419,7 +417,8 @@ subroutine BareGroundFluxes(bounds, num_noexposedvegp, filter_noexposedvegp, & q_ref2m(p) = forc_q(c) + temp2(p)*dqh(p)*(1._r8/temp22m(p) - 1._r8/temp2(p)) ! 2 m height relative humidity - call QSat(t_ref2m(p), forc_pbot(c), e_ref2m, de2mdT, qsat_ref2m, dqsat2mdT) + call QSat(t_ref2m(p), forc_pbot(c), qsat_ref2m, & + es = e_ref2m) rh_ref2m(p) = min(100._r8, q_ref2m(p) / qsat_ref2m * 100._r8) diff --git a/src/biogeophys/BiogeophysPreFluxCalcsMod.F90 b/src/biogeophys/BiogeophysPreFluxCalcsMod.F90 index 9a920e7b05..f533a62916 100644 --- a/src/biogeophys/BiogeophysPreFluxCalcsMod.F90 +++ b/src/biogeophys/BiogeophysPreFluxCalcsMod.F90 @@ -15,7 +15,7 @@ module BiogeophysPreFluxCalcsMod use ColumnType , only : col use LandunitType , only : lun use clm_varcon , only : spval - use clm_varpar , only : nlevgrnd, nlevsno, nlevurb + use clm_varpar , only : nlevgrnd, nlevsno, nlevurb, nlevmaxurbgrnd use clm_varctl , only : use_fates use pftconMod , only : pftcon use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall @@ -54,6 +54,7 @@ module BiogeophysPreFluxCalcsMod !----------------------------------------------------------------------- subroutine BiogeophysPreFluxCalcs(bounds, & num_nolakec, filter_nolakec, num_nolakep, filter_nolakep, & + num_urbanc, filter_urbanc, & clm_fates, atm2lnd_inst, canopystate_inst, energyflux_inst, frictionvel_inst, & soilstate_inst, temperature_inst, & wateratm2lndbulk_inst, waterdiagnosticbulk_inst, waterstatebulk_inst) @@ -67,6 +68,8 @@ subroutine BiogeophysPreFluxCalcs(bounds, & integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points integer , intent(in) :: num_nolakep ! number of column non-lake points in patch filter integer , intent(in) :: filter_nolakep(:) ! patch filter for non-lake points + integer , intent(in) :: num_urbanc ! number of urban columns in clump + integer , intent(in) :: filter_urbanc(:) ! urban column filter type(hlm_fates_interface_type) , intent(in) :: clm_fates type(atm2lnd_type) , intent(in) :: atm2lnd_inst type(canopystate_type) , intent(inout) :: canopystate_inst @@ -95,6 +98,7 @@ subroutine BiogeophysPreFluxCalcs(bounds, & call CalcInitialTemperatureAndEnergyVars(bounds, & num_nolakec, filter_nolakec, & num_nolakep, filter_nolakep, & + num_urbanc, filter_urbanc, & atm2lnd_inst, canopystate_inst, frictionvel_inst, & wateratm2lndbulk_inst, & waterdiagnosticbulk_inst, waterstatebulk_inst, & @@ -163,6 +167,7 @@ end subroutine SetZ0mDisp !----------------------------------------------------------------------- subroutine CalcInitialTemperatureAndEnergyVars(bounds, & num_nolakec, filter_nolakec, num_nolakep, filter_nolakep, & + num_urbanc, filter_urbanc, & atm2lnd_inst, canopystate_inst, frictionvel_inst, & wateratm2lndbulk_inst, waterdiagnosticbulk_inst, waterstatebulk_inst, & temperature_inst, energyflux_inst) @@ -178,6 +183,8 @@ subroutine CalcInitialTemperatureAndEnergyVars(bounds, & integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points integer , intent(in) :: num_nolakep ! number of column non-lake points in patch filter integer , intent(in) :: filter_nolakep(:) ! patch filter for non-lake points + integer , intent(in) :: num_urbanc ! number of urban columns in clump + integer , intent(in) :: filter_urbanc(:) ! urban column filter type(atm2lnd_type) , intent(in) :: atm2lnd_inst type(canopystate_type) , intent(in) :: canopystate_inst type(frictionvel_type) , intent(in) :: frictionvel_inst @@ -238,14 +245,24 @@ subroutine CalcInitialTemperatureAndEnergyVars(bounds, & do j = -nlevsno+1, nlevgrnd do fc = 1,num_nolakec c = filter_nolakec(fc) - if ((col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall & - .or. col%itype(c) == icol_roof) .and. j > nlevurb) then - tssbef(c,j) = spval - else + if (col%itype(c) /= icol_sunwall .and. col%itype(c) /= icol_shadewall & + .and. col%itype(c) /= icol_roof) then tssbef(c,j) = t_soisno(c,j) end if - ! record t_h2osfc prior to updating - t_h2osfc_bef(c) = t_h2osfc(c) + end do + end do + + do j = -nlevsno+1, nlevmaxurbgrnd + do fc = 1,num_urbanc + c = filter_urbanc(fc) + if (col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall & + .or. col%itype(c) == icol_roof) then + if (j > nlevurb) then + tssbef(c,j) = spval + else + tssbef(c,j) = t_soisno(c,j) + end if + end if end do end do @@ -253,6 +270,9 @@ subroutine CalcInitialTemperatureAndEnergyVars(bounds, & c = filter_nolakec(fc) l = col%landunit(c) + ! record t_h2osfc prior to updating + t_h2osfc_bef(c) = t_h2osfc(c) + ! ground temperature is weighted average of exposed soil, snow, and h2osfc if (snl(c) < 0) then t_grnd(c) = frac_sno_eff(c) * t_soisno(c,snl(c)+1) & diff --git a/src/biogeophys/CMakeLists.txt b/src/biogeophys/CMakeLists.txt index a25ba5ed0e..1bb52accc5 100644 --- a/src/biogeophys/CMakeLists.txt +++ b/src/biogeophys/CMakeLists.txt @@ -12,6 +12,7 @@ list(APPEND clm_sources InfiltrationExcessRunoffMod.F90 IrrigationMod.F90 LakeCon.F90 + LakeStateType.F90 QSatMod.F90 RootBiophysMod.F90 SaturatedExcessRunoffMod.F90 diff --git a/src/biogeophys/CanopyFluxesMod.F90 b/src/biogeophys/CanopyFluxesMod.F90 index 935bce7c2e..75c9a40f5c 100644 --- a/src/biogeophys/CanopyFluxesMod.F90 +++ b/src/biogeophys/CanopyFluxesMod.F90 @@ -321,13 +321,10 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, real(r8) :: wtalq(bounds%begp:bounds%endp) ! normalized latent heat cond. for air and leaf [-] real(r8) :: wtgaq ! normalized latent heat cond. for air and ground [-] real(r8) :: el(bounds%begp:bounds%endp) ! vapor pressure on leaf surface [pa] - real(r8) :: deldT ! derivative of "el" on "t_veg" [pa/K] real(r8) :: qsatl(bounds%begp:bounds%endp) ! leaf specific humidity [kg/kg] real(r8) :: qsatldT(bounds%begp:bounds%endp) ! derivative of "qsatl" on "t_veg" real(r8) :: e_ref2m ! 2 m height surface saturated vapor pressure [Pa] - real(r8) :: de2mdT ! derivative of 2 m height surface saturated vapor pressure on t_ref2m real(r8) :: qsat_ref2m ! 2 m height surface saturated specific humidity [kg/kg] - real(r8) :: dqsat2mdT ! derivative of 2 m height surface saturated specific humidity on t_ref2m real(r8) :: air(bounds%begp:bounds%endp) ! atmos. radiation temporay set real(r8) :: bir(bounds%begp:bounds%endp) ! atmos. radiation temporay set real(r8) :: cir(bounds%begp:bounds%endp) ! atmos. radiation temporay set @@ -405,6 +402,14 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, real(r8) :: dt_veg_temp(bounds%begp:bounds%endp) integer :: iv logical :: is_end_day ! is end of current day + real(r8) :: tl_ini ! leaf temperature from beginning of time step [K] + real(r8) :: ts_ini ! stem temperature from beginning of time step [K] + real(r8) :: cp_leaf !heat capacity of leaves + real(r8) :: dt_stem !change in stem temperature + real(r8) :: frac_rad_abs_by_stem !fraction of incoming radiation absorbed by stems + real(r8) :: lw_stem !internal longwave stem + real(r8) :: lw_leaf !internal longwave leaf + real(r8) :: sa_internal !min(sa_stem,sa_leaf) integer :: dummy_to_make_pgi_happy !------------------------------------------------------------------------------ @@ -537,7 +542,6 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, grnd_ch4_cond => ch4_inst%grnd_ch4_cond_patch , & ! Output: [real(r8) (:) ] tracer conductance for boundary layer [m/s] htvp => energyflux_inst%htvp_col , & ! Input: [real(r8) (:) ] latent heat of evaporation (/sublimation) [J/kg] (constant) - btran2 => energyflux_inst%btran2_patch , & ! Output: [real(r8) (:) ] F. Li and S. Levis btran => energyflux_inst%btran_patch , & ! Output: [real(r8) (:) ] transpiration wetness factor (0 to 1) rresis => energyflux_inst%rresis_patch , & ! Output: [real(r8) (:,:) ] root resistance by layer (0-1) (nlevgrnd) taux => energyflux_inst%taux_patch , & ! Output: [real(r8) (:) ] wind (shear) stress: e-w (kg/m/s**2) @@ -630,8 +634,15 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, wtaq0(p) = 0._r8 obuold(p) = 0._r8 btran(p) = btran0 - btran2(p) = btran0 end do + frac_rad_abs_by_stem = 0._r8 + lw_leaf = 0._r8 + cp_leaf = 0._r8 + lw_stem = 0._r8 + sa_internal = 0._r8 + dt_stem = 0._r8 + tl_ini = 0._r8 + ts_ini = 0._r8 ! calculate daylength control for Vcmax do f = 1, fn @@ -707,7 +718,6 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, waterstatebulk_inst=waterstatebulk_inst, & waterdiagnosticbulk_inst=waterdiagnosticbulk_inst, & soil_water_retention_curve=soil_water_retention_curve) - end if @@ -740,7 +750,9 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, ! Saturated vapor pressure, specific humidity, and their derivatives ! at the leaf surface - call QSat (t_veg(p), forc_pbot(c), el(p), deldT, qsatl(p), qsatldT(p)) + call QSat (t_veg(p), forc_pbot(c), qsatl(p), & + es = el(p), & + qsdT = qsatldT(p)) ! Determine atmospheric co2 and o2 @@ -1050,9 +1062,13 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, +(1._r8-frac_sno(c)-frac_h2osfc(c))*t_soisno(c,1)**4 & +frac_h2osfc(c)*t_h2osfc(c)**4) - dt_veg(p) = (sabv(p) + air(p) + bir(p)*t_veg(p)**4 + & - cir(p)*lw_grnd - efsh - efe(p)) / & - (- 4._r8*bir(p)*t_veg(p)**3 +dc1*wtga +dc2*wtgaq*qsatldT(p)) + dt_veg(p) = ((1._r8-frac_rad_abs_by_stem)*(sabv(p) + air(p) & + + bir(p)*t_veg(p)**4 + cir(p)*lw_grnd) & + - efsh - efe(p) - lw_leaf + lw_stem & + - (cp_leaf/dtime)*(t_veg(p) - tl_ini)) & + / ((1._r8-frac_rad_abs_by_stem)*(- 4._r8*bir(p)*t_veg(p)**3 & + + 4._r8*sa_internal*emv(p)*sb*t_veg(p)**3 & + +dc1*wtga+dc2*wtgaq*qsatldT(p))+ cp_leaf/dtime) t_veg(p) = tlbef(p) + dt_veg(p) dels = dt_veg(p) del(p) = abs(dels) @@ -1060,10 +1076,14 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, if (del(p) > delmax) then dt_veg(p) = delmax*dels/del(p) t_veg(p) = tlbef(p) + dt_veg(p) - err(p) = sabv(p) + air(p) + bir(p)*tlbef(p)**3*(tlbef(p) + & - 4._r8*dt_veg(p)) + cir(p)*lw_grnd - & - (efsh + dc1*wtga*dt_veg(p)) - (efe(p) + & - dc2*wtgaq*qsatldT(p)*dt_veg(p)) + err(p) = (1._r8-frac_rad_abs_by_stem)*(sabv(p) + air(p) & + + bir(p)*tlbef(p)**3*(tlbef(p) + & + 4._r8*dt_veg(p)) + cir(p)*lw_grnd) & + -sa_internal*emv(p)*sb*tlbef(p)**3*(tlbef(p) + 4._r8*dt_veg(p)) & + + lw_stem & + - (efsh + dc1*wtga*dt_veg(p)) - (efe(p) + & + dc2*wtgaq*qsatldT(p)*dt_veg(p)) & + - (cp_leaf/dtime)*(t_veg(p) - tl_ini) end if ! Fluxes from leaves to canopy space @@ -1109,7 +1129,9 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, ! Re-calculate saturated vapor pressure, specific humidity, and their ! derivatives at the leaf surface - call QSat(t_veg(p), forc_pbot(c), el(p), deldT, qsatl(p), qsatldT(p)) + call QSat(t_veg(p), forc_pbot(c), qsatl(p), & + es = el(p), & + qsdT = qsatldT(p)) ! Update vegetation/ground surface temperature, canopy air ! temperature, canopy vapor pressure, aerodynamic temperature, and @@ -1185,9 +1207,10 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, +(1._r8-frac_sno(c)-frac_h2osfc(c))*t_soisno(c,1)**4 & +frac_h2osfc(c)*t_h2osfc(c)**4) - err(p) = sabv(p) + air(p) + bir(p)*tlbef(p)**3*(tlbef(p) + 4._r8*dt_veg(p)) & - !+ cir(p)*t_grnd(c)**4 - eflx_sh_veg(p) - hvap*qflx_evap_veg(p) - + cir(p)*lw_grnd - eflx_sh_veg(p) - hvap*qflx_evap_veg(p) + err(p) = (1.0_r8-frac_rad_abs_by_stem)*(sabv(p) + air(p) + bir(p)*tlbef(p)**3 & + *(tlbef(p) + 4._r8*dt_veg(p)) + cir(p)*lw_grnd) & + - lw_leaf + lw_stem - eflx_sh_veg(p) - hvap*qflx_evap_veg(p) & + - ((t_veg(p)-tl_ini)*cp_leaf/dtime) ! Fluxes from ground to canopy space @@ -1228,7 +1251,8 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, ! 2 m height relative humidity - call QSat(t_ref2m(p), forc_pbot(c), e_ref2m, de2mdT, qsat_ref2m, dqsat2mdT) + call QSat(t_ref2m(p), forc_pbot(c), qsat_ref2m, & + es = e_ref2m) rh_ref2m(p) = min(100._r8, q_ref2m(p) / qsat_ref2m * 100._r8) rh_ref2m_r(p) = rh_ref2m(p) @@ -1270,14 +1294,20 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, ! Downward longwave radiation below the canopy - dlrad(p) = (1._r8-emv(p))*emg(c)*forc_lwrad(c) + & - emv(p)*emg(c)*sb*tlbef(p)**3*(tlbef(p) + 4._r8*dt_veg(p)) + dlrad(p) = (1._r8-emv(p))*emg(c)*forc_lwrad(c) & + + emv(p)*emg(c)*sb*tlbef(p)**3*(tlbef(p) + 4._r8*dt_veg(p)) & + *(1.0_r8-frac_rad_abs_by_stem) & + + emv(p)*emg(c)*sb*ts_ini**3*(ts_ini + 4._r8*dt_stem) & + *frac_rad_abs_by_stem ! Upward longwave radiation above the canopy ulrad(p) = ((1._r8-emg(c))*(1._r8-emv(p))*(1._r8-emv(p))*forc_lwrad(c) & - + emv(p)*(1._r8+(1._r8-emg(c))*(1._r8-emv(p)))*sb*tlbef(p)**3*(tlbef(p) + & - 4._r8*dt_veg(p)) + emg(c)*(1._r8-emv(p))*sb*lw_grnd) + + emv(p)*(1._r8+(1._r8-emg(c))*(1._r8-emv(p)))*sb & + *tlbef(p)**3*(tlbef(p) + 4._r8*dt_veg(p))*(1._r8-frac_rad_abs_by_stem) & + + emv(p)*(1._r8+(1._r8-emg(c))*(1._r8-emv(p)))*sb & + *ts_ini**3*(ts_ini+ 4._r8*dt_stem)*frac_rad_abs_by_stem & + + emg(c)*(1._r8-emv(p))*sb*lw_grnd) ! Calculate the skin temperature as a weighted sum of all the ground and vegetated fraction ! The weight is the so-called vegetation emissivity, but not that emv is actually an attentuation diff --git a/src/biogeophys/CanopyStateType.F90 b/src/biogeophys/CanopyStateType.F90 index a073486eea..8aa8a24f68 100644 --- a/src/biogeophys/CanopyStateType.F90 +++ b/src/biogeophys/CanopyStateType.F90 @@ -48,6 +48,8 @@ module CanopyStateType real(r8) , pointer :: rscanopy_patch (:) ! patch canopy stomatal resistance (s/m) (ED specific) real(r8) , pointer :: vegwp_patch (:,:) ! patch vegetation water matric potential (mm) + real(r8) , pointer :: vegwp_ln_patch (:,:) ! patch vegetation water matric potential at local noon (mm) + real(r8) , pointer :: vegwp_pd_patch (:,:) ! patch predawn vegetation water matric potential (mm) real(r8) :: leaf_mr_vcm = spval ! Scalar constant of leaf respiration with Vcmax @@ -131,7 +133,8 @@ subroutine InitAllocate(this, bounds) allocate(this%rscanopy_patch (begp:endp)) ; this%rscanopy_patch (:) = nan ! allocate(this%gccanopy_patch (begp:endp)) ; this%gccanopy_patch (:) = 0.0_r8 allocate(this%vegwp_patch (begp:endp,1:nvegwcs)) ; this%vegwp_patch (:,:) = nan - + allocate(this%vegwp_ln_patch (begp:endp,1:nvegwcs)) ; this%vegwp_ln_patch (:,:) = nan + allocate(this%vegwp_pd_patch (begp:endp,1:nvegwcs)) ; this%vegwp_pd_patch (:,:) = nan end subroutine InitAllocate !----------------------------------------------------------------------- @@ -243,6 +246,14 @@ subroutine InitHistory(this, bounds) call hist_addfld2d (fname='VEGWP', units='mm', type2d='nvegwcs', & avgflag='A', long_name='vegetation water matric potential for sun/sha canopy,xyl,root segments', & ptr_patch=this%vegwp_patch) + this%vegwp_ln_patch(begp:endp,:) = spval + call hist_addfld2d (fname='VEGWPLN', units='mm', type2d='nvegwcs', & + avgflag='A', long_name='vegetation water matric potential for sun/sha canopy,xyl,root at local noon', & + ptr_patch=this%vegwp_ln_patch, default='active') + this%vegwp_pd_patch(begp:endp,:) = spval + call hist_addfld2d (fname='VEGWPPD', units='mm', type2d='nvegwcs', avgflag='A', & + long_name='predawn vegetation water matric potential for sun/sha canopy,xyl,root', & + ptr_patch=this%vegwp_pd_patch, default='active') end if end subroutine InitHistory @@ -533,6 +544,8 @@ subroutine Restart(this, bounds, ncid, flag) dim1name='pft', long_name='sunlit fraction of canopy', units='', & interpinic_flag='interp', readvar=readvar, data=this%fsun_patch) + + if (flag=='read' )then do p = bounds%begp,bounds%endp if (shr_infnan_isnan(this%fsun_patch(p)) ) then @@ -547,6 +560,16 @@ subroutine Restart(this, bounds, ncid, flag) long_name='vegetation water matric potential', units='mm', & interpinic_flag='interp', readvar=readvar, data=this%vegwp_patch) + call restartvar(ncid=ncid, flag=flag, varname='VEGWPLN', xtype=ncd_double, & + dim1name='pft', dim2name='vegwcs', & + long_name='vegetation water matric potential for sun/sha canopy,xyl,root at local noon', units='mm', & + interpinic_flag='skip', readvar=readvar, data=this%vegwp_ln_patch) + + call restartvar(ncid=ncid, flag=flag, varname='VEGWPPD', xtype=ncd_double, & + dim1name='pft', dim2name='vegwcs', & + long_name='predawn vegetation water matric potential for sun/sha canopy,xyl,root', units='mm', & + interpinic_flag='skip', readvar=readvar, data=this%vegwp_pd_patch) + end if end subroutine Restart diff --git a/src/biogeophys/EnergyFluxType.F90 b/src/biogeophys/EnergyFluxType.F90 index 3f125e9497..9b1a37a235 100644 --- a/src/biogeophys/EnergyFluxType.F90 +++ b/src/biogeophys/EnergyFluxType.F90 @@ -95,7 +95,6 @@ module EnergyFluxType real(r8), pointer :: bsha_patch (:) ! patch shaded canopy transpiration wetness factor (0 to 1) ! Roots - real(r8), pointer :: btran2_patch (:) ! patch root zone soil wetness factor (0 to 1) real(r8), pointer :: rresis_patch (:,:) ! patch root resistance by layer (0-1) (nlevgrnd) ! Latent heat @@ -250,7 +249,6 @@ subroutine InitAllocate(this, bounds) allocate(this%btran_patch (begp:endp)) ; this%btran_patch (:) = nan allocate(this%btran_min_patch (begp:endp)) ; this%btran_min_patch (:) = nan allocate(this%btran_min_inst_patch (begp:endp)) ; this%btran_min_inst_patch (:) = nan - allocate(this%btran2_patch (begp:endp)) ; this%btran2_patch (:) = nan allocate( this%bsun_patch (begp:endp)) ; this%bsun_patch (:) = nan allocate( this%bsha_patch (begp:endp)) ; this%bsha_patch (:) = nan allocate( this%errsoi_patch (begp:endp)) ; this%errsoi_patch (:) = nan @@ -640,11 +638,6 @@ subroutine InitHistory(this, bounds, is_simple_buildtemp) avgflag='A', long_name='daily minimum of transpiration beta factor', & ptr_patch=this%btran_min_patch, l2g_scale_type='veg') - this%btran2_patch(begp:endp) = spval - call hist_addfld1d (fname='BTRAN2', units='unitless', & - avgflag='A', long_name='root zone soil wetness factor', & - ptr_patch=this%btran2_patch, l2g_scale_type='veg') - if (use_cn) then this%rresis_patch(begp:endp,:) = spval call hist_addfld2d (fname='RRESIS', units='proportion', type2d='levgrnd', & @@ -861,11 +854,6 @@ subroutine Restart(this, bounds, ncid, flag, is_simple_buildtemp, is_prog_buildt interpinic_flag='interp', readvar=readvar, data=this%eflx_urban_heat_col) end if - call restartvar(ncid=ncid, flag=flag, varname='btran2', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%btran2_patch) - call restartvar(ncid=ncid, flag=flag, varname='BTRAN_MIN', xtype=ncd_double, & dim1name='pft', & long_name='daily minimum of transpiration wetness factor', units='', & diff --git a/src/biogeophys/HydrologyDrainageMod.F90 b/src/biogeophys/HydrologyDrainageMod.F90 index 93d77cebf6..6a062e5d1c 100644 --- a/src/biogeophys/HydrologyDrainageMod.F90 +++ b/src/biogeophys/HydrologyDrainageMod.F90 @@ -151,9 +151,18 @@ subroutine HydrologyDrainage(bounds, & do j = 1, nlevgrnd do fc = 1, num_nolakec c = filter_nolakec(fc) - if ((ctype(c) == icol_sunwall .or. ctype(c) == icol_shadewall & - .or. ctype(c) == icol_roof) .and. j > nlevurb) then - else + if (ctype(c) /= icol_sunwall .and. ctype(c) /= icol_shadewall & + .and. ctype(c) /= icol_roof) then + h2osoi_vol(c,j) = h2osoi_liq(c,j)/(dz(c,j)*denh2o) + h2osoi_ice(c,j)/(dz(c,j)*denice) + end if + end do + end do + + do j = 1, nlevurb + do fc = 1, num_urbanc + c = filter_urbanc(fc) + if (col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall & + .or. col%itype(c) == icol_roof) then h2osoi_vol(c,j) = h2osoi_liq(c,j)/(dz(c,j)*denh2o) + h2osoi_ice(c,j)/(dz(c,j)*denice) end if end do diff --git a/src/biogeophys/HydrologyNoDrainageMod.F90 b/src/biogeophys/HydrologyNoDrainageMod.F90 index 2596f7e5b0..9a3009d968 100644 --- a/src/biogeophys/HydrologyNoDrainageMod.F90 +++ b/src/biogeophys/HydrologyNoDrainageMod.F90 @@ -590,9 +590,18 @@ subroutine HydrologyNoDrainage(bounds, & do j = 1, nlevgrnd do fc = 1, num_nolakec c = filter_nolakec(fc) - if ((ctype(c) == icol_sunwall .or. ctype(c) == icol_shadewall & - .or. ctype(c) == icol_roof) .and. j > nlevurb) then - else + if (ctype(c) /= icol_sunwall .and. ctype(c) /= icol_shadewall & + .and. ctype(c) /= icol_roof) then + h2osoi_vol(c,j) = h2osoi_liq(c,j)/(dz(c,j)*denh2o) + h2osoi_ice(c,j)/(dz(c,j)*denice) + end if + end do + end do + + do j = 1, nlevurb + do fc = 1, num_urbanc + c = filter_urbanc(fc) + if (col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall & + .or. col%itype(c) == icol_roof) then h2osoi_vol(c,j) = h2osoi_liq(c,j)/(dz(c,j)*denh2o) + h2osoi_ice(c,j)/(dz(c,j)*denice) end if end do diff --git a/src/biogeophys/LakeFluxesMod.F90 b/src/biogeophys/LakeFluxesMod.F90 index 63633fe93c..3477c565d6 100644 --- a/src/biogeophys/LakeFluxesMod.F90 +++ b/src/biogeophys/LakeFluxesMod.F90 @@ -130,12 +130,10 @@ subroutine LakeFluxes(bounds, num_lakec, filter_lakec, num_lakep, filter_lakep, integer :: jtop(bounds%begc:bounds%endc) ! top level for each column (no longer all 1) real(r8) :: ax ! used in iteration loop for calculating t_grnd (numerator of NR solution) real(r8) :: bx ! used in iteration loop for calculating t_grnd (denomin. of NR solution) - real(r8) :: degdT ! d(eg)/dT real(r8) :: dqh(bounds%begp:bounds%endp) ! diff of humidity between ref. height and surface real(r8) :: dth(bounds%begp:bounds%endp) ! diff of virtual temp. between ref. height and surface real(r8) :: dthv ! diff of vir. poten. temp. between ref. height and surface real(r8) :: dzsur(bounds%begc:bounds%endc) ! 1/2 the top layer thickness (m) - real(r8) :: eg ! water vapor pressure at temperature T [pa] real(r8) :: htvp(bounds%begc:bounds%endc) ! latent heat of vapor of water (or sublimation) [j/kg] real(r8) :: obu(bounds%begp:bounds%endp) ! monin-obukhov length (m) real(r8) :: obuold(bounds%begp:bounds%endp) ! monin-obukhov length of previous iteration @@ -173,9 +171,7 @@ subroutine LakeFluxes(bounds, num_lakec, filter_lakec, num_lakep, filter_lakep, real(r8) :: t_grnd_temp ! Used in surface flux correction over frozen ground real(r8) :: betaprime(bounds%begc:bounds%endc) ! Effective beta: sabg_lyr(p,jtop) for snow layers, beta otherwise real(r8) :: e_ref2m ! 2 m height surface saturated vapor pressure [Pa] - real(r8) :: de2mdT ! derivative of 2 m height surface saturated vapor pressure on t_ref2m real(r8) :: qsat_ref2m ! 2 m height surface saturated specific humidity [kg/kg] - real(r8) :: dqsat2mdT ! derivative of 2 m height surface saturated specific humidity on t_ref2m real(r8) :: sabg_nir ! NIR that is absorbed (W/m^2) ! For calculating roughness lengths @@ -364,7 +360,8 @@ subroutine LakeFluxes(bounds, num_lakec, filter_lakec, num_lakep, filter_lakep, ! Saturated vapor pressure, specific humidity and their derivatives ! at lake surface - call QSat(t_grnd(c), forc_pbot(c), eg, degdT, qsatg(c), qsatgdT(c)) + call QSat(t_grnd(c), forc_pbot(c), qsatg(c), & + qsdT = qsatgdT(c)) ! Potential, virtual potential temperature, and wind speed at the ! reference height @@ -491,7 +488,8 @@ subroutine LakeFluxes(bounds, num_lakec, filter_lakec, num_lakep, filter_lakep, ! Re-calculate saturated vapor pressure, specific humidity and their ! derivatives at lake surface - call QSat(t_grnd(c), forc_pbot(c), eg, degdT, qsatg(c), qsatgdT(c)) + call QSat(t_grnd(c), forc_pbot(c), qsatg(c), & + qsdT = qsatgdT(c)) dth(p)=thm(p)-t_grnd(c) dqh(p)=forc_q(c)-qsatg(c) @@ -643,7 +641,8 @@ subroutine LakeFluxes(bounds, num_lakec, filter_lakec, num_lakep, filter_lakep, ! 2 m height relative humidity - call QSat(t_ref2m(p), forc_pbot(c), e_ref2m, de2mdT, qsat_ref2m, dqsat2mdT) + call QSat(t_ref2m(p), forc_pbot(c), qsat_ref2m, & + es = e_ref2m) rh_ref2m(p) = min(100._r8, q_ref2m(p) / qsat_ref2m * 100._r8) ! Human Heat Stress diff --git a/src/biogeophys/LakeHydrologyMod.F90 b/src/biogeophys/LakeHydrologyMod.F90 index 44588fafff..f6f83d8956 100644 --- a/src/biogeophys/LakeHydrologyMod.F90 +++ b/src/biogeophys/LakeHydrologyMod.F90 @@ -164,7 +164,7 @@ subroutine LakeHydrology(bounds, & t_soisno => temperature_inst%t_soisno_col , & ! Output: [real(r8) (:,:) ] snow temperature (Kelvin) dTdz_top => temperature_inst%dTdz_top_col , & ! Output: [real(r8) (:) ] temperature gradient in top layer K m-1] !TOD snot_top => temperature_inst%snot_top_col , & ! Output: [real(r8) (:) ] snow temperature in top layer [K] !TODO - t_sno_mul_mss => temperature_inst%t_sno_mul_mss_col , & ! Output: [real(r8) (:) ] col snow temperature multiplied by layer mass, layer sum (K * kg/m2) + t_sno_mul_mss => temperature_inst%t_sno_mul_mss_col , & ! Output: [real(r8) (:) ] col snow temperature multiplied by layer mass, layer sum (K * kg/m2) begwb => b_waterbalance_inst%begwb_col , & ! Input: [real(r8) (:) ] water mass begining of the time step endwb => b_waterbalance_inst%endwb_col , & ! Output: [real(r8) (:) ] water mass end of the time step @@ -649,8 +649,8 @@ subroutine LakeHydrology(bounds, & ! Determine ending water balance and volumetric soil water call ComputeWaterMassLake(bounds, num_lakec, filter_lakec, & - b_waterstate_inst, & - subtract_dynbal_baselines = .false., & + b_waterstate_inst, lakestate_inst, & + add_lake_water_and_subtract_dynbal_baselines = .false., & water_mass = endwb(bounds%begc:bounds%endc)) do j = 1, nlevgrnd diff --git a/src/biogeophys/LakeTemperatureMod.F90 b/src/biogeophys/LakeTemperatureMod.F90 index f550f294a6..280020b6ef 100644 --- a/src/biogeophys/LakeTemperatureMod.F90 +++ b/src/biogeophys/LakeTemperatureMod.F90 @@ -134,6 +134,7 @@ subroutine LakeTemperature(bounds, num_lakec, filter_lakec, num_lakep, filter_la type(energyflux_type) , intent(inout) :: energyflux_inst type(temperature_type) , intent(inout) :: temperature_inst type(lakestate_type) , intent(inout) :: lakestate_inst + ! ! !LOCAL VARIABLES: real(r8), parameter :: p0 = 1._r8 ! neutral value of turbulent prandtl number @@ -247,7 +248,7 @@ subroutine LakeTemperature(bounds, num_lakec, filter_lakec, num_lakep, filter_la t_grnd => temperature_inst%t_grnd_col , & ! Input: [real(r8) (:) ] ground temperature (Kelvin) t_soisno => temperature_inst%t_soisno_col , & ! Output: [real(r8) (:,:) ] soil (or snow) temperature (Kelvin) t_lake => temperature_inst%t_lake_col , & ! Output: [real(r8) (:,:) ] col lake temperature (Kelvin) - + beta => lakestate_inst%betaprime_col , & ! Output: [real(r8) (:) ] col effective beta: sabg_lyr(p,jtop) for snow layers, beta otherwise lake_icefrac => lakestate_inst%lake_icefrac_col , & ! Output: [real(r8) (:,:) ] col mass fraction of lake layer that is frozen lake_icefracsurf => lakestate_inst%lake_icefracsurf_col , & ! Output: [real(r8) (:,:) ] col mass fraction of surface lake layer that is frozen @@ -999,8 +1000,10 @@ subroutine LakeTemperature(bounds, num_lakec, filter_lakec, num_lakep, filter_la ncvts(c) = ncvts(c) + cv_lake(c,j)*(t_lake(c,j)-tfrz) & + cfus*dz_lake(c,j)*(1._r8-lake_icefrac(c,j)) fin(c) = fin(c) + phi(c,j) + end do end do + call waterstatebulk_inst%CalculateTotalH2osno(bounds, num_lakec, filter_lakec, & caller = 'LakeTemperature-2', & @@ -1022,6 +1025,7 @@ subroutine LakeTemperature(bounds, num_lakec, filter_lakec, num_lakep, filter_la end do + ! Check energy conservation. do fp = 1, num_lakep p = filter_lakep(fp) diff --git a/src/biogeophys/PhotosynthesisMod.F90 b/src/biogeophys/PhotosynthesisMod.F90 index 70c89e809a..44e28a681c 100644 --- a/src/biogeophys/PhotosynthesisMod.F90 +++ b/src/biogeophys/PhotosynthesisMod.F90 @@ -17,7 +17,7 @@ module PhotosynthesisMod use clm_varctl , only : use_c13, use_c14, use_cn, use_cndv, use_fates, use_luna, use_hydrstress use clm_varctl , only : iulog use clm_varpar , only : nlevcan, nvegwcs, mxpft - use clm_varcon , only : namep, c14ratio, spval + use clm_varcon , only : namep, c14ratio, spval, isecspday use decompMod , only : bounds_type use QuadraticMod , only : quadratic use pftconMod , only : pftcon @@ -148,7 +148,7 @@ module PhotosynthesisMod real(r8), pointer, private :: gs_mol_patch (:,:) ! patch leaf stomatal conductance (umol H2O/m**2/s) real(r8), pointer, private :: gb_mol_patch (:) ! patch leaf boundary layer conductance (umol H2O/m**2/s) real(r8), pointer, private :: rh_leaf_patch (:) ! patch fractional humidity at leaf surface (dimensionless) - + real(r8), pointer, private :: vpd_can_patch (:) ! patch canopy vapor pressure deficit (kPa) real(r8), pointer, private :: alphapsnsun_patch (:) ! patch sunlit 13c fractionation ([]) real(r8), pointer, private :: alphapsnsha_patch (:) ! patch shaded 13c fractionation ([]) @@ -293,7 +293,7 @@ subroutine InitAllocate(this, bounds) allocate(this%mbb_patch (begp:endp)) ; this%mbb_patch (:) = nan allocate(this%gb_mol_patch (begp:endp)) ; this%gb_mol_patch (:) = nan allocate(this%rh_leaf_patch (begp:endp)) ; this%rh_leaf_patch (:) = nan - + allocate(this%vpd_can_patch (begp:endp)) ; this%vpd_can_patch (:) = nan allocate(this%psnsun_patch (begp:endp)) ; this%psnsun_patch (:) = nan allocate(this%psnsha_patch (begp:endp)) ; this%psnsha_patch (:) = nan allocate(this%c13_psnsun_patch (begp:endp)) ; this%c13_psnsun_patch (:) = nan @@ -376,6 +376,14 @@ subroutine InitHistory(this, bounds) call hist_addfld1d (fname='RH_LEAF', units='fraction', & avgflag='A', long_name='fractional humidity at leaf surface', & ptr_patch=this%rh_leaf_patch, set_spec=spval, default='inactive') + + this%vpd_can_patch(begp:endp) = spval + call hist_addfld1d (fname='VPD_CAN', units='kPa', & + avgflag='A', long_name='canopy vapor pressure deficit', & + ptr_patch=this%vpd_can_patch, set_spec=spval, default='active') + + + this%lnca_patch(begp:endp) = spval call hist_addfld1d (fname='LNC', units='gN leaf/m^2', & avgflag='A', long_name='leaf N concentration', & @@ -578,7 +586,7 @@ subroutine InitHistory(this, bounds) endif this%fpsn24_patch = spval - call hist_addfld1d (fname='FPSN24', units='umol CO2/m**2 ground/day',& + call hist_addfld1d (fname='FPSN24', units='umol CO2/m^2 ground/day',& avgflag='A', long_name='24 hour accumulative patch photosynthesis starting from mid-night', & ptr_patch=this%fpsn24_patch, default='inactive') @@ -927,6 +935,13 @@ subroutine Restart(this, bounds, ncid, flag) units='umol/m2/s', & interpinic_flag='interp', readvar=readvar, data=this%lutpu25top_patch) + call restartvar(ncid=ncid, flag=flag, varname='VPD_CAN', xtype=ncd_double, & + dim1name='pft', long_name='canopy vapor pressure deficit', & + units='kPa', & + interpinic_flag='interp', readvar=readvar, data=this%vpd_can_patch) + + + end subroutine Restart !------------------------------------------------------------------------------ @@ -1224,6 +1239,7 @@ subroutine Photosynthesis ( bounds, fn, filterp, & bbb => photosyns_inst%bbb_patch , & ! Output: [real(r8) (:) ] Ball-Berry minimum leaf conductance (umol H2O/m**2/s) mbb => photosyns_inst%mbb_patch , & ! Output: [real(r8) (:) ] Ball-Berry slope of conductance-photosynthesis relationship rh_leaf => photosyns_inst%rh_leaf_patch , & ! Output: [real(r8) (:) ] fractional humidity at leaf surface (dimensionless) + vpd_can => photosyns_inst%vpd_can_patch , & ! Output: [real(r8) (:) ] canopy vapor pressure deficit (kPa) lnc => photosyns_inst%lnca_patch , & ! Output: [real(r8) (:) ] top leaf layer leaf N concentration (gN leaf/m^2) light_inhibit=> photosyns_inst%light_inhibit , & ! Input: [logical ] flag if light should inhibit respiration leafresp_method=> photosyns_inst%leafresp_method , & ! Input: [integer ] method type to use for leaf-maint.-respiration at 25C canopy top @@ -1646,6 +1662,7 @@ subroutine Photosynthesis ( bounds, fn, filterp, & else if ( stomatalcond_mtd == stomatalcond_mtd_medlyn2011 )then ! Put some constraints on RH in the canopy when Medlyn stomatal conductance is being used rh_can = max((esat_tv(p) - ceair), 50._r8) * 0.001_r8 + vpd_can(p) = rh_can end if ! Electron transport rate for C3 plants. Convert par from W/m2 to @@ -2730,6 +2747,7 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & bbb => photosyns_inst%bbb_patch , & ! Output: [real(r8) (:) ] Ball-Berry minimum leaf conductance (umol H2O/m**2/s) mbb => photosyns_inst%mbb_patch , & ! Output: [real(r8) (:) ] Ball-Berry slope of conductance-photosynthesis relationship rh_leaf => photosyns_inst%rh_leaf_patch , & ! Output: [real(r8) (:) ] fractional humidity at leaf surface (dimensionless) + vpd_can => photosyns_inst%vpd_can_patch , & ! Output: [real(r8) (:) ] canopy vapor pressure deficit (kPa) lnc => photosyns_inst%lnca_patch , & ! Output: [real(r8) (:) ] top leaf layer leaf N concentration (gN leaf/m^2) light_inhibit=> photosyns_inst%light_inhibit , & ! Input: [logical ] flag if light should inhibit respiration leafresp_method=> photosyns_inst%leafresp_method , & ! Input: [integer ] method type to use for leaf-maint.-respiration at 25C canopy top @@ -3278,6 +3296,7 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & else if ( stomatalcond_mtd == stomatalcond_mtd_medlyn2011 )then ! Put some constraints on RH in the canopy when Medlyn stomatal conductance is being used rh_can = max((esat_tv(p) - ceair), 50._r8) * 0.001_r8 + vpd_can(p) = rh_can end if ! Electron transport rate for C3 plants. Convert par from W/m2 to @@ -3310,7 +3329,7 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & end if !find ci and stomatal conductance - call hybrid_PHS(ci_z_sun(p,iv), ci_z_sha(p,iv), p, iv, c, gb_mol(p), bsun(p),bsha(p), je_sun, & + call hybrid_PHS(ci_z_sun(p,iv), ci_z_sha(p,iv), p, iv, c, g, gb_mol(p), bsun(p),bsha(p), je_sun, & je_sha, cair(p), oair(p), lmr_z_sun(p,iv), lmr_z_sha(p,iv), & par_z_sun(p,iv), par_z_sha(p,iv), rh_can, gs_mol_sun(p,iv), gs_mol_sha(p,iv), & qsatl(p), qaf(p), iter1, iter2, atm2lnd_inst, photosyns_inst, & @@ -3534,7 +3553,7 @@ end subroutine PhotosynthesisHydraulicStress !------------------------------------------------------------------------------ !-------------------------------------------------------------------------------- - subroutine hybrid_PHS(x0sun, x0sha, p, iv, c, gb_mol, bsun, bsha, jesun, jesha, & + subroutine hybrid_PHS(x0sun, x0sha, p, iv, c, g, gb_mol, bsun, bsha, jesun, jesha, & cair, oair, lmr_z_sun, lmr_z_sha, par_z_sun, par_z_sha, rh_can, & gs_mol_sun, gs_mol_sha, qsatl, qaf, iter1, iter2, atm2lnd_inst, photosyns_inst, & canopystate_inst, waterdiagnosticbulk_inst, soilstate_inst, temperature_inst, waterfluxbulk_inst) @@ -3551,6 +3570,7 @@ subroutine hybrid_PHS(x0sun, x0sha, p, iv, c, gb_mol, bsun, bsha, jesun, jesha, ! ! !!USES: + use clm_time_manager , only : is_near_local_noon ! !! ARGUMENTS: implicit none @@ -3558,6 +3578,7 @@ subroutine hybrid_PHS(x0sun, x0sha, p, iv, c, gb_mol, bsun, bsha, jesun, jesha, integer , intent(in) :: p ! pft index integer , intent(in) :: iv ! radiation canopy layer index integer , intent(in) :: c ! column index + integer , intent(in) :: g ! gridcell index real(r8), intent(in) :: gb_mol ! leaf boundary layer conductance (umol H2O/m**2/s) real(r8), intent(out) :: bsun ! sunlit canopy transpiration wetness factor (0 to 1) real(r8), intent(out) :: bsha ! shaded canopy transpiration wetness factor (0 to 1) @@ -3618,7 +3639,8 @@ subroutine hybrid_PHS(x0sun, x0sha, p, iv, c, gb_mol, bsun, bsha, jesun, jesha, associate( & qflx_tran_veg => waterfluxbulk_inst%qflx_tran_veg_patch , & ! Input: [real(r8) (:) ] vegetation transpiration (mm H2O/s) (+ = to atm) - vegwp => canopystate_inst%vegwp_patch & ! Input/Output: [real(r8) (:,:) ] vegetation water matric potential (mm) + vegwp => canopystate_inst%vegwp_patch ,& ! Input/Output: [real(r8) (:,:) ] vegetation water matric potential (mm) + vegwp_ln => canopystate_inst%vegwp_ln_patch & ! Output: [real(r8) (:,:) ] vegetation water matric potential (mm) at local noon ) @@ -3767,6 +3789,14 @@ subroutine hybrid_PHS(x0sun, x0sha, p, iv, c, gb_mol, bsun, bsha, jesun, jesha, call getvegwp(p, c, x, gb_mol, gs_mol_sun, gs_mol_sha, qsatl, qaf, soilflux, & atm2lnd_inst, canopystate_inst, waterdiagnosticbulk_inst, soilstate_inst, temperature_inst) vegwp(p,:)=x + + !write out local noon vwp (within +/- 1hr) + if ( is_near_local_noon( grc%londeg(g), deltasec=3600 ) )then + vegwp_ln(p,:) = vegwp(p,:) + else + vegwp_ln(p,:) = spval + end if + if (soilflux<0._r8) soilflux = 0._r8 qflx_tran_veg(p) = soilflux @@ -4108,51 +4138,61 @@ subroutine ci_func_PHS(x,cisun, cisha, fvalsun, fvalsha, p, iv, c, bsun, bsha, b ! With an <= 0, then gs_mol = bbb ! Sunlit - cs_sun = cair - 1.4_r8/gb_mol * an_sun(p,iv) * forc_pbot(c) - cs_sun = max(cs_sun,10.e-06_r8) + if (an_sun(p,iv) >= 0._r8) then + cs_sun = cair - 1.4_r8/gb_mol * an_sun(p,iv) * forc_pbot(c) + cs_sun = max(cs_sun,10.e-06_r8) + end if if ( stomatalcond_mtd == stomatalcond_mtd_medlyn2011 )then - term = 1.6_r8 * an_sun(p,iv) / (cs_sun / forc_pbot(c) * 1.e06_r8) - aquad = 1.0_r8 - bquad = -(2.0 * (medlynintercept(patch%itype(p))*1.e-06_r8 + term) + (medlynslope(patch%itype(p)) * term)**2 / & + if (an_sun(p,iv) >= 0._r8) then + term = 1.6_r8 * an_sun(p,iv) / (cs_sun / forc_pbot(c) * 1.e06_r8) + aquad = 1.0_r8 + bquad = -(2.0 * (medlynintercept(patch%itype(p))*1.e-06_r8 + term) + (medlynslope(patch%itype(p)) * term)**2 / & (gb_mol*1.e-06_r8 * rh_can)) - cquad = medlynintercept(patch%itype(p))*medlynintercept(patch%itype(p))*1.e-12_r8 + & + cquad = medlynintercept(patch%itype(p))*medlynintercept(patch%itype(p))*1.e-12_r8 + & (2.0*medlynintercept(patch%itype(p))*1.e-06_r8 + term * & (1.0 - medlynslope(patch%itype(p))* medlynslope(patch%itype(p)) / rh_can)) * term - call quadratic (aquad, bquad, cquad, r1, r2) - gs_mol_sun = max(r1,r2) * 1.e06_r8 - + call quadratic (aquad, bquad, cquad, r1, r2) + gs_mol_sun = max(r1,r2) * 1.e06_r8 + end if + ! Shaded - cs_sha = cair - 1.4_r8/gb_mol * an_sha(p,iv) * forc_pbot(c) - cs_sha = max(cs_sha,10.e-06_r8) - - term = 1.6_r8 * an_sha(p,iv) / (cs_sha / forc_pbot(c) * 1.e06_r8) - aquad = 1.0_r8 - bquad = -(2.0 * (medlynintercept(patch%itype(p))*1.e-06_r8 + term) + (medlynslope(patch%itype(p)) * term)**2 / & + if (an_sha(p,iv) >= 0._r8) then + cs_sha = cair - 1.4_r8/gb_mol * an_sha(p,iv) * forc_pbot(c) + cs_sha = max(cs_sha,10.e-06_r8) + + term = 1.6_r8 * an_sha(p,iv) / (cs_sha / forc_pbot(c) * 1.e06_r8) + aquad = 1.0_r8 + bquad = -(2.0 * (medlynintercept(patch%itype(p))*1.e-06_r8 + term) + (medlynslope(patch%itype(p)) * term)**2 / & (gb_mol*1.e-06_r8 * rh_can)) - cquad = medlynintercept(patch%itype(p))*medlynintercept(patch%itype(p))*1.e-12_r8 + & + cquad = medlynintercept(patch%itype(p))*medlynintercept(patch%itype(p))*1.e-12_r8 + & (2.0*medlynintercept(patch%itype(p))*1.e-06_r8 + term * (1.0 - medlynslope(patch%itype(p))* & medlynslope(patch%itype(p)) / rh_can)) * term - call quadratic (aquad, bquad, cquad, r1, r2) - gs_mol_sha = max(r1,r2)* 1.e06_r8 + call quadratic (aquad, bquad, cquad, r1, r2) + gs_mol_sha = max(r1,r2)* 1.e06_r8 + end if else if ( stomatalcond_mtd == stomatalcond_mtd_bb1987 )then - aquad = cs_sun - bquad = cs_sun*(gb_mol - max(bsun*bbb(p),1._r8)) - mbb(p)*an_sun(p,iv)*forc_pbot(c) - cquad = -gb_mol*(cs_sun*max(bsun*bbb(p),1._r8) + mbb(p)*an_sun(p,iv)*forc_pbot(c)*rh_can) - call quadratic (aquad, bquad, cquad, r1, r2) - gs_mol_sun = max(r1,r2) - + if (an_sun(p,iv) >= 0._r8) then + aquad = cs_sun + bquad = cs_sun*(gb_mol - max(bsun*bbb(p),1._r8)) - mbb(p)*an_sun(p,iv)*forc_pbot(c) + cquad = -gb_mol*(cs_sun*max(bsun*bbb(p),1._r8) + mbb(p)*an_sun(p,iv)*forc_pbot(c)*rh_can) + call quadratic (aquad, bquad, cquad, r1, r2) + gs_mol_sun = max(r1,r2) + end if + ! Shaded - cs_sha = cair - 1.4_r8/gb_mol * an_sha(p,iv) * forc_pbot(c) - cs_sha = max(cs_sha,10.e-06_r8) - - aquad = cs_sha - bquad = cs_sha*(gb_mol - max(bsha*bbb(p),1._r8)) - mbb(p)*an_sha(p,iv)*forc_pbot(c) - cquad = -gb_mol*(cs_sha*max(bsha*bbb(p),1._r8) + mbb(p)*an_sha(p,iv)*forc_pbot(c)*rh_can) - call quadratic (aquad, bquad, cquad, r1, r2) - gs_mol_sha = max(r1,r2) + if (an_sha(p,iv) >= 0._r8) then + cs_sha = cair - 1.4_r8/gb_mol * an_sha(p,iv) * forc_pbot(c) + cs_sha = max(cs_sha,10.e-06_r8) + + aquad = cs_sha + bquad = cs_sha*(gb_mol - max(bsha*bbb(p),1._r8)) - mbb(p)*an_sha(p,iv)*forc_pbot(c) + cquad = -gb_mol*(cs_sha*max(bsha*bbb(p),1._r8) + mbb(p)*an_sha(p,iv)*forc_pbot(c)*rh_can) + call quadratic (aquad, bquad, cquad, r1, r2) + gs_mol_sha = max(r1,r2) + end if end if ! Derive new estimate for cisun,cisha @@ -4186,6 +4226,7 @@ subroutine calcstress(p,c,x,bsun,bsha,gb_mol,gs_mol_sun,gs_mol_sha,qsatl,qaf, & ! USES use clm_varpar , only : nlevsoi use clm_varcon , only : rgas + use clm_time_manager , only : get_local_time !! ! !ARGUMENTS: integer , intent(in) :: p ! pft index @@ -4218,6 +4259,7 @@ subroutine calcstress(p,c,x,bsun,bsha,gb_mol,gs_mol_sun,gs_mol_sha,qsatl,qaf, & real(r8) :: gs0sun,gs0sha ! local gs_mol copies real(r8) :: qsun,qsha ! attenuated transpiration fluxes integer :: j ! index + integer :: g ! gridcell index real(r8) :: cf ! s m**2/umol -> s/m integer :: iter ! newton's method iteration number logical :: flag ! signal that matrix was not invertible @@ -4241,6 +4283,7 @@ subroutine calcstress(p,c,x,bsun,bsha,gb_mol,gs_mol_sun,gs_mol_sha,qsatl,qaf, & tgcm => temperature_inst%thm_patch , & ! Input: [real(r8) (:) ] air temperature at agcm reference height (kelvin) bsw => soilstate_inst%bsw_col , & ! Input: [real(r8) (:,:) ] Clapp and Hornberger "b" qflx_tran_veg => waterfluxbulk_inst%qflx_tran_veg_patch , & ! Input: [real(r8) (:) ] vegetation transpiration (mm H2O/s) (+ = to atm) + vegwp_pd => canopystate_inst%vegwp_pd_patch , & ! Output: [real(r8) (:,:) ] vegetation water matric potential (mm) predawn sucsat => soilstate_inst%sucsat_col & ! Input: [real(r8) (:,:) ] minimum soil suction (mm) ) @@ -4380,6 +4423,14 @@ subroutine calcstress(p,c,x,bsun,bsha,gb_mol,gs_mol_sun,gs_mol_sha,qsatl,qaf, & if (soilflux<0._r8) soilflux = 0._r8 qflx_tran_veg(p) = soilflux endif + + !save predawn vegwp + g = patch%gridcell(p) + if (night .and. get_local_time(grc%londeg(g))<(isecspday/2)) then + vegwp_pd(p,:) = x + else + vegwp_pd(p,:) = spval + end if end associate diff --git a/src/biogeophys/QSatMod.F90 b/src/biogeophys/QSatMod.F90 index 0b1819e467..9a17ce7001 100644 --- a/src/biogeophys/QSatMod.F90 +++ b/src/biogeophys/QSatMod.F90 @@ -12,59 +12,58 @@ module QSatMod ! ! !PUBLIC MEMBER FUNCTIONS: public :: QSat - public :: rhoSat !----------------------------------------------------------------------- - ! For water vapor (temperature range 0C-100C) - real(r8), parameter :: a0 = 6.11213476_r8 - real(r8), parameter :: a1 = 0.444007856_r8 - real(r8), parameter :: a2 = 0.143064234e-01_r8 - real(r8), parameter :: a3 = 0.264461437e-03_r8 - real(r8), parameter :: a4 = 0.305903558e-05_r8 - real(r8), parameter :: a5 = 0.196237241e-07_r8 - real(r8), parameter :: a6 = 0.892344772e-10_r8 - real(r8), parameter :: a7 = -0.373208410e-12_r8 - real(r8), parameter :: a8 = 0.209339997e-15_r8 - ! For derivative:water vapor - real(r8), parameter :: b0 = 0.444017302_r8 - real(r8), parameter :: b1 = 0.286064092e-01_r8 - real(r8), parameter :: b2 = 0.794683137e-03_r8 - real(r8), parameter :: b3 = 0.121211669e-04_r8 - real(r8), parameter :: b4 = 0.103354611e-06_r8 - real(r8), parameter :: b5 = 0.404125005e-09_r8 - real(r8), parameter :: b6 = -0.788037859e-12_r8 - real(r8), parameter :: b7 = -0.114596802e-13_r8 - real(r8), parameter :: b8 = 0.381294516e-16_r8 - ! For ice (temperature range -75C-0C) - real(r8), parameter :: c0 = 6.11123516_r8 - real(r8), parameter :: c1 = 0.503109514_r8 - real(r8), parameter :: c2 = 0.188369801e-01_r8 - real(r8), parameter :: c3 = 0.420547422e-03_r8 - real(r8), parameter :: c4 = 0.614396778e-05_r8 - real(r8), parameter :: c5 = 0.602780717e-07_r8 - real(r8), parameter :: c6 = 0.387940929e-09_r8 - real(r8), parameter :: c7 = 0.149436277e-11_r8 - real(r8), parameter :: c8 = 0.262655803e-14_r8 - ! For derivative:ice - real(r8), parameter :: d0 = 0.503277922_r8 - real(r8), parameter :: d1 = 0.377289173e-01_r8 - real(r8), parameter :: d2 = 0.126801703e-02_r8 - real(r8), parameter :: d3 = 0.249468427e-04_r8 - real(r8), parameter :: d4 = 0.313703411e-06_r8 - real(r8), parameter :: d5 = 0.257180651e-08_r8 - real(r8), parameter :: d6 = 0.133268878e-10_r8 - real(r8), parameter :: d7 = 0.394116744e-13_r8 - real(r8), parameter :: d8 = 0.498070196e-16_r8 -contains - + ! For water vapor (temperature range 0C-100C) + real(r8), parameter :: a0 = 6.11213476_r8 + real(r8), parameter :: a1 = 0.444007856_r8 + real(r8), parameter :: a2 = 0.143064234e-01_r8 + real(r8), parameter :: a3 = 0.264461437e-03_r8 + real(r8), parameter :: a4 = 0.305903558e-05_r8 + real(r8), parameter :: a5 = 0.196237241e-07_r8 + real(r8), parameter :: a6 = 0.892344772e-10_r8 + real(r8), parameter :: a7 = -0.373208410e-12_r8 + real(r8), parameter :: a8 = 0.209339997e-15_r8 + ! For derivative:water vapor + real(r8), parameter :: b0 = 0.444017302_r8 + real(r8), parameter :: b1 = 0.286064092e-01_r8 + real(r8), parameter :: b2 = 0.794683137e-03_r8 + real(r8), parameter :: b3 = 0.121211669e-04_r8 + real(r8), parameter :: b4 = 0.103354611e-06_r8 + real(r8), parameter :: b5 = 0.404125005e-09_r8 + real(r8), parameter :: b6 = -0.788037859e-12_r8 + real(r8), parameter :: b7 = -0.114596802e-13_r8 + real(r8), parameter :: b8 = 0.381294516e-16_r8 + ! For ice (temperature range -75C-0C) + real(r8), parameter :: c0 = 6.11123516_r8 + real(r8), parameter :: c1 = 0.503109514_r8 + real(r8), parameter :: c2 = 0.188369801e-01_r8 + real(r8), parameter :: c3 = 0.420547422e-03_r8 + real(r8), parameter :: c4 = 0.614396778e-05_r8 + real(r8), parameter :: c5 = 0.602780717e-07_r8 + real(r8), parameter :: c6 = 0.387940929e-09_r8 + real(r8), parameter :: c7 = 0.149436277e-11_r8 + real(r8), parameter :: c8 = 0.262655803e-14_r8 + ! For derivative:ice + real(r8), parameter :: d0 = 0.503277922_r8 + real(r8), parameter :: d1 = 0.377289173e-01_r8 + real(r8), parameter :: d2 = 0.126801703e-02_r8 + real(r8), parameter :: d3 = 0.249468427e-04_r8 + real(r8), parameter :: d4 = 0.313703411e-06_r8 + real(r8), parameter :: d5 = 0.257180651e-08_r8 + real(r8), parameter :: d6 = 0.133268878e-10_r8 + real(r8), parameter :: d7 = 0.394116744e-13_r8 + real(r8), parameter :: d8 = 0.498070196e-16_r8 +contains !----------------------------------------------------------------------- - subroutine QSat (T, p, es, esdT, qs, qsdT) + subroutine QSat (T, p, qs, es, qsdT, esdT) ! ! !DESCRIPTION: - ! Computes saturation mixing ratio and the change in saturation - ! mixing ratio with respect to temperature. + ! Computes saturation mixing ratio and (optionally) the change in saturation mixing + ! ratio with respect to temperature. Mixing ratio and specific humidity are + ! approximately equal and can be treated as the same. ! Reference: Polynomial approximations from: ! Piotr J. Flatau, et al.,1992: Polynomial fits to saturation ! vapor pressure. Journal of Applied Meteorology, 31, 1507-1513. @@ -77,91 +76,54 @@ subroutine QSat (T, p, es, esdT, qs, qsdT) implicit none real(r8), intent(in) :: T ! temperature (K) real(r8), intent(in) :: p ! surface atmospheric pressure (pa) - real(r8), intent(out) :: es ! vapor pressure (pa) - real(r8), intent(out) :: esdT ! d(es)/d(T) real(r8), intent(out) :: qs ! humidity (kg/kg) - real(r8), intent(out) :: qsdT ! d(qs)/d(T) + real(r8), intent(out), optional :: es ! vapor pressure (pa) + real(r8), intent(out), optional :: qsdT ! d(qs)/d(T) + real(r8), intent(out), optional :: esdT ! d(es)/d(T) ! ! !LOCAL VARIABLES: - real(r8) :: T_limit + real(r8) :: es_local ! local version of es (in case es is not present) + real(r8) :: esdT_local ! local version of esdT (in case esdT is not present) real(r8) :: td,vp,vp1,vp2 !----------------------------------------------------------------------- - T_limit = T - SHR_CONST_TKFRZ - if (T_limit > 100.0_r8) T_limit=100.0_r8 - if (T_limit < -75.0_r8) T_limit=-75.0_r8 + td = min(100.0_r8, max(-75.0_r8, T - SHR_CONST_TKFRZ)) - td = T_limit if (td >= 0.0_r8) then - es = a0 + td*(a1 + td*(a2 + td*(a3 + td*(a4 & + es_local = a0 + td*(a1 + td*(a2 + td*(a3 + td*(a4 & + td*(a5 + td*(a6 + td*(a7 + td*a8))))))) - - esdT = b0 + td*(b1 + td*(b2 + td*(b3 + td*(b4 & - + td*(b5 + td*(b6 + td*(b7 + td*b8))))))) - else - es = c0 + td*(c1 + td*(c2 + td*(c3 + td*(c4 & + es_local = c0 + td*(c1 + td*(c2 + td*(c3 + td*(c4 & + td*(c5 + td*(c6 + td*(c7 + td*c8))))))) - - esdT = d0 + td*(d1 + td*(d2 + td*(d3 + td*(d4 & - + td*(d5 + td*(d6 + td*(d7 + td*d8))))))) - endif - es = es * 100._r8 ! pa - - esdT = esdT * 100._r8 ! pa/K - - - vp = 1.0_r8 / (p - 0.378_r8*es) + es_local = es_local * 100._r8 ! pa + vp = 1.0_r8 / (p - 0.378_r8*es_local) vp1 = 0.622_r8 * vp - vp2 = vp1 * vp - - qs = es * vp1 ! kg/kg - qsdT = esdT * vp2 * p ! 1 / K - + qs = es_local * vp1 ! kg/kg + if (present(es)) then + es = es_local + end if + + if (present(qsdT) .or. present(esdT)) then + if (td >= 0.0_r8) then + esdT_local = b0 + td*(b1 + td*(b2 + td*(b3 + td*(b4 & + + td*(b5 + td*(b6 + td*(b7 + td*b8))))))) + else + esdT_local = d0 + td*(d1 + td*(d2 + td*(d3 + td*(d4 & + + td*(d5 + td*(d6 + td*(d7 + td*d8))))))) + end if + + esdT_local = esdT_local * 100._r8 ! pa/K + vp2 = vp1 * vp + if (present(qsdT)) then + qsdT = esdT_local * vp2 * p ! 1 / K + end if + if (present(esdT)) then + esdT = esdT_local + end if + end if end subroutine QSat - - -!------------------------------------------------------------------------------- - subroutine rhoSat(T, rho, rhodT) - ! compute the saturated vapor pressure density and its derivative against the temperature - ! jyt - use clm_varcon, only: rwat - use shr_const_mod, only: SHR_CONST_TKFRZ - - implicit none - real(r8), intent(in) :: T - real(r8), intent(out) :: rho - real(r8), optional, intent(out) :: rhodT - - - !------------------ - - real(r8) :: T_limit - real(r8) :: td, es, esdT - - T_limit = T - SHR_CONST_TKFRZ - if (T_limit > 100.0_r8) T_limit=100.0_r8 - if (T_limit < -75.0_r8) T_limit=-75.0_r8 - - td = T_limit - if (td >= 0.0_r8) then - es = a0 + td*(a1 + td*(a2 + td*(a3 + td*(a4 & - + td*(a5 + td*(a6 + td*(a7 + td*a8))))))) - esdT = b0 + td*(b1 + td*(b2 + td*(b3 + td*(b4 & - + td*(b5 + td*(b6 + td*(b7 + td*b8))))))) - else - es = c0 + td*(c1 + td*(c2 + td*(c3 + td*(c4 & - + td*(c5 + td*(c6 + td*(c7 + td*c8))))))) - esdT = d0 + td*(d1 + td*(d2 + td*(d3 + td*(d4 & - + td*(d5 + td*(d6 + td*(d7 + td*d8))))))) - endif - - es = es * 100._r8 ! pa - rho = es/(rwat*T) !kg m^-3 - if(present(rhodT))rhodT= esdT/(rwat*T)-rho/T !kg m^-3 K^-1 - end subroutine rhoSat end module QSatMod diff --git a/src/biogeophys/SnowHydrologyMod.F90 b/src/biogeophys/SnowHydrologyMod.F90 index 2eb9ac6a32..8d1824a70c 100644 --- a/src/biogeophys/SnowHydrologyMod.F90 +++ b/src/biogeophys/SnowHydrologyMod.F90 @@ -21,7 +21,7 @@ module SnowHydrologyMod use decompMod , only : bounds_type use abortutils , only : endrun use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevsoi, nlevgrnd + use clm_varpar , only : nlevsno, nlevsoi, nlevgrnd, nlevmaxurbgrnd use clm_varctl , only : iulog, use_subgrid_fluxes use clm_varcon , only : namec, h2osno_max, hfus, denh2o, denice, rpi, spval, tfrz use clm_varcon , only : cpice, cpliq @@ -949,10 +949,10 @@ subroutine Bulk_InitializeSnowPack(bounds, snowpack_initialized_filterc, & SHR_ASSERT_FL((ubound(forc_t, 1) == bounds%endc), sourcefile, __LINE__) SHR_ASSERT_FL((ubound(snow_depth, 1) == bounds%endc), sourcefile, __LINE__) SHR_ASSERT_FL((ubound(snl, 1) == bounds%endc), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(zi) == [bounds%endc, nlevgrnd]), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(dz) == [bounds%endc, nlevgrnd]), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(z) == [bounds%endc, nlevgrnd]), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(t_soisno) == [bounds%endc, nlevgrnd]), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(zi) == [bounds%endc, nlevmaxurbgrnd]), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(dz) == [bounds%endc, nlevmaxurbgrnd]), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(z) == [bounds%endc, nlevmaxurbgrnd]), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(t_soisno) == [bounds%endc, nlevmaxurbgrnd]), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(frac_iceold) == [bounds%endc, nlevgrnd]), sourcefile, __LINE__) do fc = 1, snowpack_initialized_filterc%num @@ -2922,9 +2922,9 @@ subroutine InitSnowLayers (bounds, snow_depth) associate( & snl => col%snl, & ! Output: [integer (:) ] number of snow layers - dz => col%dz, & ! Output: [real(r8) (:,:) ] layer thickness (m) (-nlevsno+1:nlevgrnd) - z => col%z, & ! Output: [real(r8) (:,:) ] layer depth (m) (-nlevsno+1:nlevgrnd) - zi => col%zi & ! Output: [real(r8) (:,:) ] interface level below a "z" level (m) (-nlevsno+0:nlevgrnd) + dz => col%dz, & ! Output: [real(r8) (:,:) ] layer thickness (m) (-nlevsno+1:nlevmaxurbgrnd) + z => col%z, & ! Output: [real(r8) (:,:) ] layer depth (m) (-nlevsno+1:nlevmaxurbgrnd) + zi => col%zi & ! Output: [real(r8) (:,:) ] interface level below a "z" level (m) (-nlevsno+0:nlevmaxurbgrnd) ) allocate(dzmin(1:nlevsno)) diff --git a/src/biogeophys/SoilFluxesMod.F90 b/src/biogeophys/SoilFluxesMod.F90 index a0b118d75b..303f4402d6 100644 --- a/src/biogeophys/SoilFluxesMod.F90 +++ b/src/biogeophys/SoilFluxesMod.F90 @@ -415,8 +415,9 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & p = filter_nolakep(fp) c = patch%column(p) - if ((col%itype(c) /= icol_sunwall .and. col%itype(c) /= icol_shadewall & - .and. col%itype(c) /= icol_roof) .or. ( j <= nlevurb)) then +! Do this for perv and imperv road for -nlevsno+1,nlevgrnd + if (col%itype(c) /= icol_sunwall .and. col%itype(c) /= icol_shadewall & + .and. col%itype(c) /= icol_roof) then ! area weight heat absorbed by snow layers if (j >= col%snl(c)+1 .and. j < 1) errsoi_patch(p) = errsoi_patch(p) & - frac_sno_eff(c)*(t_soisno(c,j)-tssbef(c,j))/fact(c,j) @@ -425,6 +426,24 @@ subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & end if end do end do + +! Do this for sunwall, shadewall, roof but for -nlevsno+1,nlevurb + do j = -nlevsno+1,nlevurb + do fp = 1,num_urbanp + p = filter_urbanp(fp) + c = patch%column(p) + + if (col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall & + .or. col%itype(c) == icol_roof) then + ! area weight heat absorbed by snow layers + if (j >= col%snl(c)+1 .and. j < 1) errsoi_patch(p) = errsoi_patch(p) & + - frac_sno_eff(c)*(t_soisno(c,j)-tssbef(c,j))/fact(c,j) + if (j >= 1) errsoi_patch(p) = errsoi_patch(p) & + - (t_soisno(c,j)-tssbef(c,j))/fact(c,j) + end if + end do + end do + call t_stopf('bgp2_loop_3') call t_startf('bgp2_loop_4') diff --git a/src/biogeophys/SoilMoistStressMod.F90 b/src/biogeophys/SoilMoistStressMod.F90 index 4f8112b611..1ef1fd7db9 100644 --- a/src/biogeophys/SoilMoistStressMod.F90 +++ b/src/biogeophys/SoilMoistStressMod.F90 @@ -312,7 +312,7 @@ end subroutine normalize_unfrozen_rootfr subroutine calc_root_moist_stress_clm45default(bounds, & nlevgrnd, fn, filterp, rootfr_unf, & temperature_inst, soilstate_inst, energyflux_inst, waterstatebulk_inst, & - waterdiagnosticbulk_inst, soil_water_retention_curve) + waterdiagnosticbulk_inst, soil_water_retention_curve) ! ! DESCRIPTIONS ! compute the root water stress using the default clm45 approach @@ -348,8 +348,7 @@ subroutine calc_root_moist_stress_clm45default(bounds, & ! !LOCAL VARIABLES: real(r8), parameter :: btran0 = 0.0_r8 ! initial value real(r8) :: smp_node, s_node !temporary variables - real(r8) :: smp_node_lf !temporary variable - integer :: p, f, j, c, l !indices + integer :: p, f, j, c !indices !------------------------------------------------------------------------------ ! Enforce expected array sizes @@ -369,7 +368,6 @@ subroutine calc_root_moist_stress_clm45default(bounds, & rootr => soilstate_inst%rootr_patch , & ! Output: [real(r8) (:,:) ] effective fraction of roots in each soil layer (SMS method only) btran => energyflux_inst%btran_patch , & ! Output: [real(r8) (:) ] transpiration wetness factor (0 to 1) (integrated soil water stress) - btran2 => energyflux_inst%btran2_patch , & ! Output: [real(r8) (:) ] integrated soil water stress square rresis => energyflux_inst%rresis_patch , & ! Output: [real(r8) (:,:) ] root soil water stress (resistance) by layer (0-1) (nlevgrnd) h2osoi_vol => waterstatebulk_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] @@ -380,7 +378,6 @@ subroutine calc_root_moist_stress_clm45default(bounds, & do f = 1, fn p = filterp(f) c = patch%column(p) - l = patch%landunit(p) ! Root resistance factors ! rootr effectively defines the active root fraction in each layer @@ -415,13 +412,6 @@ subroutine calc_root_moist_stress_clm45default(bounds, & ! inconsistency for now. btran(p) = btran(p) + max(rootr(p,j),0._r8) end if - s_node = max(h2osoi_vol(c,j)/watsat(c,j), 0.01_r8) - - call soil_water_retention_curve%soil_suction(c, j, s_node, soilstate_inst, smp_node_lf) - - smp_node_lf = max(smpsc(patch%itype(p)), smp_node_lf) - btran2(p) = btran2(p) +rootfr(p,j)*max(0._r8,min((smp_node_lf - smpsc(patch%itype(p))) / & - (smpso(patch%itype(p)) - smpsc(patch%itype(p))), 1._r8)) end do end do diff --git a/src/biogeophys/SoilMoistureStreamMod.F90 b/src/biogeophys/SoilMoistureStreamMod.F90 index 3b1e22f9a5..421d729f0b 100644 --- a/src/biogeophys/SoilMoistureStreamMod.F90 +++ b/src/biogeophys/SoilMoistureStreamMod.F90 @@ -1,5 +1,14 @@ module SoilMoistureStreamMod + ! ********************************************************************** + ! --------------------------- IMPORTANT NOTE --------------------------- + ! + ! In cases using the NUOPC driver/mediator, we use a different version of this module, + ! based on CDEPS, which resides in src/cpl/nuopc/. Changes to the science here should + ! also be made in the similar file in src/cpl/nuopc. Once we start using CDEPS by + ! default, we can remove this version and move the CDEPS-based version into its place. + ! ********************************************************************** + #include "shr_assert.h" !----------------------------------------------------------------------- @@ -14,7 +23,7 @@ module SoilMoistureStreamMod use shr_log_mod , only : errMsg => shr_log_errMsg use decompMod , only : bounds_type use abortutils , only : endrun - use clm_varctl , only : scmlat,scmlon,single_column + use clm_varctl , only : scmlat,scmlon,single_column, inst_name use clm_varctl , only : iulog, use_soil_moisture_streams use clm_varcon , only : grlnd use controlMod , only : NLFilename @@ -22,14 +31,14 @@ module SoilMoistureStreamMod use domainMod , only : ldomain use fileutils , only : getavu, relavu use LandunitType , only : lun - use ColumnType , only : col + use ColumnType , only : col use SoilStateType , only : soilstate_type use WaterStateBulkType, only : waterstatebulk_type use perf_mod , only : t_startf, t_stopf use spmdMod , only : masterproc use spmdMod , only : mpicom, comp_id use mct_mod - use ncdio_pio + use ncdio_pio ! ! !PUBLIC TYPES: implicit none @@ -45,7 +54,7 @@ module SoilMoistureStreamMod integer :: ism ! Soil moisture steram index integer, allocatable :: g_to_ig(:) ! Array matching gridcell index to data index logical :: soilm_ignore_data_if_missing ! If should ignore overridding a point with soil moisture data - ! from the streams file, if the streams file shows that point + ! from the streams file, if the streams file shows that point ! as missing (namelist item) ! ! !PRIVATE TYPES: @@ -55,7 +64,7 @@ module SoilMoistureStreamMod !----------------------------------------------------------------------- contains - + !----------------------------------------------------------------------- ! ! soil_moisture_init @@ -67,7 +76,6 @@ subroutine PrescribedSoilMoistureInit(bounds) ! ! ! !USES: - use clm_varctl , only : inst_name use clm_time_manager , only : get_calendar use ncdio_pio , only : pio_subsystem use shr_pio_mod , only : shr_pio_getiotype @@ -85,11 +93,11 @@ subroutine PrescribedSoilMoistureInit(bounds) integer :: i ! index integer :: stream_year_first_soilm ! first year in Ustar stream to use integer :: stream_year_last_soilm ! last year in Ustar stream to use - integer :: model_year_align_soilm ! align stream_year_first_soilm with + integer :: model_year_align_soilm ! align stream_year_first_soilm with integer :: nu_nml ! unit for namelist file integer :: nml_error ! namelist i/o error flag integer :: soilm_offset ! Offset in time for dataset (sec) - type(mct_ggrid) :: dom_clm ! domain information + type(mct_ggrid) :: dom_clm ! domain information character(len=CL) :: stream_fldfilename_soilm ! ustar stream filename to read character(len=CL) :: soilm_tintalgo = 'linear' ! Time interpolation alogrithm @@ -147,9 +155,9 @@ subroutine PrescribedSoilMoistureInit(bounds) write(iulog,*) ' ' write(iulog,*) 'soil_moisture_stream settings:' - write(iulog,*) ' stream_year_first_soilm = ',stream_year_first_soilm - write(iulog,*) ' stream_year_last_soilm = ',stream_year_last_soilm - write(iulog,*) ' model_year_align_soilm = ',model_year_align_soilm + write(iulog,*) ' stream_year_first_soilm = ',stream_year_first_soilm + write(iulog,*) ' stream_year_last_soilm = ',stream_year_last_soilm + write(iulog,*) ' model_year_align_soilm = ',model_year_align_soilm write(iulog,*) ' stream_fldfilename_soilm = ',trim(stream_fldfilename_soilm) write(iulog,*) ' soilm_tintalgo = ',trim(soilm_tintalgo) write(iulog,*) ' soilm_offset = ',soilm_offset @@ -169,10 +177,10 @@ subroutine PrescribedSoilMoistureInit(bounds) fldList = trim(soilmString) if (masterproc) write(iulog,*) 'fieldlist: ', trim(fldList) - + call shr_strdata_create(sdat_soilm,name="soil_moisture", & - pio_subsystem=pio_subsystem, & - pio_iotype=shr_pio_getiotype(inst_name), & + pio_subsystem=pio_subsystem, & + pio_iotype=shr_pio_getiotype(inst_name), & mpicom=mpicom, compid=comp_id, & gsmap=gsMap_lnd2Dsoi_gdc2glo, ggrid=dom_clm, & nxg=ldomain%ni, nyg=ldomain%nj, & @@ -185,8 +193,8 @@ subroutine PrescribedSoilMoistureInit(bounds) domFileName=trim(stream_fldFileName_soilm), & domTvarName='time', & domXvarName='lon' , & - domYvarName='lat' , & - domZvarName='levsoi' , & + domYvarName='lat' , & + domZvarName='levsoi' , & domAreaName='area', & domMaskName='mask', & filePath='', & @@ -299,7 +307,7 @@ subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, & SHR_ASSERT_FL( (lbound(sdat_soilm%avs(1)%rAttr,2) <= g_to_ig(bounds%begg) ), sourcefile, __LINE__) SHR_ASSERT_FL( (ubound(sdat_soilm%avs(1)%rAttr,2) >= g_to_ig(bounds%endg)+(nlevsoi-1)*size(g_to_ig) ), sourcefile, __LINE__) associate( & - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer depth (m) + dz => col%dz , & ! Input: [real(r8) (:,:) ] layer depth (m) watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) h2osoi_liq => waterstatebulk_inst%h2osoi_liq_col , & ! Input/Output: [real(r8) (:,:) ] liquid water (kg/m2) h2osoi_ice => waterstatebulk_inst%h2osoi_ice_col , & ! Input/Output: [real(r8) (:,:) ] ice water (kg/m2) @@ -336,7 +344,7 @@ subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, & do g = bounds%begg, bounds%endg ig = g_to_ig(g) do j = 1, nlevsoi - + !n = ig + (j-1)*size(g_to_ig) n = ig + (j-1)*size(g_to_ig) @@ -350,28 +358,28 @@ subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, & end do end do - + do c = bounds%begc, bounds%endc ! ! Set variable for each gridcell/column combination ! g = col%gridcell(c) ig = g_to_ig(g) - + ! EBK Jan/2020, also check weights on gridcell (See https://github.com/ESCOMP/CTSM/issues/847) if ( (lun%itype(col%landunit(c)) == istsoil) .or. (lun%itype(col%landunit(c)) == istcrop) .and. & (col%wtgcell(c) /= 0._r8) ) then ! this is a 2d field (gridcell/nlevsoi) ! do j = 1, nlevsoi - + n = ig + (j-1)*size(g_to_ig) ! if soil water is zero, liq/ice fractions cannot be calculated if((h2osoi_liq(c, j) + h2osoi_ice(c, j)) > 0._r8) then - + ! save original soil moisture value h2osoi_vol_initial = h2osoi_vol(c,j) - + ! Check if the vegetated land mask from the dataset on the ! file is different if ( (h2osoi_vol_prs(g,j) == spval) .and. (h2osoi_vol_initial /= spval) )then @@ -405,7 +413,7 @@ subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, & call endrun(subname // ':: ERROR h2osoil liquid plus ice is zero') endif enddo - endif + endif end do end associate diff --git a/src/biogeophys/SoilStateInitTimeConstMod.F90 b/src/biogeophys/SoilStateInitTimeConstMod.F90 index 414a8b6f16..e035a55403 100644 --- a/src/biogeophys/SoilStateInitTimeConstMod.F90 +++ b/src/biogeophys/SoilStateInitTimeConstMod.F90 @@ -158,7 +158,7 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) use ncdio_pio , only : file_desc_t, ncd_io, ncd_double, ncd_int, ncd_inqvdlen use ncdio_pio , only : ncd_pio_openfile, ncd_pio_closefile, ncd_inqdlen use clm_varpar , only : numrad - use clm_varpar , only : nlevsoi, nlevgrnd, nlevlak, nlevsoifl, nlayer, nlayert, nlevurb, nlevsno + use clm_varpar , only : nlevsoi, nlevgrnd, nlevlak, nlevsoifl, nlayer, nlayert, nlevmaxurbgrnd, nlevsno use clm_varcon , only : zsoi, dzsoi, zisoi, spval use clm_varcon , only : secspday, pc, mu, denh2o, denice, grlnd use clm_varctl , only : use_cn, use_lch4, use_fates @@ -396,9 +396,12 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) (lun%urbpoi(l) .and. col%itype(c) /= icol_road_perv .and. & col%itype(c) /= icol_road_imperv)) then + do lev = 1,nlevmaxurbgrnd + soilstate_inst%watsat_col(c,lev) = spval + end do + do lev = 1,nlevgrnd soilstate_inst%bsw_col(c,lev) = spval - soilstate_inst%watsat_col(c,lev) = spval soilstate_inst%watfc_col(c,lev) = spval soilstate_inst%hksat_col(c,lev) = spval soilstate_inst%sucsat_col(c,lev) = spval diff --git a/src/biogeophys/SoilStateType.F90 b/src/biogeophys/SoilStateType.F90 index 6500166bd9..f5b75324c6 100644 --- a/src/biogeophys/SoilStateType.F90 +++ b/src/biogeophys/SoilStateType.F90 @@ -7,7 +7,7 @@ module SoilStateType use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) use decompMod , only : bounds_type use abortutils , only : endrun - use clm_varpar , only : nlevsoi, nlevgrnd, nlevlak, nlayer, nlevsno + use clm_varpar , only : nlevsoi, nlevgrnd, nlevlak, nlayer, nlevsno, nlevmaxurbgrnd use clm_varcon , only : spval use clm_varctl , only : use_hydrstress, use_cn, use_lch4, use_dynroot, use_fates use clm_varctl , only : iulog, hist_wrtch4diag @@ -138,7 +138,7 @@ subroutine InitAllocate(this, bounds) allocate(this%smpmin_col (begc:endc)) ; this%smpmin_col (:) = nan allocate(this%bsw_col (begc:endc,nlevgrnd)) ; this%bsw_col (:,:) = nan - allocate(this%watsat_col (begc:endc,nlevgrnd)) ; this%watsat_col (:,:) = nan + allocate(this%watsat_col (begc:endc,nlevmaxurbgrnd)) ; this%watsat_col (:,:) = nan allocate(this%watdry_col (begc:endc,nlevgrnd)) ; this%watdry_col (:,:) = spval allocate(this%watopt_col (begc:endc,nlevgrnd)) ; this%watopt_col (:,:) = spval allocate(this%watfc_col (begc:endc,nlevgrnd)) ; this%watfc_col (:,:) = nan @@ -154,7 +154,7 @@ subroutine InitAllocate(this, bounds) allocate(this%eff_porosity_col (begc:endc,nlevgrnd)) ; this%eff_porosity_col (:,:) = spval allocate(this%gwc_thr_col (begc:endc)) ; this%gwc_thr_col (:) = nan - allocate(this%thk_col (begc:endc,-nlevsno+1:nlevgrnd)) ; this%thk_col (:,:) = nan + allocate(this%thk_col (begc:endc,-nlevsno+1:nlevmaxurbgrnd)) ; this%thk_col (:,:) = nan allocate(this%tkmg_col (begc:endc,nlevgrnd)) ; this%tkmg_col (:,:) = nan allocate(this%tkdry_col (begc:endc,nlevgrnd)) ; this%tkdry_col (:,:) = nan allocate(this%tksatu_col (begc:endc,nlevgrnd)) ; this%tksatu_col (:,:) = nan diff --git a/src/biogeophys/SoilTemperatureMod.F90 b/src/biogeophys/SoilTemperatureMod.F90 index fb27951471..e8a6b0ef68 100644 --- a/src/biogeophys/SoilTemperatureMod.F90 +++ b/src/biogeophys/SoilTemperatureMod.F90 @@ -88,7 +88,7 @@ module SoilTemperatureMod contains !----------------------------------------------------------------------- - subroutine SoilTemperature(bounds, num_urbanl, filter_urbanl, num_nolakec, filter_nolakec, & + subroutine SoilTemperature(bounds, num_urbanl, filter_urbanl, num_urbanc, filter_urbanc, num_nolakec, filter_nolakec, & atm2lnd_inst, urbanparams_inst, canopystate_inst, waterstatebulk_inst, waterdiagnosticbulk_inst, waterfluxbulk_inst,& solarabs_inst, soilstate_inst, energyflux_inst, temperature_inst, urbantv_inst) ! @@ -113,7 +113,7 @@ subroutine SoilTemperature(bounds, num_urbanl, filter_urbanl, num_nolakec, filte ! ! !USES: use clm_time_manager , only : get_step_size_real - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb + use clm_varpar , only : nlevsno, nlevgrnd, nlevurb, nlevmaxurbgrnd use clm_varctl , only : iulog use clm_varcon , only : cnfac, cpice, cpliq, denh2o use landunit_varcon , only : istsoil, istcrop @@ -128,6 +128,8 @@ subroutine SoilTemperature(bounds, num_urbanl, filter_urbanl, num_nolakec, filte integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points integer , intent(in) :: num_urbanl ! number of urban landunits in clump integer , intent(in) :: filter_urbanl(:) ! urban landunit filter + integer , intent(in) :: num_urbanc ! number of urban columns in clump + integer , intent(in) :: filter_urbanc(:) ! urban column filter type(atm2lnd_type) , intent(in) :: atm2lnd_inst type(urbanparams_type) , intent(in) :: urbanparams_inst type(urbantv_type) , intent(in) :: urbantv_inst @@ -146,10 +148,10 @@ subroutine SoilTemperature(bounds, num_urbanl, filter_urbanl, num_nolakec, filte integer :: fl ! urban filtered landunit indices integer :: jtop(bounds%begc:bounds%endc) ! top level at each column real(r8) :: dtime ! land model time step (sec) - real(r8) :: cv (bounds%begc:bounds%endc,-nlevsno+1:nlevgrnd) ! heat capacity [J/(m2 K)] - real(r8) :: tk (bounds%begc:bounds%endc,-nlevsno+1:nlevgrnd) ! thermal conductivity [W/(m K)] - real(r8) :: fn (bounds%begc:bounds%endc,-nlevsno+1:nlevgrnd) ! heat diffusion through the layer interface [W/m2] - real(r8) :: fn1(bounds%begc:bounds%endc,-nlevsno+1:nlevgrnd) ! heat diffusion through the layer interface [W/m2] + real(r8) :: cv (bounds%begc:bounds%endc,-nlevsno+1:nlevmaxurbgrnd) ! heat capacity [J/(m2 K)] + real(r8) :: tk (bounds%begc:bounds%endc,-nlevsno+1:nlevmaxurbgrnd) ! thermal conductivity [W/(m K)] + real(r8) :: fn (bounds%begc:bounds%endc,-nlevsno+1:nlevmaxurbgrnd) ! heat diffusion through the layer interface [W/m2] + real(r8) :: fn1(bounds%begc:bounds%endc,-nlevsno+1:nlevmaxurbgrnd) ! heat diffusion through the layer interface [W/m2] real(r8) :: dzm ! used in computing tridiagonal matrix real(r8) :: dzp ! used in computing tridiagonal matrix real(r8) :: sabg_lyr_col(bounds%begc:bounds%endc,-nlevsno+1:1) ! absorbed solar radiation (col,lyr) [W/m2] @@ -160,9 +162,9 @@ subroutine SoilTemperature(bounds, num_urbanl, filter_urbanl, num_nolakec, filte real(r8) :: fn_h2osfc(bounds%begc:bounds%endc) ! heat diffusion through standing-water/soil interface [W/m2] real(r8) :: dz_h2osfc(bounds%begc:bounds%endc) ! height of standing surface water [m] integer, parameter :: nband=5 - real(r8) :: bmatrix(bounds%begc:bounds%endc,nband,-nlevsno:nlevgrnd) ! banded matrix for numerical solution of temperature - real(r8) :: tvector(bounds%begc:bounds%endc,-nlevsno:nlevgrnd) ! initial temperature solution [K] - real(r8) :: rvector(bounds%begc:bounds%endc,-nlevsno:nlevgrnd) ! RHS vector for numerical solution of temperature + real(r8) :: bmatrix(bounds%begc:bounds%endc,nband,-nlevsno:nlevmaxurbgrnd) ! banded matrix for numerical solution of temperature + real(r8) :: tvector(bounds%begc:bounds%endc,-nlevsno:nlevmaxurbgrnd) ! initial temperature solution [K] + real(r8) :: rvector(bounds%begc:bounds%endc,-nlevsno:nlevmaxurbgrnd) ! RHS vector for numerical solution of temperature real(r8) :: tk_h2osfc(bounds%begc:bounds%endc) ! thermal conductivity of h2osfc [W/(m K)] [col] real(r8) :: dhsdT(bounds%begc:bounds%endc) ! temperature derivative of "hs" [col] real(r8) :: hs_soil(bounds%begc:bounds%endc) ! heat flux on soil [W/m2] @@ -276,7 +278,7 @@ subroutine SoilTemperature(bounds, num_urbanl, filter_urbanl, num_nolakec, filte ! Thermal conductivity and Heat capacity tk_h2osfc(begc:endc) = nan - call SoilThermProp(bounds, num_nolakec, filter_nolakec, & + call SoilThermProp(bounds, num_urbanc, filter_urbanc, num_nolakec, filter_nolakec, & tk(begc:endc, :), & cv(begc:endc, :), & tk_h2osfc(begc:endc), & @@ -369,7 +371,7 @@ subroutine SoilTemperature(bounds, num_urbanl, filter_urbanl, num_nolakec, filte tvector(c,0) = t_h2osfc(c) ! soil layers; top layer will have one offset and one extra coefficient - tvector(c,1:nlevgrnd) = t_soisno(c,1:nlevgrnd) + tvector(c,1:nlevmaxurbgrnd) = t_soisno(c,1:nlevmaxurbgrnd) enddo @@ -377,7 +379,7 @@ subroutine SoilTemperature(bounds, num_urbanl, filter_urbanl, num_nolakec, filte ! Solve the system - call BandDiagonal(bounds, -nlevsno, nlevgrnd, jtop(begc:endc), jbot(begc:endc), & + call BandDiagonal(bounds, -nlevsno, nlevmaxurbgrnd, jtop(begc:endc), jbot(begc:endc), & num_nolakec, filter_nolakec, nband, bmatrix(begc:endc, :, :), & rvector(begc:endc, :), tvector(begc:endc, :)) call t_stopf( 'SoilTempBandDiag') @@ -389,7 +391,7 @@ subroutine SoilTemperature(bounds, num_urbanl, filter_urbanl, num_nolakec, filte do j = snl(c)+1, 0 t_soisno(c,j) = tvector(c,j-1) !snow layers end do - t_soisno(c,1:nlevgrnd) = tvector(c,1:nlevgrnd) !soil layers + t_soisno(c,1:nlevmaxurbgrnd) = tvector(c,1:nlevmaxurbgrnd) !soil layers if (frac_h2osfc(c) == 0._r8) then t_h2osfc(c)=t_soisno(c,1) @@ -400,7 +402,7 @@ subroutine SoilTemperature(bounds, num_urbanl, filter_urbanl, num_nolakec, filte ! Melting or Freezing - do j = -nlevsno+1,nlevgrnd + do j = -nlevsno+1,nlevmaxurbgrnd do fc = 1,num_nolakec c = filter_nolakec(fc) l = col%landunit(c) @@ -546,7 +548,7 @@ subroutine SoilTemperature(bounds, num_urbanl, filter_urbanl, num_nolakec, filte end subroutine SoilTemperature !----------------------------------------------------------------------- - subroutine SoilThermProp (bounds, num_nolakec, filter_nolakec, & + subroutine SoilThermProp (bounds, num_urbanc, filter_urbanc, num_nolakec, filter_nolakec, & tk, cv, tk_h2osfc, & urbanparams_inst, temperature_inst, waterstatebulk_inst, waterdiagnosticbulk_inst, soilstate_inst) @@ -566,7 +568,7 @@ subroutine SoilThermProp (bounds, num_nolakec, filter_nolakec, & ! flux from the interface to the node j+1. ! ! !USES: - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb, nlevsoi + use clm_varpar , only : nlevsno, nlevgrnd, nlevurb, nlevsoi, nlevmaxurbgrnd use clm_varcon , only : denh2o, denice, tfrz, tkwat, tkice, tkair, cpice, cpliq, thk_bedrock, csol_bedrock use landunit_varcon , only : istice_mec, istwet use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall, icol_road_perv, icol_road_imperv @@ -574,6 +576,8 @@ subroutine SoilThermProp (bounds, num_nolakec, filter_nolakec, & ! ! !ARGUMENTS: type(bounds_type) , intent(in) :: bounds + integer , intent(in) :: num_urbanc ! number of urban columns in clump + integer , intent(in) :: filter_urbanc(:) ! urban column filter integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points real(r8) , intent(out) :: cv( bounds%begc: , -nlevsno+1: ) ! heat capacity [J/(m2 K) ] [col, lev] @@ -598,8 +602,8 @@ subroutine SoilThermProp (bounds, num_nolakec, filter_nolakec, & call t_startf( 'SoilThermProp' ) ! Enforce expected array sizes - SHR_ASSERT_ALL_FL((ubound(cv) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(tk) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(cv) == (/bounds%endc, nlevmaxurbgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(tk) == (/bounds%endc, nlevmaxurbgrnd/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(tk_h2osfc) == (/bounds%endc/)), sourcefile, __LINE__) associate( & @@ -635,9 +639,6 @@ subroutine SoilThermProp (bounds, num_nolakec, filter_nolakec, & ) ! Thermal conductivity of soil from Farouki (1981) - ! Urban values are from Masson et al. 2002, Evaluation of the Town Energy Balance (TEB) - ! scheme with direct measurements from dry districts in two cities, J. Appl. Meteorol., - ! 41, 1011-1026. do j = -nlevsno+1,nlevgrnd do fc = 1, num_nolakec @@ -646,15 +647,12 @@ subroutine SoilThermProp (bounds, num_nolakec, filter_nolakec, & ! Only examine levels from 1->nlevgrnd if (j >= 1) then l = col%landunit(c) - if ((col%itype(c) == icol_sunwall .OR. col%itype(c) == icol_shadewall) .and. j <= nlevurb) then - thk(c,j) = tk_wall(l,j) - else if (col%itype(c) == icol_roof .and. j <= nlevurb) then - thk(c,j) = tk_roof(l,j) - else if (col%itype(c) == icol_road_imperv .and. j >= 1 .and. j <= nlev_improad(l)) then - thk(c,j) = tk_improad(l,j) - else if (lun%itype(l) /= istwet .AND. lun%itype(l) /= istice_mec & - .AND. col%itype(c) /= icol_sunwall .AND. col%itype(c) /= icol_shadewall .AND. & - col%itype(c) /= icol_roof) then + + ! This will include pervious road for all nlevgrnd layers and impervious road for j > nlev_improad + if ((lun%itype(l) /= istwet .and. lun%itype(l) /= istice_mec & + .and. col%itype(c) /= icol_sunwall .and. col%itype(c) /= icol_shadewall .and. & + col%itype(c) /= icol_roof .and. col%itype(c) /= icol_road_imperv) .or. & + (col%itype(c) == icol_road_imperv .and. j > nlev_improad(l))) then satw = (h2osoi_liq(c,j)/denh2o + h2osoi_ice(c,j)/denice)/(dz(c,j)*watsat(c,j)) satw = min(1._r8, satw) @@ -695,9 +693,25 @@ subroutine SoilThermProp (bounds, num_nolakec, filter_nolakec, & end do end do + do j = 1,nlevurb + do fc = 1, num_urbanc + c = filter_urbanc(fc) + l = col%landunit(c) + + if (col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall) then + thk(c,j) = tk_wall(l,j) + else if (col%itype(c) == icol_roof) then + thk(c,j) = tk_roof(l,j) + else if (col%itype(c) == icol_road_imperv .and. j <= nlev_improad(l)) then + thk(c,j) = tk_improad(l,j) + end if + + end do + end do + ! Thermal conductivity at the layer interface - do j = -nlevsno+1,nlevgrnd + do j = -nlevsno+1,nlevmaxurbgrnd do fc = 1,num_nolakec c = filter_nolakec(fc) if ((col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall & @@ -733,23 +747,15 @@ subroutine SoilThermProp (bounds, num_nolakec, filter_nolakec, & enddo ! Soil heat capacity, from de Vires (1963) - ! Urban values are from Masson et al. 2002, Evaluation of the Town Energy Balance (TEB) - ! scheme with direct measurements from dry districts in two cities, J. Appl. Meteorol., - ! 41, 1011-1026. do j = 1, nlevgrnd do fc = 1,num_nolakec c = filter_nolakec(fc) l = col%landunit(c) - if ((col%itype(c) == icol_sunwall .OR. col%itype(c) == icol_shadewall) .and. j <= nlevurb) then - cv(c,j) = cv_wall(l,j) * dz(c,j) - else if (col%itype(c) == icol_roof .and. j <= nlevurb) then - cv(c,j) = cv_roof(l,j) * dz(c,j) - else if (col%itype(c) == icol_road_imperv .and. j >= 1 .and. j <= nlev_improad(l)) then - cv(c,j) = cv_improad(l,j) * dz(c,j) - else if (lun%itype(l) /= istwet .AND. lun%itype(l) /= istice_mec & - .AND. col%itype(c) /= icol_sunwall .AND. col%itype(c) /= icol_shadewall .AND. & - col%itype(c) /= icol_roof) then + if ((lun%itype(l) /= istwet .and. lun%itype(l) /= istice_mec & + .and. col%itype(c) /= icol_sunwall .and. col%itype(c) /= icol_shadewall .and. & + col%itype(c) /= icol_roof .and. col%itype(c) /= icol_road_imperv) .or. & + (col%itype(c) == icol_road_imperv .and. j > nlev_improad(l))) then cv(c,j) = csol(c,j)*(1._r8-watsat(c,j))*dz(c,j) + (h2osoi_ice(c,j)*cpice + h2osoi_liq(c,j)*cpliq) if (j > nbedrock(c)) cv(c,j) = csol_bedrock*dz(c,j) else if (lun%itype(l) == istwet) then @@ -758,14 +764,30 @@ subroutine SoilThermProp (bounds, num_nolakec, filter_nolakec, & else if (lun%itype(l) == istice_mec) then cv(c,j) = (h2osoi_ice(c,j)*cpice + h2osoi_liq(c,j)*cpliq) endif - if (j == 1) then - if (h2osno_no_layers(c) > 0._r8) then - cv(c,j) = cv(c,j) + cpice*h2osno_no_layers(c) - end if - end if enddo end do + do j = 1, nlevurb + do fc = 1,num_urbanc + c = filter_urbanc(fc) + l = col%landunit(c) + if (col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall) then + cv(c,j) = cv_wall(l,j) * dz(c,j) + else if (col%itype(c) == icol_roof) then + cv(c,j) = cv_roof(l,j) * dz(c,j) + else if (col%itype(c) == icol_road_imperv .and. j <= nlev_improad(l)) then + cv(c,j) = cv_improad(l,j) * dz(c,j) + endif + end do + end do + + do fc = 1, num_nolakec + c = filter_nolakec(fc) + if (h2osno_no_layers(c) > 0._r8) then + cv(c,1) = cv(c,1) + cpice*h2osno_no_layers(c) + end if + end do + ! Snow heat capacity do j = -nlevsno+1,0 @@ -1033,7 +1055,7 @@ subroutine Phasechange_beta (bounds, num_nolakec, filter_nolakec, dhsdT, & ! ! !USES: use clm_time_manager , only : get_step_size_real - use clm_varpar , only : nlevsno, nlevgrnd,nlevurb + use clm_varpar , only : nlevsno, nlevgrnd, nlevurb, nlevmaxurbgrnd use clm_varctl , only : iulog use clm_varcon , only : tfrz, hfus, grav use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall, icol_road_perv @@ -1057,14 +1079,14 @@ subroutine Phasechange_beta (bounds, num_nolakec, filter_nolakec, dhsdT, & real(r8) :: dtime !land model time step (sec) real(r8) :: heatr !energy residual or loss after melting or freezing real(r8) :: temp1 !temporary variables [kg/m2] - real(r8) :: hm(bounds%begc:bounds%endc,-nlevsno+1:nlevgrnd) !energy residual [W/m2] - real(r8) :: xm(bounds%begc:bounds%endc,-nlevsno+1:nlevgrnd) !melting or freezing within a time step [kg/m2] - real(r8) :: wmass0(bounds%begc:bounds%endc,-nlevsno+1:nlevgrnd)!initial mass of ice and liquid (kg/m2) - real(r8) :: wice0 (bounds%begc:bounds%endc,-nlevsno+1:nlevgrnd)!initial mass of ice (kg/m2) - real(r8) :: wliq0 (bounds%begc:bounds%endc,-nlevsno+1:nlevgrnd)!initial mass of liquid (kg/m2) - real(r8) :: supercool(bounds%begc:bounds%endc,nlevgrnd) !supercooled water in soil (kg/m2) + real(r8) :: hm(bounds%begc:bounds%endc,-nlevsno+1:nlevmaxurbgrnd) !energy residual [W/m2] + real(r8) :: xm(bounds%begc:bounds%endc,-nlevsno+1:nlevmaxurbgrnd) !melting or freezing within a time step [kg/m2] + real(r8) :: wmass0(bounds%begc:bounds%endc,-nlevsno+1:nlevmaxurbgrnd)!initial mass of ice and liquid (kg/m2) + real(r8) :: wice0 (bounds%begc:bounds%endc,-nlevsno+1:nlevmaxurbgrnd)!initial mass of ice (kg/m2) + real(r8) :: wliq0 (bounds%begc:bounds%endc,-nlevsno+1:nlevmaxurbgrnd)!initial mass of liquid (kg/m2) + real(r8) :: supercool(bounds%begc:bounds%endc,nlevmaxurbgrnd) !supercooled water in soil (kg/m2) real(r8) :: propor !proportionality constant (-) - real(r8) :: tinc(bounds%begc:bounds%endc,-nlevsno+1:nlevgrnd) !t(n+1)-t(n) [K] + real(r8) :: tinc(bounds%begc:bounds%endc,-nlevsno+1:nlevmaxurbgrnd) !t(n+1)-t(n) [K] real(r8) :: smp !frozen water potential (mm) !----------------------------------------------------------------------- @@ -1121,7 +1143,7 @@ subroutine Phasechange_beta (bounds, num_nolakec, filter_nolakec, dhsdT, & qflx_snow_drain(c) = 0._r8 end do - do j = -nlevsno+1,nlevgrnd ! all layers + do j = -nlevsno+1,nlevmaxurbgrnd ! all layers do fc = 1,num_nolakec c = filter_nolakec(fc) if (j >= snl(c)+1) then @@ -1171,21 +1193,21 @@ subroutine Phasechange_beta (bounds, num_nolakec, filter_nolakec, dhsdT, & enddo ! end of level-loop !-- soil layers --------------------------------------------------- - do j = 1,nlevgrnd + do j = 1,nlevmaxurbgrnd do fc = 1,num_nolakec c = filter_nolakec(fc) l = col%landunit(c) supercool(c,j) = 0.0_r8 ! add in urban condition if-block if ((col%itype(c) /= icol_sunwall .and. col%itype(c) /= icol_shadewall & - .and. col%itype(c) /= icol_roof) .or. ( j <= nlevurb)) then - - + .and. col%itype(c) /= icol_roof .and. j <= nlevgrnd) .or. & + ((col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall & + .or. col%itype(c) == icol_roof) .and. j <= nlevurb)) then if (h2osoi_ice(c,j) > 0. .AND. t_soisno(c,j) > tfrz) then imelt(c,j) = 1 ! tinc(c,j) = t_soisno(c,j) - tfrz - tinc(c,j) = tfrz - t_soisno(c,j) + tinc(c,j) = tfrz - t_soisno(c,j) t_soisno(c,j) = tfrz endif @@ -1202,7 +1224,7 @@ subroutine Phasechange_beta (bounds, num_nolakec, filter_nolakec, dhsdT, & if (h2osoi_liq(c,j) > supercool(c,j) .AND. t_soisno(c,j) < tfrz) then imelt(c,j) = 2 ! tinc(c,j) = t_soisno(c,j) - tfrz - tinc(c,j) = tfrz - t_soisno(c,j) + tinc(c,j) = tfrz - t_soisno(c,j) t_soisno(c,j) = tfrz endif @@ -1222,12 +1244,14 @@ subroutine Phasechange_beta (bounds, num_nolakec, filter_nolakec, dhsdT, & enddo - do j = -nlevsno+1,nlevgrnd ! all layers + do j = -nlevsno+1,nlevmaxurbgrnd ! all layers do fc = 1,num_nolakec c = filter_nolakec(fc) if ((col%itype(c) /= icol_sunwall .and. col%itype(c) /= icol_shadewall & - .and. col%itype(c) /= icol_roof) .or. ( j <= nlevurb)) then + .and. col%itype(c) /= icol_roof .and. j <= nlevgrnd) .or. & + ((col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall & + .or. col%itype(c) == icol_roof) .and. j <= nlevurb)) then if (j >= snl(c)+1) then @@ -1296,7 +1320,7 @@ subroutine Phasechange_beta (bounds, num_nolakec, filter_nolakec, dhsdT, & qflx_snomelt(c) = max(0._r8,(temp1-h2osno_no_layers(c)))/dtime ! kg/(m2 s) ! no snow layers, so qflx_snomelt_lyr is not set xmf(c) = hfus*qflx_snomelt(c) - qflx_snow_drain(c) = qflx_snomelt(c) + qflx_snow_drain(c) = qflx_snomelt(c) endif endif @@ -1348,7 +1372,7 @@ subroutine Phasechange_beta (bounds, num_nolakec, filter_nolakec, dhsdT, & end if endif ! end of heatr > 0 if-block - if (j >= 1) then + if (j >= 1) then xmf(c) = xmf(c) + hfus*(wice0(c,j)-h2osoi_ice(c,j))/dtime else xmf(c) = xmf(c) + hfus*(wice0(c,j)-h2osoi_ice(c,j))/dtime @@ -1661,7 +1685,7 @@ subroutine ComputeHeatDiffFluxAndFactor(bounds, num_nolakec, filter_nolakec, dti ! !USES: use clm_varcon , only : capr, cnfac use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb + use clm_varpar , only : nlevsno, nlevgrnd, nlevurb, nlevmaxurbgrnd use UrbanParamsType, only : IsSimpleBuildTemp ! ! !ARGUMENTS: @@ -1684,10 +1708,10 @@ subroutine ComputeHeatDiffFluxAndFactor(bounds, num_nolakec, filter_nolakec, dti !----------------------------------------------------------------------- ! Enforce expected array sizes - SHR_ASSERT_ALL_FL((ubound(tk) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(cv) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(fact) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(fn) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(tk) == (/bounds%endc, nlevmaxurbgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(cv) == (/bounds%endc, nlevmaxurbgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(fact) == (/bounds%endc, nlevmaxurbgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(fn) == (/bounds%endc, nlevmaxurbgrnd/)), sourcefile, __LINE__) associate(& zi => col%zi , & ! Input: [real(r8) (:,:) ] interface level below a "z" level (m) @@ -1706,7 +1730,7 @@ subroutine ComputeHeatDiffFluxAndFactor(bounds, num_nolakec, filter_nolakec, dti ! tridiagonal matrix and set up vector r and vectors a, b, c that define tridiagonal ! matrix and solve system - do j = -nlevsno+1,nlevgrnd + do j = -nlevsno+1,nlevmaxurbgrnd do fc = 1,num_nolakec c = filter_nolakec(fc) l = col%landunit(c) @@ -1740,7 +1764,7 @@ subroutine ComputeHeatDiffFluxAndFactor(bounds, num_nolakec, filter_nolakec, dti end if end if else if (col%itype(c) /= icol_sunwall .and. col%itype(c) /= icol_shadewall & - .and. col%itype(c) /= icol_roof) then + .and. col%itype(c) /= icol_roof .and. j <= nlevgrnd) then if (j >= col%snl(c)+1) then if (j == col%snl(c)+1) then fact(c,j) = dtime/cv(c,j) * dz(c,j) / (0.5_r8*(z(c,j)-zi(c,j-1)+capr*(z(c,j+1)-zi(c,j-1)))) @@ -1784,7 +1808,7 @@ subroutine SetRHSVec(bounds, num_nolakec, filter_nolakec, dtime, & ! !USES: use clm_varcon , only : cnfac, cpliq use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb + use clm_varpar , only : nlevsno, nlevmaxurbgrnd ! ! !ARGUMENTS: implicit none @@ -1811,11 +1835,11 @@ subroutine SetRHSVec(bounds, num_nolakec, filter_nolakec, dtime, & ! !LOCAL VARIABLES: integer :: j,c ! indices integer :: fc ! lake filtered column indices - real(r8) :: rt (bounds%begc:bounds%endc,-nlevsno+1:nlevgrnd) ! "r" vector for tridiagonal solution + real(r8) :: rt (bounds%begc:bounds%endc,-nlevsno+1:nlevmaxurbgrnd) ! "r" vector for tridiagonal solution real(r8) :: fn_h2osfc(bounds%begc:bounds%endc) ! heat diffusion through standing-water/soil interface [W/m2] real(r8) :: rt_snow(bounds%begc:bounds%endc,-nlevsno:-1) ! RHS vector corresponding to snow layers real(r8) :: rt_ssw(bounds%begc:bounds%endc,1) ! RHS vector corresponding to standing surface water - real(r8) :: rt_soil(bounds%begc:bounds%endc,1:nlevgrnd) ! RHS vector corresponding to soil layer + real(r8) :: rt_soil(bounds%begc:bounds%endc,1:nlevmaxurbgrnd) ! RHS vector corresponding to soil layer !----------------------------------------------------------------------- ! Enforce expected array sizes @@ -1825,13 +1849,13 @@ subroutine SetRHSVec(bounds, num_nolakec, filter_nolakec, dtime, & SHR_ASSERT_ALL_FL((ubound(hs_top) == (/bounds%endc/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(dhsdT) == (/bounds%endc/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(sabg_lyr_col) == (/bounds%endc, 1/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(tk) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(tk) == (/bounds%endc, nlevmaxurbgrnd/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(tk_h2osfc) == (/bounds%endc/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(fact) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(fn) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(fact) == (/bounds%endc, nlevmaxurbgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(fn) == (/bounds%endc, nlevmaxurbgrnd/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(c_h2osfc) == (/bounds%endc/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(dz_h2osfc) == (/bounds%endc/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(rvector) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(rvector) == (/bounds%endc, nlevmaxurbgrnd/)), sourcefile, __LINE__) associate( & t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature [K] @@ -1897,7 +1921,7 @@ subroutine SetRHSVec(bounds, num_nolakec, filter_nolakec, dtime, & c = filter_nolakec(fc) rvector(c, -nlevsno:-1) = rt_snow(c, -nlevsno:-1) rvector(c, 0 ) = rt_ssw(c, 1 ) - rvector(c, 1:nlevgrnd ) = rt_soil(c, 1:nlevgrnd ) + rvector(c, 1:nlevmaxurbgrnd ) = rt_soil(c, 1:nlevmaxurbgrnd ) end do end associate @@ -1916,7 +1940,7 @@ subroutine SetRHSVec_Snow(bounds, num_nolakec, filter_nolakec, & use clm_varcon , only : cnfac use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall use column_varcon , only : icol_road_perv, icol_road_imperv - use clm_varpar , only : nlevsno, nlevgrnd + use clm_varpar , only : nlevsno, nlevmaxurbgrnd ! ! !ARGUMENTS: implicit none @@ -1945,9 +1969,9 @@ subroutine SetRHSVec_Snow(bounds, num_nolakec, filter_nolakec, & SHR_ASSERT_ALL_FL((ubound(hs_top) == (/bounds%endc/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(dhsdT) == (/bounds%endc/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(sabg_lyr_col) == (/bounds%endc, 1/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(fact) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(fn) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(t_soisno) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(fact) == (/bounds%endc, nlevmaxurbgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(fn) == (/bounds%endc, nlevmaxurbgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(t_soisno) == (/bounds%endc, nlevmaxurbgrnd/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(t_h2osfc) == (/bounds%endc/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(rt) == (/bounds%endc, -1/)), sourcefile, __LINE__) @@ -2011,7 +2035,7 @@ subroutine SetRHSVec_StandingSurfaceWater(bounds, num_nolakec, filter_nolakec, d ! !USES: use clm_varcon , only : cnfac use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd + use clm_varpar , only : nlevsno, nlevmaxurbgrnd ! ! !ARGUMENTS: implicit none @@ -2042,7 +2066,7 @@ subroutine SetRHSVec_StandingSurfaceWater(bounds, num_nolakec, filter_nolakec, d SHR_ASSERT_ALL_FL((ubound(c_h2osfc) == (/bounds%endc/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(dz_h2osfc) == (/bounds%endc/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(fn_h2osfc) == (/bounds%endc/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(t_soisno) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(t_soisno) == (/bounds%endc, nlevmaxurbgrnd/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(t_h2osfc) == (/bounds%endc/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(rt) == (/bounds%endc,1/)), sourcefile, __LINE__) @@ -2078,7 +2102,7 @@ subroutine SetRHSVec_Soil(bounds, num_nolakec, filter_nolakec, & use clm_varcon , only : cnfac use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall use column_varcon , only : icol_road_perv, icol_road_imperv - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb + use clm_varpar , only : nlevsno, nlevurb, nlevgrnd, nlevmaxurbgrnd ! ! !ARGUMENTS: implicit none @@ -2108,14 +2132,14 @@ subroutine SetRHSVec_Soil(bounds, num_nolakec, filter_nolakec, & SHR_ASSERT_ALL_FL((ubound(hs_soil) == (/bounds%endc/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(dhsdT) == (/bounds%endc/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(sabg_lyr_col) == (/bounds%endc, 1/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(fact) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(fn) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(fact) == (/bounds%endc, nlevmaxurbgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(fn) == (/bounds%endc, nlevmaxurbgrnd/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(fn_h2osfc) == (/bounds%endc/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(c_h2osfc) == (/bounds%endc/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(frac_h2osfc) == (/bounds%endc/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(frac_sno_eff) == (/bounds%endc/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(t_soisno) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(rt) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(t_soisno) == (/bounds%endc, nlevmaxurbgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(rt) == (/bounds%endc, nlevmaxurbgrnd/)), sourcefile, __LINE__) associate(& begc => bounds%begc , & ! Input: [integer ] beginning column index @@ -2227,7 +2251,7 @@ subroutine SetMatrix(bounds, num_nolakec, filter_nolakec, dtime, nband, & ! !USES: use clm_varcon , only : cnfac use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb + use clm_varpar , only : nlevsno, nlevmaxurbgrnd ! ! !ARGUMENTS: implicit none @@ -2252,7 +2276,7 @@ subroutine SetMatrix(bounds, num_nolakec, filter_nolakec, dtime, nband, & real(r8) :: dzp ! used in computing tridiagonal matrix real(r8) :: bmatrix_snow(bounds%begc:bounds%endc,nband,-nlevsno:-1 ) ! block-diagonal matrix for snow layers real(r8) :: bmatrix_ssw(bounds%begc:bounds%endc,nband, 0:0 ) ! block-diagonal matrix for standing surface water - real(r8) :: bmatrix_soil(bounds%begc:bounds%endc,nband, 1:nlevgrnd) ! block-diagonal matrix for soil layers + real(r8) :: bmatrix_soil(bounds%begc:bounds%endc,nband, 1:nlevmaxurbgrnd) ! block-diagonal matrix for soil layers real(r8) :: bmatrix_snow_soil(bounds%begc:bounds%endc,nband,-1:-1) ! off-diagonal matrix for snow-soil interaction real(r8) :: bmatrix_ssw_soil(bounds%begc:bounds%endc,nband, 0:0 ) ! off-diagonal matrix for standing surface water-soil interaction real(r8) :: bmatrix_soil_snow(bounds%begc:bounds%endc,nband, 1:1 ) ! off-diagonal matrix for soil-snow interaction @@ -2261,12 +2285,12 @@ subroutine SetMatrix(bounds, num_nolakec, filter_nolakec, dtime, nband, & ! Enforce expected array sizes SHR_ASSERT_ALL_FL((ubound(dhsdT) == (/bounds%endc/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(tk) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(tk) == (/bounds%endc, nlevmaxurbgrnd/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(tk_h2osfc) == (/bounds%endc/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(fact) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(fact) == (/bounds%endc, nlevmaxurbgrnd/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(c_h2osfc) == (/bounds%endc/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(dz_h2osfc) == (/bounds%endc/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(bmatrix) == (/bounds%endc, nband, nlevgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(bmatrix) == (/bounds%endc, nband, nlevmaxurbgrnd/)), sourcefile, __LINE__) associate( & z => col%z , & ! Input: [real(r8) (:,:) ] layer thickness [m] @@ -2373,7 +2397,7 @@ subroutine AssembleMatrixFromSubmatrices(bounds, num_nolakec, filter_nolakec, nb ! !USES: use clm_varcon , only : cnfac use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb + use clm_varpar , only : nlevsno, nlevmaxurbgrnd ! ! !ARGUMENTS: implicit none @@ -2398,12 +2422,12 @@ subroutine AssembleMatrixFromSubmatrices(bounds, num_nolakec, filter_nolakec, nb ! Enforce expected array sizes SHR_ASSERT_ALL_FL((ubound(bmatrix_snow) == (/bounds%endc, nband, -1/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(bmatrix_ssw) == (/bounds%endc, nband, 0/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(bmatrix_soil) == (/bounds%endc, nband, nlevgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(bmatrix_soil) == (/bounds%endc, nband, nlevmaxurbgrnd/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(bmatrix_snow_soil) == (/bounds%endc, nband, -1/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(bmatrix_ssw_soil) == (/bounds%endc, nband, 0/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(bmatrix_soil_snow) == (/bounds%endc, nband, 1/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(bmatrix_soil_ssw) == (/bounds%endc, nband, 1/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(bmatrix) == (/bounds%endc, nband, nlevgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(bmatrix) == (/bounds%endc, nband, nlevmaxurbgrnd/)), sourcefile, __LINE__) ! Assemble the full matrix @@ -2427,8 +2451,8 @@ subroutine AssembleMatrixFromSubmatrices(bounds, num_nolakec, filter_nolakec, nb ! Soil bmatrix(c,2:3,1 ) = bmatrix_soil(c,2:3,1 ) - bmatrix(c,2:4,2:nlevgrnd-1) = bmatrix_soil(c,2:4,2:nlevgrnd-1) - bmatrix(c,3:4,nlevgrnd ) = bmatrix_soil(c,3:4,nlevgrnd ) + bmatrix(c,2:4,2:nlevmaxurbgrnd-1) = bmatrix_soil(c,2:4,2:nlevmaxurbgrnd-1) + bmatrix(c,3:4,nlevmaxurbgrnd ) = bmatrix_soil(c,3:4,nlevmaxurbgrnd ) ! Soil-Snow bmatrix(c,5,1) = bmatrix_soil_snow(c,5,1) @@ -2451,7 +2475,7 @@ subroutine SetMatrix_Snow(bounds, num_nolakec, filter_nolakec, nband, & use clm_varcon , only : cnfac use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall use column_varcon , only : icol_road_perv, icol_road_imperv - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb + use clm_varpar , only : nlevsno, nlevgrnd, nlevurb, nlevmaxurbgrnd ! ! !ARGUMENTS: implicit none @@ -2476,8 +2500,8 @@ subroutine SetMatrix_Snow(bounds, num_nolakec, filter_nolakec, nband, & ! Enforce expected array sizes SHR_ASSERT_ALL_FL((ubound(dhsdT) == (/bounds%endc/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(tk) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(fact) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(tk) == (/bounds%endc, nlevmaxurbgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(fact) == (/bounds%endc, nlevmaxurbgrnd/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(frac_sno_eff) == (/bounds%endc/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(bmatrix_snow) == (/bounds%endc, nband, -1/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(bmatrix_snow_soil) == (/bounds%endc, nband, -1/)), sourcefile, __LINE__) @@ -2548,7 +2572,7 @@ subroutine SetMatrix_Soil(bounds, num_nolakec, filter_nolakec, nband, & use clm_varcon , only : cnfac use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall use column_varcon , only : icol_road_perv, icol_road_imperv - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb + use clm_varpar , only : nlevsno, nlevgrnd, nlevurb, nlevmaxurbgrnd ! ! !ARGUMENTS: implicit none @@ -2576,13 +2600,13 @@ subroutine SetMatrix_Soil(bounds, num_nolakec, filter_nolakec, nband, & ! Enforce expected array sizes SHR_ASSERT_ALL_FL((ubound(dhsdT) == (/bounds%endc/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(tk) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(tk) == (/bounds%endc, nlevmaxurbgrnd/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(tk_h2osfc) == (/bounds%endc/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(dz_h2osfc) == (/bounds%endc/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(fact) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(fact) == (/bounds%endc, nlevmaxurbgrnd/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(frac_h2osfc) == (/bounds%endc/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(frac_sno_eff) == (/bounds%endc/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(bmatrix_soil) == (/bounds%endc, nband, nlevgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(bmatrix_soil) == (/bounds%endc, nband, nlevmaxurbgrnd/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(bmatrix_soil_snow) == (/bounds%endc, nband, 1/)), sourcefile, __LINE__) associate( & @@ -2714,7 +2738,7 @@ subroutine SetMatrix_StandingSurfaceWater(bounds, num_nolakec, filter_nolakec, d ! !USES: use clm_varcon , only : cnfac use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd + use clm_varpar , only : nlevsno, nlevmaxurbgrnd ! ! !ARGUMENTS: implicit none @@ -2742,9 +2766,9 @@ subroutine SetMatrix_StandingSurfaceWater(bounds, num_nolakec, filter_nolakec, d ! Enforce expected array sizes SHR_ASSERT_ALL_FL((ubound(dhsdT) == (/bounds%endc/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(tk) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(tk) == (/bounds%endc, nlevmaxurbgrnd/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(tk_h2osfc) == (/bounds%endc/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(fact) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(fact) == (/bounds%endc, nlevmaxurbgrnd/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(c_h2osfc) == (/bounds%endc/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(dz_h2osfc) == (/bounds%endc/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(frac_h2osfc) == (/bounds%endc/)), sourcefile, __LINE__) diff --git a/src/biogeophys/SoilWaterMovementMod.F90 b/src/biogeophys/SoilWaterMovementMod.F90 index 5b841390fe..65dafcefae 100644 --- a/src/biogeophys/SoilWaterMovementMod.F90 +++ b/src/biogeophys/SoilWaterMovementMod.F90 @@ -2210,42 +2210,20 @@ subroutine TridiagonalCol (ci, lbj, ubj, jtop, a, b, c, r, u) bet = b(jtop) do j = lbj, ubj - if ((col%itype(ci) == icol_sunwall .or. col%itype(ci) == icol_shadewall & - .or. col%itype(ci) == icol_roof) .and. j <= nlevurb) then - if (j >= jtop) then - if (j == jtop) then - u(j) = r(j) / bet - else - gam(j) = c(j-1) / bet - bet = b(j) - a(j) * gam(j) - u(j) = (r(j) - a(j)*u(j-1)) / bet - end if - end if - else if (col%itype(ci) /= icol_sunwall .and. col%itype(ci) /= icol_shadewall & - .and. col%itype(ci) /= icol_roof) then - if (j >= jtop) then - if (j == jtop) then - u(j) = r(j) / bet - else - gam(j) = c(j-1) / bet - bet = b(j) - a(j) * gam(j) - u(j) = (r(j) - a(j)*u(j-1)) / bet - end if + if (j >= jtop) then + if (j == jtop) then + u(j) = r(j) / bet + else + gam(j) = c(j-1) / bet + bet = b(j) - a(j) * gam(j) + u(j) = (r(j) - a(j)*u(j-1)) / bet end if end if end do do j = ubj-1,lbj,-1 - if ((col%itype(ci) == icol_sunwall .or. col%itype(ci) == icol_shadewall & - .or. col%itype(ci) == icol_roof) .and. j <= nlevurb-1) then - if (j >= jtop) then - u(j) = u(j) - gam(j+1) * u(j+1) - end if - else if (col%itype(ci) /= icol_sunwall .and. col%itype(ci) /= icol_shadewall & - .and. col%itype(ci) /= icol_roof) then - if (j >= jtop) then - u(j) = u(j) - gam(j+1) * u(j+1) - end if + if (j >= jtop) then + u(j) = u(j) - gam(j+1) * u(j+1) end if end do diff --git a/src/biogeophys/SoilWaterPlantSinkMod.F90 b/src/biogeophys/SoilWaterPlantSinkMod.F90 index 290ba8c164..115e1cab76 100644 --- a/src/biogeophys/SoilWaterPlantSinkMod.F90 +++ b/src/biogeophys/SoilWaterPlantSinkMod.F90 @@ -274,27 +274,30 @@ subroutine Compute_EffecRootFrac_And_VertTranSink_HydStress( bounds, & integer :: pi ! patch index real(r8) :: temp(bounds%begc:bounds%endc) ! accumulator for rootr weighting real(r8) :: grav2 ! soil layer gravitational potential relative to surface (mm H2O) + real(r8) :: patchflux ! patch level soil-to-plant water flux (mm/s) integer , parameter :: soil=1,root=4 ! index values !----------------------------------------------------------------------- associate(& - k_soil_root => soilstate_inst%k_soil_root_patch , & ! Input: [real(r8) (:,:) ] + k_soil_root => soilstate_inst%k_soil_root_patch , & ! Input: [real(r8) (:,:) ] ! soil-root interface conductance (mm/s) - qflx_phs_neg_col => waterfluxbulk_inst%qflx_phs_neg_col , & ! Input: [real(r8) (:) ] n - ! net neg hydraulic redistribution flux(mm H2O/s) - qflx_tran_veg_col => waterfluxbulk_inst%qflx_tran_veg_col , & ! Input: [real(r8) (:) ] + qflx_phs_neg_col => waterfluxbulk_inst%qflx_phs_neg_col , & ! Output: [real(r8) (:) ] + ! net neg hydraulic redistribution flux col (mm H2O/s) + qflx_hydr_redist_patch => waterfluxbulk_inst%qflx_hydr_redist_patch, & ! Output: [real(r8) (:) ] + ! net neg hydraulic redistribution flux patch (mm H2O/s) + qflx_tran_veg_col => waterfluxbulk_inst%qflx_tran_veg_col , & ! Input: [real(r8) (:) ] ! vegetation transpiration (mm H2O/s) (+ = to atm) - qflx_tran_veg_patch => waterfluxbulk_inst%qflx_tran_veg_patch , & ! Input: [real(r8) (:) ] + qflx_tran_veg_patch => waterfluxbulk_inst%qflx_tran_veg_patch , & ! Input: [real(r8) (:) ] ! vegetation transpiration (mm H2O/s) (+ = to atm) - qflx_rootsoi_col => waterfluxbulk_inst%qflx_rootsoi_col , & ! Output: [real(r8) (:) ] + qflx_rootsoi_col => waterfluxbulk_inst%qflx_rootsoi_col , & ! Output: [real(r8) (:) ] ! col root and soil water ! exchange [mm H2O/s] [+ into root] - smp => soilstate_inst%smp_l_col , & ! Input: [real(r8) (:,:) ] soil matrix pot. [mm] - frac_veg_nosno => canopystate_inst%frac_veg_nosno_patch , & ! Input: [integer (:) ] + smp => soilstate_inst%smp_l_col , & ! Input: [real(r8) (:,:) ] soil matrix pot. [mm] + frac_veg_nosno => canopystate_inst%frac_veg_nosno_patch , & ! Input: [integer (:) ] ! fraction of vegetation not ! covered by snow (0 OR 1) [-] - z => col%z , & ! Input: [real(r8) (:,:) ] layer node depth (m) - vegwp => canopystate_inst%vegwp_patch & ! Input: [real(r8) (:,:) ] vegetation water + z => col%z , & ! Input: [real(r8) (:,:) ] layer node depth (m) + vegwp => canopystate_inst%vegwp_patch & ! Input: [real(r8) (:,:) ] vegetation water ! matric potential (mm) ) @@ -308,10 +311,16 @@ subroutine Compute_EffecRootFrac_And_VertTranSink_HydStress( bounds, & do pi = 1,max_patch_per_col if (pi <= col%npatches(c)) then p = col%patchi(c) + pi - 1 + if (j == 1) then + qflx_hydr_redist_patch(p) = 0._r8 + end if if (patch%active(p).and.frac_veg_nosno(p)>0) then if (patch%wtcol(p) > 0._r8) then - temp(c) = temp(c) + k_soil_root(p,j) & - * (smp(c,j) - vegwp(p,4) - grav2)* patch%wtcol(p) + patchflux = k_soil_root(p,j) * (smp(c,j) - vegwp(p,4) - grav2) + if (patchflux <0) then + qflx_hydr_redist_patch(p) = qflx_hydr_redist_patch(p) + patchflux + end if + temp(c) = temp(c) + patchflux * patch%wtcol(p) endif end if end if diff --git a/src/biogeophys/SurfaceHumidityMod.F90 b/src/biogeophys/SurfaceHumidityMod.F90 index b412f39d63..425fd4c4cb 100644 --- a/src/biogeophys/SurfaceHumidityMod.F90 +++ b/src/biogeophys/SurfaceHumidityMod.F90 @@ -65,9 +65,7 @@ subroutine CalculateSurfaceHumidity(bounds, & integer :: fp ! lake filter patch index integer :: fc ! lake filter column index real(r8) :: qred ! soil surface relative humidity - real(r8) :: eg ! water vapor pressure at temperature T [pa] real(r8) :: qsatg ! saturated humidity [kg/kg] - real(r8) :: degdT ! d(eg)/dT real(r8) :: qsatgdT ! d(qsatg)/dT real(r8) :: qsatgdT_snow ! d(qsatg)/dT, for snow real(r8) :: qsatgdT_soil ! d(qsatg)/dT, for soil @@ -184,7 +182,8 @@ subroutine CalculateSurfaceHumidity(bounds, & ! compute humidities individually for snow, soil, h2osfc for vegetated landunits if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - call QSat(t_soisno(c,1) , forc_pbot(c), eg, degdT, qsatg, qsatgdT_soil) + call QSat(t_soisno(c,1), forc_pbot(c), qsatg, & + qsdT = qsatgdT_soil) if (qsatg > forc_q(c) .and. forc_q(c) > hr*qsatg) then qsatg = forc_q(c) qsatgdT_soil = 0._r8 @@ -192,7 +191,8 @@ subroutine CalculateSurfaceHumidity(bounds, & qg_soil(c) = hr*qsatg if (snl(c) < 0) then - call QSat(t_soisno(c,snl(c)+1), forc_pbot(c), eg, degdT, qsatg, qsatgdT_snow) + call QSat(t_soisno(c,snl(c)+1), forc_pbot(c), qsatg, & + qsdT = qsatgdT_snow) qg_snow(c) = qsatg dqgdT(c) = frac_sno_eff(c)*qsatgdT_snow + & (1._r8 - frac_sno_eff(c) - frac_h2osfc(c))*hr*qsatgdT_soil @@ -204,7 +204,8 @@ subroutine CalculateSurfaceHumidity(bounds, & endif if (frac_h2osfc(c) > 0._r8) then - call QSat(t_h2osfc(c), forc_pbot(c), eg, degdT, qsatg, qsatgdT_h2osfc) + call QSat(t_h2osfc(c), forc_pbot(c), qsatg, & + qsdT = qsatgdT_h2osfc) qg_h2osfc(c) = qsatg dqgdT(c) = dqgdT(c) + frac_h2osfc(c) * qsatgdT_h2osfc else @@ -215,7 +216,8 @@ subroutine CalculateSurfaceHumidity(bounds, & + frac_h2osfc(c) * qg_h2osfc(c) else - call QSat(t_grnd(c), forc_pbot(c), eg, degdT, qsatg, qsatgdT) + call QSat(t_grnd(c), forc_pbot(c), qsatg, & + qsdT = qsatgdT) qg(c) = qred*qsatg dqgdT(c) = qred*qsatgdT diff --git a/src/biogeophys/SurfaceWaterMod.F90 b/src/biogeophys/SurfaceWaterMod.F90 index 069e14d393..768e9a8445 100644 --- a/src/biogeophys/SurfaceWaterMod.F90 +++ b/src/biogeophys/SurfaceWaterMod.F90 @@ -10,7 +10,7 @@ module SurfaceWaterMod use shr_const_mod , only : shr_const_pi use shr_spfn_mod , only : erf => shr_spfn_erf use clm_varcon , only : denh2o, denice, roverg, tfrz, pc, mu, rpi - use clm_varpar , only : nlevsno, nlevgrnd + use clm_varpar , only : nlevsno, nlevmaxurbgrnd use clm_time_manager , only : get_step_size_real use column_varcon , only : icol_roof, icol_road_imperv, icol_sunwall, icol_shadewall, icol_road_perv use decompMod , only : bounds_type @@ -293,7 +293,7 @@ subroutine UpdateState_TooSmallH2osfcToSoil(bounds, num_soilc, filter_soilc, & SHR_ASSERT_FL((ubound(qflx_too_small_h2osfc_to_soil, 1) == bounds%endc), sourcefile, __LINE__) SHR_ASSERT_FL((ubound(h2osfc, 1) == bounds%endc), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(h2osoi_liq) == [bounds%endc, nlevgrnd]), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(h2osoi_liq) == [bounds%endc, nlevmaxurbgrnd]), sourcefile, __LINE__) do fc = 1, num_soilc c = filter_soilc(fc) diff --git a/src/biogeophys/TemperatureType.F90 b/src/biogeophys/TemperatureType.F90 index 5c69733f8a..bb25b2bd53 100644 --- a/src/biogeophys/TemperatureType.F90 +++ b/src/biogeophys/TemperatureType.F90 @@ -8,7 +8,7 @@ module TemperatureType use decompMod , only : bounds_type use abortutils , only : endrun use clm_varctl , only : use_cndv, iulog, use_luna, use_crop - use clm_varpar , only : nlevsno, nlevgrnd, nlevlak, nlevlak, nlevurb + use clm_varpar , only : nlevsno, nlevgrnd, nlevlak, nlevlak, nlevurb, nlevmaxurbgrnd use clm_varcon , only : spval, ispval use GridcellType , only : grc use LandunitType , only : lun @@ -116,7 +116,7 @@ module TemperatureType real(r8), pointer :: xmf_h2osfc_col (:) ! latent heat of phase change of surface water real(r8), pointer :: fact_col (:,:) ! used in computing tridiagonal matrix real(r8), pointer :: c_h2osfc_col (:) ! heat capacity of surface water - + contains procedure, public :: Init @@ -204,8 +204,8 @@ subroutine InitAllocate(this, bounds) endif allocate(this%t_h2osfc_col (begc:endc)) ; this%t_h2osfc_col (:) = nan allocate(this%t_h2osfc_bef_col (begc:endc)) ; this%t_h2osfc_bef_col (:) = nan - allocate(this%t_ssbef_col (begc:endc,-nlevsno+1:nlevgrnd)) ; this%t_ssbef_col (:,:) = nan - allocate(this%t_soisno_col (begc:endc,-nlevsno+1:nlevgrnd)) ; this%t_soisno_col (:,:) = nan + allocate(this%t_ssbef_col (begc:endc,-nlevsno+1:nlevmaxurbgrnd)) ; this%t_ssbef_col (:,:) = nan + allocate(this%t_soisno_col (begc:endc,-nlevsno+1:nlevmaxurbgrnd)) ; this%t_soisno_col (:,:) = nan allocate(this%t_lake_col (begc:endc,1:nlevlak)) ; this%t_lake_col (:,:) = nan allocate(this%t_grnd_col (begc:endc)) ; this%t_grnd_col (:) = nan allocate(this%t_grnd_r_col (begc:endc)) ; this%t_grnd_r_col (:) = nan @@ -268,7 +268,7 @@ subroutine InitAllocate(this, bounds) allocate(this%liquid_water_temp2_grc (begg:endg)) ; this%liquid_water_temp2_grc (:) = nan ! flags - allocate(this%imelt_col (begc:endc,-nlevsno+1:nlevgrnd)) ; this%imelt_col (:,:) = huge(1) + allocate(this%imelt_col (begc:endc,-nlevsno+1:nlevmaxurbgrnd)) ; this%imelt_col (:,:) = huge(1) ! emissivities allocate(this%emv_patch (begp:endp)) ; this%emv_patch (:) = nan @@ -276,7 +276,7 @@ subroutine InitAllocate(this, bounds) allocate(this%xmf_col (begc:endc)) ; this%xmf_col (:) = nan allocate(this%xmf_h2osfc_col (begc:endc)) ; this%xmf_h2osfc_col (:) = nan - allocate(this%fact_col (begc:endc, -nlevsno+1:nlevgrnd)) ; this%fact_col (:,:) = nan + allocate(this%fact_col (begc:endc, -nlevsno+1:nlevmaxurbgrnd)) ; this%fact_col (:,:) = nan allocate(this%c_h2osfc_col (begc:endc)) ; this%c_h2osfc_col (:) = nan end subroutine InitAllocate @@ -620,7 +620,6 @@ subroutine InitHistory(this, bounds, is_simple_buildtemp, is_prog_buildtemp ) ptr_patch=this%t_veg10_night_patch, default='inactive') endif - end subroutine InitHistory !----------------------------------------------------------------------- @@ -672,7 +671,7 @@ subroutine InitCold(this, bounds, & do c = bounds%begc,bounds%endc l = col%landunit(c) - this%t_soisno_col(c,-nlevsno+1:nlevgrnd) = spval + this%t_soisno_col(c,-nlevsno+1:nlevmaxurbgrnd) = spval ! Snow level temperatures - all land points if (snl(c) < 0) then diff --git a/src/biogeophys/TotalWaterAndHeatMod.F90 b/src/biogeophys/TotalWaterAndHeatMod.F90 index 9488eedc70..ffce06b552 100644 --- a/src/biogeophys/TotalWaterAndHeatMod.F90 +++ b/src/biogeophys/TotalWaterAndHeatMod.F90 @@ -8,8 +8,8 @@ module TotalWaterAndHeatMod #include "shr_assert.h" use shr_kind_mod , only : r8 => shr_kind_r8 use decompMod , only : bounds_type - use clm_varcon , only : cpice, cpliq, denh2o, tfrz, hfus - use clm_varpar , only : nlevgrnd, nlevsoi, nlevurb + use clm_varcon , only : cpice, cpliq, denh2o, denice, tfrz, hfus + use clm_varpar , only : nlevgrnd, nlevsoi, nlevurb, nlevlak, nlevmaxurbgrnd use ColumnType , only : col use LandunitType , only : lun use subgridAveMod , only : p2c @@ -21,6 +21,7 @@ module TotalWaterAndHeatMod use UrbanParamsType , only : urbanparams_type use SoilStateType , only : soilstate_type use TemperatureType , only : temperature_type + use LakeStateType , only : lakestate_type use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall use column_varcon , only : icol_road_perv, icol_road_imperv use landunit_varcon , only : istdlak, istsoil,istcrop,istwet,istice_mec @@ -38,12 +39,14 @@ module TotalWaterAndHeatMod ! routines parallel with the water routines. public :: ComputeWaterMassNonLake ! Compute total water mass of non-lake columns public :: ComputeWaterMassLake ! Compute total water mass of lake columns + public :: AccumulateLiqIceMassLake ! Accumulate lake water mass of lake columns, separated into liquid and ice public :: ComputeLiqIceMassNonLake ! Compute total water mass of non-lake columns, separated into liquid and ice public :: AccumulateSoilLiqIceMassNonLake ! Accumulate soil water mass of non-lake columns, separated into liquid and ice public :: ComputeLiqIceMassLake ! Compute total water mass of lake columns, separated into liquid and ice public :: ComputeHeatNonLake ! Compute heat content of non-lake columns public :: AccumulateSoilHeatNonLake ! Accumulate soil heat content of non-lake columns public :: ComputeHeatLake ! Compute heat content of lake columns + public :: AccumulateHeatLake ! Accumulate heat content of lake water of lake columns public :: AdjustDeltaHeatForDeltaLiq ! Adjusts the change in gridcell heat content due to land cover change to account for the implicit heat flux associated with delta_liq public :: LiquidWaterHeat ! Get the total heat content of some mass of liquid water at a given temperature @@ -104,8 +107,8 @@ subroutine ComputeWaterMassNonLake(bounds, num_nolakec, filter_nolakec, & class(waterstate_type) , intent(in) :: waterstate_inst class(waterdiagnostic_type), intent(in) :: waterdiagnostic_inst - ! BUG(wjs, 2019-03-12, ESCOMP/ctsm#659) When we can accept answer changes to methane, - ! remove this argument, always assuming it's true. + ! BUG(wjs, 2019-03-12, ESCOMP/ctsm#659) When https://github.com/ESCOMP/CTSM/issues/658 + ! is resolved, remove this argument, always assuming it's true. logical, intent(in) :: subtract_dynbal_baselines ! whether to subtract dynbal_baseline_liq and dynbal_baseline_ice from liquid_mass and ice_mass real(r8) , intent(inout) :: water_mass( bounds%begc: ) ! computed water mass (kg m-2) @@ -139,8 +142,8 @@ end subroutine ComputeWaterMassNonLake !----------------------------------------------------------------------- subroutine ComputeWaterMassLake(bounds, num_lakec, filter_lakec, & - waterstate_inst, & - subtract_dynbal_baselines, & + waterstate_inst, lakestate_inst, & + add_lake_water_and_subtract_dynbal_baselines, & water_mass) ! ! !DESCRIPTION: @@ -154,10 +157,14 @@ subroutine ComputeWaterMassLake(bounds, num_lakec, filter_lakec, & integer , intent(in) :: num_lakec ! number of column lake points in column filter integer , intent(in) :: filter_lakec(:) ! column filter for lake points class(waterstate_type) , intent(in) :: waterstate_inst + type(lakestate_type) , intent(in) :: lakestate_inst - ! BUG(wjs, 2019-03-12, ESCOMP/ctsm#659) When we can accept answer changes to methane, - ! remove this argument, always assuming it's true. - logical, intent(in) :: subtract_dynbal_baselines ! whether to subtract dynbal_baseline_liq and dynbal_baseline_ice from liquid_mass and ice_mass + ! Whether to (1) add lake water/ice to total accounting, and (2) subtract + ! dynbal_baseline_liq and dynbal_baseline_ice from liquid_mass and ice_mass + ! + ! BUG(wjs, 2019-03-12, ESCOMP/ctsm#659) When https://github.com/ESCOMP/CTSM/issues/658 + ! is resolved, remove this argument, always assuming it's true. + logical, intent(in) :: add_lake_water_and_subtract_dynbal_baselines real(r8) , intent(inout) :: water_mass( bounds%begc: ) ! computed water mass (kg m-2) ! @@ -176,7 +183,8 @@ subroutine ComputeWaterMassLake(bounds, num_lakec, filter_lakec, & num_lakec = num_lakec, & filter_lakec = filter_lakec, & waterstate_inst = waterstate_inst, & - subtract_dynbal_baselines = subtract_dynbal_baselines, & + lakestate_inst = lakestate_inst, & + add_lake_water_and_subtract_dynbal_baselines = add_lake_water_and_subtract_dynbal_baselines, & liquid_mass = liquid_mass(bounds%begc:bounds%endc), & ice_mass = ice_mass(bounds%begc:bounds%endc)) @@ -210,8 +218,8 @@ subroutine ComputeLiqIceMassNonLake(bounds, num_nolakec, filter_nolakec, & class(waterstate_type) , intent(in) :: waterstate_inst class(waterdiagnostic_type), intent(in) :: waterdiagnostic_inst - ! BUG(wjs, 2019-03-12, ESCOMP/ctsm#659) When we can accept answer changes to methane, - ! remove this argument, always assuming it's true. + ! BUG(wjs, 2019-03-12, ESCOMP/ctsm#659) When https://github.com/ESCOMP/CTSM/issues/658 + ! is resolved, remove this argument, always assuming it's true. logical, intent(in) :: subtract_dynbal_baselines ! whether to subtract dynbal_baseline_liq and dynbal_baseline_ice from liquid_mass and ice_mass real(r8) , intent(inout) :: liquid_mass( bounds%begc: ) ! computed liquid water mass (kg m-2) @@ -353,7 +361,7 @@ subroutine AccumulateSoilLiqIceMassNonLake(bounds, num_c, filter_c, & h2osoi_liq => waterstate_inst%h2osoi_liq_col & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) ) - do j = 1, nlevgrnd + do j = 1, nlevmaxurbgrnd do fc = 1, num_c c = filter_c(fc) if (col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall) then @@ -365,7 +373,11 @@ subroutine AccumulateSoilLiqIceMassNonLake(bounds, num_c, filter_c, & has_h2o = .false. end if else - has_h2o = .true. + if (j <= nlevgrnd) then + has_h2o = .true. + else + has_h2o = .false. + end if end if if (has_h2o) then @@ -382,8 +394,8 @@ end subroutine AccumulateSoilLiqIceMassNonLake !----------------------------------------------------------------------- subroutine ComputeLiqIceMassLake(bounds, num_lakec, filter_lakec, & - waterstate_inst, & - subtract_dynbal_baselines, & + waterstate_inst, lakestate_inst, & + add_lake_water_and_subtract_dynbal_baselines, & liquid_mass, ice_mass) ! ! !DESCRIPTION: @@ -400,17 +412,21 @@ subroutine ComputeLiqIceMassLake(bounds, num_lakec, filter_lakec, & integer , intent(in) :: num_lakec ! number of column lake points in column filter integer , intent(in) :: filter_lakec(:) ! column filter for lake points class(waterstate_type), intent(in) :: waterstate_inst + type(lakestate_type) , intent(in) :: lakestate_inst - ! BUG(wjs, 2019-03-12, ESCOMP/ctsm#659) When we can accept answer changes to methane, - ! remove this argument, always assuming it's true. - logical, intent(in) :: subtract_dynbal_baselines ! whether to subtract dynbal_baseline_liq and dynbal_baseline_ice from liquid_mass and ice_mass + ! Whether to (1) add lake water/ice to total accounting, and (2) subtract + ! dynbal_baseline_liq and dynbal_baseline_ice from liquid_mass and ice_mass + ! + ! BUG(wjs, 2019-03-12, ESCOMP/ctsm#659) When https://github.com/ESCOMP/CTSM/issues/658 + ! is resolved, remove this argument, always assuming it's true. + logical, intent(in) :: add_lake_water_and_subtract_dynbal_baselines real(r8) , intent(inout) :: liquid_mass( bounds%begc: ) ! computed liquid water mass (kg m-2) real(r8) , intent(inout) :: ice_mass( bounds%begc: ) ! computed ice mass (kg m-2) ! ! !LOCAL VARIABLES: - integer :: c, j, fc ! indices - + integer :: c, j, fc ! indices + character(len=*), parameter :: subname = 'ComputeLiqIceMassLake' !----------------------------------------------------------------------- @@ -419,10 +435,9 @@ subroutine ComputeLiqIceMassLake(bounds, num_lakec, filter_lakec, & associate( & snl => col%snl , & ! Input: [integer (:) ] negative number of snow layers - h2osno_no_layers => waterstate_inst%h2osno_no_layers_col , & ! Input: [real(r8) (:) ] snow water that is not resolved into layers (mm H2O) h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice lens (kg/m2) - h2osoi_liq => waterstate_inst%h2osoi_liq_col, & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) + h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) dynbal_baseline_liq => waterstate_inst%dynbal_baseline_liq_col, & ! Input: [real(r8) (:) ] baseline liquid water content subtracted from each column's total liquid water calculation (mm H2O) dynbal_baseline_ice => waterstate_inst%dynbal_baseline_ice_col & ! Input: [real(r8) (:) ] baseline ice content subtracted from each column's total ice calculation (mm H2O) ) @@ -433,6 +448,34 @@ subroutine ComputeLiqIceMassLake(bounds, num_lakec, filter_lakec, & ice_mass(c) = 0._r8 end do + ! ------------------------------------------------------------------------ + ! Start with some large terms that will often cancel (the negative baselines and the + ! lake water content): In order to maintain precision in the other terms, it can help if + ! we deal with these large, often-canceling terms first. (If we accumulated some + ! small terms, then added a big term and then subtracted a big term, we would have + ! lost some precision in the small terms.) + ! ------------------------------------------------------------------------ + + if (add_lake_water_and_subtract_dynbal_baselines) then + ! Subtract baselines set in initialization + do fc = 1, num_lakec + c = filter_lakec(fc) + liquid_mass(c) = liquid_mass(c) - dynbal_baseline_liq(c) + ice_mass(c) = ice_mass(c) - dynbal_baseline_ice(c) + end do + + ! Lake water content + call AccumulateLiqIceMassLake(bounds, num_lakec, filter_lakec, & + lakestate_inst, & + tracer_ratio = waterstate_inst%info%get_ratio(), & + liquid_mass = liquid_mass(bounds%begc:bounds%endc), & + ice_mass = ice_mass(bounds%begc:bounds%endc)) + end if + + ! ------------------------------------------------------------------------ + ! Now add some other terms + ! ------------------------------------------------------------------------ + ! Snow water content do fc = 1, num_lakec c = filter_lakec(fc) @@ -453,19 +496,70 @@ subroutine ComputeLiqIceMassLake(bounds, num_lakec, filter_lakec, & end do end do - if (subtract_dynbal_baselines) then - ! Subtract baselines set in initialization - do fc = 1, num_lakec - c = filter_lakec(fc) - liquid_mass(c) = liquid_mass(c) - dynbal_baseline_liq(c) - ice_mass(c) = ice_mass(c) - dynbal_baseline_ice(c) - end do - end if - end associate end subroutine ComputeLiqIceMassLake + !----------------------------------------------------------------------- + subroutine AccumulateLiqIceMassLake(bounds, num_c, filter_c, & + lakestate_inst, tracer_ratio, liquid_mass, ice_mass) + ! + ! !DESCRIPTION: + ! Accumulate lake water mass of lake columns, separated into liquid and ice. + ! + ! Adds to any existing values in liquid_mass and ice_mass. + ! + ! Note: Changes to this routine should generally be accompanied by similar changes to + ! AccumulateHeatLake + ! + ! !ARGUMENTS: + type(bounds_type) , intent(in) :: bounds + integer , intent(in) :: num_c ! number of column points in column filter (should not include lake points; can be a subset of the no-lake filter) + integer , intent(in) :: filter_c(:) ! column filter (should not include lake points; can be a subset of the no-lake filter) + type(lakestate_type) , intent(in) :: lakestate_inst + real(r8) , intent(in) :: tracer_ratio ! for water tracers, standard ratio of this tracer to bulk water (1 for bulk water) + real(r8) , intent(inout) :: liquid_mass( bounds%begc: ) ! accumulated liquid mass (kg m-2) + real(r8) , intent(inout) :: ice_mass( bounds%begc: ) ! accumulated ice mass (kg m-2) + ! + ! !LOCAL VARIABLES: + integer :: c, j, fc ! indices + real(r8) :: h2olak_liq ! liquid water content of lake layer [kg/m²] + real(r8) :: h2olak_ice ! ice water content of lake layer [kg/m²] + + character(len=*), parameter :: subname = 'AccumulateLiqIceMassLake' + !----------------------------------------------------------------------- + + SHR_ASSERT_ALL_FL((ubound(liquid_mass) == (/bounds%endc/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(ice_mass) == (/bounds%endc/)), sourcefile, __LINE__) + + associate( & + lake_icefrac => lakestate_inst%lake_icefrac_col, & ! Input: [real(r8) (:,:) ] lake ice fraction + dz_lake => col%dz_lake & ! Input: [real(r8) (:,:) ] lake depth (m) + ) + + ! Lake water content + do j = 1, nlevlak + do fc = 1, num_c + c = filter_c(fc) + ! Lake water volume isn't tracked explicitly, so we calculate it from lake + ! depth. Because it isn't tracked explicitly, we also don't have any water + ! tracer information, so we assume a fixed, standard tracer ratio. + h2olak_liq = dz_lake(c,j) * denh2o * (1 - lake_icefrac(c,j)) * tracer_ratio + + ! use water density rather than ice density because lake layer depths are not + ! adjusted when the layer freezes + h2olak_ice = dz_lake(c,j) * denh2o * lake_icefrac(c,j) * tracer_ratio + + liquid_mass(c) = liquid_mass(c) + h2olak_liq + ice_mass(c) = ice_mass(c) + h2olak_ice + end do + end do + + end associate + + end subroutine AccumulateLiqIceMassLake + + !----------------------------------------------------------------------- subroutine ComputeHeatNonLake(bounds, num_nolakec, filter_nolakec, & urbanparams_inst, soilstate_inst, & @@ -662,6 +756,11 @@ subroutine ComputeHeatNonLake(bounds, num_nolakec, filter_nolakec, & ! trying to account for the temperature of these baselines at all. This amounts to ! assuming that the baselines that we add / subtract are at the average temperature ! of the real liquid water in the column. + + ! This is different for lakes: there the virtual lake water's temperature is excluded + ! to avoid having it dominating the average temperature calculation + ! see note at top of the AccumulateHeatLake subroutine. + do fc = 1, num_nolakec c = filter_nolakec(fc) heat(c) = heat(c) - dynbal_baseline_heat(c) @@ -737,7 +836,7 @@ subroutine AccumulateSoilHeatNonLake(bounds, num_c, filter_c, & soil_latent_heat_liquid(c) = 0._r8 end do - do j = 1, nlevgrnd + do j = 1, nlevmaxurbgrnd do fc = 1, num_c c = filter_c(fc) l = col%landunit(c) @@ -759,16 +858,20 @@ subroutine AccumulateSoilHeatNonLake(bounds, num_c, filter_c, & end if else - has_h2o = .true. + if (j <= nlevgrnd) then + has_h2o = .true. - if (col%itype(c) == icol_road_imperv .and. j <= nlev_improad(l)) then - soil_heat_dry_mass(c) = soil_heat_dry_mass(c) + & - TempToHeat(temp = t_soisno(c,j), cv = (cv_improad(l,j) * dz(c,j))) - else if (lun%itype(l) /= istwet .and. lun%itype(l) /= istice_mec) then - ! Note that this also includes impervious roads below nlev_improad (where - ! we have soil) - soil_heat_dry_mass(c) = soil_heat_dry_mass(c) + & - TempToHeat(temp = t_soisno(c,j), cv = (csol(c,j)*(1-watsat(c,j))*dz(c,j))) + if (col%itype(c) == icol_road_imperv .and. j <= nlev_improad(l)) then + soil_heat_dry_mass(c) = soil_heat_dry_mass(c) + & + TempToHeat(temp = t_soisno(c,j), cv = (cv_improad(l,j) * dz(c,j))) + else if (lun%itype(l) /= istwet .and. lun%itype(l) /= istice_mec) then + ! Note that this also includes impervious roads below nlev_improad (where + ! we have soil) + soil_heat_dry_mass(c) = soil_heat_dry_mass(c) + & + TempToHeat(temp = t_soisno(c,j), cv = (csol(c,j)*(1-watsat(c,j))*dz(c,j))) + end if + else + has_h2o = .false. end if end if @@ -799,7 +902,7 @@ end subroutine AccumulateSoilHeatNonLake !----------------------------------------------------------------------- subroutine ComputeHeatLake(bounds, num_lakec, filter_lakec, & - soilstate_inst, temperature_inst, waterstatebulk_inst, & + soilstate_inst, temperature_inst, waterstatebulk_inst, lakestate_inst, & heat, heat_liquid, cv_liquid) ! ! !DESCRIPTION: @@ -820,10 +923,13 @@ subroutine ComputeHeatLake(bounds, num_lakec, filter_lakec, & type(soilstate_type) , intent(in) :: soilstate_inst type(temperature_type) , intent(in) :: temperature_inst type(waterstatebulk_type) , intent(in) :: waterstatebulk_inst + type(lakestate_type) , intent(in) :: lakestate_inst + real(r8) , intent(inout) :: heat( bounds%begc: ) ! sum of heat content for all columns [J/m^2] real(r8) , intent(inout) :: heat_liquid( bounds%begc: ) ! sum of heat content for all columns: liquid water, excluding latent heat [J/m^2] real(r8) , intent(inout) :: cv_liquid( bounds%begc: ) ! sum of liquid heat capacity for all columns [J/(m^2 K)] + ! ! !LOCAL VARIABLES: integer :: fc @@ -848,7 +954,7 @@ subroutine ComputeHeatLake(bounds, num_lakec, filter_lakec, & t_soisno => temperature_inst%t_soisno_col, & ! soil temperature (Kelvin) dynbal_baseline_heat => temperature_inst%dynbal_baseline_heat_col, & ! Input: [real(r8) (:) ] baseline heat content subtracted from each column's total heat calculation (J/m2) h2osoi_liq => waterstatebulk_inst%h2osoi_liq_col, & ! liquid water (kg/m2) - h2osoi_ice => waterstatebulk_inst%h2osoi_ice_col & ! frozen water (kg/m2) + h2osoi_ice => waterstatebulk_inst%h2osoi_ice_col & ! frozen water (kg/m2) ) do fc = 1, num_lakec @@ -861,6 +967,42 @@ subroutine ComputeHeatLake(bounds, num_lakec, filter_lakec, & latent_heat_liquid(c) = 0._r8 end do + ! ------------------------------------------------------------------------ + ! Start with some large terms that will often cancel (the negative baselines and the + ! lake water content): In order to maintain precision in the other terms, it can help if + ! we deal with these large, often-canceling terms first. (If we accumulated some + ! small terms, then added a big term and then subtracted a big term, we would have + ! lost some precision in the small terms.) + ! ------------------------------------------------------------------------ + + ! Subtract baselines set in initialization + ! + ! NOTE(wjs, 2019-03-01) I haven't given enough thought to how (if at all) we should + ! correct for heat_liquid and cv_liquid, which are used to determine the weighted + ! average liquid water temperature. For example, if we're subtracting out a baseline + ! water amount because a particular water state is fictitious, we probably shouldn't + ! include that particular state when determining the weighted average temperature of + ! liquid water. And conversely, if we're adding a state via these baselines, should + ! we also add some water temperature of that state? The tricky thing here is what to + ! do when we end up subtracting water due to the baselines, so for now I'm simply not + ! trying to account for the temperature of these baselines at all. This amounts to + ! assuming that the baselines that we add / subtract are at the average temperature + ! of the real liquid water in the column. + do fc = 1, num_lakec + c = filter_lakec(fc) + heat(c) = -dynbal_baseline_heat(c) + end do + + ! Lake water heat content + ! Note that we do NOT accumulate heat_liquid and cv_liquid in this call. See the + ! comments at the top of AccumulateHeatLake for rationale. + call AccumulateHeatLake(bounds, num_lakec, filter_lakec, temperature_inst, lakestate_inst, & + heat) + + ! ------------------------------------------------------------------------ + ! Now add some other terms + ! ------------------------------------------------------------------------ + ! Snow heat content do fc = 1, num_lakec c = filter_lakec(fc) @@ -881,7 +1023,7 @@ subroutine ComputeHeatLake(bounds, num_lakec, filter_lakec, & end do end do - ! Soil water content of the soil under the lake + ! Soil heat content of the soil under the lake do j = 1,nlevgrnd do fc = 1, num_lakec c = filter_lakec(fc) @@ -898,37 +1040,116 @@ subroutine ComputeHeatLake(bounds, num_lakec, filter_lakec, & TempToHeat(temp = t_soisno(c,j), cv = (h2osoi_ice(c,j)*cpice)) end do end do - - ! TODO(wjs, 2017-03-11) Include heat content of water in lakes, once we include - ! lake water as an explicit water state (https://github.com/ESCOMP/ctsm/issues/200) - + do fc = 1, num_lakec c = filter_lakec(fc) - heat(c) = heat_dry_mass(c) + heat_ice(c) + heat_liquid(c) + latent_heat_liquid(c) + heat(c) = heat(c) + heat_dry_mass(c) + heat_ice(c) + heat_liquid(c) + latent_heat_liquid(c) end do + + end associate - ! Subtract baselines set in initialization + end subroutine ComputeHeatLake + + !----------------------------------------------------------------------- + subroutine AccumulateHeatLake(bounds, num_c, filter_c, & + temperature_inst, lakestate_inst, & + heat) ! - ! NOTE(wjs, 2019-03-01) I haven't given enough thought to how (if at all) we should - ! correct for heat_liquid and cv_liquid, which are used to determine the weighted - ! average liquid water temperature. For example, if we're subtracting out a baseline - ! water amount because a particular water state is fictitious, we probably shouldn't - ! include that particular state when determining the weighted average temperature of - ! liquid water. And conversely, if we're adding a state via these baselines, should - ! we also add some water temperature of that state? The tricky thing here is what to - ! do when we end up subtracting water due to the baselines, so for now I'm simply not - ! trying to account for the temperature of these baselines at all. This amounts to - ! assuming that the baselines that we add / subtract are at the average temperature - ! of the real liquid water in the column. - do fc = 1, num_lakec - c = filter_lakec(fc) - heat(c) = heat(c) - dynbal_baseline_heat(c) + ! !DESCRIPTION: + ! Accumulate heat of lake water in lake columns. + ! + ! This subroutine differs from AccumulateSoilHeatNonLake in the sense that for lake heat + ! the average heat_liquid and cv_liquid are not accumulated. This is because these + ! terms are currently only used to calculate the implicit temperature of the dynbal liquid flux. + ! Because the lake water is virtual (there will never be a change in lake water content, + ! it should not be taken into the average column temperature when adjusting the change in + ! heat content of the grid cell for the change in water content. + ! Now, for lake grid cells, this is only done for the water content of the + ! soil under the lake and the snow on the lake. Since the virtual lake water doesn't generally + ! contribute to the dynbal liquid flux, its temperature shouldn't contribute + ! to the implicit temperature of the dynbal liquid flux. (If we allowed it + ! to contribute, the lake's temperature could dominate the average temperature calculation, + ! since there is so much lake water relative to other water in the grid cell.) + ! + ! We are adopting a different approach in the lake and non-lake columns. + ! For the choices made in a non-lake column, see comment at bottom of ComputeHeatNonLake subroutine + ! + ! Some minor concerns with this approach: + ! In some cases, lake water can have some changes in water content in time, + ! when experiencing phase changes: If a lake was completely liquid in initialization, + ! but then partially froze and then grew / shrank, some dynbal fluxes would be generated: + ! equal and opposite dynbal liquid and ice terms. In this case, it would be appropriate to + ! take the lake temperature along in determining the total heat which is corrected for delta liq. + + ! !ARGUMENTS: + type(bounds_type) , intent(in) :: bounds + integer , intent(in) :: num_c ! number of column points in column filter (should not include lake points; can be a subset of the no-lake filter) + integer , intent(in) :: filter_c(:) ! column filter (should not include lake points; can be a subset of the no-lake filter) + type(temperature_type) , intent(in) :: temperature_inst + type(lakestate_type) , intent(in) :: lakestate_inst + real(r8) , intent(inout) :: heat( bounds%begc: ) ! accumulated heat content [J/m^2] + + ! !LOCAL VARIABLES: + integer :: fc + integer :: l, c, j + real(r8) :: h2olak_liq ! liquid water content of lake layer [kg/m²] + real(r8) :: h2olak_ice ! ice water content of lake layer [kg/m²] + real(r8) :: lake_heat_liquid(bounds%begc:bounds%endc) ! sum of heat content: liquid water in lake, excluding latent heat [J/m^2] + real(r8) :: lake_heat_ice(bounds%begc:bounds%endc) ! sum of heat content: ice in lake [J/m^2] + real(r8) :: lake_latent_heat_liquid(bounds%begc:bounds%endc) ! sum of heat content: latent heat of liquid water in lake [J/m^2] + + character(len=*), parameter :: subname = 'AccumulateHeatLake' + !----------------------------------------------------------------------- + + SHR_ASSERT_ALL_FL((ubound(heat) == (/bounds%endc/)), sourcefile, __LINE__) + + + associate( & + dz_lake => col%dz_lake, & ! lake layer depth (m) + t_lake => temperature_inst%t_lake_col, & ! lake temperature (K) + lake_icefrac => lakestate_inst%lake_icefrac_col & ! Input: [real(r8) (:,:) ] lake ice fraction + ) + + do fc = 1, num_c + c = filter_c(fc) + + lake_heat_liquid(c) = 0._r8 + lake_heat_ice(c) = 0._r8 + lake_latent_heat_liquid(c) = 0._r8 + end do + + + ! calculate heat content of lake itself + do j = 1, nlevlak + do fc = 1, num_c + c = filter_c(fc) + ! liquid heat + h2olak_liq = dz_lake(c,j) * denh2o * (1 - lake_icefrac(c,j)) + call AccumulateLiquidWaterHeat( & + temp = t_lake(c,j), & + h2o = h2olak_liq, & + heat_liquid = lake_heat_liquid(c), & + latent_heat_liquid = lake_latent_heat_liquid(c)) + ! ice heat + ! use water density rather than ice density because lake layer depths are not + ! adjusted when the layer freezes + h2olak_ice = dz_lake(c,j) * denh2o * lake_icefrac(c,j) + lake_heat_ice(c) = lake_heat_ice(c) + & + TempToHeat(temp=t_lake(c,j), cv = (h2olak_ice * cpice)) + end do + end do + + ! add ice heat and liquid heat together + do fc = 1, num_c + c = filter_c(fc) + heat(c) = heat(c) + (lake_heat_ice(c) + & + lake_heat_liquid(c) + lake_latent_heat_liquid(c)) end do end associate - end subroutine ComputeHeatLake - + end subroutine AccumulateHeatLake + !----------------------------------------------------------------------- subroutine AdjustDeltaHeatForDeltaLiq(bounds, delta_liq, & liquid_water_temp1, liquid_water_temp2, & @@ -955,10 +1176,16 @@ subroutine AdjustDeltaHeatForDeltaLiq(bounds, delta_liq, & ! ice runoff is at heat_base_temp (which is reasonable as long as heat_base_temp = ! tfrz). ! + ! With dynamical lakes, the adjusted delta_heat does not account for the added lake + ! water content due to growing lakes. This is because lake depth is constant, the + ! total lake water content (kg/m^2) does not change. The change in water content of + ! the snow and soil in the lake column are accounted for. + ! ! Eventually, if we begin to explicitly account for the temperature / heat content of ! liquid and ice runoff in CLM, then this routine should be reworked to use the true ! heat contents of both liquid and ice runoff. ! + ! ! Sign convention: delta_liq and delta_heat are positive if the post-landcover change ! value is greater than the pre-landcover change value. ! diff --git a/src/biogeophys/TridiagonalMod.F90 b/src/biogeophys/TridiagonalMod.F90 index d6a50a3beb..46532b0d8b 100644 --- a/src/biogeophys/TridiagonalMod.F90 +++ b/src/biogeophys/TridiagonalMod.F90 @@ -27,8 +27,6 @@ subroutine Tridiagonal (bounds, lbj, ubj, jtop, numf, filter, a, b, c, r, u) ! ! !USES: use shr_kind_mod , only : r8 => shr_kind_r8 - use clm_varpar , only : nlevurb - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall use clm_varctl , only : iulog use decompMod , only : bounds_type use ColumnType , only : col @@ -38,8 +36,8 @@ subroutine Tridiagonal (bounds, lbj, ubj, jtop, numf, filter, a, b, c, r, u) type(bounds_type), intent(in) :: bounds integer , intent(in) :: lbj, ubj ! lbinning and ubing level indices integer , intent(in) :: jtop( bounds%begc: ) ! top level for each column [col] - integer , intent(in) :: numf ! filter dimension - integer , intent(in) :: filter(:) ! filter + integer , intent(in) :: numf ! filter dimension (should not include hydrologically inactive points) + integer , intent(in) :: filter(:) ! filter (should not include hydrologically inactive points) real(r8), intent(in) :: a( bounds%begc: , lbj: ) ! "a" left off diagonal of tridiagonal matrix [col, j] real(r8), intent(in) :: b( bounds%begc: , lbj: ) ! "b" diagonal column for tridiagonal matrix [col, j] real(r8), intent(in) :: c( bounds%begc: , lbj: ) ! "c" right off diagonal tridiagonal matrix [col, j] @@ -69,27 +67,13 @@ subroutine Tridiagonal (bounds, lbj, ubj, jtop, numf, filter, a, b, c, r, u) do j = lbj, ubj do fc = 1,numf ci = filter(fc) - if ((col%itype(ci) == icol_sunwall .or. col%itype(ci) == icol_shadewall & - .or. col%itype(ci) == icol_roof) .and. j <= nlevurb) then - if (j >= jtop(ci)) then - if (j == jtop(ci)) then - u(ci,j) = r(ci,j) / bet(ci) - else - gam(ci,j) = c(ci,j-1) / bet(ci) - bet(ci) = b(ci,j) - a(ci,j) * gam(ci,j) - u(ci,j) = (r(ci,j) - a(ci,j)*u(ci,j-1)) / bet(ci) - end if - end if - else if (col%itype(ci) /= icol_sunwall .and. col%itype(ci) /= icol_shadewall & - .and. col%itype(ci) /= icol_roof) then - if (j >= jtop(ci)) then - if (j == jtop(ci)) then - u(ci,j) = r(ci,j) / bet(ci) - else - gam(ci,j) = c(ci,j-1) / bet(ci) - bet(ci) = b(ci,j) - a(ci,j) * gam(ci,j) - u(ci,j) = (r(ci,j) - a(ci,j)*u(ci,j-1)) / bet(ci) - end if + if (j >= jtop(ci)) then + if (j == jtop(ci)) then + u(ci,j) = r(ci,j) / bet(ci) + else + gam(ci,j) = c(ci,j-1) / bet(ci) + bet(ci) = b(ci,j) - a(ci,j) * gam(ci,j) + u(ci,j) = (r(ci,j) - a(ci,j)*u(ci,j-1)) / bet(ci) end if end if end do @@ -98,16 +82,8 @@ subroutine Tridiagonal (bounds, lbj, ubj, jtop, numf, filter, a, b, c, r, u) do j = ubj-1,lbj,-1 do fc = 1,numf ci = filter(fc) - if ((col%itype(ci) == icol_sunwall .or. col%itype(ci) == icol_shadewall & - .or. col%itype(ci) == icol_roof) .and. j <= nlevurb-1) then - if (j >= jtop(ci)) then - u(ci,j) = u(ci,j) - gam(ci,j+1) * u(ci,j+1) - end if - else if (col%itype(ci) /= icol_sunwall .and. col%itype(ci) /= icol_shadewall & - .and. col%itype(ci) /= icol_roof) then - if (j >= jtop(ci)) then - u(ci,j) = u(ci,j) - gam(ci,j+1) * u(ci,j+1) - end if + if (j >= jtop(ci)) then + u(ci,j) = u(ci,j) - gam(ci,j+1) * u(ci,j+1) end if end do end do diff --git a/src/biogeophys/UrbBuildTempOleson2015Mod.F90 b/src/biogeophys/UrbBuildTempOleson2015Mod.F90 index 2b2e326c87..e0cd0a375f 100644 --- a/src/biogeophys/UrbBuildTempOleson2015Mod.F90 +++ b/src/biogeophys/UrbBuildTempOleson2015Mod.F90 @@ -209,7 +209,7 @@ subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall use clm_varctl , only : iulog use abortutils , only : endrun - use clm_varpar , only : nlevurb, nlevsno, nlevgrnd + use clm_varpar , only : nlevurb, nlevsno, nlevmaxurbgrnd use UrbanParamsType , only : urban_hac, urban_hac_off, urban_hac_on, urban_wasteheat_on ! ! !ARGUMENTS: @@ -302,7 +302,7 @@ subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, !----------------------------------------------------------------------- ! Enforce expected array sizes - SHR_ASSERT_ALL_FL((ubound(tk) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(tk) == (/bounds%endc, nlevmaxurbgrnd/)), sourcefile, __LINE__) associate(& clandunit => col%landunit , & ! Input: [integer (:)] column's landunit diff --git a/src/biogeophys/UrbanFluxesMod.F90 b/src/biogeophys/UrbanFluxesMod.F90 index 23a687c158..b00de6c5dc 100644 --- a/src/biogeophys/UrbanFluxesMod.F90 +++ b/src/biogeophys/UrbanFluxesMod.F90 @@ -210,9 +210,7 @@ subroutine UrbanFluxes (bounds, num_nourbanl, filter_nourbanl, integer :: indexl ! index of first found in search loop integer :: nstep ! time step number real(r8) :: e_ref2m ! 2 m height surface saturated vapor pressure [Pa] - real(r8) :: de2mdT ! derivative of 2 m height surface saturated vapor pressure on t_ref2m real(r8) :: qsat_ref2m ! 2 m height surface saturated specific humidity [kg/kg] - real(r8) :: dqsat2mdT ! derivative of 2 m height surface saturated specific humidity on t_ref2m ! real(r8), parameter :: lapse_rate = 0.0098_r8 ! Dry adiabatic lapse rate (K/m) integer , parameter :: niters = 3 ! maximum number of iterations for surface temperature @@ -887,7 +885,8 @@ subroutine UrbanFluxes (bounds, num_nourbanl, filter_nourbanl, ! 2 m height relative humidity - call QSat(t_ref2m(p), forc_pbot(g), e_ref2m, de2mdT, qsat_ref2m, dqsat2mdT) + call QSat(t_ref2m(p), forc_pbot(g), qsat_ref2m, & + es = e_ref2m) rh_ref2m(p) = min(100._r8, q_ref2m(p) / qsat_ref2m * 100._r8) rh_ref2m_u(p) = rh_ref2m(p) diff --git a/src/biogeophys/UrbanParamsType.F90 b/src/biogeophys/UrbanParamsType.F90 index 4b4187c3af..74b2315a10 100644 --- a/src/biogeophys/UrbanParamsType.F90 +++ b/src/biogeophys/UrbanParamsType.F90 @@ -122,8 +122,7 @@ subroutine Init(this, bounds) ! ! !USES: use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use clm_varpar , only : nlevcan, nlevcan, numrad, nlevgrnd, nlevurb - use clm_varpar , only : nlevsoi, nlevgrnd + use clm_varpar , only : numrad, nlevurb use clm_varctl , only : use_vancouver, use_mexicocity use clm_varcon , only : vkc use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall @@ -195,7 +194,6 @@ subroutine Init(this, bounds) do l = bounds%begl,bounds%endl - ! "0" refers to urban wall/roof surface and "nlevsoi" refers to urban wall/roof bottom if (lun%urbpoi(l)) then g = lun%gridcell(l) diff --git a/src/biogeophys/UrbanTimeVarType.F90 b/src/biogeophys/UrbanTimeVarType.F90 index a340b4a3ff..7a907bb9b9 100644 --- a/src/biogeophys/UrbanTimeVarType.F90 +++ b/src/biogeophys/UrbanTimeVarType.F90 @@ -9,10 +9,10 @@ module UrbanTimeVarType use shr_log_mod , only : errMsg => shr_log_errMsg use abortutils , only : endrun use decompMod , only : bounds_type - use clm_varctl , only : iulog + use clm_varctl , only : iulog, inst_name use landunit_varcon , only : isturb_MIN, isturb_MAX use clm_varcon , only : spval - use LandunitType , only : lun + use LandunitType , only : lun use GridcellType , only : grc use mct_mod use shr_strdata_mod , only : shr_strdata_type @@ -34,10 +34,10 @@ module UrbanTimeVarType procedure, public :: Init ! Allocate and initialize urbantv procedure, public :: urbantv_init ! Initialize urban time varying stream procedure, public :: urbantv_interp ! Interpolate urban time varying stream - + end type urbantv_type - !----------------------------------------------------------------------- + !----------------------------------------------------------------------- character(15), private :: stream_var_name(isturb_MIN:isturb_MAX) character(len=*), parameter, private :: sourcefile = & @@ -56,7 +56,7 @@ subroutine Init(this, bounds, NLFilename) ! ! !ARGUMENTS: class(urbantv_type) :: this - type(bounds_type) , intent(in) :: bounds + type(bounds_type) , intent(in) :: bounds character(len=*) , intent(in) :: NLFilename ! Namelist filename ! ! !LOCAL VARIABLES: @@ -90,7 +90,6 @@ subroutine urbantv_init(this, bounds, NLFilename) ! Initialize data stream information for urban time varying data ! ! !USES: - use clm_varctl , only : inst_name use clm_time_manager , only : get_calendar use ncdio_pio , only : pio_subsystem use shr_pio_mod , only : shr_pio_getiotype @@ -117,11 +116,11 @@ subroutine urbantv_init(this, bounds, NLFilename) integer :: ifield ! field index integer :: stream_year_first_urbantv ! first year in urban tv stream to use integer :: stream_year_last_urbantv ! last year in urban tv stream to use - integer :: model_year_align_urbantv ! align stream_year_first_urbantv + integer :: model_year_align_urbantv ! align stream_year_first_urbantv ! with this model year integer :: nu_nml ! unit for namelist file integer :: nml_error ! namelist i/o error flag - type(mct_ggrid) :: dom_clm ! domain information + type(mct_ggrid) :: dom_clm ! domain information character(len=CL) :: stream_fldFileName_urbantv ! urban tv streams filename character(len=CL) :: urbantvmapalgo = 'nn' ! mapping alogrithm for urban ac character(len=CL) :: urbantv_tintalgo = 'linear' ! time interpolation alogrithm @@ -193,7 +192,7 @@ subroutine urbantv_init(this, bounds, NLFilename) call shr_strdata_create(this%sdat_urbantv,name="clmurbantv", & pio_subsystem=pio_subsystem, & - pio_iotype=shr_pio_getiotype(inst_name), & + pio_iotype=shr_pio_getiotype(inst_name), & mpicom=mpicom, compid=comp_id, & gsmap=gsmap_lnd_gdc2glo, ggrid=dom_clm, & nxg=ldomain%ni, nyg=ldomain%nj, & diff --git a/src/biogeophys/WaterFluxBulkType.F90 b/src/biogeophys/WaterFluxBulkType.F90 index 9936eec293..eb0a1d3303 100644 --- a/src/biogeophys/WaterFluxBulkType.F90 +++ b/src/biogeophys/WaterFluxBulkType.F90 @@ -40,6 +40,7 @@ module WaterFluxBulkType real(r8), pointer :: qflx_adv_col (:,:) ! col advective flux across different soil layer interfaces [mm H2O/s] [+ downward] real(r8), pointer :: qflx_rootsoi_col (:,:) ! col root and soil water exchange [mm H2O/s] [+ into root] + real(r8), pointer :: qflx_hydr_redist_patch (:) ! patch hydraulic redistribution [mm H2O/s] real(r8), pointer :: qflx_sat_excess_surf_col (:) ! col surface runoff due to saturated surface (mm H2O /s) real(r8), pointer :: qflx_infl_excess_col (:) ! col infiltration excess runoff (mm H2O /s) real(r8), pointer :: qflx_infl_excess_surf_col(:) ! col surface runoff due to infiltration excess (mm H2O /s) @@ -112,8 +113,8 @@ subroutine InitBulkAllocate(this, bounds) allocate(this%qflx_snowindunload_patch (begp:endp)) ; this%qflx_snowindunload_patch (:) = nan allocate(this%qflx_snotempunload_patch (begp:endp)) ; this%qflx_snotempunload_patch (:) = nan - - allocate(this%qflx_phs_neg_col (begc:endc)) ; this%qflx_phs_neg_col (:) = nan + allocate(this%qflx_hydr_redist_patch (begp:endp)) ; this%qflx_hydr_redist_patch (:) = nan + allocate(this%qflx_phs_neg_col (begc:endc)) ; this%qflx_phs_neg_col (:) = nan allocate( this%qflx_ev_snow_patch (begp:endp)) ; this%qflx_ev_snow_patch (:) = nan allocate( this%qflx_ev_snow_col (begc:endc)) ; this%qflx_ev_snow_col (:) = nan @@ -186,6 +187,14 @@ subroutine InitBulkHistory(this, bounds) long_name=this%info%lname('water flux from soil to root in each soil-layer'), & ptr_col=this%qflx_rootsoi_col, set_spec=spval, l2g_scale_type='veg', default='inactive') + this%qflx_hydr_redist_patch(begp:endp) = spval + call hist_addfld1d ( & + fname=this%info%fname('QHR'), & + units='mm/s', & + avgflag='A', & + long_name=this%info%lname('hydraulic redistribution'), & + ptr_patch=this%qflx_hydr_redist_patch, set_spec=spval, l2g_scale_type='veg', default='active') + this%qflx_snowindunload_patch(begp:endp) = spval call hist_addfld1d ( & fname=this%info%fname('QSNO_WINDUNLOAD'), & diff --git a/src/biogeophys/WaterStateBulkType.F90 b/src/biogeophys/WaterStateBulkType.F90 index 02a3579b80..5c0298c8d5 100644 --- a/src/biogeophys/WaterStateBulkType.F90 +++ b/src/biogeophys/WaterStateBulkType.F90 @@ -12,7 +12,7 @@ module WaterStateBulkType ! !USES: use shr_kind_mod , only : r8 => shr_kind_r8 use decompMod , only : bounds_type - use clm_varpar , only : nlevgrnd, nlevsno + use clm_varpar , only : nlevmaxurbgrnd, nlevsno use clm_varcon , only : spval use WaterStateType , only : waterstate_type use WaterInfoBaseType, only : water_info_base_type @@ -28,7 +28,6 @@ module WaterStateBulkType real(r8), pointer :: snow_persistence_col (:) ! col length of time that ground has had non-zero snow thickness (sec) real(r8), pointer :: int_snow_col (:) ! col integrated snowfall (mm H2O) - contains procedure :: InitBulk @@ -105,8 +104,6 @@ subroutine InitBulkAllocate(this, bounds) allocate(this%snow_persistence_col (begc:endc)) ; this%snow_persistence_col (:) = nan allocate(this%int_snow_col (begc:endc)) ; this%int_snow_col (:) = nan - - end subroutine InitBulkAllocate !------------------------------------------------------------------------ @@ -211,7 +208,7 @@ subroutine RestartBulk(this, bounds, ncid, flag, & logical :: readvar !------------------------------------------------------------------------ - SHR_ASSERT_ALL_FL((ubound(watsat_col) == (/bounds%endc,nlevgrnd/)) , sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(watsat_col) == (/bounds%endc,nlevmaxurbgrnd/)) , sourcefile, __LINE__) call this%restart (bounds, ncid, flag=flag, & watsat_col=watsat_col(bounds%begc:bounds%endc,:)) diff --git a/src/biogeophys/WaterStateType.F90 b/src/biogeophys/WaterStateType.F90 index 4f59b78c63..243e93ca48 100644 --- a/src/biogeophys/WaterStateType.F90 +++ b/src/biogeophys/WaterStateType.F90 @@ -15,7 +15,7 @@ module WaterStateType use decompMod , only : BOUNDS_SUBGRID_PATCH, BOUNDS_SUBGRID_COLUMN, BOUNDS_SUBGRID_GRIDCELL use clm_varctl , only : use_bedrock, iulog use clm_varctl , only : use_fates_planthydro - use clm_varpar , only : nlevgrnd, nlevsoi, nlevurb, nlevsno + use clm_varpar , only : nlevgrnd, nlevsoi, nlevurb, nlevmaxurbgrnd, nlevsno use clm_varcon , only : spval, namec use LandunitType , only : lun use ColumnType , only : col @@ -119,7 +119,7 @@ subroutine InitAllocate(this, bounds, tracer_vars) call AllocateVar2d(var = this%h2osoi_vol_col, name = 'h2osoi_vol_col', & container = tracer_vars, & bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN, & - dim2beg = 1, dim2end = nlevgrnd) + dim2beg = 1, dim2end = nlevmaxurbgrnd) call AllocateVar2d(var = this%h2osoi_vol_prs_grc, name = 'h2osoi_vol_prs_grc', & container = tracer_vars, & bounds = bounds, subgrid_level = BOUNDS_SUBGRID_GRIDCELL, & @@ -127,11 +127,11 @@ subroutine InitAllocate(this, bounds, tracer_vars) call AllocateVar2d(var = this%h2osoi_ice_col, name = 'h2osoi_ice_col', & container = tracer_vars, & bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN, & - dim2beg = -nlevsno+1, dim2end = nlevgrnd) + dim2beg = -nlevsno+1, dim2end = nlevmaxurbgrnd) call AllocateVar2d(var = this%h2osoi_liq_col, name = 'h2osoi_liq_col', & container = tracer_vars, & bounds = bounds, subgrid_level = BOUNDS_SUBGRID_COLUMN, & - dim2beg = -nlevsno+1, dim2end = nlevgrnd) + dim2beg = -nlevsno+1, dim2end = nlevmaxurbgrnd) call AllocateVar1d(var = this%snocan_patch, name = 'snocan_patch', & container = tracer_vars, & bounds = bounds, subgrid_level = BOUNDS_SUBGRID_PATCH) @@ -307,8 +307,8 @@ subroutine InitCold(this, bounds, & !----------------------------------------------------------------------- SHR_ASSERT_ALL_FL((ubound(h2osno_input_col) == (/bounds%endc/)) , sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(watsat_col) == (/bounds%endc,nlevgrnd/)) , sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(t_soisno_col) == (/bounds%endc,nlevgrnd/)) , sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(watsat_col) == (/bounds%endc,nlevmaxurbgrnd/)) , sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(t_soisno_col) == (/bounds%endc,nlevmaxurbgrnd/)) , sourcefile, __LINE__) ratio = this%info%get_ratio() @@ -455,7 +455,7 @@ subroutine InitCold(this, bounds, & !-------------------------------------------- do c = bounds%begc, bounds%endc - do j = 1,nlevgrnd + do j = 1,nlevmaxurbgrnd if (this%h2osoi_vol_col(c,j) /= spval) then if (t_soisno_col(c,j) <= tfrz) then this%h2osoi_ice_col(c,j) = col%dz(c,j)*denice*this%h2osoi_vol_col(c,j) ! ratio already applied @@ -539,7 +539,7 @@ subroutine Restart(this, bounds, ncid, flag, & real(r8) :: totwat ! total soil water (mm) !------------------------------------------------------------------------ - SHR_ASSERT_ALL_FL((ubound(watsat_col) == (/bounds%endc,nlevgrnd/)) , sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(watsat_col) == (/bounds%endc,nlevmaxurbgrnd/)) , sourcefile, __LINE__) call restartvar(ncid=ncid, flag=flag, & varname=this%info%fname('H2OSFC'), & diff --git a/src/biogeophys/Waterlnd2atmBulkType.F90 b/src/biogeophys/Waterlnd2atmBulkType.F90 index a00668a364..6c1bee4bde 100644 --- a/src/biogeophys/Waterlnd2atmBulkType.F90 +++ b/src/biogeophys/Waterlnd2atmBulkType.F90 @@ -12,7 +12,7 @@ module Waterlnd2atmBulkType ! !USES: use shr_kind_mod , only : r8 => shr_kind_r8 use decompMod , only : bounds_type - use clm_varpar , only : nlevgrnd + use clm_varpar , only : nlevmaxurbgrnd use WaterLnd2atmType , only : waterlnd2atm_type use WaterInfoBaseType, only : water_info_base_type use WaterTracerContainerType, only : water_tracer_container_type @@ -78,7 +78,7 @@ subroutine InitBulkAllocate(this, bounds) begg = bounds%begg; endg= bounds%endg - allocate(this%h2osoi_vol_grc (begg:endg,1:nlevgrnd)) ; this%h2osoi_vol_grc (:,:) = ival + allocate(this%h2osoi_vol_grc (begg:endg,1:nlevmaxurbgrnd)) ; this%h2osoi_vol_grc (:,:) = ival end subroutine InitBulkAllocate diff --git a/src/biogeophys/test/HumanStress_test/test_humanstress.pf b/src/biogeophys/test/HumanStress_test/test_humanstress.pf index 51b41cf8e4..a6cf85bbdd 100644 --- a/src/biogeophys/test/HumanStress_test/test_humanstress.pf +++ b/src/biogeophys/test/HumanStress_test/test_humanstress.pf @@ -51,14 +51,14 @@ contains real(r8) :: shum ! specific humidity real(r8) :: Teq, epott, sat_vapor - real(r8) :: esdT, qsdT real(r8) :: es_mb, de_mbdT, dlnes_mbdT, rs, rsdT, foftk, fdT pres = 100000._r8 temp = 50._r8 + SHR_CONST_TKFRZ rh = 100.0_r8 - call QSat (temp, pres, sat_vapor, esdT, rs, qsdT) + call QSat (temp, pres, rs, & + es = sat_vapor) call VaporPres( rh, sat_vapor, vapor ) call VaporPres( rh, rs, shum ) call Wet_Bulb (temp,vapor,pres,rh,shum,Teq,epott,wbt) @@ -66,7 +66,8 @@ contains temp = 59._r8 + SHR_CONST_TKFRZ rh = 65.0_r8 - call QSat (temp, pres, sat_vapor, esdT, rs, qsdT) + call QSat (temp, pres, rs, & + es = sat_vapor) call VaporPres( rh, sat_vapor, vapor ) call VaporPres( rh, rs, shum ) call Wet_Bulb (temp,vapor,pres,rh,shum,Teq,epott,wbt) @@ -78,7 +79,8 @@ contains do while ( pres > 85000._r8 ) temp = 53._r8 + SHR_CONST_TKFRZ do while ( temp > SHR_CONST_TKFRZ-127.0 ) - call QSat (temp, pres, sat_vapor, esdT, rs, qsdT) + call QSat (temp, pres, rs, & + es = sat_vapor) call VaporPres( rh, sat_vapor, vapor ) call VaporPres( rh, rs, shum ) call Wet_Bulb (temp,vapor,pres,rh,shum,Teq,epott,wbt) @@ -110,7 +112,6 @@ contains real(r8) :: shum ! specific humidity real(r8) :: Teq, epott, sat_vapor - real(r8) :: esdT, qsdT real(r8) :: es_mb, de_mbdT, dlnes_mbdT, rs, rsdT, foftk, fdT rh = 1.0_r8 @@ -119,7 +120,8 @@ contains do while ( pres < 110000._r8 ) temp = 53._r8 + SHR_CONST_TKFRZ do while ( temp <= SHR_CONST_TKFRZ+58.0 ) - call QSat (temp, pres, sat_vapor, esdT, rs, qsdT) + call QSat (temp, pres, rs, & + es = sat_vapor) call VaporPres( rh, sat_vapor, vapor ) call VaporPres( rh, rs, shum ) write(*,*) 'temp, pres, rh : ', temp-SHR_CONST_TKFRZ, pres, rh diff --git a/src/cpl/lilac/lnd_import_export.F90 b/src/cpl/lilac/lnd_import_export.F90 index 313d0ce635..581bdbedc8 100644 --- a/src/cpl/lilac/lnd_import_export.F90 +++ b/src/cpl/lilac/lnd_import_export.F90 @@ -2,12 +2,9 @@ module lnd_import_export use ESMF use shr_kind_mod , only : r8 => shr_kind_r8, cx=>shr_kind_cx, cxx=>shr_kind_cxx, cs=>shr_kind_cs - use shr_infnan_mod , only : isnan => shr_infnan_isnan - use shr_string_mod , only : shr_string_listGetName, shr_string_listGetNum use shr_sys_mod , only : shr_sys_abort - use shr_const_mod , only : SHR_CONST_TKFRZ, fillvalue=>SHR_CONST_SPVAL - use clm_varctl , only : iulog, co2_ppmv, ndep_from_cpl - use clm_varcon , only : rair, o2_molar_const + use shr_const_mod , only : fillvalue=>SHR_CONST_SPVAL + use clm_varctl , only : iulog, ndep_from_cpl use clm_time_manager , only : get_nstep use clm_instMod , only : atm2lnd_inst, lnd2atm_inst, water_inst use domainMod , only : ldomain @@ -18,6 +15,7 @@ module lnd_import_export use atm2lndType , only : atm2lnd_type use lnd_shr_methods , only : chkerr use shr_megan_mod , only : shr_megan_mechcomps_n ! TODO: need to add a namelist read here (see https://github.com/ESCOMP/CTSM/issues/926) + use lnd_import_export_utils, only : derive_quantities, check_for_errors, check_for_nans implicit none private ! except @@ -28,7 +26,6 @@ module lnd_import_export private :: state_getimport private :: state_setexport private :: state_getfldptr - private :: check_for_nans ! from atm->lnd integer :: ndep_nflds ! number of nitrogen deposition fields from atm->lnd/ocn @@ -66,41 +63,15 @@ subroutine import_fields( importState, bounds, first_call, rc) integer :: num integer :: begg, endg ! bounds integer :: g,i,k ! indices - real(r8) :: e ! vapor pressure (Pa) - real(r8) :: qsat ! saturation specific humidity (kg/kg) - real(r8) :: co2_ppmv_val ! temporary - real(r8) :: esatw ! saturation vapor pressure over water (Pa) - real(r8) :: esati ! saturation vapor pressure over ice (Pa) - real(r8) :: a0,a1,a2,a3,a4,a5,a6 ! coefficients for esat over water - real(r8) :: b0,b1,b2,b3,b4,b5,b6 ! coefficients for esat over ice - real(r8) :: tdc, t ! Kelvins to Celcius function and its input - real(r8) :: forc_t ! atmospheric temperature (Kelvin) - real(r8) :: forc_q ! atmospheric specific humidity (kg/kg) - real(r8) :: forc_pbot ! atmospheric pressure (Pa) real(r8) :: forc_rainc(bounds%begg:bounds%endg) ! rainxy Atm flux mm/s real(r8) :: forc_rainl(bounds%begg:bounds%endg) ! rainxy Atm flux mm/s real(r8) :: forc_snowc(bounds%begg:bounds%endg) ! snowfxy Atm flux mm/s real(r8) :: forc_snowl(bounds%begg:bounds%endg) ! snowfxl Atm flux mm/s + real(r8) :: qsat_kg_kg ! saturation specific humidity (kg/kg) real(r8) :: forc_noy(bounds%begg:bounds%endg) real(r8) :: forc_nhx(bounds%begg:bounds%endg) - real(r8) :: topo_grc(bounds%begg:bounds%endg, 0:glc_nec) character(len=*), parameter :: subname='(lnd_import_export:import_fields)' - ! Constants to compute vapor pressure - parameter (a0=6.107799961_r8 , a1=4.436518521e-01_r8, & - a2=1.428945805e-02_r8, a3=2.650648471e-04_r8, & - a4=3.031240396e-06_r8, a5=2.034080948e-08_r8, & - a6=6.136820929e-11_r8) - - parameter (b0=6.109177956_r8 , b1=5.034698970e-01_r8, & - b2=1.886013408e-02_r8, b3=4.176223716e-04_r8, & - b4=5.824720280e-06_r8, b5=4.838803174e-08_r8, & - b6=1.838826904e-10_r8) - - ! function declarations - tdc(t) = min( 50._r8, max(-50._r8,(t-SHR_CONST_TKFRZ)) ) - esatw(t) = 100._r8*(a0+t*(a1+t*(a2+t*(a3+t*(a4+t*(a5+t*a6)))))) - esati(t) = 100._r8*(b0+t*(b1+t*(b2+t*(b3+t*(b4+t*(b5+t*b6)))))) !--------------------------------------------------------------------------- rc = ESMF_SUCCESS @@ -264,85 +235,19 @@ subroutine import_fields( importState, bounds, first_call, rc) water_inst%wateratm2lndbulk_inst%forc_flood_grc(:) = 0._r8 - !-------------------------- - ! Derived quantities - !-------------------------- - do g = begg, endg - forc_t = atm2lnd_inst%forc_t_not_downscaled_grc(g) - forc_q = water_inst%wateratm2lndbulk_inst%forc_q_not_downscaled_grc(g) - forc_pbot = atm2lnd_inst%forc_pbot_not_downscaled_grc(g) - - atm2lnd_inst%forc_hgt_u_grc(g) = atm2lnd_inst%forc_hgt_grc(g) !observational height of wind [m] - atm2lnd_inst%forc_hgt_t_grc(g) = atm2lnd_inst%forc_hgt_grc(g) !observational height of temperature [m] - atm2lnd_inst%forc_hgt_q_grc(g) = atm2lnd_inst%forc_hgt_grc(g) !observational height of humidity [m] - - atm2lnd_inst%forc_vp_grc(g) = forc_q * forc_pbot / (0.622_r8 + 0.378_r8 * forc_q) - - atm2lnd_inst%forc_rho_not_downscaled_grc(g) = & - (forc_pbot - 0.378_r8 * atm2lnd_inst%forc_vp_grc(g)) / (rair * forc_t) - - atm2lnd_inst%forc_po2_grc(g) = o2_molar_const * forc_pbot - - atm2lnd_inst%forc_pco2_grc(g) = co2_ppmv * 1.e-6_r8 * forc_pbot - - atm2lnd_inst%forc_wind_grc(g) = sqrt(atm2lnd_inst%forc_u_grc(g)**2 + atm2lnd_inst%forc_v_grc(g)**2) - - atm2lnd_inst%forc_solar_grc(g) = atm2lnd_inst%forc_solad_grc(g,1) + atm2lnd_inst%forc_solai_grc(g,1) + & - atm2lnd_inst%forc_solad_grc(g,2) + atm2lnd_inst%forc_solai_grc(g,2) - - water_inst%wateratm2lndbulk_inst%forc_rain_not_downscaled_grc(g) = forc_rainc(g) + forc_rainl(g) - water_inst%wateratm2lndbulk_inst%forc_snow_not_downscaled_grc(g) = forc_snowc(g) + forc_snowl(g) - - - if (forc_t > SHR_CONST_TKFRZ) then - e = esatw(tdc(forc_t)) - else - e = esati(tdc(forc_t)) - end if - qsat = 0.622_r8*e / (forc_pbot - 0.378_r8*e) - - ! modify specific humidity if precip occurs - if (1==2) then - if ((forc_rainc(g)+forc_rainl(g)) > 0._r8) then - forc_q = 0.95_r8*qsat - !forc_q = qsat - water_inst%wateratm2lndbulk_inst%forc_q_not_downscaled_grc(g) = forc_q - endif - endif - - water_inst%wateratm2lndbulk_inst%forc_rh_grc(g) = 100.0_r8*(forc_q / qsat) water_inst%wateratm2lndbulk_inst%volr_grc(g) = 0._r8 water_inst%wateratm2lndbulk_inst%volrmch_grc(g) = 0._r8 end do !-------------------------- - ! Error checks + ! Derived quantities for required fields + ! and corresponding error checks !-------------------------- - ! Check that solar, specific-humidity and LW downward aren't negative - do g = begg,endg - if ( atm2lnd_inst%forc_lwrad_not_downscaled_grc(g) <= 0.0_r8 ) then - call shr_sys_abort( subname//& - ' ERROR: Longwave down sent from the atmosphere model is negative or zero' ) - end if - if ( (atm2lnd_inst%forc_solad_grc(g,1) < 0.0_r8) .or. & - (atm2lnd_inst%forc_solad_grc(g,2) < 0.0_r8) .or. & - (atm2lnd_inst%forc_solai_grc(g,1) < 0.0_r8) .or. & - (atm2lnd_inst%forc_solai_grc(g,2) < 0.0_r8) ) then - call shr_sys_abort( subname//& - ' ERROR: One of the solar fields (indirect/diffuse, vis or near-IR)'// & - ' from the atmosphere model is negative or zero' ) - end if - if ( water_inst%wateratm2lndbulk_inst%forc_q_not_downscaled_grc(g) < 0.0_r8 )then - call shr_sys_abort( subname//& - ' ERROR: Bottom layer specific humidty sent from the atmosphere model is less than zero' ) - end if - end do + call derive_quantities(bounds, atm2lnd_inst, water_inst%wateratm2lndbulk_inst, forc_rainc, forc_rainl, forc_snowc, forc_snowl) - ! Make sure relative humidity is properly bounded - ! atm2lnd_inst%forc_rh_grc(g) = min( 100.0_r8, atm2lnd_inst%forc_rh_grc(g) ) - ! atm2lnd_inst%forc_rh_grc(g) = max( 0.0_r8, atm2lnd_inst%forc_rh_grc(g) ) + call check_for_errors(bounds, atm2lnd_inst, water_inst%wateratm2lndbulk_inst) end subroutine import_fields @@ -819,31 +724,4 @@ subroutine state_getfldptr(State, fb, fldname, fldptr1d, fldptr2d, rc) end subroutine state_getfldptr - !=============================================================================== - - subroutine check_for_nans(array, fname, begg) - - ! input/output variables - real(r8) , intent(in) :: array(:) - character(len=*) , intent(in) :: fname - integer , intent(in) :: begg - ! - ! local variables - integer :: i - !------------------------------------------------------------------------------- - - ! Check if any input from lilac or output to lilac is NaN - - if (any(isnan(array))) then - write(iulog,*) '# of NaNs = ', count(isnan(array)) - write(iulog,*) 'Which are NaNs = ', isnan(array) - do i = 1, size(array) - if (isnan(array(i))) then - write(iulog,*) "NaN found in field ", trim(fname), ' at gridcell index ',begg+i-1 - end if - end do - call shr_sys_abort(' ERROR: One or more of the output from CLM to the coupler are NaN ' ) - end if - end subroutine check_for_nans - end module lnd_import_export diff --git a/src/cpl/mct/lnd_comp_mct.F90 b/src/cpl/mct/lnd_comp_mct.F90 index b5b46ca97e..1ae6b9f6b9 100644 --- a/src/cpl/mct/lnd_comp_mct.F90 +++ b/src/cpl/mct/lnd_comp_mct.F90 @@ -74,7 +74,7 @@ subroutine lnd_init_mct( EClock, cdata_l, x2l_l, l2x_l, NLFilename ) character(len=*), optional, intent(in) :: NLFilename ! Namelist filename to read ! ! !LOCAL VARIABLES: - integer :: LNDID ! Land identifyer + integer :: LNDID ! Land identifyer integer :: mpicom_lnd ! MPI communicator type(mct_gsMap), pointer :: GSMap_lnd ! Land model MCT GS map type(mct_gGrid), pointer :: dom_l ! Land model domain @@ -130,7 +130,6 @@ subroutine lnd_init_mct( EClock, cdata_l, x2l_l, l2x_l, NLFilename ) inst_name = seq_comm_name(LNDID) inst_index = seq_comm_inst(LNDID) inst_suffix = seq_comm_suffix(LNDID) - ! Initialize io log unit call shr_file_getLogUnit (shrlogunit) @@ -430,7 +429,7 @@ subroutine lnd_run_mct(EClock, cdata_l, x2l_l, l2x_l) nstep = get_nstep() caldayp1 = get_curr_calday(offset=dtime) if (nstep == 0) then - doalb = .false. + doalb = .false. else if (nstep == 1) then doalb = (abs(nextsw_cday- caldayp1) < 1.e-10_r8) else diff --git a/src/cpl/mct/lnd_import_export.F90 b/src/cpl/mct/lnd_import_export.F90 index b93379979a..afdf575a30 100644 --- a/src/cpl/mct/lnd_import_export.F90 +++ b/src/cpl/mct/lnd_import_export.F90 @@ -27,11 +27,9 @@ subroutine lnd_import( bounds, x2l, glc_present, atm2lnd_inst, glc2lnd_inst, wat use seq_flds_mod , only: seq_flds_x2l_fields use clm_varctl , only: co2_type, co2_ppmv, iulog, use_c13 use clm_varctl , only: ndep_from_cpl - use clm_varcon , only: rair, o2_molar_const, c13ratio - use shr_const_mod , only: SHR_CONST_TKFRZ - use shr_string_mod , only: shr_string_listGetName + use clm_varcon , only: c13ratio use domainMod , only: ldomain - use shr_infnan_mod , only : isnan => shr_infnan_isnan + use lnd_import_export_utils, only : derive_quantities, check_for_errors, check_for_nans ! ! !ARGUMENTS: type(bounds_type) , intent(in) :: bounds ! bounds @@ -42,46 +40,26 @@ subroutine lnd_import( bounds, x2l, glc_present, atm2lnd_inst, glc2lnd_inst, wat type(wateratm2lndbulk_type), intent(inout) :: wateratm2lndbulk_inst ! clm internal input data type ! ! !LOCAL VARIABLES: + integer :: begg, endg ! bounds integer :: g,i,k,nstep,ier ! indices, number of steps, and error code - real(r8) :: forc_rainc ! rainxy Atm flux mm/s - real(r8) :: e ! vapor pressure (Pa) - real(r8) :: qsat ! saturation specific humidity (kg/kg) - real(r8) :: forc_t ! atmospheric temperature (Kelvin) - real(r8) :: forc_q ! atmospheric specific humidity (kg/kg) + real(r8) :: qsat_kg_kg ! saturation specific humidity (kg/kg) real(r8) :: forc_pbot ! atmospheric pressure (Pa) - real(r8) :: forc_rainl ! rainxy Atm flux mm/s - real(r8) :: forc_snowc ! snowfxy Atm flux mm/s - real(r8) :: forc_snowl ! snowfxl Atm flux mm/s + real(r8) :: forc_rainc(bounds%begg:bounds%endg) ! rainxy Atm flux mm/s + real(r8) :: forc_rainl(bounds%begg:bounds%endg) ! rainxy Atm flux mm/s + real(r8) :: forc_snowc(bounds%begg:bounds%endg) ! snowfxy Atm flux mm/s + real(r8) :: forc_snowl(bounds%begg:bounds%endg) ! snowfxl Atm flux mm/s real(r8) :: co2_ppmv_diag ! temporary real(r8) :: co2_ppmv_prog ! temporary real(r8) :: co2_ppmv_val ! temporary integer :: co2_type_idx ! integer flag for co2_type options - real(r8) :: esatw ! saturation vapor pressure over water (Pa) - real(r8) :: esati ! saturation vapor pressure over ice (Pa) - real(r8) :: a0,a1,a2,a3,a4,a5,a6 ! coefficients for esat over water - real(r8) :: b0,b1,b2,b3,b4,b5,b6 ! coefficients for esat over ice - real(r8) :: tdc, t ! Kelvins to Celcius function and its input character(len=32) :: fname ! name of field that is NaN character(len=32), parameter :: sub = 'lnd_import' - ! Constants to compute vapor pressure - parameter (a0=6.107799961_r8 , a1=4.436518521e-01_r8, & - a2=1.428945805e-02_r8, a3=2.650648471e-04_r8, & - a4=3.031240396e-06_r8, a5=2.034080948e-08_r8, & - a6=6.136820929e-11_r8) - - parameter (b0=6.109177956_r8 , b1=5.034698970e-01_r8, & - b2=1.886013408e-02_r8, b3=4.176223716e-04_r8, & - b4=5.824720280e-06_r8, b5=4.838803174e-08_r8, & - b6=1.838826904e-10_r8) - ! - ! function declarations - ! - tdc(t) = min( 50._r8, max(-50._r8,(t-SHR_CONST_TKFRZ)) ) - esatw(t) = 100._r8*(a0+t*(a1+t*(a2+t*(a3+t*(a4+t*(a5+t*a6)))))) - esati(t) = 100._r8*(b0+t*(b1+t*(b2+t*(b3+t*(b4+t*(b5+t*b6)))))) !--------------------------------------------------------------------------- + ! Set bounds + begg = bounds%begg; endg = bounds%endg + co2_type_idx = 0 if (co2_type == 'prognostic') then co2_type_idx = 1 @@ -100,9 +78,8 @@ subroutine lnd_import( bounds, x2l, glc_present, atm2lnd_inst, glc2lnd_inst, wat ! by 1000 mm/m resulting in an overall factor of unity. ! Below the units are therefore given in mm/s. - - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) + do g = begg,endg + i = 1 + (g - begg) ! Determine flooding input, sign convention is positive downward and ! hierarchy is atm/glc/lnd/rof/ice/ocn. so water sent from rof to land is negative, @@ -130,10 +107,10 @@ subroutine lnd_import( bounds, x2l, glc_present, atm2lnd_inst, glc2lnd_inst, wat atm2lnd_inst%forc_t_not_downscaled_grc(g) = x2l(index_x2l_Sa_tbot,i) ! forc_txy Atm state K atm2lnd_inst%forc_lwrad_not_downscaled_grc(g) = x2l(index_x2l_Faxa_lwdn,i) ! flwdsxy Atm flux W/m^2 - forc_rainc = x2l(index_x2l_Faxa_rainc,i) ! mm/s - forc_rainl = x2l(index_x2l_Faxa_rainl,i) ! mm/s - forc_snowc = x2l(index_x2l_Faxa_snowc,i) ! mm/s - forc_snowl = x2l(index_x2l_Faxa_snowl,i) ! mm/s + forc_rainc(g) = x2l(index_x2l_Faxa_rainc,i) ! mm/s + forc_rainl(g) = x2l(index_x2l_Faxa_rainl,i) ! mm/s + forc_snowc(g) = x2l(index_x2l_Faxa_snowc,i) ! mm/s + forc_snowl(g) = x2l(index_x2l_Faxa_snowl,i) ! mm/s ! atmosphere coupling, for prognostic/prescribed aerosols atm2lnd_inst%forc_aer_grc(g,1) = x2l(index_x2l_Faxa_bcphidry,i) @@ -169,79 +146,32 @@ subroutine lnd_import( bounds, x2l, glc_present, atm2lnd_inst, glc2lnd_inst, wat atm2lnd_inst%forc_pch4_grc(g) = x2l(index_x2l_Sa_methane,i) endif - ! Determine derived quantities for required fields + !-------------------------- + ! Check for nans from coupler + !-------------------------- - forc_t = atm2lnd_inst%forc_t_not_downscaled_grc(g) - forc_q = wateratm2lndbulk_inst%forc_q_not_downscaled_grc(g) - forc_pbot = atm2lnd_inst%forc_pbot_not_downscaled_grc(g) - - atm2lnd_inst%forc_hgt_u_grc(g) = atm2lnd_inst%forc_hgt_grc(g) !observational height of wind [m] - atm2lnd_inst%forc_hgt_t_grc(g) = atm2lnd_inst%forc_hgt_grc(g) !observational height of temperature [m] - atm2lnd_inst%forc_hgt_q_grc(g) = atm2lnd_inst%forc_hgt_grc(g) !observational height of humidity [m] - atm2lnd_inst%forc_vp_grc(g) = forc_q * forc_pbot / (0.622_r8 + 0.378_r8 * forc_q) - atm2lnd_inst%forc_rho_not_downscaled_grc(g) = & - (forc_pbot - 0.378_r8 * atm2lnd_inst%forc_vp_grc(g)) / (rair * forc_t) - atm2lnd_inst%forc_po2_grc(g) = o2_molar_const * forc_pbot - atm2lnd_inst%forc_wind_grc(g) = sqrt(atm2lnd_inst%forc_u_grc(g)**2 + atm2lnd_inst%forc_v_grc(g)**2) - atm2lnd_inst%forc_solar_grc(g) = atm2lnd_inst%forc_solad_grc(g,1) + atm2lnd_inst%forc_solai_grc(g,1) + & - atm2lnd_inst%forc_solad_grc(g,2) + atm2lnd_inst%forc_solai_grc(g,2) - - wateratm2lndbulk_inst%forc_rain_not_downscaled_grc(g) = forc_rainc + forc_rainl - wateratm2lndbulk_inst%forc_snow_not_downscaled_grc(g) = forc_snowc + forc_snowl - - if (forc_t > SHR_CONST_TKFRZ) then - e = esatw(tdc(forc_t)) - else - e = esati(tdc(forc_t)) - end if - qsat = 0.622_r8*e / (forc_pbot - 0.378_r8*e) - - !modify specific humidity if precip occurs - if(1==2) then - if((forc_rainc+forc_rainl) > 0._r8) then - forc_q = 0.95_r8*qsat - ! forc_q = qsat - wateratm2lndbulk_inst%forc_q_not_downscaled_grc(g) = forc_q - endif - endif + call check_for_nans(x2l(:,i), fname, begg) + + end do - wateratm2lndbulk_inst%forc_rh_grc(g) = 100.0_r8*(forc_q / qsat) + !-------------------------- + ! Derived quantities for required fields + ! and corresponding error checks + !-------------------------- - ! Check that solar, specific-humidity and LW downward aren't negative - if ( atm2lnd_inst%forc_lwrad_not_downscaled_grc(g) <= 0.0_r8 )then - call endrun( sub//' ERROR: Longwave down sent from the atmosphere model is negative or zero' ) - end if - if ( (atm2lnd_inst%forc_solad_grc(g,1) < 0.0_r8) .or. (atm2lnd_inst%forc_solad_grc(g,2) < 0.0_r8) & - .or. (atm2lnd_inst%forc_solai_grc(g,1) < 0.0_r8) .or. (atm2lnd_inst%forc_solai_grc(g,2) < 0.0_r8) ) then - call endrun( sub//' ERROR: One of the solar fields (indirect/diffuse, vis or near-IR)'// & - ' from the atmosphere model is negative or zero' ) - end if - if ( wateratm2lndbulk_inst%forc_q_not_downscaled_grc(g) < 0.0_r8 )then - call endrun( sub//' ERROR: Bottom layer specific humidty sent from the atmosphere model is less than zero' ) - end if + call derive_quantities(bounds, atm2lnd_inst, wateratm2lndbulk_inst, & + forc_rainc, forc_rainl, forc_snowc, forc_snowl) - ! Check if any input from the coupler is NaN - if ( any(isnan(x2l(:,i))) )then - write(iulog,*) '# of NaNs = ', count(isnan(x2l(:,i))) - write(iulog,*) 'Which are NaNs = ', isnan(x2l(:,i)) - do k = 1, size(x2l(:,i)) - if ( isnan(x2l(k,i)) )then - call shr_string_listGetName( seq_flds_x2l_fields, k, fname ) - write(iulog,*) trim(fname) - end if - end do - write(iulog,*) 'gridcell index = ', g - call endrun( sub//' ERROR: One or more of the input from the atmosphere model are NaN '// & - '(Not a Number from a bad floating point calculation)' ) - end if + call check_for_errors(bounds, atm2lnd_inst, wateratm2lndbulk_inst) - ! Make sure relative humidity is properly bounded - ! wateratm2lndbulk_inst%forc_rh_grc(g) = min( 100.0_r8, wateratm2lndbulk_inst%forc_rh_grc(g) ) - ! wateratm2lndbulk_inst%forc_rh_grc(g) = max( 0.0_r8, wateratm2lndbulk_inst%forc_rh_grc(g) ) + ! Determine derived quantities for optional fields + ! Note that the following does unit conversions from ppmv to partial pressures (Pa) + ! Note that forc_pbot is in Pa - ! Determine derived quantities for optional fields - ! Note that the following does unit conversions from ppmv to partial pressures (Pa) - ! Note that forc_pbot is in Pa + do g = begg,endg + i = 1 + (g - begg) + + forc_pbot = atm2lnd_inst%forc_pbot_not_downscaled_grc(g) if (co2_type_idx == 1) then co2_ppmv_val = co2_ppmv_prog @@ -294,13 +224,10 @@ subroutine lnd_export( bounds, waterlnd2atmbulk_inst, lnd2atm_inst, lnd2glc_inst use shr_kind_mod , only : r8 => shr_kind_r8 use seq_flds_mod , only : seq_flds_l2x_fields use clm_varctl , only : iulog - use clm_time_manager , only : get_nstep use seq_drydep_mod , only : n_drydep use shr_megan_mod , only : shr_megan_mechcomps_n use shr_fire_emis_mod , only : shr_fire_emis_mechcomps_n - use domainMod , only : ldomain - use shr_string_mod , only : shr_string_listGetName - use shr_infnan_mod , only : isnan => shr_infnan_isnan + use lnd_import_export_utils, only : check_for_nans ! ! !ARGUMENTS: implicit none @@ -311,6 +238,7 @@ subroutine lnd_export( bounds, waterlnd2atmbulk_inst, lnd2atm_inst, lnd2glc_inst real(r8) , intent(out) :: l2x(:,:)! land to coupler export state on land grid ! ! !LOCAL VARIABLES: + integer :: begg, endg ! bounds integer :: g,i,k ! indices integer :: ier ! error status integer :: nstep ! time step index @@ -320,12 +248,15 @@ subroutine lnd_export( bounds, waterlnd2atmbulk_inst, lnd2atm_inst, lnd2glc_inst character(len=32), parameter :: sub = 'lnd_export' !--------------------------------------------------------------------------- + ! Set bounds + begg = bounds%begg; endg = bounds%endg + ! cesm sign convention is that fluxes are positive downward l2x(:,:) = 0.0_r8 - do g = bounds%begg,bounds%endg - i = 1 + (g-bounds%begg) + do g = begg,endg + i = 1 + (g-begg) l2x(index_l2x_Sl_t,i) = lnd2atm_inst%t_rad_grc(g) l2x(index_l2x_Sl_snowh,i) = waterlnd2atmbulk_inst%h2osno_grc(g) l2x(index_l2x_Sl_avsdr,i) = lnd2atm_inst%albd_grc(g,1) @@ -410,19 +341,11 @@ subroutine lnd_export( bounds, waterlnd2atmbulk_inst, lnd2atm_inst, lnd2glc_inst l2x(index_l2x_Flgl_qice(num),i) = lnd2glc_inst%qice_grc(g,num) end do - ! Check if any output sent to the coupler is NaN - if ( any(isnan(l2x(:,i))) )then - write(iulog,*) '# of NaNs = ', count(isnan(l2x(:,i))) - write(iulog,*) 'Which are NaNs = ', isnan(l2x(:,i)) - do k = 1, size(l2x(:,i)) - if ( isnan(l2x(k,i)) )then - call shr_string_listGetName( seq_flds_l2x_fields, k, fname ) - write(iulog,*) trim(fname) - end if - end do - write(iulog,*) 'gridcell index = ', g - call endrun( sub//' ERROR: One or more of the output from CLM to the coupler are NaN ' ) - end if + !-------------------------- + ! Check for nans to coupler + !-------------------------- + + call check_for_nans(l2x(:,i), fname, begg) end do diff --git a/src/cpl/nuopc/SoilMoistureStreamMod.F90 b/src/cpl/nuopc/SoilMoistureStreamMod.F90 new file mode 100644 index 0000000000..3c6b23a0aa --- /dev/null +++ b/src/cpl/nuopc/SoilMoistureStreamMod.F90 @@ -0,0 +1,400 @@ +module SoilMoistureStreamMod + + ! ********************************************************************** + ! --------------------------- IMPORTANT NOTE --------------------------- + ! + ! This file is here temporarily in order to exercise the CDEPS stream code for this 3-d + ! stream. In cases using the NUOPC driver/mediator, this version is used instead of the + ! version in src/biogeophys. Changes to the science here should also be made in the + ! similar file in src/biogeophys. Once we start using CDEPS by default, we can remove + ! the version in src/biogeophys and move this version into there. + ! ********************************************************************** + +#include "shr_assert.h" + + !----------------------------------------------------------------------- + ! !DESCRIPTION: + ! Read in soil moisture from data stream + ! + ! !USES: + use ESMF + use dshr_strdata_mod , only : shr_strdata_type, shr_strdata_print + use dshr_strdata_mod , only : shr_strdata_init_from_inline, shr_strdata_advance + use dshr_methods_mod , only : dshr_fldbun_getfldptr + use dshr_stream_mod , only : shr_stream_file_null + use shr_kind_mod , only : r8 => shr_kind_r8, cl => shr_kind_CL, cxx => shr_kind_CXX + use shr_log_mod , only : errMsg => shr_log_errMsg + use shr_mpi_mod , only : shr_mpi_bcast + use decompMod , only : bounds_type + use abortutils , only : endrun + use clm_varctl , only : iulog, use_soil_moisture_streams + use controlMod , only : NLFilename + use LandunitType , only : lun + use ColumnType , only : col + use SoilStateType , only : soilstate_type + use WaterStateBulkType , only : waterstatebulk_type + use perf_mod , only : t_startf, t_stopf + use spmdMod , only : masterproc, mpicom, iam + use clm_time_manager , only : get_calendar, get_curr_date + use clm_nlUtilsMod , only : find_nlgroup_name + use clm_varpar , only : nlevsoi + use clm_varcon , only : denh2o, denice, watmin, spval + use landunit_varcon , only : istsoil, istcrop + use lnd_comp_shr , only : mesh, model_meshfile, model_clock + ! + ! !PUBLIC TYPES: + implicit none + private + ! + ! !PUBLIC MEMBER FUNCTIONS: + public :: PrescribedSoilMoistureInit ! position datasets for soil moisture + public :: PrescribedSoilMoistureAdvance ! Advance the soil moisture stream (outside of Open-MP loops) + public :: PrescribedSoilMoistureInterp ! interpolates between two periods of soil moisture data + + ! !PRIVATE MEMBER DATA: + type(shr_strdata_type) :: sdat_soilm ! soil moisture input data stream + character(*), parameter :: stream_var_name = "H2OSOI" ! base string for field string + character(len=CL) :: stream_lev_dimname = 'levsoi' ! name of vertical layer dimension + integer, allocatable :: g_to_ig(:) ! Array matching gridcell index to data index + logical :: soilm_ignore_data_if_missing ! If should ignore overridding a point with soil moisture data + ! from the streams file, if the streams file shows that point + ! as missing (namelist item) + ! !PRIVATE TYPES: + character(len=*), parameter, private :: sourcefile = & + __FILE__ + character(*), parameter :: u_FILE_u = & + __FILE__ + !----------------------------------------------------------------------- + +contains + + !----------------------------------------------------------------------- + ! + ! soil_moisture_init + ! + !----------------------------------------------------------------------- + subroutine PrescribedSoilMoistureInit(bounds) + ! + ! Initialize data stream information for soil moisture. + ! + ! !USES: + ! + ! !ARGUMENTS: + implicit none + type(bounds_type), intent(in) :: bounds ! bounds + ! + ! !LOCAL VARIABLES: + integer :: rc ! error coe + integer :: i ! index + integer :: stream_year_first_soilm ! first year in Ustar stream to use + integer :: stream_year_last_soilm ! last year in Ustar stream to use + integer :: model_year_align_soilm ! align stream_year_first_soilm with + integer :: nu_nml ! unit for namelist file + integer :: nml_error ! namelist i/o error flag + integer :: soilm_offset ! Offset in time for dataset (sec) + character(len=CL) :: stream_fldfilename_soilm ! ustar stream filename to read + character(len=CL) :: soilm_tintalgo = 'linear' ! Time interpolation alogrithm + character(len=CL) :: stream_mapalgo = 'bilinear' + real(r8) :: stream_dtlimit = 15._r8 + character(len=CL) :: stream_taxmode = 'cycle' + character(*), parameter :: subName = "('PrescribedSoilMoistureInit')" + character(*), parameter :: F00 = "('(PrescribedSoilMoistureInit) ',4a)" + !----------------------------------------------------------------------- + ! + ! deal with namelist variables here in init + ! + namelist /soil_moisture_streams/ & + stream_year_first_soilm, & + stream_year_last_soilm, & + model_year_align_soilm, & + soilm_tintalgo, & + soilm_offset, & + soilm_ignore_data_if_missing, & + stream_fldfilename_soilm + + ! Default values for namelist + stream_year_first_soilm = 1 ! first year in stream to use + stream_year_last_soilm = 1 ! last year in stream to use + model_year_align_soilm = 1 ! align stream_year_first_soilm with this model year + stream_fldfilename_soilm = shr_stream_file_null + soilm_offset = 0 + soilm_ignore_data_if_missing = .false. + + ! Read soilm_streams namelist + if (masterproc) then + open( newunit=nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) + call find_nlgroup_name(nu_nml, 'soil_moisture_streams', status=nml_error) + if (nml_error == 0) then + read(nu_nml, nml=soil_moisture_streams,iostat=nml_error) + if (nml_error /= 0) then + call endrun(subname // ':: ERROR reading soil_moisture_streams namelist') + end if + else + call endrun(subname // ':: ERROR finding soilm_streams namelist') + end if + close(nu_nml) + endif + + call shr_mpi_bcast(stream_year_first_soilm, mpicom) + call shr_mpi_bcast(stream_year_last_soilm, mpicom) + call shr_mpi_bcast(model_year_align_soilm, mpicom) + call shr_mpi_bcast(stream_fldfilename_soilm, mpicom) + call shr_mpi_bcast(soilm_tintalgo, mpicom) + call shr_mpi_bcast(soilm_offset, mpicom) + call shr_mpi_bcast(soilm_ignore_data_if_missing, mpicom) + + if (masterproc) then + write(iulog,*) ' ' + write(iulog,*) 'soil_moisture_stream settings:' + write(iulog,*) ' stream_year_first_soilm = ',stream_year_first_soilm + write(iulog,*) ' stream_year_last_soilm = ',stream_year_last_soilm + write(iulog,*) ' model_year_align_soilm = ',model_year_align_soilm + write(iulog,*) ' stream_fldfilename_soilm = ',trim(stream_fldfilename_soilm) + write(iulog,*) ' soilm_tintalgo = ',trim(soilm_tintalgo) + write(iulog,*) ' soilm_offset = ',soilm_offset + if ( soilm_ignore_data_if_missing ) then + write(iulog,*) ' Do NOT override a point with streams data if the streams data is missing' + else + write(iulog,*) ' Abort, if you find a model point where the input streams data is set to missing value' + end if + endif + + ! Initialize the cdeps data type sdat_soilm + ! TODO: for now stream_meshfile is the same as the model meshfile - must generalize this if want to have + ! stream be at a different resolution + + call shr_strdata_init_from_inline(sdat_soilm, & + my_task = iam, & + logunit = iulog, & + compname = 'LND', & + model_clock = model_clock, & + model_mesh = mesh, & + stream_meshfile = model_meshfile, & + stream_lev_dimname = trim(stream_lev_dimname), & + stream_mapalgo = trim(stream_mapalgo), & + stream_filenames = (/trim(stream_fldfilename_soilm)/), & + stream_fldlistFile = (/trim(stream_var_name)/), & + stream_fldListModel = (/trim(stream_var_name)/), & + stream_yearFirst = stream_year_first_soilm, & + stream_yearLast = stream_year_last_soilm, & + stream_yearAlign = model_year_align_soilm, & + stream_offset = soilm_offset, & + stream_taxmode = stream_taxmode, & + stream_dtlimit = stream_dtlimit, & + stream_tintalgo = soilm_tintalgo, & + rc = rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then + call ESMF_Finalize(endflag=ESMF_END_ABORT) + end if + + if (masterproc) then + call shr_strdata_print(sdat_soilm,'soil moisture data') + endif + + end subroutine PrescribedSoilMoistureInit + + !----------------------------------------------------------------------- + ! + ! PrescribedSoilMoistureAdvance + ! + !----------------------------------------------------------------------- + subroutine PrescribedSoilMoistureAdvance( bounds ) + ! + ! Advanace the prescribed soil moisture stream + ! + ! !USES: + ! + ! !ARGUMENTS: + type(bounds_type) , intent(in) :: bounds + ! + ! !LOCAL VARIABLES: + integer :: rc + integer :: g, ig + integer :: ier ! error code + integer :: year ! year (0, ...) for nstep+1 + integer :: mon ! month (1, ..., 12) for nstep+1 + integer :: day ! day of month (1, ..., 31) for nstep+1 + integer :: sec ! seconds into current date for nstep+1 + integer :: mcdate ! Current model date (yyyymmdd) + !----------------------------------------------------------------------- + + rc = ESMF_SUCCESS + + call get_curr_date(year, mon, day, sec) + mcdate = year*10000 + mon*100 + day + + ! Advance sdat stream + call shr_strdata_advance(sdat_soilm, ymd=mcdate, tod=sec, logunit=iulog, istr='soil_moisture', rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then + call ESMF_Finalize(endflag=ESMF_END_ABORT) + end if + + ! Map gridcell to 1->local_size (g_to_ig is a module variable) + ier = 0 + if ( .not. allocated(g_to_ig) )then + allocate (g_to_ig(bounds%begg:bounds%endg), stat=ier) + if (ier /= 0) then + write(iulog,*) 'Prescribed soil moisture allocation error' + call endrun(msg=errMsg(sourcefile, __LINE__)) + end if + + ig = 0 + do g = bounds%begg,bounds%endg + ig = ig+1 + g_to_ig(g) = ig + end do + end if + + end subroutine PrescribedSoilMoistureAdvance + + !----------------------------------------------------------------------- + ! + ! PrescribedSoilMoistureInterp + ! + !----------------------------------------------------------------------- + subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, waterstatebulk_inst) + ! + ! Assign data stream information for prescribed soil moisture. + ! + ! !USES: + ! + ! !ARGUMENTS: + implicit none + type(bounds_type) , intent(in) :: bounds + type(soilstate_type) , intent(in) :: soilstate_inst + type(waterstatebulk_type) , intent(inout) :: waterstatebulk_inst + ! + ! !LOCAL VARIABLES: + integer :: rc + integer :: c, g, j, ig, n + real(r8) :: soilm_liq_frac ! liquid fraction of soil moisture + real(r8) :: soilm_ice_frac ! ice fraction of soil moisture + real(r8) :: moisture_increment ! soil moisture adjustment increment + real(r8) :: h2osoi_vol_initial ! initial vwc value + real(r8), pointer :: dataptr2d(:,:) ! first dimension is level, second is data on that level + character(*), parameter :: subName = "('PrescribedSoilMoistureInterp')" + !----------------------------------------------------------------------- + + SHR_ASSERT_FL( (lbound(g_to_ig,1) <= bounds%begg ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(g_to_ig,1) >= bounds%endg ), sourcefile, __LINE__) + associate( & + dz => col%dz , & ! Input: [real(r8) (:,:) ] layer depth (m) + watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) + h2osoi_liq => waterstatebulk_inst%h2osoi_liq_col , & ! Input/Output: [real(r8) (:,:) ] liquid water (kg/m2) + h2osoi_ice => waterstatebulk_inst%h2osoi_ice_col , & ! Input/Output: [real(r8) (:,:) ] ice water (kg/m2) + h2osoi_vol => waterstatebulk_inst%h2osoi_vol_col , & ! Output: volumetric soil water (m3/m3) + h2osoi_vol_prs => waterstatebulk_inst%h2osoi_vol_prs_grc & ! Output: prescribed volumetric soil water (m3/m3) + ) + SHR_ASSERT_FL( (lbound(h2osoi_vol,1) <= bounds%begc ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(h2osoi_vol,1) >= bounds%endc ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(h2osoi_vol,2) == 1 ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(h2osoi_vol,2) >= nlevsoi ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(dz,1) <= bounds%begc ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(dz,1) >= bounds%endc ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(dz,2) <= 1 ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(dz,2) >= nlevsoi ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(watsat,1) <= bounds%begc ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(watsat,1) >= bounds%endc ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(watsat,2) <= 1 ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(watsat,2) >= nlevsoi ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(h2osoi_liq,1) <= bounds%begc ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(h2osoi_liq,1) >= bounds%endc ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(h2osoi_liq,2) <= 1 ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(h2osoi_liq,2) >= nlevsoi ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(h2osoi_ice,1) <= bounds%begc ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(h2osoi_ice,1) >= bounds%endc ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(h2osoi_ice,2) <= 1 ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(h2osoi_ice,2) >= nlevsoi ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(h2osoi_vol_prs,1) <= bounds%begg ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(h2osoi_vol_prs,1) >= bounds%endg ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(h2osoi_vol_prs,2) == 1 ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(h2osoi_vol_prs,2) >= nlevsoi ), sourcefile, __LINE__) + + ! Get pointer for stream data that is time and spatially interpolate to model time and grid + call dshr_fldbun_getFldPtr(sdat_soilm%pstrm(1)%fldbun_model, trim(stream_var_name), fldptr2=dataptr2d, rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then + call ESMF_Finalize(endflag=ESMF_END_ABORT) + end if + + ! Check that inner most dimensino of dataptr2d is equal to nlevsoi + if (size(dataptr2d,dim=1) /= nlevsoi) then + if (masterproc) then + write(iulog,*) 'ERROR: dataptr2d(dim=1) = ',size(dataptr2d,dim=1),& + ' and nlevsoi = ',nlevsoi,' must match ' + end if + call endrun(trim(subname) // & + ' ERROR:: The input soil moisture stream does not have levels equal to nlevsoi') + end if + + ! Set the prescribed soil moisture read from the file everywhere + do g = bounds%begg, bounds%endg + ig = g_to_ig(g) + do j = 1, nlevsoi + h2osoi_vol_prs(g,j) = dataptr2d(j,ig) + + ! If soil moiture is being interpolated in time and the result is + ! large that probably means one of the two data points is missing (set to spval) + if ( h2osoi_vol_prs(g,j) > 10.0_r8 .and. (h2osoi_vol_prs(g,j) /= spval) )then + h2osoi_vol_prs(g,j) = spval + end if + end do + end do + + do c = bounds%begc, bounds%endc + ! Set variable for each gridcell/column combination + g = col%gridcell(c) + ig = g_to_ig(g) + + ! EBK Jan/2020, also check weights on gridcell (See https://github.com/ESCOMP/CTSM/issues/847) + if ( (lun%itype(col%landunit(c)) == istsoil) .or. & + (lun%itype(col%landunit(c)) == istcrop) .and. (col%wtgcell(c) /= 0._r8) ) then + + ! this is a 2d field (gridcell/nlevsoi) ! + do j = 1, nlevsoi + ! if soil water is zero, liq/ice fractions cannot be calculated + if((h2osoi_liq(c, j) + h2osoi_ice(c, j)) > 0._r8) then + + ! save original soil moisture value + h2osoi_vol_initial = h2osoi_vol(c,j) + + ! Check if the vegetated land mask from the dataset on the + ! file is different + if ( (h2osoi_vol_prs(g,j) == spval) .and. (h2osoi_vol_initial /= spval) )then + if ( soilm_ignore_data_if_missing )then + cycle + else + write(iulog,*) 'Input soil moisture dataset is not vegetated as expected: gridcell=', & + g, ' active = ', col%active(c) + call endrun(subname //& + ' ERROR:: The input soil moisture stream is NOT vegetated for one of the land points' ) + end if + end if + + ! update volumetric soil moisture from data prescribed from the file + h2osoi_vol(c,j) = h2osoi_vol_prs(g,j) + + ! calculate liq/ice mass fractions + soilm_liq_frac = h2osoi_liq(c, j) /(h2osoi_liq(c, j) + h2osoi_ice(c, j)) + soilm_ice_frac = h2osoi_ice(c, j) /(h2osoi_liq(c, j) + h2osoi_ice(c, j)) + + ! calculate moisture increment + moisture_increment = h2osoi_vol(c,j) - h2osoi_vol_initial + ! add limitation check + moisture_increment = min((watsat(c,j) - h2osoi_vol_initial),max(-(h2osoi_vol_initial-watmin),moisture_increment)) + + ! update liq/ice water mass due to (volumetric) moisture increment + h2osoi_liq(c,j) = h2osoi_liq(c,j) + (soilm_liq_frac * moisture_increment * dz(c, j) * denh2o) + h2osoi_ice(c,j) = h2osoi_ice(c,j) + (soilm_ice_frac * moisture_increment * dz(c, j) * denice) + + else + call endrun(subname // ':: ERROR h2osoil liquid plus ice is zero') + endif + enddo + endif + end do + + end associate + + end subroutine PrescribedSoilMoistureInterp + +end module SoilMoistureStreamMod diff --git a/src/cpl/nuopc/lnd_comp_nuopc.F90 b/src/cpl/nuopc/lnd_comp_nuopc.F90 index 172030f777..af4f1c64bf 100644 --- a/src/cpl/nuopc/lnd_comp_nuopc.F90 +++ b/src/cpl/nuopc/lnd_comp_nuopc.F90 @@ -8,6 +8,7 @@ module lnd_comp_nuopc use NUOPC , only : NUOPC_CompDerive, NUOPC_CompSetEntryPoint, NUOPC_CompSpecialize use NUOPC , only : NUOPC_CompFilterPhaseMap, NUOPC_CompAttributeGet, NUOPC_CompAttributeSet use NUOPC_Model , only : model_routine_SS => SetServices + use NUOPC_Model , only : SetVM use NUOPC_Model , only : model_label_Advance => label_Advance use NUOPC_Model , only : model_label_DataInitialize => label_DataInitialize use NUOPC_Model , only : model_label_SetRunClock => label_SetRunClock @@ -33,20 +34,21 @@ module lnd_comp_nuopc use clm_time_manager , only : get_curr_date, get_curr_calday use clm_initializeMod , only : initialize1, initialize2 use clm_driver , only : clm_drv - use lnd_import_export , only : advertise_fields, realize_fields - use lnd_import_export , only : import_fields, export_fields - use lnd_shr_methods , only : chkerr, state_setscalar, state_getscalar, state_diagnose, alarmInit - use lnd_shr_methods , only : set_component_logging, get_component_instance, log_clock_advance + use nuopc_shr_methods , only : chkerr, state_setscalar, state_getscalar, state_diagnose, alarmInit + use nuopc_shr_methods , only : set_component_logging, get_component_instance, log_clock_advance use perf_mod , only : t_startf, t_stopf, t_barrierf use netcdf , only : nf90_open, nf90_nowrite, nf90_noerr, nf90_close, nf90_strerror - use netcdf , only : nf90_inq_dimid, nf90_inq_varid, nf90_get_var + use netcdf , only : nf90_inq_dimid, nf90_inq_varid, nf90_get_var use netcdf , only : nf90_inquire_dimension, nf90_inquire_variable + use lnd_import_export , only : advertise_fields, realize_fields, import_fields, export_fields + use lnd_comp_shr , only : mesh, model_meshfile, model_clock implicit none private ! except ! Module routines public :: SetServices + public :: SetVM private :: InitializeP0 private :: InitializeAdvertise private :: InitializeRealize @@ -66,7 +68,7 @@ module lnd_comp_nuopc integer :: flds_scalar_index_ny = 0 integer :: flds_scalar_index_nextsw_cday = 0 - logical :: glc_present + logical :: glc_present logical :: rof_prognostic integer, parameter :: dbug = 0 character(*),parameter :: modName = "(lnd_comp_nuopc)" @@ -167,7 +169,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) ! local variables type(ESMF_VM) :: vm integer :: lmpicom - integer :: ierr + integer :: ierr integer :: n integer :: localpet integer :: compid ! component id @@ -199,13 +201,20 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) call mpi_comm_dup(lmpicom, mpicom, ierr) + !---------------------------------------------------------------------------- + ! reset shr logging to my log file + !---------------------------------------------------------------------------- + + call set_component_logging(gcomp, localPet==0, iulog, shrlogunit, rc) + if (ChkErr(rc,__LINE__,u_FILE_u)) return + ! Note still need compid for those parts of the code that use the data model ! functionality through subroutine calls call NUOPC_CompAttributeGet(gcomp, name='MCTID', value=cvalue, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return read(cvalue,*) compid ! convert from string to integer - call spmd_init( mpicom, compid ) + call spmd_init(mpicom, compid) !---------------------------------------------------------------------------- ! determine instance information @@ -213,15 +222,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) call get_component_instance(gcomp, inst_suffix, inst_index, rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return - - inst_name = "LND"//trim(inst_suffix) - - !---------------------------------------------------------------------------- - ! reset shr logging to my log file - !---------------------------------------------------------------------------- - - call set_component_logging(gcomp, localPet==0, iulog, shrlogunit, rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return + inst_name = 'LND' !---------------------------------------------------------------------------- ! advertise fields @@ -294,13 +295,19 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) if (trim(cvalue) == 'sglc') then glc_present = .false. else - glc_present = .true. + glc_present = .true. cism_evolve = .true. call NUOPC_CompAttributeGet(gcomp, name="cism_evolve", value=cvalue, isPresent=isPresent, isSet=isSet, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return if (isPresent .and. isSet) then call ESMF_LogWrite(trim(subname)//' cism_evolve = '//trim(cvalue), ESMF_LOGMSG_INFO) - write (cism_evolve,*) cvalue + if (trim(cvalue) .eq. '.true.') then + cism_evolve = .true. + else if (trim(cvalue) .eq. '.false.') then + cism_evolve = .false. + else + call shr_sys_abort(subname//'Could not determine cism_evolve value '//trim(cvalue)) + endif else call shr_sys_abort(subname//'Need to set cism_evolve if glc is present') endif @@ -321,7 +328,6 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) call shr_file_setLogUnit (shrlogunit) call ESMF_LogWrite(subname//' done', ESMF_LOGMSG_INFO) - end subroutine InitializeAdvertise !=============================================================================== @@ -329,7 +335,8 @@ end subroutine InitializeAdvertise subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) use clm_instMod, only : lnd2atm_inst, lnd2glc_inst, water_inst - +!$ use omp_lib, only : omp_set_num_threads + use ESMF, only : ESMF_VM, ESMF_VMGet ! input/output variables type(ESMF_GridComp) :: gcomp type(ESMF_State) :: importState @@ -338,8 +345,9 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) integer, intent(out) :: rc ! local variables - type(ESMF_Mesh) :: mesh, gridmesh ! esmf mesh + type(ESMF_Mesh) :: gridmesh ! temporary esmf mesh type(ESMF_DistGrid) :: DistGrid ! esmf global index space descriptor + type(ESMF_VM) :: vm type(ESMF_Time) :: currTime ! Current time type(ESMF_Time) :: startTime ! Start time type(ESMF_Time) :: refTime ! Ref time @@ -354,9 +362,12 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) integer :: curr_ymd ! Start date (YYYYMMDD) integer :: curr_tod ! Start time of day (sec) integer :: dtime_sync ! coupling time-step from the input synchronization clock + integer :: localPet + integer :: localpecount integer, pointer :: gindex(:) ! global index space for land and ocean points integer, pointer :: gindex_lnd(:) ! global index space for just land points integer, pointer :: gindex_ocn(:) ! global index space for just ocean points + integer, pointer :: mask(:) ! local land/ocean mask character(ESMF_MAXSTR) :: cvalue ! config data integer :: nlnd, nocn ! local size ofarrays integer :: g,n ! indices @@ -391,7 +402,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) integer :: maxIndex(2) real(r8) :: mincornerCoord(2) real(r8) :: maxcornerCoord(2) - type(ESMF_Grid) :: lgrid + type(ESMF_Grid) :: lgrid character(len=*),parameter :: subname=trim(modName)//':(InitializeRealize) ' !------------------------------------------------------------------------------- @@ -404,7 +415,6 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) call shr_file_getLogUnit (shrlogunit) call shr_file_setLogUnit (iulog) - #if (defined _MEMTRACE) if (masterproc) then lbnum=1 @@ -412,6 +422,13 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) endif #endif + call ESMF_GridCompGet(gcomp, vm=vm, localPet=localPet, rc=rc) + if (chkerr(rc,__LINE__,u_FILE_u)) return + call ESMF_VMGet(vm, pet=localPet, peCount=localPeCount, rc=rc) + if (chkerr(rc,__LINE__,u_FILE_u)) return + +!$ call omp_set_num_threads(localPeCount) + !---------------------- ! Obtain attribute values !---------------------- @@ -533,6 +550,12 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) ref_tod_in=ref_tod, & dtime_in=dtime_sync) + !---------------------------------------------------------------------------- + ! Set model clock in lnd_comp_shr + !---------------------------------------------------------------------------- + + model_clock = clock + !---------------------- ! Read namelist, grid and surface data !---------------------- @@ -553,7 +576,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) ! If no land then abort for now ! TODO: need to handle the case of noland with CMEPS ! if ( noland ) then - ! call shr_sys_abort(trim(subname)//"ERROR: Currently cannot handle case of single column with non-land") + ! call shr_sys_abort(trim(subname)//"ERROR: Currently cannot handle case of single column with non-land") ! end if ! obtain global index array for just land points which includes mask=0 or ocean points @@ -568,11 +591,14 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) ! create a global index that includes both land and ocean points nocn = size(gindex_ocn) allocate(gindex(nlnd + nocn)) + allocate(mask(nlnd + nocn)) do n = 1,nlnd+nocn if (n <= nlnd) then gindex(n) = gindex_lnd(n) + mask(n) = 1 else gindex(n) = gindex_ocn(n-nlnd) + mask(n) = 0 end if end do @@ -586,11 +612,11 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) !-------------------------------- ! determine if the mesh will be created or read in - call NUOPC_CompAttributeGet(gcomp, name='mesh_lnd', value=cvalue, rc=rc) + call NUOPC_CompAttributeGet(gcomp, name='mesh_lnd', value=model_meshfile, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return - if (single_column) cvalue = 'create_mesh' + if (single_column) model_meshfile = 'create_mesh' - if (cvalue == 'create_mesh') then + if (trim(model_meshfile) == 'create_mesh') then ! get the datm grid from the domain file call NUOPC_CompAttributeGet(gcomp, name='domain_lnd', value=cvalue, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return @@ -639,29 +665,40 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return ! create the mesh from the grid - gridmesh = ESMF_MeshCreate(lgrid, rc=rc) + mesh = ESMF_MeshCreate(lgrid, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return - ! Now redistribute the mesh to use the internal distrid - mesh = ESMF_MeshCreate(gridmesh, elementDistgrid=Distgrid, rc=rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return + ! TODO: is the mask by default set to 1 if created from a grid? + ! reset the global mask (which is 1) to the land/ocean mask + ! + ! Currently, this call requires that the information has + ! already been added to the mesh during creation. For example, + ! you can only change the element mask information, if the mesh + ! was initially created with element masking. + !!! call ESMF_MeshSet(mesh, elementMask=mask, rc=rc) + !!! if (ChkErr(rc,__LINE__,u_FILE_u)) return + + deallocate(mask) + else + ! read in the mesh from the file - mesh = ESMF_MeshCreate(filename=trim(cvalue), fileformat=ESMF_FILEFORMAT_ESMFMESH, & + mesh = ESMF_MeshCreate(filename=trim(model_meshfile), fileformat=ESMF_FILEFORMAT_ESMFMESH, & elementDistgrid=Distgrid, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return if (masterproc) then - write(iulog,*)'mesh file for domain is ',trim(cvalue) + write(iulog,*)'mesh file for domain is ',trim(model_meshfile) end if - end if - ! Determine the areas on the mesh - areaField = ESMF_FieldCreate(mesh, ESMF_TYPEKIND_R8, name='mesh_areas', meshloc=ESMF_MESHLOC_ELEMENT, rc=rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return - call ESMF_FieldRegridGetArea(areaField, rc=rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return - call ESMF_FieldGet(areaField, farrayPtr=areaPtr, rc=rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return + ! Determine the areas on the mesh + areaField = ESMF_FieldCreate(mesh, ESMF_TYPEKIND_R8, name='mesh_areas', meshloc=ESMF_MESHLOC_ELEMENT, rc=rc) + if (ChkErr(rc,__LINE__,u_FILE_u)) return + call ESMF_FieldRegridGetArea(areaField, rc=rc) + if (ChkErr(rc,__LINE__,u_FILE_u)) return + call ESMF_FieldGet(areaField, farrayPtr=areaPtr, rc=rc) + if (ChkErr(rc,__LINE__,u_FILE_u)) return + + end if ! realize the actively coupled fields call realize_fields(gcomp, mesh, flds_scalar_name, flds_scalar_num, rc) @@ -678,33 +715,35 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) ! obtain mesh lats and lons !-------------------------------- - call ESMF_MeshGet(mesh, spatialDim=spatialDim, numOwnedElements=numOwnedElements, rc=rc) - if (ChkErr(rc,__LINE__,u_FILE_u)) return - allocate(ownedElemCoords(spatialDim*numOwnedElements)) - call ESMF_MeshGet(mesh, ownedElemCoords=ownedElemCoords) - if (ChkErr(rc,__LINE__,u_FILE_u)) return - do g = bounds%begg,bounds%endg - n = 1 + (g - bounds%begg) - mesh_lon = ownedElemCoords(2*n-1) - mesh_lat = ownedElemCoords(2*n) - mesh_area = areaPtr(n) - if (abs(mesh_lon - ldomain%lonc(g)) > tolerance_latlon) then - write(6,100)'ERROR: clm_lon, mesh_lon, diff_lon = ',& - ldomain%lonc(g), mesh_lon, abs(mesh_lon - ldomain%lonc(g)) - !call shr_sys_abort() - end if - if (abs(mesh_lat - ldomain%latc(g)) > tolerance_latlon) then - write(6,100)'ERROR: clm_lat, mesh_lat, diff_lat = ',& - ldomain%latc(g), mesh_lat, abs(mesh_lat - ldomain%latc(g)) - !call shr_sys_abort() - end if - if (abs(mesh_area - ldomain%area(g)/(re*re)) > tolerance_area) then - write(6,100)'ERROR: clm_area, mesh_area, diff_area = ',& - ldomain%area(g)/(re*re), mesh_area, abs(mesh_area - ldomain%area(g)/(re*re)) - !call shr_sys_abort() - end if - end do -100 format(a,3(d13.5,2x)) + if (trim(model_meshfile) /= 'create_mesh') then + call ESMF_MeshGet(mesh, spatialDim=spatialDim, numOwnedElements=numOwnedElements, rc=rc) + if (ChkErr(rc,__LINE__,u_FILE_u)) return + allocate(ownedElemCoords(spatialDim*numOwnedElements)) + call ESMF_MeshGet(mesh, ownedElemCoords=ownedElemCoords) + if (ChkErr(rc,__LINE__,u_FILE_u)) return + do g = bounds%begg,bounds%endg + n = 1 + (g - bounds%begg) + mesh_lon = ownedElemCoords(2*n-1) + mesh_lat = ownedElemCoords(2*n) + mesh_area = areaPtr(n) + if (abs(mesh_lon - ldomain%lonc(g)) > tolerance_latlon) then + write(6,100)'ERROR: clm_lon, mesh_lon, diff_lon = ',& + ldomain%lonc(g), mesh_lon, abs(mesh_lon - ldomain%lonc(g)) + !call shr_sys_abort() + end if + if (abs(mesh_lat - ldomain%latc(g)) > tolerance_latlon) then + write(6,100)'ERROR: clm_lat, mesh_lat, diff_lat = ',& + ldomain%latc(g), mesh_lat, abs(mesh_lat - ldomain%latc(g)) + !call shr_sys_abort() + end if + if (abs(mesh_area - ldomain%area(g)/(re*re)) > tolerance_area) then + write(6,100)'ERROR: clm_area, mesh_area, diff_area = ',& + ldomain%area(g)/(re*re), mesh_area, abs(mesh_area - ldomain%area(g)/(re*re)) + !call shr_sys_abort() + end if + end do +100 format(a,3(d13.5,2x)) + end if !-------------------------------- ! Create land export state @@ -747,7 +786,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) #if (defined _MEMTRACE) if(masterproc) then - write(iulog,*) TRIM(Sub) // ':end::' + write(iulog,*) TRIM(subname) // ':end::' lbnum=1 call memmon_dump_fort('memmon.out','lnd_comp_nuopc_InitializeRealize:end::',lbnum) call memmon_reset_addr() @@ -765,8 +804,10 @@ subroutine ModelAdvance(gcomp, rc) !------------------------ ! Run CTSM !------------------------ - + use clm_instMod, only : water_inst, atm2lnd_inst, glc2lnd_inst, lnd2atm_inst, lnd2glc_inst + !$ use omp_lib, only : omp_set_num_threads + use ESMF, only : ESMF_VM, ESMF_VMGet ! input/output variables type(ESMF_GridComp) :: gcomp @@ -778,6 +819,7 @@ subroutine ModelAdvance(gcomp, rc) type(ESMF_Time) :: currTime type(ESMF_Time) :: nextTime type(ESMF_State) :: importState, exportState + type(ESMF_VM) :: vm character(ESMF_MAXSTR) :: cvalue character(ESMF_MAXSTR) :: case_name ! case name integer :: ymd ! CTSM current date (YYYYMMDD) @@ -792,6 +834,8 @@ subroutine ModelAdvance(gcomp, rc) integer :: tod_sync ! Sync current time of day (sec) integer :: dtime ! time step increment (sec) integer :: nstep ! time step index + integer :: localPet + integer :: localpecount logical :: rstwr ! .true. ==> write restart file before returning logical :: nlend ! .true. ==> last time-step logical :: dosend ! true => send data back to driver @@ -813,6 +857,13 @@ subroutine ModelAdvance(gcomp, rc) rc = ESMF_SUCCESS call ESMF_LogWrite(subname//' called', ESMF_LOGMSG_INFO) + call ESMF_GridCompGet(gcomp, vm=vm, localPet=localPet, rc=rc) + if (chkerr(rc,__LINE__,u_FILE_u)) return + call ESMF_VMGet(vm, pet=localPet, peCount=localPeCount, rc=rc) + if (chkerr(rc,__LINE__,u_FILE_u)) return + + !$ call omp_set_num_threads(localPeCount) + call shr_file_getLogUnit (shrlogunit) call shr_file_setLogUnit (iulog) @@ -879,7 +930,7 @@ subroutine ModelAdvance(gcomp, rc) caldayp1 = get_curr_calday(offset=dtime) if (nstep == 0) then - doalb = .false. + doalb = .false. else if (nstep == 1) then doalb = (abs(nextsw_cday- caldayp1) < 1.e-10_r8) else @@ -1191,7 +1242,7 @@ subroutine clm_orbital_init(gcomp, logunit, mastertask, rc) ! input/output variables type(ESMF_GridComp) , intent(in) :: gcomp integer , intent(in) :: logunit - logical , intent(in) :: mastertask + logical , intent(in) :: mastertask integer , intent(out) :: rc ! output error ! local variables @@ -1285,12 +1336,12 @@ end subroutine clm_orbital_init subroutine clm_orbital_update(clock, logunit, mastertask, eccen, obliqr, lambm0, mvelpp, rc) !---------------------------------------------------------- - ! Update orbital settings + ! Update orbital settings !---------------------------------------------------------- ! input/output variables type(ESMF_Clock) , intent(in) :: clock - integer , intent(in) :: logunit + integer , intent(in) :: logunit logical , intent(in) :: mastertask real(R8) , intent(inout) :: eccen ! orbital eccentricity real(R8) , intent(inout) :: obliqr ! Earths obliquity in rad @@ -1300,7 +1351,7 @@ subroutine clm_orbital_update(clock, logunit, mastertask, eccen, obliqr, lambm0 ! local variables type(ESMF_Time) :: CurrTime ! current time - integer :: year ! model year at current time + integer :: year ! model year at current time integer :: orb_year ! orbital year for current orbital computation character(len=CL) :: msgstr ! temporary logical :: lprint @@ -1316,7 +1367,7 @@ subroutine clm_orbital_update(clock, logunit, mastertask, eccen, obliqr, lambm0 orb_year = orb_iyear + (year - orb_iyear_align) lprint = mastertask else - orb_year = orb_iyear + orb_year = orb_iyear if (first_time) then lprint = mastertask first_time = .false. diff --git a/src/cpl/nuopc/lnd_comp_shr.F90 b/src/cpl/nuopc/lnd_comp_shr.F90 new file mode 100644 index 0000000000..dd619c7648 --- /dev/null +++ b/src/cpl/nuopc/lnd_comp_shr.F90 @@ -0,0 +1,15 @@ +module lnd_comp_shr + + ! Model mesh info is here in order to be leveraged by CDEPS in line calls + + use ESMF + use shr_kind_mod, only : r8 => shr_kind_r8, cl=>shr_kind_cl + + implicit none + public + + type(ESMF_Clock) :: model_clock ! model clock + type(ESMF_Mesh) :: mesh ! model_mesh + character(len=cl) :: model_meshfile ! model mesh file + +end module lnd_comp_shr diff --git a/src/cpl/nuopc/lnd_import_export.F90 b/src/cpl/nuopc/lnd_import_export.F90 index c55f1e16b4..346e4f6e7f 100644 --- a/src/cpl/nuopc/lnd_import_export.F90 +++ b/src/cpl/nuopc/lnd_import_export.F90 @@ -8,8 +8,6 @@ module lnd_import_export use NUOPC , only : NUOPC_CompAttributeGet, NUOPC_Advertise, NUOPC_IsConnected use NUOPC_Model , only : NUOPC_ModelGet use shr_kind_mod , only : r8 => shr_kind_r8, cx=>shr_kind_cx, cxx=>shr_kind_cxx, cs=>shr_kind_cs - use shr_infnan_mod , only : isnan => shr_infnan_isnan - use shr_string_mod , only : shr_string_listGetName, shr_string_listGetNum use shr_sys_mod , only : shr_sys_abort use clm_varctl , only : iulog use clm_time_manager , only : get_nstep @@ -20,12 +18,13 @@ module lnd_import_export use glc2lndMod , only : glc2lnd_type use domainMod , only : ldomain use spmdMod , only : masterproc - use seq_drydep_mod , only : seq_drydep_readnl, n_drydep, seq_drydep_init + use seq_drydep_mod , only : seq_drydep_readnl, n_drydep use shr_megan_mod , only : shr_megan_readnl, shr_megan_mechcomps_n use shr_fire_emis_mod , only : shr_fire_emis_readnl use shr_carma_mod , only : shr_carma_readnl use shr_ndep_mod , only : shr_ndep_readnl - use lnd_shr_methods , only : chkerr + use nuopc_shr_methods , only : chkerr + use lnd_import_export_utils, only : derive_quantities, check_for_errors, check_for_nans implicit none private ! except @@ -40,7 +39,6 @@ module lnd_import_export private :: state_getimport private :: state_setexport private :: state_getfldptr - private :: check_for_nans type fld_list_type character(len=128) :: stdname @@ -56,7 +54,7 @@ module lnd_import_export integer, parameter :: gridTofieldMap = 2 ! ungridded dimension is innermost ! from atm->lnd - integer :: ndep_nflds ! number of nitrogen deposition fields from atm->lnd/ocn + integer :: ndep_nflds ! number of nitrogen deposition fields from atm->lnd/ocn ! from lnd->atm character(len=cx) :: carma_fields ! List of CARMA fields from lnd->atm @@ -67,7 +65,7 @@ module lnd_import_export logical :: flds_co2a ! use case logical :: flds_co2b ! use case logical :: flds_co2c ! use case - integer :: glc_nec ! number of glc elevation classes + integer :: glc_nec ! number of glc elevation classes integer, parameter :: debug = 0 ! internal debug level character(*),parameter :: F01 = "('(lnd_import_export) ',a,i5,2x,i5,2x,d21.14)" @@ -187,7 +185,6 @@ subroutine advertise_fields(gcomp, flds_scalar_name, glc_present, cism_evolve, r if (drydep_nflds > 0) then call fldlist_add(fldsFrLnd_num, fldsFrLnd, 'Sl_ddvel', ungridded_lbound=1, ungridded_ubound=drydep_nflds) end if - call seq_drydep_init( ) ! MEGAN VOC emissions fluxes from land call shr_megan_readnl('drv_flds_in', megan_nflds) @@ -263,7 +260,7 @@ subroutine advertise_fields(gcomp, flds_scalar_name, glc_present, cism_evolve, r call fldlist_add(fldsToLnd_num, fldsToLnd, 'Faxa_ocph', ungridded_lbound=1, ungridded_ubound=3) ! from atm - wet dust deposition frluxes (4 sizes) - ! (1) => dstwet1, (2) => dstwet2, (3) => dstwet3, (4) => dstwet4 + ! (1) => dstwet1, (2) => dstwet2, (3) => dstwet3, (4) => dstwet4 call fldlist_add(fldsToLnd_num, fldsToLnd, 'Faxa_dstwet', ungridded_lbound=1, ungridded_ubound=4) ! from - atm dry dust deposition frluxes (4 sizes) @@ -291,10 +288,10 @@ subroutine advertise_fields(gcomp, flds_scalar_name, glc_present, cism_evolve, r end if if (glc_present) then - ! from land-ice (glc) - no elevation classes + ! from land-ice (glc) - no elevation classes call fldlist_add(fldsToLnd_num, fldsToLnd, 'Sg_icemask' ) ! mask of where cism is running - call fldlist_add(fldsToLnd_num, fldsToLnd, 'Sg_icemask_coupled_fluxes') ! - + call fldlist_add(fldsToLnd_num, fldsToLnd, 'Sg_icemask_coupled_fluxes') ! + ! from land-ice (glc) - fields for all glc->lnd elevation classes (1:glc_nec) plus bare land (index 0) call fldlist_add(fldsToLnd_num, fldsToLnd, 'Sg_ice_covered_elev', ungridded_lbound=1, ungridded_ubound=glc_nec+1) call fldlist_add(fldsToLnd_num, fldsToLnd, 'Sg_topo_elev' , ungridded_lbound=1, ungridded_ubound=glc_nec+1) @@ -320,7 +317,7 @@ subroutine realize_fields(gcomp, Emesh, flds_scalar_name, flds_scalar_num, rc) type(ESMF_GridComp) , intent(inout) :: gcomp type(ESMF_Mesh) , intent(in) :: Emesh character(len=*) , intent(in) :: flds_scalar_name - integer , intent(in) :: flds_scalar_num + integer , intent(in) :: flds_scalar_num integer , intent(out) :: rc ! local variables @@ -369,6 +366,7 @@ subroutine import_fields( gcomp, bounds, glc_present, rof_prognostic, & use clm_varcon , only: rair, o2_molar_const, c13ratio use shr_const_mod , only: SHR_CONST_TKFRZ use Wateratm2lndBulkType , only: wateratm2lndbulk_type + use QSatMod , only: QSat ! input/output variabes type(ESMF_GridComp) :: gcomp @@ -388,15 +386,7 @@ subroutine import_fields( gcomp, bounds, glc_present, rof_prognostic, & integer :: num integer :: begg, endg ! bounds integer :: g,i,k ! indices - real(r8) :: e ! vapor pressure (Pa) - real(r8) :: qsat ! saturation specific humidity (kg/kg) - real(r8) :: esatw ! saturation vapor pressure over water (Pa) - real(r8) :: esati ! saturation vapor pressure over ice (Pa) - real(r8) :: a0,a1,a2,a3,a4,a5,a6 ! coefficients for esat over water - real(r8) :: b0,b1,b2,b3,b4,b5,b6 ! coefficients for esat over ice - real(r8) :: tdc, t ! Kelvins to Celcius function and its input - real(r8) :: forc_t ! atmospheric temperature (Kelvin) - real(r8) :: forc_q ! atmospheric specific humidity (kg/kg) + real(r8) :: qsat_kg_kg ! saturation specific humidity (kg/kg) real(r8) :: forc_pbot ! atmospheric pressure (Pa) real(r8) :: co2_ppmv_input(bounds%begg:bounds%endg) ! temporary real(r8) :: forc_rainc(bounds%begg:bounds%endg) ! rainxy Atm flux mm/s @@ -412,21 +402,6 @@ subroutine import_fields( gcomp, bounds, glc_present, rof_prognostic, & real(r8) :: icemask_coupled_fluxes_grc(bounds%begg:bounds%endg) character(len=*), parameter :: subname='(lnd_import_export:import_fields)' - ! Constants to compute vapor pressure - parameter (a0=6.107799961_r8 , a1=4.436518521e-01_r8, & - a2=1.428945805e-02_r8, a3=2.650648471e-04_r8, & - a4=3.031240396e-06_r8, a5=2.034080948e-08_r8, & - a6=6.136820929e-11_r8) - - parameter (b0=6.109177956_r8 , b1=5.034698970e-01_r8, & - b2=1.886013408e-02_r8, b3=4.176223716e-04_r8, & - b4=5.824720280e-06_r8, b5=4.838803174e-08_r8, & - b6=1.838826904e-10_r8) - - ! function declarations - tdc(t) = min( 50._r8, max(-50._r8,(t-SHR_CONST_TKFRZ)) ) - esatw(t) = 100._r8*(a0+t*(a1+t*(a2+t*(a3+t*(a4+t*(a5+t*a6)))))) - esati(t) = 100._r8*(b0+t*(b1+t*(b2+t*(b3+t*(b4+t*(b5+t*b6)))))) !--------------------------------------------------------------------------- rc = ESMF_SUCCESS @@ -653,12 +628,12 @@ subroutine import_fields( gcomp, bounds, glc_present, rof_prognostic, & !-------------------------- ! Land-ice (glc) fields !-------------------------- - + if (glc_present) then ! We could avoid setting these fields if glc_present is .false., if that would ! help with performance. (The downside would be that we wouldn't have these fields ! available for diagnostic purposes or to force a later T compset with dlnd.) - + do num = 0,glc_nec call state_getimport(importState, 'Sg_ice_covered_elev', bounds, frac_grc(:,num), ungridded_index=num+1, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return @@ -677,79 +652,14 @@ subroutine import_fields( gcomp, bounds, glc_present, rof_prognostic, & end if !-------------------------- - ! Derived quantities - !-------------------------- - - do g = begg, endg - forc_t = atm2lnd_inst%forc_t_not_downscaled_grc(g) - forc_q = wateratm2lndbulk_inst%forc_q_not_downscaled_grc(g) - forc_pbot = atm2lnd_inst%forc_pbot_not_downscaled_grc(g) - - atm2lnd_inst%forc_hgt_u_grc(g) = atm2lnd_inst%forc_hgt_grc(g) !observational height of wind [m] - atm2lnd_inst%forc_hgt_t_grc(g) = atm2lnd_inst%forc_hgt_grc(g) !observational height of temperature [m] - atm2lnd_inst%forc_hgt_q_grc(g) = atm2lnd_inst%forc_hgt_grc(g) !observational height of humidity [m] - - atm2lnd_inst%forc_vp_grc(g) = forc_q * forc_pbot / (0.622_r8 + 0.378_r8 * forc_q) - - atm2lnd_inst%forc_rho_not_downscaled_grc(g) = & - (forc_pbot - 0.378_r8 * atm2lnd_inst%forc_vp_grc(g)) / (rair * forc_t) - - atm2lnd_inst%forc_po2_grc(g) = o2_molar_const * forc_pbot - - atm2lnd_inst%forc_wind_grc(g) = sqrt(atm2lnd_inst%forc_u_grc(g)**2 + atm2lnd_inst%forc_v_grc(g)**2) - - atm2lnd_inst%forc_solar_grc(g) = atm2lnd_inst%forc_solad_grc(g,1) + atm2lnd_inst%forc_solai_grc(g,1) + & - atm2lnd_inst%forc_solad_grc(g,2) + atm2lnd_inst%forc_solai_grc(g,2) - - wateratm2lndbulk_inst%forc_rain_not_downscaled_grc(g) = forc_rainc(g) + forc_rainl(g) - wateratm2lndbulk_inst%forc_snow_not_downscaled_grc(g) = forc_snowc(g) + forc_snowl(g) - - if (forc_t > SHR_CONST_TKFRZ) then - e = esatw(tdc(forc_t)) - else - e = esati(tdc(forc_t)) - end if - qsat = 0.622_r8*e / (forc_pbot - 0.378_r8*e) - - ! modify specific humidity if precip occurs - if (1==2) then - if ((forc_rainc(g)+forc_rainl(g)) > 0._r8) then - forc_q = 0.95_r8*qsat - !forc_q = qsat - wateratm2lndbulk_inst%forc_q_not_downscaled_grc(g) = forc_q - endif - endif - - wateratm2lndbulk_inst%forc_rh_grc(g) = 100.0_r8*(forc_q / qsat) - end do - - !-------------------------- - ! Error checks + ! Derived quantities for required fields + ! and corresponding error checks !-------------------------- - ! Check that solar, specific-humidity and LW downward aren't negative - do g = begg,endg - if ( atm2lnd_inst%forc_lwrad_not_downscaled_grc(g) <= 0.0_r8 ) then - call shr_sys_abort( subname//& - ' ERROR: Longwave down sent from the atmosphere model is negative or zero' ) - end if - if ( (atm2lnd_inst%forc_solad_grc(g,1) < 0.0_r8) .or. & - (atm2lnd_inst%forc_solad_grc(g,2) < 0.0_r8) .or. & - (atm2lnd_inst%forc_solai_grc(g,1) < 0.0_r8) .or. & - (atm2lnd_inst%forc_solai_grc(g,2) < 0.0_r8) ) then - call shr_sys_abort( subname//& - ' ERROR: One of the solar fields (indirect/diffuse, vis or near-IR)'// & - ' from the atmosphere model is negative or zero' ) - end if - if ( wateratm2lndbulk_inst%forc_q_not_downscaled_grc(g) < 0.0_r8 )then - call shr_sys_abort( subname//& - ' ERROR: Bottom layer specific humidty sent from the atmosphere model is less than zero' ) - end if - end do + call derive_quantities(bounds, atm2lnd_inst, wateratm2lndbulk_inst, & + forc_rainc, forc_rainl, forc_snowc, forc_snowl) - ! Make sure relative humidity is properly bounded - ! atm2lnd_inst%forc_rh_grc(g) = min( 100.0_r8, atm2lnd_inst%forc_rh_grc(g) ) - ! atm2lnd_inst%forc_rh_grc(g) = max( 0.0_r8, atm2lnd_inst%forc_rh_grc(g) ) + call check_for_errors(bounds, atm2lnd_inst, wateratm2lndbulk_inst) end subroutine import_fields @@ -1338,31 +1248,4 @@ subroutine state_getfldptr(State, fldname, fldptr1d, fldptr2d, rc) end subroutine state_getfldptr - !=============================================================================== - - subroutine check_for_nans(array, fname, begg) - - ! input/output variables - real(r8) , intent(in) :: array(:) - character(len=*) , intent(in) :: fname - integer , intent(in) :: begg - - ! local variables - integer :: i - !------------------------------------------------------------------------------- - - ! Check if any input from mediator or output to mediator is NaN - - if (any(isnan(array))) then - write(iulog,*) '# of NaNs = ', count(isnan(array)) - write(iulog,*) 'Which are NaNs = ', isnan(array) - do i = 1, size(array) - if (isnan(array(i))) then - write(iulog,*) "NaN found in field ", trim(fname), ' at gridcell index ',begg+i-1 - end if - end do - call shr_sys_abort(' ERROR: One or more of the output from CLM to the coupler are NaN ' ) - end if - end subroutine check_for_nans - end module lnd_import_export diff --git a/src/cpl/nuopc/lnd_shr_methods.F90 b/src/cpl/nuopc/lnd_shr_methods.F90 deleted file mode 100644 index 13438e855f..0000000000 --- a/src/cpl/nuopc/lnd_shr_methods.F90 +++ /dev/null @@ -1,831 +0,0 @@ -module lnd_shr_methods - - use ESMF , only : operator(<), operator(/=), operator(+) - use ESMF , only : operator(-), operator(*) , operator(>=) - use ESMF , only : operator(<=), operator(>), operator(==) - use ESMF , only : ESMF_LOGERR_PASSTHRU, ESMF_LogFoundError, ESMF_LOGMSG_ERROR, ESMF_MAXSTR - use ESMF , only : ESMF_SUCCESS, ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_FAILURE - use ESMF , only : ESMF_State, ESMF_StateGet - use ESMF , only : ESMF_Field, ESMF_FieldGet - use ESMF , only : ESMF_GridComp, ESMF_GridCompGet, ESMF_GridCompSet - use ESMF , only : ESMF_GeomType_Flag, ESMF_FieldStatus_Flag - use ESMF , only : ESMF_Mesh, ESMF_MeshGet - use ESMF , only : ESMF_GEOMTYPE_MESH, ESMF_GEOMTYPE_GRID, ESMF_FIELDSTATUS_COMPLETE - use ESMF , only : ESMF_Clock, ESMF_ClockCreate, ESMF_ClockGet, ESMF_ClockSet - use ESMF , only : ESMF_ClockPrint, ESMF_ClockAdvance - use ESMF , only : ESMF_Alarm, ESMF_AlarmCreate, ESMF_AlarmGet, ESMF_AlarmSet - use ESMF , only : ESMF_Calendar, ESMF_CALKIND_NOLEAP, ESMF_CALKIND_GREGORIAN - use ESMF , only : ESMF_Time, ESMF_TimeGet, ESMF_TimeSet - use ESMF , only : ESMF_TimeInterval, ESMF_TimeIntervalSet, ESMF_TimeIntervalGet - use ESMF , only : ESMF_VM, ESMF_VMGet, ESMF_VMBroadcast, ESMF_VMGetCurrent - use NUOPC , only : NUOPC_CompAttributeGet - use NUOPC_Model , only : NUOPC_ModelGet - use shr_kind_mod , only : r8 => shr_kind_r8, cl=>shr_kind_cl, cs=>shr_kind_cs - use shr_sys_mod , only : shr_sys_abort - use shr_file_mod , only : shr_file_setlogunit, shr_file_getLogUnit - - implicit none - private - - public :: memcheck - public :: get_component_instance - public :: set_component_logging - public :: log_clock_advance - public :: state_getscalar - public :: state_setscalar - public :: state_diagnose - public :: alarmInit - public :: chkerr - - private :: timeInit - private :: field_getfldptr - - ! Clock and alarm options - character(len=*), private, parameter :: & - optNONE = "none" , & - optNever = "never" , & - optNSteps = "nsteps" , & - optNStep = "nstep" , & - optNSeconds = "nseconds" , & - optNSecond = "nsecond" , & - optNMinutes = "nminutes" , & - optNMinute = "nminute" , & - optNHours = "nhours" , & - optNHour = "nhour" , & - optNDays = "ndays" , & - optNDay = "nday" , & - optNMonths = "nmonths" , & - optNMonth = "nmonth" , & - optNYears = "nyears" , & - optNYear = "nyear" , & - optMonthly = "monthly" , & - optYearly = "yearly" , & - optDate = "date" , & - optIfdays0 = "ifdays0" - - ! Module data - integer, parameter :: SecPerDay = 86400 ! Seconds per day - integer, parameter :: memdebug_level=1 - character(len=1024) :: msgString - character(len=*), parameter :: u_FILE_u = & - __FILE__ - -!=============================================================================== -contains -!=============================================================================== - - subroutine memcheck(string, level, mastertask) - - ! input/output variables - character(len=*) , intent(in) :: string - integer , intent(in) :: level - logical , intent(in) :: mastertask - - ! local variables - integer :: ierr - integer, external :: GPTLprint_memusage - !----------------------------------------------------------------------- - - if ((mastertask .and. memdebug_level > level) .or. memdebug_level > level+1) then - ierr = GPTLprint_memusage(string) - endif - - end subroutine memcheck - -!=============================================================================== - - subroutine get_component_instance(gcomp, inst_suffix, inst_index, rc) - - ! input/output variables - type(ESMF_GridComp) :: gcomp - character(len=*) , intent(out) :: inst_suffix - integer , intent(out) :: inst_index - integer , intent(out) :: rc - - ! local variables - logical :: isPresent - character(len=4) :: cvalue - !----------------------------------------------------------------------- - - rc = ESMF_SUCCESS - - call NUOPC_CompAttributeGet(gcomp, name="inst_suffix", isPresent=isPresent, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - - if (isPresent) then - call NUOPC_CompAttributeGet(gcomp, name="inst_suffix", value=inst_suffix, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - cvalue = inst_suffix(2:) - read(cvalue, *) inst_index - else - inst_suffix = "" - inst_index=1 - endif - - end subroutine get_component_instance - -!=============================================================================== - - subroutine set_component_logging(gcomp, mastertask, logunit, shrlogunit, rc) - - ! input/output variables - type(ESMF_GridComp) :: gcomp - logical, intent(in) :: mastertask - integer, intent(out) :: logunit - integer, intent(out) :: shrlogunit - integer, intent(out) :: rc - - ! local variables - character(len=CL) :: diro - character(len=CL) :: logfile - !----------------------------------------------------------------------- - - rc = ESMF_SUCCESS - - shrlogunit = 6 - - if (mastertask) then - call NUOPC_CompAttributeGet(gcomp, name="diro", value=diro, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - call NUOPC_CompAttributeGet(gcomp, name="logfile", value=logfile, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - - open(newunit=logunit,file=trim(diro)//"/"//trim(logfile)) - else - logUnit = 6 - endif - - call shr_file_setLogUnit (logunit) - - end subroutine set_component_logging - -!=============================================================================== - - subroutine log_clock_advance(clock, component, logunit, rc) - - ! input/output variables - type(ESMF_Clock) :: clock - character(len=*) , intent(in) :: component - integer , intent(in) :: logunit - integer , intent(out) :: rc - - ! local variables - character(len=CL) :: cvalue, prestring - !----------------------------------------------------------------------- - - rc = ESMF_SUCCESS - - write(prestring, *) "------>Advancing ",trim(component)," from: " - call ESMF_ClockPrint(clock, options="currTime", unit=cvalue, preString=trim(prestring), rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - write(logunit, *) trim(cvalue) - - call ESMF_ClockPrint(clock, options="stopTime", unit=cvalue, & - preString="--------------------------------> to: ", rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - write(logunit, *) trim(cvalue) - - end subroutine log_clock_advance - -!=============================================================================== - - subroutine state_getscalar(state, scalar_id, scalar_value, flds_scalar_name, flds_scalar_num, rc) - - ! ---------------------------------------------- - ! Get scalar data from State for a particular name and broadcast it to all other pets - ! ---------------------------------------------- - - ! input/output variables - type(ESMF_State), intent(in) :: state - integer, intent(in) :: scalar_id - real(r8), intent(out) :: scalar_value - character(len=*), intent(in) :: flds_scalar_name - integer, intent(in) :: flds_scalar_num - integer, intent(inout) :: rc - - ! local variables - integer :: mytask, ierr, len - type(ESMF_VM) :: vm - type(ESMF_Field) :: field - real(r8), pointer :: farrayptr(:,:) - real(r8) :: tmp(1) - character(len=*), parameter :: subname='(state_getscalar)' - ! ---------------------------------------------- - - rc = ESMF_SUCCESS - - call ESMF_VMGetCurrent(vm, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - - call ESMF_VMGet(vm, localPet=mytask, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - - call ESMF_StateGet(State, itemName=trim(flds_scalar_name), field=field, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - - if (mytask == 0) then - call ESMF_FieldGet(field, farrayPtr = farrayptr, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - if (scalar_id < 0 .or. scalar_id > flds_scalar_num) then - call ESMF_LogWrite(trim(subname)//": ERROR in scalar_id", ESMF_LOGMSG_INFO, line=__LINE__, file=u_FILE_u) - rc = ESMF_FAILURE - if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=u_FILE_u)) return - endif - tmp(:) = farrayptr(scalar_id,:) - endif - call ESMF_VMBroadCast(vm, tmp, 1, 0, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - scalar_value = tmp(1) - - end subroutine state_getscalar - -!================================================================================ - - subroutine state_setscalar(scalar_value, scalar_id, State, flds_scalar_name, flds_scalar_num, rc) - - ! ---------------------------------------------- - ! Set scalar data from State for a particular name - ! ---------------------------------------------- - - ! input/output arguments - real(r8), intent(in) :: scalar_value - integer, intent(in) :: scalar_id - type(ESMF_State), intent(inout) :: State - character(len=*), intent(in) :: flds_scalar_name - integer, intent(in) :: flds_scalar_num - integer, intent(inout) :: rc - - ! local variables - integer :: mytask - type(ESMF_Field) :: lfield - type(ESMF_VM) :: vm - real(r8), pointer :: farrayptr(:,:) - character(len=*), parameter :: subname='(state_setscalar)' - ! ---------------------------------------------- - - rc = ESMF_SUCCESS - - call ESMF_VMGetCurrent(vm, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - - call ESMF_VMGet(vm, localPet=mytask, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - - call ESMF_StateGet(State, itemName=trim(flds_scalar_name), field=lfield, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - - if (mytask == 0) then - call ESMF_FieldGet(lfield, farrayPtr = farrayptr, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - if (scalar_id < 0 .or. scalar_id > flds_scalar_num) then - call ESMF_LogWrite(trim(subname)//": ERROR in scalar_id", ESMF_LOGMSG_INFO) - rc = ESMF_FAILURE - return - endif - farrayptr(scalar_id,1) = scalar_value - endif - - end subroutine state_setscalar - -!=============================================================================== - - subroutine state_diagnose(State, string, rc) - - ! ---------------------------------------------- - ! Diagnose status of State - ! ---------------------------------------------- - - type(ESMF_State), intent(in) :: state - character(len=*), intent(in) :: string - integer , intent(out) :: rc - - ! local variables - integer :: i,j,n - type(ESMf_Field) :: lfield - integer :: fieldCount, lrank - character(ESMF_MAXSTR) ,pointer :: lfieldnamelist(:) - real(r8), pointer :: dataPtr1d(:) - real(r8), pointer :: dataPtr2d(:,:) - character(len=*),parameter :: subname='(state_diagnose)' - ! ---------------------------------------------- - - call ESMF_StateGet(state, itemCount=fieldCount, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - allocate(lfieldnamelist(fieldCount)) - - call ESMF_StateGet(state, itemNameList=lfieldnamelist, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - - do n = 1, fieldCount - - call ESMF_StateGet(state, itemName=lfieldnamelist(n), field=lfield, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - - call field_getfldptr(lfield, rc=rc, fldptr1=dataPtr1d, fldptr2=dataPtr2d, rank=lrank) - if (chkerr(rc,__LINE__,u_FILE_u)) return - - if (lrank == 0) then - ! no local data - elseif (lrank == 1) then - if (size(dataPtr1d) > 0) then - write(msgString,'(A,3g14.7,i8)') trim(string)//': '//trim(lfieldnamelist(n)), & - minval(dataPtr1d), maxval(dataPtr1d), sum(dataPtr1d), size(dataPtr1d) - else - write(msgString,'(A,a)') trim(string)//': '//trim(lfieldnamelist(n))," no data" - endif - elseif (lrank == 2) then - if (size(dataPtr2d) > 0) then - write(msgString,'(A,3g14.7,i8)') trim(string)//': '//trim(lfieldnamelist(n)), & - minval(dataPtr2d), maxval(dataPtr2d), sum(dataPtr2d), size(dataPtr2d) - else - write(msgString,'(A,a)') trim(string)//': '//trim(lfieldnamelist(n))," no data" - endif - else - call ESMF_LogWrite(trim(subname)//": ERROR rank not supported ", ESMF_LOGMSG_ERROR) - rc = ESMF_FAILURE - return - endif - call ESMF_LogWrite(trim(msgString), ESMF_LOGMSG_INFO) - enddo - - deallocate(lfieldnamelist) - - end subroutine state_diagnose - -!=============================================================================== - - subroutine field_getfldptr(field, rc, fldptr1, fldptr2, rank, abort) - - ! ---------------------------------------------- - ! for a field, determine rank and return fldptr1 or fldptr2 - ! abort is true by default and will abort if fldptr is not yet allocated in field - ! rank returns 0, 1, or 2. 0 means fldptr not allocated and abort=false - ! ---------------------------------------------- - - ! input/output variables - type(ESMF_Field) , intent(in) :: field - integer , intent(out) :: rc - real(r8), pointer , intent(inout), optional :: fldptr1(:) - real(r8), pointer , intent(inout), optional :: fldptr2(:,:) - integer , intent(out) , optional :: rank - logical , intent(in) , optional :: abort - - ! local variables - type(ESMF_GeomType_Flag) :: geomtype - type(ESMF_FieldStatus_Flag) :: status - type(ESMF_Mesh) :: lmesh - integer :: lrank, nnodes, nelements - logical :: labort - character(len=*), parameter :: subname='(field_getfldptr)' - ! ---------------------------------------------- - - rc = ESMF_SUCCESS - - labort = .true. - if (present(abort)) then - labort = abort - endif - lrank = -99 - - call ESMF_FieldGet(field, status=status, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - - if (status /= ESMF_FIELDSTATUS_COMPLETE) then - lrank = 0 - if (labort) then - call ESMF_LogWrite(trim(subname)//": ERROR data not allocated ", ESMF_LOGMSG_INFO, rc=rc) - rc = ESMF_FAILURE - return - else - call ESMF_LogWrite(trim(subname)//": WARNING data not allocated ", ESMF_LOGMSG_INFO, rc=rc) - endif - else - - call ESMF_FieldGet(field, geomtype=geomtype, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - - if (geomtype == ESMF_GEOMTYPE_GRID) then - call ESMF_FieldGet(field, rank=lrank, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - elseif (geomtype == ESMF_GEOMTYPE_MESH) then - call ESMF_FieldGet(field, rank=lrank, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - call ESMF_FieldGet(field, mesh=lmesh, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - call ESMF_MeshGet(lmesh, numOwnedNodes=nnodes, numOwnedElements=nelements, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - if (nnodes == 0 .and. nelements == 0) lrank = 0 - else - call ESMF_LogWrite(trim(subname)//": ERROR geomtype not supported ", & - ESMF_LOGMSG_INFO, rc=rc) - rc = ESMF_FAILURE - return - endif ! geomtype - - if (lrank == 0) then - call ESMF_LogWrite(trim(subname)//": no local nodes or elements ", & - ESMF_LOGMSG_INFO) - elseif (lrank == 1) then - if (.not.present(fldptr1)) then - call ESMF_LogWrite(trim(subname)//": ERROR missing rank=1 array ", & - ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u) - rc = ESMF_FAILURE - return - endif - call ESMF_FieldGet(field, farrayPtr=fldptr1, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - elseif (lrank == 2) then - if (.not.present(fldptr2)) then - call ESMF_LogWrite(trim(subname)//": ERROR missing rank=2 array ", & - ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u) - rc = ESMF_FAILURE - return - endif - call ESMF_FieldGet(field, farrayPtr=fldptr2, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - else - call ESMF_LogWrite(trim(subname)//": ERROR in rank ", & - ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u) - rc = ESMF_FAILURE - return - endif - - endif ! status - - if (present(rank)) then - rank = lrank - endif - - end subroutine field_getfldptr - -!=============================================================================== - - subroutine alarmInit( clock, alarm, option, & - opt_n, opt_ymd, opt_tod, RefTime, alarmname, rc) - - ! Setup an alarm in a clock - ! Notes: The ringtime sent to AlarmCreate MUST be the next alarm - ! time. If you send an arbitrary but proper ringtime from the - ! past and the ring interval, the alarm will always go off on the - ! next clock advance and this will cause serious problems. Even - ! if it makes sense to initialize an alarm with some reference - ! time and the alarm interval, that reference time has to be - ! advance forward to be >= the current time. In the logic below - ! we set an appropriate "NextAlarm" and then we make sure to - ! advance it properly based on the ring interval. - - ! input/output variables - type(ESMF_Clock) , intent(inout) :: clock ! clock - type(ESMF_Alarm) , intent(inout) :: alarm ! alarm - character(len=*) , intent(in) :: option ! alarm option - integer , optional , intent(in) :: opt_n ! alarm freq - integer , optional , intent(in) :: opt_ymd ! alarm ymd - integer , optional , intent(in) :: opt_tod ! alarm tod (sec) - type(ESMF_Time) , optional , intent(in) :: RefTime ! ref time - character(len=*) , optional , intent(in) :: alarmname ! alarm name - integer , intent(inout) :: rc ! Return code - - ! local variables - type(ESMF_Calendar) :: cal ! calendar - integer :: lymd ! local ymd - integer :: ltod ! local tod - integer :: cyy,cmm,cdd,csec ! time info - character(len=64) :: lalarmname ! local alarm name - logical :: update_nextalarm ! update next alarm - type(ESMF_Time) :: CurrTime ! Current Time - type(ESMF_Time) :: NextAlarm ! Next restart alarm time - type(ESMF_TimeInterval) :: AlarmInterval ! Alarm interval - integer :: sec - character(len=*), parameter :: subname = '(set_alarmInit): ' - !------------------------------------------------------------------------------- - - rc = ESMF_SUCCESS - - lalarmname = 'alarm_unknown' - if (present(alarmname)) lalarmname = trim(alarmname) - ltod = 0 - if (present(opt_tod)) ltod = opt_tod - lymd = -1 - if (present(opt_ymd)) lymd = opt_ymd - - call ESMF_ClockGet(clock, CurrTime=CurrTime, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - - call ESMF_TimeGet(CurrTime, yy=cyy, mm=cmm, dd=cdd, s=csec, rc=rc ) - if (chkerr(rc,__LINE__,u_FILE_u)) return - - ! initial guess of next alarm, this will be updated below - if (present(RefTime)) then - NextAlarm = RefTime - else - NextAlarm = CurrTime - endif - - ! Determine calendar - call ESMF_ClockGet(clock, calendar=cal) - - ! Determine inputs for call to create alarm - selectcase (trim(option)) - - case (optNONE) - call ESMF_TimeIntervalSet(AlarmInterval, yy=9999, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - call ESMF_TimeSet( NextAlarm, yy=9999, mm=12, dd=1, s=0, calendar=cal, rc=rc ) - if (chkerr(rc,__LINE__,u_FILE_u)) return - update_nextalarm = .false. - - case (optNever) - call ESMF_TimeIntervalSet(AlarmInterval, yy=9999, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - call ESMF_TimeSet( NextAlarm, yy=9999, mm=12, dd=1, s=0, calendar=cal, rc=rc ) - if (chkerr(rc,__LINE__,u_FILE_u)) return - update_nextalarm = .false. - - case (optDate) - if (.not. present(opt_ymd)) then - call shr_sys_abort(subname//trim(option)//' requires opt_ymd') - end if - if (lymd < 0 .or. ltod < 0) then - call shr_sys_abort(subname//trim(option)//'opt_ymd, opt_tod invalid') - end if - call ESMF_TimeIntervalSet(AlarmInterval, yy=9999, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - call timeInit(NextAlarm, lymd, cal, ltod, rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - update_nextalarm = .false. - - case (optIfdays0) - if (.not. present(opt_ymd)) then - call shr_sys_abort(subname//trim(option)//' requires opt_ymd') - end if - if (.not.present(opt_n)) then - call shr_sys_abort(subname//trim(option)//' requires opt_n') - end if - if (opt_n <= 0) then - call shr_sys_abort(subname//trim(option)//' invalid opt_n') - end if - call ESMF_TimeIntervalSet(AlarmInterval, mm=1, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - call ESMF_TimeSet( NextAlarm, yy=cyy, mm=cmm, dd=opt_n, s=0, calendar=cal, rc=rc ) - if (chkerr(rc,__LINE__,u_FILE_u)) return - update_nextalarm = .true. - - case (optNSteps) - if (.not.present(opt_n)) then - call shr_sys_abort(subname//trim(option)//' requires opt_n') - end if - if (opt_n <= 0) then - call shr_sys_abort(subname//trim(option)//' invalid opt_n') - end if - call ESMF_ClockGet(clock, TimeStep=AlarmInterval, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - AlarmInterval = AlarmInterval * opt_n - update_nextalarm = .true. - - case (optNStep) - if (.not.present(opt_n)) call shr_sys_abort(subname//trim(option)//' requires opt_n') - if (opt_n <= 0) call shr_sys_abort(subname//trim(option)//' invalid opt_n') - call ESMF_ClockGet(clock, TimeStep=AlarmInterval, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - AlarmInterval = AlarmInterval * opt_n - update_nextalarm = .true. - - case (optNSeconds) - if (.not.present(opt_n)) then - call shr_sys_abort(subname//trim(option)//' requires opt_n') - end if - if (opt_n <= 0) then - call shr_sys_abort(subname//trim(option)//' invalid opt_n') - end if - call ESMF_TimeIntervalSet(AlarmInterval, s=1, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - AlarmInterval = AlarmInterval * opt_n - update_nextalarm = .true. - - case (optNSecond) - if (.not.present(opt_n)) then - call shr_sys_abort(subname//trim(option)//' requires opt_n') - end if - if (opt_n <= 0) then - call shr_sys_abort(subname//trim(option)//' invalid opt_n') - end if - call ESMF_TimeIntervalSet(AlarmInterval, s=1, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - AlarmInterval = AlarmInterval * opt_n - update_nextalarm = .true. - - case (optNMinutes) - call ESMF_TimeIntervalSet(AlarmInterval, s=60, rc=rc) - if (.not.present(opt_n)) then - call shr_sys_abort(subname//trim(option)//' requires opt_n') - end if - if (opt_n <= 0) then - call shr_sys_abort(subname//trim(option)//' invalid opt_n') - end if - AlarmInterval = AlarmInterval * opt_n - update_nextalarm = .true. - - case (optNMinute) - if (.not.present(opt_n)) then - call shr_sys_abort(subname//trim(option)//' requires opt_n') - end if - if (opt_n <= 0) then - call shr_sys_abort(subname//trim(option)//' invalid opt_n') - end if - call ESMF_TimeIntervalSet(AlarmInterval, s=60, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - AlarmInterval = AlarmInterval * opt_n - update_nextalarm = .true. - - case (optNHours) - if (.not.present(opt_n)) then - call shr_sys_abort(subname//trim(option)//' requires opt_n') - end if - if (opt_n <= 0) then - call shr_sys_abort(subname//trim(option)//' invalid opt_n') - end if - call ESMF_TimeIntervalSet(AlarmInterval, s=3600, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - AlarmInterval = AlarmInterval * opt_n - update_nextalarm = .true. - - case (optNHour) - if (.not.present(opt_n)) then - call shr_sys_abort(subname//trim(option)//' requires opt_n') - end if - if (opt_n <= 0) then - call shr_sys_abort(subname//trim(option)//' invalid opt_n') - end if - call ESMF_TimeIntervalSet(AlarmInterval, s=3600, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - AlarmInterval = AlarmInterval * opt_n - update_nextalarm = .true. - - case (optNDays) - if (.not.present(opt_n)) then - call shr_sys_abort(subname//trim(option)//' requires opt_n') - end if - if (opt_n <= 0) then - call shr_sys_abort(subname//trim(option)//' invalid opt_n') - end if - call ESMF_TimeIntervalSet(AlarmInterval, d=1, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - AlarmInterval = AlarmInterval * opt_n - update_nextalarm = .true. - - case (optNDay) - if (.not.present(opt_n)) then - call shr_sys_abort(subname//trim(option)//' requires opt_n') - end if - if (opt_n <= 0) then - call shr_sys_abort(subname//trim(option)//' invalid opt_n') - end if - call ESMF_TimeIntervalSet(AlarmInterval, d=1, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - AlarmInterval = AlarmInterval * opt_n - update_nextalarm = .true. - - case (optNMonths) - if (.not.present(opt_n)) then - call shr_sys_abort(subname//trim(option)//' requires opt_n') - end if - if (opt_n <= 0) then - call shr_sys_abort(subname//trim(option)//' invalid opt_n') - end if - call ESMF_TimeIntervalSet(AlarmInterval, mm=1, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - AlarmInterval = AlarmInterval * opt_n - update_nextalarm = .true. - - case (optNMonth) - if (.not.present(opt_n)) then - call shr_sys_abort(subname//trim(option)//' requires opt_n') - end if - if (opt_n <= 0) then - call shr_sys_abort(subname//trim(option)//' invalid opt_n') - end if - call ESMF_TimeIntervalSet(AlarmInterval, mm=1, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - AlarmInterval = AlarmInterval * opt_n - update_nextalarm = .true. - - case (optMonthly) - call ESMF_TimeIntervalSet(AlarmInterval, mm=1, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - call ESMF_TimeSet( NextAlarm, yy=cyy, mm=cmm, dd=1, s=0, calendar=cal, rc=rc ) - if (chkerr(rc,__LINE__,u_FILE_u)) return - update_nextalarm = .true. - - case (optNYears) - if (.not.present(opt_n)) then - call shr_sys_abort(subname//trim(option)//' requires opt_n') - end if - if (opt_n <= 0) then - call shr_sys_abort(subname//trim(option)//' invalid opt_n') - end if - call ESMF_TimeIntervalSet(AlarmInterval, yy=1, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - AlarmInterval = AlarmInterval * opt_n - update_nextalarm = .true. - - case (optNYear) - if (.not.present(opt_n)) then - call shr_sys_abort(subname//trim(option)//' requires opt_n') - end if - if (opt_n <= 0) then - call shr_sys_abort(subname//trim(option)//' invalid opt_n') - end if - call ESMF_TimeIntervalSet(AlarmInterval, yy=1, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - AlarmInterval = AlarmInterval * opt_n - update_nextalarm = .true. - - case (optYearly) - call ESMF_TimeIntervalSet(AlarmInterval, yy=1, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - call ESMF_TimeSet( NextAlarm, yy=cyy, mm=1, dd=1, s=0, calendar=cal, rc=rc ) - if (chkerr(rc,__LINE__,u_FILE_u)) return - update_nextalarm = .true. - - case default - call shr_sys_abort(subname//'unknown option '//trim(option)) - - end select - - ! -------------------------------------------------------------------------------- - ! --- AlarmInterval and NextAlarm should be set --- - ! -------------------------------------------------------------------------------- - - ! --- advance Next Alarm so it won't ring on first timestep for - ! --- most options above. go back one alarminterval just to be careful - - if (update_nextalarm) then - NextAlarm = NextAlarm - AlarmInterval - do while (NextAlarm <= CurrTime) - NextAlarm = NextAlarm + AlarmInterval - enddo - endif - - alarm = ESMF_AlarmCreate( name=lalarmname, clock=clock, ringTime=NextAlarm, & - ringInterval=AlarmInterval, rc=rc) - if (chkerr(rc,__LINE__,u_FILE_u)) return - - end subroutine alarmInit - -!=============================================================================== - - subroutine timeInit( Time, ymd, cal, tod, rc) - - ! Create the ESMF_Time object corresponding to the given input time, - ! given in YMD (Year Month Day) and TOD (Time-of-day) format. - ! Set the time by an integer as YYYYMMDD and integer seconds in the day - - ! input/output parameters: - type(ESMF_Time) , intent(inout) :: Time ! ESMF time - integer , intent(in) :: ymd ! year, month, day YYYYMMDD - type(ESMF_Calendar) , intent(in) :: cal ! ESMF calendar - integer , intent(in) :: tod ! time of day in seconds - integer , intent(out) :: rc - - ! local variables - integer :: year, mon, day ! year, month, day as integers - integer :: tdate ! temporary date - integer :: date ! coded-date (yyyymmdd) - character(len=*), parameter :: subname='(timeInit)' - !------------------------------------------------------------------------------- - - rc = ESMF_SUCCESS - - if ( (ymd < 0) .or. (tod < 0) .or. (tod > SecPerDay) )then - call shr_sys_abort( subname//'ERROR yymmdd is a negative number or time-of-day out of bounds' ) - end if - - tdate = abs(date) - year = int(tdate/10000) - if (date < 0) year = -year - mon = int( mod(tdate,10000)/ 100) - day = mod(tdate, 100) - - call ESMF_TimeSet( Time, yy=year, mm=mon, dd=day, s=tod, calendar=cal, rc=rc ) - if (chkerr(rc,__LINE__,u_FILE_u)) return - - end subroutine timeInit - -!=============================================================================== - - logical function chkerr(rc, line, file) - - integer, intent(in) :: rc - integer, intent(in) :: line - character(len=*), intent(in) :: file - - integer :: lrc - - chkerr = .false. - lrc = rc - if (ESMF_LogFoundError(rcToCheck=lrc, msg=ESMF_LOGERR_PASSTHRU, line=line, file=file)) then - chkerr = .true. - endif - end function chkerr - -end module lnd_shr_methods diff --git a/src/cpl/utils/lnd_import_export_utils.F90 b/src/cpl/utils/lnd_import_export_utils.F90 new file mode 100644 index 0000000000..c02e1a18dc --- /dev/null +++ b/src/cpl/utils/lnd_import_export_utils.F90 @@ -0,0 +1,179 @@ +module lnd_import_export_utils + + use shr_kind_mod , only : r8 => shr_kind_r8 + use shr_infnan_mod , only : isnan => shr_infnan_isnan + use shr_sys_mod , only : shr_sys_abort + use clm_varctl , only : iulog + use decompmod , only : bounds_type + use atm2lndType , only : atm2lnd_type + use Wateratm2lndBulkType , only : wateratm2lndbulk_type + + implicit none + private ! except + + public :: derive_quantities + public :: check_for_errors + public :: check_for_nans + +!============================================================================= +contains +!============================================================================= + + !=========================================================================== + + subroutine derive_quantities( bounds, atm2lnd_inst, wateratm2lndbulk_inst, & + forc_rainc, forc_rainl, forc_snowc, forc_snowl ) + + !------------------------------------------------------------------------- + ! Convert the input data from the mediator to the land model + !------------------------------------------------------------------------- + + use clm_varctl, only: co2_ppmv + use clm_varcon, only: rair, o2_molar_const + use QSatMod, only: QSat + + ! input/output variabes + type(bounds_type), intent(in) :: bounds ! bounds + type(atm2lnd_type), intent(inout) :: atm2lnd_inst ! clm internal input data type + type(wateratm2lndbulk_type), intent(inout) :: wateratm2lndbulk_inst + real(r8), intent(in) :: forc_rainc(bounds%begg:bounds%endg) ! convective rain (mm/s) + real(r8), intent(in) :: forc_rainl(bounds%begg:bounds%endg) ! large scale rain (mm/s) + real(r8), intent(in) :: forc_snowc(bounds%begg:bounds%endg) ! convective snow (mm/s) + real(r8), intent(in) :: forc_snowl(bounds%begg:bounds%endg) ! large scale snow (mm/s) + + ! local variables + integer :: g ! indices + integer :: begg, endg ! bounds + real(r8) :: qsat_kg_kg ! saturation specific humidity (kg/kg) + real(r8) :: forc_t ! atmospheric temperature (Kelvin) + real(r8) :: forc_q ! atmospheric specific humidity (kg/kg) + real(r8) :: forc_pbot ! atmospheric pressure (Pa) + character(len=*), parameter :: subname='(cpl:utils:derive_quantities)' + + !------------------------------------------------------------------------- + + ! Set bounds + begg = bounds%begg; endg=bounds%endg + + !-------------------------- + ! Derived quantities + !-------------------------- + + do g = begg, endg + forc_t = atm2lnd_inst%forc_t_not_downscaled_grc(g) + forc_q = wateratm2lndbulk_inst%forc_q_not_downscaled_grc(g) + forc_pbot = atm2lnd_inst%forc_pbot_not_downscaled_grc(g) + + atm2lnd_inst%forc_hgt_u_grc(g) = atm2lnd_inst%forc_hgt_grc(g) !observational height of wind [m] + atm2lnd_inst%forc_hgt_t_grc(g) = atm2lnd_inst%forc_hgt_grc(g) !observational height of temperature [m] + atm2lnd_inst%forc_hgt_q_grc(g) = atm2lnd_inst%forc_hgt_grc(g) !observational height of humidity [m] + + atm2lnd_inst%forc_vp_grc(g) = forc_q * forc_pbot / (0.622_r8 + 0.378_r8 * forc_q) + + atm2lnd_inst%forc_rho_not_downscaled_grc(g) = & + (forc_pbot - 0.378_r8 * atm2lnd_inst%forc_vp_grc(g)) / (rair * forc_t) + + atm2lnd_inst%forc_po2_grc(g) = o2_molar_const * forc_pbot + atm2lnd_inst%forc_pco2_grc(g) = co2_ppmv * 1.e-6_r8 * forc_pbot + + atm2lnd_inst%forc_wind_grc(g) = sqrt(atm2lnd_inst%forc_u_grc(g)**2 + atm2lnd_inst%forc_v_grc(g)**2) + + atm2lnd_inst%forc_solar_grc(g) = atm2lnd_inst%forc_solad_grc(g,1) + atm2lnd_inst%forc_solai_grc(g,1) + & + atm2lnd_inst%forc_solad_grc(g,2) + atm2lnd_inst%forc_solai_grc(g,2) + + wateratm2lndbulk_inst%forc_rain_not_downscaled_grc(g) = forc_rainc(g) + forc_rainl(g) + wateratm2lndbulk_inst%forc_snow_not_downscaled_grc(g) = forc_snowc(g) + forc_snowl(g) + + call QSat(forc_t, forc_pbot, qsat_kg_kg) + + ! modify specific humidity if precip occurs + if (1==2) then + if ((forc_rainc(g) + forc_rainl(g)) > 0._r8) then + forc_q = 0.95_r8 * qsat_kg_kg + !forc_q = qsat_kg_kg + wateratm2lndbulk_inst%forc_q_not_downscaled_grc(g) = forc_q + endif + endif + + wateratm2lndbulk_inst%forc_rh_grc(g) = 100.0_r8*(forc_q / qsat_kg_kg) + end do + + end subroutine derive_quantities + + !=========================================================================== + + subroutine check_for_errors( bounds, atm2lnd_inst, wateratm2lndbulk_inst ) + + ! input/output variabes + type(bounds_type), intent(in) :: bounds ! bounds + type(atm2lnd_type), intent(inout) :: atm2lnd_inst ! clm internal input data type + type(wateratm2lndbulk_type), intent(inout) :: wateratm2lndbulk_inst + + ! local variables + integer :: g ! indices + integer :: begg, endg ! bounds + character(len=*), parameter :: subname='(cpl:utils:check_for_errors)' + + !------------------------------------------------------------------------- + + ! Set bounds + begg = bounds%begg; endg=bounds%endg + + !-------------------------- + ! Error checks + !-------------------------- + + ! Check that solar, specific-humidity, and LW downward aren't negative + do g = begg, endg + if ( atm2lnd_inst%forc_lwrad_not_downscaled_grc(g) <= 0.0_r8 ) then + call shr_sys_abort( subname//& + ' ERROR: Longwave down sent from the atmosphere model is negative or zero' ) + end if + if ( (atm2lnd_inst%forc_solad_grc(g,1) < 0.0_r8) .or. & + (atm2lnd_inst%forc_solad_grc(g,2) < 0.0_r8) .or. & + (atm2lnd_inst%forc_solai_grc(g,1) < 0.0_r8) .or. & + (atm2lnd_inst%forc_solai_grc(g,2) < 0.0_r8) ) then + call shr_sys_abort( subname//& + ' ERROR: One of the solar fields (indirect/diffuse, vis or near-IR)'// & + ' from the atmosphere model is negative or zero' ) + end if + if ( wateratm2lndbulk_inst%forc_q_not_downscaled_grc(g) < 0.0_r8 )then + call shr_sys_abort( subname//& + ' ERROR: Bottom layer specific humidty sent from the atmosphere model is less than zero' ) + end if + end do + + ! Make sure relative humidity is properly bounded + ! atm2lnd_inst%forc_rh_grc(g) = min( 100.0_r8, atm2lnd_inst%forc_rh_grc(g) ) + ! atm2lnd_inst%forc_rh_grc(g) = max( 0.0_r8, atm2lnd_inst%forc_rh_grc(g) ) + + end subroutine check_for_errors + + !============================================================================= + + subroutine check_for_nans(array, fname, begg) + + ! input/output variables + real(r8) , intent(in) :: array(:) + character(len=*) , intent(in) :: fname + integer , intent(in) :: begg + + ! local variables + integer :: i + !--------------------------------------------------------------------------- + + ! Check if any input from mediator or output to mediator is NaN + + if (any(isnan(array))) then + write(iulog,*) '# of NaNs = ', count(isnan(array)) + write(iulog,*) 'Which are NaNs = ', isnan(array) + do i = 1, size(array) + if (isnan(array(i))) then + write(iulog,*) "NaN found in field ", trim(fname), ' at gridcell index ',begg+i-1 + end if + end do + call shr_sys_abort(' ERROR: One or more of the output from CLM to the coupler are NaN ' ) + end if + end subroutine check_for_nans + +end module lnd_import_export_utils diff --git a/src/dyn_subgrid/CMakeLists.txt b/src/dyn_subgrid/CMakeLists.txt index 42ecc336ef..4445c85809 100644 --- a/src/dyn_subgrid/CMakeLists.txt +++ b/src/dyn_subgrid/CMakeLists.txt @@ -7,7 +7,7 @@ set(genf90_files dynVarTimeUninterpMod.F90.in ) -process_genf90_source_list("${genf90_files}" ${CMAKE_CURRENT_SOURCE_DIR} clm_genf90_sources) +process_genf90_source_list("${genf90_files}" ${CMAKE_CURRENT_BINARY_DIR} clm_genf90_sources) sourcelist_to_parent(clm_genf90_sources) diff --git a/src/dyn_subgrid/dynConsBiogeophysMod.F90 b/src/dyn_subgrid/dynConsBiogeophysMod.F90 index 018cd12176..089715233d 100644 --- a/src/dyn_subgrid/dynConsBiogeophysMod.F90 +++ b/src/dyn_subgrid/dynConsBiogeophysMod.F90 @@ -20,12 +20,13 @@ module dynConsBiogeophysMod use WaterFluxType , only : waterflux_type use WaterStateBulkType , only : waterstatebulk_type use WaterStateType , only : waterstate_type + use LakestateType , only : lakestate_type use WaterDiagnosticType , only : waterdiagnostic_type use WaterDiagnosticBulkType , only : waterdiagnosticbulk_type use WaterBalanceType , only : waterbalance_type use WaterType , only : water_type - use TotalWaterAndHeatMod , only : AccumulateSoilLiqIceMassNonLake - use TotalWaterAndHeatMod , only : AccumulateSoilHeatNonLake + use TotalWaterAndHeatMod , only : AccumulateSoilLiqIceMassNonLake, AccumulateLiqIceMassLake + use TotalWaterAndHeatMod , only : AccumulateSoilHeatNonLake, AccumulateHeatLake use TotalWaterAndHeatMod , only : ComputeLiqIceMassNonLake, ComputeLiqIceMassLake use TotalWaterAndHeatMod , only : ComputeHeatNonLake, ComputeHeatLake use TotalWaterAndHeatMod , only : AdjustDeltaHeatForDeltaLiq @@ -64,7 +65,9 @@ module dynConsBiogeophysMod !----------------------------------------------------------------------- subroutine dyn_hwcontent_set_baselines(bounds, num_icemecc, filter_icemecc, & - urbanparams_inst, soilstate_inst, water_inst, temperature_inst) + num_lakec, filter_lakec, & + urbanparams_inst, soilstate_inst, lakestate_inst, water_inst, temperature_inst, & + reset_all_baselines, reset_lake_baselines) ! ! !DESCRIPTION: ! Set start-of-run baseline values for heat and water content in some columns. @@ -77,13 +80,18 @@ subroutine dyn_hwcontent_set_baselines(bounds, num_icemecc, filter_icemecc, & ! represented). These corrections will typically reduce the fictitious dynbal ! conservation fluxes. ! - ! At a minimum, this should be called during cold start initialization, to initialize - ! the baseline values based on cold start states. In addition, this can be called when - ! starting a new run from existing initial conditions, if the user desires. This - ! optional resetting can further reduce the dynbal fluxes; however, it can break - ! conservation. (So, for example, it can be done when transitioning from an offline - ! spinup to a coupled run, but it should not be done when transitioning from a - ! coupled historical run to a future scenario.) + ! At a minimum, this should be called during cold start initialization with + ! reset_all_baselines set to true, to initialize the baseline values based on cold + ! start states. This should also be called after reading initial conditions, but the + ! various reset_* flags should be set appropriately; setting all of these flags to + ! false will result in no baselines being reset in this call. + + ! Setting reset_all_baselines can be done when starting a new run from existing + ! initial conditions if the user desires. This optional resetting can further reduce + ! the dynbal fluxes; however, it can break conservation. (So, for example, it can be + ! done when transitioning from an offline spinup to a coupled run, but it should not + ! be done when transitioning from a coupled historical run to a future scenario.) + ! Other reset_* flags are described below. ! ! !ARGUMENTS: type(bounds_type), intent(in) :: bounds @@ -93,11 +101,28 @@ subroutine dyn_hwcontent_set_baselines(bounds, num_icemecc, filter_icemecc, & ! appropriate baseline value for that point. integer, intent(in) :: num_icemecc ! number of points in filter_icemecc integer, intent(in) :: filter_icemecc(:) ! filter for icemec (i.e., glacier) columns + integer, intent(in) :: num_lakec ! number of points in filter_lakec + integer, intent(in) :: filter_lakec(:) ! filter for lake columns type(urbanparams_type), intent(in) :: urbanparams_inst type(soilstate_type), intent(in) :: soilstate_inst + type(lakestate_type), intent(in) :: lakestate_inst type(water_type), intent(inout) :: water_inst type(temperature_type), intent(inout) :: temperature_inst + + ! Whether to reset baselines for all columns + logical, intent(in) :: reset_all_baselines + + ! Whether to reset baselines for lake columns. Ignored if reset_all_baselines is + ! true. + ! + ! BACKWARDS_COMPATIBILITY(wjs, 2020-09-02) This is needed when reading old initial + ! conditions files created before https://github.com/ESCOMP/CTSM/issues/1140 was + ! resolved via https://github.com/ESCOMP/CTSM/pull/1109: The definition of total + ! column water content has been changed for lakes, so we need to reset baseline values + ! for lakes on older initial conditions files. + logical, intent(in) :: reset_lake_baselines + ! ! !LOCAL VARIABLES: integer :: i @@ -118,22 +143,27 @@ subroutine dyn_hwcontent_set_baselines(bounds, num_icemecc, filter_icemecc, & associate(bulk_or_tracer => water_inst%bulk_and_tracers(i)) call dyn_water_content_set_baselines(bounds, natveg_and_glc_filterc, & - num_icemecc, filter_icemecc, & - bulk_or_tracer%waterstate_inst) + num_icemecc, filter_icemecc, num_lakec, filter_lakec, & + bulk_or_tracer%waterstate_inst, lakestate_inst, & + reset_all_baselines = reset_all_baselines, & + reset_lake_baselines = reset_lake_baselines) end associate end do - + call dyn_heat_content_set_baselines(bounds, natveg_and_glc_filterc, & - num_icemecc, filter_icemecc, & - urbanparams_inst, soilstate_inst, water_inst%waterstatebulk_inst, & - temperature_inst) + num_icemecc, filter_icemecc, num_lakec, filter_lakec, & + urbanparams_inst, soilstate_inst, lakestate_inst, water_inst%waterstatebulk_inst, & + temperature_inst, & + reset_all_baselines = reset_all_baselines, & + reset_lake_baselines = reset_lake_baselines) end subroutine dyn_hwcontent_set_baselines !----------------------------------------------------------------------- subroutine dyn_water_content_set_baselines(bounds, natveg_and_glc_filterc, & - num_icemecc, filter_icemecc, & - waterstate_inst) + num_icemecc, filter_icemecc, num_lakec, filter_lakec, & + waterstate_inst, lakestate_inst, & + reset_all_baselines, reset_lake_baselines) ! ! !DESCRIPTION: ! Set start-of-run baseline values for water content, for a single water tracer or @@ -146,13 +176,23 @@ subroutine dyn_water_content_set_baselines(bounds, natveg_and_glc_filterc, & ! The following filter should include inactive as well as active points integer, intent(in) :: num_icemecc ! number of points in filter_icemecc integer, intent(in) :: filter_icemecc(:) ! filter for icemec (i.e., glacier) columns + integer, intent(in) :: num_lakec ! number of points in filter_lakec + integer, intent(in) :: filter_lakec(:) ! filter for lake columns + type(lakestate_type), intent(in) :: lakestate_inst class(waterstate_type), intent(inout) :: waterstate_inst + + ! See dyn_hwcontent_set_baselines for documentation of these arguments + logical, intent(in) :: reset_all_baselines + logical, intent(in) :: reset_lake_baselines ! ! !LOCAL VARIABLES: + integer :: c, fc ! indices real(r8) :: soil_liquid_mass_col(bounds%begc:bounds%endc) real(r8) :: soil_ice_mass_col(bounds%begc:bounds%endc) - + real(r8) :: lake_liquid_mass_col(bounds%begc:bounds%endc) + real(r8) :: lake_ice_mass_col(bounds%begc:bounds%endc) + character(len=*), parameter :: subname = 'dyn_water_content_set_baselines' !----------------------------------------------------------------------- @@ -161,28 +201,49 @@ subroutine dyn_water_content_set_baselines(bounds, natveg_and_glc_filterc, & dynbal_baseline_ice => waterstate_inst%dynbal_baseline_ice_col & ! Output: [real(r8) (:) ] baseline ice content subtracted from each column's total ice calculation (mm H2O) ) - soil_liquid_mass_col(bounds%begc:bounds%endc) = 0._r8 - soil_ice_mass_col (bounds%begc:bounds%endc) = 0._r8 + if (reset_all_baselines) then + soil_liquid_mass_col(bounds%begc:bounds%endc) = 0._r8 + soil_ice_mass_col (bounds%begc:bounds%endc) = 0._r8 + + call AccumulateSoilLiqIceMassNonLake(bounds, & + natveg_and_glc_filterc%num, natveg_and_glc_filterc%indices, & + waterstate_inst, & + liquid_mass = soil_liquid_mass_col(bounds%begc:bounds%endc), & + ice_mass = soil_ice_mass_col(bounds%begc:bounds%endc)) + + ! For glacier columns, the liquid and ice in the "soil" (i.e., in the glacial ice) is + ! a virtual pool. So we'll subtract this amount when determining the dynbal + ! fluxes. (Note that a positive value in these baseline variables indicates an extra + ! stock that will be subtracted later.) But glacier columns do not represent the soil + ! under the glacial ice. Let's assume that the soil state under each glacier column is + ! the same as the soil state in the natural vegetation landunit on that grid cell. We + ! subtract this from the dynbal baseline variables to indicate a missing stock. + call set_glacier_baselines(bounds, num_icemecc, filter_icemecc, & + vals_col = soil_liquid_mass_col(bounds%begc:bounds%endc), & + baselines_col = dynbal_baseline_liq(bounds%begc:bounds%endc)) + call set_glacier_baselines(bounds, num_icemecc, filter_icemecc, & + vals_col = soil_ice_mass_col(bounds%begc:bounds%endc), & + baselines_col = dynbal_baseline_ice(bounds%begc:bounds%endc)) + end if - call AccumulateSoilLiqIceMassNonLake(bounds, & - natveg_and_glc_filterc%num, natveg_and_glc_filterc%indices, & - waterstate_inst, & - liquid_mass = soil_liquid_mass_col(bounds%begc:bounds%endc), & - ice_mass = soil_ice_mass_col(bounds%begc:bounds%endc)) - - ! For glacier columns, the liquid and ice in the "soil" (i.e., in the glacial ice) is - ! a virtual pool. So we'll subtract this amount when determining the dynbal - ! fluxes. (Note that a positive value in these baseline variables indicates an extra - ! stock that will be subtracted later.) But glacier columns do not represent the soil - ! under the glacial ice. Let's assume that the soil state under each glacier column is - ! the same as the soil state in the natural vegetation landunit on that grid cell. We - ! subtract this from the dynbal baseline variables to indicate a missing stock. - call set_glacier_baselines(bounds, num_icemecc, filter_icemecc, & - vals_col = soil_liquid_mass_col(bounds%begc:bounds%endc), & - baselines_col = dynbal_baseline_liq(bounds%begc:bounds%endc)) - call set_glacier_baselines(bounds, num_icemecc, filter_icemecc, & - vals_col = soil_ice_mass_col(bounds%begc:bounds%endc), & - baselines_col = dynbal_baseline_ice(bounds%begc:bounds%endc)) + if (reset_all_baselines .or. reset_lake_baselines) then + ! set baselines for lake columns + + lake_liquid_mass_col(bounds%begc:bounds%endc) = 0._r8 + lake_ice_mass_col (bounds%begc:bounds%endc) = 0._r8 + + ! Calculate the total water volume of the lake column + call AccumulateLiqIceMassLake(bounds, num_lakec, filter_lakec, lakestate_inst, & + tracer_ratio = waterstate_inst%info%get_ratio(), & + liquid_mass = lake_liquid_mass_col(bounds%begc:bounds%endc), & + ice_mass = lake_ice_mass_col(bounds%begc:bounds%endc)) + + do fc = 1, num_lakec + c = filter_lakec(fc) + dynbal_baseline_liq(c) = lake_liquid_mass_col(c) + dynbal_baseline_ice(c) = lake_ice_mass_col(c) + end do + end if end associate @@ -190,9 +251,10 @@ end subroutine dyn_water_content_set_baselines !----------------------------------------------------------------------- subroutine dyn_heat_content_set_baselines(bounds, natveg_and_glc_filterc, & - num_icemecc, filter_icemecc, & - urbanparams_inst, soilstate_inst, waterstatebulk_inst, & - temperature_inst) + num_icemecc, filter_icemecc, num_lakec, filter_lakec, & + urbanparams_inst, soilstate_inst, lakestate_inst, waterstatebulk_inst, & + temperature_inst, & + reset_all_baselines, reset_lake_baselines) ! ! !DESCRIPTION: ! Set start-of-run baseline values for heat content. @@ -202,19 +264,28 @@ subroutine dyn_heat_content_set_baselines(bounds, natveg_and_glc_filterc, & type(filter_col_type), intent(in) :: natveg_and_glc_filterc ! filter for natural veg and glacier columns ! The following filter should include inactive as well as active points - integer, intent(in) :: num_icemecc ! number of points in filter_icemecc + integer, intent(in) :: num_icemecc ! number of points in filter_icemecc integer, intent(in) :: filter_icemecc(:) ! filter for icemec (i.e., glacier) columns + integer, intent(in) :: num_lakec ! number of points in filter_lakec + integer, intent(in) :: filter_lakec(:) ! filter for lake columns - type(urbanparams_type), intent(in) :: urbanparams_inst - type(soilstate_type), intent(in) :: soilstate_inst + type(urbanparams_type), intent(in) :: urbanparams_inst + type(soilstate_type) , intent(in) :: soilstate_inst + type(lakestate_type) , intent(in) :: lakestate_inst type(waterstatebulk_type), intent(in) :: waterstatebulk_inst type(temperature_type), intent(inout) :: temperature_inst + + ! See dyn_hwcontent_set_baselines for documentation of these arguments + logical, intent(in) :: reset_all_baselines + logical, intent(in) :: reset_lake_baselines ! ! !LOCAL VARIABLES: - real(r8) :: soil_heat_col(bounds%begc:bounds%endc) ! soil heat content [J/m^2] - real(r8) :: soil_heat_liquid_col(bounds%begc:bounds%endc) ! unused; just needed for AccumulateSoilHeatNonLake interface - real(r8) :: soil_cv_liquid_col(bounds%begc:bounds%endc) ! unused; just needed for AccumulateSoilHeatNonLake interface - + integer :: c, fc ! indices + real(r8) :: soil_heat_col(bounds%begc:bounds%endc) ! soil heat content [J/m^2] + real(r8) :: soil_heat_liquid_col(bounds%begc:bounds%endc) ! unused; just needed for AccumulateSoilHeatNonLake interface + real(r8) :: soil_cv_liquid_col(bounds%begc:bounds%endc) ! unused; just needed for AccumulateSoilHeatNonLake interface + real(r8) :: lake_heat_col(bounds%begc:bounds%endc) ! lake heat content [J/m^2] + character(len=*), parameter :: subname = 'dyn_heat_content_set_baselines' !----------------------------------------------------------------------- @@ -222,34 +293,51 @@ subroutine dyn_heat_content_set_baselines(bounds, natveg_and_glc_filterc, & dynbal_baseline_heat => temperature_inst%dynbal_baseline_heat_col & ! Output: [real(r8) (:) ] baseline heat content subtracted from each column's total heat calculation (J/m2) ) - soil_heat_col(bounds%begc:bounds%endc) = 0._r8 - soil_heat_liquid_col(bounds%begc:bounds%endc) = 0._r8 - soil_cv_liquid_col(bounds%begc:bounds%endc) = 0._r8 - - call AccumulateSoilHeatNonLake(bounds, & - natveg_and_glc_filterc%num, natveg_and_glc_filterc%indices, & - urbanparams_inst, soilstate_inst, temperature_inst, waterstatebulk_inst, & - heat = soil_heat_col(bounds%begc:bounds%endc), & - heat_liquid = soil_heat_liquid_col(bounds%begc:bounds%endc), & - cv_liquid = soil_cv_liquid_col(bounds%begc:bounds%endc)) - - ! See comments in dyn_water_content_set_baselines for rationale for these glacier - ! baselines. Even though the heat in glacier ice can interact with the rest of the - ! system (e.g., giving off heat to the atmosphere or receiving heat from the - ! atmosphere), it is still a virtual state in the sense that the glacier ice column - ! is virtual. And, as for water, we subtract the heat of the soil in the associated - ! natural vegetated landunit to account for the fact that we don't explicitly model - ! the soil under glacial ice. - ! - ! Aside from these considerations of what is virtual vs. real, another rationale - ! driving the use of these baselines is the desire to minimize the dynbal fluxes. For - ! the sake of conservation, it seems okay to pick any fixed baseline when summing the - ! energy (or water) content of a given column (as long as that baseline doesn't - ! change over time). By using the baselines computed here, we reduce the dynbal - ! fluxes to more reasonable values. - call set_glacier_baselines(bounds, num_icemecc, filter_icemecc, & - vals_col = soil_heat_col(bounds%begc:bounds%endc), & - baselines_col = dynbal_baseline_heat(bounds%begc:bounds%endc)) + if (reset_all_baselines) then + soil_heat_col(bounds%begc:bounds%endc) = 0._r8 + soil_heat_liquid_col(bounds%begc:bounds%endc) = 0._r8 + soil_cv_liquid_col(bounds%begc:bounds%endc) = 0._r8 + + call AccumulateSoilHeatNonLake(bounds, & + natveg_and_glc_filterc%num, natveg_and_glc_filterc%indices, & + urbanparams_inst, soilstate_inst, temperature_inst, waterstatebulk_inst, & + heat = soil_heat_col(bounds%begc:bounds%endc), & + heat_liquid = soil_heat_liquid_col(bounds%begc:bounds%endc), & + cv_liquid = soil_cv_liquid_col(bounds%begc:bounds%endc)) + + ! See comments in dyn_water_content_set_baselines for rationale for these glacier + ! baselines. Even though the heat in glacier ice can interact with the rest of the + ! system (e.g., giving off heat to the atmosphere or receiving heat from the + ! atmosphere), it is still a virtual state in the sense that the glacier ice column + ! is virtual. And, as for water, we subtract the heat of the soil in the associated + ! natural vegetated landunit to account for the fact that we don't explicitly model + ! the soil under glacial ice. + ! + ! Aside from these considerations of what is virtual vs. real, another rationale + ! driving the use of these baselines is the desire to minimize the dynbal fluxes. For + ! the sake of conservation, it seems okay to pick any fixed baseline when summing the + ! energy (or water) content of a given column (as long as that baseline doesn't + ! change over time). By using the baselines computed here, we reduce the dynbal + ! fluxes to more reasonable values. + call set_glacier_baselines(bounds, num_icemecc, filter_icemecc, & + vals_col = soil_heat_col(bounds%begc:bounds%endc), & + baselines_col = dynbal_baseline_heat(bounds%begc:bounds%endc)) + end if + + if (reset_all_baselines .or. reset_lake_baselines) then + ! Set baselines for lake columns + + lake_heat_col(bounds%begc:bounds%endc) = 0._r8 + + call AccumulateHeatLake(bounds, num_lakec, filter_lakec, & + temperature_inst, lakestate_inst, & + heat = lake_heat_col) + + do fc = 1, num_lakec + c = filter_lakec(fc) + dynbal_baseline_heat(c) = lake_heat_col(c) + end do + end if end associate @@ -334,7 +422,7 @@ subroutine dyn_hwcontent_init(bounds, & num_nolakec, filter_nolakec, & num_lakec, filter_lakec, & urbanparams_inst, soilstate_inst, & - water_inst, temperature_inst) + water_inst, temperature_inst, lakestate_inst) ! ! !DESCRIPTION: ! Compute grid cell-level heat and water content before land cover change @@ -350,7 +438,9 @@ subroutine dyn_hwcontent_init(bounds, & type(urbanparams_type) , intent(in) :: urbanparams_inst type(soilstate_type) , intent(in) :: soilstate_inst type(water_type) , intent(inout) :: water_inst + type(lakestate_type) , intent(in) :: lakestate_inst type(temperature_type) , intent(inout) :: temperature_inst + ! ! !LOCAL VARIABLES: integer :: i @@ -369,6 +459,7 @@ subroutine dyn_hwcontent_init(bounds, & num_lakec, filter_lakec, & bulk_or_tracer%waterstate_inst, & bulk_or_tracer%waterdiagnostic_inst, & + lakestate_inst, & liquid_mass = bulk_or_tracer%waterbalance_inst%liq1_grc(begg:endg), & ice_mass = bulk_or_tracer%waterbalance_inst%ice1_grc(begg:endg)) end associate @@ -380,6 +471,7 @@ subroutine dyn_hwcontent_init(bounds, & urbanparams_inst, soilstate_inst, & temperature_inst, & water_inst%waterstatebulk_inst, water_inst%waterdiagnosticbulk_inst, & + lakestate_inst, & heat_grc = temperature_inst%heat1_grc(begg:endg), & liquid_water_temp_grc = temperature_inst%liquid_water_temp1_grc(begg:endg)) @@ -393,7 +485,7 @@ subroutine dyn_hwcontent_final(bounds, & num_lakec, filter_lakec, & urbanparams_inst, soilstate_inst, & water_inst, & - temperature_inst, energyflux_inst) + temperature_inst, energyflux_inst, lakestate_inst) ! ! !DESCRIPTION: ! Compute grid cell-level heat and water content and dynbal fluxes after land cover change @@ -409,6 +501,7 @@ subroutine dyn_hwcontent_final(bounds, & type(urbanparams_type) , intent(in) :: urbanparams_inst type(soilstate_type) , intent(in) :: soilstate_inst type(water_type) , intent(inout) :: water_inst + type(lakestate_type) , intent(in) :: lakestate_inst type(temperature_type) , intent(inout) :: temperature_inst type(energyflux_type) , intent(inout) :: energyflux_inst ! @@ -433,6 +526,7 @@ subroutine dyn_hwcontent_final(bounds, & bulk_or_tracer%waterdiagnostic_inst, & bulk_or_tracer%waterbalance_inst, & bulk_or_tracer%waterflux_inst, & + lakestate_inst, & delta_liq = this_delta_liq(begg:endg)) if (i == water_inst%i_bulk) then delta_liq_bulk(begg:endg) = this_delta_liq(begg:endg) @@ -446,6 +540,7 @@ subroutine dyn_hwcontent_final(bounds, & urbanparams_inst, soilstate_inst, & temperature_inst, & water_inst%waterstatebulk_inst, water_inst%waterdiagnosticbulk_inst, & + lakestate_inst, & heat_grc = temperature_inst%heat2_grc(begg:endg), & liquid_water_temp_grc = temperature_inst%liquid_water_temp2_grc(begg:endg)) @@ -481,7 +576,7 @@ subroutine dyn_water_content_final(bounds, & num_lakec, filter_lakec, & waterstate_inst, waterdiagnostic_inst, & waterbalance_inst, waterflux_inst, & - delta_liq) + lakestate_inst, delta_liq) ! ! !DESCRIPTION: ! Compute grid cell-level water content and dynbal fluxes after landcover change, for @@ -497,6 +592,7 @@ subroutine dyn_water_content_final(bounds, & class(waterdiagnostic_type) , intent(in) :: waterdiagnostic_inst class(waterbalance_type) , intent(inout) :: waterbalance_inst class(waterflux_type) , intent(inout) :: waterflux_inst + type(lakestate_type) , intent(in) :: lakestate_inst real(r8) , intent(out) :: delta_liq(bounds%begg:) ! change in gridcell h2o liq content ! ! !LOCAL VARIABLES: @@ -515,7 +611,7 @@ subroutine dyn_water_content_final(bounds, & call dyn_water_content(bounds, & num_nolakec, filter_nolakec, & num_lakec, filter_lakec, & - waterstate_inst, waterdiagnostic_inst, & + waterstate_inst, waterdiagnostic_inst, lakestate_inst, & liquid_mass = waterbalance_inst%liq2_grc(bounds%begg:bounds%endg), & ice_mass = waterbalance_inst%ice2_grc(bounds%begg:bounds%endg)) @@ -549,7 +645,7 @@ end subroutine dyn_water_content_final subroutine dyn_water_content(bounds, & num_nolakec, filter_nolakec, & num_lakec, filter_lakec, & - waterstate_inst, waterdiagnostic_inst, & + waterstate_inst, waterdiagnostic_inst, lakestate_inst, & liquid_mass, ice_mass) ! ! !DESCRIPTION: @@ -563,6 +659,7 @@ subroutine dyn_water_content(bounds, & integer , intent(in) :: filter_lakec(:) class(waterstate_type) , intent(in) :: waterstate_inst class(waterdiagnostic_type) , intent(in) :: waterdiagnostic_inst + type(lakestate_type) , intent(in) :: lakestate_inst real(r8) , intent(out) :: liquid_mass( bounds%begg: ) ! kg m-2 real(r8) , intent(out) :: ice_mass( bounds%begg: ) ! kg m-2 ! @@ -584,7 +681,8 @@ subroutine dyn_water_content(bounds, & call ComputeLiqIceMassLake(bounds, num_lakec, filter_lakec, & waterstate_inst, & - subtract_dynbal_baselines = .true., & + lakestate_inst, & + add_lake_water_and_subtract_dynbal_baselines = .true., & liquid_mass = liquid_mass_col(bounds%begc:bounds%endc), & ice_mass = ice_mass_col(bounds%begc:bounds%endc)) @@ -608,7 +706,7 @@ subroutine dyn_heat_content(bounds, & num_nolakec, filter_nolakec, & num_lakec, filter_lakec, & urbanparams_inst, soilstate_inst, & - temperature_inst, waterstatebulk_inst, waterdiagnosticbulk_inst, & + temperature_inst, waterstatebulk_inst, waterdiagnosticbulk_inst, lakestate_inst, & heat_grc, liquid_water_temp_grc) ! !DESCRIPTION: @@ -631,6 +729,7 @@ subroutine dyn_heat_content(bounds, & type(temperature_type) , intent(in) :: temperature_inst type(waterstatebulk_type) , intent(in) :: waterstatebulk_inst type(waterdiagnosticbulk_type) , intent(in) :: waterdiagnosticbulk_inst + type(lakestate_type) , intent(in) :: lakestate_inst real(r8) , intent(out) :: heat_grc( bounds%begg: ) ! total heat content for each grid cell [J/m^2] real(r8) , intent(out) :: liquid_water_temp_grc( bounds%begg: ) ! weighted average liquid water temperature for each grid cell (K) @@ -659,7 +758,7 @@ subroutine dyn_heat_content(bounds, & cv_liquid = cv_liquid_col(bounds%begc:bounds%endc)) call ComputeHeatLake(bounds, num_lakec, filter_lakec, & - soilstate_inst, temperature_inst, waterstatebulk_inst, & + soilstate_inst, temperature_inst, waterstatebulk_inst, lakestate_inst, & heat = heat_col(bounds%begc:bounds%endc), & heat_liquid = heat_liquid_col(bounds%begc:bounds%endc), & cv_liquid = cv_liquid_col(bounds%begc:bounds%endc)) diff --git a/src/dyn_subgrid/dynSubgridControlMod.F90 b/src/dyn_subgrid/dynSubgridControlMod.F90 index 3e077a036c..b4da85be73 100644 --- a/src/dyn_subgrid/dynSubgridControlMod.F90 +++ b/src/dyn_subgrid/dynSubgridControlMod.F90 @@ -24,6 +24,7 @@ module dynSubgridControlMod public :: get_flanduse_timeseries ! return the value of the flanduse_timeseries file name public :: get_do_transient_pfts ! return the value of the do_transient_pfts control flag public :: get_do_transient_crops ! return the value of the do_transient_crops control flag + public :: get_do_transient_lakes ! return the value of the do_transient_lakes control flag public :: run_has_transient_landcover ! returns true if any aspects of prescribed transient landcover are enabled public :: get_do_harvest ! return the value of the do_harvest control flag public :: get_reset_dynbal_baselines ! return the value of the reset_dynbal_baselines control flag @@ -40,6 +41,7 @@ module dynSubgridControlMod character(len=fname_len) :: flanduse_timeseries = ' ' ! transient landuse dataset logical :: do_transient_pfts = .false. ! whether to apply transient natural PFTs from dataset logical :: do_transient_crops = .false. ! whether to apply transient crops from dataset + logical :: do_transient_lakes = .false. ! whether to apply transient lakes from dataset logical :: do_harvest = .false. ! whether to apply harvest from dataset logical :: reset_dynbal_baselines = .false. ! whether to reset baseline values of total column water and energy in the first step of the run @@ -116,6 +118,7 @@ subroutine read_namelist( NLFilename ) character(len=fname_len) :: flanduse_timeseries logical :: do_transient_pfts logical :: do_transient_crops + logical :: do_transient_lakes logical :: do_harvest logical :: reset_dynbal_baselines logical :: for_testing_allow_non_annual_changes @@ -131,6 +134,7 @@ subroutine read_namelist( NLFilename ) flanduse_timeseries, & do_transient_pfts, & do_transient_crops, & + do_transient_lakes, & do_harvest, & reset_dynbal_baselines, & for_testing_allow_non_annual_changes, & @@ -140,6 +144,7 @@ subroutine read_namelist( NLFilename ) flanduse_timeseries = ' ' do_transient_pfts = .false. do_transient_crops = .false. + do_transient_lakes = .false. do_harvest = .false. reset_dynbal_baselines = .false. for_testing_allow_non_annual_changes = .false. @@ -164,6 +169,7 @@ subroutine read_namelist( NLFilename ) call shr_mpi_bcast (flanduse_timeseries, mpicom) call shr_mpi_bcast (do_transient_pfts, mpicom) call shr_mpi_bcast (do_transient_crops, mpicom) + call shr_mpi_bcast (do_transient_lakes, mpicom) call shr_mpi_bcast (do_harvest, mpicom) call shr_mpi_bcast (reset_dynbal_baselines, mpicom) call shr_mpi_bcast (for_testing_allow_non_annual_changes, mpicom) @@ -173,6 +179,7 @@ subroutine read_namelist( NLFilename ) flanduse_timeseries = flanduse_timeseries, & do_transient_pfts = do_transient_pfts, & do_transient_crops = do_transient_crops, & + do_transient_lakes = do_transient_lakes, & do_harvest = do_harvest, & reset_dynbal_baselines = reset_dynbal_baselines, & for_testing_allow_non_annual_changes = for_testing_allow_non_annual_changes, & @@ -218,6 +225,11 @@ subroutine check_namelist_consistency write(iulog,*) 'a flanduse_timeseries file (currently flanduse_timeseries is blank)' call endrun(msg=errMsg(sourcefile, __LINE__)) end if + if (dyn_subgrid_control_inst%do_transient_lakes) then + write(iulog,*) 'ERROR: do_transient_lakes can only be true if you are running with' + write(iulog,*) 'a flanduse_timeseries file (currently flanduse_timeseries is blank)' + call endrun(msg=errMsg(sourcefile, __LINE__)) + end if if (dyn_subgrid_control_inst%do_harvest) then write(iulog,*) 'ERROR: do_harvest can only be true if you are running with' write(iulog,*) 'a flanduse_timeseries file (currently flanduse_timeseries is blank)' @@ -236,9 +248,18 @@ subroutine check_namelist_consistency end if end if - if (dyn_subgrid_control_inst%do_transient_pfts .or. dyn_subgrid_control_inst%do_transient_crops) then + ! NOTE(wjs, 2020-08-23) In the following error checks, I'm treating do_transient_lakes + ! similar to do_transient_pfts and do_transient_crops. I'm not sure if all of these + ! checks are truly important for transient lakes (in particular, my guess is that + ! collapse_urban could probably be done with transient lakes - as well as transient + ! pfts and transient crops for that matter), but some of the checks probably are + ! needed, and it seems best to keep transient lakes consistent with other transient + ! areas in this respect. + if (dyn_subgrid_control_inst%do_transient_pfts .or. & + dyn_subgrid_control_inst%do_transient_crops .or. & + dyn_subgrid_control_inst%do_transient_lakes) then if (collapse_urban) then - write(iulog,*) 'ERROR: do_transient_pfts and do_transient_crops are & + write(iulog,*) 'ERROR: do_transient_pfts, do_transient_crops and do_transient_lakes are & incompatible with collapse_urban = .true.' call endrun(msg=errMsg(sourcefile, __LINE__)) end if @@ -246,7 +267,7 @@ subroutine check_namelist_consistency .or. toosmall_soil > 0._r8 .or. toosmall_crop > 0._r8 & .or. toosmall_glacier > 0._r8 .or. toosmall_lake > 0._r8 & .or. toosmall_wetland > 0._r8 .or. toosmall_urban > 0._r8) then - write(iulog,*) 'ERROR: do_transient_pfts and do_transient_crops are & + write(iulog,*) 'ERROR: do_transient_pfts, do_transient_crops and do_transient_lakes are & incompatible with any of the following set to > 0: & n_dom_pfts > 0, n_dom_landunits > 0, & toosmall_soil > 0._r8, toosmall_crop > 0._r8, & @@ -271,8 +292,8 @@ subroutine check_namelist_consistency write(iulog,*) 'ERROR: do_harvest can only be true if either use_cn or use_fates are true' call endrun(msg=errMsg(sourcefile, __LINE__)) end if - end if - + end if + end subroutine check_namelist_consistency !----------------------------------------------------------------------- @@ -312,6 +333,18 @@ logical function get_do_transient_crops() get_do_transient_crops = dyn_subgrid_control_inst%do_transient_crops end function get_do_transient_crops + + !----------------------------------------------------------------------- + logical function get_do_transient_lakes() + ! !DESCRIPTION: + ! Return the value of the do_transient_lakes control flag + !----------------------------------------------------------------------- + + SHR_ASSERT_FL(dyn_subgrid_control_inst%initialized, sourcefile, __LINE__) + + get_do_transient_lakes = dyn_subgrid_control_inst%do_transient_lakes + + end function get_do_transient_lakes !----------------------------------------------------------------------- logical function run_has_transient_landcover() diff --git a/src/dyn_subgrid/dynSubgridDriverMod.F90 b/src/dyn_subgrid/dynSubgridDriverMod.F90 index a6d91778fd..e34791ce75 100644 --- a/src/dyn_subgrid/dynSubgridDriverMod.F90 +++ b/src/dyn_subgrid/dynSubgridDriverMod.F90 @@ -12,7 +12,7 @@ module dynSubgridDriverMod use decompMod , only : bounds_type, BOUNDS_LEVEL_PROC, BOUNDS_LEVEL_CLUMP use decompMod , only : get_proc_clumps, get_clump_bounds use dynSubgridControlMod , only : get_flanduse_timeseries - use dynSubgridControlMod , only : get_do_transient_pfts, get_do_transient_crops + use dynSubgridControlMod , only : get_do_transient_pfts, get_do_transient_crops, get_do_transient_lakes use dynSubgridControlMod , only : get_do_harvest use dynPriorWeightsMod , only : prior_weights_type use dynPatchStateUpdaterMod , only : patch_state_updater_type @@ -20,6 +20,7 @@ module dynSubgridDriverMod use dynpftFileMod , only : dynpft_init, dynpft_interp use dyncropFileMod , only : dyncrop_init, dyncrop_interp use dynHarvestMod , only : dynHarvest_init, dynHarvest_interp + use dynlakeFileMod , only : dynlake_init, dynlake_interp use dynLandunitAreaMod , only : update_landunit_weights use subgridWeightsMod , only : compute_higher_order_weights, set_subgrid_diagnostic_fields use reweightMod , only : reweight_wrapup @@ -37,6 +38,7 @@ module dynSubgridDriverMod use SoilHydrologyType , only : soilhydrology_type use SoilStateType , only : soilstate_type use WaterType , only : water_type + use LakestateType , only : lakestate_type use TemperatureType , only : temperature_type use CropType , only : crop_type use glc2lndMod , only : glc2lnd_type @@ -120,6 +122,12 @@ subroutine dynSubgrid_init(bounds_proc, glc_behavior, crop_inst) call dynHarvest_init(bounds_proc, harvest_filename=get_flanduse_timeseries()) end if + + ! Initialize stuff for prescribed transient lakes + if (get_do_transient_lakes()) then + call dynlake_init(bounds_proc, dynlake_filename=get_flanduse_timeseries()) + end if + ! ------------------------------------------------------------------------ ! Set initial subgrid weights for aspects that are read from file. This is relevant ! for cold start and use_init_interp-based initialization. @@ -133,6 +141,11 @@ subroutine dynSubgrid_init(bounds_proc, glc_behavior, crop_inst) call dyncrop_interp(bounds_proc, crop_inst) end if + if (get_do_transient_lakes()) then + call dynlake_interp(bounds_proc) + end if + + ! (We don't bother calling dynHarvest_interp, because the harvest information isn't ! needed until the run loop. Harvest has nothing to do with subgrid weights, and in ! some respects doesn't even really belong in this module at all.) @@ -153,7 +166,7 @@ end subroutine dynSubgrid_init !----------------------------------------------------------------------- subroutine dynSubgrid_driver(bounds_proc, & urbanparams_inst, soilstate_inst, water_inst, & - temperature_inst, energyflux_inst, & + temperature_inst, energyflux_inst, lakestate_inst, & canopystate_inst, photosyns_inst, crop_inst, glc2lnd_inst, bgc_vegetation_inst, & soilbiogeochem_state_inst, soilbiogeochem_carbonstate_inst, & c13_soilbiogeochem_carbonstate_inst, c14_soilbiogeochem_carbonstate_inst, & @@ -181,6 +194,7 @@ subroutine dynSubgrid_driver(bounds_proc, type(urbanparams_type) , intent(in) :: urbanparams_inst type(soilstate_type) , intent(in) :: soilstate_inst type(water_type) , intent(inout) :: water_inst + type(lakestate_type) , intent(in) :: lakestate_inst type(temperature_type) , intent(inout) :: temperature_inst type(energyflux_type) , intent(inout) :: energyflux_inst type(canopystate_type) , intent(inout) :: canopystate_inst @@ -221,7 +235,7 @@ subroutine dynSubgrid_driver(bounds_proc, filter(nc)%num_nolakec, filter(nc)%nolakec, & filter(nc)%num_lakec, filter(nc)%lakec, & urbanparams_inst, soilstate_inst, & - water_inst, temperature_inst) + water_inst, temperature_inst, lakestate_inst) call prior_weights%set_prior_weights(bounds_clump) call patch_state_updater%set_old_weights(bounds_clump) @@ -244,7 +258,10 @@ subroutine dynSubgrid_driver(bounds_proc, if (get_do_harvest() .and. .not. use_fates) then call dynHarvest_interp(bounds_proc) end if - + + if (get_do_transient_lakes()) then + call dynlake_interp(bounds_proc) + end if ! ========================================================================== ! Do land cover change that does not require I/O ! ========================================================================== @@ -292,7 +309,7 @@ subroutine dynSubgrid_driver(bounds_proc, filter(nc)%num_lakec, filter(nc)%lakec, & urbanparams_inst, soilstate_inst, & water_inst, & - temperature_inst, energyflux_inst) + temperature_inst, energyflux_inst, lakestate_inst) if (use_cn) then call bgc_vegetation_inst%DynamicAreaConservation(bounds_clump, nc, & diff --git a/src/dyn_subgrid/dyncropFileMod.F90 b/src/dyn_subgrid/dyncropFileMod.F90 index 0d27cf8bfc..4ea7a4ff12 100644 --- a/src/dyn_subgrid/dyncropFileMod.F90 +++ b/src/dyn_subgrid/dyncropFileMod.F90 @@ -53,7 +53,7 @@ subroutine dyncrop_init(bounds, dyncrop_filename) ! ! !USES: use clm_varpar , only : cft_size - use ncdio_pio , only : check_dim + use ncdio_pio , only : check_dim_size use dynTimeInfoMod , only : YEAR_POSITION_START_OF_TIMESTEP ! ! !ARGUMENTS: @@ -80,7 +80,7 @@ subroutine dyncrop_init(bounds, dyncrop_filename) ! prognostically, if crop areas are ever determined prognostically rather than ! prescribed ahead of time. dyncrop_file = dyn_file_type(dyncrop_filename, YEAR_POSITION_START_OF_TIMESTEP) - call check_dim(dyncrop_file, 'cft', cft_size) + call check_dim_size(dyncrop_file, 'cft', cft_size) ! read data PCT_CROP and PCT_CFT corresponding to correct year ! diff --git a/src/dyn_subgrid/dynlakeFileMod.F90 b/src/dyn_subgrid/dynlakeFileMod.F90 new file mode 100644 index 0000000000..317f98ec75 --- /dev/null +++ b/src/dyn_subgrid/dynlakeFileMod.F90 @@ -0,0 +1,130 @@ +module dynlakeFileMod + + !--------------------------------------------------------------------------- + ! !DESCRIPTION: + ! Handle reading of the dataset that specifies transient areas of the lake landunit + ! + ! !USES: + +#include "shr_assert.h" + use shr_log_mod , only : errMsg => shr_log_errMsg + use shr_kind_mod , only : r8 => shr_kind_r8 + use decompMod , only : bounds_type, BOUNDS_LEVEL_PROC + use dynFileMod , only : dyn_file_type + use dynVarTimeUninterpMod , only : dyn_var_time_uninterp_type + use clm_varctl , only : iulog + use clm_varcon , only : grlnd + use abortutils , only : endrun + use spmdMod , only : masterproc + + ! !PUBLIC MEMBER FUNCTIONS: + implicit none + private + save + public :: dynlake_init ! initialize information read from landuse.timeseries dataset + public :: dynlake_interp ! get landuse data for the current time step, if needed + ! + ! ! PRIVATE TYPES + type(dyn_file_type), target :: dynlake_file ! information for the file containing transient lake data + type(dyn_var_time_uninterp_type) :: wtlake ! weight of the lake landunit + + ! Names of variables on file + character(len=*), parameter :: lake_varname = 'PCT_LAKE' + + character(len=*), parameter, private :: sourcefile = & + __FILE__ + !--------------------------------------------------------------------------- + +contains + + !----------------------------------------------------------------------- + subroutine dynlake_init(bounds, dynlake_filename) + ! + ! !DESCRIPTION: + ! Initialize dataset containing transient lake info (position it to the right time + ! samples that bound the initial model date) + ! + ! !USES: + use dynTimeInfoMod , only : YEAR_POSITION_START_OF_TIMESTEP + ! + ! !ARGUMENTS: + type(bounds_type) , intent(in) :: bounds ! proc-level bounds + character(len=*) , intent(in) :: dynlake_filename ! name of file containing transient lake information + ! + ! !LOCAL VARIABLES: + integer :: num_points ! number of spatial points + + character(len=*), parameter :: subname = 'dynlake_init' + !----------------------------------------------------------------------- + + SHR_ASSERT(bounds%level == BOUNDS_LEVEL_PROC, subname // ': argument must be PROC-level bounds') + + if (masterproc) then + write(iulog,*) 'Attempting to read lake dynamic landuse data .....' + end if + + ! Get the year from the START of the timestep; this way, we'll update lake areas + ! starting after the year boundary. This is consistent with the timing of glacier + ! updates, and will likely be consistent with the timing of lake updates determined + ! prognostically, if lake areas are ever determined prognostically rather than + ! prescribed ahead of time. + dynlake_file = dyn_file_type(dynlake_filename, YEAR_POSITION_START_OF_TIMESTEP) + + ! read data PCT_LAKE + ! + ! Note: if you want to change transient lakes so that they are interpolated, rather + ! than jumping to each year's value on Jan 1 of that year, simply change wtlake and + ! to be of type dyn_var_time_interp_type (rather than + ! dyn_var_time_uninterp_type), and change the following constructors to construct + ! variables of dyn_var_time_interp_type. That's all you need to do. + num_points = (bounds%endg - bounds%begg + 1) + wtlake = dyn_var_time_uninterp_type( & + dyn_file = dynlake_file, varname=lake_varname, & + dim1name=grlnd, conversion_factor=100._r8, & + do_check_sums_equal_1=.false., data_shape=[num_points]) + + end subroutine dynlake_init + + + !----------------------------------------------------------------------- + subroutine dynlake_interp(bounds) + ! + ! !DESCRIPTION: + ! Get lake cover for model time, when needed. + ! + ! Sets col%wtlunit and lun%wtgcell for lake landunits. + ! + ! Note that lake cover currently jumps to its new value at the start of the year. + ! However, as mentioned above, this behavior can be changed to time interpolation + ! simply by making wtlake and wtcft dyn_var_time_interp_type variables rather than + ! dyn_var_time_uninterp_type. + ! + ! !USES: + use landunit_varcon , only : istdlak + use subgridWeightsMod , only : set_landunit_weight + ! + ! !ARGUMENTS: + type(bounds_type), intent(in) :: bounds ! proc-level bounds + ! + ! !LOCAL VARIABLES: + integer :: g ! indices + real(r8), allocatable :: wtlake_cur(:) ! current weight of the lake landunit + + character(len=*), parameter :: subname = 'dynlake_interp' + !----------------------------------------------------------------------- + + SHR_ASSERT(bounds%level == BOUNDS_LEVEL_PROC, subname // ': argument must be PROC-level bounds') + + call dynlake_file%time_info%set_current_year() + + ! Set new landunit area + allocate(wtlake_cur(bounds%begg:bounds%endg)) + call wtlake%get_current_data(wtlake_cur) + do g = bounds%begg, bounds%endg + call set_landunit_weight(g, istdlak, wtlake_cur(g)) + end do + deallocate(wtlake_cur) + + end subroutine dynlake_interp + +end module dynlakeFileMod diff --git a/src/dyn_subgrid/dynpftFileMod.F90 b/src/dyn_subgrid/dynpftFileMod.F90 index 3d50ee740b..836b3cd6ee 100644 --- a/src/dyn_subgrid/dynpftFileMod.F90 +++ b/src/dyn_subgrid/dynpftFileMod.F90 @@ -78,7 +78,7 @@ subroutine dynpft_init(bounds, dynpft_filename) dynpft_file = dyn_file_type(dynpft_filename, YEAR_POSITION_START_OF_TIMESTEP) ! Consistency checks - call check_dim(dynpft_file, 'natpft', natpft_size) + call check_dim_size(dynpft_file, 'natpft', natpft_size) call dynpft_check_consistency(bounds) ! read data PCT_NAT_PFT corresponding to correct year diff --git a/src/dyn_subgrid/test/dynConsBiogeophys_test/test_dyn_cons_biogeophys.pf b/src/dyn_subgrid/test/dynConsBiogeophys_test/test_dyn_cons_biogeophys.pf index 54f56b333f..47f802e5bf 100644 --- a/src/dyn_subgrid/test/dynConsBiogeophys_test/test_dyn_cons_biogeophys.pf +++ b/src/dyn_subgrid/test/dynConsBiogeophys_test/test_dyn_cons_biogeophys.pf @@ -7,7 +7,7 @@ module test_dyn_cons_biogeophys use shr_kind_mod , only : r8 => shr_kind_r8 use unittestSubgridMod use unittestArrayMod, only : col_array - use unittestFilterBuilderMod, only : filter_from_range + use unittestFilterBuilderMod, only : filter_from_range, filter_empty use unittestWaterTypeFactory, only : unittest_water_type_factory_type use clm_varpar, only : nlevgrnd, nlevsno, maxpatch_glcmec use column_varcon, only : icemec_class_to_col_itype @@ -18,6 +18,7 @@ module test_dyn_cons_biogeophys use SoilStateType, only : soilstate_type use TemperatureType, only : temperature_type use UrbanParamsType, only : urbanparams_type + use LakestateType, only : lakestate_type use WaterType, only : water_type use TotalWaterAndHeatMod, only : AccumulateSoilLiqIceMassNonLake use TotalWaterAndHeatMod, only : AccumulateSoilHeatNonLake @@ -30,6 +31,7 @@ module test_dyn_cons_biogeophys type(soilstate_type) :: soilstate_inst type(temperature_type) :: temperature_inst type(urbanparams_type) :: urbanparams_inst + type(lakestate_type) :: lakestate_inst type(water_type) :: water_inst contains procedure :: setUp @@ -99,8 +101,8 @@ contains real(r8), parameter :: wt_veg_col1 = 0.25_r8 real(r8), parameter :: wt_veg_col2 = 0.75_r8 integer :: veg_col1, veg_col2, glc_col - integer :: num_icemecc, num_natveg_and_icemecc - integer, allocatable :: filter_icemecc(:), filter_natveg_and_icemecc(:) + integer :: num_icemecc, num_natveg_and_icemecc, num_lakec + integer, allocatable :: filter_icemecc(:), filter_natveg_and_icemecc(:), filter_lakec(:) integer :: c real(r8), allocatable :: expected_vals_liq_col(:) real(r8), allocatable :: expected_vals_ice_col(:) @@ -160,6 +162,9 @@ contains numf=num_icemecc, filter=filter_icemecc) call filter_from_range(start=veg_col1, end=glc_col, & numf=num_natveg_and_icemecc, filter=filter_natveg_and_icemecc) + ! For now, this test does NOT cover lake columns. So just use an empty lake filter. + ! This also allows us to avoid initializing variables in this%lakestate_inst. + call filter_empty(num_lakec, filter_lakec) ! Initialize necessary variables in soilstate_inst allocate(this%soilstate_inst%csol_col(bounds%begc:bounds%endc, nlevgrnd)) @@ -203,8 +208,10 @@ contains ! ------------------------------------------------------------------------ call dyn_hwcontent_set_baselines(bounds, num_icemecc, filter_icemecc, & - this%urbanparams_inst, this%soilstate_inst, & - this%water_inst, this%temperature_inst) + num_lakec, filter_lakec, & + this%urbanparams_inst, this%soilstate_inst, this%lakestate_inst, & + this%water_inst, this%temperature_inst, & + reset_all_baselines = .true., reset_lake_baselines = .false.) ! ------------------------------------------------------------------------ ! Compute expected values diff --git a/src/init_interp/initInterp.F90 b/src/init_interp/initInterp.F90 index f9272ba339..0e6e8da6e2 100644 --- a/src/init_interp/initInterp.F90 +++ b/src/init_interp/initInterp.F90 @@ -485,7 +485,7 @@ subroutine initInterp (filei, fileo, bounds, glc_behavior) end if ! Find which of the list of possible variables actually exists on the input file. - call find_var_on_file(ncidi, varname_i_options, varname_i) + call find_var_on_file(ncidi, varname_i_options, is_dim=.false., varname_on_file=varname_i) ! Note that, if none of the options are found, varname_i will be set to the first ! variable in the list, in which case the following code will determine that we diff --git a/src/init_interp/initInterpMultilevelContainer.F90 b/src/init_interp/initInterpMultilevelContainer.F90 index 56facfc52d..d27f7591de 100644 --- a/src/init_interp/initInterpMultilevelContainer.F90 +++ b/src/init_interp/initInterpMultilevelContainer.F90 @@ -21,7 +21,7 @@ module initInterpMultilevelContainer use initInterpMultilevelSplit , only : interp_multilevel_split_type, create_interp_multilevel_split_type use initInterp2dvar , only : interp_2dvar_type use initInterp1dData , only : interp_1d_data - use ncdio_pio , only : file_desc_t, var_desc_t, check_var, ncd_io + use ncdio_pio , only : file_desc_t, var_desc_t, check_var, ncd_io, ncd_inqdlen, ncd_inqdid use clm_varctl , only : iulog use abortutils , only : endrun use shr_log_mod , only : errMsg => shr_log_errMsg @@ -46,6 +46,7 @@ module initInterpMultilevelContainer ! attribute.) type(interp_multilevel_copy_type), pointer :: interp_multilevel_copy type(interp_multilevel_interp_type), pointer :: interp_multilevel_levgrnd_col + type(interp_multilevel_interp_type), pointer :: interp_multilevel_levmaxurbgrnd_col type(interp_multilevel_interp_type), pointer :: interp_multilevel_levgrnd_pft type(interp_multilevel_snow_type), pointer :: interp_multilevel_levsno type(interp_multilevel_snow_type), pointer :: interp_multilevel_levsno1 @@ -58,7 +59,9 @@ module initInterpMultilevelContainer ! Private routines - private :: create_interp_multilevel_levgrnd + private :: create_levgrnd_col_interpolators + private :: create_levgrnd_pft_interpolator + private :: get_levmaxurbgrnd_metadata private :: interp_levgrnd_check_source_file private :: create_snow_interpolators @@ -91,6 +94,9 @@ subroutine init(this, ncid_source, ncid_dest, bounds_source, bounds_dest, & integer, intent(in) :: colindex(:) ! ! !LOCAL VARIABLES: + integer :: levgrnd_source ! size of the levgrnd dimension in source + integer :: levgrnd_dest ! size of the levgrnd dimension in dest + integer :: dimid ! dimension id character(len=*), parameter :: subname = 'init' !----------------------------------------------------------------------- @@ -98,25 +104,40 @@ subroutine init(this, ncid_source, ncid_dest, bounds_source, bounds_dest, & allocate(this%interp_multilevel_copy) this%interp_multilevel_copy = interp_multilevel_copy_type() + call ncd_inqdlen(ncid_source, dimid, levgrnd_source, name='levgrnd') + call ncd_inqdlen(ncid_dest , dimid, levgrnd_dest , name='levgrnd') + + ! Note that there are two (often identical) interpolators for column-level levgrnd: + ! interp_multilevel_levgrnd_col is used for interpolating variables that are + ! dimensioned by levgrnd; interp_multilevel_levmaxurbgrnd_col is used as part of the + ! levtot interpolator for interpolating variables that are dimensioned by levtot, + ! because levtot is snow plus levmaxurbgrnd. If nlevgrnd >= nlevurb (which is often + ! the case), then these two are identical; however, if nlevgrnd < nlevurb for source + ! and/or destination, then interp_multilevel_levmaxurbgrnd_col will have additional + ! levels beyond those in interp_multilevel_levgrnd_col. allocate(this%interp_multilevel_levgrnd_col) - this%interp_multilevel_levgrnd_col = create_interp_multilevel_levgrnd( & + allocate(this%interp_multilevel_levmaxurbgrnd_col) + call create_levgrnd_col_interpolators( & ncid_source = ncid_source, & ncid_dest = ncid_dest, & bounds_source = bounds_source, & bounds_dest = bounds_dest, & - coord_varname = 'COL_Z', & - level_class_varname = 'LEVGRND_CLASS', & - sgridindex = colindex) + levgrnd_source = levgrnd_source, & + levgrnd_dest = levgrnd_dest, & + colindex = colindex, & + interp_multilevel_levgrnd_col = this%interp_multilevel_levgrnd_col, & + interp_multilevel_levmaxurbgrnd_col = this%interp_multilevel_levmaxurbgrnd_col) allocate(this%interp_multilevel_levgrnd_pft) - this%interp_multilevel_levgrnd_pft = create_interp_multilevel_levgrnd( & + call create_levgrnd_pft_interpolator( & ncid_source = ncid_source, & ncid_dest = ncid_dest, & bounds_source = bounds_source, & bounds_dest = bounds_dest, & - coord_varname = 'COL_Z_p', & - level_class_varname = 'LEVGRND_CLASS_p', & - sgridindex = pftindex) + levgrnd_source = levgrnd_source, & + levgrnd_dest = levgrnd_dest, & + pftindex = pftindex, & + interp_multilevel_levgrnd_pft = this%interp_multilevel_levgrnd_pft) allocate(this%interp_multilevel_levsno) allocate(this%interp_multilevel_levsno1) @@ -128,13 +149,14 @@ subroutine init(this, ncid_source, ncid_dest, bounds_source, bounds_dest, & bounds_dest = bounds_dest, & colindex = colindex) - ! levtot is two sets of levels: first snow, then levgrnd + ! levtot is two sets of levels: first snow, then levmaxurbgrnd (where levmaxurbgrnd = + ! max(levgrnd, levurb)) allocate(this%interp_multilevel_levtot_col) this%interp_multilevel_levtot_col = create_interp_multilevel_split_type( & interpolator_first_levels = this%find_interpolator('levsno', 'column'), & - interpolator_second_levels = this%interp_multilevel_levgrnd_col, & - num_second_levels_source = this%interp_multilevel_levgrnd_col%get_nlev_source(), & - num_second_levels_dest = this%interp_multilevel_levgrnd_col%get_nlev_dest()) + interpolator_second_levels = this%interp_multilevel_levmaxurbgrnd_col, & + num_second_levels_source = this%interp_multilevel_levmaxurbgrnd_col%get_nlev_source(), & + num_second_levels_dest = this%interp_multilevel_levmaxurbgrnd_col%get_nlev_dest()) end subroutine init @@ -169,6 +191,16 @@ function find_interpolator(this, lev_dimname, vec_dimname) result(interpolator) case default call error_not_found(subname, lev_dimname, vec_dimname) end select + case ('levmaxurbgrnd') + select case (vec_dimname) + case ('column') + ! NOTE(wjs, 2020-10-23) Currently, no variables use this interpolator, but we + ! need it as part of the levtot interpolator, so we might as well support it as + ! a standalone interpolator in case it's needed in the future. + interpolator => this%interp_multilevel_levmaxurbgrnd_col + case default + call error_not_found(subname, lev_dimname, vec_dimname) + end select case ('levtot') select case (vec_dimname) case ('column') @@ -204,19 +236,121 @@ end function find_interpolator ! ======================================================================== !----------------------------------------------------------------------- - function create_interp_multilevel_levgrnd(ncid_source, ncid_dest, & - bounds_source, bounds_dest, & - coord_varname, level_class_varname, & - sgridindex) & - result(interpolator) + subroutine create_levgrnd_col_interpolators(ncid_source, ncid_dest, & + bounds_source, bounds_dest, colindex, levgrnd_source, levgrnd_dest, & + interp_multilevel_levgrnd_col, interp_multilevel_levmaxurbgrnd_col) ! ! !DESCRIPTION: - ! Create the interpolator used to interpolate variables dimensioned by levgrnd + ! Create the interp_multilevel_levgrnd_col and interp_multilevel_levmaxurbgrnd_col interpolators ! - ! !USES: + ! !ARGUMENTS: + type(file_desc_t), target, intent(inout) :: ncid_source + type(file_desc_t), target, intent(inout) :: ncid_dest + type(interp_bounds_type), intent(in) :: bounds_source + type(interp_bounds_type), intent(in) :: bounds_dest + integer, intent(in) :: colindex(:) ! mappings from column-level source to dest points + integer, intent(in) :: levgrnd_source ! size of the levgrnd dimension in source + integer, intent(in) :: levgrnd_dest ! size of the levgrnd dimension in dest + type(interp_multilevel_interp_type), intent(out) :: interp_multilevel_levgrnd_col + type(interp_multilevel_interp_type), intent(out) :: interp_multilevel_levmaxurbgrnd_col + ! + ! !LOCAL VARIABLES: + real(r8), allocatable :: coordinates_source(:,:) ! [lev, vec] + real(r8), allocatable :: coordinates_dest(:,:) ! [lev, vec] + integer , allocatable :: level_classes_source(:,:) ! [lev, vec] + integer , allocatable :: level_classes_dest(:,:) ! [lev, vec] + + character(len=*), parameter :: subname = 'create_levgrnd_col_interpolators' + !----------------------------------------------------------------------- + + call get_levmaxurbgrnd_metadata( & + ncid_source = ncid_source, & + ncid_dest = ncid_dest, & + bounds_source = bounds_source, & + bounds_dest = bounds_dest, & + coord_varname = 'COL_Z', & + level_class_varname = 'LEVGRND_CLASS', & + sgridindex = colindex, & + coordinates_source = coordinates_source, & + coordinates_dest = coordinates_dest, & + level_classes_source = level_classes_source, & + level_classes_dest = level_classes_dest) + + interp_multilevel_levmaxurbgrnd_col = interp_multilevel_interp_type( & + coordinates_source = coordinates_source, & + coordinates_dest = coordinates_dest, & + level_classes_source = level_classes_source, & + level_classes_dest = level_classes_dest, & + coord_varname = 'COL_Z') + + interp_multilevel_levgrnd_col = interp_multilevel_interp_type( & + coordinates_source = coordinates_source(1:levgrnd_source, :), & + coordinates_dest = coordinates_dest(1:levgrnd_dest, :), & + level_classes_source = level_classes_source(1:levgrnd_source, :), & + level_classes_dest = level_classes_dest(1:levgrnd_dest, :), & + coord_varname = 'COL_Z down to levgrnd') + + end subroutine create_levgrnd_col_interpolators + + !----------------------------------------------------------------------- + subroutine create_levgrnd_pft_interpolator(ncid_source, ncid_dest, & + bounds_source, bounds_dest, pftindex, levgrnd_source, levgrnd_dest, & + interp_multilevel_levgrnd_pft) + ! + ! !DESCRIPTION: + ! Create the interp_multilevel_levgrnd_pft interpolator + ! + ! !ARGUMENTS: + type(file_desc_t), target, intent(inout) :: ncid_source + type(file_desc_t), target, intent(inout) :: ncid_dest + type(interp_bounds_type), intent(in) :: bounds_source + type(interp_bounds_type), intent(in) :: bounds_dest + integer, intent(in) :: pftindex(:) ! mappings from patch-level source to dest points + integer, intent(in) :: levgrnd_source ! size of the levgrnd dimension in source + integer, intent(in) :: levgrnd_dest ! size of the levgrnd dimension in dest + type(interp_multilevel_interp_type), intent(out) :: interp_multilevel_levgrnd_pft + ! + ! !LOCAL VARIABLES: + real(r8), allocatable :: coordinates_source(:,:) ! [lev, vec] + real(r8), allocatable :: coordinates_dest(:,:) ! [lev, vec] + integer , allocatable :: level_classes_source(:,:) ! [lev, vec] + integer , allocatable :: level_classes_dest(:,:) ! [lev, vec] + + character(len=*), parameter :: subname = 'create_levgrnd_pft_interpolator' + !----------------------------------------------------------------------- + + call get_levmaxurbgrnd_metadata( & + ncid_source = ncid_source, & + ncid_dest = ncid_dest, & + bounds_source = bounds_source, & + bounds_dest = bounds_dest, & + coord_varname = 'COL_Z_p', & + level_class_varname = 'LEVGRND_CLASS_p', & + sgridindex = pftindex, & + coordinates_source = coordinates_source, & + coordinates_dest = coordinates_dest, & + level_classes_source = level_classes_source, & + level_classes_dest = level_classes_dest) + + interp_multilevel_levgrnd_pft = interp_multilevel_interp_type( & + coordinates_source = coordinates_source(1:levgrnd_source, :), & + coordinates_dest = coordinates_dest(1:levgrnd_dest, :), & + level_classes_source = level_classes_source(1:levgrnd_source, :), & + level_classes_dest = level_classes_dest(1:levgrnd_dest, :), & + coord_varname = 'COL_Z_p down to levgrnd') + + end subroutine create_levgrnd_pft_interpolator + + !----------------------------------------------------------------------- + subroutine get_levmaxurbgrnd_metadata(ncid_source, ncid_dest, & + bounds_source, bounds_dest, & + coord_varname, level_class_varname, sgridindex, & + coordinates_source, coordinates_dest, level_classes_source, level_classes_dest) + ! + ! !DESCRIPTION: + ! Get coordinate and level class metadata for the levmaxurbgrnd dimension ! ! !ARGUMENTS: - type(interp_multilevel_interp_type) :: interpolator ! function result type(file_desc_t), target, intent(inout) :: ncid_source type(file_desc_t), target, intent(inout) :: ncid_dest type(interp_bounds_type), intent(in) :: bounds_source @@ -224,6 +358,12 @@ function create_interp_multilevel_levgrnd(ncid_source, ncid_dest, & character(len=*), intent(in) :: coord_varname character(len=*), intent(in) :: level_class_varname integer, intent(in) :: sgridindex(:) ! mappings from source to dest points for the appropriate subgrid level (e.g., column-level mappings if this interpolator is for column-level data) + + ! The following output arrays are all allocated in this subroutine: + real(r8), allocatable, intent(out) :: coordinates_source(:,:) ! [lev, vec] + real(r8), allocatable, intent(out) :: coordinates_dest(:,:) ! [lev, vec] + integer , allocatable, intent(out) :: level_classes_source(:,:) ! [lev, vec] + integer , allocatable, intent(out) :: level_classes_dest(:,:) ! [lev, vec] ! ! !LOCAL VARIABLES: type(interp_2dvar_type) :: coord_source @@ -236,10 +376,12 @@ function create_interp_multilevel_levgrnd(ncid_source, ncid_dest, & integer , pointer :: level_class_data_source_sgrid_1d(:) ! [vec] On the source grid integer , allocatable :: level_class_data_source(:,:) ! [vec, lev] Interpolated to the dest grid, but source vertical grid integer , pointer :: level_class_data_dest(:,:) ! [vec, lev] Dest horiz & vertical grid - real(r8), allocatable :: coord_data_source_transpose(:,:) ! [lev, vec] - real(r8), allocatable :: coord_data_dest_transpose(:,:) ! [lev, vec] - integer , allocatable :: level_class_data_source_transpose(:,:) ! [lev, vec] - integer , allocatable :: level_class_data_dest_transpose(:,:) ! [lev, vec] + + integer :: dimid ! netcdf dimension id + logical :: dimexist ! whether the given dimension exists on file + + integer :: levmaxurbgrnd_source ! length of levmaxurbgrnd dimension on source file + integer :: levmaxurbgrnd_dest ! length of levmaxurbgrnd dimension on dest file integer :: beg_dest integer :: end_dest @@ -249,9 +391,25 @@ function create_interp_multilevel_levgrnd(ncid_source, ncid_dest, & integer :: level integer :: nlev_source - character(len=*), parameter :: subname = 'create_interp_multilevel_levgrnd' + character(len=*), parameter :: levmaxurbgrnd_name = 'levmaxurbgrnd' + + character(len=*), parameter :: subname = 'get_levmaxurbgrnd_metadata' !----------------------------------------------------------------------- + ! Get levmaxurbgrnd dimension size on source and dest + ! BACKWARDS_COMPATIBILITY(wjs, 2020-10-22) On older initial conditions files, + ! levmaxurbgrnd doesn't exist, but we can use levgrnd for the same purpose because + ! prior to the existence of levmaxurbgrnd, it was always the case that levgrnd >= + ! levurb. + call ncd_inqdid(ncid_source, levmaxurbgrnd_name, dimid, dimexist) + if (dimexist) then + call ncd_inqdlen(ncid_source, dimid, levmaxurbgrnd_source) + else + call ncd_inqdlen(ncid_source, dimid, levmaxurbgrnd_source, name='levgrnd') + end if + ! For dest, we can assume this dimension exists + call ncd_inqdlen(ncid_dest, dimid, levmaxurbgrnd_dest, name=levmaxurbgrnd_name) + ! Set coord_data_dest coord_dest = interp_2dvar_type( & varname = coord_varname, & @@ -263,6 +421,10 @@ function create_interp_multilevel_levgrnd(ncid_source, ncid_dest, & ! match can be found for the generic subprogram call "READVAR"'. So we ! explicitly call the specific routine, rather than calling readvar. call coord_dest%readvar_double(coord_data_dest) + call shr_assert(coord_dest%get_nlev() == levmaxurbgrnd_dest, & + msg = 'dest '//coord_varname//' dimension length does not match expected levmaxurbgrnd size', & + file = sourcefile, & + line = __LINE__) beg_dest = coord_dest%get_vec_beg() end_dest = coord_dest%get_vec_end() @@ -277,6 +439,10 @@ function create_interp_multilevel_levgrnd(ncid_source, ncid_dest, & ! match can be found for the generic subprogram call "READVAR"'. So we ! explicitly call the specific routine, rather than calling readvar. call level_class_dest%readvar_int(level_class_data_dest) + call shr_assert(level_class_dest%get_nlev() == levmaxurbgrnd_dest, & + msg = 'dest '//level_class_varname//' dimension length does not match expected levmaxurbgrnd size', & + file = sourcefile, & + line = __LINE__) SHR_ASSERT_FL(level_class_dest%get_vec_beg() == beg_dest, sourcefile, __LINE__) SHR_ASSERT_FL(level_class_dest%get_vec_end() == end_dest, sourcefile, __LINE__) @@ -293,6 +459,10 @@ function create_interp_multilevel_levgrnd(ncid_source, ncid_dest, & ncid = ncid_source, & file_is_dest = .false., & bounds = bounds_source) + call shr_assert(coord_source%get_nlev() == levmaxurbgrnd_source, & + msg = 'source '//coord_varname//' dimension length does not match expected levmaxurbgrnd size', & + file = sourcefile, & + line = __LINE__) nlev_source = coord_source%get_nlev() beg_source = coord_source%get_vec_beg() end_source = coord_source%get_vec_end() @@ -320,7 +490,10 @@ function create_interp_multilevel_levgrnd(ncid_source, ncid_dest, & ncid = ncid_source, & file_is_dest = .false., & bounds = bounds_source) - SHR_ASSERT_FL(level_class_source%get_nlev() == nlev_source, sourcefile, __LINE__) + call shr_assert(level_class_source%get_nlev() == levmaxurbgrnd_source, & + msg = 'source '//level_class_varname//' dimension length does not match expected levmaxurbgrnd size', & + file = sourcefile, & + line = __LINE__) SHR_ASSERT_FL(level_class_source%get_vec_beg() == beg_source, sourcefile, __LINE__) SHR_ASSERT_FL(level_class_source%get_vec_end() == end_source, sourcefile, __LINE__) allocate(level_class_data_source(beg_dest:end_dest, nlev_source)) @@ -341,23 +514,17 @@ function create_interp_multilevel_levgrnd(ncid_source, ncid_dest, & end do deallocate(level_class_data_source_sgrid_1d) - ! Create interpolator - call transpose_wrapper(coord_data_source_transpose, coord_data_source) - call transpose_wrapper(coord_data_dest_transpose, coord_data_dest) - call transpose_wrapper(level_class_data_source_transpose, level_class_data_source) - call transpose_wrapper(level_class_data_dest_transpose, level_class_data_dest) - interpolator = interp_multilevel_interp_type( & - coordinates_source = coord_data_source_transpose, & - coordinates_dest = coord_data_dest_transpose, & - level_classes_source = level_class_data_source_transpose, & - level_classes_dest = level_class_data_dest_transpose, & - coord_varname = coord_varname) + ! Set output arrays + call transpose_wrapper(coordinates_source, coord_data_source) + call transpose_wrapper(coordinates_dest, coord_data_dest) + call transpose_wrapper(level_classes_source, level_class_data_source) + call transpose_wrapper(level_classes_dest, level_class_data_dest) ! Deallocate pointers (allocatables are automatically deallocated) deallocate(coord_data_dest) deallocate(level_class_data_dest) - end function create_interp_multilevel_levgrnd + end subroutine get_levmaxurbgrnd_metadata !----------------------------------------------------------------------- subroutine interp_levgrnd_check_source_file(ncid_source, coord_varname, level_class_varname) @@ -378,19 +545,17 @@ subroutine interp_levgrnd_check_source_file(ncid_source, coord_varname, level_cl ! !LOCAL VARIABLES: logical :: coord_on_source logical :: level_class_on_source - type(var_desc_t) :: coord_source_vardesc ! unused, but needed for check_var interface - type(var_desc_t) :: level_class_source_vardesc ! unused, but needed for check_var interface character(len=:), allocatable :: variables_missing character(len=*), parameter :: subname = 'interp_levgrnd_check_source_file' !----------------------------------------------------------------------- variables_missing = ' ' - call check_var(ncid_source, coord_varname, coord_source_vardesc, coord_on_source) + call check_var(ncid_source, coord_varname, coord_on_source) if (.not. coord_on_source) then variables_missing = variables_missing // coord_varname // ' ' end if - call check_var(ncid_source, level_class_varname, level_class_source_vardesc, level_class_on_source) + call check_var(ncid_source, level_class_varname, level_class_on_source) if (.not. level_class_on_source) then variables_missing = variables_missing // level_class_varname // ' ' end if @@ -501,6 +666,7 @@ subroutine destroy_interp_multilevel_container_type(this) deallocate(this%interp_multilevel_copy) deallocate(this%interp_multilevel_levgrnd_col) + deallocate(this%interp_multilevel_levmaxurbgrnd_col) deallocate(this%interp_multilevel_levgrnd_pft) deallocate(this%interp_multilevel_levsno) deallocate(this%interp_multilevel_levsno1) diff --git a/src/main/ColumnType.F90 b/src/main/ColumnType.F90 index f55b59b01c..181be48a0e 100644 --- a/src/main/ColumnType.F90 +++ b/src/main/ColumnType.F90 @@ -20,7 +20,7 @@ module ColumnType ! use shr_kind_mod , only : r8 => shr_kind_r8 use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use clm_varpar , only : nlevsno, nlevgrnd, nlevlak + use clm_varpar , only : nlevsno, nlevgrnd, nlevlak, nlevmaxurbgrnd use clm_varcon , only : spval, ispval use shr_sys_mod , only : shr_sys_abort use clm_varctl , only : iulog @@ -117,16 +117,16 @@ subroutine Init(this, begc, endc) ! The following is set in initVerticalMod allocate(this%snl (begc:endc)) ; this%snl (:) = ispval !* cannot be averaged up - allocate(this%dz (begc:endc,-nlevsno+1:nlevgrnd)) ; this%dz (:,:) = nan - allocate(this%z (begc:endc,-nlevsno+1:nlevgrnd)) ; this%z (:,:) = nan - allocate(this%zi (begc:endc,-nlevsno+0:nlevgrnd)) ; this%zi (:,:) = nan + allocate(this%dz (begc:endc,-nlevsno+1:nlevmaxurbgrnd)) ; this%dz (:,:) = nan + allocate(this%z (begc:endc,-nlevsno+1:nlevmaxurbgrnd)) ; this%z (:,:) = nan + allocate(this%zi (begc:endc,-nlevsno+0:nlevmaxurbgrnd)) ; this%zi (:,:) = nan allocate(this%zii (begc:endc)) ; this%zii (:) = nan allocate(this%lakedepth (begc:endc)) ; this%lakedepth (:) = spval allocate(this%dz_lake (begc:endc,nlevlak)) ; this%dz_lake (:,:) = nan allocate(this%z_lake (begc:endc,nlevlak)) ; this%z_lake (:,:) = nan - allocate(this%nbedrock (begc:endc)) ; this%nbedrock (:) = ispval - allocate(this%levgrnd_class(begc:endc,nlevgrnd)) ; this%levgrnd_class(:,:) = ispval + allocate(this%nbedrock (begc:endc)) ; this%nbedrock (:) = ispval + allocate(this%levgrnd_class(begc:endc,nlevmaxurbgrnd)) ; this%levgrnd_class(:,:) = ispval allocate(this%micro_sigma (begc:endc)) ; this%micro_sigma (:) = nan allocate(this%topo_slope (begc:endc)) ; this%topo_slope (:) = nan allocate(this%topo_std (begc:endc)) ; this%topo_std (:) = nan diff --git a/src/main/FireDataBaseType.F90 b/src/main/FireDataBaseType.F90 index be9325d798..ac7d28171f 100644 --- a/src/main/FireDataBaseType.F90 +++ b/src/main/FireDataBaseType.F90 @@ -11,7 +11,7 @@ module FireDataBaseType use shr_strdata_mod , only : shr_strdata_type, shr_strdata_create, shr_strdata_print use shr_strdata_mod , only : shr_strdata_advance use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varctl , only : iulog + use clm_varctl , only : iulog, inst_name use spmdMod , only : masterproc, mpicom, comp_id use fileutils , only : getavu, relavu use decompMod , only : gsmap_lnd_gdc2glo @@ -42,7 +42,8 @@ module FireDataBaseType contains ! ! !PUBLIC MEMBER FUNCTIONS: - procedure, public :: FireInit ! Initialization of Fire + procedure, public :: FireInit => BaseFireInit ! Initialization of Fire + procedure, public :: BaseFireInit ! Initialization of Fire procedure(FireReadNML_interface), public, deferred :: FireReadNML ! Read in namelist for Fire procedure, public :: FireInterp ! Interpolate fire data procedure(need_lightning_and_popdens_interface), public, deferred :: & @@ -92,7 +93,7 @@ subroutine FireReadNML_interface( this, NLFilename ) end subroutine FireReadNML_interface !----------------------------------------------------------------------- - subroutine FireInit( this, bounds, NLFilename ) + subroutine BaseFireInit( this, bounds, NLFilename ) ! ! !DESCRIPTION: ! Initialize CN Fire module @@ -101,7 +102,7 @@ subroutine FireInit( this, bounds, NLFilename ) ! ! !ARGUMENTS: class(fire_base_type) :: this - type(bounds_type), intent(in) :: bounds + type(bounds_type), intent(in) :: bounds character(len=*), intent(in) :: NLFilename !----------------------------------------------------------------------- @@ -119,7 +120,7 @@ subroutine FireInit( this, bounds, NLFilename ) call this%lnfm_interp(bounds) end if - end subroutine FireInit + end subroutine BaseFireInit !----------------------------------------------------------------------- subroutine FireInterp(this,bounds) @@ -129,7 +130,7 @@ subroutine FireInterp(this,bounds) ! ! !ARGUMENTS: class(fire_base_type) :: this - type(bounds_type), intent(in) :: bounds + type(bounds_type), intent(in) :: bounds !----------------------------------------------------------------------- if ( this%need_lightning_and_popdens() ) then @@ -146,7 +147,6 @@ subroutine hdm_init( this, bounds, NLFilename ) ! Initialize data stream information for population density. ! ! !USES: - use clm_varctl , only : inst_name use clm_time_manager , only : get_calendar use ncdio_pio , only : pio_subsystem use shr_pio_mod , only : shr_pio_getiotype @@ -157,16 +157,16 @@ subroutine hdm_init( this, bounds, NLFilename ) ! !ARGUMENTS: implicit none class(fire_base_type) :: this - type(bounds_type), intent(in) :: bounds + type(bounds_type), intent(in) :: bounds character(len=*), intent(in) :: NLFilename ! Namelist filename ! ! !LOCAL VARIABLES: integer :: stream_year_first_popdens ! first year in pop. dens. stream to use integer :: stream_year_last_popdens ! last year in pop. dens. stream to use - integer :: model_year_align_popdens ! align stream_year_first_hdm with + integer :: model_year_align_popdens ! align stream_year_first_hdm with integer :: nu_nml ! unit for namelist file integer :: nml_error ! namelist i/o error flag - type(mct_ggrid) :: dom_clm ! domain information + type(mct_ggrid) :: dom_clm ! domain information character(len=CL) :: stream_fldFileName_popdens ! population density streams filename character(len=CL) :: popdensmapalgo = 'bilinear' ! mapping alogrithm for population density character(len=CL) :: popdens_tintalgo = 'nearest'! time interpolation alogrithm for population density @@ -212,9 +212,9 @@ subroutine hdm_init( this, bounds, NLFilename ) if (masterproc) then write(iulog,*) ' ' write(iulog,*) 'popdens_streams settings:' - write(iulog,*) ' stream_year_first_popdens = ',stream_year_first_popdens - write(iulog,*) ' stream_year_last_popdens = ',stream_year_last_popdens - write(iulog,*) ' model_year_align_popdens = ',model_year_align_popdens + write(iulog,*) ' stream_year_first_popdens = ',stream_year_first_popdens + write(iulog,*) ' stream_year_last_popdens = ',stream_year_last_popdens + write(iulog,*) ' model_year_align_popdens = ',model_year_align_popdens write(iulog,*) ' stream_fldFileName_popdens = ',stream_fldFileName_popdens write(iulog,*) ' popdens_tintalgo = ',popdens_tintalgo write(iulog,*) ' ' @@ -223,8 +223,8 @@ subroutine hdm_init( this, bounds, NLFilename ) call clm_domain_mct (bounds, dom_clm) call shr_strdata_create(this%sdat_hdm,name="clmhdm", & - pio_subsystem=pio_subsystem, & - pio_iotype=shr_pio_getiotype(inst_name), & + pio_subsystem=pio_subsystem, & + pio_iotype=shr_pio_getiotype(inst_name), & mpicom=mpicom, compid=comp_id, & gsmap=gsmap_lnd_gdc2glo, ggrid=dom_clm, & nxg=ldomain%ni, nyg=ldomain%nj, & @@ -236,7 +236,7 @@ subroutine hdm_init( this, bounds, NLFilename ) domFileName=trim(stream_fldFileName_popdens), & domTvarName='time', & domXvarName='lon' , & - domYvarName='lat' , & + domYvarName='lat' , & domAreaName='area', & domMaskName='mask', & filePath='', & @@ -259,7 +259,7 @@ subroutine hdm_init( this, bounds, NLFilename ) ptr_lnd=this%forc_hdm, default='inactive') end subroutine hdm_init - + !----------------------------------------------------------------------- subroutine hdm_interp( this, bounds) ! @@ -271,7 +271,7 @@ subroutine hdm_interp( this, bounds) ! ! !ARGUMENTS: class(fire_base_type) :: this - type(bounds_type), intent(in) :: bounds + type(bounds_type), intent(in) :: bounds ! ! !LOCAL VARIABLES: integer :: g, ig @@ -292,7 +292,7 @@ subroutine hdm_interp( this, bounds) ig = ig+1 this%forc_hdm(g) = this%sdat_hdm%avs(1)%rAttr(1,ig) end do - + end subroutine hdm_interp !----------------------------------------------------------------------- @@ -303,7 +303,6 @@ subroutine lnfm_init( this, bounds, NLFilename ) ! Initialize data stream information for Lightning. ! ! !USES: - use clm_varctl , only : inst_name use clm_time_manager , only : get_calendar use ncdio_pio , only : pio_subsystem use shr_pio_mod , only : shr_pio_getiotype @@ -314,16 +313,16 @@ subroutine lnfm_init( this, bounds, NLFilename ) ! !ARGUMENTS: implicit none class(fire_base_type) :: this - type(bounds_type), intent(in) :: bounds + type(bounds_type), intent(in) :: bounds character(len=*), intent(in) :: NLFilename ! ! !LOCAL VARIABLES: integer :: stream_year_first_lightng ! first year in Lightning stream to use integer :: stream_year_last_lightng ! last year in Lightning stream to use - integer :: model_year_align_lightng ! align stream_year_first_lnfm with + integer :: model_year_align_lightng ! align stream_year_first_lnfm with integer :: nu_nml ! unit for namelist file integer :: nml_error ! namelist i/o error flag - type(mct_ggrid) :: dom_clm ! domain information + type(mct_ggrid) :: dom_clm ! domain information character(len=CL) :: stream_fldFileName_lightng ! lightning stream filename to read character(len=CL) :: lightng_tintalgo = 'linear'! time interpolation alogrithm character(len=CL) :: lightngmapalgo = 'bilinear'! Mapping alogrithm @@ -369,9 +368,9 @@ subroutine lnfm_init( this, bounds, NLFilename ) if (masterproc) then write(iulog,*) ' ' write(iulog,*) 'light_stream settings:' - write(iulog,*) ' stream_year_first_lightng = ',stream_year_first_lightng - write(iulog,*) ' stream_year_last_lightng = ',stream_year_last_lightng - write(iulog,*) ' model_year_align_lightng = ',model_year_align_lightng + write(iulog,*) ' stream_year_first_lightng = ',stream_year_first_lightng + write(iulog,*) ' stream_year_last_lightng = ',stream_year_last_lightng + write(iulog,*) ' model_year_align_lightng = ',model_year_align_lightng write(iulog,*) ' stream_fldFileName_lightng = ',stream_fldFileName_lightng write(iulog,*) ' lightng_tintalgo = ',lightng_tintalgo write(iulog,*) ' ' @@ -380,8 +379,8 @@ subroutine lnfm_init( this, bounds, NLFilename ) call clm_domain_mct (bounds, dom_clm) call shr_strdata_create(this%sdat_lnfm,name="clmlnfm", & - pio_subsystem=pio_subsystem, & - pio_iotype=shr_pio_getiotype(inst_name), & + pio_subsystem=pio_subsystem, & + pio_iotype=shr_pio_getiotype(inst_name), & mpicom=mpicom, compid=comp_id, & gsmap=gsmap_lnd_gdc2glo, ggrid=dom_clm, & nxg=ldomain%ni, nyg=ldomain%nj, & @@ -393,7 +392,7 @@ subroutine lnfm_init( this, bounds, NLFilename ) domFileName=trim(stream_fldFileName_lightng), & domTvarName='time', & domXvarName='lon' , & - domYvarName='lat' , & + domYvarName='lat' , & domAreaName='area', & domMaskName='mask', & filePath='', & @@ -416,7 +415,7 @@ subroutine lnfm_init( this, bounds, NLFilename ) ptr_lnd=this%forc_lnfm, default='inactive') end subroutine lnfm_init - + !----------------------------------------------------------------------- subroutine lnfm_interp(this, bounds ) ! @@ -428,7 +427,7 @@ subroutine lnfm_interp(this, bounds ) ! ! !ARGUMENTS: class(fire_base_type) :: this - type(bounds_type), intent(in) :: bounds + type(bounds_type), intent(in) :: bounds ! ! !LOCAL VARIABLES: integer :: g, ig @@ -449,7 +448,7 @@ subroutine lnfm_interp(this, bounds ) ig = ig+1 this%forc_lnfm(g) = this%sdat_lnfm%avs(1)%rAttr(1,ig) end do - + end subroutine lnfm_interp end module FireDataBaseType diff --git a/src/main/FireMethodType.F90 b/src/main/FireMethodType.F90 index 314ee1ceca..d0685f0826 100644 --- a/src/main/FireMethodType.F90 +++ b/src/main/FireMethodType.F90 @@ -115,8 +115,10 @@ end subroutine CNFireReadParams_interface !----------------------------------------------------------------------- subroutine CNFireArea_interface (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & + num_exposedvegp, filter_exposedvegp, num_noexposedvegp, filter_noexposedvegp, & atm2lnd_inst, energyflux_inst, saturated_excess_runoff_inst, & waterdiagnosticbulk_inst, wateratm2lndbulk_inst, & + waterstatebulk_inst, soilstate_inst, soil_water_retention_curve, & cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) ! ! !DESCRIPTION: @@ -128,8 +130,11 @@ subroutine CNFireArea_interface (this, bounds, num_soilc, filter_soilc, num_soil use atm2lndType , only : atm2lnd_type use EnergyFluxType , only : energyflux_type use SaturatedExcessRunoffMod , only : saturated_excess_runoff_type - use WaterDiagnosticBulkType , only : waterdiagnosticbulk_type - use Wateratm2lndBulkType , only : wateratm2lndbulk_type + use WaterDiagnosticBulkType , only : waterdiagnosticbulk_type + use Wateratm2lndBulkType , only : wateratm2lndbulk_type + use WaterStateBulkType , only : waterstatebulk_type + use SoilStateType , only : soilstate_type + use SoilWaterRetentionCurveMod , only : soil_water_retention_curve_type use CNVegStateType , only : cnveg_state_type use CNVegCarbonStateType , only : cnveg_carbonstate_type import :: fire_method_type @@ -141,11 +146,18 @@ subroutine CNFireArea_interface (this, bounds, num_soilc, filter_soilc, num_soil integer , intent(in) :: filter_soilc(:) ! filter for soil columns integer , intent(in) :: num_soilp ! number of soil patches in filter integer , intent(in) :: filter_soilp(:) ! filter for soil patches + integer , intent(in) :: num_exposedvegp ! number of points in filter_exposedvegp + integer , intent(in) :: filter_exposedvegp(:) ! patch filter for non-snow-covered veg + integer , intent(in) :: num_noexposedvegp ! number of points in filter_noexposedvegp + integer , intent(in) :: filter_noexposedvegp(:) ! patch filter where frac_veg_nosno is 0 type(atm2lnd_type) , intent(in) :: atm2lnd_inst type(energyflux_type) , intent(in) :: energyflux_inst type(saturated_excess_runoff_type) , intent(in) :: saturated_excess_runoff_inst - type(waterdiagnosticbulk_type) , intent(in) :: waterdiagnosticbulk_inst - type(wateratm2lndbulk_type) , intent(in) :: wateratm2lndbulk_inst + type(waterdiagnosticbulk_type) , intent(in) :: waterdiagnosticbulk_inst + type(wateratm2lndbulk_type) , intent(in) :: wateratm2lndbulk_inst + type(waterstatebulk_type) , intent(in) :: waterstatebulk_inst + type(soilstate_type) , intent(in) :: soilstate_inst + class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve type(cnveg_state_type) , intent(inout) :: cnveg_state_inst type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst real(r8) , intent(in) :: totlitc_col(bounds%begc:) @@ -206,7 +218,7 @@ subroutine CNFireFluxes_interface (this, bounds, num_soilc, filter_soilc, num_so !----------------------------------------------------------------------- end subroutine CNFireFluxes_interface - !----------------------------------------------------------------------- + !----------------------------------------------------------------------- end interface diff --git a/src/main/atm2lndMod.F90 b/src/main/atm2lndMod.F90 index fc26d7b341..cf81c2089a 100644 --- a/src/main/atm2lndMod.F90 +++ b/src/main/atm2lndMod.F90 @@ -128,10 +128,9 @@ subroutine downscale_forcings(bounds, & ! temporaries for topo downscaling real(r8) :: hsurf_g,hsurf_c real(r8) :: Hbot, zbot - real(r8) :: tbot_g, pbot_g, thbot_g, qbot_g, qs_g, es_g, rhos_g - real(r8) :: tbot_c, pbot_c, thbot_c, qbot_c, qs_c, es_c, rhos_c + real(r8) :: tbot_g, pbot_g, thbot_g, qbot_g, qs_g, rhos_g + real(r8) :: tbot_c, pbot_c, thbot_c, qbot_c, qs_c, rhos_c real(r8) :: rhos_c_estimate, rhos_g_estimate - real(r8) :: dum1, dum2 character(len=*), parameter :: subname = 'downscale_forcings' !----------------------------------------------------------------------- @@ -223,8 +222,8 @@ subroutine downscale_forcings(bounds, & thbot_c= thbot_g + (tbot_c - tbot_g)*exp((zbot/Hbot)*(rair/cpair)) ! pot temp calc - call Qsat(tbot_g,pbot_g,es_g,dum1,qs_g,dum2) - call Qsat(tbot_c,pbot_c,es_c,dum1,qs_c,dum2) + call Qsat(tbot_g,pbot_g,qs_g) + call Qsat(tbot_c,pbot_c,qs_c) qbot_c = qbot_g*(qs_c/qs_g) diff --git a/src/main/clm_driver.F90 b/src/main/clm_driver.F90 index 393eca365c..b65a260bc2 100644 --- a/src/main/clm_driver.F90 +++ b/src/main/clm_driver.F90 @@ -339,7 +339,7 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro call t_startf('dyn_subgrid') call dynSubgrid_driver(bounds_proc, & urbanparams_inst, soilstate_inst, water_inst, & - temperature_inst, energyflux_inst, & + temperature_inst, energyflux_inst, lakestate_inst, & canopystate_inst, photosyns_inst, crop_inst, glc2lnd_inst, bgc_vegetation_inst, & soilbiogeochem_state_inst, soilbiogeochem_carbonstate_inst, & c13_soilbiogeochem_carbonstate_inst, c14_soilbiogeochem_carbonstate_inst, & @@ -385,7 +385,7 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro call BeginWaterBalance(bounds_clump, & filter(nc)%num_nolakec, filter(nc)%nolakec, & filter(nc)%num_lakec, filter(nc)%lakec, & - water_inst, soilhydrology_inst, & + water_inst, soilhydrology_inst, lakestate_inst, & use_aquifer_layer = use_aquifer_layer()) call t_stopf('begwbal') @@ -608,6 +608,7 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro call BiogeophysPreFluxCalcs(bounds_clump, & filter(nc)%num_nolakec, filter(nc)%nolakec, & filter(nc)%num_nolakep, filter(nc)%nolakep, & + filter(nc)%num_urbanc, filter(nc)%urbanc, & clm_fates, & atm2lnd_inst, canopystate_inst, energyflux_inst, frictionvel_inst, & soilstate_inst, temperature_inst, & @@ -801,6 +802,7 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro call t_startf('soiltemperature') call SoilTemperature(bounds_clump, & filter(nc)%num_urbanl , filter(nc)%urbanl, & + filter(nc)%num_urbanc , filter(nc)%urbanc, & filter(nc)%num_nolakec , filter(nc)%nolakec, & atm2lnd_inst, urbanparams_inst, canopystate_inst, water_inst%waterstatebulk_inst, & water_inst%waterdiagnosticbulk_inst, water_inst%waterfluxbulk_inst, & @@ -972,7 +974,10 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro call bgc_vegetation_inst%EcosystemDynamicsPreDrainage(bounds_clump, & filter(nc)%num_soilc, filter(nc)%soilc, & filter(nc)%num_soilp, filter(nc)%soilp, & - filter(nc)%num_pcropp, filter(nc)%pcropp, doalb, & + filter(nc)%num_pcropp, filter(nc)%pcropp, & + filter(nc)%num_exposedvegp, filter(nc)%exposedvegp, & + filter(nc)%num_noexposedvegp, filter(nc)%noexposedvegp, & + doalb, & soilbiogeochem_carbonflux_inst, soilbiogeochem_carbonstate_inst, & c13_soilbiogeochem_carbonflux_inst, c13_soilbiogeochem_carbonstate_inst, & c14_soilbiogeochem_carbonflux_inst, c14_soilbiogeochem_carbonstate_inst, & @@ -981,7 +986,8 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro active_layer_inst, & atm2lnd_inst, water_inst%waterstatebulk_inst, & water_inst%waterdiagnosticbulk_inst, water_inst%waterfluxbulk_inst, & - water_inst%wateratm2lndbulk_inst, canopystate_inst, soilstate_inst, temperature_inst, crop_inst, ch4_inst, & + water_inst%wateratm2lndbulk_inst, canopystate_inst, soilstate_inst, temperature_inst, & + soil_water_retention_curve, crop_inst, ch4_inst, & photosyns_inst, saturated_excess_runoff_inst, energyflux_inst, & nutrient_competition_method, fireemis_inst) diff --git a/src/main/clm_initializeMod.F90 b/src/main/clm_initializeMod.F90 index d40c8a3aa8..fb54ee2ffc 100644 --- a/src/main/clm_initializeMod.F90 +++ b/src/main/clm_initializeMod.F90 @@ -14,7 +14,7 @@ module clm_initializeMod use clm_varctl , only : iulog use clm_varctl , only : use_lch4, use_cn, use_cndv, use_c13, use_c14, use_fates use clm_varctl , only : use_soil_moisture_streams - use clm_instur , only : wt_lunit, urban_valid, wt_nat_patch, wt_cft, fert_cft, irrig_method, wt_glc_mec, topo_glc_mec + use clm_instur , only : wt_lunit, urban_valid, wt_nat_patch, wt_cft, fert_cft, irrig_method, wt_glc_mec, topo_glc_mec, haslake use perf_mod , only : t_startf, t_stopf use readParamsMod , only : readParameters use ncdio_pio , only : file_desc_t @@ -26,6 +26,7 @@ module clm_initializeMod use filterMod , only : allocFilters, filter, filter_inactive_and_active use dynSubgridControlMod, only: dynSubgridControl_init, get_reset_dynbal_baselines use CLMFatesInterfaceMod, only : CLMFatesGlobals + use SelfTestDriver, only : self_test_driver use clm_instMod use SoilMoistureStreamMod, only : PrescribedSoilMoistureInit @@ -183,7 +184,7 @@ subroutine initialize1(dtime, gindex_ocn) allocate (irrig_method (begg:endg, cft_lb:cft_ub )) allocate (wt_glc_mec (begg:endg, maxpatch_glcmec)) allocate (topo_glc_mec(begg:endg, maxpatch_glcmec)) - + allocate (haslake (begg:endg )) ! Read list of Patches and their corresponding parameter values ! Independent of model resolution, Needs to stay before surfrd_get_data @@ -262,11 +263,14 @@ subroutine initialize1(dtime, gindex_ocn) call ch4conrd() end if + ! Run any requested self-tests + call self_test_driver(bounds_proc) + ! Deallocate surface grid dynamic memory for variables that aren't needed elsewhere. ! Some things are kept until the end of initialize2; urban_valid is kept through the ! end of the run for error checking. - deallocate (wt_lunit, wt_cft, wt_glc_mec) + deallocate (wt_lunit, wt_cft, wt_glc_mec, haslake) call t_stopf('clm_init1') @@ -279,6 +283,7 @@ subroutine initialize2( ) ! CLM initialization - second phase ! ! !USES: + use shr_orb_mod , only : shr_orb_decl use shr_scam_mod , only : shr_scam_getCloseLatLon use seq_drydep_mod , only : n_drydep, drydep_method, DD_XLND @@ -340,6 +345,8 @@ subroutine initialize2( ) logical :: lexist integer :: closelatidx,closelonidx real(r8) :: closelat,closelon + logical :: reset_dynbal_baselines_all_columns + logical :: reset_dynbal_baselines_lake_columns integer :: begp, endp integer :: begc, endc integer :: begl, endl @@ -447,9 +454,7 @@ subroutine initialize2( ) end if ! Initialize instances of all derived types as well as time constant variables - call clm_instInit(bounds_proc) - ! Initialize SNICAR optical and aging parameters call SnowOptics_init( ) ! SNICAR optical parameters: @@ -489,8 +494,14 @@ subroutine initialize2( ) call dyn_hwcontent_set_baselines(bounds_clump, & filter_inactive_and_active(nc)%num_icemecc, & filter_inactive_and_active(nc)%icemecc, & - urbanparams_inst, soilstate_inst, water_inst, temperature_inst) + filter_inactive_and_active(nc)%num_lakec, & + filter_inactive_and_active(nc)%lakec, & + urbanparams_inst, soilstate_inst, lakestate_inst, water_inst, temperature_inst, & + reset_all_baselines = .true., & + ! reset_lake_baselines is irrelevant since reset_all_baselines is true + reset_lake_baselines = .false.) end do + !$OMP END PARALLEL DO ! ------------------------------------------------------------------------ ! Initialize modules (after time-manager initialization in most cases) @@ -548,6 +559,7 @@ subroutine initialize2( ) is_cold_start = .false. is_interpolated_start = .false. + reset_dynbal_baselines_lake_columns = .false. if (nsrest == nsrStartup) then @@ -568,7 +580,8 @@ subroutine initialize2( ) write(iulog,*)'Reading initial conditions from ',trim(finidat) end if call getfil( finidat, fnamer, 0 ) - call restFile_read(bounds_proc, fnamer, glc_behavior) + call restFile_read(bounds_proc, fnamer, glc_behavior, & + reset_dynbal_baselines_lake_columns = reset_dynbal_baselines_lake_columns) end if else if ((nsrest == nsrContinue) .or. (nsrest == nsrBranch)) then @@ -576,8 +589,8 @@ subroutine initialize2( ) if (masterproc) then write(iulog,*)'Reading restart file ',trim(fnamer) end if - call restFile_read(bounds_proc, fnamer, glc_behavior) - + call restFile_read(bounds_proc, fnamer, glc_behavior, & + reset_dynbal_baselines_lake_columns = reset_dynbal_baselines_lake_columns) end if ! ------------------------------------------------------------------------ @@ -603,7 +616,8 @@ subroutine initialize2( ) glc_behavior=glc_behavior) ! Read new interpolated conditions file back in - call restFile_read(bounds_proc, finidat_interp_dest, glc_behavior) + call restFile_read(bounds_proc, finidat_interp_dest, glc_behavior, & + reset_dynbal_baselines_lake_columns = reset_dynbal_baselines_lake_columns) ! Reset finidat to now be finidat_interp_dest ! (to be compatible with routines still using finidat) @@ -618,31 +632,50 @@ subroutine initialize2( ) ! interpolated restart file, if applicable). ! ------------------------------------------------------------------------ - if (get_reset_dynbal_baselines()) then - if (nsrest == nsrStartup) then - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) 'Resetting dynbal baselines' - write(iulog,*) ' ' - end if - - !$OMP PARALLEL DO PRIVATE (nc, bounds_clump) - do nc = 1,nclumps - call get_clump_bounds(nc, bounds_clump) - - call dyn_hwcontent_set_baselines(bounds_clump, & - filter_inactive_and_active(nc)%num_icemecc, & - filter_inactive_and_active(nc)%icemecc, & - urbanparams_inst, soilstate_inst, water_inst, temperature_inst) - end do - else if (nsrest == nsrBranch) then + reset_dynbal_baselines_all_columns = get_reset_dynbal_baselines() + if (nsrest == nsrBranch) then + if (reset_dynbal_baselines_all_columns) then call endrun(msg='ERROR clm_initializeMod: '//& 'Cannot set reset_dynbal_baselines in a branch run') end if - ! nsrContinue not explicitly handled: it's okay for reset_dynbal_baselines to - ! remain set in a continue run, but it has no effect + else if (nsrest == nsrContinue) then + ! It's okay for the reset_dynbal_baselines flag to remain set in a continue + ! run, but we'll ignore it. (This way, the user doesn't have to change their + ! namelist file for the continue run.) + reset_dynbal_baselines_all_columns = .false. + end if + ! Note that we will still honor reset_dynbal_baselines_lake_columns even in a branch + ! or continue run: even in these runs, we want to reset those baselines if they are + ! wrong on the restart file. + + if (masterproc) then + if (reset_dynbal_baselines_all_columns) then + write(iulog,*) ' ' + write(iulog,*) 'Resetting dynbal baselines for all columns' + write(iulog,*) ' ' + else if (reset_dynbal_baselines_lake_columns) then + write(iulog,*) ' ' + write(iulog,*) 'Resetting dynbal baselines for lake columns' + write(iulog,*) ' ' + end if end if + !$OMP PARALLEL DO PRIVATE (nc, bounds_clump) + do nc = 1,nclumps + call get_clump_bounds(nc, bounds_clump) + + call dyn_hwcontent_set_baselines(bounds_clump, & + filter_inactive_and_active(nc)%num_icemecc, & + filter_inactive_and_active(nc)%icemecc, & + filter_inactive_and_active(nc)%num_lakec, & + filter_inactive_and_active(nc)%lakec, & + urbanparams_inst, soilstate_inst, lakestate_inst, & + water_inst, temperature_inst, & + reset_all_baselines = reset_dynbal_baselines_all_columns, & + reset_lake_baselines = reset_dynbal_baselines_lake_columns) + end do + !$OMP END PARALLEL DO + ! ------------------------------------------------------------------------ ! Initialize nitrogen deposition ! ------------------------------------------------------------------------ diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index ceb3b6ab01..a1f6d168fa 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -53,6 +53,9 @@ module clm_varctl !true => no valid land points -- do NOT run logical, public :: noland = .false. + ! true => run tests of ncdio_pio + logical, public :: for_testing_run_ncdiopio_tests = .false. + ! Hostname of machine running on character(len=256), public :: hostname = ' ' @@ -68,6 +71,9 @@ module clm_varctl ! dataset conventions character(len=256), public :: conventions = "CF-1.0" + ! component name for filenames (history or restart files) + character(len=8), public :: compname = 'clm2' + !---------------------------------------------------------- ! Unit Numbers !---------------------------------------------------------- @@ -344,6 +350,9 @@ module clm_varctl ! namelist: write CH4 extra diagnostic output logical, public :: hist_wrtch4diag = .false. + ! namelist: write history master list to a file for use in documentation + logical, public :: hist_master_list_file = .false. + !---------------------------------------------------------- ! FATES !---------------------------------------------------------- diff --git a/src/main/clm_varpar.F90 b/src/main/clm_varpar.F90 index 6d0e7b6bd6..7cadb20936 100644 --- a/src/main/clm_varpar.F90 +++ b/src/main/clm_varpar.F90 @@ -32,6 +32,7 @@ module clm_varpar integer, public :: nlevgrnd ! number of ground layers ! (includes lower layers that are hydrologically inactive) integer, public :: nlevurb ! number of urban layers + integer, public :: nlevmaxurbgrnd ! maximum of the number of ground and urban layers integer, public :: nlevlak ! number of lake layers integer, public :: nlevdecomp ! number of biogeochemically active soil layers integer, public :: nlevdecomp_full ! number of biogeochemical layers @@ -58,7 +59,6 @@ module clm_varpar integer, public :: maxveg ! # of pfts + cfts integer, public :: maxpatch_urb= 5 ! max number of urban patches (columns) in urban landunit - integer, public :: maxpatch_pft ! obsolete: max number of plant functional types in naturally vegetated landunit (namelist setting) integer, public :: maxsoil_patches ! # of pfts + cfts + bare ground; replaces maxpatch_pft, which is obsolete ! constants for decomposition cascade @@ -194,6 +194,7 @@ subroutine clm_varpar_init(actual_maxsoil_patches, actual_numcft) call shr_sys_abort(subname//' ERROR: Unrecognized pre-defined soil layer structure') end if endif + nlevmaxurbgrnd = max0(nlevurb,nlevgrnd) if ( masterproc ) write(iulog, *) 'nlevsoi, nlevgrnd varpar ', nlevsoi, nlevgrnd if (use_vichydro) then diff --git a/src/main/clm_varsur.F90 b/src/main/clm_varsur.F90 index cd3bacc87a..41740f1e2b 100644 --- a/src/main/clm_varsur.F90 +++ b/src/main/clm_varsur.F90 @@ -45,6 +45,9 @@ module clm_instur ! subgrid glacier_mec sfc elevation real(r8), pointer :: topo_glc_mec(:,:) + + ! whether we have lake to initialise in each grid cell + logical , pointer :: haslake(:) !----------------------------------------------------------------------- end module clm_instur diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index bbb14b5186..7a43319d90 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -19,7 +19,7 @@ module controlMod use spmdMod , only: MPI_CHARACTER, MPI_INTEGER, MPI_LOGICAL, MPI_REAL8 use decompMod , only: clump_pproc use clm_varcon , only: h2osno_max - use clm_varpar , only: maxpatch_pft, maxpatch_glcmec, numrad, nlevsno + use clm_varpar , only: maxpatch_glcmec, numrad, nlevsno use fileutils , only: getavu, relavu, get_filename use histFileMod , only: max_tapes, max_namlen use histFileMod , only: hist_empty_htapes, hist_dov2xy, hist_avgflag_pertape, hist_type1d_pertape @@ -139,10 +139,10 @@ subroutine control_init(dtime) ! CLM namelist settings - namelist /clm_inparm / & + namelist /clm_inparm/ & fatmlndfrc, finidat, nrevsn, & finidat_interp_dest, & - use_init_interp + use_init_interp, compname ! Input datasets @@ -164,7 +164,7 @@ subroutine control_init(dtime) hist_fexcl4, hist_fexcl5, hist_fexcl6, & hist_fexcl7, hist_fexcl8, & hist_fexcl9, hist_fexcl10 - namelist /clm_inparm/ hist_wrtch4diag + namelist /clm_inparm/ hist_wrtch4diag, hist_master_list_file ! BGC info @@ -202,7 +202,7 @@ subroutine control_init(dtime) albice, soil_layerstruct_predefined, soil_layerstruct_userdefined, & soil_layerstruct_userdefined_nlevsoi, use_subgrid_fluxes, snow_cover_fraction_method, & irrigate, run_zero_weight_urban, all_active, & - crop_fsat_equals_zero + crop_fsat_equals_zero, for_testing_run_ncdiopio_tests ! vertical soil mixing variables namelist /clm_inparm/ & @@ -252,10 +252,6 @@ subroutine control_init(dtime) ! All old cpp-ifdefs are below and have been converted to namelist variables - ! maxpatch_pft is obsolete and has been replaced with maxsoil_patches - ! maxpatch_pft will eventually be removed from the perl and the namelist - namelist /clm_inparm/ maxpatch_pft - ! Number of dominant pfts and landunits. Enhance ctsm performance by ! reducing the number of active pfts to n_dom_pfts and ! active landunits to n_dom_landunits. @@ -620,6 +616,7 @@ subroutine control_spmd() ! run control variables call mpi_bcast (caseid, len(caseid), MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (ctitle, len(ctitle), MPI_CHARACTER, 0, mpicom, ier) + call mpi_bcast (compname, len(compname), MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (version, len(version), MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (hostname, len(hostname), MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (username, len(username), MPI_CHARACTER, 0, mpicom, ier) @@ -661,6 +658,9 @@ subroutine control_spmd() ! Crop saturated excess runoff call mpi_bcast(crop_fsat_equals_zero, 1, MPI_LOGICAL, 0, mpicom, ier) + ! Whether to run tests of ncdio_pio + call mpi_bcast(for_testing_run_ncdiopio_tests, 1, MPI_LOGICAL, 0, mpicom, ier) + ! Landunit generation call mpi_bcast(create_crop_landunit, 1, MPI_LOGICAL, 0, mpicom, ier) @@ -668,16 +668,11 @@ subroutine control_spmd() call mpi_bcast(run_zero_weight_urban, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast(all_active, 1, MPI_LOGICAL, 0, mpicom, ier) - ! maxpatch_pft is obsolete and has been replaced with maxsoil_patches - ! maxpatch_pft will eventually be removed from the perl and the namelist - call mpi_bcast(maxpatch_pft, 1, MPI_LOGICAL, 0, mpicom, ier) - ! Number of dominant pfts and landunits. Enhance ctsm performance by ! reducing the number of active pfts to n_dom_pfts and ! active landunits to n_dom_landunits. ! Also choose to collapse the urban landunits to the dominant urban ! landunit by setting collapse_urban = .true. - ! slevis: maxpatch_pft is MPI_LOGICAL? Doesn't matter since obsolete. call mpi_bcast(n_dom_pfts, 1, MPI_INTEGER, 0, mpicom, ier) call mpi_bcast(n_dom_landunits, 1, MPI_INTEGER, 0, mpicom, ier) call mpi_bcast(collapse_urban, 1, MPI_LOGICAL, 0, mpicom, ier) @@ -810,11 +805,12 @@ subroutine control_spmd() call mpi_bcast (hist_nhtfrq, size(hist_nhtfrq), MPI_INTEGER, 0, mpicom, ier) call mpi_bcast (hist_mfilt, size(hist_mfilt), MPI_INTEGER, 0, mpicom, ier) call mpi_bcast (hist_ndens, size(hist_ndens), MPI_INTEGER, 0, mpicom, ier) - call mpi_bcast (hist_avgflag_pertape, size(hist_avgflag_pertape), MPI_CHARACTER, 0, mpicom, ier) + call mpi_bcast (hist_avgflag_pertape, len(hist_avgflag_pertape)*size(hist_avgflag_pertape), MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (hist_type1d_pertape, max_namlen*size(hist_type1d_pertape), MPI_CHARACTER, 0, mpicom, ier) if (use_lch4) then call mpi_bcast (hist_wrtch4diag, 1, MPI_LOGICAL, 0, mpicom, ier) end if + call mpi_bcast (hist_master_list_file, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (hist_fexcl1, max_namlen*size(hist_fexcl1), MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (hist_fexcl2, max_namlen*size(hist_fexcl2), MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (hist_fexcl3, max_namlen*size(hist_fexcl3), MPI_CHARACTER, 0, mpicom, ier) diff --git a/src/main/dtypes.h b/src/main/dtypes.h deleted file mode 100644 index aa1dc3bd0f..0000000000 --- a/src/main/dtypes.h +++ /dev/null @@ -1,6 +0,0 @@ -#define TYPETEXT 100 -#define TYPEREAL 101 -#define TYPEDOUBLE 102 -#define TYPEINT 103 -#define TYPELONG 104 -#define TYPELOGICAL 105 diff --git a/src/main/findHistFields.pl b/src/main/findHistFields.pl deleted file mode 100755 index 34bc7a7f9f..0000000000 --- a/src/main/findHistFields.pl +++ /dev/null @@ -1,546 +0,0 @@ -#!/usr/bin/env perl -# -# This perl script reads in the histFldsMod.F90 file to find the total list of history -# fields that can be added for this model version, regardless of namelist options, or -# CPP processing. -# -use strict; -#use warnings; -#use diagnostics; - -use Cwd; -use English; -use Getopt::Long; -use IO::File; -use File::Glob ':glob'; - -# Set the directory that contains the CLM configuration scripts. If the command was -# issued using a relative or absolute path, that path is in $ProgDir. Otherwise assume -# the -# command was issued from the current working directory. - -(my $ProgName = $0) =~ s!(.*)/!!; # name of this script -my $ProgDir = $1; # name of directory containing this script -- may be a - # relative or absolute path, or null if the script - # is in - # the user's PATH -my $cmdline = "@ARGV"; # Command line arguments to script -my $cwd = getcwd(); # current working directory -my $cfgdir; # absolute pathname of directory that contains this script -my $nm = "${ProgName}::"; # name to use if script dies -if ($ProgDir) { - $cfgdir = $ProgDir; -} else { - $cfgdir = $cwd; -} -# The namelist definition file contains entries for all namelist variables that -# can be output by build-namelist. -my $nl_definition_file = "$cfgdir/../../bld/namelist_files/namelist_definition_ctsm.xml"; -(-f "$nl_definition_file") or die <<"EOF"; -** $ProgName - Cannot find namelist definition file \"$nl_definition_file\" ** -EOF -print "Using namelist definition file $nl_definition_file\n"; - -# The Build::NamelistDefinition module provides utilities to get the list of -# megan compounds - -#The root directory to cesm utils Tools -my $cesm_tools = "$cfgdir/../../../../cime/utils/"; - -if ( ! -f "$cesm_tools/perl5lib/Build/NamelistDefinition.pm") { - $cesm_tools = "$cfgdir/../../cime/utils/"; - if ( ! -f "$cesm_tools/perl5lib/Build/NamelistDefinition.pm") { - die <<"EOF"; -** $ProgName - Cannot find perl module \"Build/NamelistDefinition.pm\" in directory - \"$cesm_tools/perl5lib\" ** -EOF - } -} -# Add $cfgdir/perl5lib to the list of paths that Perl searches for modules -my @dirs = ( $cfgdir, "$cesm_tools/perl5lib"); -unshift @INC, @dirs; -require Build::NamelistDefinition; -# Create a namelist definition object. This object provides a method for verifying that -# the -# output namelist variables are in the definition file, and are output in the correct -# namelist groups. -my $definition = Build::NamelistDefinition->new($nl_definition_file); - - -my $mxname = 0; -my $mxlongn = 0; -my %fields; -my $fldnamevar = "fieldname_var"; - -sub matchKeyword { -# -# Match a keyword -# - my $keyword = shift; - my $line = shift; - my $fh = shift; - - my $match = undef; - if ( $line =~ /$keyword/ ) { - if ( $line =~ /$keyword\s*=\s*['"]([^'"]+)(['"&])/ ) { - $match = $1; - if ( $2 eq "&" ) { - $line = <$fh>; - if ( $line =~ /&([^'"]+)['"]/ ) { - $match .= $1; - } - } - } elsif ( $line =~ /$keyword\s*=\s*&\s*$/ ) { - $line = <$fh>; - if ( $line =~ /^\s*['"]([^'"]+)['"]/ ) { - $match = $1; - } else { - die "ERROR: Trouble getting keyword string\n Line: $line"; - } - } else { - if ( $line =~ /fname\s*=\s*fieldname/ ) { - print STDERR "Found variable used for fieldname = $line\n"; - $match = $fldnamevar; - } elsif ( $line =~ /fname\s*=\s*trim\(fname\)/ ) { - $match = undef; - } elsif ( $line =~ /units\s*=\s*units/ ) { - $match = undef; - } elsif ( $line =~ /long_name\s*=\s*long_name/ ) { - $match = undef; - } elsif ( $line =~ /long_name\s*=\s*lname/ ) { - $match = undef; - } elsif ( $line =~ /long_name\s*=\s*longname/ ) { - print STDERR "Found variable used for longname = $line\n"; - $match = "longname_var"; - } else { - die "ERROR: Still have a match on $keyword\n Line: $line"; - } - } - } - return( $match ); -} - -sub getFieldInfo { -# -# Get field Information -# - my $fh = shift; - my $line = shift; - - my $fname = undef; - my $units = undef; - my $longn = undef; - my $endin = undef; - do { - if ( $line =~ /MEG_/ ) { - $line =~ s|'//'_'|_'|g; - $line =~ s|'//trim\(meg_cmp\%name\)|megancmpd'|gi; - if ( $line =~ /meg_cmp\%name/ ) { - die "ERROR: Still have meg_cmp in a line\n"; - } - } - if ( $line =~ /^(.+)this\%species\%hist_fname\(\s*['"]*([^'"]+)['"]\s*[,]*([^\)]*)\)(.*)/ ) { - my $suffix = ""; - my $beg = $1; - my $mid = $2; - my $suf = $3; - my $end = $4; - if ( $suf =~ /suffix\s*=\s*['"]([^'"]+)['"]/ ) { - $suffix=$1; - } - $line = "$beg 'ISO_${mid}ELEM_${suffix}' $end"; - } - $line -~ s|['"]\s*\/\/\s*this\%species\%get_species\(\)\s*\/\/\s*['"]|ELEM_|g; - if ( ! defined($fname) ) { - $fname = &matchKeyword( "fname", $line, $fh ); - } - if ( ! defined($units) ) { - $units = &matchKeyword( "units", $line, $fh ); - } - if ( ! defined($longn) ) { - $longn = &matchKeyword( "long_name", $line, $fh ); - } - if ( $line =~ /\)\s*$/ ) { - $endin = 1; - } - if ( ! defined($endin) ) { $line = <$fh>; } - - } until( (defined($fname) && defined($units) && defined($longn)) || - ! defined($line) || defined($endin) ); - if ( ! defined($fname) ) { - print "fname: $fname units: $units longn: $longn endin: $endin\n"; - die "ERROR: name undefined for field ending with: $line\n"; - } - return( $fname, $longn, $units ); -} - -sub setField { -# -# Set the field -# - my $name = shift; - my $longn = shift; - my $units = shift; - - if ( defined($name) && $name ne $fldnamevar ) { - if ( length($name) > $mxname ) { $mxname = length($name); } - if ( length($longn) > $mxlongn ) { $mxlongn = length($longn); } - my $len; - if ( length($longn) > 90 ) { - $len = 110; - } elsif ( length($longn) > 60 ) { - $len = 90; - } else { - $len = 60; - } - $fields{$name}{'field'} = sprintf( "%-${len}s\t(%s)", $longn, $units ); - $fields{$name}{'longn'} = $longn; - $fields{$name}{'units'} = $units; - } -} - -sub XML_Header { -# -# Write out header to history fields file -# - my $outfh = shift; - my $outfilename = shift; - - print STDERR " Write out header to history fields file to: $outfilename\n"; - my $svnurl = '$URL: https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_40/models/lnd/clm/src/main/findHistFields.pl $'; - my $svnid = '$Id: findHistFields.pl 34757 2012-02-15 18:38:05Z erik $'; - print $outfh <<"EOF"; - - -\<\?xml-stylesheet type="text\/xsl" href="history_fields.xsl"\?\> - -\<\!-- - List of history file field names, long-names and units for all the fields output - by CLM. - SVN version information: - $svnurl - $svnid ---\> - -\ -EOF -} - -sub XML_Footer { -# -# Write out footer to history fields file -# - my $outfh = shift; - - print STDERR " Write out footer to history fields file\n"; - print $outfh "\n\n"; -} - -my $pwd = `pwd`; -chomp( $pwd ); -my @megcmpds = $definition->get_valid_values( "megan_cmpds", 'noquotes'=>1 ); -my @filenames = glob( "$pwd/*.F90" ); -push( @filenames, glob( "$pwd/../biogeochem/*.F90" ) ); -push( @filenames, glob( "$pwd/../biogeophys/*.F90" ) ); -push( @filenames, glob( "$pwd/../soilbiogeochem/*.F90" ) ); -push( @filenames, glob( "$pwd/../biogeophys/*.F90" ) ); -push( @filenames, glob( "$pwd/../fates/main/*.F90" ) ); - -# -# Loop over all files that have hist_addfld calls in them -# -foreach my $filename ( @filenames ) { - - if ( $filename =~ /histFileMod.F90$/ ) { - next; - } - my $fh = IO::File->new($filename, '<') or die "** $ProgName - can't open history Fields file: $filename\n"; - print( "Filename: $filename\n" ); - # - # Read in the list of fields from the source file - # - while (my $line = <$fh>) { - - # Comments - if ($line =~ /(.*)\!/) { - $line = $1; - } - #if ($line =~ /end subroutine/) { - # last; - #} - my $format = "\n\n"; - if ($line =~ /call\s*hist_addfld/i ) { - (my $name, my $longn, my $units) = &getFieldInfo( $fh, $line ); - if ( $name ne "MEG_megancmpd" && $name =~ /ISO_/ ) { - &setField( $name, $longn, $units ); - printf( , $format, $name, $units, $longn ); - } elsif ( $name =~ /ISO_/ ) { - foreach my $iso ( "C12", "C13", "C14", "N" ) { - my $elem = substr( $iso, 0, 1 ); - $name =~ s/ISO_/$iso/g; - $name =~ s/ELEM_/$elem/g; - $longn =~ s/ISO_/$elem/g; - $longn =~ s/ELEM_/$elem/g; - $units =~ s/ISO_/$iso/g; - $units =~ s/ELEM_/$elem/g; - &setField( $name, $longn, $units ); - printf( , $format, $name, $units, $longn ); - } - } elsif ( $name eq "MEG_megancmpd" ) { - foreach my $megcmpd ( @megcmpds ) { - my $name = "MEG_${megcmpd}"; - &setField( $name, $longn, $units ); - printf( , $format, $name, $units, $longn ); - } - } - } - } - close( $fh ); -} -print STDERR " mxname = $mxname\n"; -print STDERR " mxlongn = $mxlongn\n"; -my %pool_name = ( - L1=> { hist=>'LITR1', long=>'litter 1' }, - L2=> { hist=>'LITR2', long=>'litter 2' }, - L3=> { hist=>'LITR3', long=>'litter 3' }, - CWD=>{ hist=>'CWD', long=>'coarse woody debris' }, - S1=> { hist=>'SOIL1', long=>'soil 1' }, - S2=> { hist=>'SOIL2', long=>'soil 2' }, - S3=> { hist=>'SOIL3', long=>'soil 3' }, - S4=> { hist=>'SOIL4', long=>'soil 4' }, - atm=>{ hist=>'atmosphere', long=>'atmosphere' }, - ); - -my %vrt_suffix = ( C=>" C", "C_vr"=>" C (vertically resolved)", C_1m=>" C to 1 meter", - C_30cm=>" C to 30 cm", C_activelayer=>" C in active layer", - N=>" C", "N_vr"=>" N (vertically resolved)", N_1m=>" N to 1 meter", - N_30cm=>" N to 30 cm", N_activelayer=>" N in active layer", - ); -my %firelist = ( - C_TO_FIRE=>" C fire loss", C_TO_FIRE_vr=>" C fire loss", - N_TO_FIRE=>" N fire loss", N_TO_FIRE_vr=>" N fire loss", - ); -my %leechlist = ( - C_TO_LEACHING=>" C leaching loss", C_TNDNCY_VERT_TRANSPORT=>" C tendency due to vertical transport", - N_TO_LEACHING=>" N leaching loss", N_TNDNCY_VERT_TRANSPORT=>" N tendency due to vertical transport", - ); -# -# Add fields that are looped over -# -my $name, my $longn, my $units; -foreach my $pool ( keys(%pool_name) ) { - my $fname = $pool_name{$pool}{'hist'}; - foreach my $fld ( keys(%vrt_suffix) ) { - $name = $fname . $fld; - $longn = $pool_name{$pool}{'hist'} . $vrt_suffix{$fld}; - $units; - if ( $fld eq "C_vr" ) { - $units = "gC/m^3"; - } elsif ( $fld eq "N_vr" ) { - $units = "gN/m^3"; - } elsif ( $fld =~ /^N/) { - $units = "gN/m^2"; - } else { - $units = "gC/m^2"; - } - &setField( $name, $longn, $units ); - if ( $fld eq "C" || $fld eq "C_vr" ) { - foreach my $ciso ( "C13", "C14" ) { - $name = $ciso."_".$fname . $fld; - $longn = $ciso." ".$pool_name{$pool}{'long'} . $vrt_suffix{$fld}; - if ( $fld eq "C_vr" ) { - $units = "g${ciso}m^3"; - } else { - $units = "g${ciso}/m^2"; - } - &setField( $name, $longn, $units ); - } - } - if ( $fld =~ "C_1m" || $fld eq "C_30m" || $fld eq "C_activelayer" ) { - foreach my $ciso ( "C14" ) { - $name = $ciso."_".$fname . $fld; - $longn = $ciso." ".$pool_name{$pool}{'long'} . $vrt_suffix{$fld}; - $units = "g${ciso}/m^2"; - &setField( $name, $longn, $units ); - } - } - } - # Fire list - if ( $fname =~ /^CWD/ || $fname =~ /^LIT/ ) { - foreach my $fld ( keys(%firelist) ) { - $name = "M_".$fname . $fld; - $longn = $firelist{$fname}; - $units; - if ( $fld =~ /_vr$/ ) { - $units = "gC/m^3"; - } else { - $units = "gC/m^2"; - } - &setField( $name, $longn, $units ); - # Carbon isotopes (C13/C14) - if ( $fld =~ /^C/ ) { - foreach my $ciso ( "C13", "C14" ) { - $name = "${ciso}_M_".$fname . $fld; - $longn = $ciso.$firelist{$fname}; - if ( $fld =~ /_vr$/ ) { - $units = "g${ciso}/m^3"; - } else { - $units = "g${ciso}/m^2"; - } - &setField( $name, $longn, $units ); - } - } - } - } - # Potential loss coefficient - $name = "K_".$fname; - $longn = $pool_name{$pool}{'long'} . " potential loss coefficient"; - $units = "1/s"; - &setField( $name, $longn, $units ); - # - # Not CWD - # - if ( $fname !~ /^CWD/ ) { - foreach my $fld ( keys(%leechlist) ) { - $name = "M_".$fname . $fld; - $longn = $leechlist{$fname}; - my $elm; - if ( $fld =~ /^N/ ) { - $elm = "N"; - } else { - $elm = "C"; - } - if ( $fld =~ /VERT$/ ) { - $units = "g${elm}/m^3"; - } else { - $units = "g${elm}/m^2"; - } - &setField( $name, $longn, $units ); - } - } -} -my %translist = ( - # CN transitions - L1S1 =>{d=>"L1", r=>"S1"}, L2S2 =>{d=>"L2", r=>"S2"}, - L3S3 =>{d=>"L3", r=>"S3"}, S1S2 =>{d=>"S1", r=>"S2"}, - S2S3 =>{d=>"S2", r=>"S3"}, S3S4 =>{d=>"S3", r=>"S4"}, - S4 =>{d=>"S4", r=>"atm"}, - CWDL2=>{d=>"CWD", r=>"L2"}, CWDL3=>{d=>"CWD", r=>"L3"}, - # CENTURY transitions NOT already given above - L2S1 =>{d=>"L2", r=>"S1"}, L3S2 =>{d=>"L3", r=>"S2"}, - S1S3 =>{d=>"S1", r=>"S3"}, S2S1 =>{d=>"S2", r=>"S1"}, - S3S1 =>{d=>"S3", r=>"S1"}, - ); -# -# Transition list (NOT complete) -# -my $unitsvr; -foreach my $trans ( keys(%translist) ) { - my $donor = $translist{$trans}{'d'}; - my $rcvr = $translist{$trans}{'r'}; - if ( $trans ne "${donor}${rcvr}" && ($rcvr ne "atm" || $trans ne $donor) ) { - die "ERROR: Either bad transition name: $trans or bad donor: $donor or receiver: -$rcvr\n"; - } - # Carbon isotopes - foreach my $ciso ( "", "C13", "C14" ) { - if ( $ciso eq "" ) { - $units = "gC/m^2/s"; - $unitsvr = "gC/m^3/s"; - } else { - $units = "g${ciso}/m^2/s"; - $unitsvr = "g${ciso}/m^3/s"; - } - if ( $donor ne "CWD" ) { - my $ii = 0; - foreach my $trans2 ( keys(%translist) ) { - if ($donor eq $translist{$trans}{'d'} ) { $ii = $ii + 1; } - } - # HR - if ( $ii == 1 ) { - $name = $pool_name{$donor}{'hist'}."_HR"; - } else { - $name = $pool_name{$donor}{'hist'}."_HR_$rcvr"; - } - if ( $ciso ne "" ) { - $name = "${ciso}$name"; - } - $longn = 'Het. Resp. from '.$pool_name{$donor}{'long'}; - # vertically integrated fluxes - &setField( $name, $longn, $units ); - # vertically resolved version - &setField( "${name}_vr", $longn, $unitsvr ); - } - if ( $rcvr ne "atm" ) { - # transfer - $name = $pool_name{$donor}{'hist'}. "C_TO_" . - $pool_name{$rcvr}{'hist'}. "C"; - $longn = "decomp of " . $pool_name{$donor}{'long'}. " C to " . - $pool_name{$rcvr}{'long'}. " C"; - if ( $ciso ne "" ) { - $name = "${ciso}$name"; - } - # vertically integrated fluxes - &setField( $name, $longn, $units ); - # vertically resolved version - &setField( "${name}_vr", $longn, $unitsvr ); - } - } - - #-- mineralization/immobilization fluxes (none from CWD) - if ( $donor ne "CWD" ) { - $units = "gN/m^2/s"; - $unitsvr = "gN/m^3/s"; - if ( $rcvr ne "atm" ) { - $name = "SMINN_TO_".$pool_name{$rcvr}{'hist'}. "N_$donor"; - } else { - $name = $pool_name{$donor}{'hist'}. "N_TO_SMINN"; - } - $longn = "mineral N flux for decomp. of " . $pool_name{$donor}{'hist'}; - # vertically integrated fluxes - &setField( $name, $longn, $units ); - # vertically resolved fluxes - &setField( "${name}_vr", $longn, $unitsvr ); - # transfer fluxes - if ( $rcvr ne "atm" ) { - $name = $pool_name{$donor}{'hist'}. "N_TO_" . - $pool_name{$rcvr}{'hist'}. "N"; - $longn = "decomp of " . $pool_name{$donor}{'long'}. " N to " . - $pool_name{$rcvr}{'long'}. " N"; - # vertically integrated fluxes - &setField( $name, $longn, $units ); - # vertically resolved fluxes - &setField( "${name}_vr", $longn, $unitsvr ); - } - # NITRIF_DENITRIF - $name = "SMINN_TO_DENIT_$trans"; - $longn = "denitrification for decomp. of " . $pool_name{$donor}{'long'} . - "to ". $pool_name{$rcvr}{'hist'}; - &setField( $name, $longn, "gN/m^2" ); - # vertically resolved fluxes - &setField( "${name}_vr", $longn, "gN/m^3" ); - } -} - -# -# List the fields in a neatly ordered list -# And Output to an XML file -# -my $outfilename = "$pwd/../../bld/namelist_files/history_fields_clm4_5.xml"; - -my $outfh = IO::File->new($outfilename, '>') or die "** $ProgName - can't open output history Fields XML file: $outfilename\n"; -&XML_Header( $outfh, $outfilename ); -foreach my $name ( sort(keys(%fields)) ) { - my $len; - if ( length($name) > 20 ) { - $len = 40; - } else { - $len = 20; - } - printf( "%-${len}s = %s\n", $name, $fields{$name}{'field'} ); - printf( $outfh "\n\n", - $name, $fields{$name}{'units'}, $fields{$name}{'longn'} ); -} - -&XML_Footer( $outfh ); -close( $outfh ); diff --git a/src/main/glc2lndMod.F90 b/src/main/glc2lndMod.F90 index 4bbb016109..b23e40c333 100644 --- a/src/main/glc2lndMod.F90 +++ b/src/main/glc2lndMod.F90 @@ -324,11 +324,11 @@ subroutine set_glc2lnd_fields_nuopc(this, bounds, glc_present, & character(len=*), parameter :: subname = 'set_glc2lnd_fields_nuopc' !----------------------------------------------------------------------- - SHR_ASSERT((ubound(frac_grc, 1) == bounds%endg), errMsg(sourcefile, __LINE__)) - SHR_ASSERT((ubound(topo_grc, 1) == bounds%endg), errMsg(sourcefile, __LINE__)) - SHR_ASSERT((ubound(hflx_grc, 1) == bounds%endg), errMsg(sourcefile, __LINE__)) - SHR_ASSERT((ubound(icemask_grc,1) == bounds%endg), errMsg(sourcefile, __LINE__)) - SHR_ASSERT((ubound(icemask_coupled_fluxes_grc,1) == bounds%endg), errMsg(sourcefile, __LINE__)) + SHR_ASSERT_FL((ubound(frac_grc, 1) == bounds%endg), sourcefile, __LINE__) + SHR_ASSERT_FL((ubound(topo_grc, 1) == bounds%endg), sourcefile, __LINE__) + SHR_ASSERT_FL((ubound(hflx_grc, 1) == bounds%endg), sourcefile, __LINE__) + SHR_ASSERT_FL((ubound(icemask_grc,1) == bounds%endg), sourcefile, __LINE__) + SHR_ASSERT_FL((ubound(icemask_coupled_fluxes_grc,1) == bounds%endg), sourcefile, __LINE__) if (glc_present) then do g = bounds%begg, bounds%endg diff --git a/src/main/histFileMod.F90 b/src/main/histFileMod.F90 index cba7425fab..5c43e1540d 100644 --- a/src/main/histFileMod.F90 +++ b/src/main/histFileMod.F90 @@ -12,7 +12,7 @@ module histFileMod use shr_sys_mod , only : shr_sys_flush use spmdMod , only : masterproc use abortutils , only : endrun - use clm_varctl , only : iulog, use_vertsoilc, use_fates + use clm_varctl , only : iulog, use_vertsoilc, use_fates, compname use clm_varcon , only : spval, ispval, dzsoi_decomp use clm_varcon , only : grlnd, nameg, namel, namec, namep, nameCohort use decompMod , only : get_proc_bounds, get_proc_global, bounds_type @@ -209,17 +209,34 @@ module histFileMod integer :: no_snow_behavior ! for multi-layer snow fields, flag saying how to treat times when a given snow layer is absent end type field_info - type master_entry - type (field_info) :: field ! field information - logical :: actflag(max_tapes) ! active/inactive flag - character(len=avgflag_strlen) :: avgflag(max_tapes) ! time averaging flag ("X","A","M","I","SUM") + type, abstract :: entry_base + type (field_info) :: field ! field information + contains + procedure(copy_entry_interface), deferred :: copy + end type entry_base + + abstract interface + subroutine copy_entry_interface(this, other) + ! set this = other + import :: entry_base + class(entry_base), intent(out) :: this + class(entry_base), intent(in) :: other + end subroutine copy_entry_interface + end interface + + type, extends(entry_base) :: master_entry + logical :: actflag(max_tapes) ! active/inactive flag + character(len=avgflag_strlen) :: avgflag(max_tapes) ! time averaging flag + contains + procedure :: copy => copy_master_entry end type master_entry - type history_entry - type (field_info) :: field ! field information - character(len=avgflag_strlen) :: avgflag ! time averaging flag + type, extends(entry_base) :: history_entry + character(len=avgflag_strlen) :: avgflag ! time averaging flag ("X","A","M","I","SUM") real(r8), pointer :: hbuf(:,:) ! history buffer (dimensions: dim1d x num2d) integer , pointer :: nacs(:,:) ! accumulation counter (dimensions: dim1d x num2d) + contains + procedure :: copy => copy_history_entry end type history_entry type history_tape @@ -301,10 +318,21 @@ subroutine hist_printflds() ! !DESCRIPTION: ! Print summary of master field list. ! + ! !USES: + use clm_varctl, only: hist_master_list_file + use fileutils, only: getavu, relavu + ! ! !ARGUMENTS: ! ! !LOCAL VARIABLES: - integer nf + integer, parameter :: ncol = 5 ! number of table columns + integer nf, i, j ! do-loop counters + integer master_list_file ! file unit number + integer width_col(ncol) ! widths of table columns + integer width_col_sum ! widths of columns summed, including spaces + character(len=3) str_width_col(ncol) ! string version of width_col + character(len=3) str_w_col_sum ! string version of width_col_sum + character(len=99) fmt_txt ! format statement character(len=*),parameter :: subname = 'CLM_hist_printflds' !----------------------------------------------------------------------- @@ -318,6 +346,98 @@ subroutine hist_printflds() call shr_sys_flush(iulog) end if + ! Print master field list in separate text file when namelist + ! variable requests it. Text file is formatted in the .rst + ! (reStructuredText) format for easy introduction of the file to + ! the CTSM's web-based documentation. + + ! First sort the list to be in alphabetical order + call sort_hist_list(1, nfmaster, masterlist) + + if (masterproc .and. hist_master_list_file) then + ! Hardwired table column widths to fit the table on a computer + ! screen. Some strings will be truncated as a result of the + ! current choices (4, 35, 94, 65, 7). In sphinx (ie the web-based + ! documentation), text that has not been truncated will wrap + ! around in the available space. + width_col(1) = 4 ! column that shows the variable number, nf + width_col(2) = 35 ! variable name column + width_col(3) = 94 ! long description column + width_col(4) = 65 ! units column + width_col(5) = 7 ! active (T or F) column + width_col_sum = sum(width_col) + ncol - 1 ! sum of widths & blank spaces + + ! Convert integer widths to strings for use in format statements + ! These write statements are not outputting to files + do i = 1, ncol + write(str_width_col(i),'(i0)') width_col(i) + end do + write(str_w_col_sum,'(i0)') width_col_sum + + ! Open master_list_file + master_list_file = getavu() ! get next available file unit number + open(unit = master_list_file, file = 'master_list_file.rst', & + status = 'new', action = 'write', form = 'formatted') + + ! File title + fmt_txt = '(a)' + write(master_list_file,fmt_txt) '===================' + write(master_list_file,fmt_txt) 'CTSM History Fields' + write(master_list_file,fmt_txt) '===================' + write(master_list_file,*) + + ! Table header + ! Concatenate strings needed in format statement + do i = 1, ncol + fmt_txt = '('//str_width_col(i)//'a,x)' + write(master_list_file,fmt_txt,advance='no') ('=', j=1,width_col(i)) + end do + write(master_list_file,*) ! next write statement will now appear in new line + + ! Table title + fmt_txt = '(a)' + write(master_list_file,fmt_txt) 'CTSM History Fields' + + ! Sub-header + ! Concatenate strings needed in format statement + fmt_txt = '('//str_w_col_sum//'a)' + write(master_list_file,fmt_txt) ('-', i=1, width_col_sum) + ! Concatenate strings needed in format statement + fmt_txt = '(a'//str_width_col(1)//',x,a'//str_width_col(2)//',x,a'//str_width_col(3)//',x,a'//str_width_col(4)//',x,a'//str_width_col(5)//')' + write(master_list_file,fmt_txt) '#', 'Variable Name', & + 'Long Description', 'Units', 'Active?' + + ! End header, same as header + ! Concatenate strings needed in format statement + do i = 1, ncol + fmt_txt = '('//str_width_col(i)//'a,x)' + write(master_list_file,fmt_txt,advance='no') ('=', j=1,width_col(i)) + end do + write(master_list_file,*) ! next write statement will now appear in new line + + ! Main table + ! Concatenate strings needed in format statement + fmt_txt = '(i'//str_width_col(1)//',x,a'//str_width_col(2)//',x,a'//str_width_col(3)//',x,a'//str_width_col(4)//',l'//str_width_col(5)//')' + do nf = 1,nfmaster + write(master_list_file,fmt_txt) nf, & + masterlist(nf)%field%name, & + masterlist(nf)%field%long_name, & + masterlist(nf)%field%units, & + masterlist(nf)%actflag(1) + end do + + ! Table footer, same as header + ! Concatenate strings needed in format statement + do i = 1, ncol + fmt_txt = '('//str_width_col(i)//'a,x)' + write(master_list_file,fmt_txt,advance='no') ('=', j=1,width_col(i)) + end do + + call shr_sys_flush(master_list_file) + close(unit = master_list_file) + call relavu(master_list_file) ! close and release file unit number + end if + end subroutine hist_printflds !----------------------------------------------------------------------- @@ -492,7 +612,7 @@ subroutine hist_htapes_build () !----------------------------------------------------------------------- if (masterproc) then - write(iulog,*) trim(subname),' Initializing clm2 history files' + write(iulog,*) trim(subname),' Initializing ', trim(compname), ' history files' write(iulog,'(72a1)') ("-",i=1,60) call shr_sys_flush(iulog) endif @@ -539,7 +659,7 @@ subroutine hist_htapes_build () end do if (masterproc) then - write(iulog,*) trim(subname),' Successfully initialized clm2 history files' + write(iulog,*) trim(subname),' Successfully initialized ', trim(compname), ' history files' write(iulog,'(72a1)') ("-",i=1,60) call shr_sys_flush(iulog) endif @@ -647,7 +767,6 @@ subroutine htapes_fieldlist() character(len=avgflag_strlen) :: avgflag ! averaging flag character(len=1) :: prec_acc ! history buffer precision flag character(len=1) :: prec_wrt ! history buffer write precision flag - type (history_entry) :: tmp ! temporary used for swapping character(len=*),parameter :: subname = 'htapes_fieldlist' !----------------------------------------------------------------------- @@ -761,25 +880,7 @@ subroutine htapes_fieldlist() ! Specification of tape contents now complete. ! Sort each list of active entries - - do f = tape(t)%nflds-1,1,-1 - do ff = 1,f - if (tape(t)%hlist(ff)%field%name > tape(t)%hlist(ff+1)%field%name) then - - tmp = tape(t)%hlist(ff) - tape(t)%hlist(ff ) = tape(t)%hlist(ff+1) - tape(t)%hlist(ff+1) = tmp - - else if (tape(t)%hlist(ff)%field%name == tape(t)%hlist(ff+1)%field%name) then - - write(iulog,*) trim(subname),' ERROR: Duplicate field ', & - tape(t)%hlist(ff)%field%name, & - 't,ff,name=',t,ff,tape(t)%hlist(ff+1)%field%name - call endrun(msg=errMsg(sourcefile, __LINE__)) - - end if - end do - end do + call sort_hist_list(t, tape(t)%nflds, tape(t)%hlist) if (masterproc) then if (tape(t)%nflds > 0) then @@ -857,6 +958,91 @@ subroutine htapes_fieldlist() end subroutine htapes_fieldlist + !----------------------------------------------------------------------- + subroutine copy_master_entry(this, other) + ! set this = other + class(master_entry), intent(out) :: this + class(entry_base), intent(in) :: other + + select type(this) + type is (master_entry) + select type(other) + type is (master_entry) + this = other + class default + call endrun('Unexpected type of "other" in copy_master_entry') + end select + class default + call endrun('Unexpected type of "this" in copy_master_entry') + end select + end subroutine copy_master_entry + + !----------------------------------------------------------------------- + subroutine copy_history_entry(this, other) + ! set this = other + class(history_entry), intent(out) :: this + class(entry_base), intent(in) :: other + + select type(this) + type is (history_entry) + select type(other) + type is (history_entry) + this = other + class default + call endrun('Unexpected type of "other" in copy_history_entry') + end select + class default + call endrun('Unexpected type of "this" in copy_history_entry') + end select + end subroutine copy_history_entry + + !----------------------------------------------------------------------- + subroutine sort_hist_list(t, n_fields, hist_list) + + ! !DESCRIPTION: + ! Sort list of history variable names hist_list in alphabetical + ! order. + + ! !ARGUMENTS: + integer, intent(in) :: t ! tape index + integer, intent(in) :: n_fields ! number of fields + class(entry_base), intent(inout) :: hist_list(:) + + ! !LOCAL VARIABLES: + integer :: f, ff ! field indices + class(entry_base), allocatable :: tmp + + character(len=*), parameter :: subname = 'sort_hist_list' + !----------------------------------------------------------------------- + + SHR_ASSERT_FL(size(hist_list) >= n_fields, sourcefile, __LINE__) + + if (n_fields < 2) then + return + end if + + allocate(tmp, source = hist_list(1)) + + do f = n_fields-1, 1, -1 + do ff = 1, f + if (hist_list(ff)%field%name > hist_list(ff+1)%field%name) then + + call tmp%copy(hist_list(ff)) + call hist_list(ff )%copy(hist_list(ff+1)) + call hist_list(ff+1)%copy(tmp) + + else if (hist_list(ff)%field%name == hist_list(ff+1)%field%name) then + + write(iulog,*) trim(subname),' ERROR: Duplicate field ', & + hist_list(ff)%field%name, & + 't,ff,name=',t,ff,hist_list(ff+1)%field%name + call endrun(msg=errMsg(sourcefile, __LINE__)) + end if + end do + end do + + end subroutine sort_hist_list + !----------------------------------------------------------------------- logical function is_mapping_upto_subgrid( type1d, type1d_out ) result ( mapping) ! @@ -1899,7 +2085,7 @@ subroutine htape_create (t, histrest) ! wrapper calls to define the history file contents. ! ! !USES: - use clm_varpar , only : nlevgrnd, nlevsno, nlevlak, nlevurb, numrad, nlevcan, nvegwcs,nlevsoi + use clm_varpar , only : nlevgrnd, nlevsno, nlevlak, nlevurb, nlevmaxurbgrnd, numrad, nlevcan, nvegwcs,nlevsoi use clm_varpar , only : natpft_size, cft_size, maxpatch_glcmec, nlevdecomp_full use landunit_varcon , only : max_lunit use clm_varctl , only : caseid, ctitle, fsurdat, finidat, paramfile @@ -1928,7 +2114,6 @@ subroutine htape_create (t, histrest) integer :: numl ! total number of landunits across all processors integer :: numg ! total number of gridcells across all processors integer :: numa ! total number of atm cells across all processors - logical :: avoid_pnetcdf ! whether we should avoid using pnetcdf logical :: lhistrest ! local history restart flag type(file_desc_t), pointer :: lnfid ! local file id character(len= 8) :: curdate ! current date @@ -1958,17 +2143,6 @@ subroutine htape_create (t, histrest) lnfid => nfid(t) endif - ! BUG(wjs, 2014-10-20, bugz 1730) Workaround for - ! http://bugs.cgd.ucar.edu/show_bug.cgi?id=1730 - ! - 1-d hist files have problems with pnetcdf. A better workaround in terms of - ! performance is to keep pnetcdf, but set PIO_BUFFER_SIZE_LIMIT=0, but that can't be - ! done on a per-file basis. - if (.not. tape(t)%dov2xy) then - avoid_pnetcdf = .true. - else - avoid_pnetcdf = .false. - end if - ! Create new netCDF file. It will be in define mode if ( .not. lhistrest )then @@ -1977,7 +2151,7 @@ subroutine htape_create (t, histrest) trim(locfnh(t)) call shr_sys_flush(iulog) end if - call ncd_pio_createfile(lnfid, trim(locfnh(t)), avoid_pnetcdf=avoid_pnetcdf) + call ncd_pio_createfile(lnfid, trim(locfnh(t))) call ncd_putatt(lnfid, ncd_global, 'title', 'CLM History file information' ) call ncd_putatt(lnfid, ncd_global, 'comment', & "NOTE: None of the variables are weighted by land fraction!" ) @@ -1987,7 +2161,7 @@ subroutine htape_create (t, histrest) trim(locfnhr(t)) call shr_sys_flush(iulog) end if - call ncd_pio_createfile(lnfid, trim(locfnhr(t)), avoid_pnetcdf=avoid_pnetcdf) + call ncd_pio_createfile(lnfid, trim(locfnhr(t))) call ncd_putatt(lnfid, ncd_global, 'title', & 'CLM Restart History information, required to continue a simulation' ) call ncd_putatt(lnfid, ncd_global, 'comment', & @@ -2046,6 +2220,7 @@ subroutine htape_create (t, histrest) if (nlevurb > 0) then call ncd_defdim(lnfid, 'levurb' , nlevurb, dimid) end if + call ncd_defdim(lnfid, 'levmaxurbgrnd' , nlevmaxurbgrnd, dimid) call ncd_defdim(lnfid, 'levlak' , nlevlak, dimid) call ncd_defdim(lnfid, 'numrad' , numrad , dimid) call ncd_defdim(lnfid, 'levsno' , nlevsno , dimid) @@ -2235,7 +2410,7 @@ subroutine htape_timeconst3D(t, & ! ! !USES: use subgridAveMod , only : c2g - use clm_varpar , only : nlevgrnd ,nlevlak + use clm_varpar , only : nlevgrnd ,nlevlak, nlevmaxurbgrnd use shr_string_mod , only : shr_string_listAppend use domainMod , only : ldomain ! @@ -2277,7 +2452,7 @@ subroutine htape_timeconst3D(t, & /) !----------------------------------------------------------------------- - SHR_ASSERT_ALL_FL((ubound(watsat_col) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(watsat_col) == (/bounds%endc, nlevmaxurbgrnd/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(sucsat_col) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(bsw_col) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(hksat_col) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) @@ -2502,6 +2677,7 @@ subroutine htape_timeconst(t, mode) ! contents. ! ! !USES: + use clm_varpar , only : nlevsoi use clm_varcon , only : zsoi, zlak, secspday, isecspday, isecsphr, isecspmin use domainMod , only : ldomain, lon1d, lat1d use clm_time_manager, only : get_nstep, get_curr_date, get_curr_time @@ -2586,12 +2762,15 @@ subroutine htape_timeconst(t, mode) if (mode == 'define') then call ncd_defvar(varname='levgrnd', xtype=tape(t)%ncprec, & dim1name='levgrnd', & - long_name='coordinate soil levels', units='m', ncid=nfid(t)) + long_name='coordinate ground levels', units='m', ncid=nfid(t)) + call ncd_defvar(varname='levsoi', xtype=tape(t)%ncprec, & + dim1name='levsoi', & + long_name='coordinate soil levels (equivalent to top nlevsoi levels of levgrnd)', units='m', ncid=nfid(t)) call ncd_defvar(varname='levlak', xtype=tape(t)%ncprec, & dim1name='levlak', & long_name='coordinate lake levels', units='m', ncid=nfid(t)) call ncd_defvar(varname='levdcmp', xtype=tape(t)%ncprec, dim1name='levdcmp', & - long_name='coordinate soil levels', units='m', ncid=nfid(t)) + long_name='coordinate levels for soil decomposition variables', units='m', ncid=nfid(t)) if(use_fates)then @@ -2656,6 +2835,7 @@ subroutine htape_timeconst(t, mode) elseif (mode == 'write') then if ( masterproc ) write(iulog, *) ' zsoi:',zsoi call ncd_io(varname='levgrnd', data=zsoi, ncid=nfid(t), flag='write') + call ncd_io(varname='levsoi', data=zsoi(1:nlevsoi), ncid=nfid(t), flag='write') call ncd_io(varname='levlak' , data=zlak, ncid=nfid(t), flag='write') if (use_vertsoilc) then call ncd_io(varname='levdcmp', data=zsoi, ncid=nfid(t), flag='write') @@ -3409,7 +3589,7 @@ subroutine hist_htapes_wrapup( rstwr, nlend, bounds, & use clm_time_manager, only : get_nstep, get_curr_date, get_curr_time, get_prev_date use clm_varcon , only : secspday use perf_mod , only : t_startf, t_stopf - use clm_varpar , only : nlevgrnd + use clm_varpar , only : nlevgrnd, nlevmaxurbgrnd ! ! !ARGUMENTS: logical, intent(in) :: rstwr ! true => write restart file this step @@ -3442,7 +3622,7 @@ subroutine hist_htapes_wrapup( rstwr, nlend, bounds, & character(len=*),parameter :: subname = 'hist_htapes_wrapup' !----------------------------------------------------------------------- - SHR_ASSERT_ALL_FL((ubound(watsat_col) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(watsat_col) == (/bounds%endc, nlevmaxurbgrnd/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(sucsat_col) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(bsw_col) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(hksat_col) == (/bounds%endc, nlevgrnd/)), sourcefile, __LINE__) @@ -3779,7 +3959,7 @@ subroutine hist_restart_ncd (bounds, ncid, flag, rdate) ! Create the restart history filename and open it write(hnum,'(i1.1)') t-1 - locfnhr(t) = "./" // trim(caseid) //".clm2"// trim(inst_suffix) & + locfnhr(t) = "./" // trim(caseid) //"."// trim(compname) // trim(inst_suffix) & // ".rh" // hnum //"."// trim(rdate) //".nc" call htape_create( t, histrest=.true. ) @@ -4576,7 +4756,7 @@ character(len=max_length_filename) function set_hist_filename (hist_freq, hist_m write(cdate,'(i4.4,"-",i2.2,"-",i2.2,"-",i5.5)') yr,mon,day,sec endif write(hist_index,'(i1.1)') hist_file - 1 - set_hist_filename = "./"//trim(caseid)//".clm2"//trim(inst_suffix)//& + set_hist_filename = "./"//trim(caseid)//"."//trim(compname)//trim(inst_suffix)//& ".h"//hist_index//"."//trim(cdate)//".nc" ! check to see if the concatenated filename exceeded the diff --git a/src/main/initVerticalMod.F90 b/src/main/initVerticalMod.F90 index 634d10e4f2..58bf29afce 100644 --- a/src/main/initVerticalMod.F90 +++ b/src/main/initVerticalMod.F90 @@ -14,7 +14,7 @@ module initVerticalMod use spmdMod , only : masterproc use clm_varpar , only : nlevsno, nlevgrnd, nlevlak use clm_varpar , only : toplev_equalspace, nlev_equalspace - use clm_varpar , only : nlevsoi, nlevsoifl, nlevurb + use clm_varpar , only : nlevsoi, nlevsoifl, nlevurb, nlevmaxurbgrnd use clm_varctl , only : fsurdat, iulog use clm_varctl , only : use_vancouver, use_mexicocity, use_vertsoilc, use_extralakelayers use clm_varctl , only : use_bedrock, rundef @@ -429,11 +429,21 @@ subroutine initVertical(bounds, glc_behavior, snow_depth, thick_wall, thick_roof col%z(c,1:nlevgrnd) = zsoi(1:nlevgrnd) col%zi(c,0:nlevgrnd) = zisoi(0:nlevgrnd) col%dz(c,1:nlevgrnd) = dzsoi(1:nlevgrnd) + if (nlevgrnd < nlevurb) then + col%z(c,nlevgrnd+1:nlevurb) = spval + col%zi(c,nlevgrnd+1:nlevurb) = spval + col%dz(c,nlevgrnd+1:nlevurb) = spval + end if end if else if (lun%itype(l) /= istdlak) then col%z(c,1:nlevgrnd) = zsoi(1:nlevgrnd) col%zi(c,0:nlevgrnd) = zisoi(0:nlevgrnd) col%dz(c,1:nlevgrnd) = dzsoi(1:nlevgrnd) + if (nlevgrnd < nlevurb) then + col%z(c,nlevgrnd+1:nlevurb) = spval + col%zi(c,nlevgrnd+1:nlevurb) = spval + col%dz(c,nlevgrnd+1:nlevurb) = spval + end if end if end do @@ -602,6 +612,11 @@ subroutine initVertical(bounds, glc_behavior, snow_depth, thick_wall, thick_roof col%z(c,1:nlevgrnd) = zsoi(1:nlevgrnd) col%zi(c,0:nlevgrnd) = zisoi(0:nlevgrnd) col%dz(c,1:nlevgrnd) = dzsoi(1:nlevgrnd) + if (nlevgrnd < nlevurb) then + col%z(c,nlevgrnd+1:nlevurb) = spval + col%zi(c,nlevgrnd+1:nlevurb) = spval + col%dz(c,nlevgrnd+1:nlevurb) = spval + end if end if end do @@ -622,13 +637,13 @@ subroutine initVertical(bounds, glc_behavior, snow_depth, thick_wall, thick_roof if (col%nbedrock(c) < nlevsoi) then col%levgrnd_class(c, (col%nbedrock(c) + 1) : nlevsoi) = LEVGRND_CLASS_SHALLOW_BEDROCK end if - col%levgrnd_class(c, (nlevsoi + 1) : nlevgrnd) = LEVGRND_CLASS_DEEP_BEDROCK + col%levgrnd_class(c, (nlevsoi + 1) : nlevmaxurbgrnd) = LEVGRND_CLASS_DEEP_BEDROCK else - col%levgrnd_class(c, 1:nlevgrnd) = LEVGRND_CLASS_STANDARD + col%levgrnd_class(c, 1:nlevmaxurbgrnd) = LEVGRND_CLASS_STANDARD end if end do - do j = 1, nlevgrnd + do j = 1, nlevmaxurbgrnd do c = bounds%begc, bounds%endc if (col%z(c,j) == spval) then col%levgrnd_class(c,j) = ispval diff --git a/src/main/lnd2atmMod.F90 b/src/main/lnd2atmMod.F90 index 9a18428264..7aed89f3fa 100644 --- a/src/main/lnd2atmMod.F90 +++ b/src/main/lnd2atmMod.F90 @@ -10,7 +10,7 @@ module lnd2atmMod use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) use shr_megan_mod , only : shr_megan_mechcomps_n use shr_fire_emis_mod , only : shr_fire_emis_mechcomps_n - use clm_varpar , only : numrad, ndst, nlevgrnd !ndst = number of dust bins. + use clm_varpar , only : numrad, ndst, nlevgrnd, nlevmaxurbgrnd !ndst = number of dust bins. use clm_varcon , only : rair, grav, cpair, hfus, tfrz, spval use clm_varctl , only : iulog, use_lch4 use seq_drydep_mod , only : n_drydep, drydep_method, DD_XLND @@ -119,7 +119,7 @@ subroutine lnd2atm_minimal(bounds, & end associate end do - call c2g(bounds, nlevgrnd, & + call c2g(bounds, nlevmaxurbgrnd, & water_inst%waterstatebulk_inst%h2osoi_vol_col (bounds%begc:bounds%endc, :), & water_inst%waterlnd2atmbulk_inst%h2osoi_vol_grc (bounds%begg:bounds%endg, :), & c2l_scale_type= 'urbanf', l2g_scale_type='unity') diff --git a/src/main/ncdio_pio.F90.in b/src/main/ncdio_pio.F90.in index 5f0fbb6ea1..4b7b75c82e 100644 --- a/src/main/ncdio_pio.F90.in +++ b/src/main/ncdio_pio.F90.in @@ -33,7 +33,8 @@ module ncdio_pio use pio , only : pio_put_att, pio_put_var, pio_read_darray, pio_real, pio_seterrorhandling use pio , only : pio_setframe, pio_unlimited, pio_write, pio_write_darray, var_desc_t use pio , only : pio_iotask_rank, PIO_REARR_SUBSET, PIO_REARR_BOX - use pio , only : pio_inq_vartype + use pio , only : pio_inq_vartype, pio_real + use array_utils , only : convert_to_logical ! ! !PUBLIC TYPES: implicit none @@ -43,8 +44,10 @@ module ncdio_pio ! !PUBLIC MEMBER FUNCTIONS: ! public :: check_var ! determine if variable is on netcdf file + public :: check_dim ! determine if dimension is on netcdf file + public :: check_var_or_dim ! determine if variable or dimension is on netcdf file public :: check_att ! check if attribute is on file - public :: check_dim ! validity check on dimension + public :: check_dim_size ! validity check on dimension public :: ncd_pio_openfile ! open a file public :: ncd_pio_createfile ! create a new file public :: ncd_pio_closefile ! close a file @@ -63,6 +66,7 @@ module ncdio_pio public :: ncd_defvar ! define variables public :: ncd_inqvid ! inquire variable id public :: ncd_inqvname ! inquire variable name + public :: ncd_inqvtype ! inquire variable type public :: ncd_inqvdims ! inquire variable ndims public :: ncd_inqvdids ! inquire variable dimids public :: ncd_inqvdlen ! inquire variable dimension size @@ -138,6 +142,12 @@ module ncdio_pio module procedure ncd_inqvdname_byName end interface + interface read_darray_dispatcher + !TYPE int,double,logical + !DIMS 1,2,3 + module procedure read_darray_{TYPE}_dispatcher_{DIMS} + end interface read_darray_dispatcher + private :: ncd_getiodesc ! obtain iodesc private :: scam_field_offsets ! get offset to proper lat/lon gridcell for SCAM @@ -224,7 +234,7 @@ contains end subroutine ncd_pio_closefile !----------------------------------------------------------------------- - subroutine ncd_pio_createfile(file, fname, avoid_pnetcdf) + subroutine ncd_pio_createfile(file, fname) ! ! !DESCRIPTION: ! Create a new NetCDF file with PIO @@ -236,34 +246,12 @@ contains class(file_desc_t), intent(inout) :: file ! PIO file descriptor character(len=*) , intent(in) :: fname ! File name to create - ! BUG(wjs, 2014-10-20, bugz 1730) Workaround for - ! http://bugs.cgd.ucar.edu/show_bug.cgi?id=1730 - logical, intent(in), optional :: avoid_pnetcdf ! ! !LOCAL VARIABLES: - logical :: l_avoid_pnetcdf ! local version of avoid_pnetcdf - integer :: my_io_type integer :: ierr !----------------------------------------------------------------------- - l_avoid_pnetcdf = .false. - if (present(avoid_pnetcdf)) then - l_avoid_pnetcdf = avoid_pnetcdf - end if - - my_io_type = io_type - if (l_avoid_pnetcdf) then - if (my_io_type == pio_iotype_pnetcdf) then - my_io_type = pio_iotype_netcdf - if(pio_iotask_rank(pio_subsystem)==0 .and. masterproc) then - write(iulog,*) 'Workaround for bugz 1730: creating' - write(iulog,*) trim(fname) - write(iulog,*) 'with type netcdf instead of pnetcdf' - end if - end if - end if - - ierr = pio_createfile(pio_subsystem, file, my_io_type, fname, ior(PIO_CLOBBER,io_netcdf_format)) + ierr = pio_createfile(pio_subsystem, file, io_type, fname, ior(PIO_CLOBBER,io_netcdf_format)) if(ierr/= PIO_NOERR) then call shr_sys_abort( ' ncd_pio_createfile ERROR: Failed to open file to write: '//trim(fname)) @@ -274,21 +262,22 @@ contains end subroutine ncd_pio_createfile !----------------------------------------------------------------------- - subroutine check_var(ncid, varname, vardesc, readvar, print_err ) + subroutine check_var(ncid, varname, readvar, vardesc, print_err ) ! ! !DESCRIPTION: ! Check if variable is on netcdf file ! ! !ARGUMENTS: - class(file_desc_t) , intent(inout) :: ncid ! PIO file descriptor - character(len=*) , intent(in) :: varname ! Varible name to check - type(Var_desc_t) , intent(out) :: vardesc ! Output variable descriptor - logical , intent(out) :: readvar ! If variable exists or not - logical, optional , intent(in) :: print_err ! If should print about error + class(file_desc_t) , intent(inout) :: ncid ! PIO file descriptor + character(len=*) , intent(in) :: varname ! Varible name to check + logical , intent(out) :: readvar ! If variable exists or not + type(Var_desc_t) , optional, intent(out) :: vardesc ! Output variable descriptor (if desired) + logical , optional, intent(in) :: print_err ! If should print about error ! ! !LOCAL VARIABLES: integer :: ret ! return value logical :: log_err ! if should log error + type(Var_desc_t) :: vardesc_local character(len=*),parameter :: subname='check_var' ! subroutine name !----------------------------------------------------------------------- @@ -300,7 +289,10 @@ contains end if readvar = .true. call pio_seterrorhandling(ncid, PIO_BCAST_ERROR) - ret = PIO_inq_varid (ncid, varname, vardesc) + ret = PIO_inq_varid (ncid, varname, vardesc_local) + if (present(vardesc)) then + vardesc = vardesc_local + end if if (ret /= PIO_noerr) then readvar = .false. if (masterproc .and. log_err) & @@ -310,6 +302,52 @@ contains end subroutine check_var + !----------------------------------------------------------------------- + subroutine check_dim(ncid, dimname, dimexist) + ! + ! !DESCRIPTION: + ! Check if dimension is on netcdf file + ! + ! !ARGUMENTS: + class(file_desc_t) , intent(inout) :: ncid ! PIO file descriptor + character(len=*) , intent(in) :: dimname ! dimension name + logical , intent(out) :: dimexist ! if this dimension exists or not + ! + ! !LOCAL VARIABLES: + integer :: dimid + + character(len=*), parameter :: subname = 'check_dim' + !----------------------------------------------------------------------- + + call ncd_inqdid(ncid, dimname, dimid, dimexist) + + end subroutine check_dim + + !----------------------------------------------------------------------- + subroutine check_var_or_dim(ncid, name, is_dim, exists) + ! + ! !DESCRIPTION: + ! Check if variable or dimension is on netcdf file + ! + ! !ARGUMENTS: + class(file_desc_t) , intent(inout) :: ncid ! PIO file descriptor + character(len=*) , intent(in) :: name ! variable or dimension name to check + logical , intent(in) :: is_dim ! if true, check for dimension; if false, check for variable + logical , intent(out) :: exists ! whether the given variable or dimension exists on file + ! + ! !LOCAL VARIABLES: + + character(len=*), parameter :: subname = 'check_var_or_dim' + !----------------------------------------------------------------------- + + if (is_dim) then + call check_dim(ncid, name, exists) + else + call check_var(ncid, name, exists, print_err=.false.) + end if + + end subroutine check_var_or_dim + !----------------------------------------------------------------------- subroutine check_att(ncid, varid, attrib, att_found) ! @@ -343,7 +381,7 @@ contains end subroutine check_att !----------------------------------------------------------------------- - subroutine check_dim(ncid, dimname, value, msg) + subroutine check_dim_size(ncid, dimname, value, msg) ! ! !DESCRIPTION: ! Validity check on dimension @@ -358,7 +396,7 @@ contains ! !LOCAL VARIABLES: integer :: dimid, dimlen ! temporaries integer :: status ! error code - character(len=*),parameter :: subname='check_dim' ! subroutine name + character(len=*),parameter :: subname='check_dim_size' ! subroutine name !----------------------------------------------------------------------- status = pio_inq_dimid (ncid, trim(dimname), dimid) @@ -372,7 +410,7 @@ contains call shr_sys_abort(errMsg(sourcefile, __LINE__)) end if - end subroutine check_dim + end subroutine check_dim_size !----------------------------------------------------------------------- subroutine ncd_redef(ncid) @@ -590,6 +628,28 @@ contains end subroutine ncd_inqvid + !----------------------------------------------------------------------- + subroutine ncd_inqvtype(ncid, vardesc, vartype) + ! + ! !DESCRIPTION: + ! Inquire variable type + ! + ! !ARGUMENTS: + class(file_desc_t) , intent(in) :: ncid ! netcdf file id + type(var_desc_t) , intent(in) :: vardesc ! variable descriptor + integer , intent(out) :: vartype ! type of var in file (ncd_int, ncd_float, ncd_double, etc.) + ! + ! !LOCAL VARIABLES: + integer :: status + + character(len=*), parameter :: subname = 'ncd_inqvtype' + !----------------------------------------------------------------------- + + vartype = -9999 + status = pio_inq_vartype(ncid, vardesc, vartype) + + end subroutine ncd_inqvtype + !----------------------------------------------------------------------- subroutine ncd_inqvdims(ncid,ndims,vardesc) ! @@ -727,7 +787,7 @@ contains integer, parameter :: error_variable_not_found = 11 !----------------------------------------------------------------------- - call check_var(ncid, varname, vardesc, readvar) + call check_var(ncid, varname, readvar, vardesc=vardesc) if (readvar) then call ncd_inqvdlen_byDesc(ncid, vardesc, dimnum, dlen, err_code) else @@ -816,7 +876,7 @@ contains character(len=*), parameter :: subname = 'ncd_inqvdname_byName' !----------------------------------------------------------------------- - call check_var(ncid, varname, vardesc, readvar) + call check_var(ncid, varname, readvar, vardesc=vardesc) if (readvar) then call ncd_inqvdname_byDesc(ncid, vardesc, dimnum, dname, err_code) else @@ -1321,7 +1381,8 @@ contains call scam_field_offsets(ncid,'undefined', vardesc,& start, count, found=found, posNOTonfile=posNOTonfile) if ( found )then - status = pio_get_var(ncid, varid, start, count, idata1d) + status = pio_inq_varndims(ncid, vardesc, ndims) + status = pio_get_var(ncid, varid, start(1:ndims), count(1:ndims), idata1d) else status = pio_get_var(ncid, varid, idata1d) end if @@ -1437,7 +1498,8 @@ contains call scam_field_offsets(ncid,'undefined', vardesc,& start, count, found=found, posNOTonfile=posNOTonfile) if ( found )then - status = pio_get_var(ncid, varid, start, count, data) + status = pio_inq_varndims(ncid, vardesc, ndims) + status = pio_get_var(ncid, varid, start(1:ndims), count(1:ndims), data) else status = pio_get_var(ncid, varid, data) end if @@ -1614,6 +1676,7 @@ contains integer , pointer :: idata(:) ! Temporary integer data to send to file type(iodesc_plus_type) , pointer :: iodesc_plus type(var_desc_t) :: vardesc + integer :: oldhandle ! previous value of pio_error_handle character(len=*),parameter :: subname='ncd_io_1d_{TYPE}' ! subroutine name !----------------------------------------------------------------------- @@ -1639,7 +1702,6 @@ contains call ncd_inqvid(ncid, varname, varid, vardesc, readvar=varpresent) if (varpresent) then - call pio_seterrorhandling(ncid, PIO_BCAST_ERROR) if (single_column) then start(:) = 1 ; count(:) = 1 call scam_field_offsets(ncid,clmlevel,vardesc,start,count) @@ -1656,6 +1718,7 @@ contains start(2) = nt ; count(2) = 1 end if end if + call pio_seterrorhandling(ncid, PIO_BCAST_ERROR, oldhandle) #if ({ITYPE}==TYPELOGICAL) allocate(idata(size(data))) status = pio_get_var(ncid, varid, start(1:n), count(1:n), idata) @@ -1671,6 +1734,8 @@ contains call shr_sys_abort(' ERROR: reading in variable: '// trim(varname) & // errMsg(sourcefile, __LINE__)) end if + call pio_seterrorhandling(ncid, oldhandle) + else status = pio_inq_varndims(ncid, vardesc, ndims) status = pio_inq_vardimid(ncid, vardesc, dids(1:ndims)) @@ -1692,25 +1757,11 @@ contains if (present(nt)) then call pio_setframe(ncid, vardesc, int(nt,kind=Pio_Offset_Kind)) end if -#if ({ITYPE}==TYPELOGICAL) - allocate(idata(size(data))) - call pio_read_darray(ncid, vardesc, iodesc_plus%iodesc, idata, status) - data = (idata == 1) - if ( any(idata /= 0 .and. idata /= 1) )then - call shr_sys_abort(' ERROR: read in bad integer value(s) for logical data'//errMsg(sourcefile, __LINE__)) - end if - deallocate( idata ) -#else - call pio_seterrorhandling(ncid, PIO_BCAST_ERROR) - call pio_read_darray(ncid, vardesc, iodesc_plus%iodesc, data, status) -#endif - if ( status /= PIO_NOERR ) then - call shr_sys_abort(' ERROR: reading in variable: '// trim(varname) & - // errMsg(sourcefile, __LINE__)) - end if + call read_darray_dispatcher(ncid, vardesc, iodesc_plus%iodesc, varname, xtype, data) + end if end if - call pio_seterrorhandling(ncid, PIO_INTERNAL_ERROR) + if (present(readvar)) readvar = varpresent elseif (flag == 'write') then @@ -1891,29 +1942,28 @@ contains status = pio_inq_dimlen(ncid,dids(n),dims(n)) enddo status = pio_inq_vartype(ncid, vardesc, xtype) - if (present(switchdim)) then - call ncd_getiodesc(ncid, clmlevel, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & - xtype, iodnum, switchdim=.true.) - else - call ncd_getiodesc(ncid, clmlevel, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & - xtype, iodnum) - end if - iodesc_plus => iodesc_list(iodnum) if (present(nt)) then call pio_setframe(ncid, vardesc, int(nt,kind=Pio_Offset_Kind)) end if if (present(switchdim)) then - call pio_read_darray(ncid, vardesc, iodesc_plus%iodesc, temp, status) + call ncd_getiodesc(ncid, clmlevel, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & + xtype, iodnum, switchdim=.true.) + iodesc_plus => iodesc_list(iodnum) + call read_darray_dispatcher(ncid, vardesc, iodesc_plus%iodesc, varname, xtype, temp) do j = lb2,ub2 - do i = lb1,ub1 - data(i,j) = temp(j,i) - end do + do i = lb1,ub1 + data(i,j) = temp(j,i) + end do end do else - call pio_read_darray(ncid, vardesc, iodesc_plus%iodesc, data, status) + call ncd_getiodesc(ncid, clmlevel, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & + xtype, iodnum) + iodesc_plus => iodesc_list(iodnum) + call read_darray_dispatcher(ncid, vardesc, iodesc_plus%iodesc, varname, xtype, data) + end if end if -#if ({ITYPE}!=TYPEINT) +#if ({ITYPE}==TYPEDOUBLE) if ( present(cnvrtnan2fill) )then do j = lb2,ub2 do i = lb1,ub1 @@ -2009,7 +2059,6 @@ contains end if end subroutine ncd_io_2d_{TYPE} - !----------------------------------------------------------------------- !TYPE int,double @@ -2105,7 +2154,8 @@ contains if (present(nt)) then call pio_setframe(ncid, vardesc, int(nt,kind=Pio_Offset_Kind)) end if - call pio_read_darray(ncid, vardesc, iodesc_plus%iodesc, data, status) + call read_darray_dispatcher(ncid, vardesc, iodesc_plus%iodesc, varname, xtype, data) + end if end if if (present(readvar)) readvar = varpresent @@ -2148,6 +2198,158 @@ contains end subroutine ncd_io_3d_{TYPE} + !----------------------------------------------------------------------- + !TYPE int,double,logical + !DIMS 1,2,3 + subroutine read_darray_{TYPE}_dispatcher_{DIMS}(ncid, vardesc, iodesc, varname, xtype, data) + ! + ! !DESCRIPTION: + ! Dispatch to the appropriate read_darray routine based on xtype (the type of var in file) + ! + ! !ARGUMENTS: + class(file_desc_t), intent(inout) :: ncid + type(var_desc_t), intent(inout) :: vardesc + type(io_desc_t), intent(inout) :: iodesc + character(len=*), intent(in) :: varname + integer, intent(in) :: xtype + {VTYPE}, pointer :: data{DIMSTR} + ! + ! !LOCAL VARIABLES: + + character(len=*), parameter :: subname = 'read_darray_{TYPE}_dispatcher_{DIMS}' + !----------------------------------------------------------------------- + + select case (xtype) + case (PIO_INT) + call read_darray_{TYPE}_from_int_{DIMS}(ncid, vardesc, iodesc, varname, data) + case (PIO_REAL) + call read_darray_{TYPE}_from_real_{DIMS}(ncid, vardesc, iodesc, varname, data) + case (PIO_DOUBLE) + call read_darray_{TYPE}_from_double_{DIMS}(ncid, vardesc, iodesc, varname, data) + case default + write(iulog,*) subname//' ERROR: unrecognized type in read: ', xtype + call shr_sys_abort(' ERROR: unrecognized type in read '//errMsg(sourcefile, __LINE__)) + end select + + end subroutine read_darray_{TYPE}_dispatcher_{DIMS} + + + !------------------------------------------------------------------------ + !TYPE int,double,logical + !DIMS 1,2,3 + subroutine read_darray_{TYPE}_from_double_{DIMS}(ncid, vardesc, iodesc, varname, data) + class(file_desc_t), intent(inout) :: ncid + type(var_desc_t), intent(inout) :: vardesc + type(io_desc_t), intent(inout) :: iodesc + {VTYPE}, pointer :: data{DIMSTR} + character(len=*), intent(in) :: varname + integer :: status + + real(R8), allocatable :: ddata{DIMSTR} + integer :: oldhandle + + call pio_seterrorhandling(ncid, PIO_BCAST_ERROR, oldhandle) +#if({ITYPE}==TYPEDOUBLE) + call pio_read_darray(ncid, vardesc, iodesc, data, status) + if ( status /= PIO_NOERR ) then + call shr_sys_abort(' ERROR: reading in variable: '// trim(varname) & + // errMsg(sourcefile, __LINE__)) + end if +#else + allocate(ddata({REPEAT: size(data,#)})) + call pio_read_darray(ncid, vardesc, iodesc, ddata, status) + if ( status /= PIO_NOERR ) then + call shr_sys_abort(' ERROR: reading in variable: '// trim(varname) & + // errMsg(sourcefile, __LINE__)) + end if +#if({ITYPE}==TYPEINT) + data = int(ddata) +#elif({ITYPE}==TYPELOGICAL) + call convert_to_logical(ddata, data) +#else + call shr_sys_abort(' ERROR: unhandled type'//errMsg(sourcefile, __LINE__)) +#endif + deallocate(ddata) +#endif + call pio_seterrorhandling(ncid, oldhandle) + end subroutine read_darray_{TYPE}_from_double_{DIMS} + + !------------------------------------------------------------------------ + !TYPE int,double,logical + !DIMS 1,2,3 + subroutine read_darray_{TYPE}_from_int_{DIMS}(ncid, vardesc, iodesc, varname, data) + class(file_desc_t), intent(inout) :: ncid + type(var_desc_t), intent(inout) :: vardesc + type(io_desc_t), intent(inout) :: iodesc + character(len=*), intent(in) :: varname + {VTYPE}, pointer :: data{DIMSTR} + integer :: status + + integer, allocatable :: idata{DIMSTR} + integer :: oldhandle + + call pio_seterrorhandling(ncid, PIO_BCAST_ERROR, oldhandle) +#if({ITYPE}==TYPEINT) + call pio_read_darray(ncid, vardesc, iodesc, data, status) + if ( status /= PIO_NOERR ) then + call shr_sys_abort(' ERROR: reading in variable: '// trim(varname) & + // errMsg(sourcefile, __LINE__)) + end if +#else + allocate(idata({REPEAT: size(data,#)})) + call pio_read_darray(ncid, vardesc, iodesc, idata, status) + if ( status /= PIO_NOERR ) then + call shr_sys_abort(' ERROR: reading in variable: '// trim(varname) & + // errMsg(sourcefile, __LINE__)) + end if +#if({ITYPE}==TYPEDOUBLE) + data = real(idata, kind=R8) +#elif({ITYPE}==TYPELOGICAL) + call convert_to_logical(idata, data) +#else + call shr_sys_abort(' ERROR: unhandled type'//errMsg(sourcefile, __LINE__)) +#endif + deallocate(idata) +#endif + call pio_seterrorhandling(ncid, oldhandle) + end subroutine read_darray_{TYPE}_from_int_{DIMS} + + !------------------------------------------------------------------------ + !TYPE int,double,logical + !DIMS 1,2,3 + subroutine read_darray_{TYPE}_from_real_{DIMS}(ncid, vardesc, iodesc, varname, data) + class(file_desc_t), intent(inout) :: ncid + type(var_desc_t), intent(inout) :: vardesc + type(io_desc_t), intent(inout) :: iodesc + character(len=*), intent(in) :: varname + {VTYPE}, pointer :: data{DIMSTR} + + integer :: status + real(r4), allocatable :: rdata{DIMSTR} + integer :: oldhandle + + call pio_seterrorhandling(ncid, PIO_BCAST_ERROR, oldhandle) + + allocate(rdata({REPEAT: size(data,#)})) + call pio_read_darray(ncid, vardesc, iodesc, rdata, status) + if ( status /= PIO_NOERR ) then + call shr_sys_abort(' ERROR: reading in variable: '// trim(varname) & + // errMsg(sourcefile, __LINE__)) + end if +#if({ITYPE}==TYPEDOUBLE) + data = real(rdata, kind=R8) +#elif({ITYPE}==TYPEINT) + data = int(rdata) +#elif({ITYPE}==TYPELOGICAL) + call convert_to_logical(rdata, data) +#else + call shr_sys_abort(' ERROR: unhandled type'//errMsg(sourcefile, __LINE__)) +#endif + deallocate(rdata) + call pio_seterrorhandling(ncid, oldhandle) + + end subroutine read_darray_{TYPE}_from_real_{DIMS} + !------------------------------------------------------------------------ subroutine scam_field_offsets( ncid, dim1name, vardesc, start, count, & diff --git a/src/main/ncdio_utils.F90 b/src/main/ncdio_utils.F90 index 977e10b484..e72232941f 100644 --- a/src/main/ncdio_utils.F90 +++ b/src/main/ncdio_utils.F90 @@ -17,7 +17,7 @@ module ncdio_utils contains !----------------------------------------------------------------------- - subroutine find_var_on_file(ncid, varname_list, varname_on_file) + subroutine find_var_on_file(ncid, varname_list, is_dim, varname_on_file) ! ! !DESCRIPTION: ! Given a colon-delimited list of possible variable names, return the first one that @@ -33,6 +33,7 @@ subroutine find_var_on_file(ncid, varname_list, varname_on_file) ! !ARGUMENTS: type(file_desc_t) , intent(inout) :: ncid ! netcdf file id character(len=*) , intent(in) :: varname_list ! colon-delimited list of possible variable names + logical , intent(in) :: is_dim ! if .true., then look at dimensions rather than variables character(len=*) , intent(out) :: varname_on_file ! first variable from the list that was found on file ! ! !LOCAL VARIABLES: @@ -41,8 +42,6 @@ subroutine find_var_on_file(ncid, varname_list, varname_on_file) logical :: found logical :: readvar character(len=len(varname_on_file)) :: cur_varname - integer :: varid - type(var_desc_t) :: vardesc character(len=*), parameter :: subname = 'find_var_on_file' !----------------------------------------------------------------------- @@ -53,8 +52,7 @@ subroutine find_var_on_file(ncid, varname_list, varname_on_file) n = 1 do while ((.not. found) .and. (n <= num_vars)) call shr_string_listGetName(varname_list, n, cur_varname) - call ncd_inqvid(ncid, cur_varname, varid, vardesc, readvar=readvar) - found = readvar + call check_var_or_dim(ncid, cur_varname, is_dim=is_dim, exists=found) n = n + 1 end do diff --git a/src/main/ndepStreamMod.F90 b/src/main/ndepStreamMod.F90 index 7a4bc66ac5..4741e879ea 100644 --- a/src/main/ndepStreamMod.F90 +++ b/src/main/ndepStreamMod.F90 @@ -12,7 +12,7 @@ module ndepStreamMod use shr_strdata_mod, only: shr_strdata_print, shr_strdata_advance use mct_mod , only: mct_ggrid use spmdMod , only: mpicom, masterproc, comp_id, iam - use clm_varctl , only: iulog + use clm_varctl , only: iulog, inst_name use abortutils , only: endrun use fileutils , only: getavu, relavu use decompMod , only: bounds_type, ldecomp @@ -51,14 +51,13 @@ subroutine ndep_init(bounds, NLFilename) ! ! Uses: use shr_kind_mod , only : CS => shr_kind_cs - use clm_varctl , only : inst_name use clm_time_manager , only : get_calendar use ncdio_pio , only : pio_subsystem use shr_pio_mod , only : shr_pio_getiotype use shr_nl_mod , only : shr_nl_find_group_name use shr_log_mod , only : errMsg => shr_log_errMsg use shr_mpi_mod , only : shr_mpi_bcast - use decompMod , only : gsmap_lnd_gdc2glo + use decompMod , only : gsmap_lnd_gdc2glo ! ! arguments implicit none @@ -302,7 +301,7 @@ subroutine clm_domain_mct(bounds, dom_clm, nlevels) ! Initialize mct domain type ! lat/lon in degrees, area in radians^2, mask is 1 (land), 0 (non-land) ! Note that in addition land carries around landfrac for the purposes of domain checking - ! + ! lsize = mct_gsMap_lsize(gsmap, mpicom) call mct_gGrid_init( GGrid=dom_clm, & CoordChars='lat:lon:hgt', OtherChars='area:aream:mask:frac', lsize=lsize ) @@ -339,7 +338,7 @@ subroutine clm_domain_mct(bounds, dom_clm, nlevels) data(i) = ldomain%lonc(g) end do end do - call mct_gGrid_importRattr(dom_clm,"lon",data,lsize) + call mct_gGrid_importRattr(dom_clm,"lon",data,lsize) do k = 1, nlevs do g = bounds%begg,bounds%endg @@ -347,7 +346,7 @@ subroutine clm_domain_mct(bounds, dom_clm, nlevels) data(i) = ldomain%latc(g) end do end do - call mct_gGrid_importRattr(dom_clm,"lat",data,lsize) + call mct_gGrid_importRattr(dom_clm,"lat",data,lsize) do k = 1, nlevs do g = bounds%begg,bounds%endg @@ -355,7 +354,7 @@ subroutine clm_domain_mct(bounds, dom_clm, nlevels) data(i) = ldomain%area(g)/(re*re) end do end do - call mct_gGrid_importRattr(dom_clm,"area",data,lsize) + call mct_gGrid_importRattr(dom_clm,"area",data,lsize) do k = 1, nlevs do g = bounds%begg,bounds%endg @@ -363,7 +362,7 @@ subroutine clm_domain_mct(bounds, dom_clm, nlevels) data(i) = real(ldomain%mask(g), r8) end do end do - call mct_gGrid_importRattr(dom_clm,"mask",data,lsize) + call mct_gGrid_importRattr(dom_clm,"mask",data,lsize) do k = 1, nlevs do g = bounds%begg,bounds%endg @@ -371,7 +370,7 @@ subroutine clm_domain_mct(bounds, dom_clm, nlevels) data(i) = real(ldomain%frac(g), r8) end do end do - call mct_gGrid_importRattr(dom_clm,"frac",data,lsize) + call mct_gGrid_importRattr(dom_clm,"frac",data,lsize) deallocate(data) deallocate(idata) diff --git a/src/main/paramUtilMod.F90 b/src/main/paramUtilMod.F90 index 96c95440e7..ac6845fc01 100644 --- a/src/main/paramUtilMod.F90 +++ b/src/main/paramUtilMod.F90 @@ -265,7 +265,7 @@ subroutine checkDimensions(ncid, varName, expected_numDims, expected_dimNames, c integer :: d, num_dims character(len=256) :: msg - call check_var(ncid, varName, var_desc, readvar) + call check_var(ncid, varName, readvar, vardesc=var_desc) if (readvar) then call ncd_inqvdims(ncid, num_dims, var_desc) if (num_dims /= expected_numDims) then diff --git a/src/main/pftconMod.F90 b/src/main/pftconMod.F90 index 9b7eefa51b..702a03b511 100644 --- a/src/main/pftconMod.F90 +++ b/src/main/pftconMod.F90 @@ -221,6 +221,8 @@ module pftconMod real(r8), allocatable :: fm_droot (:) real(r8), allocatable :: fsr_pft (:) real(r8), allocatable :: fd_pft (:) + real(r8), allocatable :: rswf_min (:) + real(r8), allocatable :: rswf_max (:) ! pft parameters for crop code real(r8), allocatable :: manunitro (:) ! manure @@ -432,6 +434,8 @@ subroutine InitAllocate (this) allocate( this%fm_droot (0:mxpft) ) allocate( this%fsr_pft (0:mxpft) ) allocate( this%fd_pft (0:mxpft) ) + allocate( this%rswf_max (0:mxpft) ) + allocate( this%rswf_min (0:mxpft) ) allocate( this%manunitro (0:mxpft) ) allocate( this%fleafcn (0:mxpft) ) allocate( this%ffrootcn (0:mxpft) ) @@ -951,6 +955,11 @@ subroutine InitRead(this) call ncd_io('fd_pft', this% fd_pft, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) + call ncd_io('rswf_min', this% rswf_min, 'read', ncid, readvar=readv) + if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) + + call ncd_io('rswf_max', this% rswf_max, 'read', ncid, readvar=readv) + if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) call ncd_io('planting_temp', this%planttemp, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) @@ -1365,6 +1374,8 @@ subroutine Clean(this) deallocate( this%fm_droot) deallocate( this%fsr_pft) deallocate( this%fd_pft) + deallocate( this%rswf_min) + deallocate( this%rswf_max) deallocate( this%manunitro) deallocate( this%fleafcn) deallocate( this%ffrootcn) diff --git a/src/main/restFileMod.F90 b/src/main/restFileMod.F90 index 83be13835b..0e60653930 100644 --- a/src/main/restFileMod.F90 +++ b/src/main/restFileMod.F90 @@ -17,14 +17,16 @@ module restFileMod use accumulMod , only : accumulRest use clm_instMod , only : clm_instRest use histFileMod , only : hist_restart_ncd - use clm_varctl , only : iulog, use_fates, use_hydrstress + use clm_varctl , only : iulog, use_fates, use_hydrstress, compname use clm_varctl , only : create_crop_landunit, irrigate use clm_varcon , only : nameg, namel, namec, namep, nameCohort use ncdio_pio , only : file_desc_t, ncd_pio_createfile, ncd_pio_openfile, ncd_global - use ncdio_pio , only : ncd_pio_closefile, ncd_defdim, ncd_putatt, ncd_enddef, check_dim + use ncdio_pio , only : ncd_pio_closefile, ncd_defdim, ncd_putatt, ncd_enddef, check_dim_size use ncdio_pio , only : check_att, ncd_getatt + use ncdio_utils , only : find_var_on_file use glcBehaviorMod , only : glc_behavior_type use reweightMod , only : reweight_wrapup + use IssueFixedMetadataHandler, only : write_issue_fixed_metadata, read_issue_fixed_metadata ! ! !PUBLIC TYPES: implicit none @@ -44,6 +46,8 @@ module restFileMod private :: restFile_write_pfile ! Writes restart pointer file private :: restFile_closeRestart ! Close restart file and write restart pointer file private :: restFile_dimset + private :: restFile_write_issues_fixed ! Write metadata for issues fixed + private :: restFile_read_issues_fixed ! Read and process metadata for issues fixed private :: restFile_add_flag_metadata ! Add global metadata for some logical flag private :: restFile_add_ilun_metadata ! Add global metadata defining landunit types private :: restFile_add_icol_metadata ! Add global metadata defining column types @@ -56,6 +60,9 @@ module restFileMod ! ! !PRIVATE TYPES: + ! Issue numbers for issue-fixed metadata + integer, parameter :: lake_dynbal_baseline_issue = 1140 + character(len=*), parameter, private :: sourcefile = & __FILE__ !----------------------------------------------------------------------- @@ -108,6 +115,9 @@ subroutine restFile_write( bounds, file, writing_finidat_interp_dest_file, rdate call hist_restart_ncd (bounds, ncid, flag='define', rdate=rdate ) end if + call restFile_write_issues_fixed(ncid, & + writing_finidat_interp_dest_file = writing_finidat_interp_dest_file) + call restFile_enddef( ncid ) ! Write variables @@ -142,7 +152,7 @@ subroutine restFile_write( bounds, file, writing_finidat_interp_dest_file, rdate end subroutine restFile_write !----------------------------------------------------------------------- - subroutine restFile_read( bounds_proc, file, glc_behavior ) + subroutine restFile_read( bounds_proc, file, glc_behavior, reset_dynbal_baselines_lake_columns ) ! ! !DESCRIPTION: ! Read a CLM restart file. @@ -151,6 +161,13 @@ subroutine restFile_read( bounds_proc, file, glc_behavior ) type(bounds_type) , intent(in) :: bounds_proc ! processor-level bounds character(len=*) , intent(in) :: file ! output netcdf restart file type(glc_behavior_type), intent(in) :: glc_behavior + + ! BACKWARDS_COMPATIBILITY(wjs, 2020-09-02) This is needed when reading old initial + ! conditions files created before https://github.com/ESCOMP/CTSM/issues/1140 was + ! resolved via https://github.com/ESCOMP/CTSM/pull/1109: The definition of total + ! column water content has been changed for lakes, so we need to reset baseline values + ! for lakes on older initial conditions files. + logical, intent(out) :: reset_dynbal_baselines_lake_columns ! ! !LOCAL VARIABLES: type(file_desc_t) :: ncid ! netcdf id @@ -201,6 +218,9 @@ subroutine restFile_read( bounds_proc, file, glc_behavior ) call hist_restart_ncd (bounds_proc, ncid, flag='read' ) + call restFile_read_issues_fixed(ncid, & + reset_dynbal_baselines_lake_columns = reset_dynbal_baselines_lake_columns) + ! Do error checking on file call restFile_check_consistency(bounds_proc, ncid) @@ -263,8 +283,8 @@ subroutine restFile_getfile( file, path ) end if call getfil( path, file, 0 ) - ! tcraig, adding xx. and .clm2 makes this more robust - ctest = 'xx.'//trim(caseid)//'.clm2' + ! tcraig, adding xx. and .compname makes this more robust + ctest = 'xx.'//trim(caseid)//'.'//trim(compname) ftest = 'xx.'//trim(file) status = index(trim(ftest),trim(ctest)) if (status /= 0 .and. .not.(brnch_retain_casename)) then @@ -466,7 +486,7 @@ character(len=256) function restFile_filename( rdate ) character(len=*), intent(in) :: rdate ! input date for restart file name !----------------------------------------------------------------------- - restFile_filename = "./"//trim(caseid)//".clm2"//trim(inst_suffix)//& + restFile_filename = "./"//trim(caseid)//"."//trim(compname)//trim(inst_suffix)//& ".r."//trim(rdate)//".nc" if (masterproc) then write(iulog,*)'writing restart file ',trim(restFile_filename),' for model date = ',rdate @@ -485,7 +505,7 @@ subroutine restFile_dimset( ncid ) use clm_varctl , only : caseid, ctitle, version, username, hostname, fsurdat use clm_varctl , only : conventions, source use dynSubgridControlMod , only : get_flanduse_timeseries - use clm_varpar , only : numrad, nlevlak, nlevsno, nlevgrnd, nlevcan + use clm_varpar , only : numrad, nlevlak, nlevsno, nlevgrnd, nlevmaxurbgrnd, nlevcan use clm_varpar , only : maxpatch_glcmec, nvegwcs use decompMod , only : get_proc_global ! @@ -518,10 +538,11 @@ subroutine restFile_dimset( ncid ) call ncd_defdim(ncid , nameCohort , numCohort , dimid) call ncd_defdim(ncid , 'levgrnd' , nlevgrnd , dimid) + call ncd_defdim(ncid , 'levmaxurbgrnd' , nlevmaxurbgrnd , dimid) call ncd_defdim(ncid , 'levlak' , nlevlak , dimid) call ncd_defdim(ncid , 'levsno' , nlevsno , dimid) call ncd_defdim(ncid , 'levsno1' , nlevsno+1 , dimid) - call ncd_defdim(ncid , 'levtot' , nlevsno+nlevgrnd, dimid) + call ncd_defdim(ncid , 'levtot' , nlevsno+nlevmaxurbgrnd, dimid) call ncd_defdim(ncid , 'numrad' , numrad , dimid) call ncd_defdim(ncid , 'levcan' , nlevcan , dimid) if ( use_hydrstress ) then @@ -563,6 +584,63 @@ subroutine restFile_dimset( ncid ) end subroutine restFile_dimset + !----------------------------------------------------------------------- + subroutine restFile_write_issues_fixed(ncid, writing_finidat_interp_dest_file) + ! + ! !DESCRIPTION: + ! Write metadata for issues fixed + ! + ! !ARGUMENTS: + type(file_desc_t), intent(inout) :: ncid ! local file id + logical , intent(in) :: writing_finidat_interp_dest_file ! true if we are writing a finidat_interp_dest file + ! + ! !LOCAL VARIABLES: + + character(len=*), parameter :: subname = 'restFile_write_issues_fixed' + !----------------------------------------------------------------------- + + ! See comment associated with reset_dynbal_baselines_lake_columns in restFile_read + call write_issue_fixed_metadata( & + ncid = ncid, & + writing_finidat_interp_dest_file = writing_finidat_interp_dest_file, & + issue_num = lake_dynbal_baseline_issue) + + end subroutine restFile_write_issues_fixed + + !----------------------------------------------------------------------- + subroutine restFile_read_issues_fixed(ncid, reset_dynbal_baselines_lake_columns) + ! + ! !DESCRIPTION: + ! Read and process metadata for issues fixed + ! + ! !ARGUMENTS: + type(file_desc_t), intent(inout) :: ncid ! local file id + logical, intent(out) :: reset_dynbal_baselines_lake_columns ! see comment in restFile_read for details + ! + ! !LOCAL VARIABLES: + integer :: attribute_value + + character(len=*), parameter :: subname = 'restFile_read_issues_fixed' + !----------------------------------------------------------------------- + + ! See comment associated with reset_dynbal_baselines_lake_columns in restFile_read + call read_issue_fixed_metadata( & + ncid = ncid, & + issue_num = lake_dynbal_baseline_issue, & + attribute_value = attribute_value) + if (attribute_value == 0) then + ! Old restart file, from before lake_dynbal_baseline_issue was resolved, so we + ! need to reset dynbal baselines for lake columns later in initialization. + reset_dynbal_baselines_lake_columns = .true. + else + ! Recent restart file, so no need to reset dynbal baselines for lake columns, + ! because they are already up to date. + reset_dynbal_baselines_lake_columns = .false. + end if + + end subroutine restFile_read_issues_fixed + + !----------------------------------------------------------------------- subroutine restFile_add_flag_metadata(ncid, flag, flag_name) ! @@ -678,7 +756,7 @@ subroutine restFile_dimcheck( ncid ) ! ! !USES: use decompMod, only : get_proc_global - use clm_varpar, only : nlevsno, nlevlak, nlevgrnd + use clm_varpar, only : nlevsno, nlevlak, nlevgrnd, nlevmaxurbgrnd use clm_varctl, only : single_column, nsrest, nsrStartup ! ! !ARGUMENTS: @@ -690,6 +768,7 @@ subroutine restFile_dimcheck( ncid ) integer :: numc ! total number of columns across all processors integer :: nump ! total number of pfts across all processors integer :: numCohort ! total number of cohorts across all processors + character(len=64) :: dimname character(len=:), allocatable :: msg ! diagnostic message character(len=32) :: subname='restFile_dimcheck' ! subroutine name !----------------------------------------------------------------------- @@ -707,17 +786,24 @@ subroutine restFile_dimcheck( ncid ) 'or a non-transient run using an initial conditions file from a transient run,' // & new_line('x') // & 'or when running a resolution or configuration that differs from the initial conditions.)' - call check_dim(ncid, nameg, numg, msg=msg) - call check_dim(ncid, namel, numl, msg=msg) - call check_dim(ncid, namec, numc, msg=msg) - call check_dim(ncid, namep, nump, msg=msg) - if ( use_fates ) call check_dim(ncid, nameCohort , numCohort, msg=msg) + call check_dim_size(ncid, nameg, numg, msg=msg) + call check_dim_size(ncid, namel, numl, msg=msg) + call check_dim_size(ncid, namec, numc, msg=msg) + call check_dim_size(ncid, namep, nump, msg=msg) + if ( use_fates ) call check_dim_size(ncid, nameCohort , numCohort, msg=msg) end if msg = 'You can deal with this mismatch by rerunning with ' // & 'use_init_interp = .true. in user_nl_clm' - call check_dim(ncid, 'levsno' , nlevsno, msg=msg) - call check_dim(ncid, 'levgrnd' , nlevgrnd, msg=msg) - call check_dim(ncid, 'levlak' , nlevlak) + call check_dim_size(ncid, 'levsno' , nlevsno, msg=msg) + call check_dim_size(ncid, 'levgrnd' , nlevgrnd, msg=msg) + call check_dim_size(ncid, 'levlak' , nlevlak) + + ! BACKWARDS_COMPATIBILITY(wjs, 2020-10-27) The possibility of falling back on levgrnd + ! is needed for backwards compatibility with older restart files that do not have a + ! levmaxurbgrnd dimension. On these old restart files, we expect the levgrnd dimension + ! to give the implicit value of levmaxurbgrnd. + call find_var_on_file(ncid, 'levmaxurbgrnd:levgrnd', is_dim=.true., varname_on_file=dimname) + call check_dim_size(ncid, dimname, nlevmaxurbgrnd) end subroutine restFile_dimcheck diff --git a/src/main/subgridMod.F90 b/src/main/subgridMod.F90 index c0dbbc3dba..296e3d215e 100644 --- a/src/main/subgridMod.F90 +++ b/src/main/subgridMod.F90 @@ -38,7 +38,8 @@ module subgridMod public :: subgrid_get_info_glacier_mec public :: subgrid_get_info_crop public :: crop_patch_exists ! returns true if the given crop patch should be created in memory - + public :: lake_landunit_exists ! returns true if the lake landunit should be created in memory + ! !PRIVATE MEMBER FUNCTIONS: private :: subgrid_get_info_urban @@ -392,10 +393,10 @@ subroutine subgrid_get_info_lake(gi, npatches, ncols, nlunits) character(len=*), parameter :: subname = 'subgrid_get_info_lake' !----------------------------------------------------------------------- - ! We currently do NOT allow the lake landunit to expand via dynamic landunits, so we - ! only need to allocate space for it where its weight is currently non-zero. - - if (wt_lunit(gi, istdlak) > 0.0_r8) then + ! We do allow the lake landunit to expand via dynamic landunits, so we + ! need to allocate space for where it is known that the lake unit will grow. + + if (lake_landunit_exists(gi) ) then npatches = 1 ncols = 1 nlunits = 1 @@ -484,7 +485,6 @@ subroutine subgrid_get_info_crop(gi, npatches, ncols, nlunits) !----------------------------------------------------------------------- npatches = 0 - do cft = cft_lb, cft_ub if (crop_patch_exists(gi, cft)) then npatches = npatches + 1 @@ -558,6 +558,45 @@ function crop_patch_exists(gi, cft) result(exists) end function crop_patch_exists +!----------------------------------------------------------------------- + function lake_landunit_exists(gi) result(exists) + ! + ! !DESCRIPTION: + ! Returns true if a land unit for lakes should be created in memory + ! which is defined for gridcells which will grow lake, given by haslake + ! + ! !USES: + use dynSubgridControlMod , only : get_do_transient_lakes + use clm_instur , only : haslake + ! + ! !ARGUMENTS: + logical :: exists ! function result + integer, intent(in) :: gi ! grid cell index + ! + ! !LOCAL VARIABLES: + + character(len=*), parameter :: subname = 'lake_landunit_exists' + !----------------------------------------------------------------------- + + if (get_do_transient_lakes()) then + ! To support dynamic landunits, we initialise a lake land unit in each grid cell in which there are lakes. + ! This is defined by the haslake variable + + if (haslake(gi)) then + exists = .true. + else + exists = .false. + end if + + else + ! For a run without transient lakes, only allocate memory for lakes actually present in run) + if (wt_lunit(gi, istdlak) > 0.0_r8) then + exists = .true. + else + exists = .false. + end if + end if + end function lake_landunit_exists end module subgridMod diff --git a/src/main/subgridRestMod.F90 b/src/main/subgridRestMod.F90 index ee5c9bf22d..4bcb69b928 100644 --- a/src/main/subgridRestMod.F90 +++ b/src/main/subgridRestMod.F90 @@ -12,7 +12,7 @@ module subgridRestMod use domainMod , only : ldomain use clm_time_manager , only : get_curr_date use clm_varcon , only : nameg, namel, namec, namep - use clm_varpar , only : nlevsno, nlevgrnd + use clm_varpar , only : nlevsno, nlevmaxurbgrnd use pio , only : file_desc_t use ncdio_pio , only : ncd_int, ncd_double use GetGlobalValuesMod , only : GetGlobalIndexArray @@ -298,14 +298,14 @@ subroutine subgridRest_write_only(bounds, ncid, flag) interpinic_flag='skip', readvar=readvar, data=icarr) call restartvar(ncid=ncid, flag=flag, varname='LEVGRND_CLASS', xtype=ncd_int, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & + dim1name='column', dim2name='levmaxurbgrnd', switchdim=.true., & long_name='class in which each layer falls', units=' ', & interpinic_flag='skip', readvar=readvar, data=col%levgrnd_class) - allocate(temp2d_r(bounds%begc:bounds%endc, 1:nlevgrnd)) - temp2d_r(bounds%begc:bounds%endc, 1:nlevgrnd) = col%z(bounds%begc:bounds%endc, 1:nlevgrnd) + allocate(temp2d_r(bounds%begc:bounds%endc, 1:nlevmaxurbgrnd)) + temp2d_r(bounds%begc:bounds%endc, 1:nlevmaxurbgrnd) = col%z(bounds%begc:bounds%endc, 1:nlevmaxurbgrnd) call restartvar(ncid=ncid, flag=flag, varname='COL_Z', xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & + dim1name='column', dim2name='levmaxurbgrnd', switchdim=.true., & long_name='layer depth, excluding snow layers', units='m', & interpinic_flag='skip', readvar=readvar, data=temp2d_r) deallocate(temp2d_r) @@ -401,24 +401,24 @@ subroutine subgridRest_write_only(bounds, ncid, flag) long_name='pft active flag (1=active, 0=inactive)', units='', & interpinic_flag='skip', readvar=readvar, data=iparr) - allocate(temp2d_i(bounds%begp:bounds%endp, 1:nlevgrnd)) + allocate(temp2d_i(bounds%begp:bounds%endp, 1:nlevmaxurbgrnd)) do p=bounds%begp,bounds%endp c = patch%column(p) - temp2d_i(p, 1:nlevgrnd) = col%levgrnd_class(c, 1:nlevgrnd) + temp2d_i(p, 1:nlevmaxurbgrnd) = col%levgrnd_class(c, 1:nlevmaxurbgrnd) end do call restartvar(ncid=ncid, flag=flag, varname='LEVGRND_CLASS_p', xtype=ncd_int, & - dim1name='pft', dim2name='levgrnd', switchdim=.true., & + dim1name='pft', dim2name='levmaxurbgrnd', switchdim=.true., & long_name='class in which each layer falls, patch-level', units=' ', & interpinic_flag='skip', readvar=readvar, data=temp2d_i) deallocate(temp2d_i) - allocate(temp2d_r(bounds%begp:bounds%endp, 1:nlevgrnd)) + allocate(temp2d_r(bounds%begp:bounds%endp, 1:nlevmaxurbgrnd)) do p=bounds%begp,bounds%endp c = patch%column(p) - temp2d_r(p, 1:nlevgrnd) = col%z(c, 1:nlevgrnd) + temp2d_r(p, 1:nlevmaxurbgrnd) = col%z(c, 1:nlevmaxurbgrnd) end do call restartvar(ncid=ncid, flag=flag, varname='COL_Z_p', xtype=ncd_double, & - dim1name='pft', dim2name='levgrnd', switchdim=.true., & + dim1name='pft', dim2name='levmaxurbgrnd', switchdim=.true., & long_name='layer depth, excluding snow layers, patch-level', units='m', & interpinic_flag='skip', readvar=readvar, data=temp2d_r) deallocate(temp2d_r) diff --git a/src/main/subgridWeightsMod.F90 b/src/main/subgridWeightsMod.F90 index ddcc9585c9..3b67fd7574 100644 --- a/src/main/subgridWeightsMod.F90 +++ b/src/main/subgridWeightsMod.F90 @@ -301,7 +301,7 @@ logical function is_active_l(l, glc_behavior) ! Determine whether the given landunit is active ! ! !USES: - use landunit_varcon, only : istsoil, istice_mec, isturb_MIN, isturb_MAX + use landunit_varcon, only : istsoil, istice_mec, isturb_MIN, isturb_MAX, istdlak ! ! !ARGUMENTS: implicit none @@ -361,7 +361,15 @@ logical function is_active_l(l, glc_behavior) if (lun%itype(l) == istsoil) then is_active_l = .true. end if - + + ! Set all lake land units to active + ! By doing this, lakes are also run virtually in grid cells which will grow + ! lakes during the transient run. + + if (lun%itype(l) == istdlak) then + is_active_l = .true. + end if + end if end function is_active_l diff --git a/src/main/surfrdMod.F90 b/src/main/surfrdMod.F90 index 771165459d..6412fafe9c 100644 --- a/src/main/surfrdMod.F90 +++ b/src/main/surfrdMod.F90 @@ -17,9 +17,9 @@ module surfrdMod use clm_varctl , only : use_cndv, use_crop use surfrdUtilsMod , only : check_sums_equal_1, collapse_crop_types, collapse_to_dominant, collapse_crop_var, collapse_individual_lunits use ncdio_pio , only : file_desc_t, var_desc_t, ncd_pio_openfile, ncd_pio_closefile - use ncdio_pio , only : ncd_io, check_var, ncd_inqfdims, check_dim, ncd_inqdid, ncd_inqdlen + use ncdio_pio , only : ncd_io, check_var, ncd_inqfdims, check_dim_size, ncd_inqdid, ncd_inqdlen use pio - use spmdMod + use spmdMod ! ! !PUBLIC TYPES: implicit none @@ -53,7 +53,7 @@ subroutine surfrd_get_globmask(filename, mask, ni, nj) ! ! !DESCRIPTION: ! Read the surface dataset grid related information: - ! This is the first routine called by clm_initialize + ! This is the first routine called by clm_initialize ! NO DOMAIN DECOMPOSITION HAS BEEN SET YET ! ! !USES: @@ -61,17 +61,16 @@ subroutine surfrd_get_globmask(filename, mask, ni, nj) ! ! !ARGUMENTS: character(len=*), intent(in) :: filename ! grid filename - integer , pointer :: mask(:) ! grid mask + integer , pointer :: mask(:) ! grid mask integer , intent(out) :: ni, nj ! global grid sizes ! ! !LOCAL VARIABLES: logical :: isgrid2d integer :: dimid,varid ! netCDF id's integer :: ns ! size of grid on file - integer :: n,i,j ! index + integer :: n,i,j ! index integer :: ier ! error status type(file_desc_t) :: ncid ! netcdf id - type(var_desc_t) :: vardesc ! variable descriptor character(len=256) :: varname ! variable name character(len=256) :: locfn ! local file name logical :: readvar ! read variable in or not @@ -106,7 +105,7 @@ subroutine surfrd_get_globmask(filename, mask, ni, nj) if (isgrid2d) then allocate(idata2d(ni,nj)) - idata2d(:,:) = 1 + idata2d(:,:) = 1 call ncd_io(ncid=ncid, varname='LANDMASK', data=idata2d, flag='read', readvar=readvar) if (.not. readvar) then call ncd_io(ncid=ncid, varname='mask', data=idata2d, flag='read', readvar=readvar) @@ -114,7 +113,7 @@ subroutine surfrd_get_globmask(filename, mask, ni, nj) if (readvar) then do j = 1,nj do i = 1,ni - n = (j-1)*ni + i + n = (j-1)*ni + i mask(n) = idata2d(i,j) enddo enddo @@ -147,21 +146,20 @@ subroutine surfrd_get_grid(begg, endg, ldomain, filename, glcfilename) use fileutils , only : getfil ! ! !ARGUMENTS: - integer ,intent(in) :: begg, endg + integer ,intent(in) :: begg, endg type(domain_type),intent(inout) :: ldomain ! domain to init character(len=*) ,intent(in) :: filename ! grid filename character(len=*) ,optional, intent(in) :: glcfilename ! glc mask filename ! ! !LOCAL VARIABLES: type(file_desc_t) :: ncid ! netcdf id - type(var_desc_t) :: vardesc ! variable descriptor integer :: beg ! local beg index integer :: end ! local end index integer :: ni,nj,ns ! size of grid on file integer :: dimid,varid ! netCDF id's integer :: start(1), count(1) ! 1d lat/lon array sections integer :: ier,ret ! error status - logical :: readvar ! true => variable is on input file + logical :: readvar ! true => variable is on input file logical :: isgrid2d ! true => file is 2d lat/lon logical :: istype_domain ! true => input file is of type domain real(r8), allocatable :: rdata2d(:,:) ! temporary @@ -189,7 +187,7 @@ subroutine surfrd_get_grid(begg, endg, ldomain, filename, glcfilename) call domain_init(ldomain, isgrid2d=isgrid2d, ni=ni, nj=nj, nbeg=begg, nend=endg) ! Determine type of file - old style grid file or new style domain file - call check_var(ncid=ncid, varname='xc', vardesc=vardesc, readvar=readvar) + call check_var(ncid=ncid, varname='xc', readvar=readvar) if (readvar)then istype_domain = .true. else @@ -204,11 +202,11 @@ subroutine surfrd_get_grid(begg, endg, ldomain, filename, glcfilename) ! convert from radians**2 to km**2 ldomain%area = ldomain%area * (re**2) if (.not. readvar) call endrun( msg=' ERROR: area NOT on file'//errMsg(sourcefile, __LINE__)) - + call ncd_io(ncid=ncid, varname= 'xc', flag='read', data=ldomain%lonc, & dim1name=grlnd, readvar=readvar) if (.not. readvar) call endrun( msg=' ERROR: xc NOT on file'//errMsg(sourcefile, __LINE__)) - + call ncd_io(ncid=ncid, varname= 'yc', flag='read', data=ldomain%latc, & dim1name=grlnd, readvar=readvar) if (.not. readvar) call endrun( msg=' ERROR: yc NOT on file'//errMsg(sourcefile, __LINE__)) @@ -289,18 +287,20 @@ subroutine surfrd_get_data (begg, endg, ldomain, lfsurdat, actual_numcft) toosmall_soil, toosmall_crop, toosmall_glacier, & toosmall_lake, toosmall_wetland, toosmall_urban, & n_dom_landunits - use fileutils , only : getfil - use domainMod , only : domain_type, domain_init, domain_clean - use clm_instur , only : wt_lunit, topo_glc_mec - use landunit_varcon, only: max_lunit, istsoil, isturb_MIN, isturb_MAX + use fileutils , only : getfil + use domainMod , only : domain_type, domain_init, domain_clean + use clm_instur , only : wt_lunit, topo_glc_mec + use landunit_varcon , only : max_lunit, istsoil, isturb_MIN, isturb_MAX + use dynSubgridControlMod, only : get_flanduse_timeseries + use dynSubgridControlMod, only : get_do_transient_lakes + ! ! !ARGUMENTS: - integer, intent(in) :: begg, endg, actual_numcft + integer, intent(in) :: begg, endg, actual_numcft type(domain_type),intent(in) :: ldomain ! land domain character(len=*), intent(in) :: lfsurdat ! surface dataset filename ! ! !LOCAL VARIABLES: - type(var_desc_t) :: vardesc ! pio variable descriptor type(domain_type) :: surfdata_domain ! local domain associated with surface dataset character(len=256):: locfn ! local file name integer, parameter :: n_dom_urban = 1 ! # of dominant urban landunits @@ -311,7 +311,8 @@ subroutine surfrd_get_data (begg, endg, ldomain, lfsurdat, actual_numcft) real(r8) :: rmaxlon,rmaxlat ! local min/max vars type(file_desc_t) :: ncid ! netcdf id logical :: istype_domain ! true => input file is of type domain - logical :: isgrid2d ! true => intut grid is 2d + logical :: isgrid2d ! true => intut grid is 2d + character(len=32) :: subname = 'surfrd_get_data' ! subroutine name !----------------------------------------------------------------------- @@ -340,11 +341,11 @@ subroutine surfrd_get_data (begg, endg, ldomain, lfsurdat, actual_numcft) ! Check if fsurdat grid is "close" to fatmlndfrc grid, exit if lats/lon > 0.001 - call check_var(ncid=ncid, varname='xc', vardesc=vardesc, readvar=readvar) + call check_var(ncid=ncid, varname='xc', readvar=readvar) if (readvar) then istype_domain = .true. else - call check_var(ncid=ncid, varname='LONGXY', vardesc=vardesc, readvar=readvar) + call check_var(ncid=ncid, varname='LONGXY', readvar=readvar) if (readvar) then istype_domain = .false. else @@ -436,7 +437,7 @@ subroutine surfrd_get_data (begg, endg, ldomain, lfsurdat, actual_numcft) ! mksurfdat.F90 toosmallPFT = 1.e-10 call collapse_individual_lunits(wt_lunit, begg, endg, toosmall_soil, & - toosmall_crop, toosmall_glacier, & + toosmall_crop, toosmall_glacier, & toosmall_lake, toosmall_wetland, & toosmall_urban) @@ -445,6 +446,11 @@ subroutine surfrd_get_data (begg, endg, ldomain, lfsurdat, actual_numcft) write(iulog,*) end if + ! read the lakemask (necessary for initialisation of dynamical lakes) + if (get_do_transient_lakes()) then + call surfrd_lakemask(begg, endg) + end if + end subroutine surfrd_get_data !----------------------------------------------------------------------- @@ -512,7 +518,7 @@ subroutine surfrd_special(begg, endg, ncid, ns) use UrbanParamsType , only : CheckUrban ! ! !ARGUMENTS: - integer , intent(in) :: begg, endg + integer , intent(in) :: begg, endg type(file_desc_t), intent(inout) :: ncid ! netcdf id integer , intent(in) :: ns ! domain size ! @@ -545,7 +551,7 @@ subroutine surfrd_special(begg, endg, ncid, ns) allocate(urban_region_id(begg:endg)) allocate(pctspec(begg:endg)) - call check_dim(ncid, 'nlevsoi', nlevsoifl) + call check_dim_size(ncid, 'nlevsoi', nlevsoifl) ! Obtain non-grid surface properties of surface dataset other than percent patch @@ -563,7 +569,7 @@ subroutine surfrd_special(begg, endg, ncid, ns) ! Read urban info if (nlevurb == 0) then - ! If PCT_URBAN is not multi-density then set pcturb to zero + ! If PCT_URBAN is not multi-density then set pcturb to zero pcturb = 0._r8 urban_valid(begg:endg) = .false. write(iulog,*)'PCT_URBAN is not multi-density, pcturb set to 0' @@ -596,8 +602,8 @@ subroutine surfrd_special(begg, endg, ncid, ns) ! Read glacier info - call check_dim(ncid, 'nglcec', maxpatch_glcmec ) - call check_dim(ncid, 'nglcecp1', maxpatch_glcmec+1 ) + call check_dim_size(ncid, 'nglcec', maxpatch_glcmec ) + call check_dim_size(ncid, 'nglcecp1', maxpatch_glcmec+1 ) call ncd_io(ncid=ncid, varname='PCT_GLC_MEC', flag='read', data=wt_glc_mec, & dim1name=grlnd, readvar=readvar) @@ -685,12 +691,12 @@ subroutine surfrd_cftformat( ncid, begg, endg, wt_cft, fert_cft, cftsize, natpft SHR_ASSERT_ALL_FL((ubound(fert_cft, dim=2) >= (/cftsize+1-cft_lb/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(wt_nat_patch) >= (/endg,natpft_size-1+natpft_lb/)), sourcefile, __LINE__) - call check_dim(ncid, 'cft', cftsize) - call check_dim(ncid, 'natpft', natpft_size) + call check_dim_size(ncid, 'cft', cftsize) + call check_dim_size(ncid, 'natpft', natpft_size) call ncd_io(ncid=ncid, varname='PCT_CFT', flag='read', data=wt_cft, & dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( msg=' ERROR: PCT_CFT NOT on surfdata file'//errMsg(sourcefile, __LINE__)) + if (.not. readvar) call endrun( msg=' ERROR: PCT_CFT NOT on surfdata file'//errMsg(sourcefile, __LINE__)) if ( cft_size > 0 )then call ncd_io(ncid=ncid, varname='CONST_FERTNITRO_CFT', flag='read', data=fert_cft, & @@ -748,7 +754,7 @@ subroutine surfrd_pftformat( begg, endg, ncid ) !----------------------------------------------------------------------- SHR_ASSERT_ALL_FL((ubound(wt_nat_patch) == (/endg, natpft_size-1+natpft_lb/)), sourcefile, __LINE__) - call check_dim(ncid, 'natpft', natpft_size) + call check_dim_size(ncid, 'natpft', natpft_size) ! If cft_size == 0, then we expect to be running with a surface dataset ! that does ! NOT have a PCT_CFT array (or CONST_FERTNITRO_CFT array), and thus does not have a 'cft' dimension. @@ -872,12 +878,12 @@ subroutine surfrd_veg_all(begg, endg, ncid, ns, actual_numcft) if ( masterproc ) write(iulog,*) "WARNING: The PFT format is an unsupported format that will be removed in the future!" ! Check dimension size call surfrd_pftformat( begg, endg, ncid ) ! Format where crop is part of the natural veg. landunit - else + else call endrun( msg=' ERROR: Problem figuring out format of input fsurdat file'//errMsg(sourcefile, __LINE__)) end if ! Do some checking - + if ( (cft_size == 0) .and. any(wt_lunit(begg:endg,istcrop) > 0._r8) ) then call endrun( msg=' ERROR: if PCT_CROP > 0 anywhere, then cft_size must be > 0'// & ' (if the surface dataset has a separate crop landunit, then the code'// & @@ -932,7 +938,7 @@ subroutine surfrd_veg_dgvm(begg, endg) use clm_instur, only : wt_nat_patch ! ! !ARGUMENTS: - integer, intent(in) :: begg, endg + integer, intent(in) :: begg, endg ! ! !LOCAL VARIABLES: character(len=*), parameter :: subname = 'surfrd_veg_dgvm' @@ -946,4 +952,59 @@ subroutine surfrd_veg_dgvm(begg, endg) end subroutine surfrd_veg_dgvm + !----------------------------------------------------------------------- + subroutine surfrd_lakemask(begg, endg) + ! + ! !DESCRIPTION: + ! Reads the lake mask, indicating where lakes are and will grow + ! of the landuse.timeseries file. + ! Necessary for the initialisation of the lake land units + ! + ! !USES: + use clm_instur , only : haslake + use dynSubgridControlMod , only : get_flanduse_timeseries + use clm_varctl , only : fname_len + use fileutils , only : getfil + ! + ! !ARGUMENTS: + integer, intent(in) :: begg, endg + ! + ! + ! !LOCAL VARIABLES: + type(file_desc_t) :: ncid_dynuse ! netcdf id for landuse timeseries file + character(len=256) :: locfn ! local file name + character(len=fname_len) :: fdynuse ! landuse.timeseries filename + logical :: readvar + ! + character(len=*), parameter :: subname = 'surfrd_lakemask' + ! + !----------------------------------------------------------------------- + + ! get filename of landuse_timeseries file + fdynuse = get_flanduse_timeseries() + + if (masterproc) then + write(iulog,*) 'Attempting to read landuse.timeseries data .....' + if (fdynuse == ' ') then + write(iulog,*)'fdynuse must be specified' + call endrun(msg=errMsg(sourcefile, __LINE__)) + end if + end if + + call getfil(fdynuse, locfn, 0 ) + + ! open landuse_timeseries file + call ncd_pio_openfile (ncid_dynuse, trim(locfn), 0) + + ! read the lakemask + call ncd_io(ncid=ncid_dynuse, varname='HASLAKE' , flag='read', data=haslake, & + dim1name=grlnd, readvar=readvar) + if (.not. readvar) call endrun( msg=' ERROR: HASLAKE is not on landuse.timeseries file'//errMsg(sourcefile, __LINE__)) + + ! close landuse_timeseries file again + call ncd_pio_closefile(ncid_dynuse) + + end subroutine surfrd_lakemask + + end module surfrdMod diff --git a/src/main/test/ncdio_utils_test/test_ncdio_utils.pf b/src/main/test/ncdio_utils_test/test_ncdio_utils.pf index e8cbeb37db..c87a89e4f7 100644 --- a/src/main/test/ncdio_utils_test/test_ncdio_utils.pf +++ b/src/main/test/ncdio_utils_test/test_ncdio_utils.pf @@ -55,7 +55,7 @@ contains ncid = file_desc_t() call add_vars_to_file(ncid, ['foo']) - call find_var_on_file(ncid, 'foo', actual) + call find_var_on_file(ncid, 'foo', is_dim=.false., varname_on_file=actual) @assertEqual('foo', actual) end subroutine test_find_var_on_file_oneElement_found @@ -68,7 +68,7 @@ contains ncid = file_desc_t() - call find_var_on_file(ncid, 'foo', actual) + call find_var_on_file(ncid, 'foo', is_dim=.false., varname_on_file=actual) @assertEqual('foo', actual) end subroutine test_find_var_on_file_oneElement_notFound @@ -82,7 +82,7 @@ contains ncid = file_desc_t() call add_vars_to_file(ncid, ['foo', 'bar', 'baz']) - call find_var_on_file(ncid, 'foo:bar:baz', actual) + call find_var_on_file(ncid, 'foo:bar:baz', is_dim=.false., varname_on_file=actual) @assertEqual('foo', actual) end subroutine test_find_var_on_file_3Elements_first @@ -96,7 +96,7 @@ contains ncid = file_desc_t() call add_vars_to_file(ncid, ['bar', 'baz']) - call find_var_on_file(ncid, 'foo:bar:baz', actual) + call find_var_on_file(ncid, 'foo:bar:baz', is_dim=.false., varname_on_file=actual) @assertEqual('bar', actual) end subroutine test_find_var_on_file_3Elements_second @@ -110,7 +110,7 @@ contains ncid = file_desc_t() call add_vars_to_file(ncid, ['baz']) - call find_var_on_file(ncid, 'foo:bar:baz', actual) + call find_var_on_file(ncid, 'foo:bar:baz', is_dim=.false., varname_on_file=actual) @assertEqual('baz', actual) end subroutine test_find_var_on_file_3Elements_third @@ -123,7 +123,7 @@ contains ncid = file_desc_t() - call find_var_on_file(ncid, 'foo:bar:baz', actual) + call find_var_on_file(ncid, 'foo:bar:baz', is_dim=.false., varname_on_file=actual) @assertEqual('foo', actual) end subroutine test_find_var_on_file_3Elements_noneFound diff --git a/src/self_tests/Assertions.F90.in b/src/self_tests/Assertions.F90.in new file mode 100644 index 0000000000..2a4c8cccc6 --- /dev/null +++ b/src/self_tests/Assertions.F90.in @@ -0,0 +1,201 @@ +module Assertions + + ! ------------------------------------------------------------------------ + ! !DESCRIPTION: + ! This module contains various assertion methods that can be used in self-tests + ! + ! When an assertion fails, it will call endrun + + use shr_kind_mod, only : r8 => shr_kind_r8, i4 => shr_kind_i4 + use abortutils, only : endrun + use clm_varctl, only : iulog + + implicit none + private + save + + public :: assert_equal + + interface assert_equal + !TYPE double,int,logical + module procedure assert_equal_1d_{TYPE} + + !TYPE double,int,logical + module procedure assert_equal_2d_{TYPE} + + !TYPE double,int,logical + module procedure assert_equal_3d_{TYPE} + end interface assert_equal + + interface vals_are_equal + !TYPE double,int,logical + module procedure vals_are_equal_{TYPE} + end interface vals_are_equal + +contains + + !----------------------------------------------------------------------- + !TYPE double,int,logical + subroutine assert_equal_1d_{TYPE}(expected, actual, msg, abs_tol) + ! + ! !DESCRIPTION: + ! Assert 1-d arrays are equal + ! + ! !ARGUMENTS: + {VTYPE}, intent(in) :: expected(:) + {VTYPE}, intent(in) :: actual(:) + character(len=*), intent(in) :: msg + + ! absolute tolerance; if not specified, require exact equality; ignored for logicals + real(r8), intent(in), optional :: abs_tol + ! + ! !LOCAL VARIABLES: + integer :: i + + character(len=*), parameter :: subname = 'assert_equal_1d_{TYPE}' + !----------------------------------------------------------------------- + + if (any(shape(actual) /= shape(expected))) then + write(iulog,*) 'ERROR in assert_equal: ', msg + write(iulog,*) 'Shape mismatch:' + write(iulog,*) 'Actual shape: ', shape(actual) + write(iulog,*) 'Expected shape: ', shape(expected) + call endrun('ERROR in assert_equal') + end if + + do i = 1, size(expected, 1) + if (.not. vals_are_equal(actual(i), expected(i), abs_tol)) then + write(iulog,*) 'ERROR in assert_equal: ', msg + write(iulog,*) 'Data mismatch: first mismatch at index: ', i + write(iulog,*) 'Actual : ', actual(i) + write(iulog,*) 'Expected: ', expected(i) + call endrun('ERROR in assert_equal') + end if + end do + + end subroutine assert_equal_1d_{TYPE} + + !----------------------------------------------------------------------- + !TYPE double,int,logical + subroutine assert_equal_2d_{TYPE}(expected, actual, msg, abs_tol) + ! + ! !DESCRIPTION: + ! Assert 2-d arrays are equal + ! + ! !ARGUMENTS: + {VTYPE}, intent(in) :: expected(:,:) + {VTYPE}, intent(in) :: actual(:,:) + character(len=*), intent(in) :: msg + + ! absolute tolerance; if not specified, require exact equality; ignored for logicals + real(r8), intent(in), optional :: abs_tol + ! + ! !LOCAL VARIABLES: + integer :: i, j + + character(len=*), parameter :: subname = 'assert_equal_2d_{TYPE}' + !----------------------------------------------------------------------- + + if (any(shape(actual) /= shape(expected))) then + write(iulog,*) 'ERROR in assert_equal: ', msg + write(iulog,*) 'Shape mismatch:' + write(iulog,*) 'Actual shape: ', shape(actual) + write(iulog,*) 'Expected shape: ', shape(expected) + call endrun('ERROR in assert_equal') + end if + + do j = 1, size(expected, 2) + do i = 1, size(expected, 1) + if (.not. vals_are_equal(actual(i,j), expected(i,j), abs_tol)) then + write(iulog,*) 'ERROR in assert_equal: ', msg + write(iulog,*) 'Data mismatch: first mismatch at index: ', i, j + write(iulog,*) 'Actual : ', actual(i,j) + write(iulog,*) 'Expected: ', expected(i,j) + call endrun('ERROR in assert_equal') + end if + end do + end do + + end subroutine assert_equal_2d_{TYPE} + + !----------------------------------------------------------------------- + !TYPE double,int,logical + subroutine assert_equal_3d_{TYPE}(expected, actual, msg, abs_tol) + ! + ! !DESCRIPTION: + ! Assert 3-d arrays are equal + ! + ! !ARGUMENTS: + {VTYPE}, intent(in) :: expected(:,:,:) + {VTYPE}, intent(in) :: actual(:,:,:) + character(len=*), intent(in) :: msg + + ! absolute tolerance; if not specified, require exact equality; ignored for logicals + real(r8), intent(in), optional :: abs_tol + ! + ! !LOCAL VARIABLES: + integer :: i, j, k + + character(len=*), parameter :: subname = 'assert_equal_3d_{TYPE}' + !----------------------------------------------------------------------- + + if (any(shape(actual) /= shape(expected))) then + write(iulog,*) 'ERROR in assert_equal: ', msg + write(iulog,*) 'Shape mismatch:' + write(iulog,*) 'Actual shape: ', shape(actual) + write(iulog,*) 'Expected shape: ', shape(expected) + call endrun('ERROR in assert_equal') + end if + + do k = 1, size(expected, 3) + do j = 1, size(expected, 2) + do i = 1, size(expected, 1) + if (.not. vals_are_equal(actual(i,j,k), expected(i,j,k), abs_tol)) then + write(iulog,*) 'ERROR in assert_equal: ', msg + write(iulog,*) 'Data mismatch: first mismatch at index: ', i, j, k + write(iulog,*) 'Actual : ', actual(i,j,k) + write(iulog,*) 'Expected: ', expected(i,j,k) + call endrun('ERROR in assert_equal') + end if + end do + end do + end do + + end subroutine assert_equal_3d_{TYPE} + + !----------------------------------------------------------------------- + !TYPE double,int,logical + function vals_are_equal_{TYPE}(actual, expected, abs_tol) result(vals_equal) + ! + ! !DESCRIPTION: + ! Returns true if actual is the same as expected, false otherwise + ! + ! !ARGUMENTS: + logical :: vals_equal ! function result + {VTYPE}, intent(in) :: actual + {VTYPE}, intent(in) :: expected + + ! absolute tolerance; if not specified, require exact equality; ignored for logicals + real(r8), intent(in), optional :: abs_tol + ! + ! !LOCAL VARIABLES: + real(r8) :: abs_tol_loc ! local version of abs_tol + + character(len=*), parameter :: subname = 'vals_are_equal_{TYPE}' + !----------------------------------------------------------------------- + +#if ({ITYPE}==TYPELOGICAL) + vals_equal = (actual .eqv. expected) +#else + if (present(abs_tol)) then + abs_tol_loc = abs_tol + else + abs_tol_loc = 0._r8 + end if + + vals_equal = (abs(actual - expected) <= abs_tol_loc) +#endif + + end function vals_are_equal_{TYPE} + +end module Assertions diff --git a/src/self_tests/CMakeLists.txt b/src/self_tests/CMakeLists.txt new file mode 100644 index 0000000000..3a454aab2b --- /dev/null +++ b/src/self_tests/CMakeLists.txt @@ -0,0 +1,14 @@ +# Note that this is just used for unit testing; hence, we only need to add +# source files that are currently used in unit tests + +set(genf90_files + Assertions.F90.in + ) + +process_genf90_source_list("${genf90_files}" ${CMAKE_CURRENT_BINARY_DIR} clm_genf90_sources) + +sourcelist_to_parent(clm_genf90_sources) + +list(APPEND clm_sources "${clm_genf90_sources}") + +sourcelist_to_parent(clm_sources) diff --git a/src/self_tests/README b/src/self_tests/README new file mode 100644 index 0000000000..bbd4164375 --- /dev/null +++ b/src/self_tests/README @@ -0,0 +1,8 @@ +This directory contains code that is invoked only when running with +self-tests enabled. This self-test code is similar to unit tests, but is +run in the context of a full model run because it covers code that is +difficult to get into a unit test harness. As such, the tests here may +be viewed more as integration tests than unit tests. An example is tests +that cover the PIO interface, since these require building and +initializing the PIO system (which is difficult to do in our unit +testing framework). diff --git a/src/self_tests/SelfTestDriver.F90 b/src/self_tests/SelfTestDriver.F90 new file mode 100644 index 0000000000..d109a27827 --- /dev/null +++ b/src/self_tests/SelfTestDriver.F90 @@ -0,0 +1,49 @@ +module SelfTestDriver + + ! ------------------------------------------------------------------------ + ! !DESCRIPTION: + ! This module contains a top-level driver to the self-test code. + ! + ! See the README file in this directory for a high-level overview of these self-tests. + + use clm_varctl, only : for_testing_run_ncdiopio_tests + use decompMod, only : bounds_type + use TestNcdioPio, only : test_ncdio_pio + + implicit none + private + save + + ! Public routines + + public :: self_test_driver + + character(len=*), parameter, private :: sourcefile = & + __FILE__ + +contains + + !----------------------------------------------------------------------- + subroutine self_test_driver(bounds) + ! + ! !DESCRIPTION: + ! Top-level driver to the self-test code + ! + ! This subroutine should be called all the time, but each set of self tests is only + ! run if the appropriate flag is set. + ! + ! !ARGUMENTS: + type(bounds_type), intent(in) :: bounds + ! + ! !LOCAL VARIABLES: + + character(len=*), parameter :: subname = 'self_test_driver' + !----------------------------------------------------------------------- + + if (for_testing_run_ncdiopio_tests) then + call test_ncdio_pio(bounds) + end if + + end subroutine self_test_driver + +end module SelfTestDriver diff --git a/src/self_tests/TestNcdioPio.F90 b/src/self_tests/TestNcdioPio.F90 new file mode 100644 index 0000000000..3bac472950 --- /dev/null +++ b/src/self_tests/TestNcdioPio.F90 @@ -0,0 +1,509 @@ +module TestNcdioPio + + ! ------------------------------------------------------------------------ + ! !DESCRIPTION: + ! This module contains tests of ncdio_pio + +#include "shr_assert.h" + use ncdio_pio + use shr_kind_mod, only : r8 => shr_kind_r8 + use Assertions, only : assert_equal + use clm_varcon, only : nameg + use abortutils, only : endrun + use array_utils, only : convert_to_logical + use decompMod, only : bounds_type, get_proc_global + use GridcellType, only : grc + use spmdMod, only : masterproc + + implicit none + private + save + + ! Public routines + + public :: test_ncdio_pio + + ! Module data used in various tests + + integer, parameter :: nlev1 = 5 + character(len=*), parameter :: lev1_name = 'lev1' + + integer, parameter :: nlev2 = 3 + character(len=*), parameter :: lev2_name = 'lev2' + + character(len=*), parameter :: testfilename = 'test_ncdio_pio.nc' + + real(r8), pointer :: data_double_1d_grc(:) + integer, pointer :: data_int_1d_grc(:) + integer, pointer :: data_intlogical_1d_grc(:) ! only has 0 & 1 values (representing a logical) + real(r8), pointer :: data_double_2d_grc(:,:) + real(r8), pointer :: data_double_3d_grc(:,:,:) + + character(len=*), parameter, private :: sourcefile = & + __FILE__ + +contains + + !----------------------------------------------------------------------- + subroutine test_ncdio_pio(bounds) + ! + ! !DESCRIPTION: + ! Drive tests of ncdio_pio + ! + ! NOTE(wjs, 2020-10-15) Currently, endrun is called when any test assertion fails. I + ! thought about changing this so that, instead, a counter is incremented for each + ! failure, then at the end of the testing (in the higher-level self-test driver), + ! endrun is called if this counter is greater than 0. The benefit of this is that we'd + ! see all test failures, not just the first failure. To do that, we'd need to change + ! the assertions here to increment a counter rather than aborting. However, I'm not + ! spending the time to make this change for now because (1) I'm not sure how much + ! value we'd get from it; (2) even if we made that change, it's still very possible + ! for test code to abort for reasons other than assertions, if something goes wrong + ! inside ncdio_pio or pio; and (3) some tests here are dependent on earlier tests (for + ! example, the reads depend on the writes having worked), so a failure in an early + ! phase could really muck things up for later testing phases. Migrating to a + ! pFUnit-based unit test would solve this problem, since each pFUnit test is + ! independent, though would prevent us from being able to have dependent tests the + ! way we do here (where reads depend on earlier writes), for better or for worse. + ! + ! !ARGUMENTS: + type(bounds_type), intent(in) :: bounds + ! + ! !LOCAL VARIABLES: + + character(len=*), parameter :: subname = 'test_ncdio_pio' + !----------------------------------------------------------------------- + + call write_to_log(subname//': create_vars') + call create_vars(bounds) + + call write_to_log(subname//': test_write_vars') + call test_write_vars + + call write_to_log(subname//': test_check_var_or_dim') + call test_check_var_or_dim + + call write_to_log(subname//': test_read_vars') + call test_read_vars + + call write_to_log(subname//': test_read_vars_change_type') + call test_read_vars_change_type + + call clean + + end subroutine test_ncdio_pio + + !----------------------------------------------------------------------- + subroutine create_vars(bounds) + ! + ! !DESCRIPTION: + ! Create module data used in tests here + ! + ! !ARGUMENTS: + type(bounds_type), intent(in) :: bounds + ! + ! !LOCAL VARIABLES: + integer :: g + integer :: lev1, lev2 + integer :: cur_intlogical + + character(len=*), parameter :: subname = 'create_vars' + !----------------------------------------------------------------------- + + associate( & + begg => bounds%begg, & + endg => bounds%endg & + ) + + allocate(data_double_1d_grc(begg:endg)) + do g = begg, endg + data_double_1d_grc(g) = grc%latdeg(g)*1.1_r8 + end do + + allocate(data_int_1d_grc(begg:endg)) + do g = begg, endg + data_int_1d_grc(g) = int(grc%latdeg(g))*3 + end do + + ! This definition of the logical values will lead to differences based on processor + ! count. That's okay for now, but we may need to revisit this if it causes problems + ! in the future. + allocate(data_intlogical_1d_grc(begg:endg)) + cur_intlogical = 1 + do g = begg, endg + data_intlogical_1d_grc(g) = cur_intlogical + cur_intlogical = 1 - cur_intlogical + end do + + allocate(data_double_2d_grc(begg:endg, 1:nlev1)) + do lev1 = 1, nlev1 + do g = begg, endg + data_double_2d_grc(g, lev1) = grc%latdeg(g)*4.4_r8 + lev1*5.5_r8 + end do + end do + + allocate(data_double_3d_grc(begg:endg, 1:nlev1, 1:nlev2)) + do lev2 = 1, nlev2 + do lev1 = 1, nlev1 + do g = begg, endg + data_double_3d_grc(g, lev1, lev2) = grc%latdeg(g)*4.4_r8 + lev1*5.5_r8 + lev2*6.6_r8 + end do + end do + end do + + end associate + + end subroutine create_vars + + !----------------------------------------------------------------------- + subroutine test_write_vars + ! + ! !DESCRIPTION: + ! Write all variables to a test file; confirm that the variables are written and that + ! they are the expected type + ! + ! !ARGUMENTS: + ! + ! !LOCAL VARIABLES: + type(file_desc_t) :: ncid + integer :: numg + integer :: dimid + + character(len=*), parameter :: subname = 'test_write_vars' + !----------------------------------------------------------------------- + + call ncd_pio_createfile(ncid, testfilename) + + call get_proc_global(ng=numg) + call ncd_defdim(ncid, nameg, numg, dimid) + call ncd_defdim(ncid, lev1_name, nlev1, dimid) + call ncd_defdim(ncid, lev2_name, nlev2, dimid) + + ! Write latitude since many of the variables' values depend on it (in case we want to + ! double-check those values) + call ncd_defvar(ncid=ncid, varname='latdeg', xtype=ncd_double, & + dim1name=nameg, & + long_name='latitude', units='degrees') + + call ncd_defvar(ncid=ncid, varname='data_double_1d_grc', xtype=ncd_double, & + dim1name=nameg, & + long_name=' ', units=' ') + call ncd_defvar(ncid=ncid, varname='data_double_1d_grc_float', xtype=ncd_float, & + dim1name=nameg, & + long_name=' ', units=' ') + call ncd_defvar(ncid=ncid, varname='data_int_1d_grc', xtype=ncd_int, & + dim1name=nameg, & + long_name=' ', units=' ') + call ncd_defvar(ncid=ncid, varname='data_intlogical_1d_grc', xtype=ncd_int, & + dim1name=nameg, & + long_name=' ', units=' ') + call ncd_defvar(ncid=ncid, varname='data_double_2d_grc', xtype=ncd_double, & + dim1name=nameg, dim2name=lev1_name, & + long_name=' ', units=' ') + call ncd_defvar(ncid=ncid, varname='data_double_2d_grc_switchdim', xtype=ncd_double, & + dim1name=lev1_name, dim2name=nameg, & + long_name=' ', units=' ') + call ncd_defvar(ncid=ncid, varname='data_double_3d_grc', xtype=ncd_double, & + dim1name=nameg, dim2name=lev1_name, dim3name=lev2_name) + + call ncd_enddef(ncid) + + call write_to_log('Writing latdeg') + call ncd_io(varname='latdeg', data=grc%latdeg, & + dim1name=nameg, ncid=ncid, flag='write') + + call write_to_log('Writing data_double_1d_grc') + call ncd_io(varname='data_double_1d_grc', data=data_double_1d_grc, & + dim1name=nameg, ncid=ncid, flag='write') + call write_to_log('Writing data_double_1d_grc_float') + call ncd_io(varname='data_double_1d_grc_float', data=data_double_1d_grc, & + dim1name=nameg, ncid=ncid, flag='write') + call write_to_log('Writing data_int_1d_grc') + call ncd_io(varname='data_int_1d_grc', data=data_int_1d_grc, & + dim1name=nameg, ncid=ncid, flag='write') + call write_to_log('Writing data_intlogical_1d_grc') + call ncd_io(varname='data_intlogical_1d_grc', data=data_intlogical_1d_grc, & + dim1name=nameg, ncid=ncid, flag='write') + call write_to_log('Writing data_double_2d_grc') + call ncd_io(varname='data_double_2d_grc', data=data_double_2d_grc, & + dim1name=nameg, ncid=ncid, flag='write') + call write_to_log('Writing data_double_2d_grc_switchdim') + call ncd_io(varname='data_double_2d_grc_switchdim', data=data_double_2d_grc, & + dim1name=nameg, switchdim=.true., ncid=ncid, flag='write') + call write_to_log('Writing data_double_3d_grc') + call ncd_io(varname='data_double_3d_grc', data=data_double_3d_grc, & + dim1name=nameg, ncid=ncid, flag='write') + + call ncd_pio_closefile(ncid) + + call write_to_log('Confirming that all variables have been written with correct type') + call ncd_pio_openfile(ncid, testfilename, 0) + call confirm_var_on_file(ncid, 'data_double_1d_grc', ncd_double) + call confirm_var_on_file(ncid, 'data_double_1d_grc_float', ncd_float) + call confirm_var_on_file(ncid, 'data_int_1d_grc', ncd_int) + call confirm_var_on_file(ncid, 'data_intlogical_1d_grc', ncd_int) + call confirm_var_on_file(ncid, 'data_double_2d_grc', ncd_double) + call confirm_var_on_file(ncid, 'data_double_2d_grc_switchdim', ncd_double) + call confirm_var_on_file(ncid, 'data_double_3d_grc', ncd_double) + call ncd_pio_closefile(ncid) + + end subroutine test_write_vars + + !----------------------------------------------------------------------- + subroutine confirm_var_on_file(ncid, varname, expected_type) + ! + ! !DESCRIPTION: + ! Confirm that the given variable exists on the file, with the expected type + ! + ! !ARGUMENTS: + type(file_desc_t), intent(inout) :: ncid + character(len=*), intent(in) :: varname + integer, intent(in) :: expected_type + ! + ! !LOCAL VARIABLES: + logical :: readvar + integer :: vartype + type(var_desc_t) :: vardesc + + character(len=*), parameter :: subname = 'check_var_written' + !----------------------------------------------------------------------- + + call check_var(ncid, varname, readvar, vardesc=vardesc) + if (.not. readvar) then + call endrun(trim(varname)//' not found on file') + end if + + call ncd_inqvtype(ncid, vardesc, vartype) + if (vartype /= expected_type) then + call endrun(trim(varname)//' not expected type') + end if + + end subroutine confirm_var_on_file + + !----------------------------------------------------------------------- + subroutine test_check_var_or_dim() + ! + ! !DESCRIPTION: + ! Test the check_var_or_dim subroutine with variables and dimensions, returning true + ! and false + ! + ! This also covers check_var and check_dim + ! + ! !ARGUMENTS: + ! + ! !LOCAL VARIABLES: + type(file_desc_t) :: ncid + logical :: exists + + character(len=*), parameter :: var_to_check = 'data_double_1d_grc' + character(len=*), parameter :: dim_to_check = lev1_name + + character(len=*), parameter :: subname = 'test_check_var_or_dim' + !----------------------------------------------------------------------- + + call ncd_pio_openfile(ncid, testfilename, 0) + + call check_var_or_dim(ncid, var_to_check, is_dim=.false., exists=exists) + call shr_assert(exists, 'check_var_or_dim: var exists') + + ! Make sure that check_var_or_dim returns false when the given variable doesn't exist + ! - even if it is an existing dimension + call check_var_or_dim(ncid, dim_to_check, is_dim=.false., exists=exists) + call shr_assert(.not. exists, 'check_var_or_dim: var does not exist') + + call check_var_or_dim(ncid, dim_to_check, is_dim=.true., exists=exists) + call shr_assert(exists, 'check_var_or_dim: dim exists') + + ! Make sure that check_var_or_dim returns false when the given dimension doesn't + ! exist - even if it is an existing variable + call check_var_or_dim(ncid, var_to_check, is_dim=.true., exists=exists) + call shr_assert(.not. exists, 'check_var_or_dim: dim does not exist') + + call ncd_pio_closefile(ncid) + end subroutine test_check_var_or_dim + + !----------------------------------------------------------------------- + subroutine test_read_vars() + ! + ! !DESCRIPTION: + ! Test reading the variables from file into variables in memory; ensure these match + ! the originals. + ! + ! This just tests reading a variable of a given type on file into a variable of the + ! same type in memory. Tests involving type conversion happen elsewhere. + ! + ! !ARGUMENTS: + ! + ! !LOCAL VARIABLES: + type(file_desc_t) :: ncid + real(r8), pointer :: local_double_1d_grc(:) + integer, pointer :: local_int_1d_grc(:) + real(r8), pointer :: local_double_2d_grc(:,:) + real(r8), pointer :: local_double_2d_grc_switchdim(:,:) + real(r8), pointer :: local_double_3d_grc(:,:,:) + + character(len=*), parameter :: subname = 'test_read_vars' + !----------------------------------------------------------------------- + + allocate(local_double_1d_grc(size(data_double_1d_grc, 1))) + allocate(local_int_1d_grc(size(data_int_1d_grc, 1))) + allocate(local_double_2d_grc(size(data_double_2d_grc, 1), size(data_double_2d_grc, 2))) + allocate(local_double_2d_grc_switchdim(size(data_double_2d_grc, 1), size(data_double_2d_grc, 2))) + allocate(local_double_3d_grc(size(data_double_3d_grc, 1), size(data_double_3d_grc, 2), size(data_double_3d_grc, 3))) + + call ncd_pio_openfile(ncid, testfilename, 0) + + call write_to_log(subname//': Reading and comparing data_double_1d_grc') + call ncd_io(varname='data_double_1d_grc', data=local_double_1d_grc, & + dim1name=nameg, ncid=ncid, flag='read') + call assert_equal(expected=data_double_1d_grc, actual=local_double_1d_grc, & + msg='data_double_1d_grc') + + call write_to_log(subname//': Reading and comparing data_int_1d_grc') + call ncd_io(varname='data_int_1d_grc', data=local_int_1d_grc, & + dim1name=nameg, ncid=ncid, flag='read') + call assert_equal(expected=data_int_1d_grc, actual=local_int_1d_grc, & + msg='data_int_1d_grc') + + call write_to_log(subname//': Reading and comparing data_double_2d_grc') + call ncd_io(varname='data_double_2d_grc', data=local_double_2d_grc, & + dim1name=nameg, ncid=ncid, flag='read') + call assert_equal(expected=data_double_2d_grc, actual=local_double_2d_grc, & + msg='data_double_2d_grc') + + call write_to_log(subname//': Reading and comparing data_double_2d_grc_switchdim') + call ncd_io(varname='data_double_2d_grc_switchdim', data=local_double_2d_grc_switchdim, & + dim1name=nameg, switchdim=.true., ncid=ncid, flag='read') + call assert_equal(expected=data_double_2d_grc, actual=local_double_2d_grc_switchdim, & + msg='data_double_2d_grc_switchdim') + + call write_to_log(subname//': Reading and comparing data_double_3d_grc') + call ncd_io(varname='data_double_3d_grc', data=local_double_3d_grc, & + dim1name=nameg, ncid=ncid, flag='read') + call assert_equal(expected=data_double_3d_grc, actual=local_double_3d_grc, & + msg='data_double_3d_grc') + + call ncd_pio_closefile(ncid) + + deallocate(local_double_1d_grc) + deallocate(local_int_1d_grc) + deallocate(local_double_2d_grc) + deallocate(local_double_2d_grc_switchdim) + deallocate(local_double_3d_grc) + + end subroutine test_read_vars + + !----------------------------------------------------------------------- + subroutine test_read_vars_change_type() + ! + ! !DESCRIPTION: + ! Test reading some variables from file into variables in memory with different + ! types, to ensure this type conversion is done correctly. + ! + ! !ARGUMENTS: + ! + ! !LOCAL VARIABLES: + type(file_desc_t) :: ncid + real(r8), pointer :: local_double_1d_grc(:) + integer, pointer :: local_int_1d_grc(:) + logical, pointer :: local_log_1d_grc(:) + logical, allocatable :: expected_log_1d(:) + + character(len=*), parameter :: subname = 'test_read_vars_change_type' + !----------------------------------------------------------------------- + + allocate(local_double_1d_grc(size(data_double_1d_grc, 1))) + allocate(local_int_1d_grc(size(data_double_1d_grc, 1))) + allocate(local_log_1d_grc(size(data_double_1d_grc, 1))) + + call ncd_pio_openfile(ncid, testfilename, 0) + + call write_to_log(subname//': Reading float into double') + local_double_1d_grc(:) = 0._r8 + call ncd_io(varname='data_double_1d_grc_float', data=local_double_1d_grc, & + dim1name=nameg, ncid=ncid, flag='read') + call assert_equal(expected=data_double_1d_grc, actual=local_double_1d_grc, & + msg='data_double_1d_grc_float to double', abs_tol=1.e-4_r8) + + call write_to_log(subname//': Reading int into double') + local_double_1d_grc(:) = 0._r8 + call ncd_io(varname='data_int_1d_grc', data=local_double_1d_grc, & + dim1name=nameg, ncid=ncid, flag='read') + call assert_equal(expected=real(data_int_1d_grc, r8), actual=local_double_1d_grc, & + msg='data_int_1d_grc to double') + + call write_to_log(subname//': Reading double into int') + local_int_1d_grc(:) = 0._r8 + call ncd_io(varname='data_double_1d_grc', data=local_int_1d_grc, & + dim1name=nameg, ncid=ncid, flag='read') + call assert_equal(expected=int(data_double_1d_grc), actual=local_int_1d_grc, & + msg='data_double_1d_grc to int') + + call write_to_log(subname//': Reading float into int') + local_int_1d_grc(:) = 0._r8 + call ncd_io(varname='data_double_1d_grc_float', data=local_int_1d_grc, & + dim1name=nameg, ncid=ncid, flag='read') + call assert_equal(expected=int(data_double_1d_grc), actual=local_int_1d_grc, & + msg='data_double_1d_grc_float to int') + + call write_to_log(subname//': Reading int into logical') + local_log_1d_grc(:) = .false. + call ncd_io(varname='data_intlogical_1d_grc', data=local_log_1d_grc, & + dim1name=nameg, ncid=ncid, flag='read') + allocate(expected_log_1d(size(data_intlogical_1d_grc))) + call convert_to_logical(data_intlogical_1d_grc, expected_log_1d) + call assert_equal(expected=expected_log_1d, actual=local_log_1d_grc, & + msg='data_intlogical_1d_grc to logical') + + call ncd_pio_closefile(ncid) + + deallocate(local_double_1d_grc) + deallocate(local_int_1d_grc) + deallocate(local_log_1d_grc) + + end subroutine test_read_vars_change_type + + + !----------------------------------------------------------------------- + subroutine write_to_log(msg) + ! + ! !DESCRIPTION: + ! Write a message to the log file, just from the masterproc + ! + ! !ARGUMENTS: + character(len=*), intent(in) :: msg + ! + ! !LOCAL VARIABLES: + + character(len=*), parameter :: subname = 'write_to_log' + !----------------------------------------------------------------------- + + if (masterproc) then + write(*,'(a)') msg + end if + + end subroutine write_to_log + + !----------------------------------------------------------------------- + subroutine clean + ! + ! !DESCRIPTION: + ! Do end-of-testing cleanup + ! + ! !ARGUMENTS: + ! + ! !LOCAL VARIABLES: + + character(len=*), parameter :: subname = 'clean' + !----------------------------------------------------------------------- + + deallocate(data_double_1d_grc) + deallocate(data_int_1d_grc) + deallocate(data_intlogical_1d_grc) + deallocate(data_double_2d_grc) + deallocate(data_double_3d_grc) + + end subroutine clean + + +end module TestNcdioPio diff --git a/src/self_tests/test/CMakeLists.txt b/src/self_tests/test/CMakeLists.txt new file mode 100644 index 0000000000..d616310bcd --- /dev/null +++ b/src/self_tests/test/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(assertions_test) diff --git a/src/self_tests/test/README b/src/self_tests/test/README new file mode 100644 index 0000000000..a78c047628 --- /dev/null +++ b/src/self_tests/test/README @@ -0,0 +1,5 @@ +This directory contains unit tests of some utility code contained in +this self_tests directory. This is a bit confusing: the self-tests +themselves are NOT run from here (they are NOT run via the standard unit +testing infrastructure), but this directory contains some standard unit +tests of lower-level infrastructure code leveraged by the self-tests. diff --git a/src/self_tests/test/assertions_test/CMakeLists.txt b/src/self_tests/test/assertions_test/CMakeLists.txt new file mode 100644 index 0000000000..de7a0febef --- /dev/null +++ b/src/self_tests/test/assertions_test/CMakeLists.txt @@ -0,0 +1,10 @@ +set (pfunit_sources + test_assertions.pf) + +set (extra_sources + ) + +create_pFUnit_test(assertions test_assertions_exe + "${pfunit_sources}" "${extra_sources}") + +target_link_libraries(test_assertions_exe clm csm_share esmf_wrf_timemgr) diff --git a/src/self_tests/test/assertions_test/test_assertions.pf b/src/self_tests/test/assertions_test/test_assertions.pf new file mode 100644 index 0000000000..10eaaafce6 --- /dev/null +++ b/src/self_tests/test/assertions_test/test_assertions.pf @@ -0,0 +1,157 @@ +module test_assertions + + ! Tests of Assertions + + use pfunit_mod + use Assertions + use shr_kind_mod , only : r8 => shr_kind_r8 + use unittestUtils, only : endrun_msg + + implicit none + + @TestCase + type, extends(TestCase) :: TestAssertions + character(len=:), allocatable :: expected_msg ! expected error message for failures + contains + procedure :: setUp + procedure :: tearDown + end type TestAssertions + + real(r8), parameter :: tol = 1.e-13_r8 + +contains + + subroutine setUp(this) + class(TestAssertions), intent(inout) :: this + + this%expected_msg = endrun_msg('ERROR in assert_equal') + end subroutine setUp + + subroutine tearDown(this) + class(TestAssertions), intent(inout) :: this + end subroutine tearDown + + @Test + subroutine test_assertEqual_1dDouble_passes(this) + class(TestAssertions), intent(inout) :: this + real(r8) :: data1(3), data2(3) + + data1 = [1._r8, 2._r8, 3._r8] + data2 = data1 + + ! Just make sure this doesn't abort + call assert_equal(data1, data2, msg=' ') + end subroutine test_assertEqual_1dDouble_passes + + @Test + subroutine test_assertEqual_1dDouble_fails(this) + class(TestAssertions), intent(inout) :: this + real(r8) :: data1(3), data2(3) + + data1 = [1._r8, 2._r8, 3._r8] + data2 = [1._r8, 2.1_r8, 3._r8] + + call assert_equal(data1, data2, msg=' ') + @assertExceptionRaised(this%expected_msg) + end subroutine test_assertEqual_1dDouble_fails + + @Test + subroutine test_assertEqual_1dDouble_withTol_passes(this) + class(TestAssertions), intent(inout) :: this + real(r8) :: data1(3), data2(3) + + data1 = [1._r8, 2._r8, 3._r8] + data2 = [1._r8, 2.1_r8, 3._r8] + + ! Just make sure this doesn't abort + call assert_equal(data1, data2, msg=' ', abs_tol=0.11_r8) + end subroutine test_assertEqual_1dDouble_withTol_passes + + @Test + subroutine test_assertEqual_1dDouble_withTol_fails(this) + class(TestAssertions), intent(inout) :: this + real(r8) :: data1(3), data2(3) + + data1 = [1._r8, 2._r8, 3._r8] + data2 = [1._r8, 2.1_r8, 3._r8] + + call assert_equal(data1, data2, msg=' ', abs_tol=0.09_r8) + @assertExceptionRaised(this%expected_msg) + end subroutine test_assertEqual_1dDouble_withTol_fails + + @Test + subroutine test_assertEqual_1dLogical_passes(this) + class(TestAssertions), intent(inout) :: this + logical :: data1(4), data2(4) + + data1 = [.true., .false., .true., .false.] + data2 = data1 + + ! Just make sure this doesn't abort + call assert_equal(data1, data2, msg=' ') + end subroutine test_assertEqual_1dLogical_passes + + @Test + subroutine test_assertEqual_1dLogical_fails(this) + class(TestAssertions), intent(inout) :: this + logical :: data1(4), data2(4) + + data1 = [.true., .false., .true., .false.] + data2 = [.true., .true. , .true., .false.] + + call assert_equal(data1, data2, msg=' ') + @assertExceptionRaised(this%expected_msg) + end subroutine test_assertEqual_1dLogical_fails + + @Test + subroutine test_assertEqual_2dDouble_passes(this) + class(TestAssertions), intent(inout) :: this + real(r8) :: data1(3,2), data2(3,2) + + data1 = reshape([1._r8, 2._r8, 3._r8, 4._r8, 5._r8, 6._r8], [3, 2]) + data2 = data1 + + ! Just make sure this doesn't abort + call assert_equal(data1, data2, msg=' ') + end subroutine test_assertEqual_2dDouble_passes + + @Test + subroutine test_assertEqual_2dDouble_fails(this) + class(TestAssertions), intent(inout) :: this + real(r8) :: data1(3,2), data2(3,2) + + data1 = reshape([1._r8, 2._r8, 3._r8, 4._r8, 5._r8, 6._r8], [3, 2]) + data2 = reshape([1._r8, 2._r8, 3._r8, 4._r8, 5.1_r8, 6._r8], [3, 2]) + + call assert_equal(data1, data2, msg=' ') + @assertExceptionRaised(this%expected_msg) + end subroutine test_assertEqual_2dDouble_fails + + @Test + subroutine test_assertEqual_3dDouble_passes(this) + class(TestAssertions), intent(inout) :: this + real(r8) :: data1(4,3,2), data2(4,3,2) + integer :: i + + data1 = reshape([(real(i, r8), i = 1, 24)], [4, 3, 2]) + data2 = data1 + + ! Just make sure this doesn't abort + call assert_equal(data1, data2, msg=' ') + end subroutine test_assertEqual_3dDouble_passes + + @Test + subroutine test_assertEqual_3dDouble_fails(this) + class(TestAssertions), intent(inout) :: this + real(r8) :: data1(4,3,2), data2(4,3,2) + integer :: i + + data1 = reshape([(real(i, r8), i = 1, 24)], [4, 3, 2]) + data2 = data1 + data2(3,2,2) = data2(3,2,2) + 0.1_r8 + + call assert_equal(data1, data2, msg=' ') + @assertExceptionRaised(this%expected_msg) + end subroutine test_assertEqual_3dDouble_fails + +end module test_assertions diff --git a/src/unit_test_shr/CMakeLists.txt b/src/unit_test_shr/CMakeLists.txt index d0172f5931..9bf95c728f 100644 --- a/src/unit_test_shr/CMakeLists.txt +++ b/src/unit_test_shr/CMakeLists.txt @@ -2,7 +2,7 @@ set(genf90_files unittestArrayMod.F90.in ) -process_genf90_source_list("${genf90_files}" ${CMAKE_CURRENT_SOURCE_DIR} clm_genf90_sources) +process_genf90_source_list("${genf90_files}" ${CMAKE_CURRENT_BINARY_DIR} clm_genf90_sources) sourcelist_to_parent(clm_genf90_sources) diff --git a/src/unit_test_shr/unittestWaterTypeFactory.F90 b/src/unit_test_shr/unittestWaterTypeFactory.F90 index 05d8ae1c0c..cc3510e881 100644 --- a/src/unit_test_shr/unittestWaterTypeFactory.F90 +++ b/src/unit_test_shr/unittestWaterTypeFactory.F90 @@ -23,7 +23,7 @@ module unittestWaterTypeFactory #include "shr_assert.h" use shr_kind_mod , only : r8 => shr_kind_r8 - use clm_varpar, only : nlevsoi, nlevgrnd, nlevsno + use clm_varpar, only : nlevsoi, nlevgrnd, nlevmaxurbgrnd, nlevsno use ColumnType, only : col use WaterType, only : water_type, water_params_type use unittestArrayMod, only : col_array @@ -66,6 +66,7 @@ subroutine setup_before_subgrid(this, my_nlevsoi, nlevgrnd_additional, my_nlevsn nlevsoi = my_nlevsoi nlevgrnd = nlevsoi + nlevgrnd_additional + nlevmaxurbgrnd = nlevgrnd nlevsno = my_nlevsno end subroutine setup_before_subgrid diff --git a/src/unit_test_stubs/main/CMakeLists.txt b/src/unit_test_stubs/main/CMakeLists.txt index b98156b5d0..e66a71488c 100644 --- a/src/unit_test_stubs/main/CMakeLists.txt +++ b/src/unit_test_stubs/main/CMakeLists.txt @@ -3,7 +3,7 @@ set(genf90_files ncdio_var.F90.in ) -process_genf90_source_list("${genf90_files}" ${CMAKE_CURRENT_SOURCE_DIR} clm_genf90_sources) +process_genf90_source_list("${genf90_files}" ${CMAKE_CURRENT_BINARY_DIR} clm_genf90_sources) sourcelist_to_parent(clm_genf90_sources) diff --git a/src/unit_test_stubs/main/ncdio_pio_fake.F90.in b/src/unit_test_stubs/main/ncdio_pio_fake.F90.in index 2fa421051d..45dcd90ba3 100644 --- a/src/unit_test_stubs/main/ncdio_pio_fake.F90.in +++ b/src/unit_test_stubs/main/ncdio_pio_fake.F90.in @@ -46,6 +46,7 @@ module ncdio_pio ! !PUBLIC MEMBER FUNCTIONS: public :: check_var ! determine if variable is on netcdf file + public :: check_var_or_dim ! determine if variable or dimension is on netcdf file public :: ncd_io ! do fake i/o (currently only set up to read) public :: ncd_inqvid ! inquire on a variable id public :: ncd_set_var ! set data on "file" for one variable @@ -270,28 +271,57 @@ contains end subroutine ncd_inqvid !----------------------------------------------------------------------- - subroutine check_var(ncid, varname, vardesc, readvar, print_err) + subroutine check_var(ncid, varname, readvar, vardesc, print_err) ! ! !DESCRIPTION: ! Fake to check if variable is on netcdf file ! ! !ARGUMENTS: - class(file_desc_t) , intent(inout) :: ncid ! PIO file descriptor - character(len=*) , intent(in) :: varname ! Varible name to check - type(Var_desc_t) , intent(out) :: vardesc ! Output variable descriptor (not set in this implementation) - logical , intent(out) :: readvar ! If variable exists or not - logical, optional , intent(in) :: print_err ! If should print about error (ignored in this implementation) + class(file_desc_t) , intent(inout) :: ncid ! PIO file descriptor + character(len=*) , intent(in) :: varname ! Varible name to check + logical , intent(out) :: readvar ! If variable exists or not + type(Var_desc_t) , optional, intent(out) :: vardesc ! Output variable descriptor (not set in this implementation) + logical , optional, intent(in) :: print_err ! If should print about error (ignored in this implementation) ! ! !LOCAL VARIABLES: integer :: varid + type(Var_desc_t) :: vardesc_local character(len=*), parameter :: subname = 'check_var' !----------------------------------------------------------------------- - call ncd_inqvid(ncid, varname, varid, vardesc, readvar) + call ncd_inqvid(ncid, varname, varid, vardesc_local, readvar) end subroutine check_var + !----------------------------------------------------------------------- + subroutine check_var_or_dim(ncid, name, is_dim, exists) + ! + ! !DESCRIPTION: + ! Fake to check if variable or dimension is on netcdf file + ! + ! NOTE: dimension check currently not implemented! + ! + ! !ARGUMENTS: + class(file_desc_t) , intent(inout) :: ncid ! PIO file descriptor + character(len=*) , intent(in) :: name ! variable or dimension name to check + logical , intent(in) :: is_dim ! if true, check for dimension; if false, check for variable + logical , intent(out) :: exists ! whether the given variable or dimension exists on file + ! + ! !LOCAL VARIABLES: + + character(len=*), parameter :: subname = 'check_var_or_dim' + !----------------------------------------------------------------------- + + if (is_dim) then + call endrun(subname//': is_dim=.true. not yet implemented') + else + call check_var(ncid, name, exists, print_err=.false.) + end if + + end subroutine check_var_or_dim + + !----------------------------------------------------------------------- subroutine ncd_inqdid(ncid, name, dimid, dimexist) ! diff --git a/src/unit_test_stubs/utils/CMakeLists.txt b/src/unit_test_stubs/utils/CMakeLists.txt index dc48aa9225..25f7c0c29f 100644 --- a/src/unit_test_stubs/utils/CMakeLists.txt +++ b/src/unit_test_stubs/utils/CMakeLists.txt @@ -2,7 +2,7 @@ set(genf90_files restUtilMod_stub.F90.in ) -process_genf90_source_list("${genf90_files}" ${CMAKE_CURRENT_SOURCE_DIR} clm_genf90_sources) +process_genf90_source_list("${genf90_files}" ${CMAKE_CURRENT_BINARY_DIR} clm_genf90_sources) sourcelist_to_parent(clm_genf90_sources) diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt index 47a2417c02..653fa9bb47 100644 --- a/src/utils/CMakeLists.txt +++ b/src/utils/CMakeLists.txt @@ -5,7 +5,7 @@ set(genf90_files array_utils.F90.in ) -process_genf90_source_list("${genf90_files}" ${CMAKE_CURRENT_SOURCE_DIR} clm_genf90_sources) +process_genf90_source_list("${genf90_files}" ${CMAKE_CURRENT_BINARY_DIR} clm_genf90_sources) sourcelist_to_parent(clm_genf90_sources) diff --git a/src/utils/array_utils.F90.in b/src/utils/array_utils.F90.in index 1152e9bc7c..4e20b602d5 100644 --- a/src/utils/array_utils.F90.in +++ b/src/utils/array_utils.F90.in @@ -12,8 +12,9 @@ module array_utils ! ! !USES: #include "shr_assert.h" - use shr_kind_mod, only : r8 => shr_kind_r8, i4=>shr_kind_i4 - use abortutils , only : endrun + use shr_kind_mod, only : r8 => shr_kind_r8, r4 => shr_kind_r4, i4=>shr_kind_i4 + use shr_log_mod , only : errMsg => shr_log_errMsg + use shr_sys_mod , only : shr_sys_abort implicit none private @@ -22,14 +23,23 @@ module array_utils ! Public routines public :: find_k_max_indices ! returns the indices of the maximum k values in data, in sorted order + public :: convert_to_logical ! convert a numeric array to logical array public :: transpose_wrapper ! wrap the intrinsic transpose function, first allocating the destination array public :: pack_wrapper ! wrap the intrinsic pack function, first allocating the destination array + interface convert_to_logical + !DIMS 1,2,3 + !TYPE double,real,int + module procedure convert_to_logical_{DIMS}d_{TYPE} + end interface convert_to_logical + interface transpose_wrapper !TYPE int,double module procedure transpose_wrapper_{TYPE} end interface transpose_wrapper + character(len=*), parameter, private :: sourcefile = & + __FILE__ contains !----------------------------------------------------------------------- @@ -60,7 +70,7 @@ contains SHR_ASSERT_FL((size(max_indices) == k), subname, __LINE__) if (k < 1 .or. k > size(data)) then - call endrun(subname//': must have 1 <= k <= size(data)') + call shr_sys_abort(subname//': must have 1 <= k <= size(data)') end if max_indices(:) = lb - 1 @@ -92,6 +102,33 @@ contains end subroutine find_k_max_indices + !----------------------------------------------------------------------- + !DIMS 1,2,3 + !TYPE double,real,int + subroutine convert_to_logical_{DIMS}d_{TYPE}(data_numeric, data_logical) + ! + ! !DESCRIPTION: + ! Convert a numeric variable to logical + ! + ! !ARGUMENTS: + {VTYPE}, intent(in) :: data_numeric{DIMSTR} + logical, intent(out) :: data_logical{DIMSTR} + ! + ! !LOCAL VARIABLES: + + character(len=*), parameter :: subname = 'convert_to_logical_{DIMS}d_{TYPE}' + !----------------------------------------------------------------------- + + if (any(data_numeric /= 0 .and. data_numeric /= 1)) then + call shr_sys_abort('convert_to_logical: bad value(s) for logical data') + end if + + where (data_numeric == 1) + data_logical = .true. + elsewhere + data_logical = .false. + end where + end subroutine convert_to_logical_{DIMS}d_{TYPE} !----------------------------------------------------------------------- !TYPE int,double diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 1d1ee04baf..d0609b85e2 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -1730,7 +1730,6 @@ subroutine wrap_btran(this,nc,fn,filterc,soilstate_inst, & t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) h2osoi_liqvol => waterdiagnosticbulk_inst%h2osoi_liqvol_col , & ! Input: [real(r8) (:,:) ] liquid volumetric moisture, will be used for BeTR btran => energyflux_inst%btran_patch , & ! Output: [real(r8) (:) ] transpiration wetness factor (0 to 1) - btran2 => energyflux_inst%btran2_patch , & ! Output: [real(r8) (:) ] rresis => energyflux_inst%rresis_patch , & ! Output: [real(r8) (:,:) ] root resistance by layer (0-1) (nlevgrnd) rootr => soilstate_inst%rootr_patch & ! Output: [real(r8) (:,:) ] Fraction of water uptake in each layer ) @@ -1823,8 +1822,8 @@ subroutine wrap_btran(this,nc,fn,filterc,soilstate_inst, & ! Convert output BC's ! For CLM/ALM this wrapper provides return variables that should ! be similar to that of calc_root_moist_stress(). However, - ! CLM/ALM-FATES simulations will no make use of rresis, btran or btran2 - ! outside of FATES. We do not have code in place to calculate btran2 or + ! CLM/ALM-FATES simulations will no make use of rresis or btran + ! outside of FATES. We do not have code in place to calculate or ! rresis right now, so we force to bad. We have btran calculated so we ! pass it in case people want diagnostics. rootr is actually the only ! variable that will be used, as it is needed to help distribute the @@ -1844,7 +1843,6 @@ subroutine wrap_btran(this,nc,fn,filterc,soilstate_inst, & ! it should not thought of as valid output until we decide to. rootr(p,j) = this%fates(nc)%bc_out(s)%rootr_pasl(ifp,j) btran(p) = this%fates(nc)%bc_out(s)%btran_pa(ifp) - btran2(p) = -999.9 ! Not available, force to nonsense end do end do diff --git a/src/utils/dtypes.h b/src/utils/dtypes.h deleted file mode 100644 index 977e95ad75..0000000000 --- a/src/utils/dtypes.h +++ /dev/null @@ -1,6 +0,0 @@ -#define TYPEDOUBLE 102 -#define TYPEINT 103 -#define TYPETEXT 100 -#define TYPELONG 104 -#define TYPEREAL 101 -#define TYPELOGICAL 105 diff --git a/src/utils/point_of_interest.F90 b/src/utils/point_of_interest.F90 new file mode 100644 index 0000000000..363f9dc687 --- /dev/null +++ b/src/utils/point_of_interest.F90 @@ -0,0 +1,91 @@ +module point_of_interest + + !----------------------------------------------------------------------- + ! !DESCRIPTION: + ! This module contains logical functions to find point(s) of interest in CTSM. Note the + ! abbreviation: p.o.i = point of interest. + ! + ! The idea is: It is common, when debugging, to want to print the values of various + ! variables for all patches or columns of certain landunit types within a certain grid + ! cell of interest. This module helps create the logical functions needed to do this. + ! + ! This module is compiled into every CTSM build, but is not invoked by default. To use + ! it: + ! + ! (1) Customize the code here by changing the functions below and/or adding new + ! functions. Look for comments about "customize" to see what to customize. + ! + ! (2) Add calls in the code + ! + ! Its typical use will be something like: + ! + ! do fc = 1, num_nolakec + ! c = filter_nolakec(fc) + ! + ! ! Various code here, maybe setting foo and bar variables + ! + ! if (poi_c(c)) then + ! write(iulog,*) 'DEBUG: foo, bar = ', foo(c), bar(c) + ! end if + ! end do + ! + ! !USES: + use GridcellType, only : grc + use LandunitType, only : lun + use ColumnType, only : col + use shr_kind_mod , only : r8 => shr_kind_r8 + use landunit_varcon, only : istsoil + + implicit none + save + private + + ! Customize: can define other levels like poi_p, etc. + public :: poi_c + +contains + + !----------------------------------------------------------------------- + logical function poi_c(c) + ! This function can be used in a column-level loop to find columns with a given + ! landunit type(s) within the grid cell(s) of interest. + integer, intent(in) :: c + + integer :: g, l + !----------------------------------------------------------------------- + + g = col%gridcell(c) + l = col%landunit(c) + + poi_c = .false. + + ! Customize this conditional; it is currently set up to flag columns in the natural + ! vegetated landunit (istsoil) of the target grid cell(s). + if (at_poi(g) .and. lun%itype(l) == istsoil) then + poi_c = .true. + end if + + end function poi_c + + !----------------------------------------------------------------------- + logical function at_poi(g) + integer, intent(in) :: g + + ! Customize these parameters (adding more blocks if necessary). These give the + ! longitude and latitude of the grid cell of interest. + real(r8), parameter :: poi_lon = 237.5_r8 + real(r8), parameter :: poi_lat = -72.94737_r8 + + real(r8), parameter :: poi_tol = 0.01_r8 ! tolerance on check of lat/lon + !----------------------------------------------------------------------- + + if ( abs(grc%londeg(g) - poi_lon) < poi_tol .and. & + abs(grc%latdeg(g) - poi_lat) < poi_tol) then + at_poi = .true. + else + at_poi = .false. + end if + + end function at_poi + +end module point_of_interest diff --git a/src/utils/restUtilMod.F90.in b/src/utils/restUtilMod.F90.in index f95c54f373..ea8b8ff84d 100644 --- a/src/utils/restUtilMod.F90.in +++ b/src/utils/restUtilMod.F90.in @@ -120,7 +120,7 @@ contains call shr_string_listGetName(varname, 1, primary_varname) if (flag == 'read') then - call find_var_on_file(ncid, varname, my_varname) + call find_var_on_file(ncid, varname, is_dim=.false., varname_on_file=my_varname) if ((my_varname /= primary_varname) .and. masterproc) then write(iulog,*) 'Restart file backwards compatibility: Translating: ', & trim(my_varname), ' => ', trim(primary_varname) @@ -256,7 +256,7 @@ contains call shr_string_listGetName(varname, 1, primary_varname) if (flag == 'read') then - call find_var_on_file(ncid, varname, my_varname) + call find_var_on_file(ncid, varname, is_dim=.false., varname_on_file=my_varname) if ((my_varname /= primary_varname) .and. masterproc) then write(iulog,*) 'Restart file backwards compatibility: Translating: ', & trim(my_varname), ' => ', trim(primary_varname) @@ -405,7 +405,7 @@ contains call shr_string_listGetName(varname, 1, primary_varname) if (flag == 'read') then - call find_var_on_file(ncid, varname, my_varname) + call find_var_on_file(ncid, varname, is_dim=.false., varname_on_file=my_varname) if ((my_varname /= primary_varname) .and. masterproc) then write(iulog,*) 'Restart file backwards compatibility: Translating: ', & trim(my_varname), ' => ', trim(primary_varname) diff --git a/src/utils/test/array_utils_test/CMakeLists.txt b/src/utils/test/array_utils_test/CMakeLists.txt index 46825df90a..11cbd47e5a 100644 --- a/src/utils/test/array_utils_test/CMakeLists.txt +++ b/src/utils/test/array_utils_test/CMakeLists.txt @@ -1,5 +1,7 @@ set (pfunit_sources - test_find_k_max_indices.pf) + test_find_k_max_indices.pf + test_convert_to_logical.pf + ) set (extra_sources ) diff --git a/src/utils/test/array_utils_test/test_convert_to_logical.pf b/src/utils/test/array_utils_test/test_convert_to_logical.pf new file mode 100644 index 0000000000..6e726d443a --- /dev/null +++ b/src/utils/test/array_utils_test/test_convert_to_logical.pf @@ -0,0 +1,94 @@ +module test_convert_to_logical + + ! Tests of array_utils: convert_to_logical + + use pfunit_mod + use array_utils + use shr_kind_mod , only : r8 => shr_kind_r8 + use unittestUtils, only : endrun_msg + + implicit none + + @TestCase + type, extends(TestCase) :: TestCTL + character(len=:), allocatable :: expected_msg ! expected error message for failures + contains + procedure :: setUp + procedure :: tearDown + end type TestCTL + + real(r8), parameter :: tol = 1.e-13_r8 + +contains + + subroutine setUp(this) + class(TestCTL), intent(inout) :: this + + this%expected_msg = endrun_msg('convert_to_logical: bad value(s) for logical data') + end subroutine setUp + + subroutine tearDown(this) + class(TestCTL), intent(inout) :: this + end subroutine tearDown + + @Test + subroutine test_convertToLogical_2dint(this) + class(TestCTL), intent(inout) :: this + integer :: my_int(2,3) + logical :: my_log(2,3) + logical :: expected(2,3) + + my_int = reshape([0,1,0,1,0,1], [2,3]) + expected = reshape([.false., .true., .false., .true., .false., .true.], [2, 3]) + + call convert_to_logical(my_int, my_log) + + ! assertEquivalent only handles 1-d arrays, so we need to reshape the 2-d arrays to + ! be 1-d for this comparison + @assertEquivalent(reshape(expected, [6]), reshape(my_log, [6])) + end subroutine test_convertToLogical_2dint + + @Test + subroutine test_convertToLogical_2ddouble(this) + class(TestCTL), intent(inout) :: this + real(r8) :: my_double(2,3) + logical :: my_log(2,3) + logical :: expected(2,3) + + my_double = reshape([0.,1.,0.,1.,0.,1.], [2,3]) + expected = reshape([.false., .true., .false., .true., .false., .true.], [2, 3]) + + call convert_to_logical(my_double, my_log) + + ! assertEquivalent only handles 1-d arrays, so we need to reshape the 2-d arrays to + ! be 1-d for this comparison + @assertEquivalent(reshape(expected, [6]), reshape(my_log, [6])) + end subroutine test_convertToLogical_2ddouble + + @Test + subroutine test_convertToLogical_2dint_fails(this) + class(TestCTL), intent(inout) :: this + integer :: my_int(2,3) + logical :: my_log(2,3) + + my_int = reshape([0,1,2,1,0,1], [2,3]) + + call convert_to_logical(my_int, my_log) + + @assertExceptionRaised(this%expected_msg) + end subroutine test_convertToLogical_2dint_fails + + @Test + subroutine test_convertToLogical_2ddouble_fails(this) + class(TestCTL), intent(inout) :: this + real(r8) :: my_double(2,3) + logical :: my_log(2,3) + + my_double = reshape([0.,1.,0.1,1.,0.,1.], [2,3]) + + call convert_to_logical(my_double, my_log) + + @assertExceptionRaised(this%expected_msg) + end subroutine test_convertToLogical_2ddouble_fails + +end module test_convert_to_logical diff --git a/tools/contrib/SpinupStability.ncl b/tools/contrib/SpinupStability.ncl index 9f0eb30302..e8d0a61ba9 100644 --- a/tools/contrib/SpinupStability.ncl +++ b/tools/contrib/SpinupStability.ncl @@ -81,9 +81,9 @@ begin end if if (annual_hist) then - fls = systemfunc("ls " + data_dir + caseid+".clm2.h0.*-*-*-*"+".nc") + fls = systemfunc("ls " + data_dir + caseid+".clm?.h0.*-*-*-*"+".nc") else - fls = systemfunc("ls " + data_dir + caseid+".clm2.h0.*-*"+".nc") + fls = systemfunc("ls " + data_dir + caseid+".clm?.h0.*-*"+".nc") end if flsdims = dimsizes(fls) diff --git a/tools/contrib/run_clm_historical b/tools/contrib/run_clm_historical index d161f1c43b..cd293d5867 100755 --- a/tools/contrib/run_clm_historical +++ b/tools/contrib/run_clm_historical @@ -125,7 +125,7 @@ while ($DONE_RUNA == 0) set DONE_RUNA = 1 echo '1850-1870 run is complete' while ($DONE_ARCHIVE == 0) - set nh0 = `ls -l $WDIR/*clm2.h0.* | egrep -c '^-'` + set nh0 = `ls -l $WDIR/*clm?.h0.* | egrep -c '^-'` echo $nh0 if ($nh0 == 1) then set DONE_ARCHIVE = 1 @@ -177,7 +177,7 @@ while ($DONE_RUNA == 0) set DONE_RUNA = 1 echo '1850-1900 run is complete' while ($DONE_ARCHIVE == 0) - set nh0 = `ls -l $WDIR/*clm2.h0.* | egrep -c '^-'` + set nh0 = `ls -l $WDIR/*clm?.h0.* | egrep -c '^-'` echo $nh0 if ($nh0 == 1) then set DONE_ARCHIVE = 1 @@ -242,7 +242,7 @@ while ($DONE_RUNA == 0) set DONE_RUNA = 1 echo '1901-1989 run is complete' while ($DONE_ARCHIVE == 0) - set nh0 = `ls -l $WDIR/*clm2.h0.* | egrep -c '^-'` + set nh0 = `ls -l $WDIR/*clm?.h0.* | egrep -c '^-'` echo $nh0 if ($nh0 == 1) then set DONE_ARCHIVE = 1 @@ -295,7 +295,7 @@ while ($DONE_RUNA == 0) set DONE_RUNA = 1 echo '1989-2004 run is complete' while ($DONE_ARCHIVE == 0) - set nh0 = `ls -l $WDIR/*clm2.h0.* | egrep -c '^-'` + set nh0 = `ls -l $WDIR/*clm?.h0.* | egrep -c '^-'` echo $nh0 if ($nh0 == 1) then set DONE_ARCHIVE = 1 @@ -349,7 +349,7 @@ while ($DONE_RUNA == 0) set DONE_RUNA = 1 echo '2005-2014 run is complete' while ($DONE_ARCHIVE == 0) - set nh0 = `ls -l $WDIR/*clm2.h0.* | egrep -c '^-'` + set nh0 = `ls -l $WDIR/*clm?.h0.* | egrep -c '^-'` echo $nh0 if ($nh0 == 1) then set DONE_ARCHIVE = 1 diff --git a/tools/mksurfdata_map/mksurfdata_map.namelist b/tools/mksurfdata_map/mksurfdata_map.namelist index fe375e6d98..8a3b697758 100644 --- a/tools/mksurfdata_map/mksurfdata_map.namelist +++ b/tools/mksurfdata_map/mksurfdata_map.namelist @@ -41,7 +41,7 @@ outnc_double = .true. all_urban = .false. no_inlandwet = .true. - mksrf_furban = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/mksrf_urban_0.05x0.05_simyr2000.c120621.nc' + mksrf_furban = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/mksrf_urban_0.05x0.05_simyr2000.c170724.nc' mksrf_fvegtyp = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/pftcftlandusedynharv.0.25x0.25.MODIS.simyr1850-2015.c170412/mksrf_landuse_histclm50_LUH2_2000.c170412.nc' mksrf_fhrvtyp = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/pftcftlandusedynharv.0.25x0.25.MODIS.simyr1850-2015.c170412/mksrf_landuse_histclm50_LUH2_2000.c170412.nc' mksrf_fsoicol = '/glade/p/cesm/cseg/inputdata/lnd/clm2/rawdata/pftcftlandusedynharv.0.25x0.25.MODIS.simyr1850-2015.c170412/mksrf_soilcolor_simyr2005.c170413.nc' diff --git a/tools/mksurfdata_map/src/mkfileMod.F90 b/tools/mksurfdata_map/src/mkfileMod.F90 index d332781223..43bdda4c12 100644 --- a/tools/mksurfdata_map/src/mkfileMod.F90 +++ b/tools/mksurfdata_map/src/mkfileMod.F90 @@ -8,9 +8,9 @@ subroutine mkfile(domain, fname, harvdata, dynlanduse) use shr_kind_mod , only : r8 => shr_kind_r8 use shr_sys_mod , only : shr_sys_getenv use fileutils , only : get_filename - use mkvarpar , only : nlevsoi, nlevurb, numrad, numstdpft + use mkvarpar , only : nlevsoi, numrad, numstdpft use mkvarctl - use mkurbanparMod, only : numurbl + use mkurbanparMod, only : numurbl, nlevurb use mkglcmecMod , only : nglcec use mkpftMod , only : mkpftAtt use mksoilMod , only : mksoilAtt diff --git a/tools/mksurfdata_map/src/mkurbanparMod.F90 b/tools/mksurfdata_map/src/mkurbanparMod.F90 index f2fad63316..1733155b50 100644 --- a/tools/mksurfdata_map/src/mkurbanparMod.F90 +++ b/tools/mksurfdata_map/src/mkurbanparMod.F90 @@ -14,6 +14,7 @@ module mkurbanparMod ! !USES: use shr_kind_mod, only : r8 => shr_kind_r8 use shr_sys_mod , only : shr_sys_flush + use mkvarctl, only : ispval implicit none private @@ -29,8 +30,10 @@ module mkurbanparMod ! !PUBLIC DATA MEMBERS: integer :: numurbl ! number of urban classes + integer :: nlevurb = ispval ! number of urban layers public :: numurbl + public :: nlevurb ! !PRIVATE DATA MEMBERS: ! flag to indicate nodata for index variables in output file: @@ -80,6 +83,8 @@ subroutine mkurbanInit(datfname) call check_ret(nf_open(datfname, 0, ncid), subname) call check_ret(nf_inq_dimid (ncid, 'density_class', dimid), subname) call check_ret(nf_inq_dimlen (ncid, dimid, numurbl), subname) + call check_ret(nf_inq_dimid (ncid, 'nlevurb', dimid), subname) + call check_ret(nf_inq_dimlen (ncid, dimid, nlevurb), subname) call check_ret(nf_close(ncid), subname) end subroutine mkurbanInit diff --git a/tools/mksurfdata_map/src/mkvarctl.F90 b/tools/mksurfdata_map/src/mkvarctl.F90 index 8c8172c22d..cebfc6a5e3 100644 --- a/tools/mksurfdata_map/src/mkvarctl.F90 +++ b/tools/mksurfdata_map/src/mkvarctl.F90 @@ -17,6 +17,7 @@ module mkvarctl save ! real(r8), public, parameter :: spval = 1.e36 ! special value + integer, public, parameter :: ispval = -9999 ! special value logical, public :: outnc_large_files ! output files in 64-bit format for large files logical, public :: outnc_double ! output ALL data in files as 64-bit diff --git a/tools/mksurfdata_map/src/mkvarpar.F90 b/tools/mksurfdata_map/src/mkvarpar.F90 index ffcdac92d0..a8a01d2da2 100644 --- a/tools/mksurfdata_map/src/mkvarpar.F90 +++ b/tools/mksurfdata_map/src/mkvarpar.F90 @@ -20,7 +20,6 @@ module mkvarpar integer, parameter :: numstdpft = 16! number of standard PFT types integer, parameter :: numstdcft = 2 ! of the number of standard PFT types, how many are crop (CFT) integer, parameter :: noveg = 0 ! value for non-vegetated pft - integer, parameter :: nlevurb = 5 ! number of urban layers integer, parameter :: numsolar = 2 ! number of solar types (Direct,Diffuse) integer, parameter :: numrad = 2 ! number of solar bands (VIS,NIR) real(r8),parameter :: elev_thresh = 2600._r8 ! elevation threshold for screening urban areas