From b32df77723fe9d7e5f86aa886804799a6cf827a2 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 10 Apr 2024 13:44:29 -0600 Subject: [PATCH 1/9] Put new ctsm5.2 finidat files in initdata_esmf/ctsm5.2 directory --- bld/namelist_files/namelist_defaults_ctsm.xml | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 47273636f4..db36e222b5 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -439,7 +439,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/ctsm51_params.c240208.nc +lnd/clm2/paramdata/ctsm60_params.c240208.nc lnd/clm2/paramdata/ctsm51_params.c240208.nc lnd/clm2/paramdata/clm50_params.c240208.nc lnd/clm2/paramdata/clm45_params.c240208.nc @@ -959,7 +959,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="18500101" sim_year="1850" do_transient_pfts=".false." ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".false." lnd_tuning_mode="clm5_0_GSWP3v1" ->lnd/clm2/initdata_map/clmi.I1850Clm50BgcCrop-ciso.1366-01-01.0.9x1.25_gx1v7_simyr1850_c240223.nc +>lnd/clm2/initdata_esmf/ctsm5.2/clmi.I1850Clm50BgcCrop-ciso.1366-01-01.0.9x1.25_gx1v7_simyr1850_c240223.nc @@ -967,7 +967,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="18500101" sim_year="1850" do_transient_pfts=".false." ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".false." lnd_tuning_mode="clm5_0_CRUv7" ->lnd/clm2/initdata_map/clmi.I1850Clm50BgcCropCru-ciso.1526-01-01.0.9x1.25_gx1v7_simyr1850_c240223.nc +>lnd/clm2/initdata_esmf/ctsm5.2/clmi.I1850Clm50BgcCropCru-ciso.1526-01-01.0.9x1.25_gx1v7_simyr1850_c240223.nc @@ -996,7 +996,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="18500101" sim_year="1850" do_transient_pfts=".false." ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".false." lnd_tuning_mode="clm5_1_GSWP3v1" ->lnd/clm2/initdata_map/clmi.I1850Clm50BgcCrop-ciso.1366-01-01.0.9x1.25_gx1v7_simyr1850_c240223.nc +>lnd/clm2/initdata_esmf/ctsm5.2/clmi.I1850Clm50BgcCrop-ciso.1366-01-01.0.9x1.25_gx1v7_simyr1850_c240223.nc @@ -1018,7 +1018,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="18500101" sim_year="1850" do_transient_pfts=".false." ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".false." lnd_tuning_mode="clm6_0_GSWP3v1" ->lnd/clm2/initdata_map/clmi.I1850Clm50BgcCrop-ciso.1366-01-01.0.9x1.25_gx1v7_simyr1850_c240223.nc +>lnd/clm2/initdata_esmf/ctsm5.2/clmi.I1850Clm50BgcCrop-ciso.1366-01-01.0.9x1.25_gx1v7_simyr1850_c240223.nc @@ -1039,7 +1039,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="20110101" sim_year="2000" do_transient_pfts=".false." ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".true." lnd_tuning_mode="clm4_5_GSWP3v1" ->lnd/clm2/initdata_map/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c240223.nc +>lnd/clm2/initdata_esmf/ctsm5.2/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c240223.nc @@ -1047,7 +1047,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="20110101" sim_year="2000" do_transient_pfts=".false." ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".true." lnd_tuning_mode="clm4_5_CRUv7" ->lnd/clm2/initdata_map/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c240223.nc +>lnd/clm2/initdata_esmf/ctsm5.2/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c240223.nc @@ -1055,19 +1055,19 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="20110101" sim_year="2000" do_transient_pfts=".false." ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".true." lnd_tuning_mode="clm5_0_GSWP3v1" ->lnd/clm2/initdata_map/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c240223.nc +>lnd/clm2/initdata_esmf/ctsm5.2/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c240223.nc lnd/clm2/initdata_map/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c240223.nc +>lnd/clm2/initdata_esmf/ctsm5.2/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c240223.nc lnd/clm2/initdata_map/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c240223.nc +>lnd/clm2/initdata_esmf/ctsm5.2/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c240223.nc @@ -1076,7 +1076,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="20110101" sim_year="2000" do_transient_pfts=".false." ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".true." lnd_tuning_mode="clm5_0_CRUv7" ->lnd/clm2/initdata_map/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c240223.nc +>lnd/clm2/initdata_esmf/ctsm5.2/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c240223.nc From ec9af2d713fb680f255236ae31163be5dee9f61c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 10 Apr 2024 13:54:52 -0600 Subject: [PATCH 2/9] Just update mksurfdata_map to mksurfdata_esmf using VS code --- doc/source/lilac/specific-atm-models/wrf-tools.rst | 4 ++-- .../CLM50_Tech_Note_Transient_Landcover.rst | 8 ++++---- doc/source/tech_note/Urban/CLM50_Tech_Note_Urban.rst | 2 +- .../running-PTCLM/adding-ptclm-site-data.rst | 2 +- .../running-single-point-configurations.rst | 6 +++--- .../running-special-cases/Running-with-irrigation.rst | 2 +- .../using-clm-tools/building-the-clm-tools.rst | 8 ++++---- .../creating-input-for-surface-dataset-generation.rst | 6 +++--- .../using-clm-tools/creating-surface-datasets.rst | 10 +++++----- .../using-clm-tools/observational-sites-datasets.rst | 2 +- .../using-clm-tools/what-are-the-clm-tools.rst | 8 ++++---- 11 files changed, 29 insertions(+), 29 deletions(-) diff --git a/doc/source/lilac/specific-atm-models/wrf-tools.rst b/doc/source/lilac/specific-atm-models/wrf-tools.rst index 0366bc1582..f67a05ea0a 100644 --- a/doc/source/lilac/specific-atm-models/wrf-tools.rst +++ b/doc/source/lilac/specific-atm-models/wrf-tools.rst @@ -52,9 +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 -6. Create surface datasets in ``tools/mksurfdata_map``:: +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_map" -no-crop + ./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 Merge WRF initial conditions into an existing CTSM initial condition file -------------------------------------------------------------------------- diff --git a/doc/source/tech_note/Transient_Landcover/CLM50_Tech_Note_Transient_Landcover.rst b/doc/source/tech_note/Transient_Landcover/CLM50_Tech_Note_Transient_Landcover.rst index c221a14d28..99ee5ab676 100644 --- a/doc/source/tech_note/Transient_Landcover/CLM50_Tech_Note_Transient_Landcover.rst +++ b/doc/source/tech_note/Transient_Landcover/CLM50_Tech_Note_Transient_Landcover.rst @@ -107,9 +107,9 @@ To represent the LUH2 transient LULCC dataset in CLM5, the annual fractional com To support this translation task the CLM5 Land Use Data tool has been built that extends the methods described in Lawrence et al (2012) to include all the new functionality of CMIP6 and CLM5 LULCC. The tool translates each of the LUH2 land units for a given year into fractional PFT and CFT values based on the current day CLM5 data for the land unit in that grid cell. The current day land unit descriptions are generated from from 1km resolution MODIS, MIRCA2000, ICESAT, AVHRR, SRTM, and CRU climate data products combined with reference year LUH2 land unit data, usually set to 2005. Where the land unit does not exist in a grid cell for the current day, the land unit description is generated from nearest neighbors with an inverse distance weighted search algorithm. -The Land Use Data tool produces raw vegetation, crop, and management data files which are combined with other raw land surface data to produce the CLM5 initial surface dataset and the dynamic *landuse.timeseries* dataset with the CLM5 mksurfdata_map tool. The schematic of this entire process from LUH2 time series and high resolution current day data to the output of CLM5 surface datasets from the mksurfdata_map tool is shown in Figure 21.2. +The Land Use Data tool produces raw vegetation, crop, and management data files which are combined with other raw land surface data to produce the CLM5 initial surface dataset and the dynamic *landuse.timeseries* dataset with the CLM5 mksurfdata_esmf tool. The schematic of this entire process from LUH2 time series and high resolution current day data to the output of CLM5 surface datasets from the mksurfdata_esmf tool is shown in Figure 21.2. -The methodology for creating the CLM5 transient PFT and CFT dataset is based on four steps which are applied across all of the historical and future time series. The first step involves generating the current day descriptions of natural and managed vegetation PFTs at 1km resolution from the global source datasets, and the current day description of crop CFTs at the 10km resolution from the MIRCA 2000 datasets. The second step combines the current day (2005) LUH2 land units with the current day CLM5 PFT and CFT distributions to get CLM5 land unit descriptions in either PFTs or CFTs at the LUH2 resolution of 0.25 degrees. The third step involves combining the LUH2 land unit time series with the CLM5 PFT and CFT descriptions for that land unit to generate the CLM5 raw PFT and CFT time series in the *landuse.timeseries* file. At this point in the process management information in terms of fertilizer, irrigation and wood harvest are added to the CLM5 PFT and CFT data to complete the CLM5 raw PFT and CFT files. The final step is to combine these files with the other raw CLM5 surface data files in the mksurfdata_map tool. +The methodology for creating the CLM5 transient PFT and CFT dataset is based on four steps which are applied across all of the historical and future time series. The first step involves generating the current day descriptions of natural and managed vegetation PFTs at 1km resolution from the global source datasets, and the current day description of crop CFTs at the 10km resolution from the MIRCA 2000 datasets. The second step combines the current day (2005) LUH2 land units with the current day CLM5 PFT and CFT distributions to get CLM5 land unit descriptions in either PFTs or CFTs at the LUH2 resolution of 0.25 degrees. The third step involves combining the LUH2 land unit time series with the CLM5 PFT and CFT descriptions for that land unit to generate the CLM5 raw PFT and CFT time series in the *landuse.timeseries* file. At this point in the process management information in terms of fertilizer, irrigation and wood harvest are added to the CLM5 PFT and CFT data to complete the CLM5 raw PFT and CFT files. The final step is to combine these files with the other raw CLM5 surface data files in the mksurfdata_esmf tool. .. _Figure Schematic of land cover change: @@ -123,8 +123,8 @@ The methodology for creating the CLM5 transient PFT and CFT dataset is based on Schematic of translation of annual LUH2 land units to CLM5 plant and crop functional types. -.. _Figure Workflow of CLM5 Land Use Data Tool and Mksurfdata_map Tool: +.. _Figure Workflow of CLM5 Land Use Data Tool and mksurfdata_esmf Tool: .. figure:: image3.png - Workflow of CLM5 Land Use Data Tool and Mksurfdata_map Tool + Workflow of CLM5 Land Use Data Tool and mksurfdata_esmf Tool diff --git a/doc/source/tech_note/Urban/CLM50_Tech_Note_Urban.rst b/doc/source/tech_note/Urban/CLM50_Tech_Note_Urban.rst index e9bfb5eb57..8777c7be74 100644 --- a/doc/source/tech_note/Urban/CLM50_Tech_Note_Urban.rst +++ b/doc/source/tech_note/Urban/CLM50_Tech_Note_Urban.rst @@ -19,7 +19,7 @@ Present day global urban extent and urban properties were developed by :ref:`Jac For each of 33 distinct regions across the globe, thermal (e.g., heat capacity and thermal conductivity), radiative (e.g., albedo and emissivity) and morphological (e.g., height to width ratio, roof fraction, average building height, and pervious fraction of the canyon floor) properties are provided for each of the density classes. Building interior minimum and maximum temperatures are prescribed based on climate and socioeconomic considerations. The surface dataset creation routines (see CLM5.0 User's Guide) aggregate the data to the desired resolution. -An optional urban properties dataset, including a tool that allows for generating future urban development scenarios is also available (:ref:`Oleson and Feddema (2018) `). This will become the default dataset in future model versions. As described in :ref:`Oleson and Feddema (2018) ` the urban properties dataset in :ref:`Jackson et al. (2010) ` was modified with respect to wall and roof thermal properties to correct for biases in heat transfer due to layer and building type averaging. Further changes to the dataset reflect the need for scenario development, thus allowing for the creation of hypothetical wall types, and the easier interchange of wall facets. The new urban properties tool is available as part of the Toolbox for Human-Earth System Integration & Scaling (THESIS) tool set (http://www.cgd.ucar.edu/iam/projects/thesis/thesis-urbanproperties-tool.html; :ref:`Feddema and Kauffman (2016) `). The driver script (urban_prop.csh) specifies three input csv files (by default, mat_prop.csv, lam_spec.csv, and city_spec.csv; (:numref:`Figure schematic of THESIS urban properties tool`)) that describe the morphological, radiative, and thermal properties of urban areas, and generates a global dataset at 0.05° latitude by longitude in NetCDF format (urban_properties_data.05deg.nc). A standalone NCL routine (gen_data_clm.ncl) can be run separately after the mksurfdata_map tool creates the CLM surface dataset. This creates a supplementary streams file of setpoints for the maximum interior building temperature at yearly time resolution. +An optional urban properties dataset, including a tool that allows for generating future urban development scenarios is also available (:ref:`Oleson and Feddema (2018) `). This will become the default dataset in future model versions. As described in :ref:`Oleson and Feddema (2018) ` the urban properties dataset in :ref:`Jackson et al. (2010) ` was modified with respect to wall and roof thermal properties to correct for biases in heat transfer due to layer and building type averaging. Further changes to the dataset reflect the need for scenario development, thus allowing for the creation of hypothetical wall types, and the easier interchange of wall facets. The new urban properties tool is available as part of the Toolbox for Human-Earth System Integration & Scaling (THESIS) tool set (http://www.cgd.ucar.edu/iam/projects/thesis/thesis-urbanproperties-tool.html; :ref:`Feddema and Kauffman (2016) `). The driver script (urban_prop.csh) specifies three input csv files (by default, mat_prop.csv, lam_spec.csv, and city_spec.csv; (:numref:`Figure schematic of THESIS urban properties tool`)) that describe the morphological, radiative, and thermal properties of urban areas, and generates a global dataset at 0.05° latitude by longitude in NetCDF format (urban_properties_data.05deg.nc). A standalone NCL routine (gen_data_clm.ncl) can be run separately after the mksurfdata_esmf tool creates the CLM surface dataset. This creates a supplementary streams file of setpoints for the maximum interior building temperature at yearly time resolution. .. Figure 12.1. Schematic representation of the urban land unit 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 index d085c2f689..b95831427f 100644 --- a/doc/source/users_guide/running-PTCLM/adding-ptclm-site-data.rst +++ b/doc/source/users_guide/running-PTCLM/adding-ptclm-site-data.rst @@ -38,7 +38,7 @@ There is a mechanism for giving site-specific land-use change in PTCLMmkdata. Ad 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_map** can read that has an entry for each year for the range of years valid for the compset in question. +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: 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 8588da8b99..9d2b68456b 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 @@ -152,7 +152,7 @@ Example: Creating a surface dataset for a single point > ./mknoocnmap.pl -p 40,255 -n $GRIDNAME # Set pointer to MAPFILE just created that will be used later > setenv MAPFILE `pwd`/map_${GRIDNAME}_noocean_to_${GRIDNAME}_nomask_aave_da_${CDATE}.nc - # create the mapping files needed by mksurfdata_map. + # create the mapping files needed by mksurfdata_esmf. > cd ../.././mkmapdata > setenv GRIDFILE ../mkmapgrids/SCRIPgrid_${GRIDNAME}_nomask_${CDATE}.nc > ./mkmapdata.sh -r $GRIDNAME -f $GRIDFILE -t regional @@ -167,7 +167,7 @@ Example: Creating a surface dataset for a single point # Save the location where the domain file was created > setenv GENDOM_PATH `pwd` # Finally create the surface dataset - > cd ../../../../lnd/clm/tools/|version|/mksurfdata_map/src + > cd ../../../../lnd/clm/tools/|version|/mksurfdata_esmf/src > gmake > cd .. > ./mksurfdata.pl -r usrspec -usr_gname $GRIDNAME -usr_gdate $CDATE @@ -186,7 +186,7 @@ Example: Setting up a case from the single-point surface dataset just created > ./link_dirtree $CSMDATA $MYCSMDATA # Copy the file you created above to your new $MYCSMDATA location following the CLMUSRDAT # naming convention (leave off the creation date) - > cp $CESMROOT/$CTSMROOT/tools/mksurfdata_map/surfdata_${GRIDNAME}_simyr1850_$CDATE.nc \ + > cp $CESMROOT/$CTSMROOT/tools/mksurfdata_esmf/surfdata_${GRIDNAME}_simyr1850_$CDATE.nc \ $MYCSMDATA/lnd/clm2/surfdata_map/surfdata_${GRIDNAME}_simyr1850.nc > cd $CESMROOT/scripts > ./create_newcase -case my_usernldatasets_test -res CLM_USRDAT -compset I1850Clm50BgcCropCru \ 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 12fa76af5b..f19b489731 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_map`` 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/using-clm-tools/building-the-clm-tools.rst b/doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst index 09725c8afc..95e0333d6d 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,15 +6,15 @@ 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_map** 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_map**) 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_map** +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_map** +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. @@ -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_map** 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. 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 276394e2b9..a727631a6c 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 @@ -40,12 +40,12 @@ If you want to create a regular latitude/longitude single-point or regional grid See :numref:`Figure mknoocnmap.pl` for a visual representation of this process. -Creating mapping files for mksurfdata_map +Creating mapping files for mksurfdata_esmf ============================================== ``mkmapdata.sh`` uses the above SCRIP grid input files to create SCRIP mapping data files (uses ESMF). -The bash shell script ``$CTSMROOT/tools/mkmapgrids/mkmapdata.sh`` uses ``ESMF_RegridWeightGen`` to create a list of maps from the raw datasets that are input to ``mksurfdata_map``. Each dataset that has a different grid, or land-mask needs a different mapping file for it, but many different raw datasets share the same grid/land-mask as other files. Hence, there doesn't need to be a different mapping file for EACH raw dataset---just for each raw dataset that has a DIFFERENT grid or land-mask. See :numref:`Figure mkmapdata.sh` for a visual representation of how this works. The bash script figures out which mapping files it needs to create and then runs ``ESMF_RegridWeightGen`` for each one. You can then either enter the datasets into the XML database (see Chapter :numref:`adding-new-resolutions-section`), or leave the files in place and use the ``-res usrspec -usr_gname -usr_gdate`` options to ``mksurfdata_map``. ``mkmapdata.sh`` has a help option with the following +The bash shell script ``$CTSMROOT/tools/mkmapgrids/mkmapdata.sh`` uses ``ESMF_RegridWeightGen`` to create a list of maps from the raw datasets that are input to ``mksurfdata_esmf``. Each dataset that has a different grid, or land-mask needs a different mapping file for it, but many different raw datasets share the same grid/land-mask as other files. Hence, there doesn't need to be a different mapping file for EACH raw dataset---just for each raw dataset that has a DIFFERENT grid or land-mask. See :numref:`Figure mkmapdata.sh` for a visual representation of how this works. The bash script figures out which mapping files it needs to create and then runs ``ESMF_RegridWeightGen`` for each one. You can then either enter the datasets into the XML database (see Chapter :numref:`adding-new-resolutions-section`), or leave the files in place and use the ``-res usrspec -usr_gname -usr_gdate`` options to ``mksurfdata_esmf``. ``mkmapdata.sh`` has a help option with the following :: ../../tools/mkmapdata/mkmapdata.sh @@ -104,4 +104,4 @@ The bash shell script ``$CTSMROOT/tools/mkmapgrids/mkmapdata.sh`` uses ``ESMF_Re Details of running mkmapdata.sh -Each of the raw datasets for ``mksurfdata_map`` needs a mapping file to map from the output grid you are running on to the grid and land-mask for that dataset. This is what ``mkmapdata.sh`` does. To create the mapping files you need a SCRIP grid file to correspond with each resolution and land mask that you have a raw data file in ``mksurfdata_map``. Some raw datasets share the same grid and land mask -- hence they can share the same SCRIP grid file. The output maps created here go into ``mksurfdata_map`` see :numref:`Figure Workflow of CLM5 Land Use Data Tool and Mksurfdata_map Tool`. +Each of the raw datasets for ``mksurfdata_esmf`` needs a mapping file to map from the output grid you are running on to the grid and land-mask for that dataset. This is what ``mkmapdata.sh`` does. To create the mapping files you need a SCRIP grid file to correspond with each resolution and land mask that you have a raw data file in ``mksurfdata_esmf``. Some raw datasets share the same grid and land mask -- hence they can share the same SCRIP grid file. The output maps created here go into ``mksurfdata_esmf`` see :numref:`Figure Workflow of CLM5 Land Use Data Tool and mksurfdata_esmf Tool`. 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 cfaa8527cd..d2e2ef7c89 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 @@ -14,7 +14,7 @@ When just creating a replacement file for an existing one, the relevant tool sho Data Flow for Creation of Surface Datasets from Raw SCRIP Grid Files -Starting from a SCRIP grid file that describes the grid you will run the model on, you first run ```mkmapdata.sh`` to create a list of mapping files. See :numref:`Figure mkmapdata.sh` for a more detailed view of how ``mkmapdata.sh`` works. The mapping files tell ``mksurfdata_map`` how to map between the output grid and the raw datasets that it uses as input. The output of ``mksurfdata_map`` is a surface dataset that you then use for running the model. See :numref:`Figure Workflow of CLM5 Land Use Data Tool and Mksurfdata_map Tool` for a more detailed view of how ``mksurfdata_map`` works. +Starting from a SCRIP grid file that describes the grid you will run the model on, you first run ```mkmapdata.sh`` to create a list of mapping files. See :numref:`Figure mkmapdata.sh` for a more detailed view of how ``mkmapdata.sh`` works. The mapping files tell ``mksurfdata_esmf`` how to map between the output grid and the raw datasets that it uses as input. The output of ``mksurfdata_esmf`` is a surface dataset that you then use for running the model. See :numref:`Figure Workflow of CLM5 Land Use Data Tool and mksurfdata_esmf Tool` for a more detailed view of how ``mksurfdata_esmf`` works. :numref:`Figure Data_Flow_Legend` is the legend for this figure (:numref:`Figure Data_Flow`) and other figures in this chapter (:numref:`Figure Global-Domain` and :numref:`Figure mknoocnmap.pl`). @@ -26,7 +26,7 @@ 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_map** 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 ------------------------------------------------- @@ -39,13 +39,13 @@ Creating a Complete Set of Files for Input to CLM 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_map (if NOT already done) +3. Create mapping files for mksurfdata_esmf (if NOT already done) - Create mapping files for mksurfdata_map with mkmapdata.sh in $CTSMROOT/tools/mkmapdata. See the Section called Creating mapping files that mksurfdata_map 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_map 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_map 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. 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 385ec159aa..50a7969281 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_map`` 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`. ``PTCLM`` uses these methods to customize datasets; see Chapter :numref:`running-PTCLM`. 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. 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 6921e4dafd..664e23a220 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 @@ -16,7 +16,7 @@ The list of generally important scripts and programs are as follows. #. *./mkmapdata* to create SCRIP mapping data file from SCRIP grid files (uses ESMF). -#. *mksurfdata_map* 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|. @@ -26,7 +26,7 @@ The list of generally important scripts and programs are as follows. 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_map and mkprocdata_map) run, with a namelist (mksurfdata_map) 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_map** 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_map/mksurfdata_map.namleist`` that shows you what the namelist should look like. **mksurfdata_map** 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/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: :: $CTSMROOT/bld/namelist_files/namelist_definition.xml`` file From 91a4906605ab18649655843aa1c12dccae13bb2c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 10 Apr 2024 14:00:40 -0600 Subject: [PATCH 3/9] remove some no longer needed mksurfdata_map settings --- .gitignore | 1 - .../namelist_definition_ctsm.xml | 203 ------------------ 2 files changed, 204 deletions(-) diff --git a/.gitignore b/.gitignore index 5885db2237..9cd97ae20e 100644 --- a/.gitignore +++ b/.gitignore @@ -95,7 +95,6 @@ ctsm.input_data_list.previous /tools/mksurfdata_esmf/mksurfdata_jobscript_single /tools/mksurfdata_esmf/pio_iotype.txt /tools/mksurfdata_esmf/*.sh -/tools/mksurfdata_esmf/mksrf_*.o* /tools/mksurfdata_esmf/tool_bld /tools/mksurfdata_esmf/pio_iotype.txt diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index cfa06dd6f3..73f933d3f6 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -1374,209 +1374,6 @@ Toggle to turn on the dynamic root model Toggle to turn on on diagnostic Snow Radiative Effect - - - - -Output of "git describe" to give the tag/commit the version being used corresponds to - - - -Filename for mksurfdata_map to remap raw data into the output surface dataset - - - -Plant Function Type dataset for mksurfdata - - - -Harvest dataset for mksurfdata - - - -Dataset for percent glacier land-unit for mksurfdata - - - -Dataset for glacier region ID for mksurfdata - - - -Dataset for topography used to define urban threshold - - - -Leaf Area Index dataset for mksurfdata - - - -Soil texture dataset for mksurfdata - - - -Soil color dataset for mksurfdata - - - -Soil max fraction dataset for mksurfdata - - - -High resolution land mask/fraction dataset for mksurfdata -(used for glacier_mec land-units) - - - -Type of grid to create for mksurfdata - - - -Grid file at the output resolution for mksurfdata - - - -Text file with filepaths (or list of XML elements) for vegetation fractions -and harvesting for each year to run over for mksurfdata to be able to model -transient land-use change - - - -High resolution topography dataset for mksurfdata -(used for glacier_mec land-units) - - - -Irrigation dataset for mksurfdata - - - -Organic soil dataset for mksurfdata - - - -Lake water dataset for mksurfdata - - - -Wetland dataset for mksurfdata - - - -Urban dataset for mksurfdata - - - -Biogenic Volatile Organic Compounds (VOC) emissions dataset for mksurfdata - - - -GDP dataset for mksurfdata - - - -Peat dataset for mksurfdata - - - -Soil depth dataset for mksurfdata - - - -Agricultural burning dominant month dataset for mksurfdata - - - -Topography statistics dataset for mksurfdata - - - -VIC parameters dataset for mksurfdata - - - -If TRUE, output variables in double precision for mksurfdata - - - -If TRUE, ignore other files, and set the output percentage to 100% urban and -zero for other land-use types. - - - -If TRUE, set wetland to 0% over land (renormalizing other landcover types as needed); -wetland will only be used for ocean points. - - - -Number of Plant Functional Types (excluding bare-soil) - - - -Plant Function Type index to override global file with for mksurfdata - - - -Plant Function Type fraction to override global file with for mksurfdata - - - -Soil color index to override global file with for mksurfdata - - - -Soil maximum fraction to override global file with for mksurfdata - - - -Soil percent sand to override global file with for mksurfdata - - - -Soil percent clay to override global file with for mksurfdata - - - From c9f13bd4e56efb92d6e10d1050882c4c7d28a587 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 10 Apr 2024 14:24:04 -0600 Subject: [PATCH 4/9] Remove comments about mksurfdata_map --- tools/README | 8 +++++--- tools/README.filecopies | 15 ++++----------- tools/mkprocdata_map/src/Makefile | 4 ++-- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/tools/README b/tools/README index 78a2cccb09..7fc72f04fb 100644 --- a/tools/README +++ b/tools/README @@ -59,7 +59,7 @@ II. Notes on building/running for each of the above tools: so that you can use the debugger, and with bounds-checking, and float trapping on. To speed up do the following... - gmake OPT=TRUE (by default already on for mksurfdata_map) + gmake OPT=TRUE Also some of the tools allow for OpenMP shared memory parallelism (such as mksurfdata) with @@ -78,8 +78,10 @@ II. Notes on building/running for each of the above tools: mksurfdata_esmf has a cime configure and CMake based build using the following files: - CMakeLists.txt -- Tells CMake how to build the source code - Makefile -------- GNU makefile to link the program together + gen_mksurfdata_build.sh - Build mksurfdata_esmf + src/CMakeLists.txt ------ Tells CMake how to build the source code + Makefile ---------------- GNU makefile to link the program together + cmake ------------------- CMake macros for finding libraries mkmapgrids, and site_and_regional only contain scripts so don't have the above build files. diff --git a/tools/README.filecopies b/tools/README.filecopies index 5ab2bc96d1..a96dff1ab7 100644 --- a/tools/README.filecopies +++ b/tools/README.filecopies @@ -1,27 +1,20 @@ tools/README.filecopies May/26/2011 There are several files that are copies of the original files from -either CTSM src/main, cime/src/share/utils, -cime/src/share/unit_test_stubs, or copies from other tool -directories. By having copies the tools can all be made stand-alone, +either CTSM src/utils or src/main, or share/src. +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. I. Files that are IDENTICAL: - 1. csm_share files copied that should be identical to cime/share/utils: + 1. csm_share files copied that should be identical to share/src: shr_kind_mod.F90 shr_const_mod.F90 - shr_log_mod.F90 - shr_timer_mod.F90 shr_string_mod.F90 shr_file_mod.F90 - 2. csm_share files copied that should be identical to cime/share/csm_share/unit_testers: - - test_mod.F90 - II. Files with differences 1. csm_share files copied with differences: @@ -32,7 +25,7 @@ II. Files with differences fileutils.F90 --- Remove use of masterproc and spmdMod and endrun in abortutils. - 3. Files in mksurfdata_map + 3. Files in mksurfdata_esmf mkvarpar.F90 nanMod.F90 diff --git a/tools/mkprocdata_map/src/Makefile b/tools/mkprocdata_map/src/Makefile index 6f07deb741..42f797b3c2 100644 --- a/tools/mkprocdata_map/src/Makefile +++ b/tools/mkprocdata_map/src/Makefile @@ -1,4 +1,4 @@ -# Makefile for mksurfdata_map +# Makefile for mkprocdata_map EXENAME = ../mkprocdata_map @@ -7,4 +7,4 @@ ifeq ($(OPT),$(null)) OPT := TRUE endif -include Makefile.common \ No newline at end of file +include Makefile.common From 146d44adfe1e2f89438409c63eaead66509bf86b Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 10 Apr 2024 17:36:12 -0600 Subject: [PATCH 5/9] Updates to ChangeLog from @slevis-lmwg review, and a few additions from going through issues --- doc/ChangeLog | 28 +++++++++++++++++++++------- doc/ChangeSum | 2 +- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 58e46cbb4a..337445490e 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: ctsm5.2.0 -Originator(s): erik (Erik Kluzek) -Date: Wed Apr 3 01:17:18 MDT 2024 +Originator(s): many (see below) +Date: Wed Apr 10 17:35:36 MDT 2024 One-line Summary: New surface datasets and new mksurfdata_esmf tool to create them Purpose and description of changes @@ -26,9 +26,9 @@ on coastal areas was also done. The following fields were added and removed to the list of fields on the datasets. Fields added: - ORGC, BULK, CFRAG, PHAQ (soil data) + ORGC, BULK, CFRAG, PHAQ (soil data) (currently NOT used by CTSM) mapunits (map units for the soil dataset) - LANDFRAC_MKSURFDATA + LANDFRAC_MKSURFDATA (for reference NOT used by CTSM) PCT_OCEAN (previously PCT_WETLAND was used) Fields removed: @@ -70,7 +70,8 @@ New lake datasets: HydroLake: Messager et. al. (2016) Contributors ------------ -@mvertens @ekluzek @jedwards4b @billsacks @wwieder @lawrencepj1 @negin513 @dlawrenncar @olyson +@mvertens @ekluzek @slevis-lmwg @jedwards4b @billsacks @wwieder @lawrencepj1 @negin513 @dlawrenncar @olyson +@keerzhang1 @fang-bowen @Face2sea @adamrher @samsrabin Significant changes to scientifically-supported configurations -------------------------------------------------------------- @@ -103,8 +104,11 @@ CTSM issues fixed (include CTSM Issue #): the landuse.timeseries file is made Fixes #2218 CTSM5.2 branch dies weirdly when clm5.0/ctsm5.1 datasets are used -- die with an error - Fixes #2278 Allow CTSM to output history files interpolated to a regular - grid (for example from SE unstructured grids to a FV grid) + Fixes #1483 hcru surface datasets + Fixes #2228 sys test requirements for mksurfdata_esmf + Fixes #90 Remove need for fatmgrid + Fixes #80 Improve modularity of mksurfdata_map + Fixes #1878 Convert wetlands to bare-ground Notes of particular relevance for users --------------------------------------- @@ -113,6 +117,16 @@ Caveats for users (e.g., need to interpolate initial conditions): These surface datasets can NOT be used in previous versions of the model Older surface datasets can NOT be used with this model version + IMPORTANT NOTE FOR USERS FOR REGIONAL CASES: + Because of this issue: + + https://github.com/ESCOMP/CTSM/issues/2430 + + We recommend that users use subset_data to subset your region from a global + grid. This could mean creating a global grid at the resolution you need (if + not standard) and then use subset_data on it to get the region of + interest. + Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): New CLM_PHYSICS_VERSION option of clm6_0 added (use it rather than clm5_1) New compsets for Clm60 added diff --git a/doc/ChangeSum b/doc/ChangeSum index c027721724..a62eeeac91 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,6 +1,6 @@ Tag Who Date Summary ============================================================================================================================ - ctsm5.2.0 multiple 04/03/2024 New mksurfdata_esmf tool to create new surface datasets that are in place + ctsm5.2.0 many 04/10/2024 New mksurfdata_esmf tool to create new surface datasets that are in place ctsm5.1.dev175 slevis 03/21/2024 merge-b4bdev-20240321 ctsm5.1.dev174 olyson 03/14/2024 Improve vegetation health at high latitudes ctsm5.1.dev173 rgknox 03/13/2024 New FATES namelist variable: fates_history_dimlevel From 5b1ee03f5c8b1af4cd5ab19f3674ba33f7e2c0b2 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 10 Apr 2024 18:13:12 -0600 Subject: [PATCH 6/9] Add cam7.0 LND_TUNING options --- cime_config/config_component.xml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index c9f9e2d0ec..41fc8f737d 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -66,7 +66,10 @@ Atm forcing options: CRUv7 GSWP3 + CAM4.0 + CAM5.0 CAM6.0 + CAM7.0 QIAN (not tuned) 1PT (not tuned) NLDAS2 (not tuned) @@ -74,8 +77,8 @@ Other atm forcing options are invalid to run CLM and will result in an error. UNSET - - clm5_0_cam6.0,clm5_0_GSWP3v1,clm5_0_CRUv7,clm5_0_QIAN,clm5_0_1PT,clm5_0_NLDAS2,clm5_0_ERA5,clm4_5_CRUv7,clm4_5_GSWP3v1,clm4_5_QIAN,clm4_5_cam6.0,clm4_5_1PT,clm4_5_NLDAS2,clm4_5_ERA5,clm5_1_CRUv7,clm5_1_GSWP3v1,clm5_1_cam6.0,clm5_1_QIAN,clm5_1_1PT,clm5_1_NLDAS2,clm5_1_ERA5,clm6_0_CRUv7,clm6_0_GSWP3v1,clm6_0_cam6.0,clm6_0_QIAN,clm6_0_1PT,clm6_0_NLDAS2,clm6_0_ERA5 + + clm5_0_cam6.0,clm5_0_cam7.0,clm5_0_GSWP3v1,clm5_0_CRUv7,clm5_0_QIAN,clm5_0_1PT,clm5_0_NLDAS2,clm5_0_ERA5,clm4_5_CRUv7,clm4_5_GSWP3v1,clm4_5_QIAN,clm4_5_cam6.0,clm4_5_cam7.0,clm4_5_1PT,clm4_5_NLDAS2,clm4_5_ERA5,clm5_1_CRUv7,clm5_1_GSWP3v1,clm5_1_cam6.0,clm5_1_QIAN,clm5_1_1PT,clm5_1_NLDAS2,clm5_1_ERA5,clm6_0_CRUv7,clm6_0_GSWP3v1,clm6_0_cam6.0,clm6_0_cam7.0,clm6_0_QIAN,clm6_0_1PT,clm6_0_NLDAS2,clm6_0_ERA5 @@ -84,6 +87,7 @@ clm4_5_CRUv7 clm4_5_GSWP3v1 clm4_5_cam6.0 + clm4_5_cam7.0 clm4_5_cam6.0 clm4_5_QIAN clm4_5_QIAN @@ -96,6 +100,7 @@ clm5_0_GSWP3v1 clm5_0_GSWP3v1 clm5_0_cam6.0 + clm5_0_cam7.0 clm5_0_cam6.0 clm5_0_QIAN clm5_0_QIAN @@ -113,6 +118,7 @@ clm6_0_GSWP3v1 clm6_0_GSWP3v1 clm6_0_cam6.0 + clm6_0_cam7.0 clm6_0_cam6.0 clm6_0_QIAN clm6_0_QIAN From 705d0c76adce8268ef1fdfaf9020dff92ed3f2e5 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 10 Apr 2024 18:26:15 -0600 Subject: [PATCH 7/9] make default gen_mksurfdata generated scripts have a .sh extension --- .gitignore | 4 ++-- cime_config/SystemTests/mksurfdataesmf.py | 4 ++-- python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py | 2 +- python/ctsm/toolchain/gen_mksurfdata_jobscript_single.py | 2 +- tools/README | 4 ++-- tools/mksurfdata_esmf/README.md | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 9cd97ae20e..1da8072fed 100644 --- a/.gitignore +++ b/.gitignore @@ -91,8 +91,8 @@ ctsm.input_data_list.previous /tools/mksurfdata_esmf/mksurfdata_in /tools/mksurfdata_esmf/surfdata_*.nc /tools/mksurfdata_esmf/landuse.timeseries_*.nc -/tools/mksurfdata_esmf/mksurfdata_jobscript_multi -/tools/mksurfdata_esmf/mksurfdata_jobscript_single +/tools/mksurfdata_esmf/mksurfdata_jobscript_multi.sh +/tools/mksurfdata_esmf/mksurfdata_jobscript_single.sh /tools/mksurfdata_esmf/pio_iotype.txt /tools/mksurfdata_esmf/*.sh /tools/mksurfdata_esmf/tool_bld diff --git a/cime_config/SystemTests/mksurfdataesmf.py b/cime_config/SystemTests/mksurfdataesmf.py index 301141f02a..f5de3c4592 100644 --- a/cime_config/SystemTests/mksurfdataesmf.py +++ b/cime_config/SystemTests/mksurfdataesmf.py @@ -35,7 +35,7 @@ def __init__(self, case): time_stamp = datetime.today().strftime("%y%m%d") self._res = "10x15" # see important comment in script's docstring self._model_yr = "1850" - self._jobscript = os.path.join(self._get_caseroot(), "mksurfdata_jobscript_single") + self._jobscript = os.path.join(self._get_caseroot(), "mksurfdata_jobscript_single.sh") self._fsurdat_namelist = os.path.join( self._get_caseroot(), f"surfdata_{self._res}_hist_{self._model_yr}_78pfts_c{time_stamp}.namelist", @@ -62,7 +62,7 @@ def build_phase(self, sharedlib_only=False, model_only=False): # Paths and strings build_script_path = os.path.join(self._tool_path, "gen_mksurfdata_build.sh") nml_script_path = os.path.join(self._tool_path, "gen_mksurfdata_namelist") - gen_jobscript_path = os.path.join(self._tool_path, "gen_mksurfdata_jobscript_single") + gen_jobscript_path = os.path.join(self._tool_path, "gen_mksurfdata_jobscript_single.sh") gen_mksurfdata_namelist = f"{nml_script_path} --res {self._res} --start-year {self._model_yr} --end-year {self._model_yr}" gen_mksurfdata_jobscript = f"{gen_jobscript_path} --number-of-nodes 1 --tasks-per-node 64 --namelist-file {self._fsurdat_namelist} --bld-path {self._tool_bld}" diff --git a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py index d0ad313867..6deb50ebfb 100755 --- a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py +++ b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py @@ -66,7 +66,7 @@ def get_parser(): """ Get parser object for this script. """ - parser = base_get_parser(default_js_name="mksurfdata_jobscript_multi") + parser = base_get_parser(default_js_name="mksurfdata_jobscript_multi.sh") parser.add_argument( "--scenario", diff --git a/python/ctsm/toolchain/gen_mksurfdata_jobscript_single.py b/python/ctsm/toolchain/gen_mksurfdata_jobscript_single.py index a04265ba84..ff793165d9 100755 --- a/python/ctsm/toolchain/gen_mksurfdata_jobscript_single.py +++ b/python/ctsm/toolchain/gen_mksurfdata_jobscript_single.py @@ -20,7 +20,7 @@ logger = logging.getLogger(__name__) -def base_get_parser(default_js_name="mksurfdata_jobscript_single"): +def base_get_parser(default_js_name="mksurfdata_jobscript_single.sh"): """ Get parser object for the gen_mksurfdata_jobscript scripts """ diff --git a/tools/README b/tools/README index 7fc72f04fb..70a2807214 100644 --- a/tools/README +++ b/tools/README @@ -198,7 +198,7 @@ III. Process sequence to create input datasets needed to run CTSM gridnames. 5.) Create surface datasets with mksurfdata_esmf on Derecho - (See mksurfdata_esmf/README for more help on doing this) + (See mksurfdata_esmf/README.md for more help on doing this) - gen_mksurfdata_build.sh to build - gen_mksurfdata_namelist to build the namelist @@ -216,7 +216,7 @@ III. Process sequence to create input datasets needed to run CTSM ./gen_mksurfdata_build.sh ./gen_mksurfdata_namelist --res 0.9x1.25 --start-year 1850 --end-year 1850 ./gen_mksurfdata_jobscript_single --number-of-nodes 24 --tasks-per-node 12 --namelist-file target.namelist - qsub mksurfdata_jobscript_single + qsub mksurfdata_jobscript_single.sh NOTE that surface dataset will be used by default for fatmgrid - and it will contain the lat,lon,edges and area values for the atm grid - ASSUMING that diff --git a/tools/mksurfdata_esmf/README.md b/tools/mksurfdata_esmf/README.md index 3c551d0388..a748c3d721 100644 --- a/tools/mksurfdata_esmf/README.md +++ b/tools/mksurfdata_esmf/README.md @@ -153,7 +153,7 @@ for example try --res 1.9x2.5 --start-year 1850 --end-year 1850: ``` shell # Assuming pwd is the tools/mksurfdata_esmf directory ./gen_mksurfdata_jobscript_single --number-of-nodes 2 --tasks-per-node 128 --namelist-file target.namelist - qsub mksurfdata_jobscript_single + qsub mksurfdata_jobscript_single.sh ``` Read note about regional grids at the end. @@ -167,7 +167,7 @@ for example try --res 1.9x2.5 --start-year 1850 --end-year 1850: ``` shell # Assuming pwd is the tools/mksurfdata_esmf directory ./gen_mksurfdata_jobscript_multi --number-of-nodes 2 --scenario global-present - qsub mksurfdata_jobscript_multi + qsub mksurfdata_jobscript_multi.sh ``` If you are looking to generate all (or a large number of) the datasets or the From 9b5ef2221876e9e5e4a7781d0da1be6672588d5c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 10 Apr 2024 18:31:51 -0600 Subject: [PATCH 8/9] Remove the .sh exention from gen_mksurfdata_build.sh as one of the parts of #2446 --- cime_config/SystemTests/mksurfdataesmf.py | 2 +- .../test/test_unit_gen_mksurfdata_jobscript_single.py | 2 +- tools/README | 6 +++--- tools/mksurfdata_esmf/README.md | 2 +- tools/mksurfdata_esmf/gen_mksurfdata_build.sh | 8 ++++---- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cime_config/SystemTests/mksurfdataesmf.py b/cime_config/SystemTests/mksurfdataesmf.py index f5de3c4592..03295201ac 100644 --- a/cime_config/SystemTests/mksurfdataesmf.py +++ b/cime_config/SystemTests/mksurfdataesmf.py @@ -60,7 +60,7 @@ def build_phase(self, sharedlib_only=False, model_only=False): # if the test stops and gets restarted. if sharedlib_only: # Paths and strings - build_script_path = os.path.join(self._tool_path, "gen_mksurfdata_build.sh") + build_script_path = os.path.join(self._tool_path, "gen_mksurfdata_build") nml_script_path = os.path.join(self._tool_path, "gen_mksurfdata_namelist") gen_jobscript_path = os.path.join(self._tool_path, "gen_mksurfdata_jobscript_single.sh") gen_mksurfdata_namelist = f"{nml_script_path} --res {self._res} --start-year {self._model_yr} --end-year {self._model_yr}" diff --git a/python/ctsm/test/test_unit_gen_mksurfdata_jobscript_single.py b/python/ctsm/test/test_unit_gen_mksurfdata_jobscript_single.py index f09d91ccce..5038c6b3e1 100755 --- a/python/ctsm/test/test_unit_gen_mksurfdata_jobscript_single.py +++ b/python/ctsm/test/test_unit_gen_mksurfdata_jobscript_single.py @@ -151,7 +151,7 @@ def test_derecho_mpirun(self): self.assertEqual(self._account, args.account) # Create the env_mach_specific.xml file needed for get_mpirun # This will catch problems with our usage of CIME objects - # Doing this here will also catch potential issues in the gen_mksurfdata_build.sh script + # Doing this here will also catch potential issues in the gen_mksurfdata_build script configure_path = os.path.join(path_to_cime(), "CIME", "scripts", "configure") self.assertTrue(os.path.exists(configure_path)) options = " --macros-format CMake --silent --compiler intel --machine " + machine diff --git a/tools/README b/tools/README index 70a2807214..568dc1239b 100644 --- a/tools/README +++ b/tools/README @@ -78,7 +78,7 @@ II. Notes on building/running for each of the above tools: mksurfdata_esmf has a cime configure and CMake based build using the following files: - gen_mksurfdata_build.sh - Build mksurfdata_esmf + gen_mksurfdata_build ---- Build mksurfdata_esmf src/CMakeLists.txt ------ Tells CMake how to build the source code Makefile ---------------- GNU makefile to link the program together cmake ------------------- CMake macros for finding libraries @@ -200,7 +200,7 @@ III. Process sequence to create input datasets needed to run CTSM 5.) Create surface datasets with mksurfdata_esmf on Derecho (See mksurfdata_esmf/README.md for more help on doing this) - - gen_mksurfdata_build.sh to build + - gen_mksurfdata_build to build - gen_mksurfdata_namelist to build the namelist - gen_mksurfdata_jobscript_single to build a batch script to run on Derecho - Submit the batch script just created above @@ -213,7 +213,7 @@ III. Process sequence to create input datasets needed to run CTSM Example: for 0.9x1.25 resolution fro 1850 cd mksurfdata_esmf - ./gen_mksurfdata_build.sh + ./gen_mksurfdata_build ./gen_mksurfdata_namelist --res 0.9x1.25 --start-year 1850 --end-year 1850 ./gen_mksurfdata_jobscript_single --number-of-nodes 24 --tasks-per-node 12 --namelist-file target.namelist qsub mksurfdata_jobscript_single.sh diff --git a/tools/mksurfdata_esmf/README.md b/tools/mksurfdata_esmf/README.md index a748c3d721..11cb69c681 100644 --- a/tools/mksurfdata_esmf/README.md +++ b/tools/mksurfdata_esmf/README.md @@ -100,7 +100,7 @@ This will bring in CIME and ccs_config which are required for building. ``` shell # Assuming pwd is the tools/mksurfdata_esmf directory - ./gen_mksurfdata_build.sh # For machines with a cime build + ./gen_mksurfdata_build # For machines with a cime build ``` Note: The pio_iotype value gets set and written to a simple .txt file diff --git a/tools/mksurfdata_esmf/gen_mksurfdata_build.sh b/tools/mksurfdata_esmf/gen_mksurfdata_build.sh index c8b891c1c4..974c1929a5 100755 --- a/tools/mksurfdata_esmf/gen_mksurfdata_build.sh +++ b/tools/mksurfdata_esmf/gen_mksurfdata_build.sh @@ -6,7 +6,7 @@ usage() { echo "" echo "***********************************************************************" echo "usage:" - echo "./gen_mksurfdata_build.sh" + echo "./gen_mksurfdata_build" echo "" echo "valid arguments: " echo "[-h|--help] " @@ -14,14 +14,14 @@ usage() { echo "[-v|--verbose] " echo " Run in verbose mode" echo "[-b|--blddir ] " - echo " Overrides default, which is /tool_bld in the same directory as ./gen_mksurfdata_build.sh" + echo " Overrides default, which is /tool_bld in the same directory as ./gen_mksurfdata_build" echo "[-m|--machine ] " echo " Overrides default MACH" echo "***********************************************************************" } -# Current working directory: the location of ./gen_mksurfdata_build.sh +# Current working directory: the location of ./gen_mksurfdata_build cwd=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # Default settings @@ -102,7 +102,7 @@ cd $blddir # Write pio_iotype to file with name pio_iotype.txt pio_iotype_filepath=../pio_iotype.txt # one up from /tool_bld if [ ! -f "$pio_iotype_filepath" ]; then - echo 'VALUE OF pio_iotype WRITTEN BY gen_mksurfdata_build.sh AND USED BY mksurfdata (i.e. THE FORTRAN EXECUTABLE):' > $pio_iotype_filepath + echo 'VALUE OF pio_iotype WRITTEN BY gen_mksurfdata_build AND USED BY mksurfdata (i.e. THE FORTRAN EXECUTABLE):' > $pio_iotype_filepath echo $pio_iotype >> $pio_iotype_filepath else echo "Use existing $pio_iotype_filepath file" From 6bfb9af0f65f6079d0d186de1fcef58da6803451 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 10 Apr 2024 22:12:37 -0600 Subject: [PATCH 9/9] Remove mkmapdata and mksurfdata from the template file --- bld/namelist_files/namelist_definition.xsl | 23 ---------------------- 1 file changed, 23 deletions(-) diff --git a/bld/namelist_files/namelist_definition.xsl b/bld/namelist_files/namelist_definition.xsl index 545d810e52..7917cc262f 100644 --- a/bld/namelist_files/namelist_definition.xsl +++ b/bld/namelist_files/namelist_definition.xsl @@ -252,18 +252,6 @@

These are namelist items that appear in the CLM Tools under components/clm/tools.

- - - - - - - - - - -
CLM mksurfdata
NameTypeDescription
Valid values
- @@ -276,17 +264,6 @@
CLM mkgriddata
Name
- - - - - - - - - - -
CLM mkmapdata
NameTypeDescription
Valid values
CLM mkgriddata