Advanced Usage

Elevation Classes

ModelE can run with elevation classes for land ice. In this mode, the ice surface model is run at multiple fixed elevations for each atmosphere gridcell, also known as the elevation grid.

In order to run with elevation classes, ModelE needs appropriate matrices to regrid from the elevation grid to atmosphere grid (going the other way is assumed to be trivial). These are computed using the IceBin regridding / coupler library; although when not running coupled, only the regridding portions are used. The following changes are required to ModelE input files:

  • The NetCDF variable fhc(nhc,jm,im) in the TOPO file, where nhc is the number of elevation classes. fhc(ihc,j,i) is extracted from the EvI sparse matrix generated by IceBin: fhc(ihc,j,i) must be set to the value of AvE at with coordinates ((j,i), (ihc,j,i)); in other words, the contribution of elevation grid cell (ihc,j,i) to atmosphere grid cell (j,i).

  • The NetCDF variable elevE(nhc,jm,im) in the TOPO file must provide the elevation for each elevation class. Typically, these will be set at fixed elevations (eg. every 100 meters) and be the same for all atmosphere gridcells. The need to be whatever elevations were used in IceBin.

  • If using the classic 3m snow/firn model:

    • The variables snowli and tlandi in the GIC file must be extended with a new nhc dimension, and set appropriately. If you don’t know how to set them, just set all elevation classes the same for spinup.

      
      

      double snowli(nhc, jm, im) ; double tlandi(nhc, jm, im, d2) ;

    • If using the Stieglitz snow/firn model, Stieglitz-appropriate variables are required: .. code-block:: console

      double dz(nhc, jm, im, nlice) ; double wsn(nhc, jm, im, nlice) ; double hsn(nhc, jm, im, nlice) ; double tsn(nhc, jm, im, nlice) ;

Continuing a Run

If a run directory has stopped running, it may be restarted where it left off with ectl run. For example:

$ ectl run myrun --time 12:00:00 -np 28

Note

Command-line parameters related to HOW to run this job must be repeated, since they might be different from the last run: --launcher, --ntasks, --time.

The above command rewrites the I file from your edited rundeck.R. This makes it easy to change rundeck parameters and restart arun. However, any command-line modifications to start/end time will be lost. If this behavior is not desired, you can either:

  1. Specify the end time again on the command-line. For example to end in 1960:

    $ ectl run myrun --timespan ,1960-01-01 --time 12:00:00 -np 28
    
  2. Put the end time in your rundeck.R ,eliminating the need to specify it on the command line.

  3. Continue the run with the --resume option. This will use the I file from the last run, rather than the rundeck. Using this option, it is not possible to change rundeck parameters:

    $ ectl run myrun --resume --time 12:00:00 -np 28
    

Restarting from fort.X.nc or an .rsf file

You can restart a run from the fort.1.nc, fort.2.nc or a restart (.rsf) file using the --restart-file option. Examples include:

$ ectl run myrun --restart-file myrun/fort.1.nc --time 12:00:00 -np 28
$ ectl run myrun --restart-file myrun/1MAR1957.rsfmyrun.R.nc --time 12:00:00 -np 28

The fort.X.nc files will be overwritten. If you want to restart from one of them while ensuring your restart file is not overwritten, copy fort.X.nc to a different name. For example:

$ cd myrun
$ cp fort.1.nc myrestart.nc
$ ectl run . --restart-file myrestart.nc --time 12:00:00 -np 28

Restarting by Date

It is also possible to restart from an .rsf file by specifying a date. For example:

$ ectl run myrun --restart-date 1957-03-01 --time 12:00:00 -np 28

This command will find the restart file for March 1957 and restart from it. If there is no restart file for the date you choose, ModelE-Control will restart from the most recent ``.rsf` file less than the date. For example, the following will produce the same result when used with monthly restart files:

$ ectl run myrun --restart-date 1957-03-17 --time 12:00:00 -np 28

Keepalive

When you start a run, ModelE lists it in a ectl/keepalive.txt file inside your ModelE-Control root. The command ectl keepalive will read that file and continue any runs that have stopped because they have reached their SLURM time limit. To use it:

$ ectl keepalive <ectl-root> --time 12:00:00 -np 28

Note

  1. <ectl-root> could be the ModelE-Control root, or any subdirectory thereof.
  2. As with ectl run, you need to re-specify the arguments --launcher, --ntasks and --time.
  3. This command is intended to run periodically — say, every 5 minutes, from a cron job.
  4. ectl keepalive will not restart jobs that have terminated on their own, or crashed, or were forcibly evicted from your cluster.

Create a Rundeck

Although ModelE-Control can work directly out of the templates directory, it can also also assemble rundecks for further manual editing. This is done with ectl flatten. Rundecks may be created in any directory on the filesystem:

$ cd ~/exp
$ ectl flatten modelE/templates/E4F40.R e4f40.R

One Root per User

Alternately, users may choose to have only one root, presumably in the user’s home directory. ModelE-Control then manges only one builds and pkgs directories for the entire user. This simplifies management in some ways, but it slows down certain ectl operations (ps, purge).