Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section
Column
Info

OpenIFS includes a number of idealised configurations. In this article we explain how to:

  • setup and run a shallow-water model
  • set idealized (e.g. Rossby-Haurwitz wave) or real single level field.
  • enable semi-Lagrangian or Euler timestepping
  • create the initial fields

Configuration

The shallow-water (SW) configuration is one of several that exist in OpenIFS (and IFS). The configuration is set by the variable NCONF in namelist NAMCT0 (see yomct0.F90). The normal 3D primitive equation configuration uses NCONF=1.

For the 2D SW configuration, NCONF=201, and with NCONF=202 is the vorticity equation model.

The 2D SW model can be initialised in various idealized states or from a single level real field. This initialisation is controlled by another variable, N2DINI in the namelist NAMCT0. As these idealized configurations are primarily research tools, they may vary from one major model release to another and not all options found in the code are guaranteed to work.

N2DINI = 1 in NAMCT0 will initialise the Rossby-Haurwitz wave case (Williamson et al, J. Comput. Phys., 1992).
N2DINI = 3 in NAMCT0 will initialise the SW model with real fields read from GRIB.

The reader is invited to look in suspecb.F90 to see what other initialisation options as possible.

Column

 

Panel
bgColorwhite
titleBGColor#f0f0f0
titleOn this page...

 

Table of Contents

...

The SW model still needs the ICMSH (spectral fields) and ICMGG (gridpoint) files to correctly start. In the idealized case, these are read solely to set the model's spectral and gridpoint resolution and the model will overwrite the initial state read from file (see the code in suspecb.F90). 

The model will require requires the vorticity, divergence, ln(Ps) (contains the geopotential of the free surface) and orography when starting from real fields.

The Euler advection scheme can only be run on a regular Gaussian grid however (see below for example) whereas the semi-Lagrangian advection is normally run on the reduced Gaussian grid.

Panel
bgColorwhite
titleBGColor#f0f0f0
titleT255 shallow-water test case

A test for the shallow-water model at spectral horizontal resolution T255 is available from the OpenIFS ftp site to try.

Code Block
ftp ftp.ecmwf.int
cd case_studies/shallow_water
get t255_swtest.tar.gz

This example comes with initial files, namelist and job script. The namelist is configured to run the semi-Lagrangian advection. A few lines in the job script may need altering for your local setup.

Panel
bgColorwhite
titleBGColor#f0f0f0
titleCreating initial fields from existing GRIB files

The GRIB files from an existing experiment can also be used to create initial files for the shallow-water model. In the following example, the initial files from the T21 test case distributed with the OpenIFS tarfile are used.

Code Block
titleExtract starting files from existing experiment
collapsetrue
#  Extract a single level (level 1) for the shallow water model
#  and change the experiment id in the file.

grib_copy -w level=1,shortName=vo ICMSHepc8INIT tmp
grib_set -s experimentVersionNumber=epc9 -w experimentVersionNumber=epc8 tmp vo.grb

grib_copy -w level=1,shortName=d  ICMSHepc8INIT tmp
grib_set -s experimentVersionNumber=epc9 -w experimentVersionNumber=epc8 tmp d.grb

grib_copy -w shortName=z          ICMSHepc8INIT z.grb

#  Combine the 3 files to form the spectral initial file
cat vo.grb d.grb z.grb > ICMSHepc9INIT

#  Create gridpoint file (stl1 is used in this example)
grib_copy -w shortName=stl1 ICMGGepc8INIT gg.grb
grib_set -s experimentVersionNumber=epc9 -w experimentVersionNumber=epc8 gg.grb ICMGGepc9INIT

Note that the initial fields themselves are not used with the idealized configurations. The initial files are there to correctly set the grid, hence stl1 is used in this example to get the initial gridpoint file.

 

If you have access to the MARS archive at ECMWF then an example of how to retrieve single level fields for use with the SW model is:

Panel
bgColorwhite
titleBGColor#f0f0f0

The following MARS request will retrieve ERA-Interim vorticity, divergence and geopotential fields together with a gridpoint field that can be used to create the initial ICMSH and ICMGG files in a similar way to the above method.

