Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds notes about generating surface dataset and initial condition for ELM #6582

Merged
merged 7 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 41 additions & 41 deletions components/elm/bld/namelist_files/namelist_defaults.xml
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ lnd/clm2/surfdata_map/surfdata_64x128_simyr2000_c170111.nc</fsurdat>
<fsurdat hgrid="NLDAS" sim_year="2000" irrig=".false." use_crop=".false." >
lnd/clm2/surfdata_map/surfdata_nldas2_simyr2000_c181207.nc</fsurdat>

<fsurdat hgrid="r0125xr0125" sim_year="2000" use_crop=".false." >
<fsurdat hgrid="r0125" sim_year="2000" use_crop=".false." >
lnd/clm2/surfdata_map/surfdata_0.125x0.125_simyr2000_c190730.nc</fsurdat>
<fsurdat hgrid="0.9x1.25" sim_year="2000" use_crop=".false." >
lnd/clm2/surfdata_map/surfdata_0.9x1.25_simyr2000_c180404.nc</fsurdat>
Expand Down Expand Up @@ -396,7 +396,7 @@ lnd/clm2/surfdata_map/surfdata_360x720cru_simyr1850_c180216.nc</fsurdat>
<fsurdat hgrid="48x96" sim_year="1850" use_crop=".false." >
lnd/clm2/surfdata_map/surfdata_48x96_simyr1850_c130927.nc</fsurdat>

<fsurdat hgrid="r0125xr0125" sim_year="1850" use_crop=".false." >
<fsurdat hgrid="r0125" sim_year="1850" use_crop=".false." >
lnd/clm2/surfdata_map/surfdata_0.125x0.125_simyr1850_c190730.nc</fsurdat>
<fsurdat hgrid="0.9x1.25" sim_year="1850" use_crop=".false." >
lnd/clm2/surfdata_map/surfdata_0.9x1.25_simyr1850_c180306.nc</fsurdat>
Expand Down Expand Up @@ -1686,13 +1686,6 @@ this mask will have smb calculated over the entire global land surface
<map frm_hgrid="1km-merge-10min" frm_lmask="HYDRO1K-merge-nomask" to_hgrid="2.5x3.33" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/2.5x3.33/map_1km-merge-10min_HYDRO1K-merge-nomask_to_2.5x3.33_nomask_aave_da_c130405.nc</map>

<!-- mapping files for 0.25x0.25 START added on Wed May 1 11:10:45 2024-->

<map frm_hgrid="0.01x0.01" frm_lmask="nomask" to_hgrid="0.25x0.25" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/0.25x0.25/map_0.01x0.01_nomask_to_0.25x0.25_nomask_aave_da_c240501.nc</map>

<!-- mapping files for 0.25x0.25 END -->

<!-- mapping files for 0.5x0.5 START added on Wed Sep 19 09:05:45 2012-->
<!-- Created by lnd/clm/bld/namelist_files/createMapEntry.pl-->

Expand Down Expand Up @@ -2056,76 +2049,83 @@ this mask will have smb calculated over the entire global land surface
<map frm_hgrid="0.5x0.5" frm_lmask="GSDTG2000" to_hgrid="ne0np4_northamericax4v1.pg2" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/northamericax4v1pg2/map_0.5x0.5_GSDTG2000_to_northamericax4v1pg2_nomask_aave_da_c210112.nc</map>

<!-- mapping files for r0125xr0125 START added on Fri Aug 1 15:44:32 2014-->
<!-- mapping files for r0125 START added on Fri Aug 1 15:44:32 2014-->
<!-- Created by lnd/clm/bld/namelist_files/createMapEntry.pl-->

