You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »


 

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

  • setup and run a shallow-water model
  • idealized (e.g. Rossby-Haurwitz wave) or real single level field.
  • semi-Lagrangian or Euler timestepping
  • creating 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 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.

Getting data

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 the vorticity, divergence, ln(Ps) (contains the geopotential of the free surface) and orography.

The Euler advection scheme can only be run on a regular Gaussian grid however (see below for example).

T255 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.

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

This example comes with initial files, namelist and job. The namelist is configured to run the semi-Lagrangian advection.

Creating 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.

#  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 is:

The following MARS request will retrieve ERA-Interim vorticity, divergence and geopotential fields

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"

 

  • notes from Nils
    Model needs 2 usual input files 'SH' and 'GG', see mars scripts in Nils 38r2. These are just used to set grid and resolution, model will overwrite with initial set. Only retrieve 1 level from MARS - use grib_set to set level to '1'.

Gotchas

  • needs GRIB_GRIBEX_MODE_ON=1 to ensure grib gets written correctly. Otherwise the model will crash at the first output instance. Users will see a failure in grib_api (igrib_set_real8_array)
  • make sure &NAMDIM, NUNDEFLD=0 is set. This ensure all uninitialized variables are set to zero. The SW model can output fields not used.
  • FPO must be off.

 

 

Code notes

Other switches are used internally:

! LR2D : 2D shallow water or vorticity model

! LRSHW : 2D shallow water model

The IFS starts with a huge amount of setup. The setup are mainly done under the routines called su0yoma and su0yomb (all setup routines starts by su). They are themselves called by the first layer of the model cnt0. Then, the following layers cnt1, cnt2, cnt3 are called (forget about them for now) 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 "jungle" routine cnt4). A time step starts in spectral space (all prognostic fields are in spectral space).

A standard time step (corresponding to time t) goes like this: the spectral fields (which are at time t) are transformed to GP space (Legendre inv. followed by Fourier inv.). Then the grid point computations start. At the end of the GP computation, the prognostic fields for next time step t+dt contain the explicit guess + half of the SI correction. This guess is transformed back to spectral space where we solve the SI problem to compute the other half of the SI correction. End of time step..... At the beginning of next time step, the new spectral fields will be the new fields for the new time t...

In the current suspecb, you can chose between idealized cases or read one level of a grib flie (N2DINI is the key for this choice). suspecb is called at cnt3 level. - the first part of the GP computations are done from a routine called CPG2 which is a very simplified version of the 3D GP computation, the other (lagged, mostly SL computation) are done in CPG2_LAG Both cpg2 and cpg2_lag are called by the driver routine gp_model which is also the driver routine of the 3D GP computation. - the spectral computation are done under spc2

 

with thanks to Sylvie Malardel, ECMWF.

  • No labels