Warning | ||
---|---|---|
| ||
NERSC Directory Change Notice Due to project's name change at NERSC from 'ACME' to 'E3SM' and NERSC’s file system update, the directory ' |
...
TempestRemap needs to be built from source from the Github repository. This is straightforward on Cori and Edison. Note that a parallel version of netCDF should be used. This can be accomplished on cori/edison be executing module swap cray-netcdf cray-netcdf-hdf5parallel
or by sourcing an env_mach_specific.sh
from a working case on the target machine before building. Then,
...
- 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/clm/tools/shared/mkmapdata/)
- mksurfdata.pl (found in components/clm/tools/clm4_5/mksurfdata_map/)
...
- Create mapping files for each land surface type if needed. The documentation of how to do this can be found hereAn (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 the ne1024np4 grid file, found within the inputdata repository at https://web.lcrc.anl.gov/public/e3sm/mapping/grids/ne1024np4_scrip_c20190125.nc. After downloading to your machine, set variable `GRIDFILE` to point to the path to this file.
Get list of input grid files for each land surface input data file. This is done by running the
components/clm/tools/shared/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):Wiki Markup ``` cd ${e3sm_root}/components/clm/tools/shared/mkmapdata ./mkmapdata.sh --gridfile ${GRIDFILE} --inputdata_path ${INPUTDATA_ROOT} --res ne120np4 --gridtype global --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:#!/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.
Compile surface dataset source code (NOTE:
${e3sm_root}/components/clm/tools/clm4_5/mksurfdata_map/src/Makefile.common
needs to be edited to build on most machines; this is fixed in https://github.com/E3SM-Project/E3SM/pull/2757):Code Block # Setup environment (should work on any E3SM-supported machine) ${e3sm_dir}/cime/tools/configure --macros-format=Makefile && source .env_mach_specific.sh # Set environent variables expected by mksurfdata_map Makefile; # Note that NETCDF_DIR is probably specific to NERSC and may need # to be adjusted for other systems export LIB_NETCDF=$NETCDF_DIR/lib export INC_NETCDF=$NETCDF_DIR/include export USER_FC=ifort export USER_CC=icc # Build mksurfdata_map cd $e3sm_dir/components/clm/tools/clm4_5/mksurfdata_map/src/ && gmake
Run the mksurfdata.pl script in "debug" mode to generate the namelist (use year 2010 on ne120np4 grids as an example).
Code Block # For supported resolutions #(use year 2010 on ne120np4 grids as an example) cd $e3sm_dir/components/clm/tools/clm4_5/mksurfdata_map ./mksurfdata.pl -res ne120np4 -y 2010 -d -dinlc /global/project/projectdirs/acme/inputdata -usr_mapdir /global/project/projectdirs/acme/inputdata/lnd/clm2/mappingdata/maps/ne120np4 # For unsupported, user-specified resolutions # (use year 2010 on ne50np4 grid as an example) # (Assuming the mapping files created in step 1 has a time stamp of '190409' in the filenames and the location of mapping files are '/whatever/directory/you/put/mapping/files') ./mksurfdata.pl -res usrspec -usr_gname ne50np4 -usr_gdate 190409 -y 2010 -d -dinlc /global/project/projectdirs/acme/inputdata -usr_mapdir /whatever/directory/you/put/mapping/files
(However, ./mksurfdata.pl -h shows -y is by default 2010. When running without "-y" option, standard output says sim_year 2000. I suspect the mksurfdata.pl help information is wrong. To be confirmed.)
Modify namelist file
(Should the correct namelist settings be automatically picked up if the default land build name list settings are modified accordingly?)Time-evolving Land use land cover change (LULCC) data should not be used for fix-time compsets, but the LULCC information for that particular year should be used (right?)
Manually change to mksrf_fvegtyp = '/global/project/projectdirs/acme/inputdata/lnd/clm2/rawdata/AA_mksrf_landuse_rc_1850-2015_06062017_LUH2/AA_mksrf_landuse_rc_2010_06062017.nc' for the F2010 ne120 compset.Create the land surface data by interactive or batch job
Code Block rm -f surfdata_ne120np4_simyr2010.bash cat <<EOF >> surfdata_ne120np4_simyr2010.bash #!/bin/bash #SBATCH --job-name=mksurfdata2010 #SBATCH --account=acme #SBATCH --nodes=1 #SBATCH --output=mksurfdata.o%j #SBATCH --exclusive #SBATCH --time=00:30:00 #SBATCH --qos=debug # Load modules module load nco module load ncl module load cray-netcdf module load cray-hdf5 # mksurfdata_map is dynamically linked export LIB_NETCDF=$NETCDF_DIR/lib export INC_NETCDF=$NETCDF_DIR/include export USER_FC=ifort export USER_CC=icc export USER_LDFLAGS="-L$NETCDF_DIR/lib -lnetcdf -lnetcdff -lnetcdf_intel" export USER_LDFLAGS=$USER_LDFLAGS" -L$HDF5_DIR/lib -lhdf5 -lhdf5_fortran -lhdf5_cpp -lhdf5_fortran_intel -lhdf5_hl_intel -lhdf5hl_fortran_intel" cd /global/homes/t/tang30/ACME_code/MkLandSurf/components/clm/tools/clm4_5/mksurfdata_map CDATE=c`date +%y%m%d` # current date ./mksurfdata_map < namelist EOF sbatch surfdata_ne120np4_simyr2010.bash
The land surface data in NetCDF format will be created at current directory. (How to verify the file is correct?)
...