Versions Compared

Key

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

...

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

Panel

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

...

title

...

Retrieve gridpoint field from MARS for shallow-water model
 retrieve,
  class="ei",
  type=an,
  stream=oper,
  date=20091227,
  time=12,
  step=0,
  expver=1,
  param=139,
  levelist=off,
  levtype=sfc,
  target="sfc_gg"

Namelists

 

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.

Plotting

 data is spectral

 

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

 

Info

with thanks to Nils Wedi and Sylvie Malardel, ECMWF.