<map frm_hgrid="0.5x0.5" frm_lmask="AVHRR" to_hgrid="r0125xr0125" to_lmask="nomask"
<map frm_hgrid="0.5x0.5" frm_lmask="AVHRR" to_hgrid="r0125" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/0.125x0.125/map_0.5x0.5_AVHRR_to_0.125x0.125_nomask_aave_da_c190725.nc</map>
<map frm_hgrid="0.5x0.5" frm_lmask="MODIS" to_hgrid="r0125xr0125" to_lmask="nomask"
<map frm_hgrid="0.5x0.5" frm_lmask="MODIS" to_hgrid="r0125" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/0.125x0.125/map_0.5x0.5_MODIS_to_0.125x0.125_nomask_aave_da_c190725.nc</map>
<map frm_hgrid="0.9x1.25" frm_lmask="GRDC" to_hgrid="r0125xr0125" to_lmask="nomask"
<map frm_hgrid="0.9x1.25" frm_lmask="GRDC" to_hgrid="r0125" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/0.125x0.125/map_0.9x1.25_GRDC_to_0.125x0.125_nomask_aave_da_c190725.nc</map>
<map frm_hgrid="10x10min" frm_lmask="IGBPmergeICESatGIS" to_hgrid="r0125xr0125" to_lmask="nomask"
<map frm_hgrid="10x10min" frm_lmask="IGBPmergeICESatGIS" to_hgrid="r0125" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/0.125x0.125/map_10x10min_IGBPmergeICESatGIS_to_0.125x0.125_nomask_aave_da_c190725.nc</map>
<map frm_hgrid="10x10min" frm_lmask="nomask" to_hgrid="r0125xr0125" to_lmask="nomask"
<map frm_hgrid="10x10min" frm_lmask="nomask" to_hgrid="r0125" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/0.125x0.125/map_10x10min_nomask_to_0.125x0.125_nomask_aave_da_c190725.nc</map>
<map frm_hgrid="1km-merge-10min" frm_lmask="HYDRO1K-merge-nomask" to_hgrid="r0125xr0125" to_lmask="nomask"
<map frm_hgrid="1km-merge-10min" frm_lmask="HYDRO1K-merge-nomask" to_hgrid="r0125" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/0.125x0.125/map_1km-merge-10min_HYDRO1K-merge-nomask_to_0.125x0.125_nomask_aave_da_c190725.nc</map>
<map frm_hgrid="360x720cru" frm_lmask="cruncep" to_hgrid="r0125xr0125" to_lmask="nomask"
<map frm_hgrid="360x720cru" frm_lmask="cruncep" to_hgrid="r0125" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/0.125x0.125/map_360x720cru_cruncep_to_0.125x0.125_nomask_aave_da_c190725.nc</map>
<map frm_hgrid="3x3min" frm_lmask="GLOBE-Gardner-mergeGIS" to_hgrid="r0125xr0125" to_lmask="nomask"
<map frm_hgrid="3x3min" frm_lmask="GLOBE-Gardner-mergeGIS" to_hgrid="r0125" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/0.125x0.125/map_3x3min_GLOBE-Gardner-mergeGIS_to_0.125x0.125_nomask_aave_da_c190725.nc</map>
<map frm_hgrid="3x3min" frm_lmask="GLOBE-Gardner" to_hgrid="r0125xr0125" to_lmask="nomask"
<map frm_hgrid="3x3min" frm_lmask="GLOBE-Gardner" to_hgrid="r0125" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/0.125x0.125/map_3x3min_GLOBE-Gardner_to_0.125x0.125_nomask_aave_da_c190725.nc</map>
<map frm_hgrid="3x3min" frm_lmask="LandScan2004" to_hgrid="r0125xr0125" to_lmask="nomask"
<map frm_hgrid="3x3min" frm_lmask="LandScan2004" to_hgrid="r0125" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/0.125x0.125/map_3x3min_LandScan2004_to_0.125x0.125_nomask_aave_da_c190725.nc</map>
<map frm_hgrid="3x3min" frm_lmask="MODIS" to_hgrid="r0125xr0125" to_lmask="nomask"
<map frm_hgrid="3x3min" frm_lmask="MODIS" to_hgrid="r0125" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/0.125x0.125/map_3x3min_MODIS_to_0.125x0.125_nomask_aave_da_c190725.nc</map>
<map frm_hgrid="3x3min" frm_lmask="USGS" to_hgrid="r0125xr0125" to_lmask="nomask"
<map frm_hgrid="3x3min" frm_lmask="USGS" to_hgrid="r0125" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/0.125x0.125/map_3x3min_USGS_to_0.125x0.125_nomask_aave_da_c190725.nc</map>
<map frm_hgrid="5x5min" frm_lmask="IGBP-GSDP" to_hgrid="r0125xr0125" to_lmask="nomask"
<map frm_hgrid="5x5min" frm_lmask="IGBP-GSDP" to_hgrid="r0125" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/0.125x0.125/map_5x5min_IGBP-GSDP_to_0.125x0.125_nomask_aave_da_c190725.nc</map>
<map frm_hgrid="5x5min" frm_lmask="ISRIC-WISE" to_hgrid="r0125xr0125" to_lmask="nomask"
<map frm_hgrid="5x5min" frm_lmask="ISRIC-WISE" to_hgrid="r0125" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/0.125x0.125/map_5x5min_ISRIC-WISE_to_0.125x0.125_nomask_aave_da_c190725.nc</map>
<map frm_hgrid="5x5min" frm_lmask="nomask" to_hgrid="r0125xr0125" to_lmask="nomask"
<map frm_hgrid="5x5min" frm_lmask="nomask" to_hgrid="r0125" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/0.125x0.125/map_5x5min_nomask_to_0.125x0.125_nomask_aave_da_c190725.nc</map>
<map frm_hgrid="0.5x0.5" frm_lmask="GSDTG2000" to_hgrid="r0125xr0125" to_lmask="nomask"
<map frm_hgrid="0.5x0.5" frm_lmask="GSDTG2000" to_hgrid="r0125" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/0.125x0.125/map_0.5x0.5_GSDTG2000_to_0.125x0.125_nomask_aave_da_c190725.nc</map>

