Skip to content

Commit

Permalink
Adds notes about generating ELM land IC
Browse files Browse the repository at this point in the history
  • Loading branch information
bishtgautam committed Sep 3, 2024
1 parent 5559a57 commit 5b0a222
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
5 changes: 5 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,8 @@ 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.

## 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

Check failure on line 18 in components/elm/docs/user-guide/interpinic.md

View workflow job for this annotation

GitHub Actions / linter

Heading levels should only increment by one level at a time

components/elm/docs/user-guide/interpinic.md:18 MD001/heading-increment Heading levels should only increment by one level at a time [Expected: h2; Actual: h3] https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md001.md

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

```

Check failure on line 22 in components/elm/docs/user-guide/interpinic.md

View workflow job for this annotation

GitHub Actions / linter

Fenced code blocks should have a language specified

components/elm/docs/user-guide/interpinic.md:22 MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"] https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md040.md
/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

```

Check failure on line 30 in components/elm/docs/user-guide/interpinic.md

View workflow job for this annotation

GitHub Actions / linter

Fenced code blocks should have a language specified

components/elm/docs/user-guide/interpinic.md:30 MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"] https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md040.md
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`

```

Check failure on line 39 in components/elm/docs/user-guide/interpinic.md

View workflow job for this annotation

GitHub Actions / linter

Fenced code blocks should have a language specified

components/elm/docs/user-guide/interpinic.md:39 MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"] https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md040.md
# Load relevant modules.
cd <e3sm-dir>
eval $(./cime/CIME/Tools/get_case_env/get_case_env)
#
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
```

### 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.

Check failure on line 55 in components/elm/docs/user-guide/interpinic.md

View workflow job for this annotation

GitHub Actions / linter

Spaces inside code span elements

components/elm/docs/user-guide/interpinic.md:55:5 MD038/no-space-in-code Spaces inside code span elements [Context: "`interpinic `"] https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md038.md

```

Check failure on line 57 in components/elm/docs/user-guide/interpinic.md

View workflow job for this annotation

GitHub Actions / linter

Fenced code blocks should have a language specified

components/elm/docs/user-guide/interpinic.md:57 MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"] https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md040.md
>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/get_case_env)
# Change dir to `interpinic`
cd components/elm/tools/interpinic/src
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
```

0 comments on commit 5b0a222

Please sign in to comment.