The purpose of this page is to document the procedure for adding support for new atmosphere grids. The process should be the same for new uniform resolutions as well as for new regionally-refined meshes, although some settings will need to be changed for new regionally-refined mesh configurations. This page is a work in progress, and will be updated as this process is refined and (eventually) made more automated. This documentation is an update of a document written by Mark Taylor and Colin Zarzycki, available as a Google Doc here.
...
The easiest way to make sure ncremap is up to date and will work for this workflow, we can source the ESMF-Unified conda environment. Instructions for supported machines can be found here. For Edison and CoriPerlmutter, it is as simple as:
Code Block |
---|
source /global/common/software/e3sm/anaconda_envs/load_latest_e3sm_unified_coripm-haswellcpu.sh |
For unsupported machines you may need to install the conda environment via:
...
land grid descriptor file in SCRIP format
ESMF_RegridWeightGen
geographic distribution for each land surface type along with grid descriptor files for each of those surface types
mkmapdata.sh (found in components/elm/tools/mkmapdata/)
mksurfdata.pl (found in components/clm/tools/clm4_5/mksurfdata_map/)
...
the steps below are for maint1-0 code base. Post-v1 release changes (to add phosphorus) broke existing land initial condition files (finidat) and may require changes to this methodology.
the focus here is on creating an fsurdat file in cases where land use land cover change (LULCC) does NOT change. Additional steps will be needed to create a transient LULCC file.
questions for the land team are in red
NOTE: The land surface generation tool is currently BROKEN in E3SM master, following addition of FAN and fertilizer mods (PR: 5981). A PR was issued to fix this by removing the unsupported FAN dataset from surfdata files, but was subsequently closed (PR: 6237). For the time being, land surface data can be generated by checking out git hash
cd22d14bb8
(master immediately before 5981 was merged).
Steps:
Create mapping files for each land surface type if needed. An (older and deprecated) example of doing this can be found here. Updated instructions follow:
Obtain or generate a target grid file in SCRIP format. For these example, we will use a ne1024pg2 grid file, which we will need to create (note that most np4 grid files can be found within the inputdata repository, for example, the ne1024np4 grid file is at https://web.lcrc.anl.gov/public/e3sm/mapping/grids/ne1024np4_scrip_c20191023.nc). To generate the pg2 SCRIP file:
Code Block ${tempest_root}/bin/GenerateCSMesh --alt --res 1024 --file ne1024.g ${tempest_root}/bin/GenerateVolumetricMesh --in ne1024.g --out ne1024pg2.g --np 2 --uniform ${tempest_root}/bin/ConvertMeshToSCRIP --in ne1024pg2.g --out ne1024pg2_scrip.nc
Get list of input grid files for each land surface input data file. This is done by running the components/elm/tools/mkmapdata/mkmapdata.sh script in debug mode to output a list of needed files (along with the commands that will be used to generate each map file; also make sure GRIDFILE is set to the SCRIP file from the above step):
Code Block language bash cd ${e3sm_root}/components/elm/tools/mkmapdata ./mkmapdata.sh --gridfile ${GRIDFILE} --inputdata-path ${INPUTDATA_ROOT} --res ne1024pg2 --gridtype global --output-filetype 64bit_offset --debug -v --list
Download needed input grid files. The above command will output a list of needed files to
clm.input_data_list
. We need to download all of these before calling the script without the debug flag to actually perform the mapping. This is possible usingcheck_input_data
in CIME, but needs to be done from a dummy case directory. So, one can create a dummy case,cd
to that case, and then call./check_input_data --data-list-dir <path where mkmapdata was run from> --download
. However, this failed to connect to the CESM SVN server for me. So instead, I used the following one-off script:Code Block #!/bin/bash e3sm_inputdata_repository="https://web.lcrc.anl.gov/public/e3sm" cesm_inputdata_repository="https://svn-ccsm-inputdata.cgd.ucar.edu/trunk" inputdata_list=clm.input_data_list cat $inputdata_list | while read line; do localpath=`echo ${line} | sed 's:.* = \(.*\):\1:'` url1=${e3sm_inputdata_repository}/`echo ${line} | sed 's:.*\(inputdata/lnd/.*\):\1:'` url2=${cesm_inputdata_repository}/`echo ${line} | sed 's:.*\(inputdata/lnd/.*\):\1:'` if [ ! -f ${localpath} ]; then echo "${url1} -> ${localpath}" mkdir -p `dirname ${localpath}` cd `dirname ${localpath}` # Try to download using first URL, if that fails then use the second wget ${url1} || wget ${url2} else echo "${localpath} exists, skipping." fi done
Create mapping files. Should just be able to run the above
mkmapdata.sh
command without the–debug --list
flags. We need to append the--outputfile-type 64bit_offset
flag for our large files (no reason not to do this by default anyways). NOTE - This step requires NCL, which is no longer part of the E3SM unified environement. If the machine you are using does not have an NCL module, creating a custom environement that includes NCL is an easy work around. Fixing this issue to avoid the NCL dependency will require rewriting the rmdups.ncl and mkunitymap.ncl script in another language (python+xarray would make sense). We will also need to write a version of the gc_qarea() function, unless the geocat project writes a port that we can use (see geocat issue #31).Code Block ./mkmapdata.sh --gridfile ${GRIDFILE} --inputdata-path ${INPUTDATA_ROOT} --res ne1024pg2 --gridtype global --output-filetype 64bit_offset -v
...