<!-- mapping files for r0125xr0125 END -->
<!-- mapping files for r0125 END -->

<map frm_hgrid="0.5x0.5" frm_lmask="AVHRR" to_hgrid="r025xr025" to_lmask="nomask"
<map frm_hgrid="0.5x0.5" frm_lmask="AVHRR" to_hgrid="r025" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/0.25x0.25/map_0.5x0.5_AVHRR_to_0.25x0.25_nomask_aave_da_c240123.nc</map>
<map frm_hgrid="0.5x0.5" frm_lmask="MODIS" to_hgrid="r025xr025" to_lmask="nomask"
<map frm_hgrid="0.5x0.5" frm_lmask="MODIS" to_hgrid="r025" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/0.25x0.25/map_0.5x0.5_MODIS_to_0.25x0.25_nomask_aave_da_c240123.nc</map>
<map frm_hgrid="0.9x1.25" frm_lmask="GRDC" to_hgrid="r025xr025" to_lmask="nomask"
<map frm_hgrid="0.9x1.25" frm_lmask="GRDC" to_hgrid="r025" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/0.25x0.25/map_0.9x1.25_GRDC_to_0.25x0.25_nomask_aave_da_c240124.nc</map>
<map frm_hgrid="10x10min" frm_lmask="IGBPmergeICESatGIS" to_hgrid="r025xr025" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/0.25x0.25/map_10x10min_IGBPmergeICESatGIS_to_0.25x0.25_nomask_aave_da_c240123.nc</map>
<map frm_hgrid="10x10min" frm_lmask="nomask" to_hgrid="r025xr025" to_lmask="nomask"
<map frm_hgrid="10x10min" frm_lmask="nomask" to_hgrid="r025" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/0.25x0.25/map_10x10min_nomask_to_0.25x0.25_nomask_aave_da_c240123.nc</map>
<map frm_hgrid="1km-merge-10min" frm_lmask="HYDRO1K-merge-nomask" to_hgrid="r025xr025" to_lmask="nomask"
<map frm_hgrid="1km-merge-10min" frm_lmask="HYDRO1K-merge-nomask" to_hgrid="r025" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/0.25x0.25/map_1km-merge-10min_HYDRO1K-merge-nomask_to_0.25x0.25_nomask_aave_da_c240123.nc</map>
<map frm_hgrid="360x720cru" frm_lmask="cruncep" to_hgrid="r025xr025" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/0.25x0.25/map_360x720cru_cruncep_to_0.25x0.25_nomask_aave_da_c240124.nc</map>
<map frm_hgrid="3x3min" frm_lmask="GLOBE-Gardner-mergeGIS" to_hgrid="r025xr025" to_lmask="nomask"
<map frm_hgrid="3x3min" frm_lmask="GLOBE-Gardner-mergeGIS" to_hgrid="r025" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/0.25x0.25/map_3x3min_GLOBE-Gardner-mergeGIS_to_0.25x0.25_nomask_aave_da_c240123.nc</map>
<map frm_hgrid="3x3min" frm_lmask="GLOBE-Gardner" to_hgrid="r025xr025" to_lmask="nomask"
<map frm_hgrid="3x3min" frm_lmask="GLOBE-Gardner" to_hgrid="r025" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/0.25x0.25/map_3x3min_GLOBE-Gardner_to_0.25x0.25_nomask_aave_da_c240123.nc</map>
<map frm_hgrid="3x3min" frm_lmask="LandScan2004" to_hgrid="r025xr025" to_lmask="nomask"
<map frm_hgrid="3x3min" frm_lmask="LandScan2004" to_hgrid="r025" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/0.25x0.25/map_3x3min_LandScan2004_to_0.25x0.25_nomask_aave_da_c240123.nc</map>
<map frm_hgrid="3x3min" frm_lmask="MODIS" to_hgrid="r025xr025" to_lmask="nomask"
<map frm_hgrid="3x3min" frm_lmask="MODIS" to_hgrid="r025" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/0.25x0.25/map_3x3min_MODIS_to_0.25x0.25_nomask_aave_da_c240123.nc</map>
<map frm_hgrid="3x3min" frm_lmask="USGS" to_hgrid="r025xr025" to_lmask="nomask"
<map frm_hgrid="3x3min" frm_lmask="USGS" to_hgrid="r025" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/0.25x0.25/map_3x3min_USGS_to_0.25x0.25_nomask_aave_da_c240123.nc</map>
<map frm_hgrid="5x5min" frm_lmask="IGBP-GSDP" to_hgrid="r025xr025" to_lmask="nomask"
<map frm_hgrid="5x5min" frm_lmask="IGBP-GSDP" to_hgrid="r025" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/0.25x0.25/map_5x5min_IGBP-GSDP_to_0.25x0.25_nomask_aave_da_c240123.nc</map>
<map frm_hgrid="5x5min" frm_lmask="ISRIC-WISE" to_hgrid="r025xr025" to_lmask="nomask"
<map frm_hgrid="5x5min" frm_lmask="ISRIC-WISE" to_hgrid="r025" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/0.25x0.25/map_5x5min_ISRIC-WISE_to_0.25x0.25_nomask_aave_da_c240123.nc</map>
<map frm_hgrid="5x5min" frm_lmask="nomask" to_hgrid="r025xr025" to_lmask="nomask"
<map frm_hgrid="360x720cru" frm_lmask="cruncep" to_hgrid="r025" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/0.25x0.25/map_360x720_cruncep_to_0.25x0.25_nomask_aave_da_c240124.nc</map>
<map frm_hgrid="5x5min" frm_lmask="nomask" to_hgrid="r025" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/0.25x0.25/map_5x5min_nomask_to_0.25x0.25_nomask_aave_da_c240123.nc</map>
<map frm_hgrid="0.5x0.5" frm_lmask="GSDTG2000" to_hgrid="r025xr025" to_lmask="nomask"
<map frm_hgrid="0.5x0.5" frm_lmask="GSDTG2000" to_hgrid="r025" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/0.25x0.25/map_0.5x0.5_GSDTG2000_to_0.25x0.25_nomask_aave_da_c240123.nc</map>
<map frm_hgrid="0.01x0.01" frm_lmask="nomask" to_hgrid="r025" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/0.25x0.25/map_0.01x0.01_nomask_to_0.25x0.25_nomask_aave_da_c240501.nc</map>
<map frm_hgrid="0.1x0.1" frm_lmask="nomask" to_hgrid="r025" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/0.25x0.25/map_0.1x0.1_nomask_to_0.25x0.25_nomask_aave_da_c240308.nc</map>


