Sign inSign up

hpscterrsys/eclm

By hpscterrsys

•Updated 6 months ago

Docker image for eCLM.

Image
0

1.1K

hpscterrsys/eclm repository overview

⁠Usage

This guide assumes that you already have installed Docker. If not, follow the Docker install guide⁠ for your OS.

Once you have Docker installed, proceed with these steps to set up eCLM⁠ on a Docker container.

⁠1. Create data folder for eCLM

Set ECLM_DATA_DIR to the path where you want to save model data. This folder will serve as the top-level folder for the model inputs and outputs.

[user@pc ~] ECLM_DATA_DIR=~/eclm_data_dir 
[user@pc ~] mkdir -p $ECLM_DATA_DIR
⁠2. Initialize container

Create the eclm container.

[user@pc ~]$ docker run --hostname eclm-docker --name eclm -it --mount type=bind,source=$ECLM_DATA_DIR,target=/home/clmuser/eclm_data hpscterrsys/eclm:latest-dev
[clmuser@eclm-docker ~]$
⁠3. Build and install eCLM

eCLM can now be set up on a Docker container. If the eclm container is not yet running, start it by executing docker start -ai eclm:

[user@pc ~]$ docker ps -a   # check first if eclm container is running
CONTAINER ID        IMAGE                     COMMAND                  CREATED             STATUS                      PORTS               NAMES
02704439c272        hpscterrsys/eclm:latest   "/bin/bash -l"           22 hours ago        Exited (0) 40 seconds ago                       eclm
[user@pc ~]$ docker start -ai eclm
[clmuser@eclm-docker ~]$ 

a. Download eCLM.

git clone https://github.com/HPSCTerrSys/eCLM.git
cd eCLM
ECLM_ROOT=$(pwd)

b. Create folders for build and install outputs.

BUILD_DIR="~/eclm_data/build"
INSTALL_DIR="~/eclm_data/install"
mkdir -p $BUILD_DIR $INSTALL_DIR

c. Build and install eCLM.

cmake -S src -B "$BUILD_DIR" -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR"
cmake --build "$BUILD_DIR" 
cmake --install "$BUILD_DIR"

# Create shortcut to eCLM
ln -s $INSTALL_DIR/bin/eclm.exe ~/.local/bin/eclm
⁠4. Install clm5nl-gen

clm5nl-gen is a Python script for generating eCLM namelists. Install it via pip:

pip3 install --user git+https://github.com/HPSCTerrSys/eCLM_namelist-generator.git@main

Then run clm5nl-gen -h to test if it works. You should get this output:

clm5nl-gen - CLM5 namelist generator

Generates CLM5 namelists from  model parameters file and saves
the outputs to a specified directory. If no directory is
specified, the namelists are saved to the current directory.

Usage: 
  clm5nl-gen [--out DIR] PARAMFILE
  clm5nl-gen (-h | --help)
  clm5nl-gen (-v | --version)

Arguments:
  PARAMFILE           model parameters file (.toml)

Options:
  -o DIR --out DIR    Save generated namelists to this directory.
  -h --help           Show this screen.
  -v --version        Show version.
⁠5. Run a 1x1 land model

After installing eCLM, you can start creating single-point cases . First, get familiar with the eCLM workflow by running the Wuestebach test case.

# Download Wuestebach input files to ~/eclm_data
wget -P ~/eclm_data https://datapub.fz-juelich.de/slts/eclm/1x1_wuestebach.tar.gz

# Extract downloaded files to inputdata folder
export DATA_DIR="/home/clmuser/eclm_data/inputdata"
mkdir -p $DATA_DIR
tar xvf 1x1_wuestebach.tar.gz -C $DATA_DIR

a. Create a folder for your own test case and then copy the Wuestebach namelists to this folder.

CASE_DIR=~/eclm_data/cases/wuestebach
mkdir -p $CASE_DIR

# Copy Wuestebach namelists
cp -vt $CASE_DIR $DATA_DIR/wtb_1x1.toml $DATA_DIR/user_datm.streams*
cd $CASE_DIR

b. The model parameters are specified in the file wtb_1x1.toml. You can inspect this file by running less wtb_1x1.toml.

A .toml config file is required for generating eCLM namelists. Generate the namelists for Wuestebach case using the clm5nl-gen tool.

clm5nl-gen wtb_1x1.toml

