Metview's documentation is now on readthedocs!

Description

Metview Macro Library function. Computes geopotential on model levels.

Usage

fieldset mvl_geopotential_on_ml(t:fieldset, q:fieldset, lnsp:fieldset, zs:fieldset)

Parameter t should be a fieldset of temperature on model levels in ascending numeric order (e.g. 1-137), q a fieldset of specific humidity on model levels in ascending numeric order, lnsp a field of log of surface pressure on model level 1, zs a field of geopotential on model level 1 (available from MARS). All fields must be GRIDDED data - no spherical harmonics, and they must all be on the same grid, with the same number of points. The function assumes that there are no other dimensions contained in the data, e.g. all fields should have the same date and time. The return value is a fieldset of geopotential on model levels.


Example

r = (date: -1, time: 12, levtype: "ml", grid: [1.5,1.5])
t    = retrieve(r,levelist: [1,"to",137],param: "t")
q    = retrieve(r,levelist: [1,"to",137],param: "q")
zs   = retrieve(r,levelist: 1,param: "z")
lnsp = retrieve(r,levelist: 1,param: "lnsp")
z_ml = mvl_geopotential_on_ml(t, q, lnsp, zs)


5 Comments

  1. Maybe this is documented elsewhere, but should be pointed out here also I think:

    1. zs is nominally extracted on model level 1, but actually as it is stored in MARS that level corresponds not to the top model level, but to the bottom level (e.g. = 137 in HRES in 2017). For temperature and other vars level 1 is level 1, etc.
    2. zs is stored for forecast fields in the fdb (for HRES at least), but is not archived in MARS as such. so you can obtain this with a day "0" retrieval, but not, say, a retrieval for day "-10"
    3. to get zs from MARS you need to access the analysis fields: TYPE="AN"

    So if you want to base code on the example code above for older dates you need to replace the "zs = ..." line with something like this:

    zs = retrieve(type: "an", date: thedate, time: thetime, step: 0, levtype: "ml", grid: thegrid, levelist: 1, param: "z")

    zs is I think only a function of the model grid, the model orography and the model level definitions, and not of atmospheric structure or evolution, hence why it is not archived in forecast fields

     

    The above is what my investigations (and repeated code failures!) in July 2017 have revealed, but happy to be corrected on any of this if necessary!

     

    1. Thank you for this observations! This saved me a lot of headache, after some failed requests when hitting the tape and not fdb..

  2. Can this function handle input fieldsets with multiple times (i.e. if I want to calculate z for a number of forecast steps in one call to this function)? Or would I need to loop over the forecast steps?

    1. Hi Jonny, you would need to loop through the steps.

  3. Please note this page is outdated. For the most recent documentation see: https://metview.readthedocs.io/en/latest/api/functions/mvl_geopotential_on_ml.html