Code Block
titleRetrieve spectral fields from MARS for shallow-water model
collapsetrue
retrieve,
  class="ei",
  type=an,
  stream=oper,
  date=20100212,
  time=12,
  step=0,
  expver=1,
  param=VOR/D/Z,
  levelist=1,
  levtype=ml,
  target="sh_ml"
Code Block
titleRetrieve gridpoint field from MARS for shallow-water model
collapsetrue
 retrieve,
  class="ei",
  type=an,
  stream=oper,
  date=20091227,
  time=12,
  step=0,
  expver=1,
  param=139,
  levelist=off,
  levtype=sfc,
  target="sfc_gg"

and then set the appropriate ICMSH and ICMGG file names and experiment number as shown in the previous example.

Namelists

It is extremely important to correctly set the NAMELIST to configure the shallow-water model correctly. Two examples are given here, one for semi-Lagrangian advection, the other for Euler advection. Euler advection must use a regular gaussian grid. It will not work with a reduced grid. The users user is free to alter some parameters such as the timestep, filtering etc.

...

Code Block
titleEuler advection namelist
collapsetrue
!  Shallow-water model with Euler
&NAMDYN
 TSTEP=300.0,               ! reduce timestep for Euler stepping
 REPS1=0.01,                ! turn on Asselin time-filtering coefficient
 REPS2=0.01,
 LHDIFFM=.false.,           !  horizontal diffusion on / off
 LSETTLS=.false.,           ! extrapolations in SL scheme
 LSETTLST=.false.,          ! ditto
/
&NAMCT0
 NCONF=201,                 ! model configuration: 201 = shallow-water (see yomct0.F90)
 LSLAG=.false.,             ! turn off semi-lagrangian scheme
 LTWOTL=.false.,            ! disable two-time-level SL scheme.
 LRFRIC=.false.,            ! turn off Rayleigh friction
 LSLPHY=.false.,            ! turn off split time-step physics
 LVERTFE=.false.,           ! turn off vertical finite element scheme
 N2DINI=1,                  ! initialise  1 = Haurwitz wave, 2 = real fields
 LSPRT=.false.,             ! if T temperature is 'virtual temperature'
 LFPOS=false,               ! turn off fullpos diagnostics, does not work with SW
 N3DINI=0,                  ! no 3D initialisation
 NSTOP=600,                 ! no. of steps to run
 NFRHIS=10,                 ! frequency of results output
/
&NAEPHY
 LEPHYS=false,           ! turn off ECMWF Physics package (master switch)
 LERADI=false,           ! turn off radiation scheme
/
&NAMDYNA
 LGRADSP=.false.,        ! disable de-aliasing the pressure gradient term
/
&NAMDIM
  NUNDEFLD=0,            ! make sure uninitialised variables are all set to zero
/

 

Gotchas

There are a number of issues that can cause the model to fail. Please make sure:

Info
titleGRIB_GRIBEX_MODE_ON

 The model will fail unless the environment variable:

export GRIB_GRIBEX_MODE_ON=1

is set in the job script. This is because the shallow-water code does not go through the usual code path (if NCONF=1) and uses a older code to output.

Otherwise the model will crash at the first output attempt. Users will usually see a failure from the grib_api library (typically grib_set_real8_array).

...

The shallow-water model outputs fields only in spectral space, only ICMSH output files are generated. To plot the fields they will first need converting to gridpoint form.

...

For more information about Metview please see Using Metview with OpenIFS or contact openifs-support@ecmwf.int.

Code notes

Other switches related to the shallow-water model setup are used internally: LR2D & LRSHW.

The IFS starts with a huge amount of setup. The setup setups are mainly done under the routines called su0yoma and su0yomb (all setup routines starts by start with 'su'). They are themselves called by the first layer of the model cnt0. Then, the following layers cnt1, cnt2, cnt3 are called and finally, we reach cnt4 which contains the time loop. The routine which does one time step is called stepo (there are many different way of calling it as you could see in the routine cnt4).

...