c. Edit all user_datm.streams.txt.1x1_wuestebach_east.* files and update the path to atmospheric forcing files. You need to replace ./wtb_1x1 with /home/clmuser/eclm_data/inputdata/wtb_1x1. Here's an example of an edited user_datm.streams.txt.1x1_wuestebach_east.Precip:

<?xml version="1.0"?>
<file id="stream" version="1.0">
   <dataSource>
      GENERIC
   </dataSource>
   <domainInfo>
      <variableNames>
          time    time
          xc      lon
          yc      lat
          area    area
          mask    mask
          </variableNames>
      <filePath>
          /home/clmuser/eclm_data/inputdata/wtb_1x1
     </filePath>
      <fileNames>
          domain.lnd.1x1_wuestebach_east.190725.nc
      </fileNames>
   </domainInfo>
   <fieldInfo>
      <variableNames>
          PRECTmms precn
      </variableNames>
      <filePath>
          /home/clmuser/eclm_data/inputdata/wtb_1x1/forcings
      </filePath>
      <fileNames>
         2009-01.nc
      </fileNames>
      <offset>
         0 
      </offset>
   </fieldInfo>
</file>

Do the same edits for user_datm.streams.txt.1x1_wuestebach_east.Solar and user_datm.streams.txt.1x1_wuestebach_east.TPQW.

d. Run eCLM.

# eclm expects that your current directory has valid namelists.
# Make sure you are in $CASE_DIR before you run eclm.
eclm

The output should look like this:

 Invalid PIO rearranger comm max pend req (comp2io),            0
 Resetting PIO rearranger comm max pend req (comp2io) to           64
 PIO rearranger options:
   comm type     =p2p                                                                             
   comm fcd      =2denable                                                                        
   max pend req (comp2io)  =           0
   enable_hs (comp2io)     = T
   enable_isend (comp2io)  = F
   max pend req (io2comp)  =          64
   enable_hs (io2comp)    = F
   enable_isend (io2comp)  = T
