From 3868bdccb30c8d85042c8f0869cbbabf8e62d4c1 Mon Sep 17 00:00:00 2001 From: John Alex Date: Wed, 21 Jun 2023 11:16:14 -0600 Subject: [PATCH 001/158] Document that fincl1 maps to 'h0' history file. And fexcl1. --- src/main/histFileMod.F90 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/histFileMod.F90 b/src/main/histFileMod.F90 index 2497a14667..b6bda0cea6 100644 --- a/src/main/histFileMod.F90 +++ b/src/main/histFileMod.F90 @@ -90,6 +90,7 @@ module histFileMod character(len=max_namlen+2), public :: & hist_fincl1(max_flds) = ' ' ! namelist: list of fields to include in history tape 1 + ! aka 'h0' history file. character(len=max_namlen+2), public :: & hist_fincl2(max_flds) = ' ' ! namelist: list of fields to include in history tape 2 character(len=max_namlen+2), public :: & @@ -115,6 +116,7 @@ module histFileMod character(len=max_namlen+2), public :: & hist_fexcl1(max_flds) = ' ' ! namelist: list of fields to exclude from history tape 1 + ! aka 'h0' history file. character(len=max_namlen+2), public :: & hist_fexcl2(max_flds) = ' ' ! namelist: list of fields to exclude from history tape 2 character(len=max_namlen+2), public :: & From 4edaa461a4cbd56bf98c5014aa85b9cd84e7fe3c Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Wed, 26 Jun 2024 14:21:18 -0600 Subject: [PATCH 002/158] move from depricated shr_file to shr_log --- src/cpl/nuopc/lnd_comp_nuopc.F90 | 37 ++++++++++++++++---------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/src/cpl/nuopc/lnd_comp_nuopc.F90 b/src/cpl/nuopc/lnd_comp_nuopc.F90 index 3852a1bf1b..7fe93454ac 100644 --- a/src/cpl/nuopc/lnd_comp_nuopc.F90 +++ b/src/cpl/nuopc/lnd_comp_nuopc.F90 @@ -29,7 +29,7 @@ module lnd_comp_nuopc use NUOPC_Model , only : NUOPC_ModelGet use shr_kind_mod , only : r8 => shr_kind_r8, cl=>shr_kind_cl use shr_sys_mod , only : shr_sys_abort - use shr_file_mod , only : shr_file_getlogunit, shr_file_setlogunit + use shr_log_mod , only : shr_log_setLogUnit, shr_log_getLogUnit use shr_orb_mod , only : shr_orb_decl, shr_orb_params, SHR_ORB_UNDEF_REAL, SHR_ORB_UNDEF_INT use shr_cal_mod , only : shr_cal_noleap, shr_cal_gregorian, shr_cal_ymd2date use spmdMod , only : masterproc, mpicom, spmd_init @@ -66,7 +66,7 @@ module lnd_comp_nuopc private :: clm_orbital_init ! Initialize the orbital information private :: clm_orbital_update ! Update the orbital information private :: CheckImport - + !-------------------------------------------------------------------------- ! Private module data !-------------------------------------------------------------------------- @@ -333,8 +333,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) !---------------------------------------------------------------------------- ! reset shr logging to original values !---------------------------------------------------------------------------- - - call shr_file_setLogUnit (shrlogunit) + call shr_log_setLogUnit(shrlogunit) call ESMF_LogWrite(subname//' done', ESMF_LOGMSG_INFO) end subroutine InitializeAdvertise @@ -497,8 +496,8 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) ! Reset shr logging to my log file !---------------------------------------------------------------------------- - call shr_file_getLogUnit (shrlogunit) - call shr_file_setLogUnit (iulog) + call shr_log_getLogUnit (shrlogunit) + call shr_log_setLogUnit (iulog) #if (defined _MEMTRACE) if (masterproc) then lbnum=1 @@ -683,7 +682,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return endif - call shr_file_setLogUnit (shrlogunit) + call shr_log_setLogUnit (shrlogunit) #if (defined _MEMTRACE) if(masterproc) then @@ -774,8 +773,8 @@ subroutine ModelAdvance(gcomp, rc) ! Reset share log units !-------------------------------- - call shr_file_getLogUnit (shrlogunit) - call shr_file_setLogUnit (iulog) + call shr_log_getLogUnit (shrlogunit) + call shr_log_setLogUnit (iulog) #if (defined _MEMTRACE) if(masterproc) then @@ -864,7 +863,7 @@ subroutine ModelAdvance(gcomp, rc) rstwr = .false. if (nlend .and. write_restart_at_endofrun) then rstwr = .true. - else + else call ESMF_ClockGetAlarm(clock, alarmname='alarm_restart', alarm=alarm, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return if (ESMF_AlarmIsCreated(alarm, rc=rc)) then @@ -964,7 +963,7 @@ subroutine ModelAdvance(gcomp, rc) ! Reset shr logging to my original values !-------------------------------- - call shr_file_setLogUnit (shrlogunit) + call shr_log_setLogUnit (shrlogunit) call ESMF_LogWrite(subname//' done', ESMF_LOGMSG_INFO) @@ -1289,14 +1288,14 @@ subroutine CheckImport(gcomp, rc) type(ESMF_GridComp) :: gcomp integer, intent(out) :: rc character(len=*) , parameter :: subname = "("//__FILE__//":CheckImport)" - + ! This is the routine that enforces the explicit time dependence on the ! import fields. This simply means that the timestamps on the Fields in the - ! importState are checked against the currentTime on the Component's + ! importState are checked against the currentTime on the Component's ! internalClock. Consequenty, this model starts out with forcing fields - ! at the current time as it does its forward step from currentTime to + ! at the current time as it does its forward step from currentTime to ! currentTime + timeStep. - + ! local variables type(ESMF_Clock) :: clock type(ESMF_Time) :: time @@ -1320,7 +1319,7 @@ subroutine CheckImport(gcomp, rc) ! query the component for info call NUOPC_CompGet(gcomp, name=name, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return - + ! query the Component for its clock and importState call ESMF_GridCompGet(gcomp, clock=clock, importState=importState, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return @@ -1328,11 +1327,11 @@ subroutine CheckImport(gcomp, rc) ! get the current time out of the clock call ESMF_ClockGet(clock, currTime=time, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return - + ! check that Fields in the importState show correct timestamp allCurrent = NUOPC_IsAtTime(importState, time, fieldList=fieldList, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return - + if (.not.allCurrent) then !TODO: introduce and use INCOMPATIBILITY return codes!!!! do i=1, size(fieldList) @@ -1354,6 +1353,6 @@ subroutine CheckImport(gcomp, rc) rcToReturn=rc) return ! bail out endif - + end subroutine CheckImport end module lnd_comp_nuopc From 915af954a034a1e6d4f777623cde90977e614499 Mon Sep 17 00:00:00 2001 From: mvdebolskiy Date: Thu, 8 Aug 2024 10:33:31 -0600 Subject: [PATCH 003/158] add spellcheck in bld-nml-tester --- bld/unit_testers/build-namelist_test.pl | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index fe6591c16b..d31d8e9294 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -1211,6 +1211,13 @@ sub cat_and_create_namelistinfile { ); foreach my $key ( keys(%failtest) ) { print( "$key\n" ); + my $var; + foreach $var ( "phys" , "options", "namelst" ) { + if ( not exists $failtest{$key}{$var} ) { + die "ERROR: Subkey $var does not exist for failtest $key\nERROR:Check if you spelled $var correctly\n" + } + } + &make_config_cache($failtest{$key}{"phys"}); my $options = $failtest{$key}{"options"}; my $namelist = $failtest{$key}{"namelst"}; @@ -1288,6 +1295,14 @@ sub cat_and_create_namelistinfile { ); foreach my $key ( keys(%warntest) ) { print( "$key\n" ); + + my $var; + foreach $var ( "phys" , "options", "namelst" ) { + if ( not exists $failtest{$key}{$var} ) { + die "ERROR: Subkey $var does not exist for warntest $key\nERROR:Check if you spelled $var correctly\n" + } + } + &make_config_cache($warntest{$key}{"phys"}); my $options = $warntest{$key}{"options"}; my $namelist = $warntest{$key}{"namelst"}; @@ -1517,6 +1532,14 @@ sub cat_and_create_namelistinfile { foreach my $key ( keys(%finidat_files) ) { print( "$key\n" ); + + my $var; + foreach $var ( "phys" , "atm_forc", "res", "bgc", "crop", "use_case", "start_ymd", "namelist" ) { + if ( not exists $failtest{$key}{$var} ) { + die "ERROR: Subkey $var does not exist for finidat_file $key\nERROR:Check if you spelled $var correctly\n" + } + } + my $phys = $finidat_files{$key}{'phys'}; print "physics = $phys\n"; &make_config_cache($phys); From 85e3124813c808a75390faf6e0be3339c1bb37ff Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Thu, 15 Aug 2024 08:28:38 -0600 Subject: [PATCH 004/158] updating fates default parameter file to api 36.1 --- bld/namelist_files/namelist_defaults_ctsm.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index c4c056195d..ad39edc69e 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -513,7 +513,8 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/fates_params_api.36.0.0_12pft_c240517.nc +lnd/clm2/paramdata/fates_params_api.36.1.0_12pft_c240814.nc + From 822618e669f08af5e4338f4d29e4a9d0ac54a74a Mon Sep 17 00:00:00 2001 From: mvdebolskiy Date: Thu, 15 Aug 2024 13:10:57 -0600 Subject: [PATCH 005/158] add test, add warning --- bld/CLMBuildNamelist.pm | 7 +++++++ bld/unit_testers/build-namelist_test.pl | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index b99be288e7..b5e74af000 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -2725,6 +2725,13 @@ SIMYR: foreach my $sim_yr ( @sim_years ) { $log->fatal_error("$useinitvar is being set for you but a $var was not found, so $useinitvar, init_interp_attributes, and finidat must not be set correctly for this configuration in the namelist_default file" ); } } + + # this check has to be here and not earlier since use_init_interp is set here and hillslope is already set above in setup_logic_hillslope + if ( &value_is_true($nl->get_value($useinitvar)) && value_is_true($nl->get_value("use_hillslope")) ) { + $log->warning("WARNING: You have set use_hillslope while $useinitvar is TRUE.\n This means all hillslope columns in a gridcell will read identical values" . + " from initial conditions. If you are sure you want this behaviour:") + } + } # end initial conditions #------------------------------------------------------------------------------- diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index c51b0b0cb3..074fdec814 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -1284,6 +1284,10 @@ sub cat_and_create_namelistinfile { namelst=>"fsurdat='build-namelist_test.pl'", phys=>"clm6_0", }, + "hillslope with init_interp"=>{ options=>"-bgc bgc -envxml_dir .", + namelst=>"use_init_interp=.true.,use_hillslope=.true.", + phys=>"clm6_0", + }, ); foreach my $key ( keys(%warntest) ) { print( "$key\n" ); From e271432f7ea3b01026a5c6edc023ed1665ba92c5 Mon Sep 17 00:00:00 2001 From: mvdebolskiy Date: Thu, 8 Aug 2024 10:33:31 -0600 Subject: [PATCH 006/158] add spellcheck in bld-nml-tester --- bld/unit_testers/build-namelist_test.pl | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index c51b0b0cb3..a9381d0eae 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -1212,6 +1212,13 @@ sub cat_and_create_namelistinfile { ); foreach my $key ( keys(%failtest) ) { print( "$key\n" ); + my $var; + foreach $var ( "phys" , "options", "namelst" ) { + if ( not exists $failtest{$key}{$var} ) { + die "ERROR: Subkey $var does not exist for failtest $key\nERROR:Check if you spelled $var correctly\n" + } + } + &make_config_cache($failtest{$key}{"phys"}); my $options = $failtest{$key}{"options"}; my $namelist = $failtest{$key}{"namelst"}; @@ -1287,6 +1294,14 @@ sub cat_and_create_namelistinfile { ); foreach my $key ( keys(%warntest) ) { print( "$key\n" ); + + my $var; + foreach $var ( "phys" , "options", "namelst" ) { + if ( not exists $failtest{$key}{$var} ) { + die "ERROR: Subkey $var does not exist for warntest $key\nERROR:Check if you spelled $var correctly\n" + } + } + &make_config_cache($warntest{$key}{"phys"}); my $options = $warntest{$key}{"options"}; my $namelist = $warntest{$key}{"namelst"}; @@ -1516,6 +1531,14 @@ sub cat_and_create_namelistinfile { foreach my $key ( keys(%finidat_files) ) { print( "$key\n" ); + + my $var; + foreach $var ( "phys" , "atm_forc", "res", "bgc", "crop", "use_case", "start_ymd", "namelist" ) { + if ( not exists $failtest{$key}{$var} ) { + die "ERROR: Subkey $var does not exist for finidat_file $key\nERROR:Check if you spelled $var correctly\n" + } + } + my $phys = $finidat_files{$key}{'phys'}; print "physics = $phys\n"; &make_config_cache($phys); From e205e2ef8ed005aa3bb7743ba5ea8061bbd22498 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 13 Sep 2024 11:38:56 -0600 Subject: [PATCH 007/158] Ignore warnings in Hillslope tests. --- .../testdefs/testmods_dirs/clm/Hillslope/shell_commands | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands b/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands index 6f3602d2e6..a2759b51b4 100644 --- a/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands @@ -2,3 +2,6 @@ DIN_LOC_ROOT=$(./xmlquery --value DIN_LOC_ROOT) meshfile=$DIN_LOC_ROOT/lnd/clm2/testdata/ESMFmesh_10x15_synthetic_cosphill_1.0.nc ./xmlchange ATM_DOMAIN_MESH=${meshfile},LND_DOMAIN_MESH=${meshfile} + +# -ignore_warnings is needed as long as we don't allow use_hillslope and use_init_interp together +./xmlchange --append CLM_BLDNML_OPTS=-ignore_warnings From d753457b0fa44784b6ba46734a8a42f0a23f9577 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 17 Sep 2024 16:55:43 -0600 Subject: [PATCH 008/158] Remove references to PTCLM/PTCLMmkdata. Resolves ESCOMP/CTSM#2769. --- doc/source/users_guide/index.rst | 1 - .../users_guide/overview/getting-help.rst | 3 - .../users_guide/overview/introduction.rst | 4 +- .../running-PTCLM/adding-ptclm-site-data.rst | 88 ------------ .../users_guide/running-PTCLM/index.rst | 20 --- .../running-PTCLM/introduction-to-ptclm.rst | 135 ------------------ .../running-PTCLM/ptclm-examples.rst | 33 ----- .../users_guide/running-PTCLM/using-ptclm.rst | 114 --------------- ...point-and-regional-grid-configurations.rst | 11 +- doc/source/users_guide/testing/testing.rst | 11 -- .../observational-sites-datasets.rst | 4 +- 11 files changed, 5 insertions(+), 419 deletions(-) delete mode 100644 doc/source/users_guide/running-PTCLM/adding-ptclm-site-data.rst delete mode 100644 doc/source/users_guide/running-PTCLM/index.rst delete mode 100644 doc/source/users_guide/running-PTCLM/introduction-to-ptclm.rst delete mode 100644 doc/source/users_guide/running-PTCLM/ptclm-examples.rst delete mode 100644 doc/source/users_guide/running-PTCLM/using-ptclm.rst diff --git a/doc/source/users_guide/index.rst b/doc/source/users_guide/index.rst index 75a2949bec..8c675c79db 100644 --- a/doc/source/users_guide/index.rst +++ b/doc/source/users_guide/index.rst @@ -24,7 +24,6 @@ adding-new-resolutions/index.rst running-special-cases/index.rst running-single-points/index.rst - running-PTCLM/index.rst trouble-shooting/index.rst testing/index.rst diff --git a/doc/source/users_guide/overview/getting-help.rst b/doc/source/users_guide/overview/getting-help.rst index 74765d1ad0..7c33071db9 100644 --- a/doc/source/users_guide/overview/getting-help.rst +++ b/doc/source/users_guide/overview/getting-help.rst @@ -146,9 +146,6 @@ MOSART PFT Plant Function Type (PFT). A type of vegetation that CLM parameterizes. -PTCLM - PoinT CLM (PTCLM) a python script that operates on top of CLM for |version| to run single point simulations for CLM. - ROF River runOff Model to route flow of surface water over land out to the ocean. |cesmrelease| has two components options for this the new model MOSART and previous model RTM. diff --git a/doc/source/users_guide/overview/introduction.rst b/doc/source/users_guide/overview/introduction.rst index bc7c1fd82c..e02fa3e422 100644 --- a/doc/source/users_guide/overview/introduction.rst +++ b/doc/source/users_guide/overview/introduction.rst @@ -60,9 +60,7 @@ As a followup to the tools chapter, :ref:`adding-new-resolutions-section` tells In :ref:`running-special-cases-section`, again for the expert user, we give details on how to do some particularly difficult special cases. For example, we give the protocol for spinning up the |version|-BGC and CLMCN models as well as CLM with dynamic vegetation active (CNDV). We give instructions to do a spinup case from a previous case with Coupler history output for atmospheric forcing. We also give instructions on running both the prognostic crop and irrigation models. Lastly we tell the user how to use the DATM model to send historical CO2 data to CLM. -:ref:`running-single-points` outlines how to do single-point or regional simulations using |version|. This is useful to either compare |version| simulations with point observational stations, such as tower sites (which might include your own atmospheric forcing), or to do quick simulations with CLM for example to test a new parameterization. There are several different ways given on how to perform single-point simulations which range from simple PTS_MODE to more complex where you create all your own datasets, tying into :ref:`using-clm-tools-section` and also :ref:`adding-new-resolutions-section` to add the files into the build-namelist XML database. The PTCLM python script to run single-point simulations was added back in for this release (but it has bugs that don't allow it to work out of the box). CLM4 in CESM1.0.5 has a fully working versions of PTCLM. - -Need :ref:`running-PTCLM` blurb... +:ref:`running-single-points` outlines how to do single-point or regional simulations using |version|. This is useful to either compare |version| simulations with point observational stations, such as tower sites (which might include your own atmospheric forcing), or to do quick simulations with CLM for example to test a new parameterization. There are several different ways given on how to perform single-point simulations which range from simple PTS_MODE to more complex where you create all your own datasets, tying into :ref:`using-clm-tools-section` and also :ref:`adding-new-resolutions-section` to add the files into the build-namelist XML database. :ref:`troubleshooting-index` gives some guidance on trouble-shooting problems when using |version|. It doesn't cover all possible problems with CLM, but gives you some guidelines for things that can be done for some common problems. diff --git a/doc/source/users_guide/running-PTCLM/adding-ptclm-site-data.rst b/doc/source/users_guide/running-PTCLM/adding-ptclm-site-data.rst deleted file mode 100644 index b95831427f..0000000000 --- a/doc/source/users_guide/running-PTCLM/adding-ptclm-site-data.rst +++ /dev/null @@ -1,88 +0,0 @@ -.. include:: ../substitutions.rst - -.. _adding-ptclm-site-data: - -============================ -Adding PTCLMmkdata Site Data -============================ - -The "sitegroupname" option to PTCLMmkdata looks for groups of sites in the files in the ``PTCLM_sitedata`` directory under the PTCLMmkdata directory. You can add new names available for this option including your own lists of sites, by adding more files in this directory. There are three files for each "sitegroupname": ``$SITEGROUP_sitedata.txt``, ``$SITEGROUP_soildata.txt`` and ``$SITEGROUP_pftdata.txt`` (where ``$SITEGROUP`` is the name that would be entered as "sitegroupname" to PTCLMmkdata). Each file needs to have the same list of sites, but gives different information: site data, PFT data, and soil data respectively. Although the site codes need to be the same between the three files, the files do NOT have to be in the same order. Each file has a one-line header that lists the contents of each column which are separated by commas. The first column for each of the files is the "site_code" which must be consistent between the three files. The site code can be any unique character string, but in general we use the AmeriFlux site code. - -Site data file:`` $SITEGROUP_sitedata.txt``): The header for this file is: -:: - - site_code,name,state,lon,lat,elev,startyear,endyear,alignyear - -The columns: name, state, and elevation are informational only. Name is a longer descriptive name of the site, and state is the state for U.S. sites or country for non U.S. sites. The columns: lon and lat are the longitude and latitude of the location in decimal degrees. The last three columns are the start and ending year for the data and the align year for an 1850 case for the data. The align year is currently unused. - -Soil data file: ``$SITEGROUP_soildata.txt``): The header for this file is: -:: - - site_code,soil_depth,n_layers,layer_depth,layer_sand%,layer_clay% - -The first three fields after "site_code" are currently unused. The only two that are used are the percent sand and clay columns to set the soil texture. - -PFT data file: ``$SITEGROUP_pftdata.txt```): The header for this file is: -:: - - site_code,pft_f1,pft_c1,pft_f2,pft_c2,pft_f3,pft_c3,pft_f4,pft_c4,pft_f5,pft_c5 - -This file gives the vegetation coverage for the different vegetation types for the site. The file only supports up to five PFT's at the same time. The columns with "pft_f" are the fractions for each PFT, and the columns with "pft_c" is the integer index of the given PFT. Look at the pft-physiology file to see what the PFT index for each PFT type is. - ----------------------------------------------------- -Dynamic Land-Use Change Files for use by PTCLMmkdata ----------------------------------------------------- - -There is a mechanism for giving site-specific land-use change in PTCLMmkdata. Adding site specific files to the ``PTCLM_sitedata`` directory under PTCLMmkdata allows you to specify the change in vegetation and change in harvesting (for the CN model) for that site. Files are named: ``$SITE_dynpftdata.txt``. There is a sample file for the US-Ha1 site called: ``US-Ha1_dynpftdata.txt``. The file has a one-line header with the information that the file has, and then one-line for each year with a transition. The header line is as follows: -:: - - trans_year,pft_f1,pft_c1,pft_f2,pft_c2,pft_f3,pft_c3,pft_f4,pft_c4,pft_f5,pft_c5,har_vh1,har_vh2,har_sh1,har_sh2,har_sh3,graze,hold_harv,hold_graze - -This file only requires a line for each year where a transition or harvest happens. As in the "pftdata" file above "pft_f" refers to the fraction and "pft_c" refers to the PFT index, and only up to five vegetation types are allowed to co-exist. The last eight columns have to do with harvesting and grazing. The last two columns are whether to hold harvesting and/or grazing constant until the next transition year and will just be either 1 or 0. This file will be converted by the **PTCLM_sitedata/cnvrt_trnsyrs2_pftdyntxtfile.pl** script in the PTCLMmkdata directory to a format that **mksurfdata_esmf** can read that has an entry for each year for the range of years valid for the compset in question. - -.. _converting-ameriflux-for-ptclmmkdata: - ------------------------------------------------- -Converting AmeriFlux Data for use by PTCLMmkdata ------------------------------------------------- - -AmeriFlux data comes in comma separated format and is available from: `http://public.ornl.gov/ameriflux/dataproducts.shtml `_. Before you download the data you need to agree to the usage terms. - -Here is a copy of the usage terms from the web-site on June/13/2011. - -"The AmeriFlux data provided on this site are freely available and were furnished by individual AmeriFlux scientists who encourage their use. Please kindly inform the appropriate AmeriFlux scientist(s) of how you are using the data and of any publication plans. Please acknowledge the data source as a citation or in the acknowledgments if the data are not yet published. If the AmeriFlux Principal Investigators (PIs) feel that they should be acknowledged or offered participation as authors, they will let you know and we assume that an agreement on such matters will be reached before publishing and/or use of the data for publication. If your work directly competes with the PI's analysis they may ask that they have the opportunity to submit a manuscript before you submit one that uses unpublished data. In addition, when publishing, please acknowledge the agency that supported the research. Lastly, we kindly request that those publishing papers using AmeriFlux data provide preprints to the PIs providing the data and to the data archive at the Carbon Dioxide Information Analysis Center (CDIAC)." - -The above agreement applies to the "US-UMB" dataset imported into our repository as well, and Gil Bohrer is the PI on record for that dataset. - -The CESM can NOT handle missing data, so we recommend using the "Level 4" Gap filled datasets. The fields will also need to be renamed. The "WS" column becomes "WIND", "PREC" becomes "PRECmms", "RH" stays as "RH", "TA" becomes "TBOT", "Rg" becomes "FSDS", "Rgl" becomes "FLDS", "PRESS" becomes "PSRF". "ZBOT" can just be set to the constant of "30" (m). The units of Temperature need to be converted from "Celsius" to "Kelvin" (use the value in ``SHR_CONST_TKFRZ`` in the file ``models/csm_share/shr/shr_const.F90`` of ``273.15``. The units of Pressure also need to be converted from "kPa" to "Pa". LATIXY, and LONGXY should also be set to the latitude and longitude of the site. - ------------------------------------------------------------------ -Example: PTCLMmkdata transient example over a shorter time period ------------------------------------------------------------------ - -This is an example of using PTCLMmkdata for Harvard Forest (AmeriFlux site code US-Ha1) for transient land use 1991-2006. In order to do this we would've needed to have converted the AmeriFlux data into NetCDF format as shown in :ref:`converting-ameriflux-for-ptclmmkdata` section above. Also note that this site has a site-specific dynamic land-use change file for it ``PTCLM_sitedata/US-Ha1_dynpftdata.txt`` in the PTCLMmkdata directory and this file will be used for land-use change and harvesting rather than the global dataset. - -:: - - > cd $CTSMROOT/tools/PTCLM - # We are going to use forcing data over 1991 to 2006, but we need to start with - # a transient compset to do so, so we use the 20th Century transient: 1850-2000 - # Note: When creating the fpftdyn dataset for this site it will use the - # PTCLM_sitedata/US-Ha1_dynpftdata.txt - # file for land-use change and harvesting - > ./PTCLMmkdata -s US-Ha1 -d $MYCSMDATA --sitegroupname AmeriFlux - > mkdir $MYCSMDATA/atm/datm7/CLM1PT_data/1x1pt_US-Ha1 - > cd $MYCSMDATA/atm/datm7/CLM1PT_data/1x1pt_US-Ha1 - # Copy data in NetCDF format to this directory, filenames should be YYYY-MM.nc - # The fieldnames on the file should be: - # FLDS,FSDS,LATIXY, LONGXY, PRECTmms,PSRF,RH,TBOT,WIND,ZBOT - # With units - # W/m2,W/m2,degrees_N,degrees_E,mm/s, Pa, %, K, m/s, m - # The time coordinate units should be: days since YYYY-MM-DD 00:00:00 - > cd ../../../../../US-Ha1_I20TRCRUCLM45BGC - # Now we need to set the start date to 1991, and make sure the align year is for 1991 - > ./xmlchange RUN_STARTDATE=1991-01-01,DATM_CLMNCEP_YR_ALIGN=1991 - # Similarly for Nitrogen deposition data we cycle over: 1991 to 2006 - > cat << EOF >> user_nl_clm - model_year_align_ndep=1991,stream_year_first_ndep=1991,stream_year_last_ndep=2006 - EOF diff --git a/doc/source/users_guide/running-PTCLM/index.rst b/doc/source/users_guide/running-PTCLM/index.rst deleted file mode 100644 index 0b44c01b49..0000000000 --- a/doc/source/users_guide/running-PTCLM/index.rst +++ /dev/null @@ -1,20 +0,0 @@ -.. on documentation master file, created by - sphinx-quickstart on Tue Jan 31 19:46:36 2017. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -.. include:: ../substitutions.rst - -.. _running-PTCLM: - -##################################### -Running PTCLM -##################################### - -.. toctree:: - :maxdepth: 2 - - introduction-to-ptclm.rst - using-ptclm.rst - ptclm-examples.rst - adding-ptclm-site-data.rst diff --git a/doc/source/users_guide/running-PTCLM/introduction-to-ptclm.rst b/doc/source/users_guide/running-PTCLM/introduction-to-ptclm.rst deleted file mode 100644 index 9ae4186d2c..0000000000 --- a/doc/source/users_guide/running-PTCLM/introduction-to-ptclm.rst +++ /dev/null @@ -1,135 +0,0 @@ -.. _introduction-to-ptclm.rst: - -.. include:: ../substitutions.rst - -.. _what-is-ptclm: - -===================== - What is PTCLMmkdata? -===================== - -PTCLMmkdata (pronounced Pee-Tee Cee-L-M make data is a Python script to help you set up PoinT CLM simulations. - -It runs the CLM tools for you to get datasets set up, and copies them to a location you can use them including the changes needed for a case to use the dataset with namelist and XML changes. - -Then you run **create_newcase** and point to the directory so that the namelist and XML changes are automatically applied. - -PTCLMmkdata has a simple ASCII text file for storing basic information for your sites. - -We also have complete lists for AmeriFlux and Fluxnet-Canada sites, although we only have the meteorology data for one site. - -For other sites you will need to obtain the meteorology data and translate it to a format that the CESM datm model can use. - -But, even without meteorology data PTCLMmkdata is useful to setup datasets to run with standard ``CLM_QIAN`` data. - -The original authors of PTCLMmkdata are: Daniel M. Ricciuto, Dali Wang, Peter E. Thornton, Wilfred M. Post all at Environmental Sciences Division, Oak Ridge National Laboratory (ORNL) and R. Quinn Thomas at Cornell University. It was then modified fairly extensively by Erik Kluzek at NCAR. We want to thank all of these individuals for this contribution to the CESM effort. We also want to thank the folks at University of Michigan Biological Stations (US-UMB) who allowed us to use their Fluxnet station data and import it into our inputdata repository, especially Gil Bohrer the PI on record for this site. - -.. _details-of-ptclm: - -======================= - Details of PTCLMmkdata -======================= - -To get help on PTCLM2_180611 use the "--help" option as follows. -:: - - > cd $CTSMROOT/tools/PTCLM - > ./PTCLMmkdata --help - -The output to the above command is as follows: -:: - - Usage: PTCLM.py [options] -d inputdatadir -m machine -s sitename - - Python script to create cases to run single point simulations with tower site data. - - Options: - --version show program's version number and exit - -h, --help show this help message and exit - - Required Options: - -d CCSM_INPUT, --csmdata=CCSM_INPUT - Location of CCSM input data - -m MYMACHINE, --machine=MYMACHINE - Machine, valid CESM script machine (-m list to list valid - machines) - -s MYSITE, --site=MYSITE - Site-code to run, FLUXNET code or CLM1PT name (-s list to list - valid names) - - Configure and Run Options: - -c MYCOMPSET, --compset=MYCOMPSET - Compset for CCSM simulation (Must be a valid 'I' compset [other - than IG compsets], use -c list to list valid compsets) - --coldstart Do a coldstart with arbitrary initial conditions - --caseidprefix=MYCASEID - Unique identifier to include as a prefix to the case name - --cesm_root=BASE_CESM - Root CESM directory (top level directory with models and scripts - subdirs) - --debug Flag to turn on debug mode so won't run, but display what would - happen - --finidat=FINIDAT Name of finidat initial conditions file to start CLM from - --list List all valid: sites, compsets, and machines - --namelist=NAMELIST - List of namelist items to add to CLM namelist (example: - --namelist="hist_fincl1='TG',hist_nhtfrq=-1" - --QIAN_tower_yrs Use the QIAN forcing data year that correspond to the tower - years - --rmold Remove the old case directory before starting - --run_n=MYRUN_N Number of time units to run simulation - --run_units=MYRUN_UNITS - Time units to run simulation (steps,days,years, etc.) - --quiet Print minimul information on what the script is doing - --sitegroupname=SITEGROUP - Name of the group of sites to search for you selected site in - (look for prefix group names in the PTCLM_sitedata directory) - --stdurbpt If you want to setup for standard urban namelist settings - --useQIAN use QIAN input forcing data instead of tower site meterology data - --verbose Print out extra information on what the script is doing - - Input data generation options: - These are options having to do with generation of input datasets. Note: When - running for supported CLM1PT single-point datasets you can NOT generate new - datasets. For supported CLM1PT single-point datasets, you MUST run with the - following settings: --nopointdata And you must NOT set any of these: --soilgrid - --pftgrid --owritesrf - - --nopointdata Do NOT make point data (use data already created) - --owritesrf Overwrite the existing surface datasets if they exist (normally - do NOT recreate them) - --pftgrid Use pft information from global gridded file (rather than site - data) - --soilgrid Use soil information from global gridded file (rather than site - data) - - Main Script Version Id: $Id: PTCLM.py 47576 2013-05-29 19:11:16Z erik $ Scripts URL: $HeadURL: https://svn-ccsm-models.cgd.ucar.edu/PTCLM/trunk_tags/PTCLM1_130529/PTCLM.py $: - -Here we give a simple example of using PTCLMmkdata for a straightforward case of running at the US-UMB Fluxnet site on cheyenne where we already have the meteorology data on the machine. Note, see :ref:`converting-ameriflux-for-ptclmmkdata` for permission information to use this data. - -Example 6-1. Example of running PTCLMmkdata for US-UMB on cheyenne ------------------------------------------------------------------- -:: - - > setenv CSMDATA $CESMDATAROOT/inputdata - > setenv MYDATAFILES `pwd`/mydatafiles - > setenv SITE US-UMB - > setenv MYCASE testPTCLM - - # Next build all of the clm tools you will need - > cd $CTSMROOT/tools/PTCLM - > buildtools - # next run PTCLM (NOTE -- MAKE SURE python IS IN YOUR PATH) - > cd $CTSMROOT/tools/PTCLM - # Here we run it using qcmd so that it will be run on a batch node - > qcmd -- ./PTCLMmkdata --site=$SITE --csmdata=$CSMDATA --mydatadir=$MYDATAFILES >& ptclmrun.log & - > cd $CIMEROOT/scripts - > ./create_newcase --user-mods-dir $MYDATAFILES/1x1pt_$SITE --case $MYCASE --res CLM_USRDAT --compset I1PtClm50SpGs - # Next setup, build and run as normal - > cd $MYCASE - > ./case.setup - -PTCLMmkdata includes a README file that gives some extra details and a simple example. - -.. include:: ../../../../tools/PTCLM/README - :literal: diff --git a/doc/source/users_guide/running-PTCLM/ptclm-examples.rst b/doc/source/users_guide/running-PTCLM/ptclm-examples.rst deleted file mode 100644 index 6801c5f3d8..0000000000 --- a/doc/source/users_guide/running-PTCLM/ptclm-examples.rst +++ /dev/null @@ -1,33 +0,0 @@ -.. include:: ../substitutions.rst - -.. _ptclm-examples: - -============================== - Examples of using PTCLMmkdata -============================== - -Now let's give a few more complex examples using some of the options we have discussed above. - -Now, let's demonstrate using a different group list, doing a spinup, running with Qian global forcing data, but using tower years to set the years to run over. This uses the options: sitegroupname, useQIAN, and QIANtower_years. - -Example: Running PTCLMmkdata without tower years ------------------------------------------------- -:: - - > cd $CTSMROOT/tools/PTCLM - > ./PTCLMmkdata -s US-Ha1 -d $CSMDATA --sitegroupname AmeriFlux --donot_use_tower_yrs - > cd ../../../../../US-Ha1_ICRUCLM45BGC_QIAN - # Now build and run normally - ``` - -Finally, let's demonstrate using a generic machine (which then requires the scratchroot option), using the global grid for PFT and soil types, and setting the run length to two months. - -Example: Running PTCLMmkdata with global PFT and soil types dataset -------------------------------------------------------------------- -:: - - > cd $CTSMROOT/tools/PTCLM - # Note, see the the Section called Converting AmeriFlux Data for use by PTCLMmkdata with permission information - # to use the US-UMB data. - > ./PTCLMmkdata -s US-UMB -d $CSMDATA --pftgrid --soilgrid - > cd ../../../../../US-UMB_ICRUCLM45BGC diff --git a/doc/source/users_guide/running-PTCLM/using-ptclm.rst b/doc/source/users_guide/running-PTCLM/using-ptclm.rst deleted file mode 100644 index e7be79bee6..0000000000 --- a/doc/source/users_guide/running-PTCLM/using-ptclm.rst +++ /dev/null @@ -1,114 +0,0 @@ -.. include:: ../substitutions.rst - -.. _using-ptclm.rst: - -************************** -Using PTCLMmkdata -************************** - -There are two types of options to PTCLMmkdata: required and optional. The three required options are the three settings that MUST be specified for PTCLMmkdata to work at all. The other settings have default values that will default to something useful. Most options use a double dash "--" "longname" such as "--list", but the most common options also have a short-name with a single dash. - -The required options to PTCLMmkdata are: inputdata directory (-d) and site-name (-s). Inputdata directory is the directory where you have the CESM inputdata files. Finally site-name is the name of the site that you want to run for. Site-name is a Fluxnet site name from the list of sites you are running on (see the --sitegroupname for more information about the site lists). - -After PTCLMmkdata is run you can run **create_newcase** to setup a case to use the datasets created. It also creates a ``README.PTCLM`` in that directory that documents the commandline options to PTCLMmkdata that were used to create it. - -After "help" the "list" option is one of the most useful options for getting help on using PTCLMmkdata. This option gives you information about some of the other options to PTCLMmkdata. To get a list of the sites that can be used for PTCLMmkdata use the "--list" option as follows. -:: - - > cd $CTSMROOT/tools/PTCLM - > ./PTCLMmkdata --list - -The output to the above command is as follows: -:: - - /bin/sh: line 1: PTCLMmkdata: command not found - -Steps in running PTCLMmkdata -============================ - -1. Build the CLM tools Next you need to make sure all the CLM FORTRAN tools are built. - :: - - > cd $CTSMROOT/tools/PTCLM - > ./buildtools - > gmake clean - -2. Run PTCLMmkdata Next you actually run PTCLMmkdata which does the different things listed below: - - a. PTCLMmkdata names your output file directory based on your input - :: - - [Prefix_]SiteCode - - Where: - ``Prefix`` is from the caseidprefix option (or blank if not used). - - ``SiteCode`` is the site name you entered with the -s option. - - For example, the casename for the following will be: - :: - - > cd scripts - > ./PTCLMmkdata -s US-UMB -d $MYCSMDATA - - b. PTCLMmkdata creates datasets for you It will populate $MYCSMDATA with new datasets it creates using the CLM tools. - - c. If a transient compset and PTCLMmkdata finds a _dynpftdata.txt file If you are running a transient compset (such as the "I_1850-2000_CN" compset) AND you there is a file in the PTCLM_sitedata directory under the PTCLMmkdata directory called $SITE_dynpftdata.txt it will use this file for the land-use changes. Otherwise it will leave land-use constant, unless you use the pftgrid option so it uses the global dataset for landuse changes. See the Section called Dynamic Land-Use Change Files for use by PTCLMmkdata for more information on this. There is a sample transient dataset called US-Ha1_dynpftdata.txt. Transient compsets, are compsets that create transient land-use change and forcing conditions such as: 'I_1850-2000', 'I_1850-2000_CN', 'I_RCP8.5_CN', 'I_RCP6.0_CN', 'I_RCP4.5_CN', or 'I_RCP2.6_CN'. - - d. PTCLMmkdata creates a pft-physiology for you PTCLMmkdata will create a local copy of the pft-physiology specific for your site that you could then customize with changes specific for that site. - - e. PTCLMmkdata creates a README.PTCLM for you PTCLMmkdata will create a simple text file with the command line for it in a file called README.PTCLM in the case directory it creates for you. - -3. Run create_newcase pointing to the directory created - -4. Customize, setup, build and run case as normal You then customize your case as you would normally. See the Chapter 1 chapter for more information on doing this. - -PTCLMmkdata options -========================= - -Next we discuss the setup and run-time options, dividing them up into setup, initial condition (IC), and run-time options. - -Configure options include: - -- --cesm_root=BASE_CESM -- --sitegroupname=SITEGROUP -- --donot_use_tower_yrs - -``--cesm_root`` - This option is for running PTCLMmkdata with a different root directory to CESM than the version PTCLMmkdata exists in. Normally you do NOT need to use this option. - -``--sitegroupname`` - In the PTCLMmkdata directory there is a subdirectory "PTCLM_sitedata" that contains files with the site, PFT and soil data information for groups of sites. These site groups are all separate ASCII files with the same prefix followed by a "_*data.txt" name. See :ref:`adding-ptclm-site-data` for more information on these files. By default we have provided three different valid group names: - -EXAMPLE -------- -AmeriFlux - -Fluxnet-Canada - -The EXAMPLE is the group used by default and ONLY includes the US-UMB site as that is the only site we have data provided for. The other two site groups include the site information for all of both the AmeriFlux and Fluxnet-Canada sites. You can use the "sitegroupname" option to use one of the other lists, or you can create your own lists using the EXAMPLE file as an example. Your list of sites could be real world locations or could be theoretical "virtual" sites given to exercise CLM on differing biomes for example. Note, see :ref:`converting-ameriflux-for-ptclmmkdata` with permission information to use the US-UMB data. - -``--donot_use_tower_yrs`` - This option is used with the "useQIAN" option to set the years to cycle over for the Qian data. In this case Qian atmospheric forcing will be used, but the simulation will run over the same years that tower site is available for this site. - -**Run-time options include:** - -- --debug - -This option tells PTCLMmkdata to echo what it would do if it were run, but NOT actually run anything. So it will show you the dataset creation commands it would use. It does however, run **create_newcase**, but then it only displays the **xmlchange** commands and changes that it would do. Also note that if you give the "--rmold" option it won't delete the case directory beforehand. Primarily this is intended for debugging the operation of PTCLMmkdata. - -**The dataset generation options are:** - -- --pftgrid -- --soilgrid - -The options that with a "grid" suffix all mean to create datasets using the global gridded information rather than using the site specific point data. By default the site specific point data is used. The "nopointdata" and "owritesrfaer" options have to do with file creation. - -Because supported single-point datasets already have the data created for them, you MUST use the "nopointdata" and "ndepgrid" options when you are using a supported single-point site. You must use "ndepgrid" even for a compset without CN. You also can NOT use the options: "soilgrid", "pftgrid", "aerdepgrid", or "owritesrfaer". - -``--pftgrid`` - This option says to use the PFT values provided on the global dataset rather than using the specific site based values from the PTCLM_sitedata/\*_pftdata.txt file when creating the surface dataset. This option must NOT be used when you you are using a site that is a supported single point dataset. - -``--soilgrid`` - This option says to use the soil values provided on the global dataset rather than using the specific site based values from the PTCLM_sitedata/\*_soildata.txt file when creating the surface dataset. This option must NOT be used when you you are using a site that is a supported single point dataset. - diff --git a/doc/source/users_guide/running-single-points/single-point-and-regional-grid-configurations.rst b/doc/source/users_guide/running-single-points/single-point-and-regional-grid-configurations.rst index 34a199ebe8..ab7e923669 100644 --- a/doc/source/users_guide/running-single-points/single-point-and-regional-grid-configurations.rst +++ b/doc/source/users_guide/running-single-points/single-point-and-regional-grid-configurations.rst @@ -8,7 +8,7 @@ Single and Regional Grid Configurations CLM allows you to set up and run cases with a single-point or a local region as well as global resolutions. This is often useful for running quick cases for testing, evaluating specific vegetation types, or land-units, or running with observed data for a specific site. -There are three different ways to do this for normal-supported site +There are two different ways to do this for normal-supported site ``PTS_MODE`` runs for a single point using global datasets. @@ -16,11 +16,6 @@ There are three different ways to do this for normal-supported site ``CLM_USRDAT_NAME`` runs using your own datasets (single-point or regional). -``PTCLMmkdata`` - easily setup simulations to run for tower sites.. - -.. note:: ``PTS_MODE`` and ``PTCLMmkdata`` only works for a single point, while the other two options can also work for regional datasets as well. - .. _options-for-single-points: ========================================= @@ -33,7 +28,5 @@ In general :ref:`pts_mode` is the quick and dirty method that gets you started w Next, ``CLM_USRDAT_NAME`` is the best way to setup cases quickly where you have to create your own datasets (see :ref:`running-single-point-datasets`). With this method you don't have to change DATM or add files to the XML database -- but you have to follow a strict naming convention for files. However, once the files are named and in the proper location, you can easily setup new cases that use these datasets. This is good for treating all the required datasets as a "group" and for a particular model version. For advanced CLM developers who need to track dataset changes with different model versions you would be best off adding these datasets as supported datasets with the "normal supported datasets" method. -Lastly *PTCLMmkdata* is a great way to easily create datasets, setup simulations and run simulations for tower sites. It takes advantage of both normal supported site functionality and CLM_USRDAT_NAME internally. A big advantage to it, is that it's one-stop shopping, it runs tools to create datasets, and runs **create_newcase** and sets the appropriate env variables for you. So you only have to learn how to run one tool, rather than work with many different ones. PTCLMmkdata is described in the next chapter, :ref:`running-PTCLM`. - -Finally, if you also have meteorology data that you want to force your CLM simulations with you'll need to setup cases as described in :ref:`creating-your-own-singlepoint-dataset`. You'll need to create CLM datasets either according to ``CLM_USRDAT_NAME``. You may also need to modify DATM to use your forcing data. And you'll need to change your forcing data to be in a format that DATM can use. :ref:`converting-ameriflux-for-ptclmmkdata` tells you how to use AmeriFlux data for atmospheric forcing. +Finally, if you also have meteorology data that you want to force your CLM simulations with you'll need to setup cases as described in :ref:`creating-your-own-singlepoint-dataset`. You'll need to create CLM datasets either according to ``CLM_USRDAT_NAME``. You may also need to modify DATM to use your forcing data. And you'll need to change your forcing data to be in a format that DATM can use. diff --git a/doc/source/users_guide/testing/testing.rst b/doc/source/users_guide/testing/testing.rst index 69ca1f7263..ec959d4b82 100644 --- a/doc/source/users_guide/testing/testing.rst +++ b/doc/source/users_guide/testing/testing.rst @@ -36,14 +36,3 @@ If something went wrong, you can find the failing tests like so: :: > grep -E "^[0-9]+/[0-9]+ < [a-zA-Z]+" namelist_test.log | grep -v "PASS" - -Testing PTCLM -============= - -.. include:: ../../../../tools/PTCLM/README - :literal: - -To run on cheyenne, you do the following: - -.. include:: ../../../../tools/PTCLM/test/README.run_cheyenne - :literal: diff --git a/doc/source/users_guide/using-clm-tools/observational-sites-datasets.rst b/doc/source/users_guide/using-clm-tools/observational-sites-datasets.rst index 50a7969281..05fe461db2 100644 --- a/doc/source/users_guide/using-clm-tools/observational-sites-datasets.rst +++ b/doc/source/users_guide/using-clm-tools/observational-sites-datasets.rst @@ -6,6 +6,6 @@ Observational Sites Datasets ******************************* -There are two ways to customize datasets for a particular observational site. The first is to customize the input to the tools that create the dataset, and the second is to overwrite the default data after you've created a given dataset. Depending on the tool it might be easier to do it one way or the other. In Table :numref:`reqd-files-table` we list the files that are most likely to be customized and the way they might be customized. Of those files, the ones you are most likely to customize are: ``fatmlndfrc``, ``fsurdat``, ``faerdep`` (for DATM), and ``stream_fldfilename_ndep``. Note ``mksurfdata_esmf`` as documented previously has options to overwrite the vegetation and soil types. For more information on this also see :ref:`creating-your-own-singlepoint-dataset`. ``PTCLM`` uses these methods to customize datasets; see Chapter :numref:`running-PTCLM`. +There are two ways to customize datasets for a particular observational site. The first is to customize the input to the tools that create the dataset, and the second is to overwrite the default data after you've created a given dataset. Depending on the tool it might be easier to do it one way or the other. In Table :numref:`reqd-files-table` we list the files that are most likely to be customized and the way they might be customized. Of those files, the ones you are most likely to customize are: ``fatmlndfrc``, ``fsurdat``, ``faerdep`` (for DATM), and ``stream_fldfilename_ndep``. Note ``mksurfdata_esmf`` as documented previously has options to overwrite the vegetation and soil types. For more information on this also see :ref:`creating-your-own-singlepoint-dataset`. -Another aspect of customizing your input datasets is customizing the input atmospheric forcing datasets; see :ref:`creating-your-own-singlepoint-dataset` for more information on this. :ref:`converting-ameriflux-for-ptclmmkdata` has information on using the AmeriFlux tower site data as atmospheric forcing. +Another aspect of customizing your input datasets is customizing the input atmospheric forcing datasets; see :ref:`creating-your-own-singlepoint-dataset` for more information on this. From c26ac543735047be12592e6b683e845563eca78d Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 17 Sep 2024 17:06:27 -0600 Subject: [PATCH 009/158] Use double-backticks instead of double-hyphens in one instance. --- doc/source/users_guide/trouble-shooting/trouble-shooting.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/users_guide/trouble-shooting/trouble-shooting.rst b/doc/source/users_guide/trouble-shooting/trouble-shooting.rst index e139796f71..93798c3c57 100644 --- a/doc/source/users_guide/trouble-shooting/trouble-shooting.rst +++ b/doc/source/users_guide/trouble-shooting/trouble-shooting.rst @@ -152,7 +152,7 @@ Here are some other suggestions on how to track down a problem encountered while Run with a smaller set of 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: +One way to simplify the system is to run with a smaller set of processors. You will need to clean the setup and edit ``env_mach_pes.xml``. For example, to run with four processors: :: > ./case.setup -clean From fbce6564046b2f72352d3078a7704ec9d38f6fc0 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Tue, 17 Sep 2024 11:10:07 -0600 Subject: [PATCH 010/158] Fix comments on urban thermal variables --- src/biogeophys/SoilTemperatureMod.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/biogeophys/SoilTemperatureMod.F90 b/src/biogeophys/SoilTemperatureMod.F90 index 0dc8876d24..d6c9660b96 100644 --- a/src/biogeophys/SoilTemperatureMod.F90 +++ b/src/biogeophys/SoilTemperatureMod.F90 @@ -671,9 +671,9 @@ subroutine SoilThermProp (bounds, num_urbanc, filter_urbanc, num_nolakec, filter tk_wall => urbanparams_inst%tk_wall , & ! Input: [real(r8) (:,:) ] thermal conductivity of urban wall tk_roof => urbanparams_inst%tk_roof , & ! Input: [real(r8) (:,:) ] thermal conductivity of urban roof tk_improad => urbanparams_inst%tk_improad , & ! Input: [real(r8) (:,:) ] thermal conductivity of urban impervious road - cv_wall => urbanparams_inst%cv_wall , & ! Input: [real(r8) (:,:) ] thermal conductivity of urban wall - cv_roof => urbanparams_inst%cv_roof , & ! Input: [real(r8) (:,:) ] thermal conductivity of urban roof - cv_improad => urbanparams_inst%cv_improad , & ! Input: [real(r8) (:,:) ] thermal conductivity of urban impervious road + cv_wall => urbanparams_inst%cv_wall , & ! Input: [real(r8) (:,:) ] heat capacity of urban wall + cv_roof => urbanparams_inst%cv_roof , & ! Input: [real(r8) (:,:) ] heat capacity of urban roof + cv_improad => urbanparams_inst%cv_improad , & ! Input: [real(r8) (:,:) ] heat capacity of urban impervious road t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature [K] From f25a251e58f06bc39484c4687f9daeeef14ba1c1 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 22 Mar 2024 11:24:28 -0600 Subject: [PATCH 011/158] Fix two hillslope error messages. --- src/biogeophys/HillslopeHydrologyMod.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/biogeophys/HillslopeHydrologyMod.F90 b/src/biogeophys/HillslopeHydrologyMod.F90 index b2866df679..1fed9b28bb 100644 --- a/src/biogeophys/HillslopeHydrologyMod.F90 +++ b/src/biogeophys/HillslopeHydrologyMod.F90 @@ -335,7 +335,7 @@ subroutine InitHillslope(bounds,fsurdat) enddo call ncd_io(ncid=ncid, varname='hillslope_distance', flag='read', data=fhillslope_in, dim1name=grlnd, readvar=readvar) if (masterproc .and. .not. readvar) then - call endrun( 'ERROR:: hillslope_length not found on surface data set.'//errmsg(sourcefile, __LINE__) ) + call endrun( 'ERROR:: hillslope_distance not found on surface data set.'//errmsg(sourcefile, __LINE__) ) end if do l = bounds%begl,bounds%endl @@ -354,7 +354,7 @@ subroutine InitHillslope(bounds,fsurdat) call ncd_io(ncid=ncid, varname='hillslope_elevation', flag='read', data=fhillslope_in, dim1name=grlnd, readvar=readvar) if (masterproc .and. .not. readvar) then - call endrun( 'ERROR:: hillslope_height not found on surface data set.'//errmsg(sourcefile, __LINE__) ) + call endrun( 'ERROR:: hillslope_elevation not found on surface data set.'//errmsg(sourcefile, __LINE__) ) end if do l = bounds%begl,bounds%endl g = lun%gridcell(l) From b6dd9f986a212c142a609e04986e6978f901136c Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 22 Mar 2024 12:12:58 -0600 Subject: [PATCH 012/158] Move hillslope variables from fsurdat to hillslope_file. --- bld/CLMBuildNamelist.pm | 4 ++ .../namelist_definition_ctsm.xml | 5 ++ .../testmods_dirs/clm/Hillslope/user_nl_clm | 2 +- src/biogeophys/HillslopeHydrologyMod.F90 | 52 +++++++++---------- src/main/clm_initializeMod.F90 | 8 +-- src/main/clm_instMod.F90 | 4 +- src/main/clm_varctl.F90 | 1 + src/main/controlMod.F90 | 8 ++- src/main/histFileMod.F90 | 3 ++ src/main/restFileMod.F90 | 2 + src/main/surfrdMod.F90 | 26 +++++++--- 11 files changed, 74 insertions(+), 41 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 86b9943f34..dc89e932ca 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -3624,6 +3624,10 @@ sub setup_logic_hillslope { if ( (! &value_is_true($use_hillslope)) && &value_is_true($use_hillslope_routing) ) { $log->fatal_error("Cannot turn on use_hillslope_routing when use_hillslope is off\n" ); } + my $hillslope_file = $nl->get_value('hillslope_file'); + if ( &value_is_true($use_hillslope) && ( ! defined($hillslope_file) ) ) { + $log->fatal_error("You must provide hillslope_file if use_hillslope is .true.\n" ); + } } #------------------------------------------------------------------------------- diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index d2347121c1..d8cb2586cd 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -946,6 +946,11 @@ Full pathname datafile with fates parameters Full pathname of surface data file. + +Full pathname of hillslope data file. + + SNICAR (SNow, ICe, and Aerosol Radiative model) optical data file name diff --git a/cime_config/testdefs/testmods_dirs/clm/Hillslope/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/Hillslope/user_nl_clm index 4fc6fc2373..c750400672 100644 --- a/cime_config/testdefs/testmods_dirs/clm/Hillslope/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/Hillslope/user_nl_clm @@ -6,6 +6,6 @@ hillslope_transmissivity_method = 'LayerSum' hillslope_pft_distribution_method = 'PftLowlandUpland' hillslope_soil_profile_method = 'Uniform' -fsurdat = '$DIN_LOC_ROOT/lnd/clm2/testdata/surfdata_10x15_hist_2000_78pfts_c240216.synthetic_hillslopes.nc' +hillslope_file = '$DIN_LOC_ROOT/lnd/clm2/testdata/synthetic_cosphill_1.3.nc' use_ssre = .false. diff --git a/src/biogeophys/HillslopeHydrologyMod.F90 b/src/biogeophys/HillslopeHydrologyMod.F90 index 1fed9b28bb..8fccd762f0 100644 --- a/src/biogeophys/HillslopeHydrologyMod.F90 +++ b/src/biogeophys/HillslopeHydrologyMod.F90 @@ -168,7 +168,7 @@ end subroutine check_aquifer_layer !----------------------------------------------------------------------- - subroutine InitHillslope(bounds,fsurdat) + subroutine InitHillslope(bounds, hillslope_file) ! ! !DESCRIPTION: ! Initialize hillslope geomorphology from input dataset @@ -187,7 +187,7 @@ subroutine InitHillslope(bounds,fsurdat) ! ! !ARGUMENTS: type(bounds_type), intent(in) :: bounds - character(len=*) , intent(in) :: fsurdat ! surface data file name + character(len=*) , intent(in) :: hillslope_file ! hillslope data file name integer, pointer :: ihillslope_in(:,:) ! read in - integer integer, pointer :: ncolumns_hillslope_in(:) ! read in number of columns integer, allocatable :: ncolumns_hillslope(:) ! number of hillslope columns @@ -224,9 +224,9 @@ subroutine InitHillslope(bounds,fsurdat) ! consistency check call check_aquifer_layer() - ! Open surface dataset to read in data below + ! Open hillslope dataset to read in data below - call getfil (fsurdat, locfn, 0) + call getfil (hillslope_file, locfn, 0) call ncd_pio_openfile (ncid, locfn, 0) allocate( & @@ -248,7 +248,7 @@ subroutine InitHillslope(bounds,fsurdat) call ncd_io(ncid=ncid, varname='nhillcolumns', flag='read', data=ncolumns_hillslope_in, dim1name=grlnd, readvar=readvar) if (masterproc .and. .not. readvar) then - call endrun( 'ERROR:: nhillcolumns not found on surface data set.'//errmsg(sourcefile, __LINE__) ) + call endrun( 'ERROR:: nhillcolumns not found on hillslope data set.'//errmsg(sourcefile, __LINE__) ) end if do l = bounds%begl,bounds%endl g = lun%gridcell(l) @@ -266,7 +266,7 @@ subroutine InitHillslope(bounds,fsurdat) call ncd_io(ncid=ncid, varname='pct_hillslope', flag='read', data=fhillslope_in, dim1name=grlnd, readvar=readvar) if (masterproc .and. .not. readvar) then - call endrun( 'ERROR:: pct_hillslope not found on surface data set.'//errmsg(sourcefile, __LINE__) ) + call endrun( 'ERROR:: pct_hillslope not found on hillslope data set.'//errmsg(sourcefile, __LINE__) ) end if do l = bounds%begl,bounds%endl g = lun%gridcell(l) @@ -278,7 +278,7 @@ subroutine InitHillslope(bounds,fsurdat) call ncd_io(ncid=ncid, varname='hillslope_index', flag='read', data=ihillslope_in, dim1name=grlnd, readvar=readvar) if (masterproc .and. .not. readvar) then - call endrun( 'ERROR:: hillslope_index not found on surface data set.'//errmsg(sourcefile, __LINE__) ) + call endrun( 'ERROR:: hillslope_index not found on hillslope data set.'//errmsg(sourcefile, __LINE__) ) end if do l = bounds%begl,bounds%endl g = lun%gridcell(l) @@ -287,7 +287,7 @@ subroutine InitHillslope(bounds,fsurdat) call ncd_io(ncid=ncid, varname='column_index', flag='read', data=ihillslope_in, dim1name=grlnd, readvar=readvar) if (masterproc .and. .not. readvar) then - call endrun( 'ERROR:: column_index not found on surface data set.'//errmsg(sourcefile, __LINE__) ) + call endrun( 'ERROR:: column_index not found on hillslope data set.'//errmsg(sourcefile, __LINE__) ) end if do l = bounds%begl,bounds%endl g = lun%gridcell(l) @@ -296,7 +296,7 @@ subroutine InitHillslope(bounds,fsurdat) call ncd_io(ncid=ncid, varname='downhill_column_index', flag='read', data=ihillslope_in, dim1name=grlnd, readvar=readvar) if (masterproc .and. .not. readvar) then - call endrun( 'ERROR:: downhill_column_index not found on surface data set.'//errmsg(sourcefile, __LINE__) ) + call endrun( 'ERROR:: downhill_column_index not found on hillslope data set.'//errmsg(sourcefile, __LINE__) ) end if do l = bounds%begl,bounds%endl g = lun%gridcell(l) @@ -307,7 +307,7 @@ subroutine InitHillslope(bounds,fsurdat) allocate(fhillslope_in(bounds%begg:bounds%endg,max_columns_hillslope)) call ncd_io(ncid=ncid, varname='hillslope_slope', flag='read', data=fhillslope_in, dim1name=grlnd, readvar=readvar) if (masterproc .and. .not. readvar) then - call endrun( 'ERROR:: hillslope_slope not found on surface data set.'//errmsg(sourcefile, __LINE__) ) + call endrun( 'ERROR:: hillslope_slope not found on hillslope data set.'//errmsg(sourcefile, __LINE__) ) end if do l = bounds%begl,bounds%endl @@ -317,7 +317,7 @@ subroutine InitHillslope(bounds,fsurdat) call ncd_io(ncid=ncid, varname='hillslope_aspect', flag='read', data=fhillslope_in, dim1name=grlnd, readvar=readvar) if (masterproc .and. .not. readvar) then - call endrun( 'ERROR:: hillslope_aspect not found on surface data set.'//errmsg(sourcefile, __LINE__) ) + call endrun( 'ERROR:: hillslope_aspect not found on hillslope data set.'//errmsg(sourcefile, __LINE__) ) end if do l = bounds%begl,bounds%endl @@ -327,7 +327,7 @@ subroutine InitHillslope(bounds,fsurdat) call ncd_io(ncid=ncid, varname='hillslope_area', flag='read', data=fhillslope_in, dim1name=grlnd, readvar=readvar) if (masterproc .and. .not. readvar) then - call endrun( 'ERROR:: hillslope_area not found on surface data set.'//errmsg(sourcefile, __LINE__) ) + call endrun( 'ERROR:: hillslope_area not found on hillslope data set.'//errmsg(sourcefile, __LINE__) ) end if do l = bounds%begl,bounds%endl g = lun%gridcell(l) @@ -335,7 +335,7 @@ subroutine InitHillslope(bounds,fsurdat) enddo call ncd_io(ncid=ncid, varname='hillslope_distance', flag='read', data=fhillslope_in, dim1name=grlnd, readvar=readvar) if (masterproc .and. .not. readvar) then - call endrun( 'ERROR:: hillslope_distance not found on surface data set.'//errmsg(sourcefile, __LINE__) ) + call endrun( 'ERROR:: hillslope_distance not found on hillslope data set.'//errmsg(sourcefile, __LINE__) ) end if do l = bounds%begl,bounds%endl @@ -345,7 +345,7 @@ subroutine InitHillslope(bounds,fsurdat) call ncd_io(ncid=ncid, varname='hillslope_width', flag='read', data=fhillslope_in, dim1name=grlnd, readvar=readvar) if (masterproc .and. .not. readvar) then - call endrun( 'ERROR:: hillslope_width not found on surface data set.'//errmsg(sourcefile, __LINE__) ) + call endrun( 'ERROR:: hillslope_width not found on hillslope data set.'//errmsg(sourcefile, __LINE__) ) end if do l = bounds%begl,bounds%endl g = lun%gridcell(l) @@ -354,7 +354,7 @@ subroutine InitHillslope(bounds,fsurdat) call ncd_io(ncid=ncid, varname='hillslope_elevation', flag='read', data=fhillslope_in, dim1name=grlnd, readvar=readvar) if (masterproc .and. .not. readvar) then - call endrun( 'ERROR:: hillslope_elevation not found on surface data set.'//errmsg(sourcefile, __LINE__) ) + call endrun( 'ERROR:: hillslope_elevation not found on hillslope data set.'//errmsg(sourcefile, __LINE__) ) end if do l = bounds%begl,bounds%endl g = lun%gridcell(l) @@ -380,7 +380,7 @@ subroutine InitHillslope(bounds,fsurdat) call ncd_io(ncid=ncid, varname='hillslope_stream_depth', flag='read', data=fstream_in, dim1name=grlnd, readvar=readvar) if (masterproc .and. .not. readvar) then - call endrun( 'ERROR:: hillslope_stream_depth not found on surface data set.'//errmsg(sourcefile, __LINE__) ) + call endrun( 'ERROR:: hillslope_stream_depth not found on hillslope data set.'//errmsg(sourcefile, __LINE__) ) end if do l = bounds%begl,bounds%endl g = lun%gridcell(l) @@ -389,7 +389,7 @@ subroutine InitHillslope(bounds,fsurdat) call ncd_io(ncid=ncid, varname='hillslope_stream_width', flag='read', data=fstream_in, dim1name=grlnd, readvar=readvar) if (masterproc .and. .not. readvar) then - call endrun( 'ERROR:: hillslope_stream_width not found on surface data set.'//errmsg(sourcefile, __LINE__) ) + call endrun( 'ERROR:: hillslope_stream_width not found on hillslope data set.'//errmsg(sourcefile, __LINE__) ) end if do l = bounds%begl,bounds%endl g = lun%gridcell(l) @@ -398,7 +398,7 @@ subroutine InitHillslope(bounds,fsurdat) call ncd_io(ncid=ncid, varname='hillslope_stream_slope', flag='read', data=fstream_in, dim1name=grlnd, readvar=readvar) if (masterproc .and. .not. readvar) then - call endrun( 'ERROR:: hillslope_stream_slope not found on surface data set.'//errmsg(sourcefile, __LINE__) ) + call endrun( 'ERROR:: hillslope_stream_slope not found on hillslope data set.'//errmsg(sourcefile, __LINE__) ) end if do l = bounds%begl,bounds%endl g = lun%gridcell(l) @@ -504,11 +504,11 @@ subroutine InitHillslope(bounds,fsurdat) enddo end if - ! if missing hillslope information on surface dataset, + ! if missing hillslope information on dataset, ! call endrun if (ncolumns_hillslope(l) > 0 .and. sum(hillslope_area) == 0._r8 .and. masterproc) then write(iulog,*) 'Problem with input data: nhillcolumns is non-zero, but hillslope area is zero' - write(iulog,*) 'Check surface data for gridcell at (lon/lat): ', grc%londeg(g),grc%latdeg(g) + write(iulog,*) 'Check hillslope data for gridcell at (lon/lat): ', grc%londeg(g),grc%latdeg(g) call endrun( 'ERROR:: sum of hillslope areas is zero.'//errmsg(sourcefile, __LINE__) ) end if @@ -559,7 +559,7 @@ end subroutine InitHillslope !----------------------------------------------------------------------- - subroutine SetHillslopeSoilThickness(bounds,fsurdat,soil_depth_lowland_in,soil_depth_upland_in) + subroutine SetHillslopeSoilThickness(bounds, hillslope_file, soil_depth_lowland_in, soil_depth_upland_in) ! ! !DESCRIPTION: ! Set hillslope column nbedrock values @@ -578,7 +578,7 @@ subroutine SetHillslopeSoilThickness(bounds,fsurdat,soil_depth_lowland_in,soil_d ! ! !ARGUMENTS: type(bounds_type), intent(in) :: bounds - character(len=*) , intent(in) :: fsurdat ! surface data file name + character(len=*) , intent(in) :: hillslope_file ! hillslope data file name real(r8), intent(in), optional :: soil_depth_lowland_in real(r8), intent(in), optional :: soil_depth_upland_in real(r8), pointer :: fhillslope_in(:,:) ! read in - float @@ -599,14 +599,14 @@ subroutine SetHillslopeSoilThickness(bounds,fsurdat,soil_depth_lowland_in,soil_d if (soil_profile_method==soil_profile_from_file) then - ! Open surface dataset to read in data below - call getfil (fsurdat, locfn, 0) + ! Open hillslope dataset to read in data below + call getfil (hillslope_file, locfn, 0) call ncd_pio_openfile (ncid, locfn, 0) allocate(fhillslope_in(bounds%begg:bounds%endg,max_columns_hillslope)) call ncd_io(ncid=ncid, varname='hillslope_bedrock_depth', flag='read', data=fhillslope_in, dim1name=grlnd, readvar=readvar) if (masterproc .and. .not. readvar) then - call endrun( 'ERROR:: soil_profile_method = "FromFile", but hillslope_bedrock not found on surface data set.'//errmsg(sourcefile, __LINE__) ) + call endrun( 'ERROR:: soil_profile_method = "FromFile", but hillslope_bedrock not found on hillslope data set.'//errmsg(sourcefile, __LINE__) ) end if do l = bounds%begl,bounds%endl g = lun%gridcell(l) @@ -896,7 +896,7 @@ end subroutine HillslopeDominantLowlandPft subroutine HillslopePftFromFile(bounds,col_pftndx) ! ! !DESCRIPTION: - ! Reassign patch type using indices from surface data file + ! Reassign patch type using indices from data file ! Assumes one patch per hillslope column ! In preparation for this reassignment of patch type, only the ! first patch was given a non-zero weight in surfrd_hillslope. diff --git a/src/main/clm_initializeMod.F90 b/src/main/clm_initializeMod.F90 index 340a799908..e827419aba 100644 --- a/src/main/clm_initializeMod.F90 +++ b/src/main/clm_initializeMod.F90 @@ -135,8 +135,8 @@ subroutine initialize2(ni,nj) use clm_varpar , only : surfpft_lb, surfpft_ub use clm_varpar , only : nlevsno use clm_varpar , only : natpft_size,cft_size - use clm_varctl , only : fsurdat - use clm_varctl , only : finidat, finidat_interp_source, finidat_interp_dest, fsurdat + use clm_varctl , only : fsurdat, hillslope_file + use clm_varctl , only : finidat, finidat_interp_source, finidat_interp_dest use clm_varctl , only : use_cn, use_fates, use_fates_luh use clm_varctl , only : use_crop, ndep_from_cpl, fates_spitfire_mode use clm_varctl , only : use_hillslope @@ -253,7 +253,7 @@ subroutine initialize2(ni,nj) call pftcon%Init() ! Read surface dataset and set up subgrid weight arrays - call surfrd_get_data(begg, endg, ldomain, fsurdat, actual_numcft) + call surfrd_get_data(begg, endg, ldomain, fsurdat, hillslope_file, actual_numcft) if(use_fates) then @@ -304,7 +304,7 @@ subroutine initialize2(ni,nj) if (use_hillslope) then ! Initialize hillslope properties - call InitHillslope(bounds_proc, fsurdat) + call InitHillslope(bounds_proc, hillslope_file) endif ! Set filters diff --git a/src/main/clm_instMod.F90 b/src/main/clm_instMod.F90 index ae83a1b31f..210cff2c2e 100644 --- a/src/main/clm_instMod.F90 +++ b/src/main/clm_instMod.F90 @@ -188,7 +188,7 @@ subroutine clm_instInit(bounds) ! ! !USES: use clm_varpar , only : nlevsno - use controlMod , only : nlfilename, fsurdat + use controlMod , only : nlfilename, fsurdat, hillslope_file use domainMod , only : ldomain use SoilBiogeochemDecompCascadeMIMICSMod, only : init_decompcascade_mimics use SoilBiogeochemDecompCascadeBGCMod , only : init_decompcascade_bgc @@ -280,7 +280,7 @@ subroutine clm_instInit(bounds) ! Set hillslope column bedrock values if (use_hillslope) then - call SetHillslopeSoilThickness(bounds,fsurdat, & + call SetHillslopeSoilThickness(bounds, hillslope_file, & soil_depth_lowland_in=8.5_r8,& soil_depth_upland_in =2.0_r8) call setSoilLayerClass(bounds) diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index cb7e2e3931..5fa2602e5a 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -109,6 +109,7 @@ module clm_varctl character(len=fname_len), public :: finidat = ' ' ! initial conditions file name character(len=fname_len), public :: fsurdat = ' ' ! surface data file name + character(len=fname_len), public :: hillslope_file = ' ' ! hillslope data file name character(len=fname_len), public :: paramfile = ' ' ! ASCII data file with PFT physiological constants character(len=fname_len), public :: nrevsn = ' ' ! restart data file name for branch run character(len=fname_len), public :: fsnowoptics = ' ' ! snow optical properties file name diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index f65c8c7f47..eedb678ca3 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -148,7 +148,7 @@ subroutine control_init(dtime) ! Input datasets namelist /clm_inparm/ & - fsurdat, & + fsurdat, hillslope_file, & paramfile, fsnowoptics, fsnowaging ! History, restart options @@ -736,6 +736,7 @@ subroutine control_spmd() call mpi_bcast (finidat_interp_source, len(finidat_interp_source), MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (finidat_interp_dest, len(finidat_interp_dest), MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (fsurdat, len(fsurdat), MPI_CHARACTER, 0, mpicom, ier) + call mpi_bcast (hillslope_file, len(hillslope_file), MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (fatmlndfrc,len(fatmlndfrc),MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (paramfile, len(paramfile) , MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (fsnowoptics, len(fsnowoptics), MPI_CHARACTER, 0, mpicom, ier) @@ -1021,6 +1022,11 @@ subroutine control_print () else write(iulog,*) ' surface data = ',trim(fsurdat) end if + if (hillslope_file == ' ') then + write(iulog,*) ' hillslope_file, hillslope dataset not set' + else + write(iulog,*) ' hillslope data = ',trim(hillslope_file) + end if if (fatmlndfrc == ' ') then write(iulog,*) ' fatmlndfrc not set, setting frac/mask to 1' else diff --git a/src/main/histFileMod.F90 b/src/main/histFileMod.F90 index 8ae4ace7e3..b2df9abfab 100644 --- a/src/main/histFileMod.F90 +++ b/src/main/histFileMod.F90 @@ -2328,6 +2328,7 @@ subroutine htape_create (t, histrest) use clm_varpar , only : natpft_size, cft_size, maxpatch_glc, nlevdecomp_full, mxsowings, mxharvests use landunit_varcon , only : max_lunit use clm_varctl , only : caseid, ctitle, fsurdat, finidat, paramfile + use clm_varctl , only : hillslope_file use clm_varctl , only : version, hostname, username, conventions, source use clm_varctl , only : use_hillslope,nhillslope,max_columns_hillslope use domainMod , only : ldomain @@ -2428,6 +2429,8 @@ subroutine htape_create (t, histrest) call ncd_putatt(lnfid, ncd_global, 'case_id', trim(caseid)) str = get_filename(fsurdat) call ncd_putatt(lnfid, ncd_global, 'Surface_dataset', trim(str)) + str = get_filename(hillslope_file) + call ncd_putatt(lnfid, ncd_global, 'Hillslope_dataset', trim(str)) if (finidat == ' ') then str = 'arbitrary initialization' else diff --git a/src/main/restFileMod.F90 b/src/main/restFileMod.F90 index 6a574406fd..c7dbf0da72 100644 --- a/src/main/restFileMod.F90 +++ b/src/main/restFileMod.F90 @@ -503,6 +503,7 @@ subroutine restFile_dimset( ncid ) ! !USES: use clm_time_manager , only : get_nstep use clm_varctl , only : caseid, ctitle, version, username, hostname, fsurdat + use clm_varctl , only : hillslope_file use clm_varctl , only : conventions, source use dynSubgridControlMod , only : get_flanduse_timeseries use clm_varpar , only : numrad, nlevlak, nlevsno, nlevgrnd, nlevmaxurbgrnd, nlevcan @@ -569,6 +570,7 @@ subroutine restFile_dimset( ncid ) call ncd_putatt(ncid, NCD_GLOBAL, 'case_title' , trim(ctitle)) call ncd_putatt(ncid, NCD_GLOBAL, 'case_id' , trim(caseid)) call ncd_putatt(ncid, NCD_GLOBAL, 'surface_dataset', trim(fsurdat)) + call ncd_putatt(ncid, NCD_GLOBAL, 'hillslope_dataset', trim(hillslope_file)) call ncd_putatt(ncid, NCD_GLOBAL, 'flanduse_timeseries', trim(get_flanduse_timeseries())) call ncd_putatt(ncid, NCD_GLOBAL, 'title', 'CLM Restart information') diff --git a/src/main/surfrdMod.F90 b/src/main/surfrdMod.F90 index 12212e2160..88a4dbd30b 100644 --- a/src/main/surfrdMod.F90 +++ b/src/main/surfrdMod.F90 @@ -46,7 +46,7 @@ module surfrdMod contains !----------------------------------------------------------------------- - subroutine surfrd_get_data (begg, endg, ldomain, lfsurdat, actual_numcft) + subroutine surfrd_get_data (begg, endg, ldomain, lfsurdat, lhillslope_file, actual_numcft) ! ! !DESCRIPTION: ! Read the surface dataset and create subgrid weights. @@ -73,7 +73,8 @@ subroutine surfrd_get_data (begg, endg, ldomain, lfsurdat, actual_numcft) use clm_varctl , only : create_crop_landunit, convert_ocean_to_land, collapse_urban, & toosmall_soil, toosmall_crop, toosmall_glacier, & toosmall_lake, toosmall_wetland, toosmall_urban, & - n_dom_landunits + n_dom_landunits, & + use_hillslope use fileutils , only : getfil use domainMod , only : domain_type, domain_init, domain_clean use clm_instur , only : wt_lunit, topo_glc_mec, pct_urban_max @@ -87,6 +88,7 @@ subroutine surfrd_get_data (begg, endg, ldomain, lfsurdat, 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 + character(len=*), intent(in) :: lhillslope_file ! hillslope dataset filename ! ! !LOCAL VARIABLES: type(domain_type) :: surfdata_domain ! local domain associated with surface dataset @@ -97,7 +99,8 @@ subroutine surfrd_get_data (begg, endg, ldomain, lfsurdat, actual_numcft) character(len=16) :: lon_var, lat_var ! names of lat/lon on dataset logical :: readvar ! true => variable is on dataset real(r8) :: rmaxlon,rmaxlat ! local min/max vars - type(file_desc_t) :: ncid ! netcdf id + type(file_desc_t) :: ncid ! netcdf id for lfsurdat + type(file_desc_t) :: ncid_hillslope ! netcdf id for lhillslope_file logical :: istype_domain ! true => input file is of type domain logical :: isgrid2d ! true => intut grid is 2d @@ -110,6 +113,10 @@ subroutine surfrd_get_data (begg, endg, ldomain, lfsurdat, actual_numcft) write(iulog,*)'lfsurdat must be specified' call endrun(msg=errMsg(sourcefile, __LINE__)) endif + if (use_hillslope .and. lhillslope_file == ' ') then + write(iulog,*)'lhillslope_file must be specified' + call endrun(msg=errMsg(sourcefile, __LINE__)) + endif endif wt_lunit(:,:) = 0._r8 @@ -119,6 +126,10 @@ subroutine surfrd_get_data (begg, endg, ldomain, lfsurdat, actual_numcft) call getfil( lfsurdat, locfn, 0 ) call ncd_pio_openfile (ncid, trim(locfn), 0) + if (use_hillslope) then + call getfil( lhillslope_file, locfn, 0 ) + call ncd_pio_openfile (ncid_hillslope, trim(locfn), 0) + end if ! Cmopare surfdat_domain attributes to ldomain attributes @@ -183,7 +194,7 @@ subroutine surfrd_get_data (begg, endg, ldomain, lfsurdat, actual_numcft) ! Obtain vegetated landunit info - call surfrd_veg_all(begg, endg, ncid, ldomain%ns, actual_numcft) + call surfrd_veg_all(begg, endg, ncid, ncid_hillslope, ldomain%ns, actual_numcft) if (use_cndv) then call surfrd_veg_dgvm(begg, endg) @@ -766,7 +777,7 @@ subroutine surfrd_pftformat( begg, endg, ncid ) end subroutine surfrd_pftformat !----------------------------------------------------------------------- - subroutine surfrd_veg_all(begg, endg, ncid, ns, actual_numcft) + subroutine surfrd_veg_all(begg, endg, ncid, ncid_hillslope, ns, actual_numcft) ! ! !DESCRIPTION: ! Determine weight arrays for non-dynamic landuse mode @@ -783,7 +794,8 @@ subroutine surfrd_veg_all(begg, endg, ncid, ns, actual_numcft) ! !ARGUMENTS: implicit none integer, intent(in) :: begg, endg, actual_numcft - type(file_desc_t),intent(inout) :: ncid ! netcdf id + type(file_desc_t),intent(inout) :: ncid ! netcdf id for fsurdat + type(file_desc_t),intent(inout) :: ncid_hillslope ! netcdf id for hillslope_file integer ,intent(in) :: ns ! domain size ! ! !LOCAL VARIABLES: @@ -869,7 +881,7 @@ subroutine surfrd_veg_all(begg, endg, ncid, ns, actual_numcft) ! Obtain hillslope hydrology information and modify pft weights if (use_hillslope) then - call surfrd_hillslope(begg, endg, ncid, ns) + call surfrd_hillslope(begg, endg, ncid_hillslope, ns) endif ! Convert from percent to fraction From d6a204710c0b7bc812bea919b46a0c3dafe44f70 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 18 Sep 2024 15:08:41 -0600 Subject: [PATCH 013/158] Move how-to-make-mesh.md to the User's Guide; give extension .rst. Also makes it accessible from table of contents. Not actually changing file contents at this point. --- doc/source/users_guide/index.rst | 1 + .../using-mesh-maker/how-to-make-mesh.rst} | 0 .../users_guide/using-mesh-maker/index.rst | 17 +++++++++++++++++ 3 files changed, 18 insertions(+) rename doc/source/{how-to-make-mesh.md => users_guide/using-mesh-maker/how-to-make-mesh.rst} (100%) create mode 100644 doc/source/users_guide/using-mesh-maker/index.rst diff --git a/doc/source/users_guide/index.rst b/doc/source/users_guide/index.rst index 8c675c79db..0bb2dbd75d 100644 --- a/doc/source/users_guide/index.rst +++ b/doc/source/users_guide/index.rst @@ -26,5 +26,6 @@ running-single-points/index.rst trouble-shooting/index.rst testing/index.rst + using-mesh-maker/index.rst Documentation was built: |today| diff --git a/doc/source/how-to-make-mesh.md b/doc/source/users_guide/using-mesh-maker/how-to-make-mesh.rst similarity index 100% rename from doc/source/how-to-make-mesh.md rename to doc/source/users_guide/using-mesh-maker/how-to-make-mesh.rst diff --git a/doc/source/users_guide/using-mesh-maker/index.rst b/doc/source/users_guide/using-mesh-maker/index.rst new file mode 100644 index 0000000000..ecc20bab9c --- /dev/null +++ b/doc/source/users_guide/using-mesh-maker/index.rst @@ -0,0 +1,17 @@ +.. on documentation master file, created by + sphinx-quickstart on Tue Jan 31 19:46:36 2017. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +.. include:: ../substitutions.rst + +.. _using-mesh-maker-index: + +##################################### +Using mesh_maker +##################################### + +.. toctree:: + :maxdepth: 2 + + how-to-make-mesh.rst From f84c5b7292453e665c33dd4f6351780d929c29c6 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 18 Sep 2024 15:25:50 -0600 Subject: [PATCH 014/158] how-to-make-mesh: Markdown to RestructuredText. --- .../using-mesh-maker/how-to-make-mesh.rst | 139 +++++++++--------- .../using-mesh-maker/test_mesh_1d_global.png | 3 + .../test_mesh_1d_regional.png | 3 + .../wrf_domain_regional_plot.png | 3 + 4 files changed, 81 insertions(+), 67 deletions(-) create mode 100644 doc/source/users_guide/using-mesh-maker/test_mesh_1d_global.png create mode 100644 doc/source/users_guide/using-mesh-maker/test_mesh_1d_regional.png create mode 100644 doc/source/users_guide/using-mesh-maker/wrf_domain_regional_plot.png diff --git a/doc/source/users_guide/using-mesh-maker/how-to-make-mesh.rst b/doc/source/users_guide/using-mesh-maker/how-to-make-mesh.rst index 0620598e05..9e2bd9ca04 100644 --- a/doc/source/users_guide/using-mesh-maker/how-to-make-mesh.rst +++ b/doc/source/users_guide/using-mesh-maker/how-to-make-mesh.rst @@ -1,98 +1,103 @@ -# Creating an ESMF mesh file from a netCDF file +.. include:: ../substitutions.rst -This gist includes instructions for creating and visualizing a mesh file from a netcdf file with valid 1D or 2D lats and lons coordinates. +.. _how-to-make-mesh: + +=============================================== + Creating an ESMF mesh file from a netCDF file +=============================================== -* **ESMF Mesh file** aka **Unstructured Grid File Format** is a netcdf file (format) that includes the information about the grids coordinates and their connectivity to each other. +This gist includes instructions for creating and visualizing a mesh file from a netcdf file with valid 1D or 2D lats and lons coordinates. -Additional information about ESMF mesh files are available [here](https://earthsystemmodeling.org/docs/release/ESMF_8_0_1/ESMF_refdoc/node3.html#SECTION03028200000000000000). +.. note:: **ESMF Mesh file** aka **Unstructured Grid File Format** is a netcdf file (format) that includes the information about the grids coordinates and their connectivity to each other. Additional information about ESMF mesh files are available `here `_. ------- +Example: Making and visualizing a mesh file +------------------------------------------- -In this example, we will use `./mesh_maker.py` which uses `mesh_type.py` to create a mesh file and visualize it. +In this example, we will use ``./mesh_maker.py`` which uses ``mesh_type.py`` to create a mesh file and visualize it. 1- First clone my fork and branch that includes these capabilities: -``` Shell -git clone https://github.com/negin513/ctsm.git ctsm_mesh -cd ctsm_mesh -git checkout subset_mesh_dask -``` +:: + + git clone https://github.com/negin513/ctsm.git ctsm_mesh + cd ctsm_mesh + + git checkout subset_mesh_dask + 2- Next run mesh_maker.py for a netcdf file: -``` -cd tools/site_and_regional -``` +:: + + cd tools/site_and_regional + Check all the avaialble options: -``` -./mesh_maker.py --help -``` +:: + + ./mesh_maker.py --help + The output shows all available options for this script: -``` -|------------------------------------------------------------------| -|--------------------- Instructions -----------------------------| -|------------------------------------------------------------------| -This script creates ESMF unstructured GRID (mesh file) from a netcdf -file with valid lats and lons. Provided lats and lons can be 1D or 2D. - -For example for running WRF-CTSM cases, the user can create a mesh -file for their domain : - ./mesh_maker.py --input wrfinput_d01 --output my_region - --lat XLAT --lon XLONG --verbose - -optional arguments: - -h, --help show this help message and exit - --input INPUT Netcdf input file for creating ESMF mesh. - --output OUTPUT Name of the ESMF mesh created. - --outdir OUT_DIR Output directory (only if name of output mesh is not - defined) - --lat LAT_NAME Name of latitude varibale on netcdf input file. If none - given, looks to find variables that include 'lat'. - --lon LON_NAME Name of latitude varibale on netcdf input file. If none - given, looks to find variables that include 'lon'. - --mask MASK_NAME Name of mask varibale on netcdf input file. If none given, - create a fake mask with values of 1. - --area AREA_NAME Name of area variable on netcdf input file. If none given, - ESMF calculates element areas automatically. - --overwrite If meshfile exists, overwrite the meshfile. - -v, --verbose Increase output verbosity - - ``` - + +:: + + |------------------------------------------------------------------| + |--------------------- Instructions -----------------------------| + |------------------------------------------------------------------| + This script creates ESMF unstructured GRID (mesh file) from a netcdf + file with valid lats and lons. Provided lats and lons can be 1D or 2D. + + For example for running WRF-CTSM cases, the user can create a mesh + file for their domain : + ./mesh_maker.py --input wrfinput_d01 --output my_region + --lat XLAT --lon XLONG --verbose + + optional arguments: + -h, --help show this help message and exit + --input INPUT Netcdf input file for creating ESMF mesh. + --output OUTPUT Name of the ESMF mesh created. + --outdir OUT_DIR Output directory (only if name of output mesh is not + defined) + --lat LAT_NAME Name of latitude varibale on netcdf input file. If none + given, looks to find variables that include 'lat'. + --lon LON_NAME Name of latitude varibale on netcdf input file. If none + given, looks to find variables that include 'lon'. + --mask MASK_NAME Name of mask varibale on netcdf input file. If none given, + create a fake mask with values of 1. + --area AREA_NAME Name of area variable on netcdf input file. If none given, + ESMF calculates element areas automatically. + --overwrite If meshfile exists, overwrite the meshfile. + -v, --verbose Increase output verbosity + Let's create a mesh file from a netcdf file with 1D lats and lons. On the sample files provided 1D lat and long coordinates are saved on `lsmlat` and `lsmlon` variables. -``` -./mesh_maker.py --input /glade/scratch/negins/example_files/surfdata_4x5_hist_78pfts_CMIP6_simyr1850_275.0-330.0_-40-15_c220705.nc --output test_mesh_1d.nc --lat lsmlat --lon lsmlon --overwrite -``` -`--verbose` option also provide additional information for debugging. +:: -This script will create regional and global mesh plots. For example for the above files, the plos are: -test_mesh_1d_regional.png -![image](https://user-images.githubusercontent.com/17344536/200441736-972a8136-5c05-4bc9-9bca-b498d972914a.png) + ./mesh_maker.py --input /glade/scratch/negins/example_files/surfdata_4x5_hist_78pfts_CMIP6_simyr1850_275.0-330.0_-40-15_c220705.nc --output test_mesh_1d.nc --lat lsmlat --lon lsmlon --overwrite +``--verbose`` option also provide additional information for debugging. -test_mesh_1d_global.png +This script will create regional and global mesh plots. For example for the above files, the plos are: -![image](https://user-images.githubusercontent.com/17344536/200441753-d06e95d1-d85b-4216-9c23-d11ba89a31e4.png) +.. figure:: test_mesh_1d_regional.png +.. figure:: test_mesh_1d_global.png +Example: Creating Mesh files for a WRF domain +--------------------------------------------- ------- - ## Creating Mesh files for a WRF domain: -For running WRF-CTSM cases, we need to create ESMF mesh files for the WRF domain. We can create mesh file from wrfinput (wrf initial condition files). wrfinput has 2D coordinate information on `XLAT` and `XLONG` variable. +For running WRF-CTSM cases, we need to create ESMF mesh files for the WRF domain. We can create mesh file from wrfinput (wrf initial condition files). wrfinput has 2D coordinate information on ``XLAT`` and ``XLONG`` variable. For example, let's create a mesh file from a WRF input file for WRF-CTSM run. - ``` -./mesh_maker.py --input /glade/scratch/negins/example_files/wrfinput_d01 --output test_mesh_wrf.nc --lat XLAT --lon XLONG --overwrite -``` -This produce mesh files for running for our WRF domain. +:: + + ./mesh_maker.py --input /glade/scratch/negins/example_files/wrfinput_d01 --output test_mesh_wrf.nc --lat XLAT --lon XLONG --overwrite -Here is how the regional plot looks like for this mesh file: - ![image](https://user-images.githubusercontent.com/17344536/200442002-1ee5595c-9252-4934-a07c-2f6ad86aff1b.png) +This produce mesh files for running for our WRF domain. +Here is how the regional plot looks like for this mesh file: - \ No newline at end of file +.. figure:: wrf_domain_regional_plot.png diff --git a/doc/source/users_guide/using-mesh-maker/test_mesh_1d_global.png b/doc/source/users_guide/using-mesh-maker/test_mesh_1d_global.png new file mode 100644 index 0000000000..3245fc621a --- /dev/null +++ b/doc/source/users_guide/using-mesh-maker/test_mesh_1d_global.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a93aa72d564e1533b1217cccb0f34373d0c73b53809a30fc70fa92a464d6f24b +size 309926 diff --git a/doc/source/users_guide/using-mesh-maker/test_mesh_1d_regional.png b/doc/source/users_guide/using-mesh-maker/test_mesh_1d_regional.png new file mode 100644 index 0000000000..cd033b24f3 --- /dev/null +++ b/doc/source/users_guide/using-mesh-maker/test_mesh_1d_regional.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e19d289cfb7368c2316ef0619ca70b8c5377b549b01e4811c4c6b78ee0b82a4a +size 222864 diff --git a/doc/source/users_guide/using-mesh-maker/wrf_domain_regional_plot.png b/doc/source/users_guide/using-mesh-maker/wrf_domain_regional_plot.png new file mode 100644 index 0000000000..c1c79feca5 --- /dev/null +++ b/doc/source/users_guide/using-mesh-maker/wrf_domain_regional_plot.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aec6232e209815a6aa99f10d1b740e32407279756516ee394eb2a5c8cd496650 +size 1199433 From 2a6ed6dc90409220da0a179fd3ffa688fd939de7 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 18 Sep 2024 15:46:11 -0600 Subject: [PATCH 015/158] Improve mesh_maker instructions. * The experience of making a mesh from an input with 1d vs. 2d coordinates is identical, so only provide one example. * In example, use as input file the 5x5_amazon surface dataset included with CTSM. * Various wording and typo fixes. --- .../using-mesh-maker/how-to-make-mesh.rst | 77 +++++-------------- 1 file changed, 19 insertions(+), 58 deletions(-) diff --git a/doc/source/users_guide/using-mesh-maker/how-to-make-mesh.rst b/doc/source/users_guide/using-mesh-maker/how-to-make-mesh.rst index 9e2bd9ca04..f830413b2f 100644 --- a/doc/source/users_guide/using-mesh-maker/how-to-make-mesh.rst +++ b/doc/source/users_guide/using-mesh-maker/how-to-make-mesh.rst @@ -6,98 +6,59 @@ Creating an ESMF mesh file from a netCDF file =============================================== -This gist includes instructions for creating and visualizing a mesh file from a netcdf file with valid 1D or 2D lats and lons coordinates. +This page includes instructions for using the ``mesh_maker`` tool to create and visualize a mesh file from a netCDF file with valid 1D or 2D latitude and longitude coordinates. -.. note:: **ESMF Mesh file** aka **Unstructured Grid File Format** is a netcdf file (format) that includes the information about the grids coordinates and their connectivity to each other. Additional information about ESMF mesh files are available `here `_. +.. note:: An **ESMF mesh file** is a netCDF file that includes the information about the grid's coordinates and their connectivity to each other in an **Unstructured Grid Format**. Additional information about ESMF mesh files is available `here `_. -Example: Making and visualizing a mesh file -------------------------------------------- - -In this example, we will use ``./mesh_maker.py`` which uses ``mesh_type.py`` to create a mesh file and visualize it. - -1- First clone my fork and branch that includes these capabilities: +You can check out the ``mesh_maker`` options like so: :: - git clone https://github.com/negin513/ctsm.git ctsm_mesh - cd ctsm_mesh + > tools/site_and_regional/mesh_maker --help - git checkout subset_mesh_dask - - -2- Next run mesh_maker.py for a netcdf file: - -:: - - cd tools/site_and_regional - -Check all the avaialble options: - -:: - - ./mesh_maker.py --help - - -The output shows all available options for this script: - -:: - |------------------------------------------------------------------| |--------------------- Instructions -----------------------------| |------------------------------------------------------------------| - This script creates ESMF unstructured GRID (mesh file) from a netcdf + This script creates ESMF unstructured GRID (mesh file) from a netCDF file with valid lats and lons. Provided lats and lons can be 1D or 2D. - + For example for running WRF-CTSM cases, the user can create a mesh file for their domain : ./mesh_maker.py --input wrfinput_d01 --output my_region --lat XLAT --lon XLONG --verbose - + optional arguments: -h, --help show this help message and exit --input INPUT Netcdf input file for creating ESMF mesh. --output OUTPUT Name of the ESMF mesh created. --outdir OUT_DIR Output directory (only if name of output mesh is not defined) - --lat LAT_NAME Name of latitude varibale on netcdf input file. If none + --lat LAT_NAME Name of latitude varibale on netCDF input file. If none given, looks to find variables that include 'lat'. - --lon LON_NAME Name of latitude varibale on netcdf input file. If none + --lon LON_NAME Name of latitude varibale on netCDF input file. If none given, looks to find variables that include 'lon'. - --mask MASK_NAME Name of mask varibale on netcdf input file. If none given, + --mask MASK_NAME Name of mask varibale on netCDF input file. If none given, create a fake mask with values of 1. - --area AREA_NAME Name of area variable on netcdf input file. If none given, + --area AREA_NAME Name of area variable on netCDF input file. If none given, ESMF calculates element areas automatically. --overwrite If meshfile exists, overwrite the meshfile. -v, --verbose Increase output verbosity -Let's create a mesh file from a netcdf file with 1D lats and lons. On the sample files provided 1D lat and long coordinates are saved on `lsmlat` and `lsmlon` variables. +Example: Making and visualizing a mesh file +------------------------------------------- + +In this example, we will use ``mesh_maker`` to create a mesh file from a netCDF file with 2D latitudes and longitudes. On the sample input provided, those coordinates are saved on the ``LATIXY`` and ``LONGXY`` variables, respectively. :: - ./mesh_maker.py --input /glade/scratch/negins/example_files/surfdata_4x5_hist_78pfts_CMIP6_simyr1850_275.0-330.0_-40-15_c220705.nc --output test_mesh_1d.nc --lat lsmlat --lon lsmlon --overwrite + input_file="python/ctsm/test/testinputs/surfdata_5x5_amazon_hist_78pfts_CMIP6_2000_c230517.nc" + output_file="meshfile_5x5_amazon.nc" + tools/site_and_regional/mesh_maker --input "${input_file}" --output "${output_file}" --lon LONGXY --lat LATIXY ``--verbose`` option also provide additional information for debugging. -This script will create regional and global mesh plots. For example for the above files, the plos are: +This script will create regional and global mesh plots. For example for the above files, the plots are: .. figure:: test_mesh_1d_regional.png .. figure:: test_mesh_1d_global.png - -Example: Creating Mesh files for a WRF domain ---------------------------------------------- - -For running WRF-CTSM cases, we need to create ESMF mesh files for the WRF domain. We can create mesh file from wrfinput (wrf initial condition files). wrfinput has 2D coordinate information on ``XLAT`` and ``XLONG`` variable. - -For example, let's create a mesh file from a WRF input file for WRF-CTSM run. - -:: - - ./mesh_maker.py --input /glade/scratch/negins/example_files/wrfinput_d01 --output test_mesh_wrf.nc --lat XLAT --lon XLONG --overwrite - - -This produce mesh files for running for our WRF domain. - -Here is how the regional plot looks like for this mesh file: - -.. figure:: wrf_domain_regional_plot.png From 1b994352afc87c2ff725341f3db1f8d1cf733190 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 18 Sep 2024 16:40:08 -0600 Subject: [PATCH 016/158] Fix typo in mesh_plotter arg description. --- python/ctsm/mesh_plotter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/ctsm/mesh_plotter.py b/python/ctsm/mesh_plotter.py index 7bcbae6fb4..db4a649f6c 100644 --- a/python/ctsm/mesh_plotter.py +++ b/python/ctsm/mesh_plotter.py @@ -62,7 +62,7 @@ def get_parser(): parser.add_argument( "--overwrite", - help="If plots xists, overwrite them.", + help="If plots exist, overwrite them.", action="store_true", dest="overwrite", required=False, From fc261d4b3204df9caf9ad32afc2b18bc1ad6b783 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 18 Sep 2024 16:40:45 -0600 Subject: [PATCH 017/158] mesh_plotter now stops if output file exists w/o --overwrite given. --- python/ctsm/mesh_plotter.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python/ctsm/mesh_plotter.py b/python/ctsm/mesh_plotter.py index db4a649f6c..f26e9bff1f 100644 --- a/python/ctsm/mesh_plotter.py +++ b/python/ctsm/mesh_plotter.py @@ -148,8 +148,13 @@ def main(): this_mesh.read_file(ds) plot_regional = os.path.splitext(mesh_out)[0] + "_regional" + ".png" + file_exists_msg = "File already exists but --overwrite not given: " + if os.path.exists(plot_regional) and not args.overwrite: + raise FileExistsError(file_exists_msg + plot_regional) plot_global = os.path.splitext(mesh_out)[0] + "_global" + ".png" + if os.path.exists(plot_global) and not args.overwrite: + raise FileExistsError(file_exists_msg + plot_global) this_mesh.make_mesh_plot(plot_regional, plot_global) From 627940aef18f7dc84a79eaef4593f2381356d8d7 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 18 Sep 2024 16:41:33 -0600 Subject: [PATCH 018/158] Add --dpi option to mesh_plotter. --- python/ctsm/mesh_plotter.py | 9 ++++++++- python/ctsm/site_and_regional/mesh_plot_type.py | 10 +++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/python/ctsm/mesh_plotter.py b/python/ctsm/mesh_plotter.py index f26e9bff1f..3ce018e7a7 100644 --- a/python/ctsm/mesh_plotter.py +++ b/python/ctsm/mesh_plotter.py @@ -68,6 +68,13 @@ def get_parser(): required=False, ) + default_dpi = 300 + parser.add_argument( + "--dpi", + help=f"Dots per square inch in output; default {default_dpi}", + type=float, + ) + add_logging_args(parser) return parser @@ -156,7 +163,7 @@ def main(): if os.path.exists(plot_global) and not args.overwrite: raise FileExistsError(file_exists_msg + plot_global) - this_mesh.make_mesh_plot(plot_regional, plot_global) + this_mesh.make_mesh_plot(plot_regional, plot_global, args.dpi) if __name__ == "__main__": diff --git a/python/ctsm/site_and_regional/mesh_plot_type.py b/python/ctsm/site_and_regional/mesh_plot_type.py index 872c0e8101..3f52918408 100644 --- a/python/ctsm/site_and_regional/mesh_plot_type.py +++ b/python/ctsm/site_and_regional/mesh_plot_type.py @@ -24,7 +24,7 @@ class MeshPlotType(MeshType): Extend mesh type with some advanced plotting capability """ - def make_mesh_plot(self, plot_regional, plot_global): + def make_mesh_plot(self, plot_regional, plot_global, dpi): """ Create plots for the ESMF mesh file @@ -36,10 +36,10 @@ def make_mesh_plot(self, plot_regional, plot_global): The path to write the ESMF meshfile global plot """ - self.mesh_plot(plot_regional, regional=True) - self.mesh_plot(plot_global, regional=False) + self.mesh_plot(plot_regional, regional=True, dpi=dpi) + self.mesh_plot(plot_global, regional=False, dpi=dpi) - def mesh_plot(self, plot_file, regional): + def mesh_plot(self, plot_file, regional, dpi): """Make a plot of a mesh file in either a regional or global grid""" # -- regional settings if regional: @@ -131,6 +131,6 @@ def mesh_plot(self, plot_file, regional): ax.legend(handles, labels) - plt.savefig(plot_file, bbox_inches="tight") + plt.savefig(plot_file, bbox_inches="tight", dpi=dpi) logger.info("Successfully created %s plots for ESMF Mesh file : %s", plot_type, plot_file) From 7ad5fd0fcb010fcbb972fe9c0e4bebdbc1d7df37 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 18 Sep 2024 16:41:54 -0600 Subject: [PATCH 019/158] More reasonable marker sizes in mesh_plotter. --- python/ctsm/site_and_regional/mesh_plot_type.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/ctsm/site_and_regional/mesh_plot_type.py b/python/ctsm/site_and_regional/mesh_plot_type.py index 3f52918408..8ba13ffa53 100644 --- a/python/ctsm/site_and_regional/mesh_plot_type.py +++ b/python/ctsm/site_and_regional/mesh_plot_type.py @@ -49,7 +49,7 @@ def mesh_plot(self, plot_file, regional, dpi): plot_type = "regional" line_width = 1 marker = "x" - marker_size = 1 + marker_size = 50 # global settings else: fig = plt.figure(num=None, figsize=(15, 10), facecolor="w", edgecolor="k") @@ -58,7 +58,7 @@ def mesh_plot(self, plot_file, regional, dpi): plot_type = "global" line_width = 0.5 marker = "o" - marker_size = None + marker_size = 0.1 ax.add_feature(cfeature.COASTLINE, edgecolor="black") ax.add_feature(cfeature.BORDERS, edgecolor="black") From 0eed0336363f964a897f283aa1e88bde48e070c1 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 19 Sep 2024 10:36:01 -0600 Subject: [PATCH 020/158] Convert I1850 hillslope 5x5_amazon tests to I2000. Avoids requiring new fsurdat. --- cime_config/testdefs/ExpectedTestFails.xml | 2 +- cime_config/testdefs/testlist_clm.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index e18b15a26e..a6ca05446b 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -194,7 +194,7 @@ - + FAIL #2423 diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index d1c3171c98..5750e9a027 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3530,7 +3530,7 @@ - + @@ -3540,7 +3540,7 @@ - + From 08d0923c54fc89da2a7ef698722b6282506bf745 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 19 Sep 2024 11:21:39 -0600 Subject: [PATCH 021/158] Add non-serial HillslopeC 5x5_amazon test to hillslope suite. --- cime_config/testdefs/testlist_clm.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 5750e9a027..79cf2efbcd 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3543,6 +3543,7 @@ + From 7242a6bfc8029fa4b270fabc3e6327f5d5960b1c Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 19 Sep 2024 11:22:35 -0600 Subject: [PATCH 022/158] Add issue reference to non-serial HillslopeC 5x5_amazon test. --- cime_config/testdefs/testlist_clm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 79cf2efbcd..b92c62be15 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3547,7 +3547,7 @@ - + From 8361f8b4719c63e7e171d900cbd175ca1e7ec716 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 19 Sep 2024 11:34:21 -0600 Subject: [PATCH 023/158] Fix HillslopeC test in expected fails list. --- cime_config/testdefs/ExpectedTestFails.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index a6ca05446b..35c452b88c 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -194,7 +194,7 @@ - + FAIL #2423 From edbef5f353cbf37fa3dfbeb1ebad1b0322e3f814 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 18 Sep 2024 17:14:37 -0600 Subject: [PATCH 024/158] Add mesh_plotter instructions. --- .../using-mesh-maker/how-to-make-mesh.rst | 15 +++++++++------ .../using-mesh-maker/test_c240918_global.png | 3 +++ .../using-mesh-maker/test_c240918_regional.png | 3 +++ .../using-mesh-maker/test_mesh_1d_global.png | 3 --- .../using-mesh-maker/test_mesh_1d_regional.png | 3 --- .../using-mesh-maker/wrf_domain_regional_plot.png | 3 --- python/ctsm/site_and_regional/mesh_plot_type.py | 4 ++-- 7 files changed, 17 insertions(+), 17 deletions(-) create mode 100644 doc/source/users_guide/using-mesh-maker/test_c240918_global.png create mode 100644 doc/source/users_guide/using-mesh-maker/test_c240918_regional.png delete mode 100644 doc/source/users_guide/using-mesh-maker/test_mesh_1d_global.png delete mode 100644 doc/source/users_guide/using-mesh-maker/test_mesh_1d_regional.png delete mode 100644 doc/source/users_guide/using-mesh-maker/wrf_domain_regional_plot.png diff --git a/doc/source/users_guide/using-mesh-maker/how-to-make-mesh.rst b/doc/source/users_guide/using-mesh-maker/how-to-make-mesh.rst index f830413b2f..f87394fd89 100644 --- a/doc/source/users_guide/using-mesh-maker/how-to-make-mesh.rst +++ b/doc/source/users_guide/using-mesh-maker/how-to-make-mesh.rst @@ -6,7 +6,7 @@ Creating an ESMF mesh file from a netCDF file =============================================== -This page includes instructions for using the ``mesh_maker`` tool to create and visualize a mesh file from a netCDF file with valid 1D or 2D latitude and longitude coordinates. +This page includes instructions for using the ``mesh_maker`` tool to create a mesh file from a netCDF file with valid 1D or 2D latitude and longitude coordinates. It also shows how to use ``mesh_plotter`` to visualize a mesh file. .. note:: An **ESMF mesh file** is a netCDF file that includes the information about the grid's coordinates and their connectivity to each other in an **Unstructured Grid Format**. Additional information about ESMF mesh files is available `here `_. @@ -53,12 +53,15 @@ In this example, we will use ``mesh_maker`` to create a mesh file from a netCDF input_file="python/ctsm/test/testinputs/surfdata_5x5_amazon_hist_78pfts_CMIP6_2000_c230517.nc" output_file="meshfile_5x5_amazon.nc" + + # Create the file. (Add --verbose for additional debugging information.) tools/site_and_regional/mesh_maker --input "${input_file}" --output "${output_file}" --lon LONGXY --lat LATIXY + + # Visualize the meshes + tools/site_and_regional/mesh_plotter --input "${output_file}" -``--verbose`` option also provide additional information for debugging. - -This script will create regional and global mesh plots. For example for the above files, the plots are: +This produces two figures: -.. figure:: test_mesh_1d_regional.png +.. figure:: test_c240918_regional.png -.. figure:: test_mesh_1d_global.png +.. figure:: test_c240918_global.png diff --git a/doc/source/users_guide/using-mesh-maker/test_c240918_global.png b/doc/source/users_guide/using-mesh-maker/test_c240918_global.png new file mode 100644 index 0000000000..b951c570ab --- /dev/null +++ b/doc/source/users_guide/using-mesh-maker/test_c240918_global.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:48f47d585b38798710f59edf4cee8fd6b5cb77c81ec1160749fec706c0b106b4 +size 1031528 diff --git a/doc/source/users_guide/using-mesh-maker/test_c240918_regional.png b/doc/source/users_guide/using-mesh-maker/test_c240918_regional.png new file mode 100644 index 0000000000..f1b761ba10 --- /dev/null +++ b/doc/source/users_guide/using-mesh-maker/test_c240918_regional.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1dfaa42056d68629c2c6ba1e847ae5e462fccf7d2175d6f6b4d65d5b3aad7491 +size 642577 diff --git a/doc/source/users_guide/using-mesh-maker/test_mesh_1d_global.png b/doc/source/users_guide/using-mesh-maker/test_mesh_1d_global.png deleted file mode 100644 index 3245fc621a..0000000000 --- a/doc/source/users_guide/using-mesh-maker/test_mesh_1d_global.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a93aa72d564e1533b1217cccb0f34373d0c73b53809a30fc70fa92a464d6f24b -size 309926 diff --git a/doc/source/users_guide/using-mesh-maker/test_mesh_1d_regional.png b/doc/source/users_guide/using-mesh-maker/test_mesh_1d_regional.png deleted file mode 100644 index cd033b24f3..0000000000 --- a/doc/source/users_guide/using-mesh-maker/test_mesh_1d_regional.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e19d289cfb7368c2316ef0619ca70b8c5377b549b01e4811c4c6b78ee0b82a4a -size 222864 diff --git a/doc/source/users_guide/using-mesh-maker/wrf_domain_regional_plot.png b/doc/source/users_guide/using-mesh-maker/wrf_domain_regional_plot.png deleted file mode 100644 index c1c79feca5..0000000000 --- a/doc/source/users_guide/using-mesh-maker/wrf_domain_regional_plot.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:aec6232e209815a6aa99f10d1b740e32407279756516ee394eb2a5c8cd496650 -size 1199433 diff --git a/python/ctsm/site_and_regional/mesh_plot_type.py b/python/ctsm/site_and_regional/mesh_plot_type.py index 872c0e8101..806e884cbe 100644 --- a/python/ctsm/site_and_regional/mesh_plot_type.py +++ b/python/ctsm/site_and_regional/mesh_plot_type.py @@ -49,7 +49,7 @@ def mesh_plot(self, plot_file, regional): plot_type = "regional" line_width = 1 marker = "x" - marker_size = 1 + marker_size = None # global settings else: fig = plt.figure(num=None, figsize=(15, 10), facecolor="w", edgecolor="k") @@ -58,7 +58,7 @@ def mesh_plot(self, plot_file, regional): plot_type = "global" line_width = 0.5 marker = "o" - marker_size = None + marker_size = 0.01 ax.add_feature(cfeature.COASTLINE, edgecolor="black") ax.add_feature(cfeature.BORDERS, edgecolor="black") From 5fb68ac1bf2ff90eddb1e759573ebd31c4bf66e6 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 19 Sep 2024 19:11:56 -0600 Subject: [PATCH 025/158] UG: Fix path of example mksurfdata_esmf namelist. --- .../users_guide/using-clm-tools/what-are-the-clm-tools.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst b/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst index 664e23a220..db5cf10798 100644 --- a/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst +++ b/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst @@ -39,7 +39,7 @@ Running FORTRAN tools with namelists ./program < namelist -There is a sample namelist called ``$CTSMROOT/tools/mksurfdata_esmf/mksurfdata_esmf.namleist`` that shows you what the namelist should look like. **mksurfdata_esmf** also has a script that creates the namelist and runs the program for you. Namelists that you create should be similar to the example namelist. The namelist values are also documented along with the other namelists in the: +There is a sample namelist called ``$CTSMROOT/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml`` that shows you what the namelist should look like. **mksurfdata_esmf** also has a script that creates the namelist and runs the program for you. Namelists that you create should be similar to the example namelist. The namelist values are also documented along with the other namelists in the: :: $CTSMROOT/bld/namelist_files/namelist_definition.xml`` file From 2d39418b6e897a62f77c758e7bdb0a2df44e006e Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 19 Sep 2024 19:41:20 -0600 Subject: [PATCH 026/158] Add double backticks in lots of places. --- ...w-Files-to-the-build-namelist-Database.rst | 2 +- .../Adding-Resolution-Names.rst | 2 +- .../users_guide/overview/introduction.rst | 2 +- .../users_guide/overview/quickstart.rst | 2 +- .../running-pts_mode-configurations.rst | 2 +- .../running-single-point-configurations.rst | 4 +- ...point-and-regional-grid-configurations.rst | 2 +- ...transient-historical-CO2-concentration.rst | 2 +- .../Running-the-prognostic-crop-model.rst | 2 +- .../Running-with-irrigation.rst | 2 +- ...ning-up-the-biogeochemistry-BGC-spinup.rst | 8 +- .../customizing-the-clm-configuration.rst | 90 +++++++++---------- .../customizing-the-clm-namelist.rst | 22 ++--- doc/source/users_guide/testing/testing.rst | 4 +- .../trouble-shooting/trouble-shooting.rst | 16 ++-- .../building-the-clm-tools.rst | 18 ++-- .../users_guide/using-clm-tools/cprnc.rst | 2 +- .../using-clm-tools/creating-domain-files.rst | 8 +- ...g-input-for-surface-dataset-generation.rst | 2 +- .../creating-surface-datasets.rst | 16 ++-- .../what-are-the-clm-tools.rst | 20 ++--- 21 files changed, 114 insertions(+), 114 deletions(-) diff --git a/doc/source/users_guide/adding-new-resolutions/Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst b/doc/source/users_guide/adding-new-resolutions/Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst index 78edaaf629..fc7b2c0ee3 100644 --- a/doc/source/users_guide/adding-new-resolutions/Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst +++ b/doc/source/users_guide/adding-new-resolutions/Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst @@ -8,7 +8,7 @@ In the last chapter we gave the details on how to create new files for input into CLM. These files could be either global resolutions, regional-grids or even a single grid point. If you want to easily have these files available for continued use in your development you will then want to include them in the build-namelist database so that build-namelist can easily find them for you. You can deal with them, just by putting the settings in the ``user_nl_clm namelist`` file, or by using ``CLM_USRDAT_NAME``. Another way to deal with them is to enter them into the database for build-namelist, so that build-namelist can find them for you. This keeps one central database for all your files, rather than having multiple locations to keep track of files. If you have a LOT of files to keep track of it also might be easier than keeping track by hand, especially if you have to periodically update your files. If you just have a few quick experiments to try, for a short time period you might be best off using the other methods mentioned above. -There are two parts to adding files to the build-namelist database. The first part is adding new resolution names which is done in the ``$CTSMROOT/bld/namelist_files/namelist_definition_clm4_5.xml`` file. You can then use the new resolution by using ``CLM_USRDAT_NAME``. If you also want to be able to give the resolution into **create_newcase** -- you'll need to add the grid to the ``$CIMEROOT/config/cesm/config_grid.xml`` file. +There are two parts to adding files to the build-namelist database. The first part is adding new resolution names which is done in the ``$CTSMROOT/bld/namelist_files/namelist_definition_clm4_5.xml`` file. You can then use the new resolution by using ``CLM_USRDAT_NAME``. If you also want to be able to give the resolution into ``create_newcase`` -- you'll need to add the grid to the ``$CIMEROOT/config/cesm/config_grid.xml`` file. The second part is actually adding the new filenames which is done in the ``$CTSMROOT/bld/namelist_files/namelist_defaults_clm4_5.xml`` file (``$CTSMROOT/bld/namelist_files/namelist_defaults_clm4_5_tools.xml`` file for CLM tools). If you aren't adding any new resolutions, and you are just changing the files for existing resolutions, you don't need to edit the namelist_definition file. diff --git a/doc/source/users_guide/adding-new-resolutions/Adding-Resolution-Names.rst b/doc/source/users_guide/adding-new-resolutions/Adding-Resolution-Names.rst index 216de19f54..d89cc13930 100644 --- a/doc/source/users_guide/adding-new-resolutions/Adding-Resolution-Names.rst +++ b/doc/source/users_guide/adding-new-resolutions/Adding-Resolution-Names.rst @@ -6,7 +6,7 @@ Adding Resolution Names ========================= -If you are adding files for new resolutions which aren't covered in the namelist_definition file -- you'll need to add them in. The list of valid resolutions is in the id="res" entry in the ``$CTSMROOT/bld/namelist_files/namelist_definition_clm4_5.xml`` file. You need to choose a name for your new resolution and simply add it to the comma delimited list of valid_values for the id="res" entry. The convention for global Gaussian grids is number_of_latitudes x number_of_longitudes. The convention for global finite volume grids is latitude_grid_size x longitude_grid_size where latitude and longitude is measured in degrees. The convention for unstructured HOMME grids is nenp4, where corresponds to the resolution. The higher is the higher the resolution. So for example, ne60np4 is roughly half-degree while ne240np4 is roughly a eighth degree. For regional or single-point datasets the names have a grid size number_of_latitudes x number_of_longitudes followed by an underscore and then a descriptive name such as a City name followed by an abbreviation for the Country in caps. The only hard requirement is that names be unique for different grid files. Here's what the entry for resolutions looks like in the file: +If you are adding files for new resolutions which aren't covered in the namelist_definition file -- you'll need to add them in. The list of valid resolutions is in the ``id="res"`` entry in the ``$CTSMROOT/bld/namelist_files/namelist_definition_clm4_5.xml`` file. You need to choose a name for your new resolution and simply add it to the comma delimited list of valid_values for the ``id="res"`` entry. The convention for global Gaussian grids is number_of_latitudes x number_of_longitudes. The convention for global finite volume grids is latitude_grid_size x longitude_grid_size where latitude and longitude is measured in degrees. The convention for unstructured HOMME grids is nenp4, where corresponds to the resolution. The higher is the higher the resolution. So for example, ne60np4 is roughly half-degree while ne240np4 is roughly a eighth degree. For regional or single-point datasets the names have a grid size number_of_latitudes x number_of_longitudes followed by an underscore and then a descriptive name such as a City name followed by an abbreviation for the Country in caps. The only hard requirement is that names be unique for different grid files. Here's what the entry for resolutions looks like in the file: :: `_. Once you are familiar with how to setup cases for any type of simulation with CESM you will want to direct your attention to the specifics of using CLM. -For some of the details of setting up cases for |version| read the README and text files available from the "$CTSMROOT/doc" directory (see the "CLM Web pages" section for a link to the list of these files). Here are the important ones that you should be familiar with: +For some of the details of setting up cases for |version| read the README and text files available from the ``$CTSMROOT/doc`` directory (see the "CLM Web pages" section for a link to the list of these files). Here are the important ones that you should be familiar with: - :ref:`readme` describing the directory structure. - The IMPORTANT_NOTES file talks about important things for users to know about using the model scientifically. It content is given in the next chapter on :ref:`scientific-validiation`. diff --git a/doc/source/users_guide/running-single-points/running-pts_mode-configurations.rst b/doc/source/users_guide/running-single-points/running-pts_mode-configurations.rst index d3b14e6184..edad4c25ff 100644 --- a/doc/source/users_guide/running-single-points/running-pts_mode-configurations.rst +++ b/doc/source/users_guide/running-single-points/running-pts_mode-configurations.rst @@ -8,7 +8,7 @@ Running a single point using global data - PTS_MODE ``PTS_MODE`` enables you to run the model using global datasets, but just picking a single point from those datasets and operating on it. It can be a very quick way to do fast simulations and get a quick turnaround. -To setup a ``PTS_MODE`` simulation you use the "-pts_lat" and "-pts_lon" arguments to **create_newcase** to give the latitude and longitude of the point you want to simulate for (the code will pick the point on the global grid nearest to the point you give. Here's an example to setup a simulation for the nearest point at 2-degree resolution to Boulder Colorado. +To setup a ``PTS_MODE`` simulation you use the ``-pts_lat`` and ``-pts_lon`` arguments to ``create_newcase`` to give the latitude and longitude of the point you want to simulate for (the code will pick the point on the global grid nearest to the point you give. Here's an example to setup a simulation for the nearest point at 2-degree resolution to Boulder Colorado. :: > cd scripts diff --git a/doc/source/users_guide/running-single-points/running-single-point-configurations.rst b/doc/source/users_guide/running-single-points/running-single-point-configurations.rst index 9d2b68456b..766eca63fd 100644 --- a/doc/source/users_guide/running-single-points/running-single-point-configurations.rst +++ b/doc/source/users_guide/running-single-points/running-single-point-configurations.rst @@ -74,7 +74,7 @@ Supported single-point runs for sites with their own atmospheric forcing Of the supported single-point datasets we have three that also have atmospheric forcing data that go with them: Mexico City (Mexico), Vancouver, (Canada, British Columbia), and ``urbanc_alpha`` (test data for an Urban inter-comparison project). Mexico city and Vancouver also have namelist options in the source code for them to work with modified urban data parameters that are particular to these locations. To turn on the atmospheric forcing for these datasets, you set the ``env_run.xml DATM_MODE`` variable to ``CLM1PT``, and then the atmospheric forcing datasets will be used for the point picked. If you use one of the compsets that has "I1Pt" in the name that will be set automatically. -When running with datasets that have their own atmospheric forcing you need to be careful to run over the period that data is available. If you have at least one year of forcing it will cycle over the available data over and over again no matter how long of a simulation you run. However, if you have less than a years worth of data (or if the start date doesn't start at the beginning of the year, or the end date doesn't end at the end of the year) then you won't be able to run over anything but the data extent. In this case you will need to carefully set the ``RUN_STARTDATE``, ``START_TOD`` and ``STOP_N/STOP_OPTION`` variables for your case to run over the entire time extent of your data. For the supported data points, these values are in the XML database and you can use the **queryDefaultNamelist.pl** script to query the values and set them for your case (they are set for the three urban test cases: Mexicocity, Vancouver, and urbanc_alpha). +When running with datasets that have their own atmospheric forcing you need to be careful to run over the period that data is available. If you have at least one year of forcing it will cycle over the available data over and over again no matter how long of a simulation you run. However, if you have less than a years worth of data (or if the start date doesn't start at the beginning of the year, or the end date doesn't end at the end of the year) then you won't be able to run over anything but the data extent. In this case you will need to carefully set the ``RUN_STARTDATE``, ``START_TOD`` and ``STOP_N/STOP_OPTION`` variables for your case to run over the entire time extent of your data. For the supported data points, these values are in the XML database and you can use the ``queryDefaultNamelist.pl`` script to query the values and set them for your case (they are set for the three urban test cases: Mexicocity, Vancouver, and urbanc_alpha). Example: Use site-specific atmospheric forcings ----------------------------------------------- @@ -199,4 +199,4 @@ Example: Setting up a case from the single-point surface dataset just created > ./xmlchange CLM_USRDAT_NAME=$GRIDNAME > ./case.setup -.. note:: With this and previous versions of the model we recommended using ``CLM_USRDAT_NAME`` as a way to identify your own datasets without having to enter them into the XML database. This has the down-side that you can't include creation dates in your filenames, which means you can't keep track of different versions by date. It also means you HAVE to rename the files after you created them with **mksurfdata.pl**. Now, since ``user_nl`` files are supported for ALL model components, and the same domain files are read by both CLM and DATM and set using the envxml variables: ``ATM_DOMAIN_PATH``, ``ATM_DOMAIN_FILE``, ``LND_DOMAIN_PATH``, and ``LND_DOMAIN_FILE`` -- you can use this mechanism (``user_nl_clm`` and ``user_nl_datm`` and those envxml variables) to point to your datasets in any location. In the future we will deprecate ``CLM_USRDAT_NAME`` and recommend ``user_nl_clm`` and ``user_nl_datm`` and the ``DOMAIN`` envxml variables. +.. note:: With this and previous versions of the model we recommended using ``CLM_USRDAT_NAME`` as a way to identify your own datasets without having to enter them into the XML database. This has the down-side that you can't include creation dates in your filenames, which means you can't keep track of different versions by date. It also means you HAVE to rename the files after you created them with ``mksurfdata.pl``. Now, since ``user_nl`` files are supported for ALL model components, and the same domain files are read by both CLM and DATM and set using the envxml variables: ``ATM_DOMAIN_PATH``, ``ATM_DOMAIN_FILE``, ``LND_DOMAIN_PATH``, and ``LND_DOMAIN_FILE`` -- you can use this mechanism (``user_nl_clm`` and ``user_nl_datm`` and those envxml variables) to point to your datasets in any location. In the future we will deprecate ``CLM_USRDAT_NAME`` and recommend ``user_nl_clm`` and ``user_nl_datm`` and the ``DOMAIN`` envxml variables. diff --git a/doc/source/users_guide/running-single-points/single-point-and-regional-grid-configurations.rst b/doc/source/users_guide/running-single-points/single-point-and-regional-grid-configurations.rst index ab7e923669..5e20a303fb 100644 --- a/doc/source/users_guide/running-single-points/single-point-and-regional-grid-configurations.rst +++ b/doc/source/users_guide/running-single-points/single-point-and-regional-grid-configurations.rst @@ -24,7 +24,7 @@ There are two different ways to do this for normal-supported site Running for a *normal supported site* is a great solution, if one of the supported single-point/regional datasets, is your region of interest (see :ref:`running-single-point-datasets`). All the datasets are created for you, and you can easily select one and run, out of the box with it using a supported resolution from the top level of the CESM scripts. The problem is that there is a very limited set of supported datasets. You can also use this method for your own datasets, but you have to create the datasets, and add them to the XML database in scripts, CLM and to the DATM. This is worthwhile if you want to repeat many multiple cases for a given point or region. -In general :ref:`pts_mode` is the quick and dirty method that gets you started without having to create datasets -- but has limitations. It's good for an initial attempt at seeing results for a point of interest, but since you can NOT restart with it, it's usage is limited. It is the quickest method as you can create a case for it directly from **create_newcase**. Although you can't restart, running a single point is very fast, and you can run for long simulation times even without restarts. +In general :ref:`pts_mode` is the quick and dirty method that gets you started without having to create datasets -- but has limitations. It's good for an initial attempt at seeing results for a point of interest, but since you can NOT restart with it, it's usage is limited. It is the quickest method as you can create a case for it directly from ``create_newcase``. Although you can't restart, running a single point is very fast, and you can run for long simulation times even without restarts. Next, ``CLM_USRDAT_NAME`` is the best way to setup cases quickly where you have to create your own datasets (see :ref:`running-single-point-datasets`). With this method you don't have to change DATM or add files to the XML database -- but you have to follow a strict naming convention for files. However, once the files are named and in the proper location, you can easily setup new cases that use these datasets. This is good for treating all the required datasets as a "group" and for a particular model version. For advanced CLM developers who need to track dataset changes with different model versions you would be best off adding these datasets as supported datasets with the "normal supported datasets" method. diff --git a/doc/source/users_guide/running-special-cases/Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst b/doc/source/users_guide/running-special-cases/Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst index f93bcca2f0..eedefd8744 100644 --- a/doc/source/users_guide/running-special-cases/Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst +++ b/doc/source/users_guide/running-special-cases/Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst @@ -6,7 +6,7 @@ Running with historical CO2 forcing ===================================== -In this case you want to run a simulation with stand-alone CLM responding to changes in CO2 for a historical period. For this example, we will start with the "I_1850-2000_CN" compset that has transient: land-use, Nitrogen and Aerosol deposition already. You could also use another compset if you didn't want these other features to be transient. In order to get CO2 to be transient we need to add a new streams file and add it to the list of streams in the user_nl_datm file. You also need a NetCDF datafile that datm can read that gives the variation. You could supply your own file, but we have a standard file that is used by CAM for this and our example will make use of this file. +In this case you want to run a simulation with stand-alone CLM responding to changes in CO2 for a historical period. For this example, we will start with the ``I_1850-2000_CN`` compset that has transient land-use, Nitrogen and Aerosol deposition already. You could also use another compset if you didn't want these other features to be transient. In order to get CO2 to be transient we need to add a new streams file and add it to the list of streams in the ``user_nl_datm`` file. You also need a NetCDF datafile that datm can read that gives the variation. You could supply your own file, but we have a standard file that is used by CAM for this and our example will make use of this file. .. note:: Most everything here has to do with changing datm rather than CLM to allow this to happen. As such the user that wishes to do this should first become more familiar with datm and read the `CESM Data Model User's Guide `_ especially as it pertains to the datm. diff --git a/doc/source/users_guide/running-special-cases/Running-the-prognostic-crop-model.rst b/doc/source/users_guide/running-special-cases/Running-the-prognostic-crop-model.rst index 7e19af8678..cb66ef209f 100644 --- a/doc/source/users_guide/running-special-cases/Running-the-prognostic-crop-model.rst +++ b/doc/source/users_guide/running-special-cases/Running-the-prognostic-crop-model.rst @@ -6,7 +6,7 @@ Running the prognostic crop model =================================== -The prognostic crop model is setup to work with CLM4.0, CLM4.5 or |version| with either BGC or CN (with or without DV). In order to use the initial condition file, we need to set the ``RUN_TYPE`` to startup rather than ``hybrid`` since the compset for f19 sets up to use an initial condition file without crop active. To activate the crop model you can choose a compset that has "Crop" in the name such as "I1850Clm50BgcCropCru" or simply add "-crop" to ``CLM_BLDNML_OPTS`` (or for CLM4.0 add "-crop on" to ``CLM_CONFIG_OPTS``). +The prognostic crop model is setup to work with CLM4.0, CLM4.5 or |version| with either BGC or CN (with or without DV). In order to use the initial condition file, we need to set the ``RUN_TYPE`` to startup rather than ``hybrid`` since the compset for f19 sets up to use an initial condition file without crop active. To activate the crop model you can choose a compset that has "Crop" in the name such as "I1850Clm50BgcCropCru" or simply add ``-crop`` to ``CLM_BLDNML_OPTS`` (or for CLM4.0 add ``-crop on`` to ``CLM_CONFIG_OPTS``). Example: Crop Simulation ------------------------------------ diff --git a/doc/source/users_guide/running-special-cases/Running-with-irrigation.rst b/doc/source/users_guide/running-special-cases/Running-with-irrigation.rst index f19b489731..5702e6d49d 100644 --- a/doc/source/users_guide/running-special-cases/Running-with-irrigation.rst +++ b/doc/source/users_guide/running-special-cases/Running-with-irrigation.rst @@ -6,7 +6,7 @@ Running with irrigation =================================== -In CLM4.0 irrigation isn't an allowed option. In CLM4.5 irrigation can ONLY be used WITH crop. With CLM5.0 irrigation can be used whether crop is on or not -- **BUT** if crop is off, your surface datasets **HAVE** to have irrigation defined appropriately. Right now *ALL* surface datasets without crop enabled have irrigation hard-wired on. In order to create datasets with irrigation off, you'd need to make changes to ``mksurfdata_esmf`` in order to have all generic crops to be non-irrigated. To turn on irrigation in |version| we simply add "-irrig on" to ``CLM_BLDNML_OPTS``. +In CLM4.0 irrigation isn't an allowed option. In CLM4.5 irrigation can ONLY be used WITH crop. With CLM5.0 irrigation can be used whether crop is on or not -- **BUT** if crop is off, your surface datasets **HAVE** to have irrigation defined appropriately. Right now *ALL* surface datasets without crop enabled have irrigation hard-wired on. In order to create datasets with irrigation off, you'd need to make changes to ``mksurfdata_esmf`` in order to have all generic crops to be non-irrigated. To turn on irrigation in |version| we simply add ``-irrig on`` to ``CLM_BLDNML_OPTS``. Example: Irrigation Simulation ------------------------------------------ diff --git a/doc/source/users_guide/running-special-cases/Spinning-up-the-biogeochemistry-BGC-spinup.rst b/doc/source/users_guide/running-special-cases/Spinning-up-the-biogeochemistry-BGC-spinup.rst index cc266506a8..089603db09 100644 --- a/doc/source/users_guide/running-special-cases/Spinning-up-the-biogeochemistry-BGC-spinup.rst +++ b/doc/source/users_guide/running-special-cases/Spinning-up-the-biogeochemistry-BGC-spinup.rst @@ -6,7 +6,7 @@ Spinup of |version|-BGC-Crop ============================= -To get the |version|-BGC model to a steady state, you first run it from arbitrary initial conditions using the "accelerated decomposition spinup" (-bgc_spinup on in CLM **configure**, see example below) mode for about 200 simulation years. :numref:`Figure BGC AD spinup plot for 1850 GSWP3` shows spinup behavior for an 1850 BGC accelerated decomposition (AD) case using GSWP3 atmospheric forcing. Generally, the criteria that less than 3% of the land surface be in total ecosystem carbon disequilibrium takes the longest to satisfy due to slow soil carbon (TOTSOMC) turnover times in the Arctic. +To get the |version|-BGC model to a steady state, you first run it from arbitrary initial conditions using the "accelerated decomposition spinup" (-bgc_spinup on in CLM ``configure``, see example below) mode for about 200 simulation years. :numref:`Figure BGC AD spinup plot for 1850 GSWP3` shows spinup behavior for an 1850 BGC accelerated decomposition (AD) case using GSWP3 atmospheric forcing. Generally, the criteria that less than 3% of the land surface be in total ecosystem carbon disequilibrium takes the longest to satisfy due to slow soil carbon (TOTSOMC) turnover times in the Arctic. .. _Figure BGC AD spinup plot for 1850 GSWP3: @@ -14,7 +14,7 @@ To get the |version|-BGC model to a steady state, you first run it from arbitrar BGC AD spinup plot for a year 1850 case with GSWP3 atmospheric forcing. Variables examined are TOTECOSYSC (total ecosystem carbon), TOTSOMC (total soil organic matter carbon), TOTVEGC (total vegetation carbon), TLAI (total leaf area index), GPP (gross primary production) and TWS (total water storage). Generated using .../tools/contrib/SpinupStability.ncl. -After this you branch from this mode in the "final spinup" (-bgc_spinup off in CLM **configure**, see example below), and run for several hundred simulation years. :numref:`Figure BGC pAD spinup plot for 1850 GSWP3` shows spinup behavior for an 1850 BGC post accelerated decomposition (pAD) case using GSWP3 atmospheric forcing. As before, the criteria that less than 3% of the land surface be in total ecosystem carbon disequilibrium takes the longest to satisfy. It can be difficult to meet this strict criteria in less than 1000 years and users may want to relax this criteria depending on their application. +After this you branch from this mode in the "final spinup" (-bgc_spinup off in CLM ``configure``, see example below), and run for several hundred simulation years. :numref:`Figure BGC pAD spinup plot for 1850 GSWP3` shows spinup behavior for an 1850 BGC post accelerated decomposition (pAD) case using GSWP3 atmospheric forcing. As before, the criteria that less than 3% of the land surface be in total ecosystem carbon disequilibrium takes the longest to satisfy. It can be difficult to meet this strict criteria in less than 1000 years and users may want to relax this criteria depending on their application. .. _Figure BGC pAD spinup plot for 1850 GSWP3: @@ -41,7 +41,7 @@ You can also start from a default initial file that is setup as part of the sele If you use the default initial file and you signficantly change model behavior or atmospheric forcing, and you are concerned about the carbon equilibrium (e.g., TOTECOSYSC, TOTSOMC, TOTVEGC), particularly at high latitudes, then we recommend you put the model back into AD mode to reach a new equilibrium. In this configuration, this will also automatically reseed "dead" plant functional types in the initial file with a bit of leaf carbon to give those plant functional types another chance to grow under the new atmospheric forcing or model conditions. **1. |version| accelerated-decomposition (AD) spinup** - For the first step of running 200+ years in "-bgc_spinup on" mode, you will setup a case, and then edit the values in env_build.xml and env_run.xml so that the right configuration is turned on and the simulation is setup to run for the required length of simulation time. So do the following: + For the first step of running 200+ years in ``-bgc_spinup on`` mode, you will setup a case, and then edit the values in env_build.xml and env_run.xml so that the right configuration is turned on and the simulation is setup to run for the required length of simulation time. So do the following: Example:: AD_SPINUP Simulation for |version|-BGC -------------------------------------------------------- @@ -67,7 +67,7 @@ Example:: AD_SPINUP Simulation for |version|-BGC Afterwards save the last restart file from this simulation to use in the next step. **2. Final spinup for |version|-BGC** - Next save the last restart file from this step and use it as the "finidat" file to use for one more spinup for at least 400+ years in normal mode. So do the following: + Next save the last restart file from this step and use it as the ``finidat`` file to use for one more spinup for at least 400+ years in normal mode. So do the following: .. _eg-final-clmbgc-spinup: diff --git a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst index a1efac897e..0987a32e8e 100644 --- a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst +++ b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst @@ -6,17 +6,17 @@ Customizing CLM's Configuration ******************************** -The section of the |cesmrelease| Quickstart `CESM Create a Case `_ gives instructions on creating a case. Also see a similar section in the CIME User's-Guide `CIME Create a case `_. What is of interest here is how to customize your use of CLM for the case that you created. +The section of the |cesmrelease| Quickstart `CESM Create a Case `_ gives instructions on creating a case. Also see a similar section in the CIME User's Guide `CIME Create a case `_. What is of interest here is how to customize your use of CLM for the case that you created. -For CLM when **preview_namelist**, **case.build**, or **case.run** are called there are two steps that take place: +For CLM when ``preview_namelist``, ``case.build``, or ``case.run`` are called there are two steps that take place: -1. The CLM "**configure**" script is called to setup the build-time configuration for CLM (see :ref:`more-info-clm-config-script`). The env variables for **configure** are locked after the **case.build** step. So the results of the CLM **configure** are locked after the build has taken place. +1. The CLM ``configure`` script is called to setup the build-time configuration for CLM (see :ref:`more-info-clm-config-script`). The env variables for ``configure`` are locked after the ``case.build`` step. So the results of the CLM ``configure`` are locked after the build has taken place. -2. The CLM "**build-namelist**" script is called to generate the run-time namelist for CLM (more information on **build-namelist** is given below in :ref:`def-nl-items-and-defaults`). +2. The CLM ``build-namelist`` script is called to generate the run-time namelist for CLM (more information on ``build-namelist`` is given below in :ref:`def-nl-items-and-defaults`). -When customizing your case at the **case.setup** step you are able to modify the process by effecting either one or both of these steps. The CLM "**configure**" and "**build-namelist**" scripts are both available in the "$CTSMROOT/bld" directory in the distribution. Both of these scripts have a "-help" option that is useful to examine to see what types of options you can give either of them. +When customizing your case at the ``case.setup`` step you are able to modify the process by effecting either one or both of these steps. The CLM ``configure`` and ``build-namelist`` scripts are both available in the ``$CTSMROOT/bld`` directory in the distribution. Both of these scripts have a ``-help`` option that is useful to examine to see what types of options you can give either of them. -There are five different types of customization for the configuration that we will discuss: |version| in |cesmrelease| build-time options, |version| in |cesmrelease| run-time options, User Namelist, other noteworthy |cesmrelease| configuration items, the CLM **configure** script options, and the CLM **build-namelist** script options. +There are five different types of customization for the configuration that we will discuss: |version| in |cesmrelease| build-time options, |version| in |cesmrelease| run-time options, User Namelist, other noteworthy |cesmrelease| configuration items, the CLM ``configure`` script options, and the CLM ``build-namelist`` script options. Information on all of the CLM script, configuration, build and run items is found under ``$CTSMROOT/cime_config/config_component.xml``. See `CLM CASEROOT Variable Definitions `_. @@ -38,12 +38,12 @@ Below we list each of the CESM configuration items that are specific to CLM. All CLM_USRDAT_NAME COMP_LND -For the precedence of the different options to **build-namelist** see the section on precedence below. +For the precedence of the different options to ``build-namelist`` see the section on precedence below. The first item ``CLM_CONFIG_OPTS`` has to do with customizing the CLM build-time options for your case, the rest all have to do with generating the namelist. CLM_CONFIG_OPTS - The option ``CLM_CONFIG_OPTS`` is all about passing command line arguments to the CLM **configure** script. It is important to note that some compsets, may already put a value into the ``CLM_CONFIG_OPTS`` variable. You can still add more options to your ``CLM_CONFIG_OPTS`` but make sure you add to what is already there rather than replacing it. Hence, we recommend using the "-append" option to the xmlchange script. In :ref:`more-info-clm-config-script` below we will go into more details on options that can be customized in the CLM "**configure**" script. It's also important to note that the **$CTSMROOT/cime_config/buildnml** script may already invoke certain CLM **configure** options and as such those command line options are NOT going to be available to change at this step (nor would you want to change them). The options to CLM **configure** are given with the "-help" option which is given in :ref:`more-info-clm-config-script`... note:: ``CLM_CONFIG_OPTS`` is locked after the **case.build** script is run. If you want to change something in ``CLM_CONFIG_OPTS`` you'll need to clean the build and rerun **case.build**. The other env variables can be changed at run-time so are never locked. + The option ``CLM_CONFIG_OPTS`` is all about passing command line arguments to the CLM ``configure`` script. It is important to note that some compsets, may already put a value into the ``CLM_CONFIG_OPTS`` variable. You can still add more options to your ``CLM_CONFIG_OPTS`` but make sure you add to what is already there rather than replacing it. Hence, we recommend using the ``-append`` option to the xmlchange script. In :ref:`more-info-clm-config-script` below we will go into more details on options that can be customized in the CLM ``configure`` script. It's also important to note that the ``$CTSMROOT/cime_config/buildnml`` script may already invoke certain CLM ``configure`` options and as such those command line options are NOT going to be available to change at this step (nor would you want to change them). The options to CLM ``configure`` are given with the ``-help`` option which is given in :ref:`more-info-clm-config-script`... note:: ``CLM_CONFIG_OPTS`` is locked after the ``case.build`` script is run. If you want to change something in ``CLM_CONFIG_OPTS`` you'll need to clean the build and rerun ``case.build``. The other env variables can be changed at run-time so are never locked. CLM_NML_USE_CASE ``CLM_NML_USE_CASE`` is used to set a particular set of conditions that set multiple namelist items, all centering around a particular usage of the model. (See :ref:`precedence-of-opts` for the precedence of this option relative to the others.) To list the valid options do the following: @@ -101,7 +101,7 @@ CLM_NML_USE_CASE stdurbpt_pd = Standard Urban Point Namelist Settings CLM_BLDNML_OPTS - The option CLM_BLDNML_OPTS is for passing options to the CLM "build-namelist" script. As with the CLM "configure" script the CLM $CTSMROOT/cime_config/buildnml may already invoke certain options and as such those options will NOT be available to be set here. The best way to see what options can be sent to the "build-namelist" script is to do + The option CLM_BLDNML_OPTS is for passing options to the CLM ``build-namelist`` script. As with the CLM ``configure`` script the CLM $CTSMROOT/cime_config/buildnml may already invoke certain options and as such those options will NOT be available to be set here. The best way to see what options can be sent to the ``build-namelist`` script is to do :: > cd $CTSMROOT/bld @@ -256,7 +256,7 @@ CLM_BLDNML_OPTS (i.e. CLM_NML_USE_CASE env_run variable) 6. values from the namelist defaults file. -The **$CTSMROOT/cime_config/buildnml** script already sets the resolution and mask as well as the CLM **configure** file, and defines an input namelist and namelist input file, and the output namelist directory, and sets the start-type (from ``RUN_TYPE``), namelist options (from ``CLM_NAMELIST_OPTS``), co2_ppmv (from ``CCSM_CO2_PPMV``, co2_type (from ``CLM_CO2_TYPE``), lnd_frac (from ``LND_DOMAIN_PATH`` and ``LND_DOMAIN_FILE``), l_ncpl (from ``LND_NCPL``, glc_grid, glc_smb, glc_nec (from ``GLC_GRID``, ``GLC_SMB``, and ``GLC_NEC``), and "clm_usr_name" is set (to ``CLM_USRDAT_NAME >``when the grid is set to ``CLM_USRDAT_NAME``. Hence only the following different options can be set: +The ``$CTSMROOT/cime_config/buildnml`` script already sets the resolution and mask as well as the CLM ``configure`` file, and defines an input namelist and namelist input file, and the output namelist directory, and sets the start-type (from ``RUN_TYPE``), namelist options (from ``CLM_NAMELIST_OPTS``), co2_ppmv (from ``CCSM_CO2_PPMV``, co2_type (from ``CLM_CO2_TYPE``), lnd_frac (from ``LND_DOMAIN_PATH`` and ``LND_DOMAIN_FILE``), l_ncpl (from ``LND_NCPL``, glc_grid, glc_smb, glc_nec (from ``GLC_GRID``, ``GLC_SMB``, and ``GLC_NEC``), and "clm_usr_name" is set (to ``CLM_USRDAT_NAME >``when the grid is set to ``CLM_USRDAT_NAME``. Hence only the following different options can be set: 1. -bgc_spinup @@ -285,14 +285,14 @@ The **$CTSMROOT/cime_config/buildnml** script already sets the resolution and ma #. -verbose -"-bgc_spinup" is an option only available for |version| for any configuration when CN is turned on (so either CLMCN or CLMBGC). It can be set to "on" or "off". If "on" the model will go into Accelerated Decomposition mode, while for "off" (the default) it will have standard decomposition rates. If you are starting up from initial condition files the model will check what mode the initial condition file is in and do the appropriate action on the first time-step to change the Carbon pools to the appropriate spinup setting. See :ref:`spinning-up-clm-bgc` for an example using this option. +``-bgc_spinup`` is an option only available for |version| for any configuration when CN is turned on (so either CLMCN or CLMBGC). It can be set to "on" or "off". If "on" the model will go into Accelerated Decomposition mode, while for "off" (the default) it will have standard decomposition rates. If you are starting up from initial condition files the model will check what mode the initial condition file is in and do the appropriate action on the first time-step to change the Carbon pools to the appropriate spinup setting. See :ref:`spinning-up-clm-bgc` for an example using this option. -"-chk_res" ensures that the resolution chosen is supported by CLM. If the resolution is NOT supported it will cause the CLM **build-namelist** to abort when run. So when either **preview_namelist**, **case.build** or **case.run** is executed it will abort early. Since, the CESM scripts only support certain resolutions anyway, in general this option is NOT needed in the context of running CESM cases. +``-chk_res`` ensures that the resolution chosen is supported by CLM. If the resolution is NOT supported it will cause the CLM ``build-namelist`` to abort when run. So when either ``preview_namelist``, ``case.build`` or ``case.run`` is executed it will abort early. Since, the CESM scripts only support certain resolutions anyway, in general this option is NOT needed in the context of running CESM cases. -"-clm_demand" asks the **build-namelist** step to require that the list of variables entered be set. Typically, this is used to require that optional filenames be used and ensure they are set before continuing. For example, you may want to require that fpftdyn be set to get dynamically changing vegetation types. To do this you would do the following. +``-clm_demand`` asks the ``build-namelist`` step to require that the list of variables entered be set. Typically, this is used to require that optional filenames be used and ensure they are set before continuing. For example, you may want to require that fpftdyn be set to get dynamically changing vegetation types. To do this you would do the following. :: - > ./xmlchange CLM_BLDNML_OPTS="-clm_demand fpftdyn"`` + > ./xmlchange CLM_BLDNML_OPTS="-clm_demand fpftdyn" To see a list of valid variables that you could set do this: :: @@ -302,25 +302,25 @@ To see a list of valid variables that you could set do this: .. note:: Using a 20th-Century transient compset or the ``20thC_transient`` use-case using ``CLM_NML_USE_CASE`` would set this as well, but would also use dynamic nitrogen and aerosol deposition files, so using ``-clm_demand`` would be a way to get *just* dynamic vegetation types and NOT the other files as well. -"-drydep" adds a dry-deposition namelist for testing to the driver. This is a driver namelist, but adding the option here has CLM **build-namelist** create the ``drv_flds_in`` file that the driver will copy over and use. Invoking this option does have an impact on performance even for I compsets and will slow the model down. It's also only useful when running with an active atmosphere model that makes use of this information. +``-drydep`` adds a dry-deposition namelist for testing to the driver. This is a driver namelist, but adding the option here has CLM ``build-namelist`` create the ``drv_flds_in`` file that the driver will copy over and use. Invoking this option does have an impact on performance even for I compsets and will slow the model down. It's also only useful when running with an active atmosphere model that makes use of this information. -"-ignore_ic_date" ignores the Initial Conditions (IC) date completely for finding initial condition files to startup from. Without this option or the "-ignore_ic_year" option below, the date of the file comes into play. +``-ignore_ic_date`` ignores the Initial Conditions (IC) date completely for finding initial condition files to startup from. Without this option or the ``-ignore_ic_year`` option below, the date of the file comes into play. -"-ignore_ic_year" ignores the Initial Conditions (IC) year for finding initial condition files to startup from. The date is used, but the year is ignored. Without this option or the "-ignore_ic_date" option below, the date and year of the file comes into play. +``-ignore_ic_year`` ignores the Initial Conditions (IC) year for finding initial condition files to startup from. The date is used, but the year is ignored. Without this option or the ``-ignore_ic_date`` option below, the date and year of the file comes into play. -When "-irrig on" is used **build-namelist** will try to find surface datasets that have the irrigation model enabled (when running with Sattellitte Phenology). When running with the prognostic crop model on, "-irrig on" will turn irrigate crops on, while "-irrig off" will manage all crop areas as rain-fed without irrigation. +When ``-irrig on`` is used ``build-namelist`` will try to find surface datasets that have the irrigation model enabled (when running with Sattellitte Phenology). When running with the prognostic crop model on, ``-irrig on`` will turn irrigate crops on, while ``-irrig off`` will manage all crop areas as rain-fed without irrigation. -"no-megan" means do NOT add a MEGAN model Biogenic Volatile Organic Compounds (BVOC) testing namelist to the driver. This namelist is created by default, so normally this WILL be done. This is a driver namelist, so unless "no-megan" is specified the CLM **build-namelist** will create the ``drv_flds_in`` file that the driver will copy over and use (if you are running with CAM and CAM produces this file as well, it's file will have precedence). +``no-megan`` means do NOT add a MEGAN model Biogenic Volatile Organic Compounds (BVOC) testing namelist to the driver. This namelist is created by default, so normally this WILL be done. This is a driver namelist, so unless ``no-megan`` is specified the CLM ``build-namelist`` will create the ``drv_flds_in`` file that the driver will copy over and use (if you are running with CAM and CAM produces this file as well, it's file will have precedence). -"-note" adds a note to the bottom of the namelist file, that gives the details of how **build-namelist** was called, giving the specific command-line options given to it. +``-note`` adds a note to the bottom of the namelist file, that gives the details of how ``build-namelist`` was called, giving the specific command-line options given to it. -"-rcp" is used to set the representative concentration pathway for the future scenarios you want the data-sets to simulate conditions for, in the input datasets. To list the valid options do the following: +``-rcp`` is used to set the representative concentration pathway for the future scenarios you want the data-sets to simulate conditions for, in the input datasets. To list the valid options do the following: :: > cd $CTSMROOT/doc > ../bld/build-namelist -rcp list -"-sim_year" is used to set the simulation year you want the data-sets to simulate conditions for in the input datasets. The simulation "year" can also be a range of years in order to do simulations with changes in the dataset values as the simulation progresses. To list the valid options do the following: +``-sim_year`` is used to set the simulation year you want the data-sets to simulate conditions for in the input datasets. The simulation ``year`` can also be a range of years in order to do simulations with changes in the dataset values as the simulation progresses. To list the valid options do the following: :: > cd $CTSMROOT/doc @@ -347,7 +347,7 @@ When "-irrig on" is used **build-namelist** will try to find surface datasets th when set to on, *requires* that your simulation do a cold start from arbitrary initial conditions. If this is NOT set, it will use an initial condition file if it can find an appropriate one, and otherwise do a cold start. ``CLM_FORCE_COLDSTART`` is a good way to ensure that you are doing a cold start if that is what you want to do. ``CLM_USRDAT_NAME`` - Provides a way to enter your own datasets into the namelist. The files you create must be named with specific naming conventions outlined in :ref:`creating-your-own-singlepoint-dataset`. To see what the expected names of the files are, use the **queryDefaultNamelist.pl** to see what the names will need to be. For example if your ``CLM_USRDAT_NAME`` will be "1x1_boulderCO", with a "navy" land-mask, constant simulation year range, for 1850, the following will list what your filenames should be: + Provides a way to enter your own datasets into the namelist. The files you create must be named with specific naming conventions outlined in :ref:`creating-your-own-singlepoint-dataset`. To see what the expected names of the files are, use the ``queryDefaultNamelist.pl`` to see what the names will need to be. For example if your ``CLM_USRDAT_NAME`` will be "1x1_boulderCO", with a "navy" land-mask, constant simulation year range, for 1850, the following will list what your filenames should be: :: > cd $CTSMROOT/bld @@ -362,7 +362,7 @@ When "-irrig on" is used **build-namelist** will try to find surface datasets th User Namelist =============== -``CLM_NAMELIST_OPTS`` as described above allows you to set any extra namelist items you would like to appear in your namelist. However, it only allows you a single line to enter namelist items, and strings must be quoted with ' which is a bit awkward. If you have a long list of namelist items you want to set (such as a long list of history fields) a convenient way to do it is to add to the ``user_nl_clm`` that is created after the **case.setup** command runs. The file needs to be in valid FORTRAN namelist format (with the exception that the namelist name &namelist and the end of namelist marker "/" are excluded". The **preview_namelist** or **case.run** step will abort if there are syntax errors. All the variable names must be valid and the values must be valid for the datatype and any restrictions for valid values for that variable. Here's an example ``user_nl_clm`` namelist that sets a bunch of history file related items, to create output history files monthly, daily, every six and 1 hours. +``CLM_NAMELIST_OPTS`` as described above allows you to set any extra namelist items you would like to appear in your namelist. However, it only allows you a single line to enter namelist items, and strings must be quoted with ' which is a bit awkward. If you have a long list of namelist items you want to set (such as a long list of history fields) a convenient way to do it is to add to the ``user_nl_clm`` that is created after the ``case.setup`` command runs. The file needs to be in valid FORTRAN namelist format (with the exception that the namelist name ``&namelist`` and the end of namelist marker ``/`` are excluded. The ``preview_namelist`` or ``case.run`` step will abort if there are syntax errors. All the variable names must be valid and the values must be valid for the datatype and any restrictions for valid values for that variable. Here's an example ``user_nl_clm`` namelist that sets a bunch of history file related items, to create output history files monthly, daily, every six and 1 hours. ---------------------------------- Example: user_nl_clm namelist file @@ -410,9 +410,9 @@ Example: user_nl_clm namelist file hist_mfilt = 1, 30, 28, 24 hist_nhtfrq = 0, -24, -6, -1 -**Note:** The comments at the top are some guidance given in the default user_nl_clm and just give some guidance on how to set variables and use the file. +**Note:** The comments at the top are some guidance given in the default ``user_nl_clm`` and just give some guidance on how to set variables and use the file. -**Note:** You do NOT need to specify the namelist group that the variables are in because the CLM **build-namelist** knows the namelist that specific variable names belong to, and it puts them there. +**Note:** You do NOT need to specify the namelist group that the variables are in because the CLM ``build-namelist`` knows the namelist that specific variable names belong to, and it puts them there. Obviously, all of this would be difficult to put in the CLM_NAMELIST_OPTS variable, especially having to put ' around all the character strings. For more information on the namelist variables being set here and what they mean, see the section on CLM namelists below, as well as the namelist definition that gives details on each variable. @@ -422,17 +422,17 @@ Obviously, all of this would be difficult to put in the CLM_NAMELIST_OPTS variab Precedence of Options --------------------- -Note: The precedence for setting the values of namelist variables with the different env_build.xml, env_run.xml options is (highest to lowest): +Note: The precedence for setting the values of namelist variables with the different ``env_build.xml``, ``env_run.xml`` options is (highest to lowest): -1. Namelist values set by specific command-line options, like, -d, -sim_year (i.e. CLM_BLDNML_OPTS env_build.xml variable) +1. Namelist values set by specific command-line options, like, ``-d``, ``-sim_year`` (i.e. ``CLM_BLDNML_OPTS`` ``env_build.xml`` variable) -#. Values set on the command-line using the -namelist option, (i.e. CLM_NAMELIST_OPTS env_run.xml variable) +#. Values set on the command-line using the ``-namelist`` option, (i.e. ``CLM_NAMELIST_OPTS`` ``env_run.xml`` variable) -#. Values read from the file specified by -infile, (i.e. user_nl_clm file) +#. Values read from the file specified by ``-infile``, (i.e. ``user_nl_clm`` file) -#. Datasets from the -clm_usr_name option, (i.e. CLM_USRDAT_NAME env_run.xml variable) +#. Datasets from the ``-clm_usr_name`` option, (i.e. ``CLM_USRDAT_NAME`` ``env_run.xml`` variable) -#. Values set from a use-case scenario, e.g., -use_case (i.e. CLM_NML_USE_CASE env_run.xml variable) +#. Values set from a use-case scenario, e.g., ``-use_case`` (i.e. ``CLM_NML_USE_CASE`` ``env_run.xml`` variable) #. Values from the namelist defaults file. @@ -451,7 +451,7 @@ Especially with CLMBGC and CLMCN starting from initial conditions is very import - :ref:`providing-finidat-in-usernlclm` - :ref:`adding-finidat-to-xml` - **Note:** Your initial condition file MUST agree with the surface dataset you are using to run the simulation. If the two files do NOT agree you will get a run-time about a mis-match in PFT weights, or in the number of PFT's or columns. To get around this you'll need to add the "use_init_interp=T" namelist flag in your namelist so that the initial conditions will be interpolated on startup.** + **Note:** Your initial condition file MUST agree with the surface dataset you are using to run the simulation. If the two files do NOT agree you will get a run-time about a mis-match in PFT weights, or in the number of PFT's or columns. To get around this you'll need to add the ``use_init_interp=T`` namelist flag in your namelist so that the initial conditions will be interpolated on startup.** .. _doing-a-hybrid-sim-for-init-conds: @@ -459,7 +459,7 @@ Especially with CLMBGC and CLMCN starting from initial conditions is very import Doing a hybrid simulation to provide initial conditions ------------------------------------------------------- -The first option is to setup a hybrid simulation and give a ``RUN_REFCASE`` and ``RUN_REFDATE`` to specify the reference case simulation name to use. When you setup coupled cases (assuming a CESM checkout), at the standard resolution of "f09" it will already do this for you. For example, if you run an "B1850" compset at "f09_g17_gl4" resolution the following settings will already be done for you. +The first option is to setup a hybrid simulation and give a ``RUN_REFCASE`` and ``RUN_REFDATE`` to specify the reference case simulation name to use. When you setup coupled cases (assuming a CESM checkout), at the standard resolution of "f09" it will already do this for you. For example, if you run a "B1850" compset at "f09_g17_gl4" resolution the following settings will already be done for you. ``./xmlchange RUN_TYPE=hybrid,RUN_REFCASE=b.e20.B1850.f09_g17.pi_control.all.297,RUN_REFDATE=0130-01-01,GET_REFCASE=TRUE`` @@ -498,7 +498,7 @@ Like other datasets, if you want to use a given initial condition file to be use Other noteworthy configuration items ------------------------------------ -For running "I" cases there are several other noteworthy configuration items that you may want to work with. Most of these involve settings for the DATM, but one ``CCSM_CO2_PPMV`` applies to all models. The list of DATM settings is `here `_. If you are running an B, E, or F case that doesn't use the DATM obviously the DATM_* settings will not be used. All of the settings below are in your ``env_build.xml`` and ``env_run.xml`` files +For running "I" cases there are several other noteworthy configuration items that you may want to work with. Most of these involve settings for the DATM, but one ``CCSM_CO2_PPMV`` applies to all models. The list of DATM settings is `here `_. If you are running a B, E, or F case that doesn't use the DATM obviously the DATM_* settings will not be used. All of the settings below are in your ``env_build.xml`` and ``env_run.xml`` files :: CCSM_CO2_PPMV @@ -514,7 +514,7 @@ For running "I" cases there are several other noteworthy configuration items tha DATM_CPL_YR_END ``CCSM_CO2_PPMV`` - Sets the mixing ratio of CO2 in parts per million by volume for ALL CESM components to use. Note that most compsets already set this value to something reasonable. Also note that some compsets may tell the atmosphere model to override this value with either historic or ramped values. If the CCSM_BGC variable is set to something other than "none" the atmosphere model will determine CO2, and CLM will listen and use what the atmosphere sends it. On the CLM side the namelist item co2_type tells CLM to use the value sent from the atmosphere rather than a value set on it's own namelist. + Sets the mixing ratio of CO2 in parts per million by volume for ALL CESM components to use. Note that most compsets already set this value to something reasonable. Also note that some compsets may tell the atmosphere model to override this value with either historic or ramped values. If the ``CCSM_BGC`` variable is set to something other than "none" the atmosphere model will determine CO2, and CLM will listen and use what the atmosphere sends it. On the CLM side the namelist item ``co2_type`` tells CLM to use the value sent from the atmosphere rather than a value set on it's own namelist. ``DATM_MODE`` Sets the mode that the DATM model should run in this determines how data is handled as well as what the source of the data will be. Many of the modes are setup specifically to be used for ocean and/or sea-ice modeling. The modes that are designed for use by CLM are (CLM_QIAN, CLMCRUNCEP, CLMCRUNCEPv7, CLMGSWP3v1 and CLM1PT): @@ -540,7 +540,7 @@ For running "I" cases there are several other noteworthy configuration items tha The standard mode for CLM4.0 of using global atmospheric data that was developed by Qian et. al. for CLM using NCEP data from 1948 to 2004. See :ref:`clmqian-and-its-datm` for more information. ``CLM1PT`` - This is for the special cases where we have single-point tower data for particular sites. Right now we only have data for three urban locations: MexicoCity Mexico, Vancouver Canada, and the urban-c alpha site. And we have data for the US-UMB AmeriFlux tower site for University of Michigan Biological Station. See :ref:`clm1pt-and-its-datm` for more information. + This is for the special cases where we have single-point tower data for particular sites. Right now we only have data for three urban locations: Mexico City Mexico, Vancouver Canada, and the urban-c alpha site. We also have data for the US-UMB AmeriFlux tower site for University of Michigan Biological Station. See :ref:`clm1pt-and-its-datm` for more information. ``CPLHISTForcing`` This is for running with atmospheric forcing from a previous CESM simulation. See :ref:`cplhistforcing` for more information. @@ -591,7 +591,7 @@ Downloading DATM Forcing Data In Chapter One of the `CESM User's Guide `_ there is a section on "Downloading input data". The normal process of setting up cases will use the "scripts/ccsm_utils/Tools/check_input_data" script to retrieve data from the CESM subversion inputdata repository. This is true for the standard `CLM_QIAN` forcing as well. -The `CLMCRUNCEP` data is uploaded into the subversion inputdata repository as well -- but as it is 1.1 Terabytes of data downloading it is problematic (*IT WILL TAKE SEVERAL DAYS TO DOWNLOAD THE ENTIRE DATASET USING SUBVERSION*). Because of it's size you may also need to download it onto a separate disk space. We have done that on cheyenne for example where it resides in ``$ENV{CESMROOT}/lmwg`` while the rest of the input data resides in ``$ENV{CESMDATAROOT}/inputdata``. The data is also already available on: janus, franklin, and hopper. If you download the data, we recommend that you break your download into several chunks, by setting up a case and setting the year range for ``DATM_CPL_YR_START`` and ``DATM_CPL_YR_END`` in say 20 year sections over 1901 to 2010, and then use **check_input_data** to export the data. +The `CLMCRUNCEP` data is uploaded into the subversion inputdata repository as well -- but as it is 1.1 Terabytes of data downloading it is problematic (*IT WILL TAKE SEVERAL DAYS TO DOWNLOAD THE ENTIRE DATASET USING SUBVERSION*). Because of its size you may also need to download it onto a separate disk space. We have done that on cheyenne for example where it resides in ``$ENV{CESMROOT}/lmwg`` while the rest of the input data resides in ``$ENV{CESMDATAROOT}/inputdata``. The data is also already available on: janus, franklin, and hopper. If you download the data, we recommend that you break your download into several chunks, by setting up a case and setting the year range for ``DATM_CPL_YR_START`` and ``DATM_CPL_YR_END`` in say 20 year sections over 1901 to 2010, and then use ``check_input_data`` to export the data. The ``CPLHISTForcing`` DATM forcing data is unique -- because it is large compared to the rest of the input data, and we only have a disk copy on cheyenne. The DATM assumes the path for the previous NCAR machine cheyenne of ``/glade/p/cesm/shared_outputdata/cases/ccsm4/$DATM_CPLHIST_CASE`` for the data. So you will need to change this path in order to run on any other machine. You can download the data itself from NCAR HPSS from ``/CCSM/csm/$DATM_CPLHIST_CASE``. @@ -599,12 +599,12 @@ The ``CPLHISTForcing`` DATM forcing data is unique -- because it is large compar Customizing via the build script files -------------------------------------- -The final thing that the user may wish to do before **case.setup** is run is to edit the build script files which determine the configuration and namelist. The variables in ``env_build.xml`` or ``env_run.xml`` typically mean you will NOT have to edit build script files. But, there are rare instances where it is useful to do so. The build script files are copied to your case directory and are available under Buildconf. The list of build script files you might wish to edit are: +The final thing that the user may wish to do before ``case.setup`` is run is to edit the build script files which determine the configuration and namelist. The variables in ``env_build.xml`` or ``env_run.xml`` typically mean you will NOT have to edit build script files. But, there are rare instances where it is useful to do so. The build script files are copied to your case directory and are available under ``Buildconf``. The list of build script files you might wish to edit are: -**clm.buildexe.csh** -**$CTSMROOT/cime_config/buildnml** -**datm.buildexe.csh** -**datm.buildnml.csh** +``clm.buildexe.csh`` +``$CTSMROOT/cime_config/buildnml`` +``datm.buildexe.csh`` +``datm.buildnml.csh`` .. _more-info-clm-config-script: @@ -617,7 +617,7 @@ The CLM ``configure`` script defines the details of a clm configuration and summ Help on CLM configure --------------------- -Coupling this with looking at the options to CLM **configure** with "-help" as below will enable you to understand how to set the different options. +Coupling this with looking at the options to CLM ``configure`` with ``-help`` as below will enable you to understand how to set the different options. :: > cd $CTSMROOT/bld @@ -694,4 +694,4 @@ The output to the above command is as follows: no-nitrif Turn the Nitrification/denitrification off [no-vert,no-cent,no-nitrif,no-vert:no-cent] -We've given details on how to use the options in env_build.xml and env_run.xml to interact with the CLM "configure" and "build-namelist" scripts, as well as giving a good understanding of how these scripts work and the options to them. In the next section we give further details on the CLM namelist. You could customize the namelist for these options after "case.setup" is run. +We've given details on how to use the options in ``env_build.xml`` and ``env_run.xml`` to interact with the CLM ``configure`` and ``build-namelist`` scripts, as well as giving a good understanding of how these scripts work and the options to them. In the next section we give further details on the CLM namelist. You could customize the namelist for these options after ``case.setup`` is run. 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 ff76a841c9..2d6f58f317 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 @@ -6,7 +6,7 @@ Customizing CLM's namelist ============================ -Once a case has run **case.setup**, we can then customize the case further, by editing the run-time namelist for CLM. First let's list the definition of each namelist item and their valid values, and then we'll list the default values for them. Next for some of the most used or tricky namelist items we'll give examples of their use, and give you example namelists that highlight these features. +Once a case has run ``case.setup``, we can then customize the case further, by editing the run-time namelist for CLM. First let's list the definition of each namelist item and their valid values, and then we'll list the default values for them. Next for some of the most used or tricky namelist items we'll give examples of their use, and give you example namelists that highlight these features. In the following, various examples of namelists are provided that feature the use of different namelist options to customize a case for particular uses. Most the examples revolve around how to customize the output history fields. This should give you a good basis for setting up your own CLM namelist. @@ -138,14 +138,14 @@ Example 1-5. Example user_nl_clm namelist removing all history fields Various ways to change history output averaging flags ----------------------------------------------------- -There are two ways to change the averaging of output history fields. The first is using ``hist_avgflag_pertape`` which gives a default value for each history stream, the second is when you add fields using ``hist_fincl*``, you add an averaging flag to the end of the field name after a colon (for example 'TSOI:X', would output the maximum of TSOI). The types of averaging that can be done are: +There are two ways to change the averaging of output history fields. The first is using ``hist_avgflag_pertape`` which gives a default value for each history stream, the second is when you add fields using ``hist_fincl*``, you add an averaging flag to the end of the field name after a colon (for example ``TSOI:X`` would output the maximum of ``TSOI``). The types of averaging that can be done are: -- *A* Average, over the output interval. -- *I* Instantaneous, output the value at the output interval. -- *X* Maximum, over the output interval. -- *M* Minimum, over the output interval. +- ``A`` Average, over the output interval. +- ``I`` Instantaneous, output the value at the output interval. +- ``X`` Maximum, over the output interval. +- ``M`` Minimum, over the output interval. -The default averaging depends on the specific fields, but for most fields is an average. A sample user namelist ``user_nl_clm`` making the monthly output fields all averages (except TSOI for the first two streams and FIRE for the 5th stream), and adding auxiliary file streams for instantaneous (6-hourly), maximum (daily), minimum (daily), and average (daily). For some of the fields we diverge from the per-tape value given and customize to some different type of optimization. +The default averaging depends on the specific fields, but for most fields is an average. A sample user namelist ``user_nl_clm`` making the monthly output fields all averages (except ``TSOI`` for the first two streams and ``FIRE`` for the 5th stream), and adding auxiliary file streams for instantaneous (6-hourly), maximum (daily), minimum (daily), and average (daily). For some of the fields we diverge from the per-tape value given and customize to some different type of optimization. Example: user_nl_clm namelist with various ways to average history fields ------------------------------------------------------------------------------------- @@ -165,7 +165,7 @@ Example: user_nl_clm namelist with various ways to average history fields hist_avgflag_pertape = 'A', 'I', 'X', 'M', 'A' hist_nhtfrq = 0, -6, -24, -24, -24 -In the example we put the same list of fields on each of the tapes: soil-temperature, ground temperature, vegetation temperature, emitted longwave radiation, reflected solar radiation, sensible heat, total latent-heat, and total water storage. We also modify the soil-temperature for the primary and secondary auxiliary tapes by outputting them for a maximum instead of the prescribed per-tape of average and instantaneous respectively. For the tertiary auxiliary tape we output ground temperature instantaneous instead of as a maximum, and for the fourth auxiliary tape we output vegetation temperature instantaneous instead of as a minimum. Finally, for the fifth auxiliary tapes we output ``FIRE`` instantaneously instead of as an average. +In the example we put the same list of fields on each of the tapes: soil-temperature, ground temperature, vegetation temperature, emitted longwave radiation, reflected solar radiation, sensible heat, total latent-heat, and total water storage. We also modify the soil temperature for the primary and secondary auxiliary tapes by outputting them for a maximum instead of the prescribed per-tape of average and instantaneous respectively. For the tertiary auxiliary tape we output ground temperature instantaneous instead of as a maximum, and for the fourth auxiliary tape we output vegetation temperature instantaneous instead of as a minimum. Finally, for the fifth auxiliary tapes we output ``FIRE`` instantaneously instead of as an average. .. note:: We also use ``hist_empty_htapes`` as in the previous example, so we can list ONLY the fields that we want on the primary history tapes. @@ -189,8 +189,8 @@ Example: user_nl_clm namelist outputting some files in 1D Vector format hist_type2d_pertape = ' ', 'GRID', 'COLS', ' ' hist_nhtfrq = 0, -24, -24, -24 -.. warning:: LAND and COLS are also options to the pertape averaging, but currently there is a bug with them and they fail to work. +.. warning:: ``LAND`` and ``COLS`` are also options to the pertape averaging, but currently there is a bug with them and they fail to work. -.. note:: Technically the default for hist_nhtfrq is for primary files output monthly and the other auxiliary tapes for daily, so we don't actually have to include hist_nhtfrq, we could use the default for it. Here we specify it for clarity. +.. note:: Technically the default for ``hist_nhtfrq`` is for primary files output monthly and the other auxiliary tapes for daily, so we don't actually have to include ``hist_nhtfrq``, we could use the default for it. Here we specify it for clarity. -Visualizing global 1D vector files will take effort. You'll probably want to do some post-processing and possibly just extract out single points of interest to see what is going on. Since, the output is a 1D vector, of only land-points traditional plots won't be helpful. The number of points per grid-cell will also vary for anything, but grid-cell averaging. You'll need to use the output fields pfts1d_ixy, and pfts1d_jxy, to get the mapping of the fields to the global 2D array. pfts1d_itype_veg gives you the PFT number for each PFT. Most likely you'll want to do this analysis in a data processing tool (such as NCL, Matlab, Mathmatica, IDL, etcetera that is able to read and process NetCDF data files). +Visualizing global 1D vector files will take effort. You'll probably want to do some post-processing and possibly just extract out single points of interest to see what is going on. Since the output is a 1D vector of only land points, traditional plots won't be helpful. The number of points per grid-cell will also vary for anything but grid-cell averaging. You'll need to use the output fields ``pfts1d_ixy``, and ``pfts1d_jxy``, to get the mapping of the fields to the global 2D array. ``pfts1d_itype_veg`` gives you the PFT number for each PFT. Most likely you'll want to do this analysis in a data processing tool (such as NCL, Matlab, Mathmatica, IDL, etc. that is able to read and process NetCDF data files). diff --git a/doc/source/users_guide/testing/testing.rst b/doc/source/users_guide/testing/testing.rst index ec959d4b82..b065cb1392 100644 --- a/doc/source/users_guide/testing/testing.rst +++ b/doc/source/users_guide/testing/testing.rst @@ -6,12 +6,12 @@ Testing ******* -Technically, you could use the customization we gave in :ref:`customizing_section` to test various configuration and namelist options for CLM. Sometimes, it's also useful to have automated tests though to test that restarts give exactly the same results as without a restart. It's also useful to have automated tests to run over a wide variety of configurations, resolutions, and namelist options. To do that we have several different types of scripts set up to make running comprehensive testing of CLM easy. There are two types of testing scripts for CLM. The first are the CESM test scripts, which utilize the **create_newcase** scripts that we shown how to use in this User's Guide. The second are a set of stand-alone scripts that use the CLM **configure** and **build-namelist** scripts to build and test the model as well as testing the CLM tools as well. Below we will go into further details of how to use both methods. +Technically, you could use the customization we gave in :ref:`customizing_section` to test various configuration and namelist options for CLM. Sometimes, it's also useful to have automated tests though to test that restarts give exactly the same results as without a restart. It's also useful to have automated tests to run over a wide variety of configurations, resolutions, and namelist options. To do that we have several different types of scripts set up to make running comprehensive testing of CLM easy. There are two types of testing scripts for CLM. The first are the CESM test scripts, which utilize the ``create_newcase`` scripts that we shown how to use in this User's Guide. The second are a set of stand-alone scripts that use the CLM ``configure`` and ``build-namelist`` scripts to build and test the model as well as testing the CLM tools as well. Below we will go into further details of how to use both methods. CIME Testing scripts ==================== -We first introduce the test scripts that work for all CESM components. The CIME script **create_test** runs a specific type of test, at a given resolution, for a given compset using a given machine. See `CIME Chapter on Testing `_ for how to use it to run single tests as well as lists of tests. The standard testname for CLM is "aux_clm" for cheyenne with intel and gnu compilers as well as the CGD machine hobart for intel, nag, and pgi compilers. There's also a shorter test list called "clm_short". Also see the `CTSM Wiki on Testing `_. +We first introduce the test scripts that work for all CESM components. The CIME script ``create_test`` runs a specific type of test, at a given resolution, for a given compset using a given machine. See `CIME Chapter on Testing `_ for how to use it to run single tests as well as lists of tests. The standard testname for CLM is "aux_clm" for cheyenne with intel and gnu compilers as well as the CGD machine hobart for intel, nag, and pgi compilers. There's also a shorter test list called "clm_short". Also see the `CTSM Wiki on Testing `_. CTSM Fortran Unit Tests ======================= diff --git a/doc/source/users_guide/trouble-shooting/trouble-shooting.rst b/doc/source/users_guide/trouble-shooting/trouble-shooting.rst index 93798c3c57..418a4aff37 100644 --- a/doc/source/users_guide/trouble-shooting/trouble-shooting.rst +++ b/doc/source/users_guide/trouble-shooting/trouble-shooting.rst @@ -2,7 +2,7 @@ .. _trouble-shooting: -*************** +************* Troubleshooting *************** @@ -112,20 +112,20 @@ The second method is to use the local index along with the processor number:: 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. +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 +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**. +(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. +(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 +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 @@ -136,7 +136,7 @@ The example function in **point_of_interest.F90** is **poi_c**. It finds columns end if end do -You will also need a **use** statement in the module from which you are calling poi_c +You will also need a ``use`` statement in the module from which you are calling poi_c :: use point_of_interest, only : poi_c @@ -193,5 +193,5 @@ Along the same lines, you might try running a simpler case, trying another comps Run with a debugger ------------------- -Another suggestion is to run the model with a debugger such as: **ddt**, **dbx**, **gdb**, or **totalview**. Often to run with a debugger you will need to reduce the number of processors as outlined above. Some debuggers such as **dbx** will only work with one processor, while more advanced debuggers such as **totalview** can work with both MPI tasks and OMP threads. Even simple debuggers though can be used to query core files, to see where the code was at when it died (for example using the **where** in **dbx** for a core file can be very helpful. For help in running with a debugger you will need to contact your system administrators for the machine you are running on. +Another suggestion is to run the model with a debugger such as: ``ddt``, ``dbx``, ``gdb``, or ``totalview``. Often to run with a debugger you will need to reduce the number of processors as outlined above. Some debuggers such as ``dbx`` will only work with one processor, while more advanced debuggers such as ``totalview`` can work with both MPI tasks and OMP threads. Even simple debuggers though can be used to query core files, to see where the code was at when it died (for example using the ``where`` in ``dbx`` for a core file can be very helpful. For help in running with a debugger you will need to contact your system administrators for the machine you are running on. diff --git a/doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst b/doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst index 95e0333d6d..295dfd9380 100644 --- a/doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst +++ b/doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst @@ -4,17 +4,17 @@ .. include:: ../substitutions.rst -The CLM FORTRAN tools all have similar makefiles, and similar options for building. The tools **cprnc** and **gen_domain** use the CIME configure/build system which is described in the next section. +The CLM FORTRAN tools all have similar makefiles, and similar options for building. The tools ``cprnc`` and ``gen_domain`` use the CIME configure/build system which is described in the next section. -The Makefiles (for **mksurfdata_esmf** and **mkprocdata_map**) use GNU Make extensions and thus require that you use GNU make to use them. They also auto detect the type of platform you are on, using "uname -s" and set the compiler, compiler flags and such accordingly. There are also environment variables that can be set to set things that must be customized. All the tools use NetCDF and hence require the path to the NetCDF libraries and include files. On some platforms (such as Linux) multiple compilers can be used, and hence there are env variables that can be set to change the FORTRAN and/or "C" compilers used. The tools also allow finer control, by also allowing the user to add compiler flags they choose, for both FORTRAN and "C", as well as picking the compiler, linker and and add linker options. Finally the tools allow you to turn optimization on (which is off by default but on for **mksurfdata_esmf**) with the OPT flag so that the tool will run faster. +The Makefiles (for ``mksurfdata_esmf`` and ``mkprocdata_map``) use GNU Make extensions and thus require that you use GNU make to use them. They also auto detect the type of platform you are on, using "uname -s" and set the compiler, compiler flags and such accordingly. There are also environment variables that can be set to set things that must be customized. All the tools use NetCDF and hence require the path to the NetCDF libraries and include files. On some platforms (such as Linux) multiple compilers can be used, and hence there are env variables that can be set to change the FORTRAN and/or "C" compilers used. The tools also allow finer control, by also allowing the user to add compiler flags they choose, for both FORTRAN and "C", as well as picking the compiler, linker and and add linker options. Finally the tools allow you to turn optimization on (which is off by default but on for ``mksurfdata_esmf``) with the OPT flag so that the tool will run faster. -Options used by all: **mksurfdata_esmf** +Options used by all: ``mksurfdata_esmf`` - ``LIB_NETCDF`` -- sets the location of the NetCDF library. - ``INC_NETCDF`` -- sets the location of the NetCDF include files. - ``USER_FC`` -- sets the name of the FORTRAN compiler. -Options used by: **mkprocdata_map**, and **mksurfdata_esmf** +Options used by: ``mkprocdata_map``, and ``mksurfdata_esmf`` - ``MOD_NETCDF`` -- sets the location of the NetCDF FORTRAN module. - ``USER_LINKER`` -- sets the name of the linker to use. @@ -40,7 +40,7 @@ More details on each environment variable. This variable sets the path to the NetCDF include directory (in order to find the include file ``netcdf.inc``). if not set it defaults to ``/usr/local/include``. ``MOD_NETCDF`` - This variable sets the path to the NetCDF module directory (in order to find the NetCDF FORTRAN-90 module file when NetCDF is used with a FORTRAN-90 **use statement**. When not set it defaults to the ``LIB_NETCDF`` value. + This variable sets the path to the NetCDF module directory (in order to find the NetCDF FORTRAN-90 module file when NetCDF is used with a FORTRAN-90 ``use statement``. When not set it defaults to the ``LIB_NETCDF`` value. ``USER_FC`` This variable sets the command name to the FORTRAN-90 compiler to use when compiling the tool. The default compiler to use depends on the platform. And for example, on the AIX platform this variable is NOT used @@ -69,7 +69,7 @@ More details on each environment variable. .. warning:: Note, that depending on the compiler answers may be different when SMP is activated. ``OPT`` - This variable flags if compiler optimization should be used when compiling the tool. It can be set to either ``TRUE`` or ``FALSE``, by default it is set to for both **mksurfdata_esmf** and **mkprocdata_map**. Turning this on should make the tool run much faster. + This variable flags if compiler optimization should be used when compiling the tool. It can be set to either ``TRUE`` or ``FALSE``, by default it is set to for both ``mksurfdata_esmf`` and ``mkprocdata_map``. Turning this on should make the tool run much faster. .. warning:: Note, you should expect that answers will be different when ``OPT`` is activated. @@ -90,7 +90,7 @@ More details on each environment variable. .. note:: There are several files that are copies of the original files. By having copies the tools can all be made stand-alone, but any changes to the originals will have to be put into the tool directories as well. -The *README.filecopies* (which can be found in ``$CTSMROOT/tools``) is repeated here. +The ``README.filecopies`` (which can be found in ``$CTSMROOT/tools``) is repeated here. .. include:: ../../../../tools/README.filecopies :literal: @@ -99,7 +99,7 @@ The *README.filecopies* (which can be found in ``$CTSMROOT/tools``) is repeated Building the CLM tools that use the CIME configure/build system ================================================================ -**cprnc** and *gen_domain** both use the CIME configure/build system rather than the CLM specific version described above. +``cprnc`` and ``gen_domain`` both use the CIME configure/build system rather than the CLM specific version described above. -See `CIME documentation on adding grids `_ for more information on adding grids, creating mapping files, and running **gen_domain**. Also see the CIME file: ``$CTSMROOT/tools/mapping/gen_domain_files/INSTALL`` for how to build **gen_domain**. +See `CIME documentation on adding grids `_ for more information on adding grids, creating mapping files, and running ``gen_domain``. Also see the CIME file: ``$CTSMROOT/tools/mapping/gen_domain_files/INSTALL`` for how to build ``gen_domain``. diff --git a/doc/source/users_guide/using-clm-tools/cprnc.rst b/doc/source/users_guide/using-clm-tools/cprnc.rst index 05a2ca8279..81418877c9 100644 --- a/doc/source/users_guide/using-clm-tools/cprnc.rst +++ b/doc/source/users_guide/using-clm-tools/cprnc.rst @@ -6,7 +6,7 @@ Comparing History Files ========================= -**cprnc** is a tool shared by |cesmrelease| to compare two NetCDF history files. It differences every field that is shared on both files, and reports a summary of the difference. The summary includes the three largest differences, as well as the root mean square (RMS) difference. It also gives some summary information on the field as well. You have to enter at least one file, and up to two files. With one file it gives you summary information on the file, and with two it gives you information on the differences between the two. At the end it will give you a summary of the fields compared and how many fields were different and how many were identical. +``cprnc`` is a tool shared by |cesmrelease| to compare two NetCDF history files. It differences every field that is shared on both files, and reports a summary of the difference. The summary includes the three largest differences, as well as the root mean square (RMS) difference. It also gives some summary information on the field as well. You have to enter at least one file, and up to two files. With one file it gives you summary information on the file, and with two it gives you information on the differences between the two. At the end it will give you a summary of the fields compared and how many fields were different and how many were identical. Options: diff --git a/doc/source/users_guide/using-clm-tools/creating-domain-files.rst b/doc/source/users_guide/using-clm-tools/creating-domain-files.rst index d4ebd6c4e7..3673e4ac18 100644 --- a/doc/source/users_guide/using-clm-tools/creating-domain-files.rst +++ b/doc/source/users_guide/using-clm-tools/creating-domain-files.rst @@ -6,7 +6,7 @@ Creating CLM domain files ***************************** -*gen_domain* to create a domain file for datm from a mapping file. ``gen_domain`` is a tool that is a part of CIME. The domain file is then used by BOTH DATM AND CLM to define the grid and land-mask. The general data flow is shown in two figures. :numref:`Figure mkmapdata.sh` shows the general flow for a general global case (or for a regional grid that DOES include ocean). :numref:`Figure mknoocnmap.pl` shows the use of ``mknoocnmap.pl`` (see :ref:`using-mkocnmap`) to create a regional or single-point map file that is then run through ``gen_domain`` to create the domain file for it. As stated before :numref:`Figure Data_Flow_Legend` is the legend for both of these figures. See `the $CIMEROOT/tools/mapping/gen_domain_files/README `_ file for more help on ``gen_domain``. +``gen_domain`` to create a domain file for datm from a mapping file. ``gen_domain`` is a tool that is a part of CIME. The domain file is then used by BOTH DATM AND CLM to define the grid and land-mask. The general data flow is shown in two figures. :numref:`Figure mkmapdata.sh` shows the general flow for a general global case (or for a regional grid that DOES include ocean). :numref:`Figure mknoocnmap.pl` shows the use of ``mknoocnmap.pl`` (see :ref:`using-mkocnmap`) to create a regional or single-point map file that is then run through ``gen_domain`` to create the domain file for it. As stated before :numref:`Figure Data_Flow_Legend` is the legend for both of these figures. See `the $CIMEROOT/tools/mapping/gen_domain_files/README `_ file for more help on ``gen_domain``. Here we create domain files for a regular global domain. @@ -19,7 +19,7 @@ Global Domain file creation Global Domain file creation -Starting from SCRIP grid files for both your atmosphere and ocean, you use **$CIMEROOT/tools/mapping/gen_mapping_files/gen_cesm_maps.sh** to create a mapping file between the atmosphere and ocean. That mapping file is then used as input to **gen_domain** to create output domain files for both atmosphere and ocean. The atmosphere domain file is then used by both CLM and DATM for I compsets, while the ocean domain file is ignored. For this process you have to define your SCRIP grid files on your own. For a regional or single-point case that doesn't include ocean see :numref:`Figure mknoocnmap.pl`. (See :numref:`Figure Global-Domain` for the legend for this figure.) +Starting from SCRIP grid files for both your atmosphere and ocean, you use ``$CIMEROOT/tools/mapping/gen_mapping_files/gen_cesm_maps.sh`` to create a mapping file between the atmosphere and ocean. That mapping file is then used as input to ``gen_domain`` to create output domain files for both atmosphere and ocean. The atmosphere domain file is then used by both CLM and DATM for I compsets, while the ocean domain file is ignored. For this process you have to define your SCRIP grid files on your own. For a regional or single-point case that doesn't include ocean see :numref:`Figure mknoocnmap.pl`. (See :numref:`Figure Global-Domain` for the legend for this figure.) Note that the SCRIP grid file used to start this process is also used in ``mkmapdata.sh`` (see :ref:`using-mkocnmap`). Next we create domain files for a single-point or regional domain. @@ -32,6 +32,6 @@ Domain file creation using mknoocnmap.pl Domain file creation using mknoocnmap.pl -For a regular latitude/longitude grid that can be used for regional or single point simulations -- you can use **mknoocnmap.pl**. It creates a SCRIP grid file that can then be used as input to **mkmapdata.sh** as well as a SCRIP mapping file that is then input to **gen_domain**. The output of **gen_domain** is a atmosphere domain file used by both CLM and DATM and a ocean domain file that is ignored. (See :numref:`Figure mknoocnmap.pl` for the legend for this figure.) +For a regular latitude/longitude grid that can be used for regional or single point simulations -- you can use ``mknoocnmap.pl``. It creates a SCRIP grid file that can then be used as input to ``mkmapdata.sh`` as well as a SCRIP mapping file that is then input to ``gen_domain``. The output of ``gen_domain`` is a atmosphere domain file used by both CLM and DATM and a ocean domain file that is ignored. (See :numref:`Figure mknoocnmap.pl` for the legend for this figure.) -In this case the process creates both SCRIP grid files to be used by **mkmapdata.sh** as well as the domain files that will be used by both CLM and DATM. +In this case the process creates both SCRIP grid files to be used by ``mkmapdata.sh`` as well as the domain files that will be used by both CLM and DATM. diff --git a/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst b/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst index a727631a6c..e923b3bab2 100644 --- a/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst +++ b/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst @@ -18,7 +18,7 @@ SCRIP grid files for all the standard model resolutions and the raw surface data Using mknocnmap.pl to create grid and maps for single-point regional grids -------------------------------------------------------------------------- -If you want to create a regular latitude/longitude single-point or regional grid, we suggest you use **mknoocnmap.pl** in ``$CTSMROOT/tools/mkmapdata`` which will create both the SCRIP grid file you need (using ``$CTSMROOT/tools/mkmapgrids/mkscripgrid.ncl`` AND an identity mapping file assuming there is NO ocean in your grid domain. If you HAVE ocean in your domain you could modify the mask in the SCRIP grid file for ocean, and then use **ESMF_RegridWeightGen** to create the mapping file, and **gen_domain** to create the domain file. Like other tools, ``./mkmapdata/mknoocnmap.pl`` has a help option with the following: +If you want to create a regular latitude/longitude single-point or regional grid, we suggest you use ``mknoocnmap.pl`` in ``$CTSMROOT/tools/mkmapdata`` which will create both the SCRIP grid file you need (using ``$CTSMROOT/tools/mkmapgrids/mkscripgrid.ncl``) AND an identity mapping file assuming there is NO ocean in your grid domain. If you HAVE ocean in your domain you could modify the mask in the SCRIP grid file for ocean, and then use ``ESMF_RegridWeightGen`` to create the mapping file, and ``gen_domain`` to create the domain file. Like other tools, ``./mkmapdata/mknoocnmap.pl`` has a help option with the following: :: SYNOPSIS diff --git a/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst b/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst index d2e2ef7c89..a59163a910 100644 --- a/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst +++ b/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst @@ -26,29 +26,29 @@ Starting from a SCRIP grid file that describes the grid you will run the model o Green arrows define the input to a program, while red arrows define the output. Cylinders define files that are either created by a program or used as input for a program. Boxes are programs. -You start with a description of a SCRIP grid file for your output grid file and then create mapping files from the raw datasets to it. Once, the mapping files are created **mksurfdata_esmf** is run to create the surface dataset to run the model. +You start with a description of a SCRIP grid file for your output grid file and then create mapping files from the raw datasets to it. Once, the mapping files are created ``mksurfdata_esmf`` is run to create the surface dataset to run the model. Creating a Complete Set of Files for Input to CLM ------------------------------------------------- 1. Create SCRIP grid datasets (if NOT already done) - First you need to create a descriptor file for your grid, that includes the locations of cell centers and cell corners. There is also a "mask" field, but in this case the mask is set to one everywhere (i.e. all of the masks for the output model grid are "nomask"). An example SCRIP grid file is: $CSMDATA/lnd/clm2/mappingdata/grids/SCRIPgrid_10x15_nomask_c110308.nc. The mkmapgrids and mkscripgrid.ncl NCL script in the $CTSMROOT/tools/mkmapgrids directory can help you with this. SCRIP grid files for all the standard CLM grids are already created for you. See the Section called Creating an output SCRIP grid file at a resolution to run the model on for more information on this. + First you need to create a descriptor file for your grid, that includes the locations of cell centers and cell corners. There is also a "mask" field, but in this case the mask is set to one everywhere (i.e. all of the masks for the output model grid are "nomask"). An example SCRIP grid file is: ``$CSMDATA/lnd/clm2/mappingdata/grids/SCRIPgrid_10x15_nomask_c110308.nc``. The ``mkmapgrids`` and ``mkscripgrid.ncl`` NCL script in the ``$CTSMROOT/tools/mkmapgrids`` directory can help you with this. SCRIP grid files for all the standard CLM grids are already created for you. See the Section called Creating an output SCRIP grid file at a resolution to run the model on for more information on this. 2. Create domain dataset (if NOT already done) - Next use gen_domain to create a domain file for use by DATM and CLM. This is required, unless a domain file was already created. See the Section called Creating a domain file for CLM and DATM for more information on this. + Next use ``gen_domain`` to create a domain file for use by DATM and CLM. This is required, unless a domain file was already created. See the Section called Creating a domain file for CLM and DATM for more information on this. -3. Create mapping files for mksurfdata_esmf (if NOT already done) +3. Create mapping files for ``mksurfdata_esmf`` (if NOT already done) - Create mapping files for mksurfdata_esmf with mkmapdata.sh in $CTSMROOT/tools/mkmapdata. See the Section called Creating mapping files that mksurfdata_esmf will use for more information on this. + Create mapping files for ``mksurfdata_esmf`` with ``mkmapdata.sh`` in ``$CTSMROOT/tools/mkmapdata``. See the Section called Creating mapping files that ``mksurfdata_esmf`` will use for more information on this. 4. Create surface datasets - Next use mksurfdata_esmf to create a surface dataset, using the mapping datasets created on the previous step as input. There is a version for either clm4_0 or |version| for this program. See the Section called Using mksurfdata_esmf to create surface datasets from grid datasets for more information on this. + Next use ``mksurfdata_esmf`` to create a surface dataset, using the mapping datasets created on the previous step as input. There is a version for either clm4_0 or |version| for this program. See the Section called Using ``mksurfdata_esmf`` to create surface datasets from grid datasets for more information on this. -5. Enter the new datasets into the build-namelist XML database - The last optional thing to do is to enter the new datasets into the build-namelist XML database. See Chapter 3 for more information on doing this. This is optional because the user may enter these files into their namelists manually. The advantage of entering them into the database is so that they automatically come up when you create new cases. +5. Enter the new datasets into the ``build-namelist`` XML database + The last optional thing to do is to enter the new datasets into the ``build-namelist`` XML database. See Chapter 3 for more information on doing this. This is optional because the user may enter these files into their namelists manually. The advantage of entering them into the database is so that they automatically come up when you create new cases. The ``$CTSMROOT/tools/README`` goes through the complete process for creating input files needed to run CLM. We repeat that file here: diff --git a/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst b/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst index db5cf10798..c997f403d2 100644 --- a/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst +++ b/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst @@ -12,21 +12,21 @@ The tools produce files that can be used for CLM4.5 and |version|. They do **NOT The list of generally important scripts and programs are as follows. -1. *./mkmapgrids* to create SCRIP grid data files from old CLM format grid files that can then be used to create new CLM datasets (deprecated). There is also a NCL script (``./mkmapgrids/mkscripgrid.ncl`` to create SCRIP grid files for regular latitude/longitude grids. +1. ``./mkmapgrids`` to create SCRIP grid data files from old CLM format grid files that can then be used to create new CLM datasets (deprecated). There is also a NCL script (``./mkmapgrids/mkscripgrid.ncl``) to create SCRIP grid files for regular latitude/longitude grids. -#. *./mkmapdata* to create SCRIP mapping data file from SCRIP grid files (uses ESMF). +#. ``./mkmapdata`` to create SCRIP mapping data file from SCRIP grid files (uses ESMF). -#. *mksurfdata_esmf* to create surface datasets from grid datasets (clm4_0 and |version| versions). +#. ``mksurfdata_esmf`` to create surface datasets from grid datasets (clm4_0 and |version| versions). -#. *./mkprocdata_map* to interpolate output unstructured grids (such as the CAM HOMME dy-core "ne" grids like ne30np4) into a 2D regular lat/long grid format that can be plotted easily. Can be used by either clm4_0 or |version|. +#. ``./mkprocdata_map`` to interpolate output unstructured grids (such as the CAM HOMME dy-core "ne" grids like ne30np4) into a 2D regular lat/long grid format that can be plotted easily. Can be used by either clm4_0 or |version|. -#. *$CIMEROOT/tools/mapping/gen_domain_files/gen_domain* to create a domain file for datm from a mapping file. The domain file is then used by BOTH datm AND CLM to define the grid and land-mask. +#. ``$CIMEROOT/tools/mapping/gen_domain_files/gen_domain`` to create a domain file for datm from a mapping file. The domain file is then used by BOTH datm AND CLM to define the grid and land-mask. -#. *$CIMEROOT/tools/cprnc* to compare two NetCDF files. +#. ``$CIMEROOT/tools/cprnc`` to compare two NetCDF files. In the sections to come we will go into detailed description of how to use each of these tools in turn. First, however we will discuss the common environment variables and options that are used by all of the FORTRAN tools. Second, we go over the outline of the entire file creation process for all input files needed by CLM for a new resolution, then we turn to each tool. In the last section we will discuss how to customize files for particular observational sites. -The FORTRAN tools (mksurfdata_esmf and mkprocdata_map) run, with a namelist (mksurfdata_esmf) to provide options, or with command line arguments (mkprocdata_map). +The FORTRAN tools (``mksurfdata_esmf`` and ``mkprocdata_map``) run, with a namelist (``mksurfdata_esmf``) to provide options, or with command line arguments (``mkprocdata_map``). In the following sections, we will outline how to make these files available for build-namelist so that you can easily create simulations that include them. In the chapter on single-point and regional datasets we also give an alternative way to enter new datasets without having to edit files. @@ -34,12 +34,12 @@ In the following sections, we will outline how to make these files available for Running FORTRAN tools with namelists ------------------------------------ -**mksurfdata_esmf** runs with a namelist that is read from standard input. Hence, you create a namelist and then run them by redirecting the namelist file into standard input as follows: +``mksurfdata_esmf`` runs with a namelist that is read from standard input. Hence, you create a namelist and then run them by redirecting the namelist file into standard input as follows: :: ./program < namelist -There is a sample namelist called ``$CTSMROOT/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml`` that shows you what the namelist should look like. **mksurfdata_esmf** also has a script that creates the namelist and runs the program for you. Namelists that you create should be similar to the example namelist. The namelist values are also documented along with the other namelists in the: +There is a sample namelist called ``$CTSMROOT/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml`` that shows you what the namelist should look like. ``mksurfdata_esmf`` also has a script that creates the namelist and runs the program for you. Namelists that you create should be similar to the example namelist. The namelist values are also documented along with the other namelists in the: :: $CTSMROOT/bld/namelist_files/namelist_definition.xml`` file @@ -50,7 +50,7 @@ There is a sample namelist called ``$CTSMROOT/tools/mksurfdata_esmf/gen_mksurfda Running FORTRAN tools with command line options ----------------------------------------------- -**gen_domain**, mkprocdata_map, and **cprnc** run with command line arguments. The detailed sections below will give you more information on the command line arguments specific to each tool. Also running the tool without any arguments will give you a general synopsis on how to run the tool. +``gen_domain``, ``mkprocdata_map``, and ``cprnc`` run with command line arguments. The detailed sections below will give you more information on the command line arguments specific to each tool. Also running the tool without any arguments will give you a general synopsis on how to run the tool. ----------------------------------------- Running FORTRAN tools built with SMP=TRUE From ac01cb3e48e3b6348b51eb1adaa73e8f63cdf3b3 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 19 Sep 2024 20:01:28 -0600 Subject: [PATCH 027/158] Add doc todo to replace missing figure. --- doc/source/lilac/specific-atm-models/wrf-nesting.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/source/lilac/specific-atm-models/wrf-nesting.rst b/doc/source/lilac/specific-atm-models/wrf-nesting.rst index f4c4570f2f..347a927a59 100644 --- a/doc/source/lilac/specific-atm-models/wrf-nesting.rst +++ b/doc/source/lilac/specific-atm-models/wrf-nesting.rst @@ -50,13 +50,14 @@ A full description of all steps for a WRF-CTSM run are included here. 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: +In this example we use a nested domain over the CONUS as shown below: .. _Figure ctsm-ndown: -.. figure:: ndown_ctsm_diagram.svg - - Flowchart for WRF-CTSM one-way nested simulations +.. todo:: + Replace missing ndown_ctsm_diagram.svg + +Flowchart for WRF-CTSM one-way nested simulations Nested Simulations : Pre-processing (geogrid.exe) ------------------------------------------------- From 5c3ea513f85f394a09e081b1e56fb69a9c1f9eab Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 19 Sep 2024 20:02:15 -0600 Subject: [PATCH 028/158] Fix a title overline. --- doc/source/users_guide/trouble-shooting/trouble-shooting.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/users_guide/trouble-shooting/trouble-shooting.rst b/doc/source/users_guide/trouble-shooting/trouble-shooting.rst index 418a4aff37..8f2387996b 100644 --- a/doc/source/users_guide/trouble-shooting/trouble-shooting.rst +++ b/doc/source/users_guide/trouble-shooting/trouble-shooting.rst @@ -2,7 +2,7 @@ .. _trouble-shooting: -************* +*************** Troubleshooting *************** From 6fca8291a2a087a75be63b9c16134528b8d4f73f Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 19 Sep 2024 20:13:13 -0600 Subject: [PATCH 029/158] More formatting fixes. --- ...w-Files-to-the-build-namelist-Database.rst | 2 +- .../Adding-or-Changing-Default-Filenames.rst | 20 ++++++----- .../customizing-the-clm-configuration.rst | 35 +++++++++---------- .../trouble-shooting/trouble-shooting.rst | 30 ++++++++++------ 4 files changed, 49 insertions(+), 38 deletions(-) diff --git a/doc/source/users_guide/adding-new-resolutions/Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst b/doc/source/users_guide/adding-new-resolutions/Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst index fc7b2c0ee3..753ea896ee 100644 --- a/doc/source/users_guide/adding-new-resolutions/Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst +++ b/doc/source/users_guide/adding-new-resolutions/Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst @@ -6,7 +6,7 @@ Adding New Resolutions ======================== -In the last chapter we gave the details on how to create new files for input into CLM. These files could be either global resolutions, regional-grids or even a single grid point. If you want to easily have these files available for continued use in your development you will then want to include them in the build-namelist database so that build-namelist can easily find them for you. You can deal with them, just by putting the settings in the ``user_nl_clm namelist`` file, or by using ``CLM_USRDAT_NAME``. Another way to deal with them is to enter them into the database for build-namelist, so that build-namelist can find them for you. This keeps one central database for all your files, rather than having multiple locations to keep track of files. If you have a LOT of files to keep track of it also might be easier than keeping track by hand, especially if you have to periodically update your files. If you just have a few quick experiments to try, for a short time period you might be best off using the other methods mentioned above. +In the last chapter we gave the details on how to create new files for input into CLM. These files could be either global resolutions, regional-grids or even a single grid point. If you want to easily have these files available for continued use in your development you will then want to include them in the build-namelist database so that build-namelist can easily find them for you. You can deal with them, just by putting the settings in the ``user_nl_clm`` namelist file, or by using ``CLM_USRDAT_NAME``. Another way to deal with them is to enter them into the database for build-namelist, so that build-namelist can find them for you. This keeps one central database for all your files, rather than having multiple locations to keep track of files. If you have a LOT of files to keep track of it also might be easier than keeping track by hand, especially if you have to periodically update your files. If you just have a few quick experiments to try, for a short time period you might be best off using the other methods mentioned above. There are two parts to adding files to the build-namelist database. The first part is adding new resolution names which is done in the ``$CTSMROOT/bld/namelist_files/namelist_definition_clm4_5.xml`` file. You can then use the new resolution by using ``CLM_USRDAT_NAME``. If you also want to be able to give the resolution into ``create_newcase`` -- you'll need to add the grid to the ``$CIMEROOT/config/cesm/config_grid.xml`` file. diff --git a/doc/source/users_guide/adding-new-resolutions/Adding-or-Changing-Default-Filenames.rst b/doc/source/users_guide/adding-new-resolutions/Adding-or-Changing-Default-Filenames.rst index a2e7fcfc4e..22af143e72 100644 --- a/doc/source/users_guide/adding-new-resolutions/Adding-or-Changing-Default-Filenames.rst +++ b/doc/source/users_guide/adding-new-resolutions/Adding-or-Changing-Default-Filenames.rst @@ -6,17 +6,18 @@ Changing Default Filenames ============================ -To add or change the default filenames you edit the ``$CTSMROOT/bld/namelist_files/namelist_defaults_clm4_5.xml`` and either change an existing filename or add a new one. Most entries in the default namelist files, include different attributes that describe the different properties that describe the differences in the datasets. Attributes include the: resolution, year to simulation, range of years to simulate for transient datafiles, the land-mask, the representative concentration pathway (rcp) for future scenarios, and the type of biogeochemistry (bgc) model used. For example the fsurdat for the 1.9x2.5 resolution is as follows: +To add or change the default filenames you edit the ``$CTSMROOT/bld/namelist_files/namelist_defaults_clm4_5.xml`` and either change an existing filename or add a new one. Most entries in the default namelist files, include different attributes that describe the different properties that describe the differences in the datasets. Attributes include the resolution, year to simulation, range of years to simulate for transient datafiles, the land-mask, the representative concentration pathway (RCP) for future scenarios, and the type of biogeochemistry (BGC) model used. For example the surface dataset (``fsurdat``) for the 1.9x2.5 resolution is as follows: -``` - -lnd/clm2/surfdata_map/surfdata_0.9x1.25_78pfts_CMIP6_simyr1850_c170824.nc - -``` +:: + + + lnd/clm2/surfdata_map/surfdata_0.9x1.25_78pfts_CMIP6_simyr1850_c170824.nc + -Other ``fsurdat`` files are distinguished from this one by their resolution (hgrid), simulation year (sim_year) and prognostic crop (use_crop) attributes. -To add or change the default filenames for CLM tools edit the ``$CTSMROOT/bld/namelist_files/namelist_defaults_|version|_tools.xml`` and either change an existing filename or add a new one. Editing this file is similar to the ``namelist_defaults_clm4_5.xml`` talked about above. +Other ``fsurdat`` files are distinguished from this one by their resolution (``hgrid``), simulation year (``sim_year``) and prognostic crop (``use_crop``) attributes. + +To add or change the default filenames for CLM tools, edit the ``$CTSMROOT/bld/namelist_files/namelist_defaults_|version|_tools.xml`` and either change an existing filename or add a new one. Editing this file is similar to the ``namelist_defaults_clm4_5.xml`` talked about above. ---------------------------- What are the required files? @@ -30,4 +31,5 @@ In the following table we list the different files used by CLM, they are listed Table 3-1. Required Files for Different Configurations and Simulation Types --------------------------------------------------------------------------- -Insert table 3-1 +.. todo:: + Insert table 3-1 diff --git a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst index 0987a32e8e..2bece02abd 100644 --- a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst +++ b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst @@ -256,34 +256,33 @@ CLM_BLDNML_OPTS (i.e. CLM_NML_USE_CASE env_run variable) 6. values from the namelist defaults file. -The ``$CTSMROOT/cime_config/buildnml`` script already sets the resolution and mask as well as the CLM ``configure`` file, and defines an input namelist and namelist input file, and the output namelist directory, and sets the start-type (from ``RUN_TYPE``), namelist options (from ``CLM_NAMELIST_OPTS``), co2_ppmv (from ``CCSM_CO2_PPMV``, co2_type (from ``CLM_CO2_TYPE``), lnd_frac (from ``LND_DOMAIN_PATH`` and ``LND_DOMAIN_FILE``), l_ncpl (from ``LND_NCPL``, glc_grid, glc_smb, glc_nec (from ``GLC_GRID``, ``GLC_SMB``, and ``GLC_NEC``), and "clm_usr_name" is set (to ``CLM_USRDAT_NAME >``when the grid is set to ``CLM_USRDAT_NAME``. Hence only the following different options can be set: +The ``$CTSMROOT/cime_config/buildnml`` script already sets the resolution and mask as well as the CLM ``configure`` file, and defines an input namelist and namelist input file, and the output namelist directory, and sets the: start-type (from ``RUN_TYPE``); namelist options (from ``CLM_NAMELIST_OPTS``); ``co2_ppmv`` (from ``CCSM_CO2_PPMV``); ``co2_type`` (from ``CLM_CO2_TYPE``); ``lnd_frac`` (from ``LND_DOMAIN_PATH`` and ``LND_DOMAIN_FILE``); ``l_ncpl`` (from ``LND_NCPL``); ``glc_grid``, ``glc_smb``, ``glc_nec`` (from ``GLC_GRID``, ``GLC_SMB``, and ``GLC_NEC``); and ``clm_usr_name`` (to ``CLM_USRDAT_NAME``). Hence only the following different options can be set: -1. --bgc_spinup +#. ``-bgc_spinup`` -#. -chk_res +#. ``-chk_res`` -#. -clm_demand +#. ``-clm_demand`` -#. -drydep +#. ``-drydep`` -#. -fire_emis +#. ``-fire_emis`` -#. -ignore_ic_date +#. ``-ignore_ic_date`` -#. -ignore_ic_year +#. ``-ignore_ic_year`` -#. -irrig +#. ``-irrig`` -#. -no-megan +#. ``-no-megan`` -#. -note +#. ``-note`` -#. -rcp +#. ``-rcp`` -#. -sim_year +#. ``-sim_year`` -#. -verbose +#. ``-verbose`` ``-bgc_spinup`` is an option only available for |version| for any configuration when CN is turned on (so either CLMCN or CLMBGC). It can be set to "on" or "off". If "on" the model will go into Accelerated Decomposition mode, while for "off" (the default) it will have standard decomposition rates. If you are starting up from initial condition files the model will check what mode the initial condition file is in and do the appropriate action on the first time-step to change the Carbon pools to the appropriate spinup setting. See :ref:`spinning-up-clm-bgc` for an example using this option. @@ -308,9 +307,9 @@ To see a list of valid variables that you could set do this: ``-ignore_ic_year`` ignores the Initial Conditions (IC) year for finding initial condition files to startup from. The date is used, but the year is ignored. Without this option or the ``-ignore_ic_date`` option below, the date and year of the file comes into play. -When ``-irrig on`` is used ``build-namelist`` will try to find surface datasets that have the irrigation model enabled (when running with Sattellitte Phenology). When running with the prognostic crop model on, ``-irrig on`` will turn irrigate crops on, while ``-irrig off`` will manage all crop areas as rain-fed without irrigation. +When ``-irrig on`` is used ``build-namelist`` will try to find surface datasets that have the irrigation model enabled (when running with Sattellitte Phenology). When running with the prognostic crop model on, ``-irrig on`` will turn crop irrigation on, while ``-irrig off`` will manage all crop areas as rain-fed without irrigation. -``no-megan`` means do NOT add a MEGAN model Biogenic Volatile Organic Compounds (BVOC) testing namelist to the driver. This namelist is created by default, so normally this WILL be done. This is a driver namelist, so unless ``no-megan`` is specified the CLM ``build-namelist`` will create the ``drv_flds_in`` file that the driver will copy over and use (if you are running with CAM and CAM produces this file as well, it's file will have precedence). +``no-megan`` means do NOT add a MEGAN model Biogenic Volatile Organic Compounds (BVOC) testing namelist to the driver. This namelist is created by default, so normally this WILL be done. This is a driver namelist, so unless ``no-megan`` is specified the CLM ``build-namelist`` will create the ``drv_flds_in`` file that the driver will copy over and use. (If you are running with CAM and CAM produces this file as well, its file will have precedence). ``-note`` adds a note to the bottom of the namelist file, that gives the details of how ``build-namelist`` was called, giving the specific command-line options given to it. @@ -463,7 +462,7 @@ The first option is to setup a hybrid simulation and give a ``RUN_REFCASE`` and ``./xmlchange RUN_TYPE=hybrid,RUN_REFCASE=b.e20.B1850.f09_g17.pi_control.all.297,RUN_REFDATE=0130-01-01,GET_REFCASE=TRUE`` -Setting the ``GET_REFCASE`` option to ``TRUE means`` it will copy the files from the RUN_REFDIR usually under: ``$DIN_LOC_ROOT/cesm2_init/$RUN_REFCASE/$RUN_REFDATE`` directory. Note, that the ``RUN_REFCASE`` and ``RUN_REFDATE`` variables are expanded to get the directory name above. If you do NOT set ``GET_REFCASE`` to ``TRUE`` then you will need to have placed the file in your run directory yourself. In either case, the file is expected to be named: ``$RUN_REFCASE.clm2.r.$RUN_REFDATE-00000.nc`` with the variables expanded of course. +Setting the ``GET_REFCASE`` option to ``TRUE`` means it will copy the files from the RUN_REFDIR usually under: ``$DIN_LOC_ROOT/cesm2_init/$RUN_REFCASE/$RUN_REFDATE`` directory. Note, that the ``RUN_REFCASE`` and ``RUN_REFDATE`` variables are expanded to get the directory name above. If you do NOT set ``GET_REFCASE`` to ``TRUE`` then you will need to have placed the file in your run directory yourself. In either case, the file is expected to be named: ``$RUN_REFCASE.clm2.r.$RUN_REFDATE-00000.nc`` with the variables expanded of course. .. _doing-a-branch-sim-for-init-conds: diff --git a/doc/source/users_guide/trouble-shooting/trouble-shooting.rst b/doc/source/users_guide/trouble-shooting/trouble-shooting.rst index 8f2387996b..a971b7f2cb 100644 --- a/doc/source/users_guide/trouble-shooting/trouble-shooting.rst +++ b/doc/source/users_guide/trouble-shooting/trouble-shooting.rst @@ -71,20 +71,26 @@ So here we know that it is either leaf nitrogen (leafn) or leaf carbon (leafc) t At this point it is useful as a next step to identify the particular patch index and perhaps the pft type that is triggering the error. In this case, the endrun call is already written to provide this information: the patch index and pft type causing the error, along with some other information, are printed in the lines beginning with ``iam``. The ``iam`` value gives the CTSM processor number (this can be obtained in the code via the ``iam`` variable defined in ``spmdMod``). The local patch index is the value of ``p`` in the current patch loop; "local" implies that it refers to this processor's indexing. However, this same value of ``p`` may appear on other processors, since the local indexing on each processor starts with 1. So, to get the unique patch causing the problem, you either need to use the processor's ``iam`` index (there is only one patch with local index 482 on processor 362), or use the global indices printed below the local index. The "global" term here refers to the global index space across all processors (there is only one patch with a global index of 163723 across all processors). See below for how to use the ``get_global_index`` function to translate from local to global indices. -If you are writing your own ``endrun`` call, you can get this additional information by specifying the ``subgrid_index`` and ``subgrid_level`` arguments; for example:: +If you are writing your own ``endrun`` call, you can get this additional information by specifying the ``subgrid_index`` and ``subgrid_level`` arguments; for example: +:: + call endrun(subgrid_index=p, subgrid_level=subgrid_level_patch, msg=errMsg(sourcefile, __LINE__)) (The ``subgrid_level_patch`` constant, and similar constants for the other subgrid levels, are defined in ``decompMod``, so can be accessed via ``use decompMod, only : subgrid_level_patch``.) -You can get this same information without aborting the run via a call to ``write_point_context``, which is also defined in the ``abortutils`` module; e.g.:: +You can get this same information without aborting the run via a call to ``write_point_context``, which is also defined in the ``abortutils`` module; e.g.: - if (abs(carbon_patch(p)) < ccrit) then - call write_point_context(subgrid_index=p, subgrid_level=subgrid_level_patch) - end if +:: + + if (abs(carbon_patch(p)) < ccrit) then + call write_point_context(subgrid_index=p, subgrid_level=subgrid_level_patch) + end if -Or, if all you want is the global index of ``p`` for the sake of writing extra diagnostic prints like the example below, then you can use the ``get_global_index`` function defined in ``decompMod``, like:: +Or, if all you want is the global index of ``p`` for the sake of writing extra diagnostic prints like the example below, then you can use the ``get_global_index`` function defined in ``decompMod``, like: +:: + if (abs(carbon_patch(p)) < ccrit) then write(iulog,*) 'carbon patch significantly negative at local, global p = ', & p, get_global_index(subgrid_index=p, subgrid_level=subgrid_level_patch) @@ -92,8 +98,10 @@ Or, if all you want is the global index of ``p`` for the sake of writing extra d In all of these cases, the output will appear in either the cesm or lnd log file. In the above example, we see that the local patch index is 482 on processor 362 and the global patch index is 163723. From there, one can use this patch index to write out variables that are used in updating leafc, for example, leafc is updated a number of times in CNCStateUpdate1Mod.F90. -There are two equivalent methods to write a conditional statement to provide more output for the problem patch within a loop over all patches. The first method is to translate the local index to a global index:: +There are two equivalent methods to write a conditional statement to provide more output for the problem patch within a loop over all patches. The first method is to translate the local index to a global index: +:: + use decompMod, only : get_global_index, subgrid_level_patch ... if (get_global_index(p, subgrid_level_patch) == 163723) then @@ -101,8 +109,10 @@ There are two equivalent methods to write a conditional statement to provide mor write(iulog,*)'CNCStateUpdate1Mod +leafc_xfer_to_leafc: ',cf_veg%leafc_xfer_to_leafc_patch(p)*dt end if -The second method is to use the local index along with the processor number:: +The second method is to use the local index along with the processor number: +:: + use spmdMod, only : iam ... if (p == 482 .and. iam == 362) then @@ -127,7 +137,7 @@ It is common, when debugging, to want to print the values of various variables f 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 @@ -136,7 +146,7 @@ The example function in ``point_of_interest.F90`` is ``poi_c``. It finds columns end if end do -You will also need a ``use`` statement in the module from which you are calling poi_c +You will also need a ``use`` statement in the module from which you are calling ``poi_c`` :: use point_of_interest, only : poi_c From 24354eba65d652e9c67f6f93328a49507a8aeb1d Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 19 Sep 2024 20:43:30 -0600 Subject: [PATCH 030/158] Replace some :: with :. --- doc/source/lilac/specific-atm-models/wrf-nesting.rst | 2 +- .../Spinning-up-the-biogeochemistry-BGC-spinup.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/lilac/specific-atm-models/wrf-nesting.rst b/doc/source/lilac/specific-atm-models/wrf-nesting.rst index 347a927a59..2e8b88efd0 100644 --- a/doc/source/lilac/specific-atm-models/wrf-nesting.rst +++ b/doc/source/lilac/specific-atm-models/wrf-nesting.rst @@ -79,7 +79,7 @@ If the geogrid step finishes successfully, you should see the following message !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 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:: +have a column for each domain with `max_dom=2`. For example: &share wrf_core = 'ARW', diff --git a/doc/source/users_guide/running-special-cases/Spinning-up-the-biogeochemistry-BGC-spinup.rst b/doc/source/users_guide/running-special-cases/Spinning-up-the-biogeochemistry-BGC-spinup.rst index 089603db09..6b39c2b380 100644 --- a/doc/source/users_guide/running-special-cases/Spinning-up-the-biogeochemistry-BGC-spinup.rst +++ b/doc/source/users_guide/running-special-cases/Spinning-up-the-biogeochemistry-BGC-spinup.rst @@ -43,7 +43,7 @@ If you use the default initial file and you signficantly change model behavior o **1. |version| accelerated-decomposition (AD) spinup** For the first step of running 200+ years in ``-bgc_spinup on`` mode, you will setup a case, and then edit the values in env_build.xml and env_run.xml so that the right configuration is turned on and the simulation is setup to run for the required length of simulation time. So do the following: -Example:: AD_SPINUP Simulation for |version|-BGC +Example: AD_SPINUP Simulation for |version|-BGC -------------------------------------------------------- :: From e368dd4b021aac7325d93006be0307ed4beeb893 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 19 Sep 2024 20:49:54 -0600 Subject: [PATCH 031/158] Formatting fixes in wrf-nesting.rst. --- .../lilac/specific-atm-models/wrf-nesting.rst | 86 +++++++------------ 1 file changed, 29 insertions(+), 57 deletions(-) diff --git a/doc/source/lilac/specific-atm-models/wrf-nesting.rst b/doc/source/lilac/specific-atm-models/wrf-nesting.rst index 2e8b88efd0..81428495f0 100644 --- a/doc/source/lilac/specific-atm-models/wrf-nesting.rst +++ b/doc/source/lilac/specific-atm-models/wrf-nesting.rst @@ -6,12 +6,9 @@ Using CTSM with WRF (Nested Model Runs) ======================================== -This section includes instructions on how to run WRF coupled with CTSM for a -nested domain. +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 +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 @@ -37,9 +34,7 @@ There are currently two types of nesting available within WRF: 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. +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. @@ -61,16 +56,14 @@ 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`. +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:: +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. +This step creates two files, ``geo_em.d01.nc`` and ``geo_em.d02.nc``, which include the domain definition for each domain. If the geogrid step finishes successfully, you should see the following message in the log file:: @@ -78,9 +71,10 @@ If the geogrid step finishes successfully, you should see the following message ! 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: +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, @@ -102,9 +96,7 @@ 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. +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. @@ -112,8 +104,7 @@ 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. +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:: @@ -129,21 +120,17 @@ At this point, you should see ungrib output (intermediate files) in your WPS dir 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``:: +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:: +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:: +Running metgrid for two domains will create files like below:: met_em.d01.* met_em.d02.* @@ -151,25 +138,19 @@ below:: Nested Simulations : real.exe ------------------------------ -In this step, run ``real.exe`` to generate initial and boundary conditions for -both domains. +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. +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:: +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:: +Run real.exe (if compiled parallel submit a batch job) to generate initial and boundary condition files for both domain. Make sure the following three files have been created in your directory:: wrfinput_d01 wrfinput_d02 @@ -179,6 +160,8 @@ The boundary condition file is only created for the outer domain. Check the last line of the real log file for the following message: +.. todo:: What message? + Rename wrfinput_d02 ------------------- Next, rename the ``wrfinput_d02`` file to ``wrfndi_d02``:: @@ -187,8 +170,7 @@ Next, rename the ``wrfinput_d02`` file to ``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). +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``:: @@ -198,20 +180,15 @@ 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. +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. +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. +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. +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:: @@ -220,8 +197,7 @@ have already created these files for the coarser domain. 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: +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 @@ -231,13 +207,9 @@ are defined within these three files: 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. +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. +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 From 3cf93a9c0388f33fe774a7c1e6da42317295d662 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 19 Sep 2024 15:00:08 -0600 Subject: [PATCH 032/158] Add --no-center-coords option. --- python/ctsm/mesh_plotter.py | 9 ++++++++- python/ctsm/site_and_regional/mesh_plot_type.py | 15 +++++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/python/ctsm/mesh_plotter.py b/python/ctsm/mesh_plotter.py index 3ce018e7a7..97ae0f3cfb 100644 --- a/python/ctsm/mesh_plotter.py +++ b/python/ctsm/mesh_plotter.py @@ -68,6 +68,13 @@ def get_parser(): required=False, ) + parser.add_argument( + "--no-center-coords", + help="Do not include red Xs at center of grid cells.", + action="store_true", + required=False, + ) + default_dpi = 300 parser.add_argument( "--dpi", @@ -163,7 +170,7 @@ def main(): if os.path.exists(plot_global) and not args.overwrite: raise FileExistsError(file_exists_msg + plot_global) - this_mesh.make_mesh_plot(plot_regional, plot_global, args.dpi) + this_mesh.make_mesh_plot(plot_regional, plot_global, args) if __name__ == "__main__": diff --git a/python/ctsm/site_and_regional/mesh_plot_type.py b/python/ctsm/site_and_regional/mesh_plot_type.py index 8ba13ffa53..08fd1c061c 100644 --- a/python/ctsm/site_and_regional/mesh_plot_type.py +++ b/python/ctsm/site_and_regional/mesh_plot_type.py @@ -24,7 +24,7 @@ class MeshPlotType(MeshType): Extend mesh type with some advanced plotting capability """ - def make_mesh_plot(self, plot_regional, plot_global, dpi): + def make_mesh_plot(self, plot_regional, plot_global, args): """ Create plots for the ESMF mesh file @@ -36,10 +36,10 @@ def make_mesh_plot(self, plot_regional, plot_global, dpi): The path to write the ESMF meshfile global plot """ - self.mesh_plot(plot_regional, regional=True, dpi=dpi) - self.mesh_plot(plot_global, regional=False, dpi=dpi) + self.mesh_plot(plot_regional, args, regional=True) + self.mesh_plot(plot_global, args, regional=False) - def mesh_plot(self, plot_file, regional, dpi): + def mesh_plot(self, plot_file, args, regional): """Make a plot of a mesh file in either a regional or global grid""" # -- regional settings if regional: @@ -59,6 +59,8 @@ def mesh_plot(self, plot_file, regional, dpi): line_width = 0.5 marker = "o" marker_size = 0.1 + if args.no_center_coords: + marker_size = 0 ax.add_feature(cfeature.COASTLINE, edgecolor="black") ax.add_feature(cfeature.BORDERS, edgecolor="black") @@ -129,8 +131,9 @@ def mesh_plot(self, plot_file, regional, dpi): *[(k, mpatches.Rectangle((0, 0), 1, 1, facecolor=v)) for k, v in lc_colors.items()] ) - ax.legend(handles, labels) + if not args.no_center_coords: + ax.legend(handles, labels) - plt.savefig(plot_file, bbox_inches="tight", dpi=dpi) + plt.savefig(plot_file, bbox_inches="tight", dpi=args.dpi) logger.info("Successfully created %s plots for ESMF Mesh file : %s", plot_type, plot_file) From 06fdc64027684acb087b3553dd8005a8403446d4 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 19 Sep 2024 21:47:21 -0600 Subject: [PATCH 033/158] Properly handle --outdir. --- python/ctsm/mesh_plotter.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/ctsm/mesh_plotter.py b/python/ctsm/mesh_plotter.py index 97ae0f3cfb..0a2af11856 100644 --- a/python/ctsm/mesh_plotter.py +++ b/python/ctsm/mesh_plotter.py @@ -112,9 +112,10 @@ def process_and_check_args(args): today = datetime.today() today_string = today.strftime("%y%m%d") + input_filename = os.path.basename(args.input) args.output = os.path.join( args.out_dir, - os.path.splitext(args.input)[0] + "_c" + today_string, + os.path.splitext(input_filename)[0] + "_c" + today_string, ) if not os.path.isfile(args.input): From 0de1673fa67e853bd0dfdc9e61a263e01addbb87 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 19 Sep 2024 21:48:46 -0600 Subject: [PATCH 034/158] Add tests to test_advanced_sys_mesh_plotter.py. --- .../test/test_advanced_sys_mesh_plotter.py | 29 +++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/python/ctsm/test/test_advanced_sys_mesh_plotter.py b/python/ctsm/test/test_advanced_sys_mesh_plotter.py index 090f7806bf..39f3728479 100755 --- a/python/ctsm/test/test_advanced_sys_mesh_plotter.py +++ b/python/ctsm/test/test_advanced_sys_mesh_plotter.py @@ -34,6 +34,13 @@ def setUp(self): ) self._tempdir = tempfile.mkdtemp() self.mesh_out = self._tempdir + "/mesh_out" + self.test_basic_argv = [ + "mesh_plotter", + "--input", + self._infile, + "--output", + self.mesh_out, + ] def tearDown(self): """ @@ -43,15 +50,31 @@ def tearDown(self): def test_basic(self): """Do a simple basic test""" + sys.argv = self.test_basic_argv + main() + plotfiles = glob.glob(self._tempdir + "/*.png") + if not plotfiles: + self.fail("plot files were NOT created as they should have") + + def test_need_overwrite(self): + """Ensure failure if output file exists but --overwrite not given""" + sys.argv = self.test_basic_argv + main() + with self.assertRaisesRegex(FileExistsError, "File already exists but --overwrite not given"): + main() + + def test_outdir(self): + """Test that --outdir option works""" + outdir = os.path.join(self._tempdir, "abc123") sys.argv = [ "mesh_plotter", "--input", self._infile, - "--output", - self.mesh_out, + "--outdir", + outdir, ] main() - plotfiles = glob.glob(self._tempdir + "/*.png") + plotfiles = glob.glob(os.path.join(outdir, "*.png")) if not plotfiles: self.fail("plot files were NOT created as they should have") From f0c9f31453e00279996ffddf660763e17d2bb590 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 19 Sep 2024 21:50:41 -0600 Subject: [PATCH 035/158] Use os.path.join in test_advanced_sys_mesh_plotter.py. --- python/ctsm/test/test_advanced_sys_mesh_plotter.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/python/ctsm/test/test_advanced_sys_mesh_plotter.py b/python/ctsm/test/test_advanced_sys_mesh_plotter.py index 39f3728479..c4f3f078a8 100755 --- a/python/ctsm/test/test_advanced_sys_mesh_plotter.py +++ b/python/ctsm/test/test_advanced_sys_mesh_plotter.py @@ -26,14 +26,20 @@ class SysTestMeshMaker(unittest.TestCase): def setUp(self): """Setup for all tests""" - testinputs_path = os.path.join(path_to_ctsm_root(), "python/ctsm/test/testinputs") + testinputs_path = os.path.join( + path_to_ctsm_root(), + "python", + "ctsm", + "test", + "testinputs", + ) self._testinputs_path = testinputs_path self._infile = os.path.join( testinputs_path, "ESMF_mesh_5x5pt_amazon_from_domain_c230308.nc", ) self._tempdir = tempfile.mkdtemp() - self.mesh_out = self._tempdir + "/mesh_out" + self.mesh_out = os.path.join(self._tempdir, "mesh_out") self.test_basic_argv = [ "mesh_plotter", "--input", @@ -52,7 +58,7 @@ def test_basic(self): """Do a simple basic test""" sys.argv = self.test_basic_argv main() - plotfiles = glob.glob(self._tempdir + "/*.png") + plotfiles = glob.glob(os.path.join(self._tempdir, "*.png")) if not plotfiles: self.fail("plot files were NOT created as they should have") From badbc50369c4ff363ab2e06c31aeacb82181343d Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 19 Sep 2024 21:55:36 -0600 Subject: [PATCH 036/158] Add dpi test to test_advanced_sys_mesh_plotter.py. --- python/ctsm/test/test_advanced_sys_mesh_plotter.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/python/ctsm/test/test_advanced_sys_mesh_plotter.py b/python/ctsm/test/test_advanced_sys_mesh_plotter.py index c4f3f078a8..1c17a314ed 100755 --- a/python/ctsm/test/test_advanced_sys_mesh_plotter.py +++ b/python/ctsm/test/test_advanced_sys_mesh_plotter.py @@ -62,6 +62,17 @@ def test_basic(self): if not plotfiles: self.fail("plot files were NOT created as they should have") + def test_dpi(self): + """Test setting dpi""" + sys.argv = self.test_basic_argv + [ + "--dpi", + "198.7", + ] + main() + plotfiles = glob.glob(os.path.join(self._tempdir, "*.png")) + if not plotfiles: + self.fail("plot files were NOT created as they should have") + def test_need_overwrite(self): """Ensure failure if output file exists but --overwrite not given""" sys.argv = self.test_basic_argv From 6d3bf8ca468f5b6eb55c2f662cec377cedcf6024 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 19 Sep 2024 21:56:27 -0600 Subject: [PATCH 037/158] Format with black. --- python/ctsm/test/test_advanced_sys_mesh_plotter.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/ctsm/test/test_advanced_sys_mesh_plotter.py b/python/ctsm/test/test_advanced_sys_mesh_plotter.py index 1c17a314ed..4a7c63ecf6 100755 --- a/python/ctsm/test/test_advanced_sys_mesh_plotter.py +++ b/python/ctsm/test/test_advanced_sys_mesh_plotter.py @@ -77,7 +77,9 @@ def test_need_overwrite(self): """Ensure failure if output file exists but --overwrite not given""" sys.argv = self.test_basic_argv main() - with self.assertRaisesRegex(FileExistsError, "File already exists but --overwrite not given"): + with self.assertRaisesRegex( + FileExistsError, "File already exists but --overwrite not given" + ): main() def test_outdir(self): From e7257591db5cc530e55b62bbe40c5793d3111b8b Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 19 Sep 2024 21:57:08 -0600 Subject: [PATCH 038/158] Add previous commit to .git-blame-ignore-revs. --- .git-blame-ignore-revs | 1 + 1 file changed, 1 insertion(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index b0bf2c5a0c..fca4a8315b 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -51,3 +51,4 @@ aa04d1f7d86cc2503b98b7e2b2d84dbfff6c316b 1a49e547ba3c48fa483f9ae81a8f05adcd6b888c 045d90f1d80f713eb3ae0ac58f6c2352937f1eb0 753fda3ff0147837231a73c9c728dd9ce47b5997 +f112ba0bbf96a61d5a4d354dc0dcbd8b0c68145c From 318a3129b3be3c3fcc6e883533d72b8ebf60b79b Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 24 Sep 2024 10:33:57 -0600 Subject: [PATCH 039/158] Update namelist_defaults_clm4_5.xml references. To namelist_definition_ctsm.xml --- ...esolutions-or-New-Files-to-the-build-namelist-Database.rst | 2 +- .../adding-new-resolutions/Adding-Resolution-Names.rst | 2 +- .../Adding-or-Changing-Default-Filenames.rst | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/source/users_guide/adding-new-resolutions/Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst b/doc/source/users_guide/adding-new-resolutions/Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst index 753ea896ee..b2cf742a2c 100644 --- a/doc/source/users_guide/adding-new-resolutions/Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst +++ b/doc/source/users_guide/adding-new-resolutions/Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst @@ -10,5 +10,5 @@ In the last chapter we gave the details on how to create new files for input int There are two parts to adding files to the build-namelist database. The first part is adding new resolution names which is done in the ``$CTSMROOT/bld/namelist_files/namelist_definition_clm4_5.xml`` file. You can then use the new resolution by using ``CLM_USRDAT_NAME``. If you also want to be able to give the resolution into ``create_newcase`` -- you'll need to add the grid to the ``$CIMEROOT/config/cesm/config_grid.xml`` file. -The second part is actually adding the new filenames which is done in the ``$CTSMROOT/bld/namelist_files/namelist_defaults_clm4_5.xml`` file (``$CTSMROOT/bld/namelist_files/namelist_defaults_clm4_5_tools.xml`` file for CLM tools). If you aren't adding any new resolutions, and you are just changing the files for existing resolutions, you don't need to edit the namelist_definition file. +The second part is actually adding the new filenames which is done in the ``$CTSMROOT/bld/namelist_files/namelist_definition_ctsm.xml`` file (``$CTSMROOT/bld/namelist_files/namelist_defaults_clm4_5_tools.xml`` file for CLM tools). If you aren't adding any new resolutions, and you are just changing the files for existing resolutions, you don't need to edit the namelist_definition file. diff --git a/doc/source/users_guide/adding-new-resolutions/Adding-Resolution-Names.rst b/doc/source/users_guide/adding-new-resolutions/Adding-Resolution-Names.rst index d89cc13930..ea10a3c409 100644 --- a/doc/source/users_guide/adding-new-resolutions/Adding-Resolution-Names.rst +++ b/doc/source/users_guide/adding-new-resolutions/Adding-Resolution-Names.rst @@ -6,7 +6,7 @@ Adding Resolution Names ========================= -If you are adding files for new resolutions which aren't covered in the namelist_definition file -- you'll need to add them in. The list of valid resolutions is in the ``id="res"`` entry in the ``$CTSMROOT/bld/namelist_files/namelist_definition_clm4_5.xml`` file. You need to choose a name for your new resolution and simply add it to the comma delimited list of valid_values for the ``id="res"`` entry. The convention for global Gaussian grids is number_of_latitudes x number_of_longitudes. The convention for global finite volume grids is latitude_grid_size x longitude_grid_size where latitude and longitude is measured in degrees. The convention for unstructured HOMME grids is nenp4, where corresponds to the resolution. The higher is the higher the resolution. So for example, ne60np4 is roughly half-degree while ne240np4 is roughly a eighth degree. For regional or single-point datasets the names have a grid size number_of_latitudes x number_of_longitudes followed by an underscore and then a descriptive name such as a City name followed by an abbreviation for the Country in caps. The only hard requirement is that names be unique for different grid files. Here's what the entry for resolutions looks like in the file: +If you are adding files for new resolutions which aren't covered in the namelist_definition file -- you'll need to add them in. The list of valid resolutions is in the ``id="res"`` entry in the ``$CTSMROOT/bld/namelist_files/namelist_definition_ctsm.xml`` file. You need to choose a name for your new resolution and simply add it to the comma delimited list of valid_values for the ``id="res"`` entry. The convention for global Gaussian grids is number_of_latitudes x number_of_longitudes. The convention for global finite volume grids is latitude_grid_size x longitude_grid_size where latitude and longitude is measured in degrees. The convention for unstructured HOMME grids is nenp4, where corresponds to the resolution. The higher is the higher the resolution. So for example, ne60np4 is roughly half-degree while ne240np4 is roughly a eighth degree. For regional or single-point datasets the names have a grid size number_of_latitudes x number_of_longitudes followed by an underscore and then a descriptive name such as a City name followed by an abbreviation for the Country in caps. The only hard requirement is that names be unique for different grid files. Here's what the entry for resolutions looks like in the file: :: Date: Tue, 24 Sep 2024 10:36:17 -0600 Subject: [PATCH 040/158] namelist_defaults_|version|_tools.xml files no longer exist. --- ...lutions-or-New-Files-to-the-build-namelist-Database.rst | 2 +- .../Adding-or-Changing-Default-Filenames.rst | 2 -- .../users_guide/using-clm-tools/what-are-the-clm-tools.rst | 7 +------ 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/doc/source/users_guide/adding-new-resolutions/Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst b/doc/source/users_guide/adding-new-resolutions/Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst index b2cf742a2c..9309f2efae 100644 --- a/doc/source/users_guide/adding-new-resolutions/Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst +++ b/doc/source/users_guide/adding-new-resolutions/Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst @@ -10,5 +10,5 @@ In the last chapter we gave the details on how to create new files for input int There are two parts to adding files to the build-namelist database. The first part is adding new resolution names which is done in the ``$CTSMROOT/bld/namelist_files/namelist_definition_clm4_5.xml`` file. You can then use the new resolution by using ``CLM_USRDAT_NAME``. If you also want to be able to give the resolution into ``create_newcase`` -- you'll need to add the grid to the ``$CIMEROOT/config/cesm/config_grid.xml`` file. -The second part is actually adding the new filenames which is done in the ``$CTSMROOT/bld/namelist_files/namelist_definition_ctsm.xml`` file (``$CTSMROOT/bld/namelist_files/namelist_defaults_clm4_5_tools.xml`` file for CLM tools). If you aren't adding any new resolutions, and you are just changing the files for existing resolutions, you don't need to edit the namelist_definition file. +The second part is actually adding the new filenames which is done in the ``$CTSMROOT/bld/namelist_files/namelist_definition_ctsm.xml`` file. If you aren't adding any new resolutions, and you are just changing the files for existing resolutions, you don't need to edit the namelist_definition file. diff --git a/doc/source/users_guide/adding-new-resolutions/Adding-or-Changing-Default-Filenames.rst b/doc/source/users_guide/adding-new-resolutions/Adding-or-Changing-Default-Filenames.rst index 4b9a92a542..a39ffa9426 100644 --- a/doc/source/users_guide/adding-new-resolutions/Adding-or-Changing-Default-Filenames.rst +++ b/doc/source/users_guide/adding-new-resolutions/Adding-or-Changing-Default-Filenames.rst @@ -17,8 +17,6 @@ To add or change the default filenames you edit the ``$CTSMROOT/bld/namelist_fil Other ``fsurdat`` files are distinguished from this one by their resolution (``hgrid``), simulation year (``sim_year``) and prognostic crop (``use_crop``) attributes. -To add or change the default filenames for CLM tools, edit the ``$CTSMROOT/bld/namelist_files/namelist_defaults_|version|_tools.xml`` and either change an existing filename or add a new one. Editing this file is similar to the ``namelist_definition_ctsm.xml`` talked about above. - ---------------------------- What are the required files? ---------------------------- diff --git a/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst b/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst index c997f403d2..7a1325884c 100644 --- a/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst +++ b/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst @@ -39,12 +39,7 @@ Running FORTRAN tools with namelists ./program < namelist -There is a sample namelist called ``$CTSMROOT/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml`` that shows you what the namelist should look like. ``mksurfdata_esmf`` also has a script that creates the namelist and runs the program for you. Namelists that you create should be similar to the example namelist. The namelist values are also documented along with the other namelists in the: -:: - - $CTSMROOT/bld/namelist_files/namelist_definition.xml`` file - and default values in the: - $CTSMROOT/bld/namelist_files/namelist_defaults_clm_tools.xml`` file. +There is a sample namelist called ``$CTSMROOT/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml`` that shows you what the namelist should look like. ``mksurfdata_esmf`` also has a script that creates the namelist and runs the program for you. Namelists that you create should be similar to the example namelist. The namelist values are also documented along with the other namelists in the ``$CTSMROOT/bld/namelist_files/namelist_definition.xml`` file, ----------------------------------------------- Running FORTRAN tools with command line options From 5d2ebe14af08d4aee3e56383a32215b4027a8213 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 24 Sep 2024 10:39:16 -0600 Subject: [PATCH 041/158] Fix namelist XML refs in what-are-the-clm-tools.rst. --- .../users_guide/using-clm-tools/what-are-the-clm-tools.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst b/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst index 7a1325884c..fa80ffa61e 100644 --- a/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst +++ b/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst @@ -39,7 +39,7 @@ Running FORTRAN tools with namelists ./program < namelist -There is a sample namelist called ``$CTSMROOT/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml`` that shows you what the namelist should look like. ``mksurfdata_esmf`` also has a script that creates the namelist and runs the program for you. Namelists that you create should be similar to the example namelist. The namelist values are also documented along with the other namelists in the ``$CTSMROOT/bld/namelist_files/namelist_definition.xml`` file, +There is a sample namelist called ``$CTSMROOT/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml`` that shows you what the namelist should look like. ``mksurfdata_esmf`` also has a script that creates the namelist and runs the program for you. Namelists that you create should be similar to the example namelist. The namelist values are also documented along with the other namelists in the ``$CTSMROOT/bld/namelist_files/namelist_definition_ctsm.xml`` file, with default values in the ``$CTSMROOT/bld/namelist_files/namelist_defaults_ctsm.xml`` file. ----------------------------------------------- Running FORTRAN tools with command line options From 9ed3cca9f3bb9aa58eb77f40b078414ed114436b Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 24 Sep 2024 10:47:09 -0600 Subject: [PATCH 042/158] Specify path to create_newcase. --- ...or-New-Files-to-the-build-namelist-Database.rst | 2 +- .../running-pts_mode-configurations.rst | 4 ++-- .../running-single-point-configurations.rst | 14 +++++++++----- ...ngle-point-and-regional-grid-configurations.rst | 2 +- ...with-transient-historical-CO2-concentration.rst | 2 +- .../Running-the-prognostic-crop-model.rst | 2 +- ...-as-atmospheric-forcing-to-spinup-the-model.rst | 2 +- .../Running-with-irrigation.rst | 2 +- ...-as-atmospheric-forcing-to-spinup-the-model.rst | 4 ++-- .../Spinning-up-the-biogeochemistry-BGC-spinup.rst | 4 ++-- doc/source/users_guide/testing/testing.rst | 5 ++++- 11 files changed, 25 insertions(+), 18 deletions(-) diff --git a/doc/source/users_guide/adding-new-resolutions/Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst b/doc/source/users_guide/adding-new-resolutions/Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst index 9309f2efae..6a12fa4b1d 100644 --- a/doc/source/users_guide/adding-new-resolutions/Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst +++ b/doc/source/users_guide/adding-new-resolutions/Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst @@ -8,7 +8,7 @@ In the last chapter we gave the details on how to create new files for input into CLM. These files could be either global resolutions, regional-grids or even a single grid point. If you want to easily have these files available for continued use in your development you will then want to include them in the build-namelist database so that build-namelist can easily find them for you. You can deal with them, just by putting the settings in the ``user_nl_clm`` namelist file, or by using ``CLM_USRDAT_NAME``. Another way to deal with them is to enter them into the database for build-namelist, so that build-namelist can find them for you. This keeps one central database for all your files, rather than having multiple locations to keep track of files. If you have a LOT of files to keep track of it also might be easier than keeping track by hand, especially if you have to periodically update your files. If you just have a few quick experiments to try, for a short time period you might be best off using the other methods mentioned above. -There are two parts to adding files to the build-namelist database. The first part is adding new resolution names which is done in the ``$CTSMROOT/bld/namelist_files/namelist_definition_clm4_5.xml`` file. You can then use the new resolution by using ``CLM_USRDAT_NAME``. If you also want to be able to give the resolution into ``create_newcase`` -- you'll need to add the grid to the ``$CIMEROOT/config/cesm/config_grid.xml`` file. +There are two parts to adding files to the build-namelist database. The first part is adding new resolution names which is done in the ``$CTSMROOT/bld/namelist_files/namelist_definition_clm4_5.xml`` file. You can then use the new resolution by using ``CLM_USRDAT_NAME``. If you also want to be able to give the resolution to ``$CTSMROOT/cime/scripts/create_newcase`` -- you'll need to add the grid to the ``$CIMEROOT/config/cesm/config_grid.xml`` file. The second part is actually adding the new filenames which is done in the ``$CTSMROOT/bld/namelist_files/namelist_definition_ctsm.xml`` file. If you aren't adding any new resolutions, and you are just changing the files for existing resolutions, you don't need to edit the namelist_definition file. diff --git a/doc/source/users_guide/running-single-points/running-pts_mode-configurations.rst b/doc/source/users_guide/running-single-points/running-pts_mode-configurations.rst index edad4c25ff..53cae1bdf4 100644 --- a/doc/source/users_guide/running-single-points/running-pts_mode-configurations.rst +++ b/doc/source/users_guide/running-single-points/running-pts_mode-configurations.rst @@ -8,10 +8,10 @@ Running a single point using global data - PTS_MODE ``PTS_MODE`` enables you to run the model using global datasets, but just picking a single point from those datasets and operating on it. It can be a very quick way to do fast simulations and get a quick turnaround. -To setup a ``PTS_MODE`` simulation you use the ``-pts_lat`` and ``-pts_lon`` arguments to ``create_newcase`` to give the latitude and longitude of the point you want to simulate for (the code will pick the point on the global grid nearest to the point you give. Here's an example to setup a simulation for the nearest point at 2-degree resolution to Boulder Colorado. +To setup a ``PTS_MODE`` simulation you use the ``-pts_lat`` and ``-pts_lon`` arguments to ``cime/scripts/create_newcase`` to give the latitude and longitude of the point you want to simulate for (the code will pick the point on the global grid nearest to the point you give. Here's an example to setup a simulation for the nearest point at 2-degree resolution to Boulder Colorado. :: - > cd scripts + > cd cime/scripts > ./create_newcase -case testPTS_MODE -res f19_g17_gl4 -compset I1850Clm50BgcCropCru -pts_lat 40.0 -pts_lon -105 > cd testPTS_MODE diff --git a/doc/source/users_guide/running-single-points/running-single-point-configurations.rst b/doc/source/users_guide/running-single-points/running-single-point-configurations.rst index 766eca63fd..b601040742 100644 --- a/doc/source/users_guide/running-single-points/running-single-point-configurations.rst +++ b/doc/source/users_guide/running-single-points/running-single-point-configurations.rst @@ -45,7 +45,7 @@ Example: Use global forcings at a site without its own special forcings This example uses the single-point site in Brazil. :: - > cd scripts + > cd cime/scripts > set SITE=1x1_brazil > ./create_newcase -case testSPDATASET -res $SITE -compset I2000Clm50SpGs > cd testSPDATASET @@ -59,7 +59,7 @@ The urban Mexico City test site has its own atmosphere forcing data (see Sect. : :: - > cd scripts + > cd cime/scripts # Set a variable to the site you want to use (as it's used several times below) > set SITE=1x1_mexicocityMEX > ./create_newcase -case testSPDATASET -res $SITE -compset I1PtClm50SpGs @@ -81,7 +81,7 @@ Example: Use site-specific atmospheric forcings In this example, we show how to use the atmospheric forcings specific to the Vancouver, Canada point. :: - > cd scripts + > cd cime/scripts # Set a variable to the site you want to use (as it's used several times below) > set SITE=1x1_vancouverCAN @@ -121,7 +121,7 @@ Example: Using CLM_USRDAT_NAME to run a simulation using user datasets for a spe ----------------------------------------------------------------------------------------------------------------------- :: - > cd scripts + > cd cime/scripts > ./create_newcase -case my_userdataset_test -res CLM_USRDAT -compset I2000Clm50BgcCruGs > cd my_userdataset_test/ > set GRIDNAME=13x12pt_f19_alaskaUSA @@ -176,6 +176,10 @@ The next step is to create a case that points to the files you created above. We Example: Setting up a case from the single-point surface dataset just created -------------------------------------------------------------------------------------------- + +.. todo:: + Change this to provide instructions for a CTSM checkout instead of a CESM one. + :: # First setup an environment variable that points to the top of the CESM directory. @@ -188,7 +192,7 @@ Example: Setting up a case from the single-point surface dataset just created # naming convention (leave off the creation date) > cp $CESMROOT/$CTSMROOT/tools/mksurfdata_esmf/surfdata_${GRIDNAME}_simyr1850_$CDATE.nc \ $MYCSMDATA/lnd/clm2/surfdata_map/surfdata_${GRIDNAME}_simyr1850.nc - > cd $CESMROOT/scripts + > cd $CESMROOT/cime/scripts > ./create_newcase -case my_usernldatasets_test -res CLM_USRDAT -compset I1850Clm50BgcCropCru \ -mach cheyenne_intel > cd my_usernldatasets_test diff --git a/doc/source/users_guide/running-single-points/single-point-and-regional-grid-configurations.rst b/doc/source/users_guide/running-single-points/single-point-and-regional-grid-configurations.rst index 5e20a303fb..61e1f25de8 100644 --- a/doc/source/users_guide/running-single-points/single-point-and-regional-grid-configurations.rst +++ b/doc/source/users_guide/running-single-points/single-point-and-regional-grid-configurations.rst @@ -24,7 +24,7 @@ There are two different ways to do this for normal-supported site Running for a *normal supported site* is a great solution, if one of the supported single-point/regional datasets, is your region of interest (see :ref:`running-single-point-datasets`). All the datasets are created for you, and you can easily select one and run, out of the box with it using a supported resolution from the top level of the CESM scripts. The problem is that there is a very limited set of supported datasets. You can also use this method for your own datasets, but you have to create the datasets, and add them to the XML database in scripts, CLM and to the DATM. This is worthwhile if you want to repeat many multiple cases for a given point or region. -In general :ref:`pts_mode` is the quick and dirty method that gets you started without having to create datasets -- but has limitations. It's good for an initial attempt at seeing results for a point of interest, but since you can NOT restart with it, it's usage is limited. It is the quickest method as you can create a case for it directly from ``create_newcase``. Although you can't restart, running a single point is very fast, and you can run for long simulation times even without restarts. +In general :ref:`pts_mode` is the quick and dirty method that gets you started without having to create datasets -- but has limitations. It's good for an initial attempt at seeing results for a point of interest, but since you can NOT restart with it, it's usage is limited. It is the quickest method as you can create a case for it directly from ``cime/scripts/create_newcase``. Although you can't restart, running a single point is very fast, and you can run for long simulation times even without restarts. Next, ``CLM_USRDAT_NAME`` is the best way to setup cases quickly where you have to create your own datasets (see :ref:`running-single-point-datasets`). With this method you don't have to change DATM or add files to the XML database -- but you have to follow a strict naming convention for files. However, once the files are named and in the proper location, you can easily setup new cases that use these datasets. This is good for treating all the required datasets as a "group" and for a particular model version. For advanced CLM developers who need to track dataset changes with different model versions you would be best off adding these datasets as supported datasets with the "normal supported datasets" method. diff --git a/doc/source/users_guide/running-special-cases/Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst b/doc/source/users_guide/running-special-cases/Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst index eedefd8744..60ef7658d0 100644 --- a/doc/source/users_guide/running-special-cases/Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst +++ b/doc/source/users_guide/running-special-cases/Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst @@ -22,7 +22,7 @@ Example: Transient Simulation with Historical CO2 -------------------------------------------------------------- :: - > cd scripts + > cd cime/scripts > ./create_newcase -case DATM_CO2_TSERIES -res f19_g17_gl4 -compset IHistClm50BgcCrop > cd DATM_CO2_TSERIES diff --git a/doc/source/users_guide/running-special-cases/Running-the-prognostic-crop-model.rst b/doc/source/users_guide/running-special-cases/Running-the-prognostic-crop-model.rst index cb66ef209f..56620b2fde 100644 --- a/doc/source/users_guide/running-special-cases/Running-the-prognostic-crop-model.rst +++ b/doc/source/users_guide/running-special-cases/Running-the-prognostic-crop-model.rst @@ -12,7 +12,7 @@ Example: Crop Simulation ------------------------------------ :: - > cd scripts + > cd cime/scripts > ./create_newcase -case CROP -res f19_g17_gl4 -compset I1850Clm50BgcCropCru > cd CROP diff --git a/doc/source/users_guide/running-special-cases/Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst b/doc/source/users_guide/running-special-cases/Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst index dbe01c497c..769755937d 100644 --- a/doc/source/users_guide/running-special-cases/Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst +++ b/doc/source/users_guide/running-special-cases/Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst @@ -14,7 +14,7 @@ Example: Simulation with MOAR Data on cheyenne ------------------------------------------------------------- :: - > cd scripts + > cd cime/scripts > ./create_newcase -case MOARforce1850 -res f19_g17_gl4 -compset I1850Clm50BgcSpinup > cd MOARforce1850 # The following sets the casename to point to for atm forcing (you could also use an editor) diff --git a/doc/source/users_guide/running-special-cases/Running-with-irrigation.rst b/doc/source/users_guide/running-special-cases/Running-with-irrigation.rst index 5702e6d49d..88bc9729ec 100644 --- a/doc/source/users_guide/running-special-cases/Running-with-irrigation.rst +++ b/doc/source/users_guide/running-special-cases/Running-with-irrigation.rst @@ -13,7 +13,7 @@ Example: Irrigation Simulation :: # Note here we do a CLMSP simulation as that is what has been validated - > cd scripts + > cd cime/scripts > ./create_newcase -case IRRIG -res f19_g17_gl4 -compset I1850Clm50BgcCrop > cd IRRIG diff --git a/doc/source/users_guide/running-special-cases/Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst b/doc/source/users_guide/running-special-cases/Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst index ff05836f6e..2a55cbed1e 100644 --- a/doc/source/users_guide/running-special-cases/Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst +++ b/doc/source/users_guide/running-special-cases/Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst @@ -14,7 +14,7 @@ Example: Fully Coupled Simulation to Create Data to Force Next Example Simulatio ---------------------------------------------------------------------------------------------- :: - > cd scripts + > cd cime/scripts > ./create_newcase -case myB1850 -res f09_g17_gl4 -compset B1850 > cd myB1850 > ./case.setup @@ -44,7 +44,7 @@ Example: Simulation Forced with Data from the Previous Simulation ------------------------------------------------------------------------------ :: - > cd scripts + > cd cime/scripts > ./create_newcase -case frcwmyB1850 -res f09_g17_gl4 -compset I1850Clm50BgcSpinup > cd frcWmyB1850 # The following sets the casename to point to for atm forcing (you could also use an editor) diff --git a/doc/source/users_guide/running-special-cases/Spinning-up-the-biogeochemistry-BGC-spinup.rst b/doc/source/users_guide/running-special-cases/Spinning-up-the-biogeochemistry-BGC-spinup.rst index 6b39c2b380..87049e6f1b 100644 --- a/doc/source/users_guide/running-special-cases/Spinning-up-the-biogeochemistry-BGC-spinup.rst +++ b/doc/source/users_guide/running-special-cases/Spinning-up-the-biogeochemistry-BGC-spinup.rst @@ -47,7 +47,7 @@ Example: AD_SPINUP Simulation for |version|-BGC -------------------------------------------------------- :: - > cd scripts + > cd cime/scripts > ./create_newcase -case BGC_spinup -res f19_g17_gl4 -compset I1850Clm50BgcCropCru > cd BGC_spinup # Change accelerated spinup mode @@ -75,7 +75,7 @@ Example: Final CLMBGC Spinup Simulation for |version|-BGC ------------------------------------------------------------------ :: - > cd scripts + > cd cime/scripts > ./create_newcase -case BGC_finalspinup -res f19_g17_gl4 -compset I1850Clm50BgcCropCru > cd BGC_finalspinup # Now, Copy the last CLM restart file from the earlier case into your run directory diff --git a/doc/source/users_guide/testing/testing.rst b/doc/source/users_guide/testing/testing.rst index b065cb1392..a9b0be0462 100644 --- a/doc/source/users_guide/testing/testing.rst +++ b/doc/source/users_guide/testing/testing.rst @@ -6,7 +6,10 @@ Testing ******* -Technically, you could use the customization we gave in :ref:`customizing_section` to test various configuration and namelist options for CLM. Sometimes, it's also useful to have automated tests though to test that restarts give exactly the same results as without a restart. It's also useful to have automated tests to run over a wide variety of configurations, resolutions, and namelist options. To do that we have several different types of scripts set up to make running comprehensive testing of CLM easy. There are two types of testing scripts for CLM. The first are the CESM test scripts, which utilize the ``create_newcase`` scripts that we shown how to use in this User's Guide. The second are a set of stand-alone scripts that use the CLM ``configure`` and ``build-namelist`` scripts to build and test the model as well as testing the CLM tools as well. Below we will go into further details of how to use both methods. +Technically, you could use the customization we gave in :ref:`customizing_section` to test various configuration and namelist options for CLM. Sometimes, it's also useful to have automated tests though to test that restarts give exactly the same results as without a restart. It's also useful to have automated tests to run over a wide variety of configurations, resolutions, and namelist options. To do that we have several different types of scripts set up to make running comprehensive testing of CLM easy. There are two types of testing scripts for CLM. The first are the CESM test scripts, which utilize the ``cime/scripts/create_newcase`` scripts that we shown how to use in this User's Guide. The second are a set of stand-alone scripts that use the CLM ``configure`` and ``bld/build-namelist`` scripts to build and test the model as well as testing the CLM tools as well. Below we will go into further details of how to use both methods. + +.. todo:: + Does ``configure`` script still exist? CIME Testing scripts ==================== From f22f22775ebc4ef9f9b478eecb85a9e3418d6010 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 24 Sep 2024 10:48:57 -0600 Subject: [PATCH 043/158] Add TODOs to update refs to queryDefaultNamelist.pl. --- .../running-single-point-configurations.rst | 3 +++ .../customizing-the-clm-configuration.rst | 3 +++ 2 files changed, 6 insertions(+) diff --git a/doc/source/users_guide/running-single-points/running-single-point-configurations.rst b/doc/source/users_guide/running-single-points/running-single-point-configurations.rst index b601040742..5977dc7be0 100644 --- a/doc/source/users_guide/running-single-points/running-single-point-configurations.rst +++ b/doc/source/users_guide/running-single-points/running-single-point-configurations.rst @@ -74,6 +74,9 @@ Supported single-point runs for sites with their own atmospheric forcing Of the supported single-point datasets we have three that also have atmospheric forcing data that go with them: Mexico City (Mexico), Vancouver, (Canada, British Columbia), and ``urbanc_alpha`` (test data for an Urban inter-comparison project). Mexico city and Vancouver also have namelist options in the source code for them to work with modified urban data parameters that are particular to these locations. To turn on the atmospheric forcing for these datasets, you set the ``env_run.xml DATM_MODE`` variable to ``CLM1PT``, and then the atmospheric forcing datasets will be used for the point picked. If you use one of the compsets that has "I1Pt" in the name that will be set automatically. +.. todo:: + Update the below, as ``queryDefaultNamelist.pl`` no longer exists. + When running with datasets that have their own atmospheric forcing you need to be careful to run over the period that data is available. If you have at least one year of forcing it will cycle over the available data over and over again no matter how long of a simulation you run. However, if you have less than a years worth of data (or if the start date doesn't start at the beginning of the year, or the end date doesn't end at the end of the year) then you won't be able to run over anything but the data extent. In this case you will need to carefully set the ``RUN_STARTDATE``, ``START_TOD`` and ``STOP_N/STOP_OPTION`` variables for your case to run over the entire time extent of your data. For the supported data points, these values are in the XML database and you can use the ``queryDefaultNamelist.pl`` script to query the values and set them for your case (they are set for the three urban test cases: Mexicocity, Vancouver, and urbanc_alpha). Example: Use site-specific atmospheric forcings diff --git a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst index 2bece02abd..7f03784f98 100644 --- a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst +++ b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst @@ -345,6 +345,9 @@ When ``-irrig on`` is used ``build-namelist`` will try to find surface datasets ``CLM_FORCE_COLDSTART`` when set to on, *requires* that your simulation do a cold start from arbitrary initial conditions. If this is NOT set, it will use an initial condition file if it can find an appropriate one, and otherwise do a cold start. ``CLM_FORCE_COLDSTART`` is a good way to ensure that you are doing a cold start if that is what you want to do. +.. todo:: + Update the below, as ``queryDefaultNamelist.pl`` no longer exists. + ``CLM_USRDAT_NAME`` Provides a way to enter your own datasets into the namelist. The files you create must be named with specific naming conventions outlined in :ref:`creating-your-own-singlepoint-dataset`. To see what the expected names of the files are, use the ``queryDefaultNamelist.pl`` to see what the names will need to be. For example if your ``CLM_USRDAT_NAME`` will be "1x1_boulderCO", with a "navy" land-mask, constant simulation year range, for 1850, the following will list what your filenames should be: :: From 8304414e9f6065da2fc36d57eba9060c10656a2f Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 24 Sep 2024 10:51:57 -0600 Subject: [PATCH 044/158] Add TODOs to update refs to mksurfdata.pl. --- doc/source/lilac/specific-atm-models/wrf-tools.rst | 3 +++ .../running-single-point-configurations.rst | 3 +++ 2 files changed, 6 insertions(+) diff --git a/doc/source/lilac/specific-atm-models/wrf-tools.rst b/doc/source/lilac/specific-atm-models/wrf-tools.rst index f67a05ea0a..720f7ad4fa 100644 --- a/doc/source/lilac/specific-atm-models/wrf-tools.rst +++ b/doc/source/lilac/specific-atm-models/wrf-tools.rst @@ -52,6 +52,9 @@ is described in here. ./gen_domain -m /glade/work/$USER/ctsm/nldas_grid/scrip/wrf2clm_mapping_noneg.nc -o wrf2clm_ocn_noneg -l wrf2clm_lnd_noneg +.. todo:: + Update the below, as ``mksurfdata.pl`` no longer exists. + 6. Create surface datasets in ``tools/mksurfdata_esmf``:: ./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_esmf" -no-crop diff --git a/doc/source/users_guide/running-single-points/running-single-point-configurations.rst b/doc/source/users_guide/running-single-points/running-single-point-configurations.rst index 5977dc7be0..34e930b7cf 100644 --- a/doc/source/users_guide/running-single-points/running-single-point-configurations.rst +++ b/doc/source/users_guide/running-single-points/running-single-point-configurations.rst @@ -145,6 +145,9 @@ The first step is to create the domain and surface datasets using the process ou Example: Creating a surface dataset for a single point --------------------------------------------------------------------- +.. todo:: + Update the below, as ``mksurfdata.pl`` no longer exists. + :: # set the GRIDNAME and creation date that will be used later From 962a0901c388ac3bccb7b9a696428c2669f1ebb8 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 24 Sep 2024 10:55:14 -0600 Subject: [PATCH 045/158] Fix compset and add TODO to "Running with historical CO2 forcing." --- ...alone-CLM-with-transient-historical-CO2-concentration.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/source/users_guide/running-special-cases/Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst b/doc/source/users_guide/running-special-cases/Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst index 60ef7658d0..f2f4c6cdd9 100644 --- a/doc/source/users_guide/running-special-cases/Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst +++ b/doc/source/users_guide/running-special-cases/Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst @@ -6,7 +6,10 @@ Running with historical CO2 forcing ===================================== -In this case you want to run a simulation with stand-alone CLM responding to changes in CO2 for a historical period. For this example, we will start with the ``I_1850-2000_CN`` compset that has transient land-use, Nitrogen and Aerosol deposition already. You could also use another compset if you didn't want these other features to be transient. In order to get CO2 to be transient we need to add a new streams file and add it to the list of streams in the ``user_nl_datm`` file. You also need a NetCDF datafile that datm can read that gives the variation. You could supply your own file, but we have a standard file that is used by CAM for this and our example will make use of this file. +In this case you want to run a simulation with stand-alone CLM responding to changes in CO2 for a historical period. For this example, we will start with the ``IHistClm50BgcCrop`` compset that has transient land-use, Nitrogen and Aerosol deposition already. You could also use another compset if you didn't want these other features to be transient. In order to get CO2 to be transient we need to add a new streams file and add it to the list of streams in the ``user_nl_datm`` file. You also need a NetCDF datafile that datm can read that gives the variation. You could supply your own file, but we have a standard file that is used by CAM for this and our example will make use of this file. + +.. todo:: + ``user_nl_datm`` or ``user_nl_datm_streams``? .. note:: Most everything here has to do with changing datm rather than CLM to allow this to happen. As such the user that wishes to do this should first become more familiar with datm and read the `CESM Data Model User's Guide `_ especially as it pertains to the datm. From 8a3107762669a7a755ff8ae838b648f16feb8ab2 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 24 Sep 2024 10:56:23 -0600 Subject: [PATCH 046/158] TODO added in "Running with irrigation". --- .../running-special-cases/Running-with-irrigation.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/source/users_guide/running-special-cases/Running-with-irrigation.rst b/doc/source/users_guide/running-special-cases/Running-with-irrigation.rst index 88bc9729ec..5e9adb4b6a 100644 --- a/doc/source/users_guide/running-special-cases/Running-with-irrigation.rst +++ b/doc/source/users_guide/running-special-cases/Running-with-irrigation.rst @@ -6,6 +6,9 @@ Running with irrigation =================================== +.. todo:: + Remove refs to pre-5.0 behavior? + In CLM4.0 irrigation isn't an allowed option. In CLM4.5 irrigation can ONLY be used WITH crop. With CLM5.0 irrigation can be used whether crop is on or not -- **BUT** if crop is off, your surface datasets **HAVE** to have irrigation defined appropriately. Right now *ALL* surface datasets without crop enabled have irrigation hard-wired on. In order to create datasets with irrigation off, you'd need to make changes to ``mksurfdata_esmf`` in order to have all generic crops to be non-irrigated. To turn on irrigation in |version| we simply add ``-irrig on`` to ``CLM_BLDNML_OPTS``. Example: Irrigation Simulation From 42ff69c713521459b900f4189b8b51060fd49eef Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 24 Sep 2024 10:58:10 -0600 Subject: [PATCH 047/158] Add TODO about -bgc_spinup. --- .../customizing-the-clm-configuration.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst index 7f03784f98..a33c5e5a2d 100644 --- a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst +++ b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst @@ -286,6 +286,9 @@ The ``$CTSMROOT/cime_config/buildnml`` script already sets the resolution and ma ``-bgc_spinup`` is an option only available for |version| for any configuration when CN is turned on (so either CLMCN or CLMBGC). It can be set to "on" or "off". If "on" the model will go into Accelerated Decomposition mode, while for "off" (the default) it will have standard decomposition rates. If you are starting up from initial condition files the model will check what mode the initial condition file is in and do the appropriate action on the first time-step to change the Carbon pools to the appropriate spinup setting. See :ref:`spinning-up-clm-bgc` for an example using this option. +.. todo:: + Update the above. + ``-chk_res`` ensures that the resolution chosen is supported by CLM. If the resolution is NOT supported it will cause the CLM ``build-namelist`` to abort when run. So when either ``preview_namelist``, ``case.build`` or ``case.run`` is executed it will abort early. Since, the CESM scripts only support certain resolutions anyway, in general this option is NOT needed in the context of running CESM cases. ``-clm_demand`` asks the ``build-namelist`` step to require that the list of variables entered be set. Typically, this is used to require that optional filenames be used and ensure they are set before continuing. For example, you may want to require that fpftdyn be set to get dynamically changing vegetation types. To do this you would do the following. From 2bf912f4d8a2189220ea3f67d823d36e78fc84fb Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 24 Sep 2024 10:59:58 -0600 Subject: [PATCH 048/158] Add TODOs about mkprocdata_map. --- .../users_guide/using-clm-tools/building-the-clm-tools.rst | 6 ++++++ .../users_guide/using-clm-tools/what-are-the-clm-tools.rst | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst b/doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst index 295dfd9380..3d2664bcec 100644 --- a/doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst +++ b/doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst @@ -6,6 +6,9 @@ The CLM FORTRAN tools all have similar makefiles, and similar options for building. The tools ``cprnc`` and ``gen_domain`` use the CIME configure/build system which is described in the next section. +.. todo:: + Remove references to mkprocdata_map? + The Makefiles (for ``mksurfdata_esmf`` and ``mkprocdata_map``) use GNU Make extensions and thus require that you use GNU make to use them. They also auto detect the type of platform you are on, using "uname -s" and set the compiler, compiler flags and such accordingly. There are also environment variables that can be set to set things that must be customized. All the tools use NetCDF and hence require the path to the NetCDF libraries and include files. On some platforms (such as Linux) multiple compilers can be used, and hence there are env variables that can be set to change the FORTRAN and/or "C" compilers used. The tools also allow finer control, by also allowing the user to add compiler flags they choose, for both FORTRAN and "C", as well as picking the compiler, linker and and add linker options. Finally the tools allow you to turn optimization on (which is off by default but on for ``mksurfdata_esmf``) with the OPT flag so that the tool will run faster. Options used by all: ``mksurfdata_esmf`` @@ -71,6 +74,9 @@ More details on each environment variable. ``OPT`` This variable flags if compiler optimization should be used when compiling the tool. It can be set to either ``TRUE`` or ``FALSE``, by default it is set to for both ``mksurfdata_esmf`` and ``mkprocdata_map``. Turning this on should make the tool run much faster. +.. todo:: + Remove reference to mkprocdata_map above? + .. warning:: Note, you should expect that answers will be different when ``OPT`` is activated. ``Filepath`` diff --git a/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst b/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst index fa80ffa61e..29eccf6b2e 100644 --- a/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst +++ b/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst @@ -6,6 +6,9 @@ What are the CLM tools ======================== +.. todo:: + Remove references to mkprocdata_map? + There are several tools provided with CLM that allow you to create your own input datasets at resolutions you choose, or to interpolate initial conditions to a different resolution, or used to compare CLM history files between different cases. The tools are all available in the ``$CTSMROOT/tools`` directory. Most of the tools are FORTRAN stand-alone programs in their own directory, but there is also a suite of NCL scripts in the ``$CTSMROOT/tools//ncl_scripts`` directory, and some of the tools are scripts that may also call the ESMF regridding program. Some of the NCL scripts are very specialized and not meant for general use, and we won't document them here. They still contain documentation in the script itself and the README file in the tools directory. The tools produce files that can be used for CLM4.5 and |version|. They do **NOT** produce files that can be used for CLM4.0. If you need files for CLM4.0, you'll need to use a previous version of CLM. @@ -45,6 +48,9 @@ There is a sample namelist called ``$CTSMROOT/tools/mksurfdata_esmf/gen_mksurfda Running FORTRAN tools with command line options ----------------------------------------------- +.. todo:: + Remove reference to mkprocdata_map? + ``gen_domain``, ``mkprocdata_map``, and ``cprnc`` run with command line arguments. The detailed sections below will give you more information on the command line arguments specific to each tool. Also running the tool without any arguments will give you a general synopsis on how to run the tool. ----------------------------------------- From 6ac23b250edbaf7c1789dd123da6c690d52fa3df Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 24 Sep 2024 11:04:06 -0600 Subject: [PATCH 049/158] Add TODOs about domain files not being needed in nuopc. --- doc/source/lilac/specific-atm-models/wrf-tools.rst | 3 +++ .../running-single-point-configurations.rst | 5 ++++- .../users_guide/using-clm-tools/building-the-clm-tools.rst | 6 ++++++ .../users_guide/using-clm-tools/creating-domain-files.rst | 3 +++ .../creating-input-for-surface-dataset-generation.rst | 3 +++ .../using-clm-tools/creating-surface-datasets.rst | 3 +++ .../users_guide/using-clm-tools/what-are-the-clm-tools.rst | 6 ++++++ 7 files changed, 28 insertions(+), 1 deletion(-) diff --git a/doc/source/lilac/specific-atm-models/wrf-tools.rst b/doc/source/lilac/specific-atm-models/wrf-tools.rst index 720f7ad4fa..1222a16f10 100644 --- a/doc/source/lilac/specific-atm-models/wrf-tools.rst +++ b/doc/source/lilac/specific-atm-models/wrf-tools.rst @@ -48,6 +48,9 @@ is described in here. ../../../configure --macros-format Makefile --mpilib mpi-serial +.. todo:: + Update the below, as domain files aren't needed with nuopc. + 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 diff --git a/doc/source/users_guide/running-single-points/running-single-point-configurations.rst b/doc/source/users_guide/running-single-points/running-single-point-configurations.rst index 34e930b7cf..0e7f1262e2 100644 --- a/doc/source/users_guide/running-single-points/running-single-point-configurations.rst +++ b/doc/source/users_guide/running-single-points/running-single-point-configurations.rst @@ -146,7 +146,7 @@ The first step is to create the domain and surface datasets using the process ou Example: Creating a surface dataset for a single point --------------------------------------------------------------------- .. todo:: - Update the below, as ``mksurfdata.pl`` no longer exists. + Update the below, as ``mksurfdata.pl`` no longer exists and domain files aren't needed with nuopc. :: @@ -186,6 +186,9 @@ Example: Setting up a case from the single-point surface dataset just created .. todo:: Change this to provide instructions for a CTSM checkout instead of a CESM one. +.. todo:: + Update the below, as domain files aren't needed with nuopc. + :: # First setup an environment variable that points to the top of the CESM directory. diff --git a/doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst b/doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst index 3d2664bcec..013af36a1c 100644 --- a/doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst +++ b/doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst @@ -4,6 +4,9 @@ .. include:: ../substitutions.rst +.. todo:: + Update the below, as domain files aren't needed with nuopc. + The CLM FORTRAN tools all have similar makefiles, and similar options for building. The tools ``cprnc`` and ``gen_domain`` use the CIME configure/build system which is described in the next section. .. todo:: @@ -105,6 +108,9 @@ The ``README.filecopies`` (which can be found in ``$CTSMROOT/tools``) is repeate Building the CLM tools that use the CIME configure/build system ================================================================ +.. todo:: + Update the below, as domain files aren't needed with nuopc. + ``cprnc`` and ``gen_domain`` both use the CIME configure/build system rather than the CLM specific version described above. See `CIME documentation on adding grids `_ for more information on adding grids, creating mapping files, and running ``gen_domain``. Also see the CIME file: ``$CTSMROOT/tools/mapping/gen_domain_files/INSTALL`` for how to build ``gen_domain``. diff --git a/doc/source/users_guide/using-clm-tools/creating-domain-files.rst b/doc/source/users_guide/using-clm-tools/creating-domain-files.rst index 3673e4ac18..3c920a449e 100644 --- a/doc/source/users_guide/using-clm-tools/creating-domain-files.rst +++ b/doc/source/users_guide/using-clm-tools/creating-domain-files.rst @@ -2,6 +2,9 @@ .. _creating-domain-files: +.. todo:: + Delete this page? Domain files aren't needed with nuopc. + ***************************** Creating CLM domain files ***************************** diff --git a/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst b/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst index e923b3bab2..66a65adbde 100644 --- a/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst +++ b/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst @@ -18,6 +18,9 @@ SCRIP grid files for all the standard model resolutions and the raw surface data Using mknocnmap.pl to create grid and maps for single-point regional grids -------------------------------------------------------------------------- +.. todo:: + Update the below, as domain files aren't needed with nuopc. + If you want to create a regular latitude/longitude single-point or regional grid, we suggest you use ``mknoocnmap.pl`` in ``$CTSMROOT/tools/mkmapdata`` which will create both the SCRIP grid file you need (using ``$CTSMROOT/tools/mkmapgrids/mkscripgrid.ncl``) AND an identity mapping file assuming there is NO ocean in your grid domain. If you HAVE ocean in your domain you could modify the mask in the SCRIP grid file for ocean, and then use ``ESMF_RegridWeightGen`` to create the mapping file, and ``gen_domain`` to create the domain file. Like other tools, ``./mkmapdata/mknoocnmap.pl`` has a help option with the following: :: diff --git a/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst b/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst index a59163a910..8394f17b3f 100644 --- a/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst +++ b/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst @@ -35,6 +35,9 @@ Creating a Complete Set of Files for Input to CLM First you need to create a descriptor file for your grid, that includes the locations of cell centers and cell corners. There is also a "mask" field, but in this case the mask is set to one everywhere (i.e. all of the masks for the output model grid are "nomask"). An example SCRIP grid file is: ``$CSMDATA/lnd/clm2/mappingdata/grids/SCRIPgrid_10x15_nomask_c110308.nc``. The ``mkmapgrids`` and ``mkscripgrid.ncl`` NCL script in the ``$CTSMROOT/tools/mkmapgrids`` directory can help you with this. SCRIP grid files for all the standard CLM grids are already created for you. See the Section called Creating an output SCRIP grid file at a resolution to run the model on for more information on this. +.. todo:: + Update the below, as domain files aren't needed with nuopc. + 2. Create domain dataset (if NOT already done) Next use ``gen_domain`` to create a domain file for use by DATM and CLM. This is required, unless a domain file was already created. See the Section called Creating a domain file for CLM and DATM for more information on this. diff --git a/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst b/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst index 29eccf6b2e..b77893222b 100644 --- a/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst +++ b/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst @@ -23,6 +23,9 @@ The list of generally important scripts and programs are as follows. #. ``./mkprocdata_map`` to interpolate output unstructured grids (such as the CAM HOMME dy-core "ne" grids like ne30np4) into a 2D regular lat/long grid format that can be plotted easily. Can be used by either clm4_0 or |version|. +.. todo:: + Update the below, as domain files aren't needed with nuopc. + #. ``$CIMEROOT/tools/mapping/gen_domain_files/gen_domain`` to create a domain file for datm from a mapping file. The domain file is then used by BOTH datm AND CLM to define the grid and land-mask. #. ``$CIMEROOT/tools/cprnc`` to compare two NetCDF files. @@ -51,6 +54,9 @@ Running FORTRAN tools with command line options .. todo:: Remove reference to mkprocdata_map? +.. todo:: + Update the below, as domain files aren't needed with nuopc. + ``gen_domain``, ``mkprocdata_map``, and ``cprnc`` run with command line arguments. The detailed sections below will give you more information on the command line arguments specific to each tool. Also running the tool without any arguments will give you a general synopsis on how to run the tool. ----------------------------------------- From 5e75f2eef913391bfeee03505250a809bef4312a Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 24 Sep 2024 11:06:44 -0600 Subject: [PATCH 050/158] Add TODO about updating "Observational Sites Datasets". --- .../using-clm-tools/observational-sites-datasets.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/source/users_guide/using-clm-tools/observational-sites-datasets.rst b/doc/source/users_guide/using-clm-tools/observational-sites-datasets.rst index 05fe461db2..82169e8238 100644 --- a/doc/source/users_guide/using-clm-tools/observational-sites-datasets.rst +++ b/doc/source/users_guide/using-clm-tools/observational-sites-datasets.rst @@ -6,6 +6,9 @@ Observational Sites Datasets ******************************* +.. todo:: + Update this. + There are two ways to customize datasets for a particular observational site. The first is to customize the input to the tools that create the dataset, and the second is to overwrite the default data after you've created a given dataset. Depending on the tool it might be easier to do it one way or the other. In Table :numref:`reqd-files-table` we list the files that are most likely to be customized and the way they might be customized. Of those files, the ones you are most likely to customize are: ``fatmlndfrc``, ``fsurdat``, ``faerdep`` (for DATM), and ``stream_fldfilename_ndep``. Note ``mksurfdata_esmf`` as documented previously has options to overwrite the vegetation and soil types. For more information on this also see :ref:`creating-your-own-singlepoint-dataset`. Another aspect of customizing your input datasets is customizing the input atmospheric forcing datasets; see :ref:`creating-your-own-singlepoint-dataset` for more information on this. From 38598dad1bbac0ffcabbcde9a2fae38c6689a1c9 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 24 Sep 2024 11:18:57 -0600 Subject: [PATCH 051/158] Fix another namelist_definition_clm4_5.xml reference. --- ...-Resolutions-or-New-Files-to-the-build-namelist-Database.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/users_guide/adding-new-resolutions/Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst b/doc/source/users_guide/adding-new-resolutions/Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst index 6a12fa4b1d..5b22f8a706 100644 --- a/doc/source/users_guide/adding-new-resolutions/Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst +++ b/doc/source/users_guide/adding-new-resolutions/Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst @@ -8,7 +8,7 @@ In the last chapter we gave the details on how to create new files for input into CLM. These files could be either global resolutions, regional-grids or even a single grid point. If you want to easily have these files available for continued use in your development you will then want to include them in the build-namelist database so that build-namelist can easily find them for you. You can deal with them, just by putting the settings in the ``user_nl_clm`` namelist file, or by using ``CLM_USRDAT_NAME``. Another way to deal with them is to enter them into the database for build-namelist, so that build-namelist can find them for you. This keeps one central database for all your files, rather than having multiple locations to keep track of files. If you have a LOT of files to keep track of it also might be easier than keeping track by hand, especially if you have to periodically update your files. If you just have a few quick experiments to try, for a short time period you might be best off using the other methods mentioned above. -There are two parts to adding files to the build-namelist database. The first part is adding new resolution names which is done in the ``$CTSMROOT/bld/namelist_files/namelist_definition_clm4_5.xml`` file. You can then use the new resolution by using ``CLM_USRDAT_NAME``. If you also want to be able to give the resolution to ``$CTSMROOT/cime/scripts/create_newcase`` -- you'll need to add the grid to the ``$CIMEROOT/config/cesm/config_grid.xml`` file. +There are two parts to adding files to the build-namelist database. The first part is adding new resolution names which is done in the ``$CTSMROOT/bld/namelist_files/namelist_definition_ctsm.xml`` file. You can then use the new resolution by using ``CLM_USRDAT_NAME``. If you also want to be able to give the resolution to ``$CTSMROOT/cime/scripts/create_newcase`` -- you'll need to add the grid to the ``$CIMEROOT/config/cesm/config_grid.xml`` file. The second part is actually adding the new filenames which is done in the ``$CTSMROOT/bld/namelist_files/namelist_definition_ctsm.xml`` file. If you aren't adding any new resolutions, and you are just changing the files for existing resolutions, you don't need to edit the namelist_definition file. From a2515820dbfb05b05b64ba3e54f930039edf2085 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 24 Sep 2024 11:23:26 -0600 Subject: [PATCH 052/158] More double-backticks in "Spinup of |version|-BGC-Crop". --- .../Spinning-up-the-biogeochemistry-BGC-spinup.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/users_guide/running-special-cases/Spinning-up-the-biogeochemistry-BGC-spinup.rst b/doc/source/users_guide/running-special-cases/Spinning-up-the-biogeochemistry-BGC-spinup.rst index 87049e6f1b..8376c280b1 100644 --- a/doc/source/users_guide/running-special-cases/Spinning-up-the-biogeochemistry-BGC-spinup.rst +++ b/doc/source/users_guide/running-special-cases/Spinning-up-the-biogeochemistry-BGC-spinup.rst @@ -6,7 +6,7 @@ Spinup of |version|-BGC-Crop ============================= -To get the |version|-BGC model to a steady state, you first run it from arbitrary initial conditions using the "accelerated decomposition spinup" (-bgc_spinup on in CLM ``configure``, see example below) mode for about 200 simulation years. :numref:`Figure BGC AD spinup plot for 1850 GSWP3` shows spinup behavior for an 1850 BGC accelerated decomposition (AD) case using GSWP3 atmospheric forcing. Generally, the criteria that less than 3% of the land surface be in total ecosystem carbon disequilibrium takes the longest to satisfy due to slow soil carbon (TOTSOMC) turnover times in the Arctic. +To get the |version|-BGC model to a steady state, you first run it from arbitrary initial conditions using the "accelerated decomposition spinup" (``-bgc_spinup on`` in CLM ``configure``, see example below) mode for about 200 simulation years. :numref:`Figure BGC AD spinup plot for 1850 GSWP3` shows spinup behavior for an 1850 BGC accelerated decomposition (AD) case using GSWP3 atmospheric forcing. Generally, the criteria that less than 3% of the land surface be in total ecosystem carbon disequilibrium takes the longest to satisfy due to slow soil carbon (TOTSOMC) turnover times in the Arctic. .. _Figure BGC AD spinup plot for 1850 GSWP3: @@ -14,7 +14,7 @@ To get the |version|-BGC model to a steady state, you first run it from arbitrar BGC AD spinup plot for a year 1850 case with GSWP3 atmospheric forcing. Variables examined are TOTECOSYSC (total ecosystem carbon), TOTSOMC (total soil organic matter carbon), TOTVEGC (total vegetation carbon), TLAI (total leaf area index), GPP (gross primary production) and TWS (total water storage). Generated using .../tools/contrib/SpinupStability.ncl. -After this you branch from this mode in the "final spinup" (-bgc_spinup off in CLM ``configure``, see example below), and run for several hundred simulation years. :numref:`Figure BGC pAD spinup plot for 1850 GSWP3` shows spinup behavior for an 1850 BGC post accelerated decomposition (pAD) case using GSWP3 atmospheric forcing. As before, the criteria that less than 3% of the land surface be in total ecosystem carbon disequilibrium takes the longest to satisfy. It can be difficult to meet this strict criteria in less than 1000 years and users may want to relax this criteria depending on their application. +After this you branch from this mode in the "final spinup" (``-bgc_spinup off`` in CLM ``configure``, see example below), and run for several hundred simulation years. :numref:`Figure BGC pAD spinup plot for 1850 GSWP3` shows spinup behavior for an 1850 BGC post accelerated decomposition (pAD) case using GSWP3 atmospheric forcing. As before, the criteria that less than 3% of the land surface be in total ecosystem carbon disequilibrium takes the longest to satisfy. It can be difficult to meet this strict criteria in less than 1000 years and users may want to relax this criteria depending on their application. .. _Figure BGC pAD spinup plot for 1850 GSWP3: From b5a82cc14ecf9fb39d092ecdda0bccf0ebbf967e Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 24 Sep 2024 11:40:59 -0600 Subject: [PATCH 053/158] Remove User's Guide section about running w/ transient hist CO2. --- ...transient-historical-CO2-concentration.rst | 42 ------------------- .../running-special-cases/index.rst | 1 - .../customizing-the-clm-configuration.rst | 2 +- 3 files changed, 1 insertion(+), 44 deletions(-) delete mode 100644 doc/source/users_guide/running-special-cases/Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst diff --git a/doc/source/users_guide/running-special-cases/Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst b/doc/source/users_guide/running-special-cases/Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst deleted file mode 100644 index f2f4c6cdd9..0000000000 --- a/doc/source/users_guide/running-special-cases/Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst +++ /dev/null @@ -1,42 +0,0 @@ -.. include:: ../substitutions.rst - -.. _running-with-historical-co2-forcing: - -===================================== - Running with historical CO2 forcing -===================================== - -In this case you want to run a simulation with stand-alone CLM responding to changes in CO2 for a historical period. For this example, we will start with the ``IHistClm50BgcCrop`` compset that has transient land-use, Nitrogen and Aerosol deposition already. You could also use another compset if you didn't want these other features to be transient. In order to get CO2 to be transient we need to add a new streams file and add it to the list of streams in the ``user_nl_datm`` file. You also need a NetCDF datafile that datm can read that gives the variation. You could supply your own file, but we have a standard file that is used by CAM for this and our example will make use of this file. - -.. todo:: - ``user_nl_datm`` or ``user_nl_datm_streams``? - -.. note:: Most everything here has to do with changing datm rather than CLM to allow this to happen. As such the user that wishes to do this should first become more familiar with datm and read the `CESM Data Model User's Guide `_ especially as it pertains to the datm. - -.. warning:: This section documents the process for doing something that is non-standard. There may be errors with the documentation and process, and you may have to do some work before all of this works for you. If that is the case, we recommend that you do further research into understanding the process and the files, as well as understanding the datm and how it works. You may have to read documentation found in the code for datm as well as "csm_share". - -The datm has "streams" files that have rough XML-like syntax and specify the location and file to get data from, as well as information on the variable names and the data locations of the grid points. The datm expects specific variable names and the datm "maps" the expected variable names from the file to the names expected by datm. The file we are working with here is a file with a single-point, that covers the entire globe (so the vertices go from -90 to 90 degrees in latitude and 0 to 360 degrees in longitude). Since it's a single point it's a little easier to work with than datasets that may be at a given horizontal resolution. The datm also expects that variables will be in certain units, and only expects a limited number of variables so arbitrary fields can NOT be exchanged this way. However, the process would be similar for datasets that do contain more than one point. - -The three things that are needed: a domain file, a data file, and a streams text file. The domain file is a CF-compliant NetCDF file that has information on the grid points (latitudes and longitudes for cell-centers and vertices, mask, fraction, and areas). The datafile is a CF-compliant NetCDF file with the data that will be mapped. The streams text file is the XML-like file that tells datm how to find the files and how to map the variables datm knows about to the variable names on the NetCDF files. Note, that in our case the domain file and the data file are the same file. In other cases, the domain file may be separate from the data file. - -First we are going to create a case, and we will edit the ``user_nl_datm`` so that we add a CO2 data stream in. There is a streams text file available in ``$CTSMROOT/doc/UsersGuide/co2_streams.txt``, that includes file with a CO2 time-series from 1765 to 2007. - -Example: Transient Simulation with Historical CO2 --------------------------------------------------------------- -:: - - > cd cime/scripts - > ./create_newcase -case DATM_CO2_TSERIES -res f19_g17_gl4 -compset IHistClm50BgcCrop - > cd DATM_CO2_TSERIES - - # Historical CO2 will already be setup correctly for this compset - # to check that look at the variables: CCSM_BGC,CLM_CO2_TYPE, and DATM_CO2_TSERIES - > ./xmlquery CCSM_BGC,CLM_CO2_TYPE,DATM_CO2_TSERIES - # Expect: CCSM_BGC=CO2A,CLM_CO2_TYPE=diagnostic,DATM_CO2_TSERIES=20tr - > ./case.setup - - # Run preview namelist so we have the namelist in CaseDocs - > ./preview_namelists - -Once, you've done that you can build and run your case normally. - diff --git a/doc/source/users_guide/running-special-cases/index.rst b/doc/source/users_guide/running-special-cases/index.rst index 9173825d04..31d5a3b148 100644 --- a/doc/source/users_guide/running-special-cases/index.rst +++ b/doc/source/users_guide/running-special-cases/index.rst @@ -24,5 +24,4 @@ Running Special Cases Running-with-excess-ground-ice.rst 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/customizing-the-clm-configuration.rst b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst index a33c5e5a2d..7cd8ce9c9c 100644 --- a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst +++ b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst @@ -361,7 +361,7 @@ When ``-irrig on`` is used ``build-namelist`` will try to find surface datasets An example of using ``CLM_USRDAT_NAME`` for a simulation is given in Example :numref:`creating-your-own-singlepoint-dataset`. ``CLM_CO2_TYPE`` - sets the type of input CO2 for either "constant", "diagnostic" or prognostic". If "constant" the value from ``CCSM_CO2_PPMV`` will be used. If "diagnostic" or "prognostic" the values MUST be sent from the atmosphere model. See :ref:`running-with-historical-co2-forcing` for more information on how to send CO2 from the data atmosphere model. + sets the type of input CO2 for either "constant", "diagnostic" or prognostic". If "constant" the value from ``CCSM_CO2_PPMV`` will be used. If "diagnostic" or "prognostic" the values MUST be sent from the atmosphere model. =============== User Namelist From edefa3c596eb5d7750595afd9c9b180badd60031 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 24 Sep 2024 11:47:15 -0600 Subject: [PATCH 054/158] Resolve a docs build warning. --- .../users_guide/using-clm-tools/creating-domain-files.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/source/users_guide/using-clm-tools/creating-domain-files.rst b/doc/source/users_guide/using-clm-tools/creating-domain-files.rst index 3c920a449e..90814e1927 100644 --- a/doc/source/users_guide/using-clm-tools/creating-domain-files.rst +++ b/doc/source/users_guide/using-clm-tools/creating-domain-files.rst @@ -2,13 +2,13 @@ .. _creating-domain-files: -.. todo:: - Delete this page? Domain files aren't needed with nuopc. - ***************************** Creating CLM domain files ***************************** +.. todo:: + Delete this page? Domain files aren't needed with nuopc. + ``gen_domain`` to create a domain file for datm from a mapping file. ``gen_domain`` is a tool that is a part of CIME. The domain file is then used by BOTH DATM AND CLM to define the grid and land-mask. The general data flow is shown in two figures. :numref:`Figure mkmapdata.sh` shows the general flow for a general global case (or for a regional grid that DOES include ocean). :numref:`Figure mknoocnmap.pl` shows the use of ``mknoocnmap.pl`` (see :ref:`using-mkocnmap`) to create a regional or single-point map file that is then run through ``gen_domain`` to create the domain file for it. As stated before :numref:`Figure Data_Flow_Legend` is the legend for both of these figures. See `the $CIMEROOT/tools/mapping/gen_domain_files/README `_ file for more help on ``gen_domain``. Here we create domain files for a regular global domain. From 6c7ecf62ddb7e742a4b993ec9f351d6cd7025a93 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Wed, 25 Sep 2024 11:19:25 -0600 Subject: [PATCH 055/158] PPE change to sa_leaf --- src/biogeophys/CanopyFluxesMod.F90 | 1 + 1 file changed, 1 insertion(+) diff --git a/src/biogeophys/CanopyFluxesMod.F90 b/src/biogeophys/CanopyFluxesMod.F90 index a969dc0583..0c5431728d 100644 --- a/src/biogeophys/CanopyFluxesMod.F90 +++ b/src/biogeophys/CanopyFluxesMod.F90 @@ -753,6 +753,7 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, .or. dbh(p) < min_stem_diameter) then frac_rad_abs_by_stem(p) = 0.0_r8 sa_stem(p) = 0.0_r8 + sa_leaf(p) = sa_leaf(p) + esai(p) endif ! if using Satellite Phenology mode, calculate leaf and stem biomass From a9cd52f0191feaa387b6d3f1fc5c245a4d29b4f0 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 20 Sep 2024 09:15:54 -0600 Subject: [PATCH 056/158] Error in Hillslope/shell_commands if running on grid w/o a hillslope_file. --- .../testmods_dirs/clm/Hillslope/shell_commands | 12 ++++++++++++ .../testdefs/testmods_dirs/clm/Hillslope/user_nl_clm | 2 -- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands b/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands index a2759b51b4..9b50ed6fe5 100644 --- a/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands @@ -1,5 +1,17 @@ ./xmlchange CLM_BLDNML_OPTS="-bgc sp" DIN_LOC_ROOT=$(./xmlquery --value DIN_LOC_ROOT) + +# Set hillslope_file. Needed for any grids without default hillslope_file already set by CTSM. +lnd_grid=$(./xmlquery --value LND_GRID) +if [[ ${lnd_grid} == "10x15" ]]; then + hillslope_file='$DIN_LOC_ROOT/lnd/clm2/testdata/synthetic_cosphill_1.3.nc' +else + echo "ERROR: Hillslope file not found for LND_GRID=${lnd_grid}" >&2 + exit 1 +fi +echo -e "hillslope_file = '${hillslope_file}'\n" >> user_nl_clm + +# Set mesh file meshfile=$DIN_LOC_ROOT/lnd/clm2/testdata/ESMFmesh_10x15_synthetic_cosphill_1.0.nc ./xmlchange ATM_DOMAIN_MESH=${meshfile},LND_DOMAIN_MESH=${meshfile} diff --git a/cime_config/testdefs/testmods_dirs/clm/Hillslope/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/Hillslope/user_nl_clm index c750400672..e108e93d91 100644 --- a/cime_config/testdefs/testmods_dirs/clm/Hillslope/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/Hillslope/user_nl_clm @@ -6,6 +6,4 @@ hillslope_transmissivity_method = 'LayerSum' hillslope_pft_distribution_method = 'PftLowlandUpland' hillslope_soil_profile_method = 'Uniform' -hillslope_file = '$DIN_LOC_ROOT/lnd/clm2/testdata/synthetic_cosphill_1.3.nc' - use_ssre = .false. From d837838470375f1ce191cf193025530d327b1681 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 25 Sep 2024 16:30:48 -0600 Subject: [PATCH 057/158] Hillslope testmod: Add hillslope_file for 5x5_amazon. --- cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands b/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands index 9b50ed6fe5..06576c405f 100644 --- a/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands @@ -5,6 +5,8 @@ DIN_LOC_ROOT=$(./xmlquery --value DIN_LOC_ROOT) lnd_grid=$(./xmlquery --value LND_GRID) if [[ ${lnd_grid} == "10x15" ]]; then hillslope_file='$DIN_LOC_ROOT/lnd/clm2/testdata/synthetic_cosphill_1.3.nc' +elif [[ ${lnd_grid} == "5x5_amazon" ]]; then + hillslope_file='/glade/derecho/scratch/samrabin/hillslopes_5x5_amazon/hand_analysis_global/combined/hilldata_5x5_amazon_hist_2000_78pfts_c240216.nc' else echo "ERROR: Hillslope file not found for LND_GRID=${lnd_grid}" >&2 exit 1 From 615224a87a7a20fcb180312e26ec9fbd8aa2c5c9 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 26 Sep 2024 14:43:43 -0600 Subject: [PATCH 058/158] Updated number of tests --- bld/unit_testers/build-namelist_test.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 3480243371..06c9bcc361 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -163,7 +163,7 @@ sub cat_and_create_namelistinfile { # # Figure out number of tests that will run # -my $ntests = 3994; +my $ntests = 3997; if ( defined($opts{'compare'}) ) { $ntests += 2437; From cb7e9223d7d773fe2d066906c5621a0b39937dfd Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 26 Sep 2024 12:48:48 -0600 Subject: [PATCH 059/158] Don't manually set meshfile in Hillslope tests. --- .../testdefs/testmods_dirs/clm/Hillslope/shell_commands | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands b/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands index 06576c405f..33504f51f4 100644 --- a/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands @@ -13,9 +13,5 @@ else fi echo -e "hillslope_file = '${hillslope_file}'\n" >> user_nl_clm -# Set mesh file -meshfile=$DIN_LOC_ROOT/lnd/clm2/testdata/ESMFmesh_10x15_synthetic_cosphill_1.0.nc -./xmlchange ATM_DOMAIN_MESH=${meshfile},LND_DOMAIN_MESH=${meshfile} - # -ignore_warnings is needed as long as we don't allow use_hillslope and use_init_interp together ./xmlchange --append CLM_BLDNML_OPTS=-ignore_warnings From ed5d17bb2176c410b15f52721cd951f0a8f0fcc5 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 26 Sep 2024 15:40:34 -0600 Subject: [PATCH 060/158] First draft ChangeLog/ChangeSum --- doc/ChangeLog | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 86 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index d11efad6b3..ded12c54f8 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,89 @@ =============================================================== +Tag name: ctsm5.3.001 +Originator(s): slevis (Samuel Levis,UCAR/TSS,303-665-1310) +Date: Thu 26 Sep 2024 03:10:40 PM MDT +One-line Summary: Merge b4b-dev + +Purpose and description of changes +---------------------------------- + +- Keith fixed comments on urban thermal variables. +- Sam R removed references to PTCLM*. +- Sam R made updates to the documentation. +- Sam R made improvements to mesh_plotter. +- Matvey and Sam R worked on hillslope hydrology warnings. +- Matvey added a test and a warning. + +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.] + +[ ] clm6_0 + +[ ] clm5_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- +List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: +PR #2770 documentation fixes and improvements +PR #2772 mesh_plotter improvements +PR #2765 fix comments on urban thermal variables +PR #2703 add a namelist warning + +Notes of particular relevance for users +--------------------------------------- +Changes to documentation: + Yes, see "bugs fixed" above. + + +Notes of particular relevance for developers: +--------------------------------------------- +Changes to tests or testing: + Test(s) added to bld/unit_testers/build-namelist_test.pl + + +Testing summary: +---------------- + + [PASS means all tests PASS; OK means tests PASS other than expected fails.] + + build-namelist tests (if CLMBuildNamelist.pm has changed): + + derecho - PASS + + python testing (if python code has changed; see instructions in python/README.md; document testing done): + + derecho - PASS + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + derecho ----- OK + izumi ------- OK + + +Answer changes +-------------- +Changes answers relative to baseline: No + + +Other details +------------- +Pull Requests that document the changes (include PR ids): + https://github.com/ESCOMP/ctsm/pull/2792 + +=============================================================== +=============================================================== Tag name: ctsm5.3.0 Originator(s): multiple (see below) Date: Wed 25 Sep 2024 01:22:06 AM MDT diff --git a/doc/ChangeSum b/doc/ChangeSum index ebbab3ce01..1014612b40 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.3.001 multiple 09/26/2024 Merge b4b-dev ctsm5.3.0 multiple 09/24/2024 Update surface datasets, CN Matrix, CLM60: excess ice on, explicit A/C on, crop calendars, Sturm snow, Leung dust emissions, prigent roughness data ctsm5.2.029 multiple 09/24/2024 New surface datasets: double tag of ctsm5.3.0 ctsm5.2.028 rgknox 09/05/2024 FATES history flushing update From 830e675efe30851e7f5701231302b5117a34ce8c Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 26 Sep 2024 16:57:01 -0600 Subject: [PATCH 061/158] Updated EXPECTED FAILUREs (I should have done this in ctsm5.3.0) --- cime_config/testdefs/ExpectedTestFails.xml | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 36245661c0..8acaf71eab 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -37,6 +37,50 @@ + + + FAIL + #2787 + The issue shows how to fix it. + + + + + FAIL + #2787 + The issue shows how to fix it. + + + + + FAIL + #2787 + The issue shows how to fix it. + + + + + + FAIL + #2780 + Crashes in the matrix solver. + + + + + FAIL + #2780 + Crashes in the matrix solver. + + + + + FAIL + #2780 + Crashes in the matrix solver. + + + FAIL From c393123b48f148041c713d0478da4f6d6d5d237a Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 26 Sep 2024 22:10:19 -0700 Subject: [PATCH 062/158] correct clm_demand option typo --- .../testdefs/testmods_dirs/clm/FatesColdLandUse/shell_commands | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/shell_commands b/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/shell_commands index c97c0dfea7..d88457df12 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/shell_commands @@ -1,3 +1,3 @@ #!/bin/bash -./xmlchange CLM_BLDNML_OPTS="-i-clm_demand -flanduse_timeseries" --append +./xmlchange CLM_BLDNML_OPTS="--clm_demand -flanduse_timeseries" --append From e591a1a677e9576382be2d6d2025ebc9b5760a24 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 27 Sep 2024 12:12:35 -0600 Subject: [PATCH 063/158] Remove parallel 5x5_amazon test from expected fails. --- cime_config/testdefs/ExpectedTestFails.xml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 35c452b88c..c4f4ac0fc7 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -194,13 +194,6 @@ - - - FAIL - #2423 - - - FAIL From 4f2129fb4a70120e6e0163a66a77073d653579bf Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 27 Sep 2024 12:28:08 -0600 Subject: [PATCH 064/158] Rename 10x15 synthetic hillslope_file to include 10x15. --- cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands b/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands index 33504f51f4..7bec6fd7f6 100644 --- a/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands @@ -4,7 +4,7 @@ DIN_LOC_ROOT=$(./xmlquery --value DIN_LOC_ROOT) # Set hillslope_file. Needed for any grids without default hillslope_file already set by CTSM. lnd_grid=$(./xmlquery --value LND_GRID) if [[ ${lnd_grid} == "10x15" ]]; then - hillslope_file='$DIN_LOC_ROOT/lnd/clm2/testdata/synthetic_cosphill_1.3.nc' + hillslope_file='$DIN_LOC_ROOT/lnd/clm2/testdata/synthetic_cosphill_10x15_1.3.nc' elif [[ ${lnd_grid} == "5x5_amazon" ]]; then hillslope_file='/glade/derecho/scratch/samrabin/hillslopes_5x5_amazon/hand_analysis_global/combined/hilldata_5x5_amazon_hist_2000_78pfts_c240216.nc' else From ad0ab606eb7b1dbda164979a531c64581f4a4a06 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 27 Sep 2024 12:33:38 -0600 Subject: [PATCH 065/158] Add/edit comments about 5x5_amazon hillslope tests. --- cime_config/testdefs/testlist_clm.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index b92c62be15..d27d1d0ec9 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3537,6 +3537,7 @@ + @@ -3547,7 +3548,7 @@ - + From 061b1c90bc2391fea6a13a162b007b3bf0857158 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 27 Sep 2024 12:36:12 -0600 Subject: [PATCH 066/158] Remove parallel 5x5_amazon hillslope test from aux_clm. --- cime_config/testdefs/testlist_clm.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index d27d1d0ec9..c27cd3eda2 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3543,7 +3543,6 @@ - From 792abd1342121126dae3929bd04d6f03242aed8a Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 27 Sep 2024 14:24:51 -0600 Subject: [PATCH 067/158] Adding one more EXPECTED FAILURE --- cime_config/testdefs/ExpectedTestFails.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 8acaf71eab..30b19ce862 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -95,6 +95,13 @@ This failure relates to the preceding ERP failure. + + + FAIL + #2619 + This failure relates to the preceding ERP failure. + + From adecc67a7f31922b3ecf4077282c954656e60a5b Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 27 Sep 2024 14:13:19 -0700 Subject: [PATCH 068/158] Revert "Merge tag 'ctsm5.3.001' into b4b-dev" From 039626c391e5e25761fc6200796c7a13f2a24f87 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 27 Sep 2024 16:03:16 -0600 Subject: [PATCH 069/158] Fix clm-basic tests --- cime_config/config_component.xml | 10 +++++----- cime_config/config_compsets.xml | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 3fb682ccf0..ec78008477 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -14,7 +14,7 @@ clm4.5: - clm5.0: + clm6.0: clm5.1: clm6.0: Satellite phenology: @@ -367,10 +367,10 @@ $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/fates_sp $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/fates_sp - $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_deck - $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_nociso_deck - $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_waccm_deck - $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_waccm_nociso_deck + $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_deck + $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_nociso_deck + $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_ctsm env_case.xml diff --git a/cime_config/config_compsets.xml b/cime_config/config_compsets.xml index 538329e523..7618c51c98 100644 --- a/cime_config/config_compsets.xml +++ b/cime_config/config_compsets.xml @@ -197,15 +197,15 @@ - I1850Clm50BgcCropCmip6 - 1850_DATM%GSWP3v1_CLM50%BGC-CROP-CMIP6DECK_SICE_SOCN_MOSART_SGLC_SWAV + I1850Clm60BgcCropCmip6 + 1850_DATM%GSWP3v1_CLM60%BGC-CROP-CMIP6DECK_SICE_SOCN_MOSART_SGLC_SWAV - I1850Clm50BgcCropCmip6waccm - 1850_DATM%GSWP3v1_CLM50%BGC-CROP-CMIP6WACCMDECK_SICE_SOCN_MOSART_SGLC_SWAV + I1850Clm60BgcCropCmip6waccm + 1850_DATM%GSWP3v1_CLM60%BGC-CROP-CMIP6WACCMDECK_SICE_SOCN_MOSART_SGLC_SWAV From 70c9f8b5a825b9271cf0c268f72876f0834f687e Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 27 Sep 2024 18:08:39 -0600 Subject: [PATCH 070/158] Updates for my fix to take effect correctly --- cime_config/config_component.xml | 8 ++++++-- cime_config/config_compsets.xml | 8 ++++++++ cime_config/testdefs/testlist_clm.xml | 6 +++--- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index ec78008477..454e95826e 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -14,9 +14,9 @@ clm4.5: - clm6.0: + clm6.0: clm5.1: - clm6.0: + clm6.0: Satellite phenology: Satellite phenology with VIC hydrology: @@ -367,6 +367,10 @@ $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/fates_sp $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/fates_sp + $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_deck + $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_nociso_deck + $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_waccm_deck + $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_waccm_nociso_deck $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_deck $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_nociso_deck $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_waccm_deck diff --git a/cime_config/config_compsets.xml b/cime_config/config_compsets.xml index 7618c51c98..e5d716384a 100644 --- a/cime_config/config_compsets.xml +++ b/cime_config/config_compsets.xml @@ -196,6 +196,10 @@ + + I1850Clm50BgcCropCmip6 + 1850_DATM%GSWP3v1_CLM50%BGC-CROP-CMIP6DECK_SICE_SOCN_MOSART_SGLC_SWAV + I1850Clm60BgcCropCmip6 1850_DATM%GSWP3v1_CLM60%BGC-CROP-CMIP6DECK_SICE_SOCN_MOSART_SGLC_SWAV @@ -203,6 +207,10 @@ + + I1850Clm50BgcCropCmip6waccm + 1850_DATM%GSWP3v1_CLM50%BGC-CROP-CMIP6WACCMDECK_SICE_SOCN_MOSART_SGLC_SWAV + I1850Clm60BgcCropCmip6waccm 1850_DATM%GSWP3v1_CLM60%BGC-CROP-CMIP6WACCMDECK_SICE_SOCN_MOSART_SGLC_SWAV diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 0eb3d5012d..f0c089f3a4 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1732,7 +1732,7 @@ - + @@ -2431,7 +2431,7 @@ - + @@ -3262,7 +3262,7 @@ - + From 698902d003d582babbc08dcf993fc7ac752d2637 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 27 Sep 2024 18:15:09 -0600 Subject: [PATCH 071/158] Small important correction --- cime_config/config_component.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 454e95826e..540d285a85 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -14,7 +14,7 @@ clm4.5: - clm6.0: + clm5.0: clm5.1: clm6.0: Satellite phenology: From bcbc46295766fc4e2ce1421fdf6876bc50040360 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 30 Sep 2024 12:19:57 -0600 Subject: [PATCH 072/158] Change testlist_clm ne30pg3_t061 tests to ne30pg3_t232 --- cime_config/testdefs/testlist_clm.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 0eb3d5012d..34a9caffb5 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1987,7 +1987,7 @@ - + @@ -1996,7 +1996,7 @@ - + From f312b8add316daca532a9be6ba6a96c695a654a0 Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Mon, 30 Sep 2024 13:36:55 -0600 Subject: [PATCH 073/158] First commit for CESM3 tuning of the dust emission module by dmleung. 30 Sep 2024 --- src/biogeochem/DustEmisLeung2023.F90 | 10 ++++++---- src/biogeophys/SoilStateInitTimeConstMod.F90 | 4 +++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/biogeochem/DustEmisLeung2023.F90 b/src/biogeochem/DustEmisLeung2023.F90 index 869c18c0dc..b77dcae9dc 100644 --- a/src/biogeochem/DustEmisLeung2023.F90 +++ b/src/biogeochem/DustEmisLeung2023.F90 @@ -384,14 +384,16 @@ subroutine DustEmission (this, bounds, & real(r8) :: wnd_frc_thr_slt_it ! [m/s] created for impact threshold friction velocity real(r8) :: wnd_frc_thr_slt ! [m/s] used for wet fluid threshold friction velocity real(r8) :: K_length ! [dimless] normalized mean interobstacle distance, or called gap length (Okin, 2008) + ! dmleung has these variables and will change them into pointers and prepare for their history outputs. 30 Sep 2024 real(r8) :: bare_frc ! LUH2 bare soil land cover fraction - real(r8) :: veg_frc ! LUH2 natural vegetation + crop land cover fraction + real(r8) :: natveg_frc ! LUH2 natural vegetation cover fraction + real(r8) :: crop_frc ! LUH2 crop cover fraction. ! ! constants ! real(r8), parameter :: cst_slt = 2.61_r8 ! [frc] Saltation constant real(r8), parameter :: flx_mss_fdg_fct = 5.0e-4_r8 ! [frc] Empir. mass flx tuning eflx_lh_vegt - real(r8), parameter :: vai_mbl_thr = 1.0_r8 ! [m2 m-2] new VAI threshold; Danny M. Leung suggests 1, and Zender's scheme uses 0.3 + real(r8), parameter :: vai_mbl_thr = 0.5_r8 ! [m2 m-2] new VAI threshold; Danny M. Leung suggests something between 0.6 and 1 for tuning. Zender's scheme uses 0.3. Simone Tilmes might want this as a namelist variable for easier CESM tuning. dmleung 30 Sep 2024. real(r8), parameter :: Cd0 = 4.4e-5_r8 ! [dimless] proportionality constant in calculation of dust emission coefficient real(r8), parameter :: Ca = 2.7_r8 ! [dimless] proportionality constant in scaling of dust emission exponent @@ -407,7 +409,7 @@ subroutine DustEmission (this, bounds, & real(r8), parameter :: D_p = 130e-6_r8 ! [m] Medium soil particle diameter, assuming a global constant of ~130 um following Leung et al. (2023). dmleung 16 Feb 2024 real(r8), parameter :: gamma_Shao = 1.65e-4_r8 ! [kg s-2] interparticle cohesion: fitting parameter in Shao and Lu (2000) (S&L00). dmleung 16 Feb 2024 real(r8), parameter :: A_Shao = 0.0123_r8 ! [dimless] coefficient for aerodynamic force: fitting parameter in Shao and Lu (2000). dmleung 16 Feb 2024 - real(r8), parameter :: frag_expt_thr = 5.0_r8 ! [dimless] threshold for fragmentation exponent defined in Leung et al. (2023), somewhere within 3 to 5. It is used to prevent a local AOD blowup (over Patagonia, Argentina), but one can test larger values and relax the threshold if wanted. dmleung 16 Feb 2024 + real(r8), parameter :: frag_expt_thr = 2.5_r8 ! [dimless] Maximum value or threshold for fragmentation exponent defined in Leung et al. (2023). Danny M. Leung suggested it to be somewhere between 3 and 5 for tuning. It is used to prevent a local AOD blowup (over Patagonia, Argentina), but one can test larger values and relax the threshold if wanted. dmleung 16 Feb 2024. Update: Simone Tilmes might want this as a namelist variable for easier CESM tuning. 30 Sep 2024. real(r8), parameter :: z0a_glob = 1e-4_r8 ! [m] assumed globally constant aeolian roughness length value in Leung et al. (2023), for the log law of the wall for Comola et al. (2019) intermittency scheme. dmleung 20 Feb 2024 real(r8), parameter :: hgt_sal = 0.1_r8 ! [m] saltation height used by Comola et al. (2019) intermittency scheme for the log law of the wall. dmleung 20 Feb 2024 real(r8), parameter :: vai0_Okin = 0.1_r8 ! [m2/m2] minimum VAI needed for Okin-Pierre's vegetation drag partition equation. lai=0 in the equation will lead to infinity, so a small value is added into this lai dmleung defined. @@ -886,4 +888,4 @@ end subroutine SetDragPartition !============================================================================== -end module DustEmisLeung2023 \ No newline at end of file +end module DustEmisLeung2023 diff --git a/src/biogeophys/SoilStateInitTimeConstMod.F90 b/src/biogeophys/SoilStateInitTimeConstMod.F90 index e6fcca0f27..fc542075fe 100644 --- a/src/biogeophys/SoilStateInitTimeConstMod.F90 +++ b/src/biogeophys/SoilStateInitTimeConstMod.F90 @@ -765,12 +765,14 @@ real(r8) function ThresholdSoilMoistZender2003( clay ) !------------------------------------------------------------------------------ real(r8), intent(IN) :: clay ! Fraction of clay in the soil (%) + real(r8), parameter :: a = 0.5_r8 ! Tuning factor for the soil moisture effect. This parameter could also be added into ThresholdSoilMoistKok2014. Simone Tilmes suggested to change this parameter into a namelist variable for easier CESM tuning. dmleung 30 Sep 2024. + if ( clay < 0.0_r8 .or. clay > 100.0_r8 )then ThresholdSoilMoistZender2003 = nan call endrun( 'Clay fraction is out of bounds (0 to 100)') return end if - ThresholdSoilMoistZender2003 = 0.17_r8 + 0.14_r8 * clay * 0.01_r8 + ThresholdSoilMoistZender2003 = a * ( 0.17_r8 + 0.14_r8 * (clay*0.01_r8) ) end function ThresholdSoilMoistZender2003 !------------------------------------------------------------------------------ From d3d4e2ee89246654d02b22f286c4365ef63de92b Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 30 Sep 2024 17:08:32 -0600 Subject: [PATCH 074/158] Allocate elevclass_o before use in mkglcmecMod.F90 --- tools/mksurfdata_esmf/src/mkglcmecMod.F90 | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/mksurfdata_esmf/src/mkglcmecMod.F90 b/tools/mksurfdata_esmf/src/mkglcmecMod.F90 index 25fa4a8edc..4bc3d83e06 100644 --- a/tools/mksurfdata_esmf/src/mkglcmecMod.F90 +++ b/tools/mksurfdata_esmf/src/mkglcmecMod.F90 @@ -100,6 +100,7 @@ subroutine mkglcmecInit( pioid_o ) call shr_sys_abort() end if + allocate(elevclass_o(size(elevclass))) elevclass_o(:) = elevclass(:) if (root_task) write(ndiag, '(a)') trim(subname)//" writing out GLC_MEC" From f40ee1a4174c318d3580d7c0810098e4ff5627c3 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 30 Sep 2024 17:30:16 -0600 Subject: [PATCH 075/158] Change testlist_clm C96_t061 test to C96_t232 --- cime_config/testdefs/testlist_clm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 34a9caffb5..25bedadb76 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -195,7 +195,7 @@ - + From b15640f6d35ecc95bdeb6157561e8f8cee741e07 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 30 Sep 2024 18:16:33 -0600 Subject: [PATCH 076/158] Remove elevclass_o altogether because it is NOT used --- tools/mksurfdata_esmf/src/mkglcmecMod.F90 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tools/mksurfdata_esmf/src/mkglcmecMod.F90 b/tools/mksurfdata_esmf/src/mkglcmecMod.F90 index 4bc3d83e06..6dc363ecac 100644 --- a/tools/mksurfdata_esmf/src/mkglcmecMod.F90 +++ b/tools/mksurfdata_esmf/src/mkglcmecMod.F90 @@ -49,7 +49,6 @@ subroutine mkglcmecInit( pioid_o ) ! local variables: type(var_desc_t) :: pio_varid type(io_desc_t) :: pio_iodesc - real(r8), allocatable :: elevclass_o(:) ! elevation classes integer :: rcode character(len=*), parameter :: subname = 'mkglcmecInit' !----------------------------------------------------------------------- @@ -100,9 +99,6 @@ subroutine mkglcmecInit( pioid_o ) call shr_sys_abort() end if - allocate(elevclass_o(size(elevclass))) - elevclass_o(:) = elevclass(:) - if (root_task) write(ndiag, '(a)') trim(subname)//" writing out GLC_MEC" rcode = pio_inq_varid(pioid_o, 'GLC_MEC', pio_varid) rcode = pio_put_var(pioid_o, pio_varid, elevclass) From 191a399fe12f92dc93edfcf6169d9ebd1808b353 Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Mon, 30 Sep 2024 18:20:10 -0600 Subject: [PATCH 077/158] dmleung deleted a few unused parameters and variables. 30 Sep 2024 --- src/biogeochem/DustEmisLeung2023.F90 | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/biogeochem/DustEmisLeung2023.F90 b/src/biogeochem/DustEmisLeung2023.F90 index b77dcae9dc..31f827faaf 100644 --- a/src/biogeochem/DustEmisLeung2023.F90 +++ b/src/biogeochem/DustEmisLeung2023.F90 @@ -358,10 +358,6 @@ subroutine DustEmission (this, bounds, & ! !LOCAL VARIABLES integer :: fp,p,c,l,g,m,n ! indices real(r8) :: liqfrac ! fraction of total water that is liquid - real(r8) :: wnd_frc_rat ! [frc] Wind friction threshold over wind friction - real(r8) :: wnd_frc_slt_dlt ! [m s-1] Friction velocity increase from saltatn - real(r8) :: wnd_rfr_dlt ! [m s-1] Reference windspeed excess over threshld - real(r8) :: dst_slt_flx_rat_ttl real(r8) :: flx_mss_hrz_slt_ttl real(r8) :: flx_mss_vrt_dst_ttl(bounds%begp:bounds%endp) real(r8) :: frc_thr_wet_fct @@ -391,8 +387,6 @@ subroutine DustEmission (this, bounds, & ! ! constants ! - real(r8), parameter :: cst_slt = 2.61_r8 ! [frc] Saltation constant - real(r8), parameter :: flx_mss_fdg_fct = 5.0e-4_r8 ! [frc] Empir. mass flx tuning eflx_lh_vegt real(r8), parameter :: vai_mbl_thr = 0.5_r8 ! [m2 m-2] new VAI threshold; Danny M. Leung suggests something between 0.6 and 1 for tuning. Zender's scheme uses 0.3. Simone Tilmes might want this as a namelist variable for easier CESM tuning. dmleung 30 Sep 2024. real(r8), parameter :: Cd0 = 4.4e-5_r8 ! [dimless] proportionality constant in calculation of dust emission coefficient From efbeafc636410a0361054453cc7084f56af73bed Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 30 Sep 2024 18:33:21 -0600 Subject: [PATCH 078/158] Revert change to C96 test; will do later, when ccs_config gets updated --- cime_config/testdefs/testlist_clm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 25bedadb76..34a9caffb5 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -195,7 +195,7 @@ - + From 79811dd9e5af7892aad6f1bac6d3c241c5f23491 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 30 Sep 2024 17:02:50 -0600 Subject: [PATCH 079/158] Add domain check for hillslope file. --- src/main/surfrdMod.F90 | 140 ++++++++++++++++++++++++----------------- 1 file changed, 81 insertions(+), 59 deletions(-) diff --git a/src/main/surfrdMod.F90 b/src/main/surfrdMod.F90 index 88a4dbd30b..af92aea48d 100644 --- a/src/main/surfrdMod.F90 +++ b/src/main/surfrdMod.F90 @@ -45,6 +45,82 @@ module surfrdMod contains + subroutine check_domain_attributes(ncid, begg, endg, ldomain, info) + ! !DESCRIPTION: + ! Checks for mismatches between the land domain and a surface or similar dataset's domain. + ! + ! !USES: + use domainMod, only : domain_type, domain_init + ! + ! !ARGUMENTS + type(file_desc_t), intent(inout) :: ncid ! netcdf id for input file + integer, intent(in) :: begg, endg + type(domain_type), intent(in) :: ldomain ! land domain + character(len=*), intent(in) :: info ! information to include in messages + ! + ! !LOCAL VARIABLES + type(domain_type) :: surfdata_domain ! local domain associated with dataset + logical :: readvar ! true => variable is on dataset + logical :: istype_domain ! true => input file is of type domain + character(len=16) :: lon_var, lat_var ! names of lat/lon on dataset + logical :: isgrid2d ! true => input grid is 2d + integer :: ni, nj, ns ! domain sizes + integer :: n + real(r8) :: rmaxlon, rmaxlat ! local min/max vars + + character(len=32) :: subname = 'check_domain_attributes' ! subroutine name + + call check_var(ncid=ncid, varname='xc', readvar=readvar) + if (readvar) then + istype_domain = .true. + else + call check_var(ncid=ncid, varname='LONGXY', readvar=readvar) + if (readvar) then + istype_domain = .false. + else + call endrun( msg=' ERROR: unknown '//info//' domain type---'//errMsg(sourcefile, __LINE__)) + end if + end if + if (istype_domain) then + lon_var = 'xc' + lat_var = 'yc' + else + lon_var = 'LONGXY' + lat_var = 'LATIXY' + end if + if ( masterproc )then + write(iulog,*) trim(subname),' ',info,' lon_var = ',trim(lon_var),' lat_var =',trim(lat_var) + end if + + call ncd_inqfdims(ncid, isgrid2d, ni, nj, ns) + call domain_init(surfdata_domain, isgrid2d, ni, nj, begg, endg, subgrid_level=grlnd) + + call ncd_io(ncid=ncid, varname=lon_var, flag='read', data=surfdata_domain%lonc, & + dim1name=grlnd, readvar=readvar) + if (.not. readvar) call endrun( msg=' ERROR: lon var NOT on '//info//' dataset---'//errMsg(sourcefile, __LINE__)) + + call ncd_io(ncid=ncid, varname=lat_var, flag='read', data=surfdata_domain%latc, & + dim1name=grlnd, readvar=readvar) + if (.not. readvar) call endrun( msg=' ERROR: lat var NOT on '//info//' dataset---'//errMsg(sourcefile, __LINE__)) + + rmaxlon = 0.0_r8 + rmaxlat = 0.0_r8 + do n = begg,endg + if (ldomain%lonc(n)-surfdata_domain%lonc(n) > 300.) then + rmaxlon = max(rmaxlon,abs(ldomain%lonc(n)-surfdata_domain%lonc(n)-360._r8)) + elseif (ldomain%lonc(n)-surfdata_domain%lonc(n) < -300.) then + rmaxlon = max(rmaxlon,abs(ldomain%lonc(n)-surfdata_domain%lonc(n)+360._r8)) + else + rmaxlon = max(rmaxlon,abs(ldomain%lonc(n)-surfdata_domain%lonc(n))) + endif + rmaxlat = max(rmaxlat,abs(ldomain%latc(n)-surfdata_domain%latc(n))) + enddo + if (rmaxlon > 0.001_r8 .or. rmaxlat > 0.001_r8) then + write(iulog,*)' ERROR: '//info//' dataset vs. land domain lon/lat mismatch error', rmaxlon,rmaxlat + call endrun(msg=errMsg(sourcefile, __LINE__)) + end if + end subroutine check_domain_attributes + !----------------------------------------------------------------------- subroutine surfrd_get_data (begg, endg, ldomain, lfsurdat, lhillslope_file, actual_numcft) ! @@ -76,7 +152,7 @@ subroutine surfrd_get_data (begg, endg, ldomain, lfsurdat, lhillslope_file, actu n_dom_landunits, & use_hillslope use fileutils , only : getfil - use domainMod , only : domain_type, domain_init, domain_clean + use domainMod , only : domain_type use clm_instur , only : wt_lunit, topo_glc_mec, pct_urban_max use landunit_varcon , only : max_lunit, istsoil, isturb_MIN, isturb_MAX use dynSubgridControlMod, only : get_flanduse_timeseries @@ -91,18 +167,10 @@ subroutine surfrd_get_data (begg, endg, ldomain, lfsurdat, lhillslope_file, actu character(len=*), intent(in) :: lhillslope_file ! hillslope dataset filename ! ! !LOCAL VARIABLES: - 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 - integer :: n ! loop indices - integer :: ni,nj,ns ! domain sizes - character(len=16) :: lon_var, lat_var ! names of lat/lon on dataset - logical :: readvar ! true => variable is on dataset - real(r8) :: rmaxlon,rmaxlat ! local min/max vars type(file_desc_t) :: ncid ! netcdf id for lfsurdat type(file_desc_t) :: ncid_hillslope ! netcdf id for lhillslope_file - logical :: istype_domain ! true => input file is of type domain - logical :: isgrid2d ! true => intut grid is 2d character(len=32) :: subname = 'surfrd_get_data' ! subroutine name !----------------------------------------------------------------------- @@ -131,56 +199,10 @@ subroutine surfrd_get_data (begg, endg, ldomain, lfsurdat, lhillslope_file, actu call ncd_pio_openfile (ncid_hillslope, trim(locfn), 0) end if - ! Cmopare surfdat_domain attributes to ldomain attributes - - call check_var(ncid=ncid, varname='xc', readvar=readvar) - if (readvar) then - istype_domain = .true. - else - call check_var(ncid=ncid, varname='LONGXY', readvar=readvar) - if (readvar) then - istype_domain = .false. - else - call endrun( msg=' ERROR: unknown domain type'//errMsg(sourcefile, __LINE__)) - end if - end if - if (istype_domain) then - lon_var = 'xc' - lat_var = 'yc' - else - lon_var = 'LONGXY' - lat_var = 'LATIXY' - end if - if ( masterproc )then - write(iulog,*) trim(subname),' lon_var = ',trim(lon_var),' lat_var =',trim(lat_var) - end if - - call ncd_inqfdims(ncid, isgrid2d, ni, nj, ns) - call domain_init(surfdata_domain, isgrid2d, ni, nj, begg, endg, subgrid_level=grlnd) - - call ncd_io(ncid=ncid, varname=lon_var, flag='read', data=surfdata_domain%lonc, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( msg=' ERROR: lon var NOT on surface dataset'//errMsg(sourcefile, __LINE__)) - - call ncd_io(ncid=ncid, varname=lat_var, flag='read', data=surfdata_domain%latc, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( msg=' ERROR: lat var NOT on surface dataset'//errMsg(sourcefile, __LINE__)) - - rmaxlon = 0.0_r8 - rmaxlat = 0.0_r8 - do n = begg,endg - if (ldomain%lonc(n)-surfdata_domain%lonc(n) > 300.) then - rmaxlon = max(rmaxlon,abs(ldomain%lonc(n)-surfdata_domain%lonc(n)-360._r8)) - elseif (ldomain%lonc(n)-surfdata_domain%lonc(n) < -300.) then - rmaxlon = max(rmaxlon,abs(ldomain%lonc(n)-surfdata_domain%lonc(n)+360._r8)) - else - rmaxlon = max(rmaxlon,abs(ldomain%lonc(n)-surfdata_domain%lonc(n))) - endif - rmaxlat = max(rmaxlat,abs(ldomain%latc(n)-surfdata_domain%latc(n))) - enddo - if (rmaxlon > 0.001_r8 .or. rmaxlat > 0.001_r8) then - write(iulog,*)' ERROR: surfdata_domain/ldomain lon/lat mismatch error', rmaxlon,rmaxlat - call endrun(msg=errMsg(sourcefile, __LINE__)) + ! Compare dataset domain attributes to ldomain attributes + call check_domain_attributes(ncid, begg, endg, ldomain, 'surface') + if (use_hillslope) then + call check_domain_attributes(ncid_hillslope, begg, endg, ldomain, 'hillslope') end if !~! TODO(SPM, 022015) - if we deallocate and clean ldomain here, then you From ea9228c7d8f4259bdf59cda611308989083f3371 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 1 Oct 2024 09:40:56 -0600 Subject: [PATCH 080/158] Update 10x15 hillslope_file (now has LATIXY/LONGXY). --- .../testdefs/testmods_dirs/clm/Hillslope/shell_commands | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands b/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands index 7bec6fd7f6..9cef7eb66f 100644 --- a/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands @@ -4,8 +4,10 @@ DIN_LOC_ROOT=$(./xmlquery --value DIN_LOC_ROOT) # Set hillslope_file. Needed for any grids without default hillslope_file already set by CTSM. lnd_grid=$(./xmlquery --value LND_GRID) if [[ ${lnd_grid} == "10x15" ]]; then - hillslope_file='$DIN_LOC_ROOT/lnd/clm2/testdata/synthetic_cosphill_10x15_1.3.nc' + # Synthetic data + hillslope_file='$DIN_LOC_ROOT/lnd/clm2/testdata/surfdata_10x15_hist_1850_78pfts_c240216.synth_hillslopes_241001.nc' elif [[ ${lnd_grid} == "5x5_amazon" ]]; then + # Real data hillslope_file='/glade/derecho/scratch/samrabin/hillslopes_5x5_amazon/hand_analysis_global/combined/hilldata_5x5_amazon_hist_2000_78pfts_c240216.nc' else echo "ERROR: Hillslope file not found for LND_GRID=${lnd_grid}" >&2 From 4b032be5b4a279723ed840b4be851829cd37ec9c Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 1 Oct 2024 09:59:52 -0600 Subject: [PATCH 081/158] Improve use_init_interp+use_hillslope namelist warning. --- bld/CLMBuildNamelist.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index dc89e932ca..e9a4ff4d56 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -2746,8 +2746,7 @@ SIMYR: foreach my $sim_yr ( @sim_years ) { # this check has to be here and not earlier since use_init_interp is set here and hillslope is already set above in setup_logic_hillslope if ( &value_is_true($nl->get_value($useinitvar)) && value_is_true($nl->get_value("use_hillslope")) ) { - $log->warning("WARNING: You have set use_hillslope while $useinitvar is TRUE.\n This means all hillslope columns in a gridcell will read identical values" . - " from initial conditions. If you are sure you want this behaviour:") + $log->warning("WARNING: You have set use_hillslope while $useinitvar is TRUE.\n This means all hillslope columns in a gridcell will read identical values from initial conditions, even if the initial conditions (finidat) file has hillslope information. If you are sure you want this behaviour, add -ignore_warnings to CLM_BLDNML_OPTS.") } } # end initial conditions From 5c74ff44cb78427c458f429a4c255405e2eb69a9 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 1 Oct 2024 11:19:07 -0600 Subject: [PATCH 082/158] Call domain_clean() at end of check_domain_attributes(). Resolves nag error in hillslope call of check_domain_attributes()---somehow, surfdata_domain was marked as "set" but was uninitialized, causing error in domain_init(). --- src/main/surfrdMod.F90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/surfrdMod.F90 b/src/main/surfrdMod.F90 index 1404ee03f2..bb2a90022c 100644 --- a/src/main/surfrdMod.F90 +++ b/src/main/surfrdMod.F90 @@ -51,7 +51,7 @@ subroutine check_domain_attributes(ncid, begg, endg, ldomain, info) ! Checks for mismatches between the land domain and a surface or similar dataset's domain. ! ! !USES: - use domainMod, only : domain_type, domain_init + use domainMod, only : domain_type, domain_init, domain_clean ! ! !ARGUMENTS type(file_desc_t), intent(inout) :: ncid ! netcdf id for input file @@ -120,6 +120,7 @@ subroutine check_domain_attributes(ncid, begg, endg, ldomain, info) write(iulog,*)' ERROR: '//info//' dataset vs. land domain lon/lat mismatch error', rmaxlon,rmaxlat call endrun(msg=errMsg(sourcefile, __LINE__)) end if + call domain_clean(surfdata_domain) end subroutine check_domain_attributes !----------------------------------------------------------------------- From 1a93690347ba7c1a3c38ccdfc0e77154c94a535b Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 1 Oct 2024 11:21:24 -0600 Subject: [PATCH 083/158] Remove outdated comment/TODO. --- src/main/surfrdMod.F90 | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/main/surfrdMod.F90 b/src/main/surfrdMod.F90 index bb2a90022c..59094ac1f3 100644 --- a/src/main/surfrdMod.F90 +++ b/src/main/surfrdMod.F90 @@ -271,11 +271,6 @@ subroutine surfrd_get_data (begg, endg, ldomain, lfsurdat, lhillslope_file, actu call check_domain_attributes(ncid_hillslope, begg, endg, ldomain, 'hillslope') end if - !~! TODO(SPM, 022015) - if we deallocate and clean ldomain here, then you - !~! get errors in htape_timeconst where the information is needed to write - !~! the *.h0* file - !~!call domain_clean(surfdata_domain) - ! Obtain special landunit info call surfrd_special(begg, endg, ncid, ldomain%ns) From 5e71b7d92588d345ec8016e76f6d24f4b3271664 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 1 Oct 2024 11:22:20 -0600 Subject: [PATCH 084/158] Rename surfdata_domain to inputdata_domain. More general to reflect that it's not necessarily the surface dataset's domain. --- src/main/surfrdMod.F90 | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/surfrdMod.F90 b/src/main/surfrdMod.F90 index 59094ac1f3..4005ec7845 100644 --- a/src/main/surfrdMod.F90 +++ b/src/main/surfrdMod.F90 @@ -60,7 +60,7 @@ subroutine check_domain_attributes(ncid, begg, endg, ldomain, info) character(len=*), intent(in) :: info ! information to include in messages ! ! !LOCAL VARIABLES - type(domain_type) :: surfdata_domain ! local domain associated with dataset + type(domain_type) :: inputdata_domain ! local domain associated with input dataset logical :: readvar ! true => variable is on dataset logical :: istype_domain ! true => input file is of type domain character(len=16) :: lon_var, lat_var ! names of lat/lon on dataset @@ -94,33 +94,33 @@ subroutine check_domain_attributes(ncid, begg, endg, ldomain, info) end if call ncd_inqfdims(ncid, isgrid2d, ni, nj, ns) - call domain_init(surfdata_domain, isgrid2d, ni, nj, begg, endg, subgrid_level=grlnd) + call domain_init(inputdata_domain, isgrid2d, ni, nj, begg, endg, subgrid_level=grlnd) - call ncd_io(ncid=ncid, varname=lon_var, flag='read', data=surfdata_domain%lonc, & + call ncd_io(ncid=ncid, varname=lon_var, flag='read', data=inputdata_domain%lonc, & dim1name=grlnd, readvar=readvar) if (.not. readvar) call endrun( msg=' ERROR: lon var NOT on '//info//' dataset---'//errMsg(sourcefile, __LINE__)) - call ncd_io(ncid=ncid, varname=lat_var, flag='read', data=surfdata_domain%latc, & + call ncd_io(ncid=ncid, varname=lat_var, flag='read', data=inputdata_domain%latc, & dim1name=grlnd, readvar=readvar) if (.not. readvar) call endrun( msg=' ERROR: lat var NOT on '//info//' dataset---'//errMsg(sourcefile, __LINE__)) rmaxlon = 0.0_r8 rmaxlat = 0.0_r8 do n = begg,endg - if (ldomain%lonc(n)-surfdata_domain%lonc(n) > 300.) then - rmaxlon = max(rmaxlon,abs(ldomain%lonc(n)-surfdata_domain%lonc(n)-360._r8)) - elseif (ldomain%lonc(n)-surfdata_domain%lonc(n) < -300.) then - rmaxlon = max(rmaxlon,abs(ldomain%lonc(n)-surfdata_domain%lonc(n)+360._r8)) + if (ldomain%lonc(n)-inputdata_domain%lonc(n) > 300.) then + rmaxlon = max(rmaxlon,abs(ldomain%lonc(n)-inputdata_domain%lonc(n)-360._r8)) + elseif (ldomain%lonc(n)-inputdata_domain%lonc(n) < -300.) then + rmaxlon = max(rmaxlon,abs(ldomain%lonc(n)-inputdata_domain%lonc(n)+360._r8)) else - rmaxlon = max(rmaxlon,abs(ldomain%lonc(n)-surfdata_domain%lonc(n))) + rmaxlon = max(rmaxlon,abs(ldomain%lonc(n)-inputdata_domain%lonc(n))) endif - rmaxlat = max(rmaxlat,abs(ldomain%latc(n)-surfdata_domain%latc(n))) + rmaxlat = max(rmaxlat,abs(ldomain%latc(n)-inputdata_domain%latc(n))) enddo if (rmaxlon > 0.001_r8 .or. rmaxlat > 0.001_r8) then write(iulog,*)' ERROR: '//info//' dataset vs. land domain lon/lat mismatch error', rmaxlon,rmaxlat call endrun(msg=errMsg(sourcefile, __LINE__)) end if - call domain_clean(surfdata_domain) + call domain_clean(inputdata_domain) end subroutine check_domain_attributes !----------------------------------------------------------------------- From 3295adb9ac0e40f48b20a5c6c9d0b9c02d58351d Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 1 Oct 2024 14:42:06 -0600 Subject: [PATCH 085/158] Correct the name of the hash to use in the checks that hash values are all set in fail, warn, and finidat tests --- bld/unit_testers/build-namelist_test.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 421bf81b5e..096409065f 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -1376,7 +1376,7 @@ sub cat_and_create_namelistinfile { my $var; foreach $var ( "phys" , "options", "namelst" ) { - if ( not exists $failtest{$key}{$var} ) { + if ( not exists $warntest{$key}{$var} ) { die "ERROR: Subkey $var does not exist for warntest $key\nERROR:Check if you spelled $var correctly\n" } } @@ -1613,7 +1613,7 @@ sub cat_and_create_namelistinfile { my $var; foreach $var ( "phys" , "atm_forc", "res", "bgc", "crop", "use_case", "start_ymd", "namelist" ) { - if ( not exists $failtest{$key}{$var} ) { + if ( not exists $finidat_files{$key}{$var} ) { die "ERROR: Subkey $var does not exist for finidat_file $key\nERROR:Check if you spelled $var correctly\n" } } From 6c352166d3e7a4f0909ba24d8f338a55ecf98622 Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Tue, 1 Oct 2024 16:51:00 -0600 Subject: [PATCH 086/158] dmleung changed the values of the tuning parameters and added a new tuning factor for vegetation drag partition effect. Also a first attempt to modify the code for soil moisture effect on dust to avoid having a factor that changes the answer of Zender's dust emissions. --- src/biogeochem/DustEmisLeung2023.F90 | 9 +++++---- src/biogeophys/SoilStateInitTimeConstMod.F90 | 19 ++++++++++++++----- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/biogeochem/DustEmisLeung2023.F90 b/src/biogeochem/DustEmisLeung2023.F90 index 31f827faaf..3b250aa003 100644 --- a/src/biogeochem/DustEmisLeung2023.F90 +++ b/src/biogeochem/DustEmisLeung2023.F90 @@ -387,7 +387,7 @@ subroutine DustEmission (this, bounds, & ! ! constants ! - real(r8), parameter :: vai_mbl_thr = 0.5_r8 ! [m2 m-2] new VAI threshold; Danny M. Leung suggests something between 0.6 and 1 for tuning. Zender's scheme uses 0.3. Simone Tilmes might want this as a namelist variable for easier CESM tuning. dmleung 30 Sep 2024. + real(r8), parameter :: vai_mbl_thr = 0.6_r8 ! [m2 m-2] new VAI threshold; Danny M. Leung suggests something between 0.6 and 1 for tuning. Zender's scheme uses 0.3. Simone Tilmes might want this as a namelist variable for easier CESM tuning. dmleung 30 Sep 2024. real(r8), parameter :: Cd0 = 4.4e-5_r8 ! [dimless] proportionality constant in calculation of dust emission coefficient real(r8), parameter :: Ca = 2.7_r8 ! [dimless] proportionality constant in scaling of dust emission exponent @@ -403,11 +403,12 @@ subroutine DustEmission (this, bounds, & real(r8), parameter :: D_p = 130e-6_r8 ! [m] Medium soil particle diameter, assuming a global constant of ~130 um following Leung et al. (2023). dmleung 16 Feb 2024 real(r8), parameter :: gamma_Shao = 1.65e-4_r8 ! [kg s-2] interparticle cohesion: fitting parameter in Shao and Lu (2000) (S&L00). dmleung 16 Feb 2024 real(r8), parameter :: A_Shao = 0.0123_r8 ! [dimless] coefficient for aerodynamic force: fitting parameter in Shao and Lu (2000). dmleung 16 Feb 2024 - real(r8), parameter :: frag_expt_thr = 2.5_r8 ! [dimless] Maximum value or threshold for fragmentation exponent defined in Leung et al. (2023). Danny M. Leung suggested it to be somewhere between 3 and 5 for tuning. It is used to prevent a local AOD blowup (over Patagonia, Argentina), but one can test larger values and relax the threshold if wanted. dmleung 16 Feb 2024. Update: Simone Tilmes might want this as a namelist variable for easier CESM tuning. 30 Sep 2024. + real(r8), parameter :: frag_expt_thr = 3.0_r8 ! [dimless] Maximum value or threshold for fragmentation exponent defined in Leung et al. (2023). Danny M. Leung suggested it to be somewhere between 3 and 5 for tuning. It is used to prevent a local AOD blowup (over Patagonia, Argentina), but one can test larger values and relax the threshold if wanted. dmleung 16 Feb 2024. Update: Simone Tilmes might want this as a namelist variable for easier CESM tuning. 30 Sep 2024. real(r8), parameter :: z0a_glob = 1e-4_r8 ! [m] assumed globally constant aeolian roughness length value in Leung et al. (2023), for the log law of the wall for Comola et al. (2019) intermittency scheme. dmleung 20 Feb 2024 real(r8), parameter :: hgt_sal = 0.1_r8 ! [m] saltation height used by Comola et al. (2019) intermittency scheme for the log law of the wall. dmleung 20 Feb 2024 real(r8), parameter :: vai0_Okin = 0.1_r8 ! [m2/m2] minimum VAI needed for Okin-Pierre's vegetation drag partition equation. lai=0 in the equation will lead to infinity, so a small value is added into this lai dmleung defined. real(r8), parameter :: zii = 1000.0_r8 ! [m] convective boundary layer height added by dmleung 20 Feb 2024, following other CTSM modules (e.g., CanopyFluxesMod). Should we transfer PBL height (PBLH) from CAM? + real(r8), parameter :: dust_veg_part_fact = 0.7_r8 ! [dimless] dmleung added a tuning factor for Greg Okin's vegetation drag partition effect. dmleung suggested a smaller vegetation drag partition effect given an increase in vegetation roughness after CTSM switched from using ZengWang2007 to Meier2022. This is simply because the drag partition effect should decrease with increasing roughness, but Okin's scheme is only a function of LAI. One might want to change this factor to 1_r8 when using ZengWang2007. dmleung 30 Sep 2024 real(r8) :: numer ! Numerator term for threshold crossing rate real(r8) :: denom ! Denominator term for threshold crossing rate !------------------------------------------------------------------------ @@ -646,8 +647,8 @@ subroutine DustEmission (this, bounds, & ! calculate Okin's shear stress ratio (SSR, which is vegetation drag partition factor) using Pierre's equation - K_length = 2.0_r8 * (1.0_r8/vai_Okin(p) - 1.0_r8) ! Here LAI has to be non-zero to avoid blowup, and < 1 to avoid -ve K_length. See this equation in Leung et al. (2023). This line is Okin's formulation - ssr(p) = (K_length+f_0*c_e)/(K_length+c_e) ! see this equation in Caroline Pierre et al. (2014) or Leung et al. (2023). This line is Pierre's formulation. + K_length = 2.0_r8 * (1.0_r8/vai_Okin(p) - 1.0_r8) ! Here VAI has to be non-zero to avoid blowup, and < 1 to avoid -ve K_length. See this equation in Leung et al. (2023). This line is Okin's formulation + ssr(p) = dust_veg_part_fact * (K_length+f_0*c_e)/(K_length+c_e) ! see this equation in Caroline Pierre et al. (2014) or Leung et al. (2023). This line is Pierre's formulation. dmleung added a tuning factor for Okin's vegetation drag partition effect (SSR) on 30 Sep 2024. ! calculation of the hybrid/total drag partition effect considering both rock and vegetation drag partitioning using LUH2 bare and veg fractions within a grid if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then diff --git a/src/biogeophys/SoilStateInitTimeConstMod.F90 b/src/biogeophys/SoilStateInitTimeConstMod.F90 index fc542075fe..3bd280761f 100644 --- a/src/biogeophys/SoilStateInitTimeConstMod.F90 +++ b/src/biogeophys/SoilStateInitTimeConstMod.F90 @@ -220,6 +220,7 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) real(r8) :: perturbed_sand ! temporary for paramfile implementation of +/- sand percentage real(r8) :: residual_clay_frac ! temporary for paramfile implementation of +/- residual clay percentage real(r8) :: perturbed_residual_clay_frac ! temporary for paramfile implementation of +/- residual clay percentage + real(r8) :: dust_moist_fact ! tuning factor for soil moisture effect on limiting dust emissions, used by Charlie Zender. Simone Tilmes suggested to change this parameter into a namelist variable for easier CESM tuning. dmleung added 30 Sep 2024 integer :: dimid ! dimension id logical :: readvar type(file_desc_t) :: ncid ! netcdf id @@ -708,16 +709,24 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) ! Initialize threshold soil moisture, and mass fraction of clay as ! scaling coefficient of dust emission flux (kg/m2/s) in each DustEmisType ! module. See the comments in each function. + ! Zender suggested that threshold soil moisture is tunable (see comment + ! inside ThresholdSoilMoistZender2003). dmleung further add dust_moist_fact + ! ofr modelers to tune the threshold soil moisture. The resulting tuning + ! factor is thus a = dust_moist_fact / (clay3d). dmleung 30 Sep 2024 ! -------------------------------------------------------------------- do c = begc,endc g = col%gridcell(c) - soilstate_inst%gwc_thr_col(c) = ThresholdSoilMoistZender2003( clay3d(g,1) ) + !soilstate_inst%gwc_thr_col(c) = ThresholdSoilMoistZender2003( clay3d(g,1) ) if ( is_dust_emis_leung() )then soilstate_inst%mss_frc_cly_vld_col(c) = MassFracClayLeung2023( clay3d(g,1) ) + dust_moist_fact = 0.9_r8 ! change this into a namelist variable later. + soilstate_inst%gwc_thr_col(c) = dust_moist_fact * ThresholdSoilMoistZender2003( clay3d(g,1) ) else soilstate_inst%mss_frc_cly_vld_col(c) = MassFracClay( clay3d(g,1) ) + dust_moist_fact = 1.0_r8 + soilstate_inst%gwc_thr_col(c) = dust_moist_fact * ThresholdSoilMoistZender2003( clay3d(g,1) ) end if end do @@ -739,9 +748,11 @@ real(r8) function ThresholdSoilMoistZender2003( clay ) ! Calculate the threshold gravimetric water content needed for dust emission, based on clay content ! This was the original equation with a = 1 / (%clay) being the tuning factor for soil ! moisture effect in Zender's 2003 dust emission scheme (only for top layer). + ! dmleung further added dust_moist_fact for more flexibility in tuning, so the tuning factor here + ! is a = dust_moist_fact / (%clay). dmleung added dust_moist_fact on 30 Sep 2024. ! ! 0.17 and 0.14 are fitting coefficients in Fecan et al. (1999), and 0.01 is used to - ! convert surface clay fraction from percentage to fraction. + ! convert surface clay from percentage to fraction. ! The equation comes from Eq. 14 of Fecan et al. (1999; https://doi.org/10.1007/s00585-999-0149-7). ! ! NOTE: dmleung 19 Feb 2024. @@ -765,14 +776,12 @@ real(r8) function ThresholdSoilMoistZender2003( clay ) !------------------------------------------------------------------------------ real(r8), intent(IN) :: clay ! Fraction of clay in the soil (%) - real(r8), parameter :: a = 0.5_r8 ! Tuning factor for the soil moisture effect. This parameter could also be added into ThresholdSoilMoistKok2014. Simone Tilmes suggested to change this parameter into a namelist variable for easier CESM tuning. dmleung 30 Sep 2024. - if ( clay < 0.0_r8 .or. clay > 100.0_r8 )then ThresholdSoilMoistZender2003 = nan call endrun( 'Clay fraction is out of bounds (0 to 100)') return end if - ThresholdSoilMoistZender2003 = a * ( 0.17_r8 + 0.14_r8 * (clay*0.01_r8) ) + ThresholdSoilMoistZender2003 = 0.17_r8 + 0.14_r8 * (clay*0.01_r8) end function ThresholdSoilMoistZender2003 !------------------------------------------------------------------------------ From f2f75351febd4a413b0788dae256443fe5734510 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Tue, 1 Oct 2024 15:53:22 -0700 Subject: [PATCH 087/158] add shell call to generate fates hydro parameter file on the fly This is a temporary update to avoid NGEET/fates#1254 and should be removed once a fix comes in on the fates-side. --- .../testmods_dirs/clm/FatesColdHydro/shell_commands | 8 ++++++++ .../testdefs/testmods_dirs/clm/FatesColdHydro/user_nl_clm | 1 + 2 files changed, 9 insertions(+) create mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdHydro/shell_commands diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdHydro/shell_commands b/cime_config/testdefs/testmods_dirs/clm/FatesColdHydro/shell_commands new file mode 100644 index 0000000000..e629e7ca34 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdHydro/shell_commands @@ -0,0 +1,8 @@ +SRCDIR=`./xmlquery SRCROOT --value` +CASEDIR=`./xmlquery CASEROOT --value` +FATESDIR=$SRCDIR/src/fates +FATESPARAMFILE=$CASEDIR/fates_params_hydrograsstempfix.nc + +ncgen -o $FATESPARAMFILE $FATESDIR/parameter_files/fates_params_default.cdl + +$FATESDIR/tools/modify_fates_paramfile.py --O --fin $FATESPARAMFILE --fout $FATESPARAMFILE --var fates_allom_smode --val 1 --allpfts diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdHydro/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdHydro/user_nl_clm index f0bdb388eb..15dcf6de1a 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdHydro/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdHydro/user_nl_clm @@ -2,6 +2,7 @@ hist_mfilt = 365 hist_nhtfrq = -24 hist_empty_htapes = .true. use_fates_planthydro= .true. +fates_paramfile = '$CASEROOT/fates_params_hydrograsstempfix.n' hist_fincl1 = 'FATES_ERRH2O_SZPF', 'FATES_TRAN_SZPF', 'FATES_SAPFLOW_SZPF', 'FATES_ITERH1_SZPF','FATES_ABSROOT_H2O_SZPF', 'FATES_TRANSROOT_H2O_SZPF','FATES_STEM_H2O_SZPF','FATES_LEAF_H2O_SZPF', From 52e5801fd9ffe8dfa309c63edd695c08d7630e31 Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Tue, 1 Oct 2024 17:10:57 -0600 Subject: [PATCH 088/158] dmleung renamed the tuning parameter for Okin's vegetation drag partition factor to dust_veg_drag_fact from dust_veg_part_fact. 1 Oct 2024 --- src/biogeochem/DustEmisLeung2023.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/biogeochem/DustEmisLeung2023.F90 b/src/biogeochem/DustEmisLeung2023.F90 index 3b250aa003..0fee001e64 100644 --- a/src/biogeochem/DustEmisLeung2023.F90 +++ b/src/biogeochem/DustEmisLeung2023.F90 @@ -408,7 +408,7 @@ subroutine DustEmission (this, bounds, & real(r8), parameter :: hgt_sal = 0.1_r8 ! [m] saltation height used by Comola et al. (2019) intermittency scheme for the log law of the wall. dmleung 20 Feb 2024 real(r8), parameter :: vai0_Okin = 0.1_r8 ! [m2/m2] minimum VAI needed for Okin-Pierre's vegetation drag partition equation. lai=0 in the equation will lead to infinity, so a small value is added into this lai dmleung defined. real(r8), parameter :: zii = 1000.0_r8 ! [m] convective boundary layer height added by dmleung 20 Feb 2024, following other CTSM modules (e.g., CanopyFluxesMod). Should we transfer PBL height (PBLH) from CAM? - real(r8), parameter :: dust_veg_part_fact = 0.7_r8 ! [dimless] dmleung added a tuning factor for Greg Okin's vegetation drag partition effect. dmleung suggested a smaller vegetation drag partition effect given an increase in vegetation roughness after CTSM switched from using ZengWang2007 to Meier2022. This is simply because the drag partition effect should decrease with increasing roughness, but Okin's scheme is only a function of LAI. One might want to change this factor to 1_r8 when using ZengWang2007. dmleung 30 Sep 2024 + real(r8), parameter :: dust_veg_drag_fact = 0.7_r8 ! [dimless] dmleung added a tuning factor for Greg Okin's vegetation drag partition effect. dmleung suggested a smaller vegetation drag partition effect given an increase in vegetation roughness after CTSM switched from using ZengWang2007 to Meier2022. This is simply because the drag partition effect should decrease with increasing roughness, but Okin's scheme is only a function of LAI. One might want to change this factor to 1_r8 when using ZengWang2007. dmleung 30 Sep 2024 real(r8) :: numer ! Numerator term for threshold crossing rate real(r8) :: denom ! Denominator term for threshold crossing rate !------------------------------------------------------------------------ @@ -648,7 +648,7 @@ subroutine DustEmission (this, bounds, & ! calculate Okin's shear stress ratio (SSR, which is vegetation drag partition factor) using Pierre's equation K_length = 2.0_r8 * (1.0_r8/vai_Okin(p) - 1.0_r8) ! Here VAI has to be non-zero to avoid blowup, and < 1 to avoid -ve K_length. See this equation in Leung et al. (2023). This line is Okin's formulation - ssr(p) = dust_veg_part_fact * (K_length+f_0*c_e)/(K_length+c_e) ! see this equation in Caroline Pierre et al. (2014) or Leung et al. (2023). This line is Pierre's formulation. dmleung added a tuning factor for Okin's vegetation drag partition effect (SSR) on 30 Sep 2024. + ssr(p) = dust_veg_drag_fact * (K_length+f_0*c_e)/(K_length+c_e) ! see this equation in Caroline Pierre et al. (2014) or Leung et al. (2023). This line is Pierre's formulation. dmleung added a tuning factor for Okin's vegetation drag partition effect (SSR) on 30 Sep 2024. ! calculation of the hybrid/total drag partition effect considering both rock and vegetation drag partitioning using LUH2 bare and veg fractions within a grid if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then From 97d1657754c75fedd6482d4d71b773859029be5d Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Tue, 1 Oct 2024 16:11:33 -0700 Subject: [PATCH 089/158] fix typo in fates hydro user_nl_clm --- .../testdefs/testmods_dirs/clm/FatesColdHydro/user_nl_clm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdHydro/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdHydro/user_nl_clm index 15dcf6de1a..318a34dfec 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdHydro/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdHydro/user_nl_clm @@ -2,7 +2,7 @@ hist_mfilt = 365 hist_nhtfrq = -24 hist_empty_htapes = .true. use_fates_planthydro= .true. -fates_paramfile = '$CASEROOT/fates_params_hydrograsstempfix.n' +fates_paramfile = '$CASEROOT/fates_params_hydrograsstempfix.nc' hist_fincl1 = 'FATES_ERRH2O_SZPF', 'FATES_TRAN_SZPF', 'FATES_SAPFLOW_SZPF', 'FATES_ITERH1_SZPF','FATES_ABSROOT_H2O_SZPF', 'FATES_TRANSROOT_H2O_SZPF','FATES_STEM_H2O_SZPF','FATES_LEAF_H2O_SZPF', From 52389c01d69b6943ffec8d547dfe2379c71188d5 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Wed, 2 Oct 2024 14:12:45 -0700 Subject: [PATCH 090/158] correct call typo to clm_demand for fateslanduse test mod --- .../testdefs/testmods_dirs/clm/FatesColdLandUse/shell_commands | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/shell_commands b/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/shell_commands index d88457df12..6152f0bd0c 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/shell_commands @@ -1,3 +1,3 @@ #!/bin/bash -./xmlchange CLM_BLDNML_OPTS="--clm_demand -flanduse_timeseries" --append +./xmlchange CLM_BLDNML_OPTS="-clm_demand flanduse_timeseries" --append From 69b815b3885f8ff9d5932d072713f143774b4ecd Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Wed, 2 Oct 2024 16:13:44 -0700 Subject: [PATCH 091/158] update default fates parameter files This update incorporates multiple parameter file updates per NGEET/fates#1255 --- bld/namelist_files/namelist_defaults_ctsm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index bc4a93ec4a..63b4ee9576 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -560,7 +560,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/fates_params_api.36.1.0_12pft_c240814.nc +lnd/clm2/paramdata/fates_params_api.36.1.0_14pft_c241002.nc From 4e0197bd3e4911413745feb6aec6e889f294834a Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Wed, 2 Oct 2024 16:21:36 -0700 Subject: [PATCH 092/158] update the gitmodules tag for fates --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 7274b9acd2..1f6da08484 100644 --- a/.gitmodules +++ b/.gitmodules @@ -28,7 +28,7 @@ [submodule "fates"] path = src/fates url = https://github.com/NGEET/fates -fxtag = sci.1.78.2_api.36.0.0 +fxtag = sci.1.78.3_api.36.1.0 fxrequired = AlwaysRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/NCAR/fates-release From 1f851c46371256fb38a0247ccde8981fb77e6ea6 Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Wed, 2 Oct 2024 18:07:11 -0600 Subject: [PATCH 093/158] Getting a new set of tuning parameters for dust. dmleung 2 Oct 2024 --- src/biogeochem/DustEmisLeung2023.F90 | 2 +- src/biogeophys/SoilStateInitTimeConstMod.F90 | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/biogeochem/DustEmisLeung2023.F90 b/src/biogeochem/DustEmisLeung2023.F90 index 0fee001e64..e9306029be 100644 --- a/src/biogeochem/DustEmisLeung2023.F90 +++ b/src/biogeochem/DustEmisLeung2023.F90 @@ -403,7 +403,7 @@ subroutine DustEmission (this, bounds, & real(r8), parameter :: D_p = 130e-6_r8 ! [m] Medium soil particle diameter, assuming a global constant of ~130 um following Leung et al. (2023). dmleung 16 Feb 2024 real(r8), parameter :: gamma_Shao = 1.65e-4_r8 ! [kg s-2] interparticle cohesion: fitting parameter in Shao and Lu (2000) (S&L00). dmleung 16 Feb 2024 real(r8), parameter :: A_Shao = 0.0123_r8 ! [dimless] coefficient for aerodynamic force: fitting parameter in Shao and Lu (2000). dmleung 16 Feb 2024 - real(r8), parameter :: frag_expt_thr = 3.0_r8 ! [dimless] Maximum value or threshold for fragmentation exponent defined in Leung et al. (2023). Danny M. Leung suggested it to be somewhere between 3 and 5 for tuning. It is used to prevent a local AOD blowup (over Patagonia, Argentina), but one can test larger values and relax the threshold if wanted. dmleung 16 Feb 2024. Update: Simone Tilmes might want this as a namelist variable for easier CESM tuning. 30 Sep 2024. + real(r8), parameter :: frag_expt_thr = 2.5_r8 ! [dimless] Maximum value or threshold for fragmentation exponent defined in Leung et al. (2023). Danny M. Leung suggested it to be somewhere between 3 and 5 for tuning. It is used to prevent a local AOD blowup (over Patagonia, Argentina), but one can test larger values and relax the threshold if wanted. dmleung 16 Feb 2024. Update: Simone Tilmes might want this as a namelist variable for easier CESM tuning. 30 Sep 2024. real(r8), parameter :: z0a_glob = 1e-4_r8 ! [m] assumed globally constant aeolian roughness length value in Leung et al. (2023), for the log law of the wall for Comola et al. (2019) intermittency scheme. dmleung 20 Feb 2024 real(r8), parameter :: hgt_sal = 0.1_r8 ! [m] saltation height used by Comola et al. (2019) intermittency scheme for the log law of the wall. dmleung 20 Feb 2024 real(r8), parameter :: vai0_Okin = 0.1_r8 ! [m2/m2] minimum VAI needed for Okin-Pierre's vegetation drag partition equation. lai=0 in the equation will lead to infinity, so a small value is added into this lai dmleung defined. diff --git a/src/biogeophys/SoilStateInitTimeConstMod.F90 b/src/biogeophys/SoilStateInitTimeConstMod.F90 index 3bd280761f..38076d8327 100644 --- a/src/biogeophys/SoilStateInitTimeConstMod.F90 +++ b/src/biogeophys/SoilStateInitTimeConstMod.F90 @@ -721,7 +721,8 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) !soilstate_inst%gwc_thr_col(c) = ThresholdSoilMoistZender2003( clay3d(g,1) ) if ( is_dust_emis_leung() )then soilstate_inst%mss_frc_cly_vld_col(c) = MassFracClayLeung2023( clay3d(g,1) ) - dust_moist_fact = 0.9_r8 ! change this into a namelist variable later. + !dust_moist_fact = 0.9_r8 ! change this into a namelist variable later. + dust_moist_fact = 1.0_r8 ! change this into a namelist variable later. soilstate_inst%gwc_thr_col(c) = dust_moist_fact * ThresholdSoilMoistZender2003( clay3d(g,1) ) else soilstate_inst%mss_frc_cly_vld_col(c) = MassFracClay( clay3d(g,1) ) From 65d26e68b9121ed3205e8012ea44098815acce79 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 3 Oct 2024 09:02:07 -0700 Subject: [PATCH 094/158] add expected failure for FatesColdLandUse test mod This is due to needing a new 16 pft historical flanduse_timeseries file. See #2810. Note this is the older fates harvest mode, not the newer raw LUH2 driven modes. --- cime_config/testdefs/ExpectedTestFails.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 30b19ce862..7b17d5743b 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -280,6 +280,13 @@ + + + FAIL + #2810 + + + From 1045e1ba7492381186bb1c7092c13a1c04cefdd3 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 3 Oct 2024 09:50:53 -0700 Subject: [PATCH 095/158] add new changelog entry --- doc/ChangeLog | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 2 ++ 2 files changed, 89 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index ded12c54f8..99611540cb 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,91 @@ =============================================================== +Tag name: ctsm5.3.003 +Originator(s): rgknox (Ryan Knox, LBNL, rgknox@lbl.gov) + glemieux (Gregory Lemieux, LBNL, glemieux@lbl.gov) +Date: Thu Oct 3 10:20:00 MDT 2024 +One-line Summary: FATES default parameter file update + +Purpose and description of changes +---------------------------------- + +This tag updates the default parameter file for FATES bringing in a number of updates: + - adds two new arctic shrub pfts + - updates the default sapwood allometry mode for grass pfts + - updates understory leaf turnover specifications for longer turnover rates + - changes the default behavior of nutrient uptake + +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.] + +[ ] clm6_0 + +[ ] clm5_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- +List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: + Fixes #2783 -- Error in FatescoldLandUse testmod + Fixes FATES#1211 -- Switching the default fates_cnp_prescribed_* parameters from 1 to 0 + +Notes of particular relevance for developers: +--------------------------------------------- +Changes to tests or testing: + FatesColdLandUse build has been added to the list of expected failures due to #2810 + +Testing summary: +---------------- + + [PASS means all tests PASS; OK means tests PASS other than expected fails.] + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + derecho ----- OK + izumi ------- + + fates tests: (give name of baseline if different from CTSM tagname, normally fates baselines are fates--) + derecho ----- OK + izumi ------- + +Answer changes +-------------- + +Changes answers relative to baseline: + + Summarize any changes to answers, i.e., + - what code configurations: FATES mode + - what platforms/compilers: ALL + - nature of change (roundoff; larger than roundoff/same climate; new climate): larger than roundoff + +Other details +------------- +List any git submodules updated (cime, rtm, mosart, cism, fates, etc.): + fates: sci.1.78.2_api.36.0.0 -> sci.1.78.3_api.36.1.0 + +Pull Requests that document the changes (include PR ids): + https://github.com/ESCOMP/CTSM/pull/2700 + https://github.com/NGEET/fates/pull/1255 + +=============================================================== +=============================================================== +Tag name: ctsm5.3.002 +Originator(s): slevis (Samuel Levis,UCAR/TSS,303-665-1310) +Date: Thu 26 Sep 2024 03:10:40 PM MDT +One-line Summary: Duplicate tag of ctsm5.3.001 + +=============================================================== +=============================================================== Tag name: ctsm5.3.001 Originator(s): slevis (Samuel Levis,UCAR/TSS,303-665-1310) Date: Thu 26 Sep 2024 03:10:40 PM MDT diff --git a/doc/ChangeSum b/doc/ChangeSum index 1014612b40..14c8b10465 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,7 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.3.003 multiple 10/03/2024 FATES default parameter file update + ctsm5.3.002 multiple 09/26/2024 Duplicate tag (same as 5.3.001) ctsm5.3.001 multiple 09/26/2024 Merge b4b-dev ctsm5.3.0 multiple 09/24/2024 Update surface datasets, CN Matrix, CLM60: excess ice on, explicit A/C on, crop calendars, Sturm snow, Leung dust emissions, prigent roughness data ctsm5.2.029 multiple 09/24/2024 New surface datasets: double tag of ctsm5.3.0 From 9abbb70d24d421e21f24b092fcac90e663e65ade Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 3 Oct 2024 13:20:11 -0700 Subject: [PATCH 096/158] minor changelog update --- doc/ChangeLog | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 99611540cb..7c84572c58 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -2,17 +2,17 @@ Tag name: ctsm5.3.003 Originator(s): rgknox (Ryan Knox, LBNL, rgknox@lbl.gov) glemieux (Gregory Lemieux, LBNL, glemieux@lbl.gov) -Date: Thu Oct 3 10:20:00 MDT 2024 +Date: Thu Oct 03 10:20:00 MDT 2024 One-line Summary: FATES default parameter file update Purpose and description of changes ---------------------------------- This tag updates the default parameter file for FATES bringing in a number of updates: - - adds two new arctic shrub pfts - - updates the default sapwood allometry mode for grass pfts - - updates understory leaf turnover specifications for longer turnover rates - - changes the default behavior of nutrient uptake + - adds two new arctic shrub pfts + - updates the default sapwood allometry mode for grass pfts + - updates understory leaf turnover specifications for longer turnover rates + - changes the default behavior of nutrient uptake Significant changes to scientifically-supported configurations -------------------------------------------------------------- From b12f6ff78df69f864f4611f56de27db05c55a674 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 3 Oct 2024 13:20:46 -0700 Subject: [PATCH 097/158] update filename --- bld/namelist_files/namelist_defaults_ctsm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 63b4ee9576..34910ec900 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -560,7 +560,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/fates_params_api.36.1.0_14pft_c241002.nc +lnd/clm2/paramdata/fates_params_api.36.1.0_14pft_c241003.nc From b9fde417b86b083a38500061e1275a2749cff395 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Fri, 4 Oct 2024 15:02:25 -0700 Subject: [PATCH 098/158] update fates tag to api36.1 --- src/fates | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fates b/src/fates index e06e0dfcaf..825579d0b4 160000 --- a/src/fates +++ b/src/fates @@ -1 +1 @@ -Subproject commit e06e0dfcaf6347993d47dc29944e952d3e4412f7 +Subproject commit 825579d0b406fe99344591b5ed8356e5c7aeebec From c3ddc480785d513d05390f655df3ec587c3642d4 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Mon, 7 Oct 2024 09:31:43 -0700 Subject: [PATCH 099/158] update testing results for ctsm5.3.003 --- doc/ChangeLog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 7c84572c58..d8b2290f38 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -52,11 +52,11 @@ Testing summary: regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): derecho ----- OK - izumi ------- + izumi ------- OK fates tests: (give name of baseline if different from CTSM tagname, normally fates baselines are fates--) derecho ----- OK - izumi ------- + izumi ------- OK Answer changes -------------- From 29f9ac85b258c0731b4361e8d8ebced17db8b345 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Mon, 7 Oct 2024 09:34:27 -0700 Subject: [PATCH 100/158] update changelog and changesum date/time for ctsm5.3.003 --- doc/ChangeLog | 2 +- doc/ChangeSum | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index d8b2290f38..8e76002a92 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -2,7 +2,7 @@ Tag name: ctsm5.3.003 Originator(s): rgknox (Ryan Knox, LBNL, rgknox@lbl.gov) glemieux (Gregory Lemieux, LBNL, glemieux@lbl.gov) -Date: Thu Oct 03 10:20:00 MDT 2024 +Date: Mon Oct 07 10:33:14 AM MDT 2024 One-line Summary: FATES default parameter file update Purpose and description of changes diff --git a/doc/ChangeSum b/doc/ChangeSum index 14c8b10465..c16940615b 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,6 +1,6 @@ Tag Who Date Summary ============================================================================================================================ - ctsm5.3.003 multiple 10/03/2024 FATES default parameter file update + ctsm5.3.003 multiple 10/07/2024 FATES default parameter file update ctsm5.3.002 multiple 09/26/2024 Duplicate tag (same as 5.3.001) ctsm5.3.001 multiple 09/26/2024 Merge b4b-dev ctsm5.3.0 multiple 09/24/2024 Update surface datasets, CN Matrix, CLM60: excess ice on, explicit A/C on, crop calendars, Sturm snow, Leung dust emissions, prigent roughness data From 1fbe88ab0bf5da4112f9927b3248c30ecaf8bb62 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 7 Oct 2024 14:01:28 -0600 Subject: [PATCH 101/158] Revert this change as it changed answers for SMS_Ln9.ne30pg2_ne30pg2_mg17.I1850Clm50Sp.derecho_intel.clm-clm50cam6LndTuningMode--clm-nofireemis, unit tests and some other tests went back to identical, but at least this one changed --- src/biogeophys/SoilStateInitTimeConstMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biogeophys/SoilStateInitTimeConstMod.F90 b/src/biogeophys/SoilStateInitTimeConstMod.F90 index 3bd280761f..07423fcc4d 100644 --- a/src/biogeophys/SoilStateInitTimeConstMod.F90 +++ b/src/biogeophys/SoilStateInitTimeConstMod.F90 @@ -781,7 +781,7 @@ real(r8) function ThresholdSoilMoistZender2003( clay ) call endrun( 'Clay fraction is out of bounds (0 to 100)') return end if - ThresholdSoilMoistZender2003 = 0.17_r8 + 0.14_r8 * (clay*0.01_r8) + ThresholdSoilMoistZender2003 = 0.17_r8 + 0.14_r8 * clay * 0.01_r8 end function ThresholdSoilMoistZender2003 !------------------------------------------------------------------------------ From 3f5aa0f5421cf3ade4d3761ccac4289d4a0a4d5c Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 7 Oct 2024 15:30:23 -0600 Subject: [PATCH 102/158] Bump up wallclock time for one test. ERS_Ly5_P128x1.f10_f10_mg37.IHistClm60BgcCrop.derecho_intel.clm-cropMonthOutput--clm-matrixcnOn_ignore_warnings See ESCOMP/CTSM#2814 (https://github.com/ESCOMP/CTSM/issues/2814) --- cime_config/testdefs/testlist_clm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index ab1755bb77..2b6a35f9eb 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1773,7 +1773,7 @@ - + From 3ec9215c09004385621f6523ca68c8eb2a55bd48 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 7 Oct 2024 15:51:49 -0600 Subject: [PATCH 103/158] Remove include_user_mods from matrixcnOn testmod. Should avoid unnecessary levels of history writing. Resolves ESCOMP/CTSM#2814. --- cime_config/testdefs/testlist_clm.xml | 2 +- .../testdefs/testmods_dirs/clm/matrixcnOn/include_user_mods | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 cime_config/testdefs/testmods_dirs/clm/matrixcnOn/include_user_mods diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 0eb3d5012d..7943b5c55e 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3332,7 +3332,7 @@ - + diff --git a/cime_config/testdefs/testmods_dirs/clm/matrixcnOn/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/matrixcnOn/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/matrixcnOn/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default From ae6b18844d186c10a369f62aa749b940d40714c0 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 7 Oct 2024 20:59:31 -0600 Subject: [PATCH 104/158] Change a test wallclock time to ensure it's what we want. --- cime_config/testdefs/testlist_clm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 7943b5c55e..cdb00db524 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1333,7 +1333,7 @@ - + From 6ae37190e2ac05253c7027fcb2c1928564f596ad Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 7 Oct 2024 21:29:34 -0600 Subject: [PATCH 105/158] Update ChangeLog and ChangeSum. --- doc/ChangeLog | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 54 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 8e76002a92..49f0a48a54 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,57 @@ =============================================================== +Tag name: ctsm5.3.004 +Originator(s): samrabin (Sam Rabin) +Date: Mon Oct 7 21:25:20 MDT 2024 +One-line Summary: Move hillslope data off surface datasets + +Purpose and description of changes +---------------------------------- + +Moves hillslope data off surface datasets onto its own separate hillslope_file. This makes it so we don't need to generate new surface datasets specifically for hillslope testing whenever the surface datasets are updated. + + +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.] + +[ ] clm6_0 + +[ ] clm5_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Testing summary: +---------------- + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + derecho ----- OK + izumi ------- OK + + +Answer changes +-------------- + +Changes answers relative to baseline: Not in real runs, only our testing. + + +Other details +------------- + +Pull Requests that document the changes (include PR ids): +- ESCOMP/CTSM#2434 (https://github.com/ESCOMP/CTSM/pull/2434) + +=============================================================== +=============================================================== Tag name: ctsm5.3.003 Originator(s): rgknox (Ryan Knox, LBNL, rgknox@lbl.gov) glemieux (Gregory Lemieux, LBNL, glemieux@lbl.gov) diff --git a/doc/ChangeSum b/doc/ChangeSum index c16940615b..ad552e320e 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.3.004 samrabin 10/07/2024 Move hillslope data off surface datasets ctsm5.3.003 multiple 10/07/2024 FATES default parameter file update ctsm5.3.002 multiple 09/26/2024 Duplicate tag (same as 5.3.001) ctsm5.3.001 multiple 09/26/2024 Merge b4b-dev From 4c9631bd797b770084a946fcc0415cf669517f9c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 8 Oct 2024 01:39:18 -0600 Subject: [PATCH 106/158] Make dust_moist_fact different for Leung and Zender, even though both are 1.0, and then have the duplicated line outside of the if statement --- src/biogeophys/SoilStateInitTimeConstMod.F90 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/biogeophys/SoilStateInitTimeConstMod.F90 b/src/biogeophys/SoilStateInitTimeConstMod.F90 index 9f4a458dda..a730417315 100644 --- a/src/biogeophys/SoilStateInitTimeConstMod.F90 +++ b/src/biogeophys/SoilStateInitTimeConstMod.F90 @@ -721,14 +721,12 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) !soilstate_inst%gwc_thr_col(c) = ThresholdSoilMoistZender2003( clay3d(g,1) ) if ( is_dust_emis_leung() )then soilstate_inst%mss_frc_cly_vld_col(c) = MassFracClayLeung2023( clay3d(g,1) ) - !dust_moist_fact = 0.9_r8 ! change this into a namelist variable later. - dust_moist_fact = 1.0_r8 ! change this into a namelist variable later. - soilstate_inst%gwc_thr_col(c) = dust_moist_fact * ThresholdSoilMoistZender2003( clay3d(g,1) ) + dust_moist_fact = 1.0_r8 ! change this into a namelist variable later., currrently not used but could be in the future else soilstate_inst%mss_frc_cly_vld_col(c) = MassFracClay( clay3d(g,1) ) dust_moist_fact = 1.0_r8 - soilstate_inst%gwc_thr_col(c) = dust_moist_fact * ThresholdSoilMoistZender2003( clay3d(g,1) ) end if + soilstate_inst%gwc_thr_col(c) = dust_moist_fact * ThresholdSoilMoistZender2003( clay3d(g,1) ) end do From 146dba46b7ebba8be78bf88021c8d65ecf15ca88 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Wed, 2 Oct 2024 08:18:22 -0600 Subject: [PATCH 107/158] Fix issue #2793 --- src/biogeophys/EnergyFluxType.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biogeophys/EnergyFluxType.F90 b/src/biogeophys/EnergyFluxType.F90 index 16929d9708..6a31293fa3 100644 --- a/src/biogeophys/EnergyFluxType.F90 +++ b/src/biogeophys/EnergyFluxType.F90 @@ -579,7 +579,7 @@ subroutine InitHistory(this, bounds, is_simple_buildtemp, is_prog_buildtemp) avgflag='A', long_name='urban heating flux', & ptr_col=this%eflx_urban_heat_col, set_nourb=0._r8, c2l_scale_type='urbanf') else - this%eflx_urban_ac_lun(begl:endl) = spval + this%eflx_building_lun(begl:endl) = spval call hist_addfld1d (fname='EFLXBUILD', units='W/m^2', & avgflag='A', long_name='building heat flux from change in interior building air temperature', & ptr_lunit=this%eflx_building_lun, set_nourb=0._r8, l2g_scale_type='unity') From c1fe2580ccabaad8ebe334e581876196a9a7e1cf Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 8 Oct 2024 16:56:09 -0600 Subject: [PATCH 108/158] Clm60 finidat updates for ne30, f09, f19 grids --- bld/namelist_files/namelist_defaults_ctsm.xml | 102 ++++++++---------- 1 file changed, 43 insertions(+), 59 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 34910ec900..1356e0c222 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1354,18 +1354,32 @@ attributes from the config_cache.xml file (with keys converted to upper-case). - + lnd/clm2/initdata_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_pSASU.clm2.r.0161-01-01-00000.nc lnd/clm2/initdata_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_pSASU.clm2.r.0161-01-01-00000.nc + + +lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_ne30pg3t232_pSASU.clm2.r.0121-01-01-00000.nc + + +lnd/clm2/initdata_esmf/ctsm5.3/ctsm530_f19_PPE_pSASU.clm2.r.0161-01-01-00000.nc + lnd/clm2/initdata_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_hist.clm2.r.2000-01-01-00000.nc @@ -1493,21 +1507,25 @@ attributes from the config_cache.xml file (with keys converted to upper-case). - lnd/clm2/initdata_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_hist.clm2.r.2000-01-01-00000.nc - lnd/clm2/initdata_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_hist.clm2.r.2000-01-01-00000.nc + +lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_ne30pg3t232_hist.clm2.r.2000-01-01-00000.nc @@ -1532,7 +1550,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="19790101" sim_year="1979" do_transient_pfts=".false." use_excess_ice=".false." ic_tod="0" glc_nec="10" use_crop=".false." irrigate=".true." lnd_tuning_mode="clm5_1_cam7.0" use_init_interp=".true." ->lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr1979_c200806.nc +>lnd/clm2/initdata_map/ctsm53n04ctsm52028_f09_hist.clm2.r.1979-01-01-00000.nc - -lnd/clm2/initdata_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.nc - lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr1979_c200806.nc +>lnd/clm2/initdata_map/ctsm53n04ctsm52028_f09_hist.clm2.r.1979-01-01-00000.nc + +lnd/clm2/initdata_map/ctsm53n04ctsm52028_ne30pg3t232_hist.clm2.r.1979-01-01-00000.nc - -lnd/clm2/initdata_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.nc - lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr2000_c200728.nc - -lnd/clm2/initdata_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.nc - - - -lnd/clm2/initdata_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.nc - - lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr1979_c200806.nc +>lnd/clm2/initdata_map/ctsm53n04ctsm52028_f09_hist.clm2.r.1979-01-01-00000.nc - -lnd/clm2/initdata_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.nc - - lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr1979_c200806.nc +>lnd/clm2/initdata_map/ctsm53n04ctsm52028_f09_hist.clm2.r.1979-01-01-00000.nc + +lnd/clm2/initdata_map/ctsm53n04ctsm52028_ne30pg3t232_hist.clm2.r.1979-01-01-00000.nc - -lnd/clm2/initdata_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.nc - - Date: Wed, 9 Oct 2024 12:41:39 -0600 Subject: [PATCH 109/158] Fix hillslope with use_init_interp warning test, by specifying the hillslope_file this fixes #2826 --- bld/unit_testers/build-namelist_test.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 06c9bcc361..5fb7b4f39b 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -1359,8 +1359,8 @@ sub cat_and_create_namelistinfile { namelst=>"fsurdat='build-namelist_test.pl'", phys=>"clm6_0", }, - "hillslope with init_interp"=>{ options=>"-bgc bgc -envxml_dir .", - namelst=>"use_init_interp=.true.,use_hillslope=.true.", + "hillslope with init_interp"=>{ options=>"--res 10x15 --bgc bgc --envxml_dir .", + namelst=>"use_init_interp=.true.,use_hillslope=.true.,hillslope_file='/dev/null'", phys=>"clm6_0", }, ); From 081427459cb67da29e3927664764f04b5e564a16 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 9 Oct 2024 16:43:15 -0600 Subject: [PATCH 110/158] ne30 updates in response to Keith Oleson's review --- bld/namelist_files/namelist_defaults_ctsm.xml | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 1356e0c222..6708e5ba8f 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -936,6 +936,10 @@ 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_crop=.true. irrigate=.false. glc_nex=10 do_transient_pfts=.false. lnd_tuning_mode=clm6_0_GSWP3v1 use_excess_ice=.true. +hgrid=ne30np4.pg3 mask=t232 + hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. +hgrid=ne30np4.pg3 maxpft=79 mask=t232 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.true. + hgrid=ne0np4.ARCTICGRIS.ne30x8 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. +hgrid=ne30np4.pg3 mask=t232 + + lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_pSASU.clm2.r.0161-01-01-00000.nc -lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_ne30pg3t232_pSASU.clm2.r.0121-01-01-00000.nc @@ -1521,7 +1532,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). phys="clm6_0" use_init_interp=".true." >lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_hist.clm2.r.2000-01-01-00000.nc -lnd/clm2/initdata_map/ctsm53n04ctsm52028_f09_hist.clm2.r.1979-01-01-00000.nc -lnd/clm2/initdata_map/ctsm53n04ctsm52028_ne30pg3t232_hist.clm2.r.1979-01-01-00000.nc @@ -1797,12 +1806,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd_tuning_mode="clm6_0_cam6.0" use_init_interp=".true." >lnd/clm2/initdata_map/ctsm53n04ctsm52028_f09_hist.clm2.r.1979-01-01-00000.nc -lnd/clm2/initdata_map/ctsm53n04ctsm52028_ne30pg3t232_hist.clm2.r.1979-01-01-00000.nc - Date: Wed, 9 Oct 2024 16:43:55 -0600 Subject: [PATCH 111/158] f19 updates for test to pick up the correct finidat --- bld/namelist_files/namelist_defaults_ctsm.xml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 6708e5ba8f..296feb03ba 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -936,6 +936,10 @@ 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_crop=.true. irrigate=.false. glc_nex=10 do_transient_pfts=.false. lnd_tuning_mode=clm6_0_GSWP3v1 use_excess_ice=.true. +hgrid=1.9x2.5 mask=gx1v7 + hgrid=ne30np4.pg3 mask=t232 @@ -1386,9 +1390,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). >lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_ne30pg3t232_pSASU.clm2.r.0121-01-01-00000.nc -lnd/clm2/initdata_esmf/ctsm5.3/ctsm530_f19_PPE_pSASU.clm2.r.0161-01-01-00000.nc From 10ff40411a43b6a214700b14bc0edd197e036832 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 10 Oct 2024 02:19:46 -0600 Subject: [PATCH 112/158] Add more expected fails --- cime_config/testdefs/ExpectedTestFails.xml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 3b80016f82..7049e9672b 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -135,6 +135,17 @@ + + + FAIL + #2310 + + + FAIL + #2310 + + + FAIL @@ -171,6 +182,13 @@ + + + FAIL + #2454 + + + FAIL From 87778795589cd919b98df068ec90147fa85bed80 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 10 Oct 2024 03:17:38 -0600 Subject: [PATCH 113/158] Update change files --- doc/ChangeLog | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 92 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 49f0a48a54..8f5b81d52b 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,95 @@ =============================================================== +Tag name: ctsm5.3.005 +Originator(s): dmleung (Danny Leung) +Date: Thu 10 Oct 2024 03:15:52 AM MDT +One-line Summary: Hardcoded tuning adjustments for Leung_2024 dust emissions + +Purpose and description of changes +---------------------------------- + +Changes to dust emissions when Leung_2024 method is being used. + +Tuning was needed since we saw some high biases in dust over semiarid regions given all the updates in CTSM and CAM. The biggest +changes in CTSM that affects dust is an increase in friction velocity (ustar; fv in CTSM) over vegetated, semiarid regions, mainly +due to a switch in the roughness scheme from 'ZengWang2007' to 'Meier2022'. Since dust emission is very sensitive to ustar, the dust +emission scheme magnifies this increase and caused strong high biases over semiarid regions, including Australia and Patagonia (see +plots in issue #2732). To enhance the robustness of Leung_2023 and reduce the likelihood to see huge changes in answers in the +future, we tried to limit the sensitivity of dust emissions to ustar. We also tried different methods (see specific notes below) to +reduce dust emissions from semiarid regions given the high biases over there. + + +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] clm6_0 + +[ ] clm5_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- +List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: + + Start of work on tuning for #2732 + Fixes #2826 -- Fix failing warning test + +Notes of particular relevance for developers: +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + Dust tuning parameters are hardcoded in FORTRAN and need to be moved to namelists + +Testing summary: Regular +---------------- + [PASS means all tests PASS; OK means tests PASS other than expected fails.] + + build-namelist tests (if CLMBuildNamelist.pm has changed): + + derecho - PASS + + python testing (if python code has changed; see instructions in python/README.md; document testing done): + + derecho - PASS + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + derecho ----- OK + izumi ------- OK + +Answer changes +-------------- + +Changes answers relative to baseline: Yes for clm6_0 + + Summarize any changes to answers, i.e., + - what code configurations: clm6_0 + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + Just updates dust emissions when Leung_2024 method is used + + Only the dust emission fields are changed all other fields are untouched + +Other details +------------- + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + + https://github.com/ESCOMP/CTSM/pull/2803 -- Tuning Leung_2023 dust emissions for clm6_0_cam7.0 + +=============================================================== +=============================================================== Tag name: ctsm5.3.004 Originator(s): samrabin (Sam Rabin) Date: Mon Oct 7 21:25:20 MDT 2024 diff --git a/doc/ChangeSum b/doc/ChangeSum index ad552e320e..358fb8060e 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.3.005 erik 10/10/2024 Hardcoded tuning adjustments for Leung_2024 dust emissions ctsm5.3.004 samrabin 10/07/2024 Move hillslope data off surface datasets ctsm5.3.003 multiple 10/07/2024 FATES default parameter file update ctsm5.3.002 multiple 09/26/2024 Duplicate tag (same as 5.3.001) From 33c8d55740e6d0100d2ef22a2d8019e34d45e928 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 10 Oct 2024 17:03:40 -0600 Subject: [PATCH 114/158] Updates after Erik's reviewr; ne30 1979 does not work, yet --- bld/namelist_files/namelist_defaults_ctsm.xml | 54 ++++++++++--------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 296feb03ba..44951814a4 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -938,11 +938,11 @@ attributes from the config_cache.xml file (with keys converted to upper-case). hgrid=1.9x2.5 mask=gx1v7 +>mask=gx1v7 use_cn=.true. do_transient_pfts=.false. use_excess_ice=.true. use_crop=.false. irrigate=.false. hgrid=ne30np4.pg3 mask=t232 +>mask=t232 use_cn=.true. do_transient_pfts=.false. use_excess_ice=.true. use_crop=.true. irrigate=.false. @@ -1275,9 +1275,9 @@ attributes from the config_cache.xml file (with keys converted to upper-case). >hgrid=ne0np4.ARCTICGRIS.ne30x8 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. -hgrid=ne30np4.pg3 mask=t232 +hgrid=ne30np4.pg3 maxpft=17 mask=t232 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. @@ -1371,27 +1371,30 @@ attributes from the config_cache.xml file (with keys converted to upper-case). - lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_pSASU.clm2.r.0161-01-01-00000.nc lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_pSASU.clm2.r.0161-01-01-00000.nc -lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_ne30pg3t232_pSASU.clm2.r.0121-01-01-00000.nc -lnd/clm2/initdata_esmf/ctsm5.3/ctsm530_f19_PPE_pSASU.clm2.r.0161-01-01-00000.nc @@ -1435,7 +1438,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd_tuning_mode="clm5_1_GSWP3v1" use_init_interp=".true." >lnd/clm2/initdata_esmf/ctsm5.2/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c240223.nc - lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_ne30pg3t232_hist.clm2.r.2000-01-01-00000.nc @@ -1562,8 +1564,8 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/ctsm53n04ctsm52028_f09_hist.clm2.r.1979-01-01-00000.nc + lnd_tuning_mode="clm5_1_cam7.0" +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_hist.clm2.r.1979-01-01-00000.nc lnd/clm2/initdata_map/ctsm53n04ctsm52028_f09_hist.clm2.r.1979-01-01-00000.nc + lnd_tuning_mode="clm6_0_cam7.0" +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_hist.clm2.r.1979-01-01-00000.nc -lnd/clm2/initdata_map/ctsm53n04ctsm52028_ne30pg3t232_hist.clm2.r.1979-01-01-00000.nc +lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_ne30pg3t232_hist.clm2.r.1979-01-01-00000.nc lnd/clm2/initdata_map/ctsm53n04ctsm52028_f09_hist.clm2.r.1979-01-01-00000.nc + lnd_tuning_mode="clm5_1_cam6.0" +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_hist.clm2.r.1979-01-01-00000.nc lnd/clm2/initdata_map/ctsm53n04ctsm52028_f09_hist.clm2.r.1979-01-01-00000.nc + lnd_tuning_mode="clm6_0_cam6.0" +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_hist.clm2.r.1979-01-01-00000.nc Date: Thu, 10 Oct 2024 17:07:38 -0600 Subject: [PATCH 115/158] Draft ChangeLog/Sum --- doc/ChangeLog | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++- doc/ChangeSum | 2 ++ 2 files changed, 93 insertions(+), 1 deletion(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 8f5b81d52b..8be750f8a7 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,87 @@ =============================================================== +Tag name: ctsm5.3.007 +Originator(s): slevis (Samuel Levis,UCAR/TSS,303-665-1310) +Date: Thu 10 Oct 2024 10:12:18 AM MDT +One-line Summary: Clm60 finidat updates for ne30, f09, f19 grids + +Purpose and description of changes +---------------------------------- + Updates appear in namelist_defaults_ctsm.xml. + As before, I updated clm51, too, to keep it same as clm60 (and clm51 will go away soon). + +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] clm6_0 + +[ ] clm5_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- +List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: + Relates to (fixes?) #2403; needs more work to close? + +Notes of particular relevance for users +--------------------------------------- +Changes made to namelist defaults (e.g., changed parameter values): + Clm60 and clm51 finidat updates for ne30, f09, f19 grids. + +Changes to the datasets (e.g., parameter, surface or initial files): + Clm60 and clm51 finidat updates for ne30, f09, f19 grids. + +Testing summary: +---------------- + + [PASS means all tests PASS; OK means tests PASS other than expected fails.] + + build-namelist tests (if CLMBuildNamelist.pm has changed): + + derecho - TODO + + python testing (if python code has changed; see instructions in python/README.md; document testing done): + + derecho - TODO + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + derecho ----- TODO + izumi ------- TODO + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes. + + Summarize any changes to answers, i.e., + - what code configurations: clm60 (and clm51 which goes away very soon) + - what platforms/compilers: all + - nature of change: larger than roundoff/same climate + +Other details +------------- +List any git submodules updated (cime, rtm, mosart, cism, fates, etc.): + +Pull Requests that document the changes (include PR ids): + https://github.com/ESCOMP/ctsm/pull/2821 + +=============================================================== +=============================================================== +Tag name: ctsm5.3.006 +=============================================================== +=============================================================== Tag name: ctsm5.3.005 Originator(s): dmleung (Danny Leung) Date: Thu 10 Oct 2024 03:15:52 AM MDT @@ -132,7 +215,14 @@ Testing summary: Answer changes -------------- -Changes answers relative to baseline: Not in real runs, only our testing. +Changes answers relative to baseline: Yes + + Summarize any changes to answers, i.e., + - what code configurations: Hillslope (tests only) + - what platforms/compilers: Tests on Izumi and Derecho + - nature of change: Larger than roundoff + + Only our tests are affected because I had to make changes to the test setup for compatibility; this included changing mesh file and hillslope data for some tests/testmods. Other details diff --git a/doc/ChangeSum b/doc/ChangeSum index 358fb8060e..293e0fc9ce 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,7 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.3.007 slevis 10/11/2024 Clm60 finidat updates for ne30, f09, f19 grids + ctsm5.3.006 ctsm5.3.005 erik 10/10/2024 Hardcoded tuning adjustments for Leung_2024 dust emissions ctsm5.3.004 samrabin 10/07/2024 Move hillslope data off surface datasets ctsm5.3.003 multiple 10/07/2024 FATES default parameter file update From cfcd041b9455a41d122cc58fa335e6bc86c9b2d7 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 11 Oct 2024 07:18:52 -0600 Subject: [PATCH 116/158] Update ChangeLog/ChangeSum. --- doc/ChangeLog | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++- doc/ChangeSum | 1 + 2 files changed, 70 insertions(+), 1 deletion(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 8f5b81d52b..737bec2b97 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,72 @@ =============================================================== +Tag name: ctsm5.3.006 +Originator(s): samrabin (Sam Rabin, UCAR/TSS, samrabin@ucar.edu) +Date: Fri Oct 11 07:01:09 MDT 2024 +One-line Summary: Merge b4b-dev + +Purpose and description of changes +---------------------------------- + +- Fix clm-basic tests (resolves ESCOMP/CTSM#2787) +- Change testlist_clm ne30pg3_t061 tests to ne30pg3_t232 (resolves ESCOMP/CTSM#2702) +- Remove unused variable elevclass_o in mkglcmecMod.F90 (resolves ESCOMP/CTSM#2802) +- Add a check in failtest, warntest, finidat_files, so when a new test or finidat file are added and one of the subkeys is misspelled you will get an error and tester will die (resolves ESCOMP/CTSM#2673) +- Move from deprecated shr_file to shr_log +- Set eflx_building_lun to spval properly (resolves ESCOMP/CTSM#2793) + + +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.] + +[ ] clm6_0 + +[ ] clm5_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- + +List of CTSM issues fixed: +- ESCOMP/CTSM#2787 (aux_clm "clm-basic" tests fail as of ctsm5.3.0 because they need c13 in finidat; https://github.com/ESCOMP/CTSM/issues/2787) +- ESCOMP/CTSM#2702 (Tests failing in ctsm5.2.019 for CESM alpha testing; https://github.com/ESCOMP/CTSM/issues/2702) +- ESCOMP/CTSM#2802 (Array elevclass_o in mksurfdata_esmf/src/mkglcmecMod.F90 is not allocated before use; https://github.com/ESCOMP/CTSM/issues/2802) +- ESCOMP/CTSM#2673 (Catch use of namelist attribute in failure testing in perl build-namelist tester; https://github.com/ESCOMP/CTSM/issues/2673) +- ESCOMP/CTSM#2793 (Potential typo/bug in EnergyFluxType.F90; https://github.com/ESCOMP/CTSM/issues/2793) + + +Testing summary: +---------------- + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + derecho ----- OK + izumi ------- OK + + +Other details +------------- + +Pull Requests that document the changes: +- ESCOMP/CTSM#2798: Fix clm-basic tests (https://github.com/ESCOMP/CTSM/pull/2798) +- ESCOMP/CTSM#2799: Change testlist_clm ne30pg3_t061 tests to ne30pg3_t232 (https://github.com/ESCOMP/CTSM/pull/2799) +- ESCOMP/CTSM#2804: Remove unused variable elevclass_o in mkglcmecMod.F90 (https://github.com/ESCOMP/CTSM/pull/2804) +- ESCOMP/CTSM#2678: Add check in build-namelist_test.pl (https://github.com/ESCOMP/CTSM/pull/2678) +- ESCOMP/CTSM#2627: move from depricated shr_file to shr_log (https://github.com/ESCOMP/CTSM/pull/2627) +- ESCOMP/CTSM#2806: Set eflx_building_lun to spval properly (https://github.com/ESCOMP/CTSM/pull/2806) + +=============================================================== +=============================================================== Tag name: ctsm5.3.005 Originator(s): dmleung (Danny Leung) Date: Thu 10 Oct 2024 03:15:52 AM MDT @@ -91,7 +159,7 @@ Pull Requests that document the changes (include PR ids): =============================================================== =============================================================== Tag name: ctsm5.3.004 -Originator(s): samrabin (Sam Rabin) +Originator(s): samrabin (Sam Rabin, UCAR/TSS, samrabin@ucar.edu) Date: Mon Oct 7 21:25:20 MDT 2024 One-line Summary: Move hillslope data off surface datasets diff --git a/doc/ChangeSum b/doc/ChangeSum index 358fb8060e..f74348094c 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.3.006 samrabin 10/11/2024 Merge b4b-dev ctsm5.3.005 erik 10/10/2024 Hardcoded tuning adjustments for Leung_2024 dust emissions ctsm5.3.004 samrabin 10/07/2024 Move hillslope data off surface datasets ctsm5.3.003 multiple 10/07/2024 FATES default parameter file update From bb97fb3bd5831f0a08b768df61ee6c013e9b2cc0 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 11 Oct 2024 13:59:05 -0600 Subject: [PATCH 117/158] Updates from review with Erik and subsequent testing --- bld/namelist_files/namelist_defaults_ctsm.xml | 132 +++++++----------- 1 file changed, 51 insertions(+), 81 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 44951814a4..11a7d68e71 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -942,7 +942,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). mask=t232 use_cn=.true. do_transient_pfts=.false. use_excess_ice=.true. use_crop=.true. irrigate=.false. +>mask=tx2_3v2 use_cn=.true. do_transient_pfts=.false. use_excess_ice=.true. use_crop=.true. irrigate=.false. @@ -965,11 +965,16 @@ 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_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. + hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nex=10 do_transient_pfts=.false. lnd_tuning_mode=clm5_1_GSWP3v1 use_excess_ice=.true. +>hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nex=10 do_transient_pfts=.false. use_excess_ice=.true. hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nex=10 do_transient_pfts=.false. lnd_tuning_mode=clm6_0_GSWP3v1 use_excess_ice=.true. +>hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nex=10 do_transient_pfts=.false. use_excess_ice=.true. + +hgrid=ne30np4.pg3 maxpft=79 mask=tx2_3v2 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.true. hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. -hgrid=ne30np4.pg3 maxpft=79 mask=t232 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.true. - hgrid=ne0np4.ARCTICGRIS.ne30x8 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. -hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. +hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 use_excess_ice=.true. - -hgrid=1.9x2.5 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. +hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 use_excess_ice=.true. + +hgrid=ne30np4.pg3 maxpft=79 mask=tx2_3v2 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 use_excess_ice=.true. hgrid=ne0np4.ARCTICGRIS.ne30x8 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. -hgrid=ne30np4.pg3 maxpft=17 mask=t232 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. - - lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_pSASU.clm2.r.0161-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_g17_BgcCrop_exice_pSASU.clm60.r.0161-01-01.nc lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_pSASU.clm2.r.0161-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_g17_BgcCrop_exice_pSASU.clm60.r.0161-01-01.nc -lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_ne30pg3t232_pSASU.clm2.r.0121-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_ne30pg3t232_BgcCrop_exice_pSASU.clm60.r.0121-01-01.nc lnd/clm2/initdata_esmf/ctsm5.3/ctsm530_f19_PPE_pSASU.clm2.r.0161-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm530_f19_g17_Bgc_exice_pSASU.clm60.r.0161-01-01.nc @@ -1523,24 +1516,26 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_hist.clm2.r.2000-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_g17_BgcCrop_exice_hist.clm60.r.2000-01-01.nc + lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_hist.clm2.r.2000-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_g17_BgcCrop_exice_hist.clm60.r.2000-01-01.nc -lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_ne30pg3t232_hist.clm2.r.2000-01-01-00000.nc + phys="clm6_0" use_init_interp=".true." +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_ne30pg3t232_BgcCrop_exice_hist.clm60.r.2000-01-01.nc @@ -1560,12 +1555,12 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd_tuning_mode="clm5_0_cam7.0" use_init_interp=".true." >lnd/clm2/initdata_map/clmi.FHISTSp.2013-01-01.ne0CONUSne30x8_mt12_simyr2013_c200806.nc - -lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_hist.clm2.r.1979-01-01-00000.nc + +lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_g17_BgcCrop_exice_hist.clm60.r.1979-01-01.nc lnd/clm2/initdata_map/clmi.FHISTSp.2013-01-01.ne0CONUSne30x8_mt12_simyr2013_c200806.nc -lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_hist.clm2.r.1979-01-01-00000.nc - -lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_ne30pg3t232_hist.clm2.r.1979-01-01-00000.nc + +lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_g17_BgcCrop_exice_hist.clm60.r.1979-01-01.nc - -lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.1.9x2.5_gx1v7_simyr1979_c200806.nc +lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_ne30pg3t232_BgcCrop_exice_hist.clm60.r.1979-01-01.nc @@ -1749,13 +1739,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_hist.clm2.r.1979-01-01-00000.nc - - -lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_hist.clm2.r.1979-01-01-00000.nc - - -lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.1.9x2.5_gx1v7_simyr1979_c200806.nc - Date: Fri, 11 Oct 2024 17:37:53 -0600 Subject: [PATCH 118/158] Correct mask for ne30pg3 1979 finidat file --- bld/namelist_files/namelist_defaults_ctsm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 11a7d68e71..ad02f86de7 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1621,7 +1621,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). phys="clm6_0" use_init_interp=".true." >lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_g17_BgcCrop_exice_hist.clm60.r.1979-01-01.nc - Date: Fri, 11 Oct 2024 23:28:54 -0600 Subject: [PATCH 119/158] Remove 2003 finidat settings for clm5_1/clm6_0 so will use 2000 files, handle 1979 finidat settings consistently for f09, f19, and ne30pg3 --- bld/namelist_files/namelist_defaults_ctsm.xml | 120 +++--------------- 1 file changed, 18 insertions(+), 102 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index ad02f86de7..d03a840fd3 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -756,18 +756,11 @@ attributes from the config_cache.xml file (with keys converted to upper-case). - -.true. -.true. + .true. .true. - -.true. - -.true. -.true. + +.true. +.true. +.true. + .true. .true. - -.true. - -.true. -.true. + .true. .true. - -.true. - -.true. -.true. + .true. .true. - -.true. -hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. +maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 use_excess_ice=.true. -hgrid=1.9x2.5 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. +hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 use_excess_ice=.true. hgrid=ne0np4.ARCTICGRIS.ne30x8 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. -hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 use_excess_ice=.true. - -hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 use_excess_ice=.true. - hgrid=ne30np4.pg3 maxpft=79 mask=tx2_3v2 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 use_excess_ice=.true. +>maxpft=79 mask=tx2_3v2 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 use_excess_ice=.true. hgrid=ne0np4.ARCTICGRIS.ne30x8 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. - -hgrid=1.9x2.5 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. - - lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_g17_BgcCrop_exice_hist.clm60.r.1979-01-01.nc -lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.1.9x2.5_gx1v7_simyr1979_c200806.nc - - - -lnd/clm2/initdata_map/clmi.BHISTSp.2000-01-01.1.9x2.5_gx1v7_simyr2003_c200807.nc - - - - -lnd/clm2/initdata_map/clmi.BHISTSp.2000-01-01.1.9x2.5_gx1v7_simyr2003_c200807.nc - - - lnd/clm2/initdata_map/clmi.FHISTSp.2013-01-01.ne0CONUSne30x8_mt12_simyr2013_c200806.nc - -lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.1.9x2.5_gx1v7_simyr1979_c200806.nc - - - -lnd/clm2/initdata_map/clmi.BHISTSp.2000-01-01.1.9x2.5_gx1v7_simyr2003_c200807.nc - - - -lnd/clm2/initdata_map/clmi.BHISTSp.2000-01-01.1.9x2.5_gx1v7_simyr2003_c200807.nc - - Date: Sun, 13 Oct 2024 15:48:40 -0600 Subject: [PATCH 120/158] Updated ChangeLog/Sum --- doc/ChangeLog | 20 ++++++++++++-------- doc/ChangeSum | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 191cd7753a..867d23c5c5 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,13 +1,17 @@ =============================================================== Tag name: ctsm5.3.007 Originator(s): slevis (Samuel Levis,UCAR/TSS,303-665-1310) -Date: Thu 10 Oct 2024 10:12:18 AM MDT +Date: Mon 13 Oct 2024 10:12:18 AM MDT One-line Summary: Clm60 finidat updates for ne30, f09, f19 grids Purpose and description of changes ---------------------------------- Updates appear in namelist_defaults_ctsm.xml. - As before, I updated clm51, too, to keep it same as clm60 (and clm51 will go away soon). + For the most part I updated clm51, too, to keep it same as clm60, knowing + that clm51 will go away soon. + I had significant help from Erik Kluzek in disentangling the .xml settings + so that cases would pick up the correct finidat settings and other namelist + settings. Significant changes to scientifically-supported configurations -------------------------------------------------------------- @@ -31,7 +35,7 @@ Does this tag change answers significantly for any of the following physics conf Bugs fixed ---------- List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: - Relates to (fixes?) #2403; needs more work to close? + Relates to #2403; needs more work to close? Notes of particular relevance for users --------------------------------------- @@ -48,16 +52,16 @@ Testing summary: build-namelist tests (if CLMBuildNamelist.pm has changed): - derecho - TODO + derecho - PASS python testing (if python code has changed; see instructions in python/README.md; document testing done): - derecho - TODO + derecho - PASS regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): - derecho ----- TODO - izumi ------- TODO + derecho ----- OK + izumi ------- OK Answer changes @@ -66,7 +70,7 @@ Answer changes Changes answers relative to baseline: Yes. Summarize any changes to answers, i.e., - - what code configurations: clm60 (and clm51 which goes away very soon) + - what code configurations: clm60 and clm51; the latter goes away soon - what platforms/compilers: all - nature of change: larger than roundoff/same climate diff --git a/doc/ChangeSum b/doc/ChangeSum index caf03f27da..7d01340622 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,6 +1,6 @@ Tag Who Date Summary ============================================================================================================================ - ctsm5.3.007 slevis 10/11/2024 Clm60 finidat updates for ne30, f09, f19 grids + ctsm5.3.007 slevis 10/14/2024 Clm60 finidat updates for ne30, f09, f19 grids ctsm5.3.006 samrabin 10/11/2024 Merge b4b-dev ctsm5.3.005 erik 10/10/2024 Hardcoded tuning adjustments for Leung_2024 dust emissions ctsm5.3.004 samrabin 10/07/2024 Move hillslope data off surface datasets From 941ec71a216ce58dd5cab2d41baa21174e915628 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Sun, 13 Oct 2024 16:06:36 -0600 Subject: [PATCH 121/158] Remove redundant lines --- bld/namelist_files/namelist_defaults_ctsm.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index d03a840fd3..d7dc104183 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -774,8 +774,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case). hgrid="0.9x1.25" >.true. .true. -.true. .true. From 5f9d597bef097fdd746a626d2e8a8d2e1e400e52 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 14 Oct 2024 10:50:09 -0600 Subject: [PATCH 122/158] Add matrixcn test suite. --- cime_config/testdefs/testlist_clm.xml | 51 +++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index cdb00db524..146a7abe6e 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -11,6 +11,7 @@ aux_cime_baselines: CESM cime baselines (subset of aux_clm tests) hillslope: Experimental test list used for the hillslope option of the model rxcropmaturity: Short tests to be run during development related to prescribed crop calendars + matrixcn: Tests exercising the matrix-CN capability --> @@ -25,6 +26,7 @@ + @@ -47,6 +49,7 @@ + @@ -276,6 +279,7 @@ + @@ -482,6 +486,7 @@ + @@ -517,6 +522,7 @@ + @@ -544,6 +550,7 @@ + @@ -802,6 +809,7 @@ + @@ -820,6 +828,7 @@ + @@ -837,6 +846,7 @@ + @@ -846,7 +856,9 @@ + + @@ -866,6 +878,7 @@ + @@ -875,6 +888,7 @@ + @@ -884,6 +898,7 @@ + @@ -893,6 +908,7 @@ + @@ -985,6 +1001,7 @@ + @@ -1003,6 +1020,7 @@ + @@ -1022,6 +1040,7 @@ + @@ -1040,6 +1059,7 @@ + @@ -1077,6 +1097,7 @@ + @@ -1094,6 +1115,7 @@ + @@ -1103,6 +1125,7 @@ + @@ -1147,6 +1170,7 @@ + @@ -1164,6 +1188,7 @@ + @@ -1237,6 +1262,7 @@ + @@ -1297,6 +1323,7 @@ + @@ -1314,6 +1341,7 @@ + @@ -1340,6 +1368,7 @@ + @@ -1376,6 +1405,7 @@ + @@ -1421,6 +1451,7 @@ + @@ -1431,6 +1462,7 @@ + @@ -1441,6 +1473,7 @@ + @@ -1553,6 +1586,7 @@ + @@ -1688,6 +1722,7 @@ + @@ -1725,6 +1760,7 @@ + @@ -1771,6 +1807,7 @@ + @@ -1827,6 +1864,7 @@ + @@ -1857,6 +1895,7 @@ + @@ -1875,6 +1914,7 @@ + @@ -1904,6 +1944,7 @@ + @@ -1941,6 +1982,7 @@ + @@ -1960,6 +2002,7 @@ + @@ -2000,6 +2043,7 @@ + @@ -2205,6 +2249,7 @@ + @@ -2273,7 +2318,9 @@ + + @@ -2354,6 +2401,7 @@ + @@ -2515,6 +2563,7 @@ + @@ -2562,6 +2611,7 @@ + @@ -3335,6 +3385,7 @@ + From 4797fd22795103464c1e9291ddd3f69483ba514c Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 14 Oct 2024 11:11:04 -0600 Subject: [PATCH 123/158] Final update to ChangeLog --- doc/ChangeLog | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 867d23c5c5..e6804811d2 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,17 +1,15 @@ =============================================================== Tag name: ctsm5.3.007 Originator(s): slevis (Samuel Levis,UCAR/TSS,303-665-1310) -Date: Mon 13 Oct 2024 10:12:18 AM MDT +Date: Mon 13 Oct 2024 11:04:18 AM MDT One-line Summary: Clm60 finidat updates for ne30, f09, f19 grids Purpose and description of changes ---------------------------------- Updates appear in namelist_defaults_ctsm.xml. - For the most part I updated clm51, too, to keep it same as clm60, knowing - that clm51 will go away soon. + For the most part I updated clm51 to match clm60, though clm51 will go away soon. I had significant help from Erik Kluzek in disentangling the .xml settings - so that cases would pick up the correct finidat settings and other namelist - settings. + so that cases would pick up the correct finidat and other namelist settings. Significant changes to scientifically-supported configurations -------------------------------------------------------------- @@ -35,7 +33,7 @@ Does this tag change answers significantly for any of the following physics conf Bugs fixed ---------- List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: - Relates to #2403; needs more work to close? + Relates to #2403 but may need more work to close the issue Notes of particular relevance for users --------------------------------------- @@ -76,8 +74,6 @@ Changes answers relative to baseline: Yes. Other details ------------- -List any git submodules updated (cime, rtm, mosart, cism, fates, etc.): - Pull Requests that document the changes (include PR ids): https://github.com/ESCOMP/ctsm/pull/2821 From 9f4844cbf5d55db7768e13086786eab13d08f03b Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 14 Oct 2024 12:07:57 -0600 Subject: [PATCH 124/158] Draft ChangeLog/Sum --- doc/ChangeLog | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 69 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index e6804811d2..02f7fa763f 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,72 @@ =============================================================== +Tag name: ctsm5.3.008 +Originator(s): olyson (Keith Oleson,UCAR/TSS) +Date: Mon 14 Oct 2024 11:56:12 AM MDT +One-line Summary: PPE change to sa_leaf in CanopyFluxesMod.F90 + +Purpose and description of changes +---------------------------------- + + Add change to sa_leaf that was in PPE branch but did not get on 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.] + +[X] clm6_0 + +[X] clm5_1 + +[X] clm5_0 + +[X] ctsm5_0-nwp + +[X] clm4_5 + + +Bugs fixed +---------- +List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: + Fixes #2777 + + +Testing summary: +---------------- + + [PASS means all tests PASS; OK means tests PASS other than expected fails.] + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + derecho ----- + izumi ------- + + +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: larger than roundoff/same climate) + + The changes in answers are explained in this post: + https://github.com/ESCOMP/CTSM/issues/2777#issuecomment-2371697380 + + +Other details +------------- +Pull Requests that document the changes (include PR ids): + https://github.com/ESCOMP/ctsm/pull/2788 + +=============================================================== +=============================================================== Tag name: ctsm5.3.007 Originator(s): slevis (Samuel Levis,UCAR/TSS,303-665-1310) Date: Mon 13 Oct 2024 11:04:18 AM MDT diff --git a/doc/ChangeSum b/doc/ChangeSum index 7d01340622..5698b8654f 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.3.008 olyson 10/14/2024 PPE change to sa_leaf in CanopyFluxesMod.F90 ctsm5.3.007 slevis 10/14/2024 Clm60 finidat updates for ne30, f09, f19 grids ctsm5.3.006 samrabin 10/11/2024 Merge b4b-dev ctsm5.3.005 erik 10/10/2024 Hardcoded tuning adjustments for Leung_2024 dust emissions From 77fdb8d07e6a0dfb674e0da5d11939cdf20e74c3 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 14 Oct 2024 13:14:09 -0600 Subject: [PATCH 125/158] Updated ChangeLog from Keith Oleson's review --- doc/ChangeLog | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 02f7fa763f..986f58973d 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: ctsm5.3.008 Originator(s): olyson (Keith Oleson,UCAR/TSS) -Date: Mon 14 Oct 2024 11:56:12 AM MDT +Date: Mon 14 Oct 2024 01:08:47 PM MDT One-line Summary: PPE change to sa_leaf in CanopyFluxesMod.F90 Purpose and description of changes @@ -18,15 +18,15 @@ 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] clm6_0 +[ ] clm6_0 -[X] clm5_1 +[ ] clm5_1 -[X] clm5_0 +[ ] clm5_0 -[X] ctsm5_0-nwp +[ ] ctsm5_0-nwp -[X] clm4_5 +[ ] clm4_5 Bugs fixed @@ -56,8 +56,10 @@ Changes answers relative to baseline: Yes - what platforms/compilers: All - nature of change: larger than roundoff/same climate) - The changes in answers are explained in this post: + The changes in answers are explained in this post https://github.com/ESCOMP/CTSM/issues/2777#issuecomment-2371697380 + and the diagnostics are here + https://webext.cgd.ucar.edu/I2000/ctsm53n04ctsm52028_f09_saleaf/lnd/ctsm53n04ctsm52028_f09_saleaf_2000_2001_2004-ctsm53n04ctsm52028_f09_2000_2001_2004/setsIndex.html Other details From ea0dadda04ed84814c8c40e9364e7165566d6ebb Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 14 Oct 2024 16:05:22 -0600 Subject: [PATCH 126/158] Final ChangeLog --- doc/ChangeLog | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 986f58973d..bfaa2e71f7 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: ctsm5.3.008 Originator(s): olyson (Keith Oleson,UCAR/TSS) -Date: Mon 14 Oct 2024 01:08:47 PM MDT +Date: Mon 14 Oct 2024 04:03:26 PM MDT One-line Summary: PPE change to sa_leaf in CanopyFluxesMod.F90 Purpose and description of changes @@ -42,8 +42,8 @@ Testing summary: regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): - derecho ----- - izumi ------- + derecho ----- OK + izumi ------- OK Answer changes From b846e2b1926a94af73342650fe5dfd22d4db46b4 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 15 Oct 2024 09:38:19 -0600 Subject: [PATCH 127/158] Roll back change of one cnmatrix test length. --- cime_config/testdefs/testlist_clm.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 9e0235a6ab..4654f53c45 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1361,7 +1361,7 @@ - + @@ -1810,7 +1810,7 @@ - + From 82a0952fc6bcee3540dc5ca7e82d674fc52dca70 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 15 Oct 2024 17:46:01 -0600 Subject: [PATCH 128/158] Update ChangeLog and ChangeSum. --- doc/ChangeLog | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 73 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index bfaa2e71f7..3620cd8c15 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,76 @@ =============================================================== +Tag name: ctsm5.3.009 +Originator(s): samrabin (Sam Rabin, UCAR/TSS, samrabin@ucar.edu) +Date: Tue Oct 15 17:35:40 MDT 2024 +One-line Summary: Reduce outputs from matrixcnOn tests + +Purpose and description of changes +---------------------------------- + +Reduces size and runtime of our tests of the CN Matrix capability. See "Notes of particular relevance for developers" for more 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.) + +[ ] clm6_0 + +[ ] clm5_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- + +List of CTSM issues fixed (include CTSM Issue # and description): +- Resolves ESCOMP/CTSM#2814: Remove include_user_mods from matrixcnOn testmod (https://github.com/ESCOMP/CTSM/pull/2815) + + +Notes of particular relevance for developers: +--------------------------------------------- + +Changes to tests or testing: +- Removing the include_user_mods file from the matrixcnOn test (and thus also matrixcnOn_ignore_warnings) means that the default outputs no longer overwrite outputs specified by earlier test mods. For example, in LCISO_Lm13.f10_f10_mg37.IHistClm60BgcCrop.derecho_intel.clm-ciso_monthly--clm-matrixcnOn_ignore_warnings, it should have been saving monthly (the ciso_monthly test mod) but was actually being saved at much higher frequency (because matrixcnOn_ignore_warnings was after ciso_monthly in the test name). That test goes from 30 to 3 GB after this change. +- Adds matrixcn test suite, which can be used during Matrix CN development. All tests in this suite are also still run in aux_clm. + + +Testing summary: +---------------- + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + derecho ----- DIFF + izumi ------- DIFF + + +Answer changes +-------------- + +Changes answers relative to baseline: + + Summarize any changes to answers, i.e., + - what code configurations: aux_clm tests only + - what platforms/compilers: all + - nature of change: larger than roundoff + + Changes are due to changed history field lists (and some other settings) due to the removal of include_user_mods from the matrixcnOn test mod. No answer changes occurred in any test other than those using matrixcnOn(_ignore_warnings); no answer changes will occur for any non-test run. + +Other details +------------- + +Pull Requests that document the changes (include PR ids): +- PR ESCOMP/CTSM#2815: Remove include_user_mods from matrixcnOn testmod (https://github.com/ESCOMP/CTSM/pull/2815) + +=============================================================== +=============================================================== Tag name: ctsm5.3.008 Originator(s): olyson (Keith Oleson,UCAR/TSS) Date: Mon 14 Oct 2024 04:03:26 PM MDT diff --git a/doc/ChangeSum b/doc/ChangeSum index 5698b8654f..af6e1675b4 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.3.009 samrabin 10/15/2024 Reduce outputs from matrixcnOn tests ctsm5.3.008 olyson 10/14/2024 PPE change to sa_leaf in CanopyFluxesMod.F90 ctsm5.3.007 slevis 10/14/2024 Clm60 finidat updates for ne30, f09, f19 grids ctsm5.3.006 samrabin 10/11/2024 Merge b4b-dev From 694333f8f49aab356a41df18b0d69515c9e3ef83 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Sun, 20 Oct 2024 10:09:49 -0600 Subject: [PATCH 129/158] Transfer the following parameters from namelist to parameter file: Jmaxb1 (now called jmaxb1 and pft-dependent) upplim_destruct_metamorph maximum_leaf_wetted_fraction interception_fraction --- bld/CLMBuildNamelist.pm | 14 ---- bld/namelist_files/namelist_defaults_ctsm.xml | 18 +---- .../namelist_definition_ctsm.xml | 20 ----- bld/unit_testers/build-namelist_test.pl | 4 - src/biogeophys/CanopyHydrologyMod.F90 | 18 ++--- src/biogeophys/LunaMod.F90 | 80 +++---------------- src/biogeophys/SnowHydrologyMod.F90 | 11 +-- src/main/controlMod.F90 | 2 - src/main/pftconMod.F90 | 6 ++ 9 files changed, 36 insertions(+), 137 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index b881cdbfac..4d8ad454ba 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -3603,17 +3603,6 @@ sub setup_logic_luna { if ( &value_is_true($nl->get_value('lnc_opt') ) && not &value_is_true( $nl_flags->{'use_cn'}) ) { $log->fatal_error("Cannot turn lnc_opt to true when bgc=sp" ); } - my $var = "jmaxb1"; - if ( &value_is_true( $nl_flags->{'use_luna'} ) ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, - 'use_luna'=>$nl_flags->{'use_luna'} ); - } - my $val = $nl->get_value($var); - if ( ! &value_is_true( $nl_flags->{'use_luna'} ) ) { - if ( defined($val) ) { - $log->fatal_error("Cannot set $var when use_luna is NOT on" ); - } - } } #------------------------------------------------------------------------------- @@ -4523,8 +4512,6 @@ sub setup_logic_canopyhydrology { # my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'interception_fraction' ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'maximum_leaf_wetted_fraction' ); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_clm5_fpi' ); } @@ -4543,7 +4530,6 @@ sub setup_logic_snowpack { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'wind_dependent_snow_density'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'snow_overburden_compaction_method'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'lotmp_snowdensity_method'); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'upplim_destruct_metamorph'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'reset_snow'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'reset_snow_glc'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'reset_snow_glc_ela'); diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 650b21cb8d..8eb8e2cccb 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -413,11 +413,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). .true. -1.0 -0.05 .false. -0.25 -1.0 1 @@ -493,9 +489,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 'Slater2017' 'TruncatedAnderson1976' -175.d00 -100.d00 - 0.08d00 .false. @@ -551,10 +544,10 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/ctsm60_params.c240822.nc -lnd/clm2/paramdata/ctsm51_params.c240814.nc -lnd/clm2/paramdata/clm50_params.c240814.nc -lnd/clm2/paramdata/clm45_params.c240814.nc +/glade/campaign/cgd/tss/people/oleson/modify_param/ctsm60_params.c241017.nc +/glade/campaign/cgd/tss/people/oleson/modify_param/ctsm51_params.c241017.nc +/glade/campaign/cgd/tss/people/oleson/modify_param/clm50_params.c241017.nc +/glade/campaign/cgd/tss/people/oleson/modify_param/clm45_params.c241017.nc @@ -605,9 +598,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case). .false. .true. - -0.17 - unset diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 417444914e..01fc6587ec 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -404,21 +404,11 @@ Max number of iterations used in subr. CanopyFluxes. For many years, 40 was the Default: 40 - -Fraction of intercepted precipitation - - If TRUE use clm5 equation for fraction of intercepted precipitation - -Maximum fraction of leaf that may be wet prior to drip occuring - - Scalar multiplier for base flow rate @@ -712,11 +702,6 @@ Scalar of leaf respiration to vcmax The maximum value to use for zeta under stable conditions - -baseline proportion of nitrogen allocated for electron transport (J) - - Toggle to turn on the FATES model @@ -2839,11 +2824,6 @@ TruncatedAnderson1976 -- Truncate the Anderson-1976 equation at the value for -1 Slater2017 ------------- Use equation from Slater that increases snow density for very cold temperatures (Arctic, Antarctic) - -Upper Limit on Destructive Metamorphism Compaction [kg/m3] - - Snow compaction overburden exponential factor (1/K) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 096409065f..64126ab347 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -1235,10 +1235,6 @@ sub cat_and_create_namelistinfile { namelst=>"use_luna=.true., lnc_opt=.true.", phys=>"clm5_0", }, - "NOlunabutsetJmaxb1" =>{ options=>"-envxml_dir . -bgc sp", - namelst=>"use_luna=.false., jmaxb1=1.0", - phys=>"clm5_0", - }, "envxml_not_dir" =>{ options=>"-envxml_dir myuser_nl_clm", namelst=>"", phys=>"clm5_0", diff --git a/src/biogeophys/CanopyHydrologyMod.F90 b/src/biogeophys/CanopyHydrologyMod.F90 index 9ce9995ce6..166aa6d53d 100644 --- a/src/biogeophys/CanopyHydrologyMod.F90 +++ b/src/biogeophys/CanopyHydrologyMod.F90 @@ -49,6 +49,8 @@ module CanopyHydrologyMod real(r8) :: snow_canopy_storage_scalar ! Canopy-storage-of-snow parameter (kg/m2) real(r8) :: snowcan_unload_temp_fact ! Temperature canopy snow unload scaling (C2 in Eq. 14, Roesch et al. 2001) (K*s) real(r8) :: snowcan_unload_wind_fact ! Wind canopy snow unload scaling (modifies 1.56e5, where 1.56e5 is C3 in Eq. 15, Roesch et al. 2001) (-) + real(r8) :: interception_fraction ! Fraction of intercepted precipitation (-) + real(r8) :: maximum_leaf_wetted_fraction ! Maximum fraction of leaf that may be wet (-) end type params_type type(params_type), private :: params_inst ! @@ -67,8 +69,6 @@ module CanopyHydrologyMod private :: BulkDiag_FracWet ! Determine fraction of vegetated surface that is wet ! ! !PRIVATE DATA MEMBERS: - real(r8) :: interception_fraction ! Fraction of intercepted precipitation - real(r8) :: maximum_leaf_wetted_fraction ! Maximum fraction of leaf that may be wet logical, private :: use_clm5_fpi = .false. ! use clm5 fpi equation character(len=*), parameter, private :: sourcefile = & @@ -99,8 +99,6 @@ subroutine CanopyHydrology_readnl( NLFilename ) character(len=32) :: subname = 'CanopyHydrology_readnl' ! subroutine name !----------------------------------------------------------------------- namelist /clm_canopyhydrology_inparm/ & - interception_fraction, & - maximum_leaf_wetted_fraction, & use_clm5_fpi ! ---------------------------------------------------------------------- @@ -125,15 +123,11 @@ subroutine CanopyHydrology_readnl( NLFilename ) end if ! Broadcast namelist variables read in - call shr_mpi_bcast(interception_fraction, mpicom) - call shr_mpi_bcast(maximum_leaf_wetted_fraction, mpicom) call shr_mpi_bcast(use_clm5_fpi, mpicom) if (masterproc) then write(iulog,*) ' ' write(iulog,*) 'canopyhydrology settings:' - write(iulog,*) ' interception_fraction = ',interception_fraction - write(iulog,*) ' maximum_leaf_wetted_fraction = ',maximum_leaf_wetted_fraction write(iulog,*) ' use_clm5_fpi = ',use_clm5_fpi endif @@ -162,6 +156,10 @@ subroutine readParams( ncid ) call readNcdioScalar(ncid, 'snowcan_unload_temp_fact', subname, params_inst%snowcan_unload_temp_fact) ! Wind canopy snow unload scaling (modifies 1.56e5, where 1.56e5 is C3 in Eq. 15, Roesch et al. 2001) (-) call readNcdioScalar(ncid, 'snowcan_unload_wind_fact', subname, params_inst%snowcan_unload_wind_fact) + ! Fraction of intercepted precipitation (-) + call readNcdioScalar(ncid, 'interception_fraction', subname, params_inst%interception_fraction) + ! Maximum fraction of leaf that may be wet (-) + call readNcdioScalar(ncid, 'maximum_leaf_wetted_fraction', subname, params_inst%maximum_leaf_wetted_fraction) end subroutine readParams @@ -535,7 +533,7 @@ subroutine BulkFlux_CanopyInterceptionAndThroughfall(bounds, num_nolakep, filter if (check_point_for_interception_and_excess(p)) then ! Coefficient of interception if (use_clm5_fpi) then - fpiliq = interception_fraction * tanh(elai(p) + esai(p)) + fpiliq = params_inst%interception_fraction * tanh(elai(p) + esai(p)) else fpiliq = 0.25_r8*(1._r8 - exp(-0.5_r8*(elai(p) + esai(p)))) end if @@ -1170,7 +1168,7 @@ subroutine BulkDiag_FracWet(bounds, num_soilp, filter_soilp, & if (h2ocan > 0._r8) then vegt = frac_veg_nosno(p)*(elai(p) + esai(p)) fwet(p) = (h2ocan / (vegt * params_inst%liq_canopy_storage_scalar))**0.666666666666_r8 - fwet(p) = min (fwet(p),maximum_leaf_wetted_fraction) ! Check for maximum limit of fwet + fwet(p) = min (fwet(p),params_inst%maximum_leaf_wetted_fraction) ! Check for maximum limit of fwet if (snocan(p) > 0._r8) then fcansno(p) = (snocan(p) / (vegt * params_inst%snow_canopy_storage_scalar))**0.15_r8 ! must match snocanmx fcansno(p) = min (fcansno(p),1.0_r8) diff --git a/src/biogeophys/LunaMod.F90 b/src/biogeophys/LunaMod.F90 index dbd39daedf..3f5f7d0e3c 100644 --- a/src/biogeophys/LunaMod.F90 +++ b/src/biogeophys/LunaMod.F90 @@ -12,7 +12,7 @@ module LunaMod use clm_varcon , only : rgas, tfrz,spval use abortutils , only : endrun use clm_varctl , only : iulog - use clm_varpar , only : nlevcan + use clm_varpar , only : nlevcan, mxpft use decompMod , only : bounds_type, subgrid_level_patch use pftconMod , only : pftcon use FrictionvelocityMod , only : frictionvel_type @@ -33,7 +33,6 @@ module LunaMod !------------------------------------------------------------------------------ ! PUBLIC MEMBER FUNCTIONS: - public :: LunaReadNML !subroutine to read in the Luna namelist public :: Update_Photosynthesis_Capacity !subroutine to update the canopy nitrogen profile public :: Acc24_Climate_LUNA !subroutine to accumulate 24 hr climates public :: Acc240_Climate_LUNA !subroutine to accumulate 10 day climates @@ -78,7 +77,6 @@ module LunaMod real(r8), parameter :: CO2ref = 380.0_r8 ! reference CO2 concentration for calculation of reference NUE. real(r8), parameter :: forc_pbot_ref = 101325.0_r8 ! reference air pressure for calculation of reference NUE real(r8), parameter :: Q10Enz = 2.0_r8 ! Q10 value for enzyme decay rate - real(r8) :: Jmaxb1 = 0.1_r8 ! the baseline proportion of nitrogen allocated for electron transport (J) real(r8), parameter :: NMCp25 = 0.715_r8 ! estimated by assuming 80% maintenance respiration is used for photosynthesis enzyme maintenance real(r8), parameter :: Trange1 = 5.0_r8 ! lower temperature limit (oC) for nitrogen optimization real(r8), parameter :: Trange2 = 42.0_r8 ! upper temperature limit (oC) for nitrogen optimization @@ -92,70 +90,11 @@ module LunaMod contains - !********************************************************************************************************************************************************************** - ! Read in LUNA namelist - subroutine LunaReadNML( NLFilename ) - ! - ! !DESCRIPTION: - ! Read the namelist for LUNA - ! - ! !USES: - use fileutils , only : getavu, relavu, opnfil - use shr_nl_mod , only : shr_nl_find_group_name - use spmdMod , only : masterproc, mpicom - use shr_mpi_mod , only : shr_mpi_bcast - use clm_varctl , only : iulog - use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: NLFilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - integer :: ierr ! error code - integer :: unitn ! unit for namelist file - - character(len=*), parameter :: subname = 'lunaReadNML' - character(len=*), parameter :: nmlname = 'luna' - !----------------------------------------------------------------------- - namelist /luna/ Jmaxb1 - - ! Initialize options to default values, in case they are not specified in - ! the namelist - - - if (masterproc) then - unitn = getavu() - write(iulog,*) 'Read in '//nmlname//' namelist' - call opnfil (NLFilename, unitn, 'F') - call shr_nl_find_group_name(unitn, nmlname, status=ierr) - if (ierr == 0) then - read(unitn, nml=luna, iostat=ierr) - if (ierr /= 0) then - call endrun(msg="ERROR reading "//nmlname//"namelist"//errmsg(__FILE__, __LINE__)) - end if - else - call endrun(msg="ERROR could NOT find "//nmlname//"namelist"//errmsg(__FILE__, __LINE__)) - end if - call relavu( unitn ) - end if - - call shr_mpi_bcast (Jmaxb1, mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) nmlname//' settings:' - write(iulog,nml=luna) - write(iulog,*) ' ' - end if - - end subroutine lunaReadNML - !---------------------------------------------------------------------------- subroutine readParams( ncid ) ! ! !USES: - use ncdio_pio, only: file_desc_t + use ncdio_pio, only: file_desc_t,ncd_io use paramUtilMod, only: readNcdioScalar ! ! !ARGUMENTS: @@ -164,6 +103,10 @@ subroutine readParams( ncid ) ! ! !LOCAL VARIABLES: character(len=*), parameter :: subname = 'readParams_Luna' + character(len=100) :: errCode = '-Error reading in parameters file:' + logical :: readv ! has variable been read in or not + real(r8) :: temp1d(0:mxpft) ! temporary to read in parameter + character(len=100) :: tString ! temp. var for reading !-------------------------------------------------------------------- ! CO2 compensation point at 25°C at present day O2 levels @@ -314,6 +257,7 @@ subroutine Update_Photosynthesis_Capacity(bounds, fn, filterp, & c3psn => pftcon%c3psn , & ! photosynthetic pathway: 0. = c4, 1. = c3 slatop => pftcon%slatop , & ! specific leaf area at top of canopy, projected area basis [m^2/gC] leafcn => pftcon%leafcn , & ! leaf C:N (gC/gN) + jmaxb1 => pftcon%jmaxb1 , & ! Coefficient determining the response of electron transport rate to light availability (-) forc_pbot10 => atm2lnd_inst%forc_pbot240_downscaled_patch , & ! Input: [real(r8) (:) ] 10 day mean atmospheric pressure(Pa) CO2_p240 => atm2lnd_inst%forc_pco2_240_patch , & ! Input: [real(r8) (:) ] 10-day mean CO2 partial pressure (Pa) O2_p240 => atm2lnd_inst%forc_po2_240_patch , & ! Input: [real(r8) (:) ] 10-day mean O2 partial pressure (Pa) @@ -439,8 +383,8 @@ subroutine Update_Photosynthesis_Capacity(bounds, fn, filterp, & PNcbold = 0.0_r8 call NitrogenAllocation(FNCa,forc_pbot10(p), relh10, CO2a10, O2a10, PARi10, PARimx10, rb10v, hourpd, & tair10, tleafd10, tleafn10, & - Jmaxb1, PNlcold, PNetold, PNrespold, PNcbold, dayl_factor(p), o3coefjmax(p), & - PNstoreopt, PNlcopt, PNetopt, PNrespopt, PNcbopt) + jmaxb1(ft), PNlcold, PNetold, PNrespold, PNcbold, dayl_factor(p), & + o3coefjmax(p), PNstoreopt, PNlcopt, PNetopt, PNrespopt, PNcbopt) vcmx25_opt= PNcbopt * FNCa * Fc25 jmx25_opt= PNetopt * FNCa * Fj25 @@ -825,7 +769,7 @@ end subroutine Clear24_Climate_LUNA !************************************************************************************************************************************************ !Use the LUNA model to calculate the Nitrogen partioning subroutine NitrogenAllocation(FNCa,forc_pbot10, relh10, CO2a10,O2a10, PARi10,PARimx10,rb10, hourpd, tair10, tleafd10, tleafn10, & - Jmaxb1, PNlcold, PNetold, PNrespold, PNcbold, dayl_factor,o3coefjmax, & + jmaxb1, PNlcold, PNetold, PNrespold, PNcbold, dayl_factor,o3coefjmax, & PNstoreopt, PNlcopt, PNetopt, PNrespopt, PNcbopt) implicit none real(r8), intent (in) :: FNCa !Area based functional nitrogen content (g N/m2 leaf) @@ -840,7 +784,7 @@ subroutine NitrogenAllocation(FNCa,forc_pbot10, relh10, CO2a10,O2a10, PARi10,PAR real(r8), intent (in) :: tair10 !10-day running mean of the 2m temperature (oC) real(r8), intent (in) :: tleafd10 !10-day running mean of daytime leaf temperature (oC) real(r8), intent (in) :: tleafn10 !10-day running mean of nighttime leaf temperature (oC) - real(r8), intent (in) :: Jmaxb1 !coefficient determining the response of electron transport rate to light availability (unitless) + real(r8), intent (in) :: jmaxb1 !coefficient determining the response of electron transport rate to light availability (unitless) real(r8), intent (in) :: PNlcold !old value of the proportion of nitrogen allocated to light capture (unitless) real(r8), intent (in) :: PNetold !old value of the proportion of nitrogen allocated to electron transport (unitless) real(r8), intent (in) :: PNrespold !old value of the proportion of nitrogen allocated to respiration (unitless) @@ -928,7 +872,7 @@ subroutine NitrogenAllocation(FNCa,forc_pbot10, relh10, CO2a10,O2a10, PARi10,PAR tleafd10c = min(max(tleafd10, Trange1), Trange2) !constrain the physiological range tleafn10c = min(max(tleafn10, Trange1), Trange2) !constrain the physiological range ci = 0.7_r8 * CO2a10 - JmaxCoef = Jmaxb1 * dayl_factor * (1.0_r8 - exp(-params_inst%relhExp * max(relh10 - & + JmaxCoef = jmaxb1 * dayl_factor * (1.0_r8 - exp(-params_inst%relhExp * max(relh10 - & params_inst%minrelh, 0.0_r8) / (1.0_r8 - params_inst%minrelh))) do while (PNlcoldi .NE. PNlc .and. jj < 100) Fc = VcmxTKattge(tair10, tleafd10c) * Fc25 diff --git a/src/biogeophys/SnowHydrologyMod.F90 b/src/biogeophys/SnowHydrologyMod.F90 index 9fb1a52dbc..57e9088ece 100644 --- a/src/biogeophys/SnowHydrologyMod.F90 +++ b/src/biogeophys/SnowHydrologyMod.F90 @@ -87,6 +87,7 @@ module SnowHydrologyMod real(r8) :: scvng_fct_mlt_dst4 ! scavenging factor for dust species 4 inclusion in meltwater [frc] real(r8) :: ceta ! Overburden compaction constant (kg/m3) real(r8) :: snw_rds_min ! minimum allowed snow effective radius (also cold "fresh snow" value) [microns] + real(r8) :: upplim_destruct_metamorph ! Upper limit on destructive metamorphism compaction end type params_type type(params_type), private :: params_inst @@ -151,7 +152,6 @@ module SnowHydrologyMod integer :: overburden_compaction_method = -1 integer :: new_snow_density = LoTmpDnsSlater2017 ! Snow density type - real(r8) :: upplim_destruct_metamorph = 100.0_r8 ! Upper Limit on Destructive Metamorphism Compaction [kg/m3] real(r8) :: overburden_compress_Tfactor = 0.08_r8 ! snow compaction overburden exponential factor (1/K) ! ------------------------------------------------------------------------ @@ -211,8 +211,7 @@ subroutine SnowHydrology_readnl( NLFilename) namelist /clm_snowhydrology_inparm/ & wind_dependent_snow_density, snow_overburden_compaction_method, & - lotmp_snowdensity_method, upplim_destruct_metamorph, & - overburden_compress_Tfactor, & + lotmp_snowdensity_method, overburden_compress_Tfactor, & reset_snow, reset_snow_glc, reset_snow_glc_ela, & snow_dzmin_1, snow_dzmax_l_1, snow_dzmax_u_1, & snow_dzmin_2, snow_dzmax_l_2, snow_dzmax_u_2 @@ -246,7 +245,6 @@ subroutine SnowHydrology_readnl( NLFilename) call shr_mpi_bcast (wind_dependent_snow_density, mpicom) call shr_mpi_bcast (snow_overburden_compaction_method, mpicom) call shr_mpi_bcast (lotmp_snowdensity_method , mpicom) - call shr_mpi_bcast (upplim_destruct_metamorph , mpicom) call shr_mpi_bcast (overburden_compress_Tfactor, mpicom) call shr_mpi_bcast (reset_snow , mpicom) call shr_mpi_bcast (reset_snow_glc , mpicom) @@ -333,6 +331,8 @@ subroutine readParams( ncid ) call readNcdioScalar(ncid, 'ceta', subname, params_inst%ceta) ! minimum allowed snow effective radius (also cold "fresh snow" value) [microns] call readNcdioScalar(ncid, 'snw_rds_min', subname, params_inst%snw_rds_min) + ! Upper limit on destructive metamorphism compaction (kg/m3) + call readNcdioScalar(ncid, 'upplim_destruct_metamorph', subname, params_inst%upplim_destruct_metamorph) end subroutine readParams @@ -1972,7 +1972,8 @@ subroutine SnowCompaction(bounds, num_snowc, filter_snowc, & ! Settling as a result of destructive metamorphism ddz1 = -c3*dexpf - if (bi > upplim_destruct_metamorph) ddz1 = ddz1*exp(-46.0e-3_r8*(bi-upplim_destruct_metamorph)) + if (bi > params_inst%upplim_destruct_metamorph) ddz1 = & + ddz1*exp(-46.0e-3_r8*(bi-params_inst%upplim_destruct_metamorph)) ! Liquid water term diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index f65c8c7f47..3b2409344d 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -119,7 +119,6 @@ subroutine control_init(dtime) ! ! !USES: use CNMRespMod , only : CNMRespReadNML - use LunaMod , only : LunaReadNML use CNNDynamicsMod , only : CNNDynamicsReadNML use CNPhenologyMod , only : CNPhenologyReadNML use landunit_varcon , only : max_lunit @@ -584,7 +583,6 @@ subroutine control_init(dtime) call SnowHydrology_readnl ( NLFilename ) call UrbanReadNML ( NLFilename ) call HumanIndexReadNML ( NLFilename ) - call LunaReadNML ( NLFilename ) ! ---------------------------------------------------------------------- ! Broadcast all control information if appropriate diff --git a/src/main/pftconMod.F90 b/src/main/pftconMod.F90 index b987879c03..4f8a7f16fc 100644 --- a/src/main/pftconMod.F90 +++ b/src/main/pftconMod.F90 @@ -164,6 +164,7 @@ module pftconMod real(r8), allocatable :: wood_density (:) ! wood density (kg/m3) real(r8), allocatable :: crit_onset_gdd_sf(:)! scale factor for crit_onset_gdd real(r8), allocatable :: ndays_on(:) ! number of days to complete leaf onset + real(r8), allocatable :: jmaxb1(:) ! Coefficient determining the response of electron transport rate to light availability ! crop @@ -506,6 +507,7 @@ subroutine InitAllocate (this) allocate( this%wood_density (0:mxpft) ) allocate( this%crit_onset_gdd_sf (0:mxpft) ) allocate( this%ndays_on (0:mxpft) ) + allocate( this%jmaxb1 (0:mxpft) ) end subroutine InitAllocate @@ -1017,6 +1019,9 @@ subroutine InitRead(this) call ncd_io('medlynintercept', this%medlynintercept, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) + call ncd_io('jmaxb1', this%jmaxb1, 'read', ncid, readvar=readv) + if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) + call ncd_io('mxmat', this%mxmat, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) @@ -1596,6 +1601,7 @@ subroutine Clean(this) deallocate( this%taper) deallocate( this%crit_onset_gdd_sf) deallocate( this%ndays_on) + deallocate( this%jmaxb1) end subroutine Clean end module pftconMod From 77b8e8017c80af86dd85b1bc819af053fbe70ebb Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Tue, 22 Oct 2024 08:47:59 -0600 Subject: [PATCH 130/158] Make jmaxb0, wc2wjb0, r_mort pft-dimensioned --- src/biogeochem/CNGapMortalityMod.F90 | 13 +++---------- src/biogeophys/LunaMod.F90 | 28 ++++++++++++++-------------- src/main/pftconMod.F90 | 18 ++++++++++++++++++ 3 files changed, 35 insertions(+), 24 deletions(-) diff --git a/src/biogeochem/CNGapMortalityMod.F90 b/src/biogeochem/CNGapMortalityMod.F90 index 8979b1eebd..70709bce8b 100644 --- a/src/biogeochem/CNGapMortalityMod.F90 +++ b/src/biogeochem/CNGapMortalityMod.F90 @@ -34,7 +34,6 @@ module CNGapMortalityMod public :: CNGapMortality type, private :: params_type - real(r8):: am ! mortality rate based on annual rate, fractional mortality (1/yr) real(r8):: k_mort ! coeff. of growth efficiency in mortality equation end type params_type ! @@ -70,11 +69,6 @@ subroutine readParams ( ncid ) character(len=100) :: tString ! temp. var for reading !----------------------------------------------------------------------- - tString='r_mort' - call ncd_io(varname=trim(tString),data=tempr, flag='read', ncid=ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%am=tempr - tString='k_mort' call ncd_io(varname=trim(tString),data=tempr, flag='read', ncid=ncid, readvar=readv) if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) @@ -140,6 +134,7 @@ subroutine CNGapMortality (bounds, num_soilp, filter_soilp, & leafcn => pftcon%leafcn , & ! Input: [real(r8) (:)] leaf C:N (gC/gN) livewdcn => pftcon%livewdcn , & ! Input: [real(r8) (:)] live wood (phloem and ray parenchyma) C:N (gC/gN) + r_mort => pftcon%r_mort , & ! Input: [real(r8) (:)] Mortality rate (1/year) laisun => canopystate_inst%laisun_patch , & ! Input: [real(r8) (:) ] sunlit projected leaf area index laisha => canopystate_inst%laisha_patch , & ! Input: [real(r8) (:) ] shaded projected leaf area index nind => dgvs_inst%nind_patch , & ! Output:[real(r8)(:)] number of individuals (#/m2) added by F. Li and S. Levis @@ -183,8 +178,6 @@ subroutine CNGapMortality (bounds, num_soilp, filter_soilp, & ) dt = real( get_step_size(), r8 ) - ! set the mortality rate based on annual rate - am = params_inst%am ! set coeff of growth efficiency in mortality equation k_mort = params_inst%k_mort @@ -216,12 +209,12 @@ subroutine CNGapMortality (bounds, num_soilp, filter_soilp, & am = min(1._r8, am + heatstress(p)) else ! lpj didn't set this for grasses; cn does ! set the mortality rate based on annual rate - am = params_inst%am + am = r_mort(ivt(p)) end if end if - m = am/(get_average_days_per_year() * secspday) + m = r_mort(ivt(p))/(get_average_days_per_year() * secspday) !------------------------------------------------------ ! patch-level gap mortality carbon fluxes diff --git a/src/biogeophys/LunaMod.F90 b/src/biogeophys/LunaMod.F90 index 3f5f7d0e3c..04bcf8256e 100644 --- a/src/biogeophys/LunaMod.F90 +++ b/src/biogeophys/LunaMod.F90 @@ -46,8 +46,6 @@ module LunaMod real(r8) :: kc25_coef ! Michaelis-Menten const. at 25°C for CO2 (unitless) real(r8) :: ko25_coef ! Michaelis-Menten const. at 25°C for O2 (unitless) real(r8) :: luna_theta_cj ! LUNA empirical curvature parameter for ac, aj photosynthesis co-limitation (unitless) - real(r8) :: jmaxb0 ! The baseline proportion of nitrogen allocated for electron transport (J) - real(r8) :: wc2wjb0 ! The baseline ratio of rubisco limited rate vs light limited photosynthetic rate (Wc:Wj) (unitless) real(r8) :: enzyme_turnover_daily ! The daily turnover rate for photosynthetic enzyme at 25oC in view of ~7 days of half-life time for Rubisco (Suzuki et al. 2001) (unitless) real(r8) :: relhExp ! Specifies the impact of relative humidity on electron transport rate (unitless) real(r8) :: minrelh ! Minimum relative humidity for nitrogen optimization (fraction) @@ -120,10 +118,6 @@ subroutine readParams( ncid ) params_inst%kc25_coef = params_inst%kc25_coef * 1.e5_r8 ! from mol/mol to Luna units ! LUNA empirical curvature parameter for ac, aj photosynthesis co-limitation call readNcdioScalar(ncid, 'luna_theta_cj', subname, params_inst%luna_theta_cj) - ! The baseline proportion of nitrogen allocated for electron transport (J) - call readNcdioScalar(ncid, 'jmaxb0', subname, params_inst%jmaxb0) - ! The baseline ratio of rubisco limited rate vs light limited photosynthetic rate (Wc:Wj) (unitless) - call readNcdioScalar(ncid, 'wc2wjb0', subname, params_inst%wc2wjb0) ! The daily turnover rate for photosynthetic enzyme at 25oC in view of ~7 days of half-life time for Rubisco (Suzuki et al. 2001) (unitless) call readNcdioScalar(ncid, 'enzyme_turnover_daily', subname, params_inst%enzyme_turnover_daily) ! Specifies the impact of relative humidity on electron transport rate (unitless) @@ -257,7 +251,9 @@ subroutine Update_Photosynthesis_Capacity(bounds, fn, filterp, & c3psn => pftcon%c3psn , & ! photosynthetic pathway: 0. = c4, 1. = c3 slatop => pftcon%slatop , & ! specific leaf area at top of canopy, projected area basis [m^2/gC] leafcn => pftcon%leafcn , & ! leaf C:N (gC/gN) + jmaxb0 => pftcon%jmaxb0 , & ! Baseline proportion of nitrogen allocated for electron transport (J) jmaxb1 => pftcon%jmaxb1 , & ! Coefficient determining the response of electron transport rate to light availability (-) + wc2wjb0 => pftcon%wc2wjb0 , & ! The baseline ratio of rubisco limited rate vs light limited photosynthetic rate (Wc:Wj) (-) forc_pbot10 => atm2lnd_inst%forc_pbot240_downscaled_patch , & ! Input: [real(r8) (:) ] 10 day mean atmospheric pressure(Pa) CO2_p240 => atm2lnd_inst%forc_pco2_240_patch , & ! Input: [real(r8) (:) ] 10-day mean CO2 partial pressure (Pa) O2_p240 => atm2lnd_inst%forc_po2_240_patch , & ! Input: [real(r8) (:) ] 10-day mean O2 partial pressure (Pa) @@ -383,7 +379,7 @@ subroutine Update_Photosynthesis_Capacity(bounds, fn, filterp, & PNcbold = 0.0_r8 call NitrogenAllocation(FNCa,forc_pbot10(p), relh10, CO2a10, O2a10, PARi10, PARimx10, rb10v, hourpd, & tair10, tleafd10, tleafn10, & - jmaxb1(ft), PNlcold, PNetold, PNrespold, PNcbold, dayl_factor(p), & + jmaxb0(ft), jmaxb1(ft), wc2wjb0(ft), PNlcold, PNetold, PNrespold, PNcbold, dayl_factor(p), & o3coefjmax(p), PNstoreopt, PNlcopt, PNetopt, PNrespopt, PNcbopt) vcmx25_opt= PNcbopt * FNCa * Fc25 jmx25_opt= PNetopt * FNCa * Fj25 @@ -769,7 +765,7 @@ end subroutine Clear24_Climate_LUNA !************************************************************************************************************************************************ !Use the LUNA model to calculate the Nitrogen partioning subroutine NitrogenAllocation(FNCa,forc_pbot10, relh10, CO2a10,O2a10, PARi10,PARimx10,rb10, hourpd, tair10, tleafd10, tleafn10, & - jmaxb1, PNlcold, PNetold, PNrespold, PNcbold, dayl_factor,o3coefjmax, & + jmaxb0, jmaxb1, wc2wjb0, PNlcold, PNetold, PNrespold, PNcbold, dayl_factor,o3coefjmax, & PNstoreopt, PNlcopt, PNetopt, PNrespopt, PNcbopt) implicit none real(r8), intent (in) :: FNCa !Area based functional nitrogen content (g N/m2 leaf) @@ -784,7 +780,9 @@ subroutine NitrogenAllocation(FNCa,forc_pbot10, relh10, CO2a10,O2a10, PARi10,PAR real(r8), intent (in) :: tair10 !10-day running mean of the 2m temperature (oC) real(r8), intent (in) :: tleafd10 !10-day running mean of daytime leaf temperature (oC) real(r8), intent (in) :: tleafn10 !10-day running mean of nighttime leaf temperature (oC) + real(r8), intent (in) :: jmaxb0 !Baseline proportion of nitrogen allocated for electron transport (J) real(r8), intent (in) :: jmaxb1 !coefficient determining the response of electron transport rate to light availability (unitless) + real(r8), intent (in) :: wc2wjb0 !The baseline ratio of rubisco limited rate vs light limited photosynthetic rate (Wc:Wj) (-) real(r8), intent (in) :: PNlcold !old value of the proportion of nitrogen allocated to light capture (unitless) real(r8), intent (in) :: PNetold !old value of the proportion of nitrogen allocated to electron transport (unitless) real(r8), intent (in) :: PNrespold !old value of the proportion of nitrogen allocated to respiration (unitless) @@ -886,7 +884,7 @@ subroutine NitrogenAllocation(FNCa,forc_pbot10, relh10, CO2a10,O2a10, PARi10,PAR call Nitrogen_investments (KcKjFlag,FNCa, Nlc, forc_pbot10, relh10, CO2a10,O2a10, PARi10c, PARimx10c,rb10, hourpd, tair10, & tleafd10c,tleafn10c, & Kj2Kc, JmaxCoef, Fc,Fj, NUEc, NUEj, NUEcref, NUEjref, NUEr, o3coefjmax, & - Kc, Kj, ci, & + jmaxb0, wc2wjb0, Kc, Kj, ci, & Vcmax, Jmax,JmeanL,JmaxL, Net, Ncb, Nresp, PSN, RESP) Npsntarget = Nlc + Ncb + Net !target nitrogen allocated to photosynthesis, which may be lower or higher than Npsn_avail @@ -901,7 +899,7 @@ subroutine NitrogenAllocation(FNCa,forc_pbot10, relh10, CO2a10,O2a10, PARi10,PAR call Nitrogen_investments (KcKjFlag,FNCa, Nlc2, forc_pbot10, relh10, CO2a10,O2a10, PARi10c, PARimx10c,rb10, hourpd, & tair10, tleafd10c,tleafn10c, & Kj2Kc, JmaxCoef, Fc,Fj, NUEc, NUEj, NUEcref, NUEjref,NUEr, o3coefjmax, & - Kc, Kj, ci, & + jmaxb0, wc2wjb0, Kc, Kj, ci, & Vcmax, Jmax,JmeanL,JmaxL, Net2, Ncb2, Nresp2, PSN2, RESP2) Npsntarget2 = Nlc2 + Ncb2 + Net2 @@ -930,7 +928,7 @@ subroutine NitrogenAllocation(FNCa,forc_pbot10, relh10, CO2a10,O2a10, PARi10,PAR call Nitrogen_investments (KcKjFlag,FNCa, Nlc1,forc_pbot10, relh10, CO2a10,O2a10, PARi10c, PARimx10c,rb10, hourpd, & tair10, tleafd10c,tleafn10c, & Kj2Kc, JmaxCoef, Fc,Fj, NUEc, NUEj, NUEcref, NUEjref,NUEr, o3coefjmax, & - Kc, Kj, ci,& + jmaxb0, wc2wjb0, Kc, Kj, ci,& Vcmax, Jmax,JmeanL,JmaxL, Net1, Ncb1, Nresp1, PSN1, RESP1) Npsntarget1 = Nlc1 + Ncb1 + Net1 Carboncost1 = (Npsntarget - Npsntarget1) * NMCp25 * Cv * (RespTBernacchi(tleafd10c) * hourpd + & @@ -961,7 +959,7 @@ end subroutine NitrogenAllocation subroutine Nitrogen_investments (KcKjFlag, FNCa, Nlc, forc_pbot10, relh10, & CO2a10, O2a10, PARi10, PARimx10, rb10, hourpd, tair10, tleafd10, tleafn10, & Kj2Kc, JmaxCoef, Fc, Fj, NUEc, NUEj, NUEcref, NUEjref, NUEr, o3coefjmax, & - Kc, Kj, ci, Vcmax, Jmax, JmeanL, JmaxL, Net, Ncb, Nresp, PSN, RESP) + jmaxb0, wc2wjb0, Kc, Kj, ci, Vcmax, Jmax, JmeanL, JmaxL, Net, Ncb, Nresp, PSN, RESP) implicit none integer, intent (in) :: KcKjFlag !flag to indicate whether to update the Kc and Kj using the photosynthesis subroutine; 0--Kc and Kj need to be calculated; 1--Kc and Kj is prescribed. real(r8), intent (in) :: FNCa !Area based functional nitrogen content (g N/m2 leaf) @@ -987,6 +985,8 @@ subroutine Nitrogen_investments (KcKjFlag, FNCa, Nlc, forc_pbot10, relh10, & real(r8), intent (in) :: NUEjref !nitrogen use efficiency for electron transport under reference climates real(r8), intent (in) :: NUEr !nitrogen use efficiency for respiration real(r8), intent (in) :: o3coefjmax !ozone coef jmax + real(r8), intent (in) :: jmaxb0 !Baseline proportion of nitrogen allocated for electron transport (J) + real(r8), intent (in) :: wc2wjb0 !The baseline ratio of rubisco limited rate vs light limited photosynthetic rate (Wc:Wj) (-) real(r8), intent (inout) :: Kc !conversion factors from Vc,max to Wc real(r8), intent (inout) :: Kj !conversion factor from electron transport rate to Wj @@ -1016,7 +1016,7 @@ subroutine Nitrogen_investments (KcKjFlag, FNCa, Nlc, forc_pbot10, relh10, & theta = 0.292_r8 / (1.0_r8 + 0.076_r8 / (Nlc * Cb)) ELTRNabsorb = theta * PARi10 - Jmaxb0act = params_inst%jmaxb0 * FNCa * Fj + Jmaxb0act = jmaxb0 * FNCa * Fj ! Default value of o3coefjmax is 1 --> ! o3coefjmax is only different from 1 if ozone_inst%stress_method == 'stress_falk' @@ -1026,7 +1026,7 @@ subroutine Nitrogen_investments (KcKjFlag, FNCa, Nlc, forc_pbot10, relh10, & JmaxL = theta * PARimx10 / (sqrt(1.0_r8 + (theta * PARimx10 / Jmax)**2.0_r8)) NUEchg = (NUEc / NUEcref) * (NUEjref / NUEj) - Wc2Wj = params_inst%wc2wjb0 * (NUEchg**0.5_r8) + Wc2Wj = wc2wjb0 * (NUEchg**0.5_r8) Vcmax = Wc2Wj * JmaxL * Kj2Kc JmeanL = theta * PARi10 / (sqrt(1.0_r8 + (ELTRNabsorb / Jmax)**2.0_r8)) if(KcKjFlag.eq.0)then !update the Kc,Kj, anc ci information diff --git a/src/main/pftconMod.F90 b/src/main/pftconMod.F90 index 4f8a7f16fc..0bb9ef23da 100644 --- a/src/main/pftconMod.F90 +++ b/src/main/pftconMod.F90 @@ -164,7 +164,10 @@ module pftconMod real(r8), allocatable :: wood_density (:) ! wood density (kg/m3) real(r8), allocatable :: crit_onset_gdd_sf(:)! scale factor for crit_onset_gdd real(r8), allocatable :: ndays_on(:) ! number of days to complete leaf onset + real(r8), allocatable :: jmaxb0(:) ! Baseline proportion of nitrogen allocated for electron transport (J) real(r8), allocatable :: jmaxb1(:) ! Coefficient determining the response of electron transport rate to light availability + real(r8), allocatable :: wc2wjb0(:) ! The baseline ratio of rubisco limited rate vs light limited photosynthetic rate (Wc:Wj) (-) + real(r8), allocatable :: r_mort(:) ! Mortality rate (1/year) ! crop @@ -507,7 +510,10 @@ subroutine InitAllocate (this) allocate( this%wood_density (0:mxpft) ) allocate( this%crit_onset_gdd_sf (0:mxpft) ) allocate( this%ndays_on (0:mxpft) ) + allocate( this%jmaxb0 (0:mxpft) ) allocate( this%jmaxb1 (0:mxpft) ) + allocate( this%wc2wjb0 (0:mxpft) ) + allocate( this%r_mort (0:mxpft) ) end subroutine InitAllocate @@ -1019,9 +1025,18 @@ subroutine InitRead(this) call ncd_io('medlynintercept', this%medlynintercept, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) + call ncd_io('jmaxb0', this%jmaxb0, 'read', ncid, readvar=readv) + if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) + call ncd_io('jmaxb1', this%jmaxb1, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) + call ncd_io('wc2wjb0', this%wc2wjb0, 'read', ncid, readvar=readv) + if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) + + call ncd_io('r_mort', this%r_mort, 'read', ncid, readvar=readv) + if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) + call ncd_io('mxmat', this%mxmat, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) @@ -1601,7 +1616,10 @@ subroutine Clean(this) deallocate( this%taper) deallocate( this%crit_onset_gdd_sf) deallocate( this%ndays_on) + deallocate( this%jmaxb0) deallocate( this%jmaxb1) + deallocate( this%wc2wjb0) + deallocate( this%r_mort) end subroutine Clean end module pftconMod From b7121a6704265cd58fe1af493cf6b668d29aabe9 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Tue, 22 Oct 2024 10:46:46 -0600 Subject: [PATCH 131/158] ncd_io not needed after all --- src/biogeophys/LunaMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biogeophys/LunaMod.F90 b/src/biogeophys/LunaMod.F90 index 04bcf8256e..366fa68f4b 100644 --- a/src/biogeophys/LunaMod.F90 +++ b/src/biogeophys/LunaMod.F90 @@ -92,7 +92,7 @@ module LunaMod subroutine readParams( ncid ) ! ! !USES: - use ncdio_pio, only: file_desc_t,ncd_io + use ncdio_pio, only: file_desc_t use paramUtilMod, only: readNcdioScalar ! ! !ARGUMENTS: From 3f4936c91a8ca79c3fce486b34c6bbcdf074210b Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Tue, 22 Oct 2024 10:52:34 -0600 Subject: [PATCH 132/158] Other variables not needed after all --- src/biogeophys/LunaMod.F90 | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/biogeophys/LunaMod.F90 b/src/biogeophys/LunaMod.F90 index 366fa68f4b..21e05dc0c6 100644 --- a/src/biogeophys/LunaMod.F90 +++ b/src/biogeophys/LunaMod.F90 @@ -12,7 +12,7 @@ module LunaMod use clm_varcon , only : rgas, tfrz,spval use abortutils , only : endrun use clm_varctl , only : iulog - use clm_varpar , only : nlevcan, mxpft + use clm_varpar , only : nlevcan use decompMod , only : bounds_type, subgrid_level_patch use pftconMod , only : pftcon use FrictionvelocityMod , only : frictionvel_type @@ -101,10 +101,6 @@ subroutine readParams( ncid ) ! ! !LOCAL VARIABLES: character(len=*), parameter :: subname = 'readParams_Luna' - character(len=100) :: errCode = '-Error reading in parameters file:' - logical :: readv ! has variable been read in or not - real(r8) :: temp1d(0:mxpft) ! temporary to read in parameter - character(len=100) :: tString ! temp. var for reading !-------------------------------------------------------------------- ! CO2 compensation point at 25°C at present day O2 levels @@ -170,7 +166,7 @@ subroutine Update_Photosynthesis_Capacity(bounds, fn, filterp, & ! !USES: use clm_time_manager , only : get_step_size_real - use clm_varpar , only : nlevsoi, mxpft + use clm_varpar , only : nlevsoi use perf_mod , only : t_startf, t_stopf use clm_varctl , only : use_cn use quadraticMod , only : quadratic From bc3d51892d4e701cd8b5a57f8010c30dc6de7d49 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Tue, 22 Oct 2024 11:04:17 -0600 Subject: [PATCH 133/158] Consistent naming of units --- src/biogeophys/LunaMod.F90 | 2 +- src/biogeophys/SnowHydrologyMod.F90 | 2 +- src/main/pftconMod.F90 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/biogeophys/LunaMod.F90 b/src/biogeophys/LunaMod.F90 index 21e05dc0c6..0727e84e7a 100644 --- a/src/biogeophys/LunaMod.F90 +++ b/src/biogeophys/LunaMod.F90 @@ -777,7 +777,7 @@ subroutine NitrogenAllocation(FNCa,forc_pbot10, relh10, CO2a10,O2a10, PARi10,PAR real(r8), intent (in) :: tleafd10 !10-day running mean of daytime leaf temperature (oC) real(r8), intent (in) :: tleafn10 !10-day running mean of nighttime leaf temperature (oC) real(r8), intent (in) :: jmaxb0 !Baseline proportion of nitrogen allocated for electron transport (J) - real(r8), intent (in) :: jmaxb1 !coefficient determining the response of electron transport rate to light availability (unitless) + real(r8), intent (in) :: jmaxb1 !coefficient determining the response of electron transport rate to light availability (-) real(r8), intent (in) :: wc2wjb0 !The baseline ratio of rubisco limited rate vs light limited photosynthetic rate (Wc:Wj) (-) real(r8), intent (in) :: PNlcold !old value of the proportion of nitrogen allocated to light capture (unitless) real(r8), intent (in) :: PNetold !old value of the proportion of nitrogen allocated to electron transport (unitless) diff --git a/src/biogeophys/SnowHydrologyMod.F90 b/src/biogeophys/SnowHydrologyMod.F90 index 57e9088ece..578769d9ea 100644 --- a/src/biogeophys/SnowHydrologyMod.F90 +++ b/src/biogeophys/SnowHydrologyMod.F90 @@ -87,7 +87,7 @@ module SnowHydrologyMod real(r8) :: scvng_fct_mlt_dst4 ! scavenging factor for dust species 4 inclusion in meltwater [frc] real(r8) :: ceta ! Overburden compaction constant (kg/m3) real(r8) :: snw_rds_min ! minimum allowed snow effective radius (also cold "fresh snow" value) [microns] - real(r8) :: upplim_destruct_metamorph ! Upper limit on destructive metamorphism compaction + real(r8) :: upplim_destruct_metamorph ! Upper limit on destructive metamorphism compaction (kg/m3) end type params_type type(params_type), private :: params_inst diff --git a/src/main/pftconMod.F90 b/src/main/pftconMod.F90 index 0bb9ef23da..965b21ec70 100644 --- a/src/main/pftconMod.F90 +++ b/src/main/pftconMod.F90 @@ -165,7 +165,7 @@ module pftconMod real(r8), allocatable :: crit_onset_gdd_sf(:)! scale factor for crit_onset_gdd real(r8), allocatable :: ndays_on(:) ! number of days to complete leaf onset real(r8), allocatable :: jmaxb0(:) ! Baseline proportion of nitrogen allocated for electron transport (J) - real(r8), allocatable :: jmaxb1(:) ! Coefficient determining the response of electron transport rate to light availability + real(r8), allocatable :: jmaxb1(:) ! Coefficient determining the response of electron transport rate to light availability (-) real(r8), allocatable :: wc2wjb0(:) ! The baseline ratio of rubisco limited rate vs light limited photosynthetic rate (Wc:Wj) (-) real(r8), allocatable :: r_mort(:) ! Mortality rate (1/year) From e5100a4d5949a0676103dc99d393478fc6aaf258 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Wed, 23 Oct 2024 08:33:36 -0600 Subject: [PATCH 134/158] New versions of specialized parameter files --- cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/user_nl_clm | 2 +- .../clm/clm60_monthly_matrixcn_soilCN30/user_nl_clm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/user_nl_clm index 3462b802c7..5aa0b903d0 100644 --- a/cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/user_nl_clm @@ -1,2 +1,2 @@ -paramfile = '$DIN_LOC_ROOT/lnd/clm2/paramdata/ctsm51_ciso_cwd_hr_params.c240814.nc' +paramfile = '/glade/campaign/cgd/tss/people/oleson/modify_param/ctsm51_ciso_cwd_hr_params.c241017.nc' hist_fincl1 = 'CWDC_HR','C13_CWDC_HR','C14_CWDC_HR','CWD_HR_L2','CWD_HR_L2_vr','CWD_HR_L3','CWD_HR_L3_vr' diff --git a/cime_config/testdefs/testmods_dirs/clm/clm60_monthly_matrixcn_soilCN30/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/clm60_monthly_matrixcn_soilCN30/user_nl_clm index d51360c82b..c41856fb01 100644 --- a/cime_config/testdefs/testmods_dirs/clm/clm60_monthly_matrixcn_soilCN30/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/clm60_monthly_matrixcn_soilCN30/user_nl_clm @@ -1,2 +1,2 @@ use_soil_matrixcn = .true. -paramfile = '$DIN_LOC_ROOT/lnd/clm2/paramdata/ctsm60_params_cn30.c240822.nc' +paramfile = '/glade/campaign/cgd/tss/people/oleson/modify_param/ctsm60_params_cn30.c241017.nc' From 28d552efb06a8bb345458e4fcbfbc73692a3fb8d Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Thu, 24 Oct 2024 09:41:35 -0600 Subject: [PATCH 135/158] Reinstate SMS_Lm1.f10_f10_mg37.I1850Clm60Bgc.derecho_intel.clm-clm60_monthly_matrixcn_soilCN30 --- cime_config/testdefs/testlist_clm.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 490748c7e7..b178570add 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -863,6 +863,15 @@ + + + + + + + + + From 157107632490551b79bc5542db5d3d3e47b5a94b Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Sat, 26 Oct 2024 09:01:55 -0600 Subject: [PATCH 136/158] Move read of jmaxb0,jmaxb1,wc2wjb0 from pftcon to LunaMod and r_mort to CNGapMortality --- src/biogeochem/CNGapMortalityMod.F90 | 38 +++++++++++++++++-- src/biogeophys/LunaMod.F90 | 56 ++++++++++++++++++++++++---- src/main/pftconMod.F90 | 24 ------------ 3 files changed, 84 insertions(+), 34 deletions(-) diff --git a/src/biogeochem/CNGapMortalityMod.F90 b/src/biogeochem/CNGapMortalityMod.F90 index 70709bce8b..73ff0bc911 100644 --- a/src/biogeochem/CNGapMortalityMod.F90 +++ b/src/biogeochem/CNGapMortalityMod.F90 @@ -9,9 +9,11 @@ module CNGapMortalityMod ! ! !USES: use shr_kind_mod , only : r8 => shr_kind_r8 + use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) use decompMod , only : bounds_type use abortutils , only : endrun use shr_log_mod , only : errMsg => shr_log_errMsg + use clm_varpar , only : mxpft use pftconMod , only : pftcon use CNDVType , only : dgvs_type use CNVegCarbonStateType , only : cnveg_carbonstate_type, spinup_factor_deadwood @@ -35,6 +37,9 @@ module CNGapMortalityMod type, private :: params_type real(r8):: k_mort ! coeff. of growth efficiency in mortality equation + real(r8), allocatable :: r_mort(:) ! Mortality rate (1/year) + contains + procedure, private :: allocParams ! Allocate the parameters end type params_type ! type(params_type), private :: params_inst @@ -48,6 +53,24 @@ module CNGapMortalityMod contains + !----------------------------------------------------------------------- + subroutine allocParams ( this ) + ! + implicit none + + ! !ARGUMENTS: + class(params_type) :: this + ! + ! !LOCAL VARIABLES: + character(len=32) :: subname = 'allocParams' + !----------------------------------------------------------------------- + + ! allocate parameters + + allocate( this%r_mort (0:mxpft) ) ; this%r_mort(:) = nan + + end subroutine allocParams + !----------------------------------------------------------------------- subroutine readParams ( ncid ) ! @@ -66,6 +89,7 @@ subroutine readParams ( ncid ) character(len=100) :: errCode = '-Error reading in parameters file:' logical :: readv ! has variable been read in or not real(r8) :: tempr ! temporary to read in constant + real(r8) :: temp1d(0:mxpft) ! temporary to read in parameter character(len=100) :: tString ! temp. var for reading !----------------------------------------------------------------------- @@ -73,6 +97,13 @@ subroutine readParams ( ncid ) call ncd_io(varname=trim(tString),data=tempr, flag='read', ncid=ncid, readvar=readv) if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) params_inst%k_mort=tempr + + call params_inst%allocParams() + + tString='r_mort' + call ncd_io(varname=trim(tString),data=temp1d, flag='read', ncid=ncid, readvar=readv) + if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) + params_inst%r_mort=temp1d end subroutine readParams @@ -134,7 +165,6 @@ subroutine CNGapMortality (bounds, num_soilp, filter_soilp, & leafcn => pftcon%leafcn , & ! Input: [real(r8) (:)] leaf C:N (gC/gN) livewdcn => pftcon%livewdcn , & ! Input: [real(r8) (:)] live wood (phloem and ray parenchyma) C:N (gC/gN) - r_mort => pftcon%r_mort , & ! Input: [real(r8) (:)] Mortality rate (1/year) laisun => canopystate_inst%laisun_patch , & ! Input: [real(r8) (:) ] sunlit projected leaf area index laisha => canopystate_inst%laisha_patch , & ! Input: [real(r8) (:) ] shaded projected leaf area index nind => dgvs_inst%nind_patch , & ! Output:[real(r8)(:)] number of individuals (#/m2) added by F. Li and S. Levis @@ -209,12 +239,14 @@ subroutine CNGapMortality (bounds, num_soilp, filter_soilp, & am = min(1._r8, am + heatstress(p)) else ! lpj didn't set this for grasses; cn does ! set the mortality rate based on annual rate - am = r_mort(ivt(p)) + am = params_inst%r_mort(ivt(p)) end if + else + am = params_inst%r_mort(ivt(p)) end if - m = r_mort(ivt(p))/(get_average_days_per_year() * secspday) + m = am/(get_average_days_per_year() * secspday) !------------------------------------------------------ ! patch-level gap mortality carbon fluxes diff --git a/src/biogeophys/LunaMod.F90 b/src/biogeophys/LunaMod.F90 index 0727e84e7a..5641846309 100644 --- a/src/biogeophys/LunaMod.F90 +++ b/src/biogeophys/LunaMod.F90 @@ -9,10 +9,11 @@ module LunaMod ! !USES: use shr_kind_mod , only : r8 => shr_kind_r8 use shr_log_mod , only : errMsg => shr_log_errMsg + use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) use clm_varcon , only : rgas, tfrz,spval use abortutils , only : endrun use clm_varctl , only : iulog - use clm_varpar , only : nlevcan + use clm_varpar , only : nlevcan, mxpft use decompMod , only : bounds_type, subgrid_level_patch use pftconMod , only : pftcon use FrictionvelocityMod , only : frictionvel_type @@ -49,6 +50,11 @@ module LunaMod real(r8) :: enzyme_turnover_daily ! The daily turnover rate for photosynthetic enzyme at 25oC in view of ~7 days of half-life time for Rubisco (Suzuki et al. 2001) (unitless) real(r8) :: relhExp ! Specifies the impact of relative humidity on electron transport rate (unitless) real(r8) :: minrelh ! Minimum relative humidity for nitrogen optimization (fraction) + real(r8), allocatable :: jmaxb0(:) ! Baseline proportion of nitrogen allocated for electron transport (J) + real(r8), allocatable :: jmaxb1(:) ! Coefficient determining the response of electron transport rate to light availability (-) + real(r8), allocatable :: wc2wjb0(:) ! The baseline ratio of rubisco limited rate vs light limited photosynthetic rate (Wc:Wj) (-) + contains + procedure, private :: allocParams ! Allocate the parameters end type params_type type(params_type), private :: params_inst @@ -88,11 +94,31 @@ module LunaMod contains + !----------------------------------------------------------------------- + subroutine allocParams ( this ) + ! + implicit none + + ! !ARGUMENTS: + class(params_type) :: this + ! + ! !LOCAL VARIABLES: + character(len=32) :: subname = 'allocParams' + !----------------------------------------------------------------------- + + ! allocate parameters + + allocate( this%jmaxb0 (0:mxpft) ) ; this%jmaxb0(:) = nan + allocate( this%jmaxb1 (0:mxpft) ) ; this%jmaxb1(:) = nan + allocate( this%wc2wjb0 (0:mxpft) ) ; this%wc2wjb0(:) = nan + + end subroutine allocParams + !---------------------------------------------------------------------------- subroutine readParams( ncid ) ! ! !USES: - use ncdio_pio, only: file_desc_t + use ncdio_pio, only: file_desc_t,ncd_io use paramUtilMod, only: readNcdioScalar ! ! !ARGUMENTS: @@ -101,6 +127,10 @@ subroutine readParams( ncid ) ! ! !LOCAL VARIABLES: character(len=*), parameter :: subname = 'readParams_Luna' + character(len=100) :: errCode = '-Error reading in parameters file:' + logical :: readv ! has variable been read in or not + real(r8) :: temp1d(0:mxpft) ! temporary to read in parameter + character(len=100) :: tString ! temp. var for reading !-------------------------------------------------------------------- ! CO2 compensation point at 25°C at present day O2 levels @@ -121,6 +151,21 @@ subroutine readParams( ncid ) ! Minimum relative humidity for nitrogen optimization (fraction) call readNcdioScalar(ncid, 'minrelh', subname, params_inst%minrelh) + call params_inst%allocParams() + + tString = "jmaxb0" + call ncd_io(varname=trim(tString),data=temp1d, flag='read', ncid=ncid, readvar=readv) + if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) + params_inst%jmaxb0=temp1d + tString = "jmaxb1" + call ncd_io(varname=trim(tString),data=temp1d, flag='read', ncid=ncid, readvar=readv) + if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) + params_inst%jmaxb1=temp1d + tString = "wc2wjb0" + call ncd_io(varname=trim(tString),data=temp1d, flag='read', ncid=ncid, readvar=readv) + if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) + params_inst%wc2wjb0=temp1d + end subroutine readParams !----------------------------------------------------------------------- @@ -247,9 +292,6 @@ subroutine Update_Photosynthesis_Capacity(bounds, fn, filterp, & c3psn => pftcon%c3psn , & ! photosynthetic pathway: 0. = c4, 1. = c3 slatop => pftcon%slatop , & ! specific leaf area at top of canopy, projected area basis [m^2/gC] leafcn => pftcon%leafcn , & ! leaf C:N (gC/gN) - jmaxb0 => pftcon%jmaxb0 , & ! Baseline proportion of nitrogen allocated for electron transport (J) - jmaxb1 => pftcon%jmaxb1 , & ! Coefficient determining the response of electron transport rate to light availability (-) - wc2wjb0 => pftcon%wc2wjb0 , & ! The baseline ratio of rubisco limited rate vs light limited photosynthetic rate (Wc:Wj) (-) forc_pbot10 => atm2lnd_inst%forc_pbot240_downscaled_patch , & ! Input: [real(r8) (:) ] 10 day mean atmospheric pressure(Pa) CO2_p240 => atm2lnd_inst%forc_pco2_240_patch , & ! Input: [real(r8) (:) ] 10-day mean CO2 partial pressure (Pa) O2_p240 => atm2lnd_inst%forc_po2_240_patch , & ! Input: [real(r8) (:) ] 10-day mean O2 partial pressure (Pa) @@ -375,7 +417,8 @@ subroutine Update_Photosynthesis_Capacity(bounds, fn, filterp, & PNcbold = 0.0_r8 call NitrogenAllocation(FNCa,forc_pbot10(p), relh10, CO2a10, O2a10, PARi10, PARimx10, rb10v, hourpd, & tair10, tleafd10, tleafn10, & - jmaxb0(ft), jmaxb1(ft), wc2wjb0(ft), PNlcold, PNetold, PNrespold, PNcbold, dayl_factor(p), & + params_inst%jmaxb0(ft), params_inst%jmaxb1(ft), params_inst%wc2wjb0(ft), PNlcold, PNetold, & + PNrespold, PNcbold, dayl_factor(p), & o3coefjmax(p), PNstoreopt, PNlcopt, PNetopt, PNrespopt, PNcbopt) vcmx25_opt= PNcbopt * FNCa * Fc25 jmx25_opt= PNetopt * FNCa * Fj25 @@ -1362,7 +1405,6 @@ subroutine Quadratic(a,b,c,r1,r2) end if end subroutine Quadratic - end module LunaMod diff --git a/src/main/pftconMod.F90 b/src/main/pftconMod.F90 index 965b21ec70..b987879c03 100644 --- a/src/main/pftconMod.F90 +++ b/src/main/pftconMod.F90 @@ -164,10 +164,6 @@ module pftconMod real(r8), allocatable :: wood_density (:) ! wood density (kg/m3) real(r8), allocatable :: crit_onset_gdd_sf(:)! scale factor for crit_onset_gdd real(r8), allocatable :: ndays_on(:) ! number of days to complete leaf onset - real(r8), allocatable :: jmaxb0(:) ! Baseline proportion of nitrogen allocated for electron transport (J) - real(r8), allocatable :: jmaxb1(:) ! Coefficient determining the response of electron transport rate to light availability (-) - real(r8), allocatable :: wc2wjb0(:) ! The baseline ratio of rubisco limited rate vs light limited photosynthetic rate (Wc:Wj) (-) - real(r8), allocatable :: r_mort(:) ! Mortality rate (1/year) ! crop @@ -510,10 +506,6 @@ subroutine InitAllocate (this) allocate( this%wood_density (0:mxpft) ) allocate( this%crit_onset_gdd_sf (0:mxpft) ) allocate( this%ndays_on (0:mxpft) ) - allocate( this%jmaxb0 (0:mxpft) ) - allocate( this%jmaxb1 (0:mxpft) ) - allocate( this%wc2wjb0 (0:mxpft) ) - allocate( this%r_mort (0:mxpft) ) end subroutine InitAllocate @@ -1025,18 +1017,6 @@ subroutine InitRead(this) call ncd_io('medlynintercept', this%medlynintercept, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - call ncd_io('jmaxb0', this%jmaxb0, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('jmaxb1', this%jmaxb1, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('wc2wjb0', this%wc2wjb0, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('r_mort', this%r_mort, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - call ncd_io('mxmat', this%mxmat, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) @@ -1616,10 +1596,6 @@ subroutine Clean(this) deallocate( this%taper) deallocate( this%crit_onset_gdd_sf) deallocate( this%ndays_on) - deallocate( this%jmaxb0) - deallocate( this%jmaxb1) - deallocate( this%wc2wjb0) - deallocate( this%r_mort) end subroutine Clean end module pftconMod From 0fd1a04d9a59c8e92d516cb0bbb992cba602589e Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Sun, 27 Oct 2024 14:15:24 -0600 Subject: [PATCH 137/158] Final paths for parameter files --- bld/namelist_files/namelist_defaults_ctsm.xml | 8 ++++---- .../testdefs/testmods_dirs/clm/ciso_cwd_hr/user_nl_clm | 2 +- .../clm/clm60_monthly_matrixcn_soilCN30/user_nl_clm | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index c93c4f5696..54d3afd5c1 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -544,10 +544,10 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -/glade/campaign/cgd/tss/people/oleson/modify_param/ctsm60_params.c241017.nc -/glade/campaign/cgd/tss/people/oleson/modify_param/ctsm51_params.c241017.nc -/glade/campaign/cgd/tss/people/oleson/modify_param/clm50_params.c241017.nc -/glade/campaign/cgd/tss/people/oleson/modify_param/clm45_params.c241017.nc +lnd/clm2/paramdata/ctsm60_params.c241017.nc +lnd/clm2/paramdata/ctsm51_params.c241017.nc +lnd/clm2/paramdata/clm50_params.c241017.nc +lnd/clm2/paramdata/clm45_params.c241017.nc diff --git a/cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/user_nl_clm index 5aa0b903d0..edeb0fce21 100644 --- a/cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/user_nl_clm @@ -1,2 +1,2 @@ -paramfile = '/glade/campaign/cgd/tss/people/oleson/modify_param/ctsm51_ciso_cwd_hr_params.c241017.nc' +paramfile = '$DIN_LOC_ROOT/lnd/clm2/paramdata/ctsm51_ciso_cwd_hr_params.c241017.nc' hist_fincl1 = 'CWDC_HR','C13_CWDC_HR','C14_CWDC_HR','CWD_HR_L2','CWD_HR_L2_vr','CWD_HR_L3','CWD_HR_L3_vr' diff --git a/cime_config/testdefs/testmods_dirs/clm/clm60_monthly_matrixcn_soilCN30/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/clm60_monthly_matrixcn_soilCN30/user_nl_clm index c41856fb01..b1d856797d 100644 --- a/cime_config/testdefs/testmods_dirs/clm/clm60_monthly_matrixcn_soilCN30/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/clm60_monthly_matrixcn_soilCN30/user_nl_clm @@ -1,2 +1,2 @@ use_soil_matrixcn = .true. -paramfile = '/glade/campaign/cgd/tss/people/oleson/modify_param/ctsm60_params_cn30.c241017.nc' +paramfile = '$DIN_LOC_ROOT/lnd/clm2/paramdata/ctsm60_params_cn30.c241017.nc' From 152f5d6d814272bd1aee2a76e0069093999de6ef Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 29 Oct 2024 18:29:17 -0600 Subject: [PATCH 138/158] Remove/replace refs to DATM_C*_YR_* variables --- ...tmospheric-forcing-to-spinup-the-model.rst | 4 +-- .../customizing-the-clm-configuration.rst | 34 ++++++------------- src/main/clm_varctl.F90 | 2 +- tools/contrib/run_clm_historical | 12 +++---- tools/contrib/run_clmtowers | 14 ++++---- 5 files changed, 27 insertions(+), 39 deletions(-) diff --git a/doc/source/users_guide/running-special-cases/Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst b/doc/source/users_guide/running-special-cases/Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst index 769755937d..a81465c699 100644 --- a/doc/source/users_guide/running-special-cases/Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst +++ b/doc/source/users_guide/running-special-cases/Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst @@ -10,7 +10,7 @@ Because it takes so long to spinup the CN model (as we just saw previously), if In this example we will use the ``I1850Clm50BgcSpinup compset`` to setup CLM to run with atmospheric forcing from a previous fully coupled simulation with data that is already stored on disk on Cheyenne. There are several simulations that have high frequency data for which we can do this. You can also do this on a machine other than Cheyenne, but would need to download the data from the Earth System Grid and change the datapath similar to Example :numref:`eg-sim-data-from-prev-sim`. -Example: Simulation with MOAR Data on cheyenne +Example: Simulation with MOAR Data on derecho ------------------------------------------------------------- :: @@ -21,7 +21,7 @@ Example: Simulation with MOAR Data on cheyenne > ./xmlchange DATM_CPL_CASE=b40.1850.track1.1deg.006a # The following sets the align year and years to run over for atm forcing # (you could also use an editor) - > ./xmlchange DATM_CPL_YR_ALIGN=1,DATM_CPL_YR_START=960,DATM_CPL_YR_END=1030 + > ./xmlchange DATM_YR_ALIGN=1,DATM_YR_START=960,DATM_YR_END=1030 > ./case.setup # Now build and run as normal > ./case.build diff --git a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst index 7cd8ce9c9c..11e996ae5d 100644 --- a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst +++ b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst @@ -510,13 +510,10 @@ For running "I" cases there are several other noteworthy configuration items tha CCSM_BGC DATM_MODE DATM_PRESAERO - DATM_CLMNCEP_YR_ALIGN - DATM_CLMNCEP_YR_START - DATM_CLMNCEP_YR_END + DATM_YR_ALIGN + DATM_YR_START + DATM_YR_END DATM_CPL_CASE - DATM_CPL_YR_ALIGN - DATM_CPL_YR_START - DATM_CPL_YR_END ``CCSM_CO2_PPMV`` Sets the mixing ratio of CO2 in parts per million by volume for ALL CESM components to use. Note that most compsets already set this value to something reasonable. Also note that some compsets may tell the atmosphere model to override this value with either historic or ramped values. If the ``CCSM_BGC`` variable is set to something other than "none" the atmosphere model will determine CO2, and CLM will listen and use what the atmosphere sends it. On the CLM side the namelist item ``co2_type`` tells CLM to use the value sent from the atmosphere rather than a value set on it's own namelist. @@ -569,36 +566,27 @@ For running "I" cases there are several other noteworthy configuration items tha ``pt1_pt1`` = read in single-point or regional datasets -DATM_CLMNCEP_YR_START - ``DATM_CLMNCEP_YR_START`` sets the beginning year to cycle the atmospheric data over for ``CLM_QIAN`` or ``CLMCRUNCEP`` modes. +DATM_YR_START + ``DATM_YR_START`` sets the beginning year to cycle the atmospheric data over for ``CLM_QIAN`` or ``CLMCRUNCEP`` or ``CPLHISTForcing`` modes. -DATM_CLMNCEP_YR_END - ``DATM_CLMNCEP_YR_END`` sets the ending year to cycle the atmospheric data over for ``CLM_QIAN`` or ``CLMCRUNCEP`` modes. +DATM_YR_END + ``DATM_YR_END`` sets the ending year to cycle the atmospheric data over for ``CLM_QIAN`` or ``CLMCRUNCEP`` or ``CPLHISTForcing`` modes. -DATM_CLMNCEP_YR_ALIGN - ``DATM_CLMNCEP_YR_START`` and ``DATM_CLMNCEP_YR_END`` determine the range of years to cycle the atmospheric data over, and ``DATM_CLMNCEP_YR_ALIGN`` determines which year in that range of years the simulation will start with. +DATM_YR_ALIGN + ``DATM_YR_START`` and ``DATM_YR_END`` determine the range of years to cycle the atmospheric data over, and ``DATM_YR_ALIGN`` determines which year in that range of years the simulation will start with. DATM_CPL_CASE ``DATM_CPL_CASE`` sets the casename to use for the ``CPLHISTForcing`` mode. -DATM_CPL_YR_START - ``DATM_CPL_YR_START`` sets the beginning year to cycle the atmospheric data over for the ``CPLHISTForcing`` mode. - -DATM_CPL_YR_END - ``DATM_CPL_YR_END`` sets the ending year to cycle the atmospheric data over for the ``CPLHISTForcing`` mode. - -DATM_CPL_YR_ALIGN - ``DATM_CPL_YR_START`` and ``DATM_CPL_YR_END`` determine the range of years to cycle the atmospheric data over, and ``DATM_CPL_YR_ALIGN`` determines which year in that range of years the simulation will start with. - ----------------------------- Downloading DATM Forcing Data ----------------------------- In Chapter One of the `CESM User's Guide `_ there is a section on "Downloading input data". The normal process of setting up cases will use the "scripts/ccsm_utils/Tools/check_input_data" script to retrieve data from the CESM subversion inputdata repository. This is true for the standard `CLM_QIAN` forcing as well. -The `CLMCRUNCEP` data is uploaded into the subversion inputdata repository as well -- but as it is 1.1 Terabytes of data downloading it is problematic (*IT WILL TAKE SEVERAL DAYS TO DOWNLOAD THE ENTIRE DATASET USING SUBVERSION*). Because of its size you may also need to download it onto a separate disk space. We have done that on cheyenne for example where it resides in ``$ENV{CESMROOT}/lmwg`` while the rest of the input data resides in ``$ENV{CESMDATAROOT}/inputdata``. The data is also already available on: janus, franklin, and hopper. If you download the data, we recommend that you break your download into several chunks, by setting up a case and setting the year range for ``DATM_CPL_YR_START`` and ``DATM_CPL_YR_END`` in say 20 year sections over 1901 to 2010, and then use ``check_input_data`` to export the data. +The `CLMCRUNCEP` data is uploaded into the subversion inputdata repository as well -- but as it is 1.1 Terabytes of data downloading it is problematic (*IT WILL TAKE SEVERAL DAYS TO DOWNLOAD THE ENTIRE DATASET USING SUBVERSION*). Because of its size you may also need to download it onto a separate disk space. We have done that on derecho for example where it resides in ``$ENV{CESMROOT}/lmwg`` while the rest of the input data resides in ``$ENV{CESMDATAROOT}/inputdata``. The data is also already available on: janus, franklin, and hopper. If you download the data, we recommend that you break your download into several chunks, by setting up a case and setting the year range for ``DATM_YR_START`` and ``DATM_YR_END`` in say 20 year sections over 1901 to 2010, and then use ``check_input_data`` to export the data. -The ``CPLHISTForcing`` DATM forcing data is unique -- because it is large compared to the rest of the input data, and we only have a disk copy on cheyenne. The DATM assumes the path for the previous NCAR machine cheyenne of ``/glade/p/cesm/shared_outputdata/cases/ccsm4/$DATM_CPLHIST_CASE`` for the data. So you will need to change this path in order to run on any other machine. You can download the data itself from NCAR HPSS from ``/CCSM/csm/$DATM_CPLHIST_CASE``. +The ``CPLHISTForcing`` DATM forcing data is unique -- because it is large compared to the rest of the input data, and we only have a disk copy on derecho. The DATM assumes the path for derecho of ``/glade/p/cesm/shared_outputdata/cases/ccsm4/$DATM_CPLHIST_CASE`` for the data. So you will need to change this path in order to run on any other machine. You can download the data itself from NCAR HPSS from ``/CCSM/csm/$DATM_CPLHIST_CASE``. -------------------------------------- Customizing via the build script files diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index 5fa2602e5a..9539060200 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -289,7 +289,7 @@ module clm_varctl logical, public :: spinup_matrixcn = .false. !.false. ! true => use acc spinup logical, public :: hist_wrt_matrixcn_diag = .false.!.false. ! true => use acc spinup ! SASU - integer, public :: nyr_forcing = 10 ! length of forcing years for the spin up. eg. if DATM_CLMNCEP_YR_START=1901;DATM_CLMNCEP_YR_END=1920, then nyr_forcing = 20 + integer, public :: nyr_forcing = 10 ! length of forcing years for the spin up. eg. if DATM_YR_START=1901;DATM_YR_END=1920, then nyr_forcing = 20 integer, public :: nyr_SASU = 1 ! length of each semi-analytic solution. eg. nyr_SASU=5, analytic solutions will be calculated every five years. ! nyr_SASU=1: the fastest SASU, but inaccurate; nyr_SASU=nyr_forcing(eg. 20): the lowest SASU but accurate integer, public :: iloop_avg = -999 ! The restart file will be based on the average of all analytic solutions within the iloop_avg^th loop. diff --git a/tools/contrib/run_clm_historical b/tools/contrib/run_clm_historical index cd293d5867..8dc9269d3b 100755 --- a/tools/contrib/run_clm_historical +++ b/tools/contrib/run_clm_historical @@ -76,9 +76,9 @@ cp original_user_nl_clm user_nl_clm ./xmlchange STOP_N=21 ./xmlchange CONTINUE_RUN=FALSE ./xmlchange RESUBMIT=0 -./xmlchange DATM_CLMNCEP_YR_ALIGN=1901 -./xmlchange DATM_CLMNCEP_YR_START=1901 -./xmlchange DATM_CLMNCEP_YR_END=1920 +./xmlchange DATM_YR_ALIGN=1901 +./xmlchange DATM_YR_START=1901 +./xmlchange DATM_YR_END=1920 # need to use user_nl_datm files to get years right cp user_nl_datm1901-1920 user_nl_datm @@ -203,9 +203,9 @@ gzip $DDIR$CASENAME*.bin # we have to resubmit the job 3 times. ./xmlchange STOP_OPTION=nyears ./xmlchange STOP_N=22 -./xmlchange DATM_CLMNCEP_YR_ALIGN=1901 -./xmlchange DATM_CLMNCEP_YR_START=1901 -./xmlchange DATM_CLMNCEP_YR_END=2014 +./xmlchange DATM_YR_ALIGN=1901 +./xmlchange DATM_YR_START=1901 +./xmlchange DATM_YR_END=2014 ./xmlchange CONTINUE_RUN=TRUE ./xmlchange RESUBMIT=3 diff --git a/tools/contrib/run_clmtowers b/tools/contrib/run_clmtowers index e4dd2519ff..7e9dbbc426 100755 --- a/tools/contrib/run_clmtowers +++ b/tools/contrib/run_clmtowers @@ -211,9 +211,9 @@ foreach mysite ( $sites ) ./xmlchange --id STOP_OPTION --val nyears ./xmlchange --id STOP_N --val $numyears ./xmlchange --id RUN_STARTDATE --val $startyear[$cnt]-01-01 - ./xmlchange --id DATM_CLMNCEP_YR_ALIGN --val $startyear[$cnt] - ./xmlchange --id DATM_CLMNCEP_YR_START --val $startyear[$cnt] - ./xmlchange --id DATM_CLMNCEP_YR_END --val $endyear[$cnt] + ./xmlchange --id DATM_YR_ALIGN --val $startyear[$cnt] + ./xmlchange --id DATM_YR_START --val $startyear[$cnt] + ./xmlchange --id DATM_YR_END --val $endyear[$cnt] ./xmlchange --id CALENDAR --val GREGORIAN if ($BGC == ON) then ./xmlchange --id CLM_BLDNML_OPTS --val "-mask navy -bgc bgc -crop" @@ -240,9 +240,9 @@ foreach mysite ( $sites ) else ./xmlchange --id RUN_STARTDATE --val $startyear[$cnt]-01-01 endif - ./xmlchange --id DATM_CLMNCEP_YR_ALIGN --val $alignyear - ./xmlchange --id DATM_CLMNCEP_YR_START --val $startyears - ./xmlchange --id DATM_CLMNCEP_YR_END --val $endyears + ./xmlchange --id DATM_YR_ALIGN --val $alignyear + ./xmlchange --id DATM_YR_START --val $startyears + ./xmlchange --id DATM_YR_END --val $endyears if ($alignyear == 1) then ./xmlchange --id CALENDAR --val NO_LEAP endif @@ -263,7 +263,7 @@ foreach mysite ( $sites ) ./preview_namelists # Have to force this for some reason if ($SPINUP_P1 == FALSE) then - ./xmlchange --id DATM_CLMNCEP_YR_END --val $endyear[$cnt] + ./xmlchange --id DATM_YR_END --val $endyear[$cnt] ./preview_namelists endif if ( $status != 0 )then From f2a8ce051099244efd3cbd38279865ea04f1d61f Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 29 Oct 2024 18:46:45 -0600 Subject: [PATCH 139/158] Remove some more DATM_C..._YR_... --- cime_config/buildnml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index e9b7a610cd..e06b9388c7 100644 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -52,16 +52,8 @@ def buildnml(case, caseroot, compname): clm_accelerated_spinup = case.get_value("CLM_ACCELERATED_SPINUP") comp_interface = case.get_value("COMP_INTERFACE") lilac_mode = case.get_value("LILAC_MODE") - if comp_interface == "nuopc": - yr_start = case.get_value("DATM_YR_START") - yr_end = case.get_value("DATM_YR_END") - else: - yr_start = case.get_value("DATM_CLMNCEP_YR_START") - yr_end = case.get_value("DATM_CLMNCEP_YR_END") - - if yr_start != None and yr_start < 0: - yr_start = case.get_value("DATM_CPLHIST_YR_START") - yr_end = case.get_value("DATM_CPLHIST_YR_END") + yr_start = case.get_value("DATM_YR_START") + yr_end = case.get_value("DATM_YR_END") # For LILAC if yr_start == None or lilac_mode == "on": From c697c76a5bec4837075f82eacef45ef36b7eeab0 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 29 Oct 2024 18:51:47 -0600 Subject: [PATCH 140/158] Remove additional DATM_C..._YR_... --- .../running-special-cases/Running-with-anomaly-forcing.rst | 2 +- ...us-simulation-as-atmospheric-forcing-to-spinup-the-model.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 index 0c6009f3fe..2efa65893d 100644 --- 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 @@ -42,4 +42,4 @@ For single point simulations, the global anomaly forcing files can be used, but 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. +The cycling of the present-day (base) climate is controlled through the DATM\_YR\_START and DATM\_YR\_END variables in env\_run.xml. diff --git a/doc/source/users_guide/running-special-cases/Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst b/doc/source/users_guide/running-special-cases/Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst index 2a55cbed1e..88d209c0d1 100644 --- a/doc/source/users_guide/running-special-cases/Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst +++ b/doc/source/users_guide/running-special-cases/Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst @@ -51,7 +51,7 @@ Example: Simulation Forced with Data from the Previous Simulation > ./xmlchange DATM_CPLHIST_CASE="myB1850" # The following sets the align year and years to run over for atm forcing # (you could also use an editor) - > ./xmlchange DATM_CPLHIST_YR_ALIGN="1",DATM_CPLHIST_YR_START=1,DATM_CPLHIST_YR_END=20 + > ./xmlchange DATM_YR_ALIGN="1",DATM_YR_START=1,DATM_YR_END=20 # Set the strm_datdir in the namelist_defaults_datm.xml # file to the archival path of the case above in the form of: /glade/home/achive/$USER/$DATM_CPLHIST_CASE/cpl/hist # NOTE: THIS WILL CHANGE THE PATH FOR ALL I1850Clm50BgcSpinup COMPSET CASES MADE AFTER THIS! From 862739bcbd044133e12afb9a60c0562d67bece44 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 30 Oct 2024 10:47:32 -0600 Subject: [PATCH 141/158] Replace outdated DATM_CPL_CASE with DATM_CPLHIST_CASE --- ...AR-data-as-atmospheric-forcing-to-spinup-the-model.rst | 2 +- .../customizing-the-clm-configuration.rst | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/source/users_guide/running-special-cases/Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst b/doc/source/users_guide/running-special-cases/Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst index a81465c699..cf9fbc773c 100644 --- a/doc/source/users_guide/running-special-cases/Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst +++ b/doc/source/users_guide/running-special-cases/Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst @@ -18,7 +18,7 @@ Example: Simulation with MOAR Data on derecho > ./create_newcase -case MOARforce1850 -res f19_g17_gl4 -compset I1850Clm50BgcSpinup > cd MOARforce1850 # The following sets the casename to point to for atm forcing (you could also use an editor) - > ./xmlchange DATM_CPL_CASE=b40.1850.track1.1deg.006a + > ./xmlchange DATM_CPLHIST_CASE=b40.1850.track1.1deg.006a # The following sets the align year and years to run over for atm forcing # (you could also use an editor) > ./xmlchange DATM_YR_ALIGN=1,DATM_YR_START=960,DATM_YR_END=1030 diff --git a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst index 11e996ae5d..ec28a0d624 100644 --- a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst +++ b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst @@ -513,7 +513,7 @@ For running "I" cases there are several other noteworthy configuration items tha DATM_YR_ALIGN DATM_YR_START DATM_YR_END - DATM_CPL_CASE + DATM_CPLHIST_CASE ``CCSM_CO2_PPMV`` Sets the mixing ratio of CO2 in parts per million by volume for ALL CESM components to use. Note that most compsets already set this value to something reasonable. Also note that some compsets may tell the atmosphere model to override this value with either historic or ramped values. If the ``CCSM_BGC`` variable is set to something other than "none" the atmosphere model will determine CO2, and CLM will listen and use what the atmosphere sends it. On the CLM side the namelist item ``co2_type`` tells CLM to use the value sent from the atmosphere rather than a value set on it's own namelist. @@ -575,8 +575,8 @@ DATM_YR_END DATM_YR_ALIGN ``DATM_YR_START`` and ``DATM_YR_END`` determine the range of years to cycle the atmospheric data over, and ``DATM_YR_ALIGN`` determines which year in that range of years the simulation will start with. -DATM_CPL_CASE - ``DATM_CPL_CASE`` sets the casename to use for the ``CPLHISTForcing`` mode. +DATM_CPLHIST_CASE + ``DATM_CPLHIST_CASE`` sets the casename to use for the ``CPLHISTForcing`` mode. ----------------------------- Downloading DATM Forcing Data @@ -586,7 +586,7 @@ In Chapter One of the `CESM User's Guide `_ there is a section The `CLMCRUNCEP` data is uploaded into the subversion inputdata repository as well -- but as it is 1.1 Terabytes of data downloading it is problematic (*IT WILL TAKE SEVERAL DAYS TO DOWNLOAD THE ENTIRE DATASET USING SUBVERSION*). Because of its size you may also need to download it onto a separate disk space. We have done that on derecho for example where it resides in ``$ENV{CESMROOT}/lmwg`` while the rest of the input data resides in ``$ENV{CESMDATAROOT}/inputdata``. The data is also already available on: janus, franklin, and hopper. If you download the data, we recommend that you break your download into several chunks, by setting up a case and setting the year range for ``DATM_YR_START`` and ``DATM_YR_END`` in say 20 year sections over 1901 to 2010, and then use ``check_input_data`` to export the data. -The ``CPLHISTForcing`` DATM forcing data is unique -- because it is large compared to the rest of the input data, and we only have a disk copy on derecho. The DATM assumes the path for derecho of ``/glade/p/cesm/shared_outputdata/cases/ccsm4/$DATM_CPLHIST_CASE`` for the data. So you will need to change this path in order to run on any other machine. You can download the data itself from NCAR HPSS from ``/CCSM/csm/$DATM_CPLHIST_CASE``. +The ``CPLHISTForcing`` DATM forcing data is unique -- because it is large compared to the rest of the input data, and we only have a disk copy on derecho. The DATM assumes the path for derecho of ``/glade/p/cesm/shared_outputdata/cases/ccsm4/$DATM_CPLHIST_CASE`` for the data. So you will need to change this path in order to run on any other machine. -------------------------------------- Customizing via the build script files From 16d83c15cce709955a44ca75115e718e84bc6a7f Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 1 Nov 2024 12:42:17 -0600 Subject: [PATCH 142/158] Add warning box to MOAR User's Guide page. --- ...th-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/source/users_guide/running-special-cases/Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst b/doc/source/users_guide/running-special-cases/Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst index cf9fbc773c..7c18cee009 100644 --- a/doc/source/users_guide/running-special-cases/Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst +++ b/doc/source/users_guide/running-special-cases/Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst @@ -6,6 +6,9 @@ Running with MOAR data ======================== +.. warning:: + These instructions are outdated and will not work. This page will be either updated or removed as part of the CTSM6/CLM3 release. + Because it takes so long to spinup the CN model (as we just saw previously), if you are doing fully coupled simulations with active atmosphere and ocean, you will want to do the spinup portion of this "offline". So instead of doing expensive fully coupled simulations for the spinup duration, you run CLM in a very cheap "I" compset using atmospheric forcing from a shorter fully coupled simulation (or a simulation run previously by someone else). In this example we will use the ``I1850Clm50BgcSpinup compset`` to setup CLM to run with atmospheric forcing from a previous fully coupled simulation with data that is already stored on disk on Cheyenne. There are several simulations that have high frequency data for which we can do this. You can also do this on a machine other than Cheyenne, but would need to download the data from the Earth System Grid and change the datapath similar to Example :numref:`eg-sim-data-from-prev-sim`. From bd8565647f41f0c249ad443295adf23e08b2c7da Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 8 Nov 2024 13:16:00 -0700 Subject: [PATCH 143/158] build-namelist_test: Ensure cold starts w/ finidat are handled properly. Currently fails. We want FATES to work and BGC to fail, even when ignoring warnings. --- bld/unit_testers/build-namelist_test.pl | 54 +++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 4 deletions(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index a1f5e3912f..1bf201d239 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -1318,10 +1318,6 @@ sub cat_and_create_namelistinfile { my %warntest = ( # Warnings without the -ignore_warnings option given - "coldwfinidat" =>{ options=>"-envxml_dir . -clm_start_type cold", - namelst=>"finidat = 'testfile.nc'", - phys=>"clm5_0", - }, "bgcspin_w_suplnitro" =>{ options=>"-envxml_dir . -bgc bgc -clm_accelerated_spinup on", namelst=>"suplnitro='ALL'", phys=>"clm5_0", @@ -1402,6 +1398,56 @@ sub cat_and_create_namelistinfile { system( "cat $tempfile" ); } +print "\n===============================================================================\n"; +print "Ensure cold starts with finidat are handled properly \n"; +print "=================================================================================\n"; + +my %coldwfinidat = ( + "bgc" => { options=>"-envxml_dir . -clm_start_type cold", + namelst=>"finidat = 'testfile.nc'", + phys=>"clm5_0", + expected_fail=>1, + }, + "fates" => { options=>"-envxml_dir . -clm_start_type cold -bgc fates -no-megan", + namelst=>"finidat = 'testfile.nc', use_fates = .true.", + phys=>"clm5_0", + expected_fail=>0, + }, +); +my $finidat; +foreach my $key ( keys(%coldwfinidat) ) { + print( "$key\n" ); + + my $var; + foreach $var ( "phys" , "options", "namelst", "expected_fail" ) { + if ( not exists $coldwfinidat{$key}{$var} ) { + die "ERROR: Subkey $var does not exist for coldwfinidat $key\nERROR:Check if you spelled $var correctly\n" + } + } + + &make_config_cache($coldwfinidat{$key}{"phys"}); + my $options = $coldwfinidat{$key}{"options"}; + my $namelist = $coldwfinidat{$key}{"namelst"}; + my $expected_fail = $coldwfinidat{$key}{"expected_fail"}; + my %settings; + &make_env_run( %settings ); + + # Should fail if expected to, pass otherwise + eval{ system( "$bldnml $options -namelist \"&clmexp $namelist /\" > $tempfile 2>&1 " ); }; + is( $? eq 0, $expected_fail eq 0, "coldwfinidat $key run"); + + if ( $expected_fail ) { + # Now run with -ignore_warnings and make sure it still doesn't work + $options .= " -ignore_warnings"; + eval{ system( "$bldnml $options -namelist \"&clmexp $namelist /\" > $tempfile 2>&1 " ); }; + isnt( $?, 0, "coldwfinidat $key run -ignore_warnings" ); + } else { + # Check that finidat was correctly set + $finidat = `grep finidat lnd_in`; + ok ( $finidat =~ "testfile.nc", "coldwfinidat $key finidat? $finidat" ); + } +} + # # Loop over all physics versions # From f8f3a6f8e01ff356027dd935c70e8bf1efadbc6e Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 8 Nov 2024 13:03:22 -0700 Subject: [PATCH 144/158] Ignore finidat for cold-start FATES runs. Resolves ESCOMP/CTSM#2856, where such runs were getting their finidat overwritten with ' '. --- bld/CLMBuildNamelist.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 592699cc2b..f4d60e481b 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -2588,7 +2588,7 @@ sub setup_logic_initial_conditions { my $finidat = $nl->get_value($var); $nl_flags->{'excess_ice_on_finidat'} = "unknown"; if ( $nl_flags->{'clm_start_type'} =~ /cold/ ) { - if (defined $finidat ) { + if (defined $finidat && !&value_is_true(($nl->get_value('use_fates')))) { $log->warning("setting $var (either explicitly in your user_nl_clm or by doing a hybrid or branch RUN_TYPE)\n is incomptable with using a cold start" . " (by setting CLM_FORCE_COLDSTART=on)." ); $log->warning("Overridding input $var file with one specifying that this is a cold start from arbitrary initial conditions." ); From 33fd95de9ca0e20e30a4e9c5d7eb6caf1c700f6a Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 8 Nov 2024 13:06:31 -0700 Subject: [PATCH 145/158] Don't allow users to supply finidat for cold-start non-FATES runs. Previously, this only produced a warning, which could be overridden. --- bld/CLMBuildNamelist.pm | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index f4d60e481b..94777d320d 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -2589,11 +2589,8 @@ sub setup_logic_initial_conditions { $nl_flags->{'excess_ice_on_finidat'} = "unknown"; if ( $nl_flags->{'clm_start_type'} =~ /cold/ ) { if (defined $finidat && !&value_is_true(($nl->get_value('use_fates')))) { - $log->warning("setting $var (either explicitly in your user_nl_clm or by doing a hybrid or branch RUN_TYPE)\n is incomptable with using a cold start" . + $log->fatal_error("setting $var (either explicitly in your user_nl_clm or by doing a hybrid or branch RUN_TYPE)\n is incompatible with using a cold start" . " (by setting CLM_FORCE_COLDSTART=on)." ); - $log->warning("Overridding input $var file with one specifying that this is a cold start from arbitrary initial conditions." ); - my $group = $definition->get_group_name($var); - $nl->set_variable_value($group, $var, "' '" ); } add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'val'=>"' '", 'no_abspath'=>1); From 000b70d74e627ff457b7353bc88921f3035fdd68 Mon Sep 17 00:00:00 2001 From: Adrianna Foster Date: Sat, 9 Nov 2024 12:42:16 -0700 Subject: [PATCH 146/158] adding izumi nag fails --- cime_config/testdefs/ExpectedTestFails.xml | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 7049e9672b..b403c95b7e 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -283,6 +283,57 @@ #2325 + + + + + FAIL + #2861 + + + + + + FAIL + #2861 + + + + + + FAIL + #2861 + + + + + + FAIL + #2861 + + + + + + FAIL + #2861 + + + + + + FAIL + #2861 + + + + + + FAIL + #2861 + + + From bbe061dfa37394d2ffcd541ebd19aaae1dfbef5f Mon Sep 17 00:00:00 2001 From: Adrianna Foster Date: Sat, 9 Nov 2024 12:54:31 -0700 Subject: [PATCH 147/158] changelog --- doc/ChangeLog | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 58 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 3620cd8c15..7dcda101aa 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,61 @@ =============================================================== +Tag name: ctsm5.3.010 +Originator(s): afoster (Adrianna Foster) +Date: Sat Nov 9 12:54:18 MST 2024 +One-line Summary: Merge b4b-dev + +Purpose and description of changes +---------------------------------- + +- moves namelist variables to parameter file for PPE and makes some parameter variables pft-dimensioned (resolves ESCOMP/CTSM#2830 and resolves ESCOMP/CTSM#2831) +- removes/replaces references to DATM_C* _YR_* variables (resolves ESCOMP/CTSM#2743) +- documents that fincl1 and fexcl1 map to 'h0' history 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.] + +[ ] clm6_0 + +[ ] clm5_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- +- ESCOMP/CTSM#2830 (allow LUNA & mortality parameter to vary by PFT; https://github.com/ESCOMP/CTSM/issues/2830) +- ESCOMP/CTSM#2831 (Move namelist parameters to paramfile; https://github.com/ESCOMP/CTSM/issues/2831) +- ESCOMP/CTSM#2743 (Docs: Remove refs to DATM_CLMNCEP_YR_* and DATM_CPL_YR_* variables; https://github.com/ESCOMP/CTSM/issues/2743) + + +Testing summary: +---------------- + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + derecho ----- OK + izumi ------- OK + + +Other details +------------- + +Pull Requests that document the changes (include PR ids): +- ESCOMP/CTSM#2845: PPE parameter work -Addresses issues 2830 and 2831 (https://github.com/ESCOMP/CTSM/pull/2845) +- ESCOMP/CTSM#2852: Remove/replace refs to DATM_C*_YR_* variables (https://github.com/ESCOMP/CTSM/pull/2852) +- ESCOMP/CTSM#2866: Document that fincl1 maps to 'h0' history file. And fexcl1 (https://github.com/ESCOMP/CTSM/pull/2866) + +=============================================================== +=============================================================== Tag name: ctsm5.3.009 Originator(s): samrabin (Sam Rabin, UCAR/TSS, samrabin@ucar.edu) Date: Tue Oct 15 17:35:40 MDT 2024 diff --git a/doc/ChangeSum b/doc/ChangeSum index af6e1675b4..46e1176fd3 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.3.010 afoster 11/09/2024 Merge b4b-dev ctsm5.3.009 samrabin 10/15/2024 Reduce outputs from matrixcnOn tests ctsm5.3.008 olyson 10/14/2024 PPE change to sa_leaf in CanopyFluxesMod.F90 ctsm5.3.007 slevis 10/14/2024 Clm60 finidat updates for ne30, f09, f19 grids From c60fe19e7d93679a0b3fcaac9d26f1f56e667065 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 11 Nov 2024 17:53:58 -0700 Subject: [PATCH 148/158] Add some tests to expected fail list. --- cime_config/testdefs/ExpectedTestFails.xml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index b403c95b7e..775ff2c281 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -334,6 +334,19 @@ + + + FAIL + #2861 + + + + + + FAIL + #2861 + + @@ -349,6 +362,13 @@ + + + FAIL + #2810 + + + From ebcd4fb4742c8eb3197a83f19309907b585c28f5 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 11 Nov 2024 18:04:18 -0700 Subject: [PATCH 149/158] Update ChangeLog and ChangeSum. --- doc/ChangeLog | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 88 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 7dcda101aa..c08a55bbd4 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,91 @@ =============================================================== +Tag name: ctsm5.3.011 +Originator(s): samrabin (Sam Rabin, UCAR/TSS, samrabin@ucar.edu) +Date: Mon Nov 11 17:55:57 MST 2024 +One-line Summary: Improve handling of cold-start finidat + +Purpose and description of changes +---------------------------------- + +This PR changes things so that: + +1. Cold-start FATES runs with finidat specified will not require -ignore_warnings, and the supplied finidat will actually be obeyed. +2. Cold-start non-FATES runs will not be allowed, even with -ignore_warnings. + + +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.) + +[ ] clm6_0 + +[ ] clm5_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- +[Remove any lines that don't apply. Remove entire section if nothing applies.] + +List of CTSM issues fixed: +- Resolves ESCOMP/CTSM#2856: FATES will never start from specified finidat (https://github.com/ESCOMP/CTSM/issues/2856) + +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 + +Changes to tests or testing: +Adds three fates suite tests to expected fails: +- ERS_D_Mmpi-serial_Ld5.1x1_brazil.I2000Clm50FatesCruRsGs.izumi_nag.clm-FatesCold +- SMS_Lm3_D_Mmpi-serial.1x1_brazil.I2000Clm50FatesCruRsGs.izumi_nag.clm-FatesColdHydro +- ERS_D_Ld30.f45_f45_mg37.I2000Clm50FatesCruRsGs.izumi_nag.clm-FatesColdLandUse + + +Testing summary: +---------------- + + [PASS means all tests PASS; OK means tests PASS other than expected fails.] + + build-namelist tests (if CLMBuildNamelist.pm has changed): + + derecho - PASS + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + derecho ----- OK + izumi ------- OK + + fates tests: + derecho ----- OK + izumi ------- OK + + +Answer changes +-------------- + +Changes answers relative to baseline: + + Summarize any changes to answers, i.e., + - what code configurations: FATES cold-start runs with finidat + - what platforms/compilers: All + - nature of change: new climate + + +Other details +------------- + +Pull Requests that document the changes (include PR ids): +- ESCOMP/CTSM#2870: Fix handling of finidat with cold starts (https://github.com/ESCOMP/CTSM/pull/2870) + +=============================================================== +=============================================================== Tag name: ctsm5.3.010 Originator(s): afoster (Adrianna Foster) Date: Sat Nov 9 12:54:18 MST 2024 diff --git a/doc/ChangeSum b/doc/ChangeSum index 46e1176fd3..daffdab145 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.3.011 samrabin 11/11/2024 Improve handling of cold-start finidat ctsm5.3.010 afoster 11/09/2024 Merge b4b-dev ctsm5.3.009 samrabin 10/15/2024 Reduce outputs from matrixcnOn tests ctsm5.3.008 olyson 10/14/2024 PPE change to sa_leaf in CanopyFluxesMod.F90 From bd3a2e8fe3abc794a77b01717eb6b59ca3f90d6c Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Fri, 15 Nov 2024 17:01:20 +0100 Subject: [PATCH 150/158] updated cime --- cime | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime b/cime index 422ddaa770..909cb49897 160000 --- a/cime +++ b/cime @@ -1 +1 @@ -Subproject commit 422ddaa770a3cea6e83a60c9700ebce77acaceed +Subproject commit 909cb498978b2386318e56ea686d28e469224cd0 From 06f50df3d0b21db80008e4ef773b992af43e45b7 Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Fri, 15 Nov 2024 17:02:56 +0100 Subject: [PATCH 151/158] updated ccs_config --- ccs_config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccs_config b/ccs_config index 69a958581e..daa8195aa6 160000 --- a/ccs_config +++ b/ccs_config @@ -1 +1 @@ -Subproject commit 69a958581ecd2d32ee9cb1c38bcd3847b8b920bf +Subproject commit daa8195aa6a817e1ba5a6b88c058aac77c17b425 From 433028eadc77634cf0e2c8ac9f3e2ff46d6e0ec1 Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Sun, 17 Nov 2024 10:37:44 +0100 Subject: [PATCH 152/158] updated cime --- cime | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime b/cime index 909cb49897..f4a63723ea 160000 --- a/cime +++ b/cime @@ -1 +1 @@ -Subproject commit 909cb498978b2386318e56ea686d28e469224cd0 +Subproject commit f4a63723ead19bf5391abf21e5d49bd3741f7e39 From 13f8ff9c2bd4d0ec3383f0948049187f29ffe3d5 Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Sun, 17 Nov 2024 10:42:18 +0100 Subject: [PATCH 153/158] udpated .gitmodules --- .gitmodules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index a3c4157850..fde6fe2361 100644 --- a/.gitmodules +++ b/.gitmodules @@ -64,7 +64,7 @@ fxtag = cesm-coupling.n02_v2.1.2 fxrequired = ToplevelRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/ESCOMP/mizuRoute - + [submodule "ccs_config"] path = ccs_config url = https://github.com/NorESMhub/ccs_config_noresm.git @@ -76,7 +76,7 @@ fxDONOTUSEurl = https://github.com/NorESMhub/ccs_config_noresm [submodule "cime"] path = cime url = https://github.com/ESMCI/cime -fxtag = cime6.0.246 +fxtag = cime6.1.28_noresm_v0 fxrequired = ToplevelRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/ESMCI/cime From a76706f4c0e33bd2b2590a81b124a212ec1fa6f0 Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Sun, 17 Nov 2024 11:16:26 +0100 Subject: [PATCH 154/158] updated buildnml to ctsm5.3.011 --- cime_config/buildnml | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index 414811abe6..e06b9388c7 100644 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -75,8 +75,7 @@ def buildnml(case, caseroot, compname): run_reftod = case.get_value("RUN_REFTOD") start_tod = case.get_value("START_TOD") glc_nec = case.get_value("GLC_NEC") - cism_use_antarctica = case.get_value("CISM_USE_ANTARCTICA") - dglc_use_antarctica = case.get_value("DGLC_USE_ANTARCTICA") + glc_use_antarctica = case.get_value("GLC_USE_ANTARCTICA") mask = case.get_value("MASK_GRID") driver = case.get_value("COMP_INTERFACE").lower() @@ -247,12 +246,9 @@ def buildnml(case, caseroot, compname): else: nomeg = "" - glc_use_antarctica = cism_use_antarctica if glc_use_antarctica is None: - glc_use_antarctica = dglc_use_antarctica - if glc_use_antarctica is None: - # This is the case for compsets without CISM or DGLC, where the - # CISM_USE_ANTARCTICA and DGLC_USE_ANTARCTICA xml variables are not defined + # This is the case for compsets with SGLC where the GLC_USE_ANTARCTICA xml + # variable isn't defined glc_use_antarctica_flag = "" elif isinstance(glc_use_antarctica, bool): if glc_use_antarctica: @@ -260,16 +256,10 @@ def buildnml(case, caseroot, compname): else: glc_use_antarctica_flag = "" else: - if cism_use_antarctia: - expect( - False, - "Unexpected value for CISM_USE_ANTARCTICA: {}".format(cism_use_antarctica), - ) - else: - expect( - False, - "Unexpected value for DGLC_USE_ANTARCTICA: {}".format(dglc_use_antarctica), - ) + expect( + False, + "Unexpected value for GLC_USE_ANTARCTICA: {}".format(glc_use_antarctica), + ) if clm_nml_use_case != "UNSET": usecase = "-use_case %s" % clm_nml_use_case From 401d758b0ba7f26ca09b3919713cb98f199c929c Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Sun, 17 Nov 2024 11:38:35 +0100 Subject: [PATCH 155/158] updated ccs_config --- ccs_config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccs_config b/ccs_config index daa8195aa6..3640d984aa 160000 --- a/ccs_config +++ b/ccs_config @@ -1 +1 @@ -Subproject commit daa8195aa6a817e1ba5a6b88c058aac77c17b425 +Subproject commit 3640d984aad755c2b536abe2ddbcb428cca130ae From 2b3555882574a9ff6ab1ecda12ff10d05fe5ea29 Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Sun, 17 Nov 2024 11:40:11 +0100 Subject: [PATCH 156/158] updated .gitmodules --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index fde6fe2361..6fec3d4a11 100644 --- a/.gitmodules +++ b/.gitmodules @@ -68,7 +68,7 @@ fxDONOTUSEurl = https://github.com/ESCOMP/mizuRoute [submodule "ccs_config"] path = ccs_config url = https://github.com/NorESMhub/ccs_config_noresm.git -fxtag = ccs_config_noresm0.0.33 +fxtag = ccs_config_noresm0.0.38 fxrequired = ToplevelRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/NorESMhub/ccs_config_noresm From cbe6f93842d894c9ea1c374b24a104958e0f6b22 Mon Sep 17 00:00:00 2001 From: mvdebolskiy Date: Mon, 18 Nov 2024 19:34:48 +0100 Subject: [PATCH 157/158] update cime and submodules to be consistent with cime6.1 --- .gitmodules | 16 ++++++++-------- cime | 2 +- components/cdeps | 2 +- components/cmeps | 2 +- components/mizuRoute | 2 +- libraries/parallelio | 2 +- share | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.gitmodules b/.gitmodules index 6fec3d4a11..c6b16d384f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -60,7 +60,7 @@ fxDONOTUSEurl = https://github.com/ESCOMP/MOSART [submodule "mizuRoute"] path = components/mizuRoute url = https://github.com/ESCOMP/mizuRoute -fxtag = cesm-coupling.n02_v2.1.2 +fxtag = cesm-coupling.n02_v2.1.3 fxrequired = ToplevelRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/ESCOMP/mizuRoute @@ -75,7 +75,7 @@ fxDONOTUSEurl = https://github.com/NorESMhub/ccs_config_noresm [submodule "cime"] path = cime -url = https://github.com/ESMCI/cime +url = https://github.com/NorESMhub/cime fxtag = cime6.1.28_noresm_v0 fxrequired = ToplevelRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed @@ -83,8 +83,8 @@ fxDONOTUSEurl = https://github.com/ESMCI/cime [submodule "cmeps"] path = components/cmeps -url = https://github.com/ESCOMP/CMEPS.git -fxtag = cmeps0.14.77 +url = https://github.com/NorESMhub/CMEPS.git +fxtag = cmeps1.0.20_noresm_v0 fxrequired = ToplevelRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/ESCOMP/CMEPS.git @@ -92,15 +92,15 @@ fxDONOTUSEurl = https://github.com/ESCOMP/CMEPS.git [submodule "cdeps"] path = components/cdeps url = https://github.com/ESCOMP/CDEPS.git -fxtag = cdeps1.0.48 +fxtag = cdeps1.0.53 fxrequired = ToplevelRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/ESCOMP/CDEPS.git [submodule "share"] path = share -url = https://github.com/ESCOMP/CESM_share -fxtag = share1.0.19 +url = https://github.com/NorESMhub/NorESM_share +fxtag = share1.1.2_noresm_v0 fxrequired = ToplevelRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/ESCOMP/CESM_share @@ -116,7 +116,7 @@ fxDONOTUSEurl = https://github.com/MCSclimate/MCT [submodule "parallelio"] path = libraries/parallelio url = https://github.com/NCAR/ParallelIO -fxtag = pio2_6_2 +fxtag = pio2_6_3 fxrequired = ToplevelRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/NCAR/ParallelIO diff --git a/cime b/cime index f4a63723ea..7c52a0bf16 160000 --- a/cime +++ b/cime @@ -1 +1 @@ -Subproject commit f4a63723ead19bf5391abf21e5d49bd3741f7e39 +Subproject commit 7c52a0bf16190ae6b6d1b73ac3521fc3bb920981 diff --git a/components/cdeps b/components/cdeps index 7b0b3a8272..f6bc97483a 160000 --- a/components/cdeps +++ b/components/cdeps @@ -1 +1 @@ -Subproject commit 7b0b3a827241c53d296ec877cb1f59966bf5e5bf +Subproject commit f6bc97483a1bfb7352c6c5610a13ed898a86990b diff --git a/components/cmeps b/components/cmeps index 47fb4e633a..1d456df89c 160000 --- a/components/cmeps +++ b/components/cmeps @@ -1 +1 @@ -Subproject commit 47fb4e633a76ec6d60969b1af751f90790387246 +Subproject commit 1d456df89ce4a1aefe7cf9f5564c53ebe3dab41f diff --git a/components/mizuRoute b/components/mizuRoute index 81c720c7ee..2ff305a029 160000 --- a/components/mizuRoute +++ b/components/mizuRoute @@ -1 +1 @@ -Subproject commit 81c720c7ee51f9c69f2934f696078c42f4493565 +Subproject commit 2ff305a0292cb06789de6cfea7ad3cc0d6173493 diff --git a/libraries/parallelio b/libraries/parallelio index f52ade0756..6539ef05ae 160000 --- a/libraries/parallelio +++ b/libraries/parallelio @@ -1 +1 @@ -Subproject commit f52ade075619b32fa141993b5665b0fe099befc2 +Subproject commit 6539ef05ae7584ec570a56fdab9f7dfb336c2b80 diff --git a/share b/share index 4b9dc4871a..b26285a01b 160000 --- a/share +++ b/share @@ -1 +1 @@ -Subproject commit 4b9dc4871a259f00f35bb47708d876cb7dcdf75c +Subproject commit b26285a01ba00c2c7f31182708827096b1bf93a8 From 89e8406f1d4c6d94cc45d00644fe5c1813597356 Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Mon, 18 Nov 2024 20:05:33 +0100 Subject: [PATCH 158/158] updated cime submodule --- cime | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime b/cime index 7c52a0bf16..f4a63723ea 160000 --- a/cime +++ b/cime @@ -1 +1 @@ -Subproject commit 7c52a0bf16190ae6b6d1b73ac3521fc3bb920981 +Subproject commit f4a63723ead19bf5391abf21e5d49bd3741f7e39