<map frm_hgrid="0.5x0.5" frm_lmask="AVHRR" to_hgrid="ne0np4_antarcticax4v1" to_lmask="nomask"
>lnd/clm2/mappingdata/maps/antarcticax4v1/map_0.5x0.5_AVHRR_to_antarcticax4v1_nomask_aave_da_c210130.nc</map>
Expand Down
2 changes: 1 addition & 1 deletion components/elm/bld/namelist_files/namelist_definition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1502,7 +1502,7 @@ If TRUE, irrigation will be active (find surface datasets with active irrigation

<entry id="sim_year" type="integer" category="default_settings"
group="default_settings" valid_values=
"1000,850,1100,1350,1600,1850,1855,1865,1875,1885,1895,1905,1915,1925,1935,1945,1950,1955,1965,1975,1985,1995,2000,2005,2010,2015,2025,2035,2045,2055,2065,2075,2085,2095,2100,2105">
"1000,850,1100,1350,1600,1850,1855,1865,1875,1885,1895,1905,1915,1925,1935,1945,1950,1955,1965,1975,1980,1985,1995,2000,2005,2010,2015,2025,2035,2045,2055,2065,2075,2085,2095,2100,2105">
Year to simulate and to provide datasets for (such as surface datasets, initial conditions, aerosol-deposition, Nitrogen deposition rates etc.)
A sim_year of 1000 corresponds to data used for testing only, NOT corresponding to any real datasets.
A sim_year greater than 2005 corresponds to rcp scenario data
Expand Down
8 changes: 8 additions & 0 deletions components/elm/docs/user-guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,11 @@ Using the above-mentioned settings:
[FATES](fates.md) can be run in various modes with ELM through the use of namelist settings.
The [FATES User's Guide section on namelist options](https://fates-users-guide.readthedocs.io/en/latest/user/Namelist-Options-and-Run-Time-Modes.html)
provides guidance on enabling these different FATES run modes.

## Create land surface dataset

A new surface dataset for ELM is generated using `mksurfdata_map` and the notes about it are available [here](surface_dataset.md)

## Generate land initial condition

Initial ELM condition can be generated using `interpinic` and the notes about it are available [here](interpinic.md).
79 changes: 79 additions & 0 deletions components/elm/docs/user-guide/interpinic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Creating an ELM initial condition file

An ELM initial condition (IC) file can be created by remapping an existing IC file from
one resolution to another using the `interpinic`, located at
`components/elm/tools/interpinic`. An ELM IC file is in the same format as an ELM restart file.
The composet of the remapped IC file will be the same as that of the input IC file.
So, for a new ELM SP-mode IC file, use an ELM input file corresponding to the SP-mode.

The steps involved in creating a new IC files are as follows:

1. Identifying an input ELM IC or restart file that will be remapped.
2. Obtaining an ELM restart file at the new resolution.
3. Compiling `interpinic` on the machine of interest.
4. Running `interpinic` to perform the interpolation.

The notes below provide an example of creating 1850 ELM IC file for the NARRM grid using E3SM v3 LR piControl from year = 0101. These notes are provided for Chrysalis.

## 1. Identification of the input ELM IC file

The identified input land condition file for this case is the following:

```bash
/lcrc/group/e3sm2/ac.golaz/E3SMv3/v3.LR.piControl/archive/rest/0101-01-01-00000/v3.LR.piControl.elm.r.0101-01-01-00000.nc
```

## 2. Obtaining an ELM restart file

Using an existing NARRM land IC and making a copy of it

```bash
cd components/elm/tools/interpinic

cp /lcrc/group/e3sm/data/inputdata/lnd/clm2/initdata_map/elmi.v3-NARRM.northamericax4v1pg2_r025_IcoswISC30E3r5.1870-01-01-00000.c20240704.nc \
elmi.v3-NARRM.northamericax4v1pg2_r025_IcoswISC30E3r5.1850-01-01-00000.c`date "+%Y%m%d"`.nc
```

## 3. Compiling `interpinic`

```bash
# Load relevant modules
cd <e3sm-dir>
eval $(./cime/CIME/Tools/get_case_env)

# change directory
cd components/elm/tools/interpinic/src

export USER_LDFLAGS="-L$NETCDF_C_DIR/lib -lnetcdf -L$NETCDF_F_DIR/lib -lnetcdff -L$HDF5_DIR/lib -lhdf5"

USER_FC=ifort LIB_NETCDF="`nc-config --flibs`" INC_NETCDF="`nf-config --includedir`" make VERBOSE=1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing "export" ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

export is not required.


cd ../
```

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cd ..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

## 4. Run `interpinic`

The `interpinic` can then be run via the following batch job (e.g., `remap.r025_RRSwISC6to18E3r4.1850.batch`) to generate the initial condition.

```bash
>cat remap.r025_RRSwISC6to18E3r4.1850.batch

#!/bin/sh
#SBATCH --job-name=remap
#SBATCH --nodes=1
#SBATCH --exclusive
#SBATCH --time 24:00:00
#SBATCH -p slurm
#SBATCH --account esmd

# Load relevant modules.
cd <e3sm-dir>
eval $(./cime/CIME/Tools/get_case_env)

# Change dir to `interpinic`
cd components/elm/tools/interpinic/

srun -n 1 ./interpinic \
-i /lcrc/group/e3sm2/ac.golaz/E3SMv3/v3.LR.piControl/archive/rest/0101-01-01-00000/v3.LR.piControl.elm.r.0101-01-01-00000.nc \
-o elmi.v3-NARRM.northamericax4v1pg2_r025_IcoswISC30E3r5.1850-01-01-00000.c20240903.nc
```
56 changes: 56 additions & 0 deletions components/elm/docs/user-guide/surface_dataset.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Creating an ELM surface dataset

The notes describe the steps in creating an ELM surface dataset at 0.5x0.5 resolution for 1950 on Perlmutter.

## 1. Load the appropriate modules

```bash
cd <e3ms-dir>
eval $(./cime/CIME/Tools/get_case_env)
```

## 2. Compile `mksurfdata_map`

```bash
cd components/elm/tools/mksurfdata_map/src/

make clean
export USER_LDFLAGS="-L$NETCDF_DIR/lib -lnetcdf -lnetcdff -lnetcdf_intel"
export USER_LDFLAGS=$USER_LDFLAGS" -L$HDF5_DIR/lib -lhdf5 -lhdf5_fortran -lhdf5_hl_intel -lhdf5hl_fortran_intel"

USER_FC=ifort LIB_NETCDF="`nc-config --flibs`" INC_NETCDF="`nf-config --includedir`" make VERBOSE=1
```

## Build the namelist

This step assumes that the resolution for which the new surface dataset is being created is a supported resolution.
If the surface dataset is being created for an unsupported resolution, 16 mapping files will have to be created to map the raw datasets
onto this unsupported resolution. The `namelist` file with default number of glaciers (equal to zero) can be generated as:

```bash
cd ../

RES=0.5x0.5
YR=1950
DIN_LOC_ROOT=/global/cfs/cdirs/e3sm/inputdata

./mksurfdata.pl -res $RES -years $YR -d -dinlc $DIN_LOC_ROOT
```

An example of generating the namelist for 0.25 deg (`r025`) resolution for 1980 with 10 glacier layers is as follows:

```bash
RES=r025
YR=1980
DIN_LOC_ROOT=/global/cfs/cdirs/e3sm/inputdata

./mksurfdata.pl -res $RES -years $YR -d -dinlc $DIN_LOC_ROOT -glc_nec 10
```

## Run `mksurfdata_map` via an interactive job

```bash
salloc --nodes 1 --qos interactive --time 01:00:00 --constraint cpu --account e3sm

srun -n 1 ./mksurfdata_map < namelist
```