(seq_comm_setcomm)  init ID (  1 GLOBAL          ) pelist   =     0     0     1 ( npes =     1) ( nthreads =  1)( suffix =)
(seq_comm_setcomm)  init ID (  2 CPL             ) pelist   =     0     0     1 ( npes =     1) ( nthreads =  1)( suffix =)
(seq_comm_setcomm)  init ID (  5 ATM             ) pelist   =     0     0     1 ( npes =     1) ( nthreads =  1)( suffix =)
(seq_comm_joincomm) init ID (  6 CPLATM          ) join IDs =     2     5       ( npes =     1) ( nthreads =  1)
(seq_comm_jcommarr) init ID (  3 ALLATMID        ) join multiple comp IDs       ( npes =     1) ( nthreads =  1)
(seq_comm_joincomm) init ID (  4 CPLALLATMID     ) join IDs =     2     3       ( npes =     1) ( nthreads =  1)
(seq_comm_setcomm)  init ID (  9 LND             ) pelist   =     0     0     1 ( npes =     1) ( nthreads =  1)( suffix =)
(seq_comm_joincomm) init ID ( 10 CPLLND          ) join IDs =     2     9       ( npes =     1) ( nthreads =  1)
(seq_comm_jcommarr) init ID (  7 ALLLNDID        ) join multiple comp IDs       ( npes =     1) ( nthreads =  1)
(seq_comm_joincomm) init ID (  8 CPLALLLNDID     ) join IDs =     2     7       ( npes =     1) ( nthreads =  1)
(seq_comm_setcomm)  init ID ( 13 ICE             ) pelist   =     0     0     1 ( npes =     1) ( nthreads =  1)( suffix =)
(seq_comm_joincomm) init ID ( 14 CPLICE          ) join IDs =     2    13       ( npes =     1) ( nthreads =  1)
(seq_comm_jcommarr) init ID ( 11 ALLICEID        ) join multiple comp IDs       ( npes =     1) ( nthreads =  1)
(seq_comm_joincomm) init ID ( 12 CPLALLICEID     ) join IDs =     2    11       ( npes =     1) ( nthreads =  1)
(seq_comm_setcomm)  init ID ( 17 OCN             ) pelist   =     0     0     1 ( npes =     1) ( nthreads =  1)( suffix =)
(seq_comm_joincomm) init ID ( 18 CPLOCN          ) join IDs =     2    17       ( npes =     1) ( nthreads =  1)
(seq_comm_jcommarr) init ID ( 15 ALLOCNID        ) join multiple comp IDs       ( npes =     1) ( nthreads =  1)
(seq_comm_joincomm) init ID ( 16 CPLALLOCNID     ) join IDs =     2    15       ( npes =     1) ( nthreads =  1)
(seq_comm_setcomm)  init ID ( 21 ROF             ) pelist   =     0     0     1 ( npes =     1) ( nthreads =  1)( suffix =)
(seq_comm_joincomm) init ID ( 22 CPLROF          ) join IDs =     2    21       ( npes =     1) ( nthreads =  1)
(seq_comm_jcommarr) init ID ( 19 ALLROFID        ) join multiple comp IDs       ( npes =     1) ( nthreads =  1)
(seq_comm_joincomm) init ID ( 20 CPLALLROFID     ) join IDs =     2    19       ( npes =     1) ( nthreads =  1)
(seq_comm_setcomm)  init ID ( 25 GLC             ) pelist   =     0     0     1 ( npes =     1) ( nthreads =  1)( suffix =)
(seq_comm_joincomm) init ID ( 26 CPLGLC          ) join IDs =     2    25       ( npes =     1) ( nthreads =  1)
(seq_comm_jcommarr) init ID ( 23 ALLGLCID        ) join multiple comp IDs       ( npes =     1) ( nthreads =  1)
(seq_comm_joincomm) init ID ( 24 CPLALLGLCID     ) join IDs =     2    23       ( npes =     1) ( nthreads =  1)
(seq_comm_setcomm)  init ID ( 29 WAV             ) pelist   =     0     0     1 ( npes =     1) ( nthreads =  1)( suffix =)
(seq_comm_joincomm) init ID ( 30 CPLWAV          ) join IDs =     2    29       ( npes =     1) ( nthreads =  1)
(seq_comm_jcommarr) init ID ( 27 ALLWAVID        ) join multiple comp IDs       ( npes =     1) ( nthreads =  1)
(seq_comm_joincomm) init ID ( 28 CPLALLWAVID     ) join IDs =     2    27       ( npes =     1) ( nthreads =  1)
(seq_comm_setcomm)  init ID ( 33 ESP             ) pelist   =     0     0     1 ( npes =     1) ( nthreads =  1)( suffix =)
(seq_comm_joincomm) init ID ( 34 CPLESP          ) join IDs =     2    33       ( npes =     1) ( nthreads =  1)
(seq_comm_jcommarr) init ID ( 31 ALLESPID        ) join multiple comp IDs       ( npes =     1) ( nthreads =  1)
(seq_comm_joincomm) init ID ( 32 CPLALLESPID     ) join IDs =     2    31       ( npes =     1) ( nthreads =  1)
(seq_comm_printcomms)     1     0     1     1  GLOBAL:
(seq_comm_printcomms)     2     0     1     1  CPL:
(seq_comm_printcomms)     3     0     1     1  ALLATMID:
(seq_comm_printcomms)     4     0     1     1  CPLALLATMID:
(seq_comm_printcomms)     5     0     1     1  ATM:
(seq_comm_printcomms)     6     0     1     1  CPLATM:
(seq_comm_printcomms)     7     0     1     1  ALLLNDID:
(seq_comm_printcomms)     8     0     1     1  CPLALLLNDID:
(seq_comm_printcomms)     9     0     1     1  LND:
(seq_comm_printcomms)    10     0     1     1  CPLLND:
(seq_comm_printcomms)    11     0     1     1  ALLICEID:
(seq_comm_printcomms)    12     0     1     1  CPLALLICEID:
(seq_comm_printcomms)    13     0     1     1  ICE:
(seq_comm_printcomms)    14     0     1     1  CPLICE:
(seq_comm_printcomms)    15     0     1     1  ALLOCNID:
(seq_comm_printcomms)    16     0     1     1  CPLALLOCNID:
(seq_comm_printcomms)    17     0     1     1  OCN:
(seq_comm_printcomms)    18     0     1     1  CPLOCN:
(seq_comm_printcomms)    19     0     1     1  ALLROFID:
(seq_comm_printcomms)    20     0     1     1  CPLALLROFID:
(seq_comm_printcomms)    21     0     1     1  ROF:
(seq_comm_printcomms)    22     0     1     1  CPLROF:
(seq_comm_printcomms)    23     0     1     1  ALLGLCID:
(seq_comm_printcomms)    24     0     1     1  CPLALLGLCID:
(seq_comm_printcomms)    25     0     1     1  GLC:
(seq_comm_printcomms)    26     0     1     1  CPLGLC:
(seq_comm_printcomms)    27     0     1     1  ALLWAVID:
(seq_comm_printcomms)    28     0     1     1  CPLALLWAVID:
(seq_comm_printcomms)    29     0     1     1  WAV:
(seq_comm_printcomms)    30     0     1     1  CPLWAV:
(seq_comm_printcomms)    31     0     1     1  ALLESPID:
(seq_comm_printcomms)    32     0     1     1  CPLALLESPID:
(seq_comm_printcomms)    33     0     1     1  ESP:
(seq_comm_printcomms)    34     0     1     1  CPLESP:
(shr_file_setIO) logfile not opened
 (t_initf) Read in prof_inparm namelist from: drv_in
 (t_initf) Using profile_disable=          F
 (t_initf)       profile_timer=                      1
 (t_initf)       profile_depth_limit=                4
 (t_initf)       profile_detail_limit=               2
 (t_initf)       profile_barrier=          F
 (t_initf)       profile_outpe_num=                  1
 (t_initf)       profile_outpe_stride=               0
 (t_initf)       profile_single_file=      F
 (t_initf)       profile_global_stats=     T
 (t_initf)       profile_ovhd_measurement= F
 (t_initf)       profile_add_detail=       F
 (t_initf)       profile_papi_enable=      F


  1 pes participating in computation for CLM

-----------------------------------

NODE#  NAME
(    0)  eclm-docker
 NetCDF: Invalid dimension ID or name
 NetCDF: Invalid dimension ID or name
 NetCDF: Invalid dimension ID or name
 NetCDF: Invalid dimension ID or name
 NetCDF: Invalid dimension ID or name
 NetCDF: Variable not found
 NetCDF: Invalid dimension ID or name
 NetCDF: Invalid dimension ID or name
 NetCDF: Invalid dimension ID or name
 NetCDF: Invalid dimension ID or name
 NetCDF: Invalid dimension ID or name
 NetCDF: Invalid dimension ID or name
 NetCDF: Invalid dimension ID or name
 NetCDF: Invalid dimension ID or name
 NetCDF: Invalid dimension ID or name
 NetCDF: Invalid dimension ID or name
 NetCDF: Variable not found
 NetCDF: Invalid dimension ID or name
 NetCDF: Invalid dimension ID or name
 NetCDF: Invalid dimension ID or name
 NetCDF: Invalid dimension ID or name
 NetCDF: Invalid dimension ID or name
 NetCDF: Invalid dimension ID or name
 NetCDF: Invalid dimension ID or name
 NetCDF: Invalid dimension ID or name
 NetCDF: Invalid dimension ID or name
 NetCDF: Invalid dimension ID or name
 NetCDF: Variable not found
 NetCDF: Variable not found
  max rss=136.4 MB
  max rss=136.4 MB
  max rss=136.4 MB
  max rss=136.4 MB
  max rss=136.4 MB
  max rss=136.4 MB
  max rss=136.4 MB
  max rss=136.4 MB
  max rss=136.4 MB
  max rss=136.4 MB
  max rss=136.4 MB
  max rss=136.4 MB
  max rss=136.4 MB
  max rss=136.4 MB
  max rss=136.4 MB
  max rss=136.4 MB
  max rss=136.4 MB
  max rss=136.4 MB
  max rss=136.4 MB
  max rss=136.4 MB
  max rss=136.4 MB
  max rss=136.4 MB
  max rss=136.4 MB
  max rss=136.4 MB
  max rss=136.4 MB

e. Running eCLM creates history files which are saved in netCDF format. Run ls $CASE_DIR and check that there are wtb_1x1.*.nc files generated.

You can use any netCDF viewer tool (e.g. ncdump, panoply) to view or extract data from history files.

⁠More information

eCLM is based from Community Land Model v5.0⁠ and is still at an experimental stage. Visit https://github.com/HPSCTerrSys/eCLM⁠ for more information.

The Dockerfile for this image can be found here: https://github.com/HPSCTerrSys/docker-images/blob/master/eclm/Dockerfile⁠

Tag summary

Content type

Image

Digest

sha256:cce426608…

Size

492.4 MB

Last updated

6 months ago

docker pull hpscterrsys/eclm