Versions Compared

Key

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

...

With n fields in the input fieldsets, if xik, yik are the ith value of the kth input fieldsets and zi is the ith value of the resulting field:


Anchor
mvl_ml2hpa
mvl_ml2hpa
fieldset mvl_ml2hPa(lnsp: fieldset, mfld: fieldset, plist: list)

Interpolates a fieldset currently on model levels onto pressure levels (in hPa). Locations where interpolation is not possible are returned as missing.

Parameter lnsp is a field of logarithm of surface pressure; mfld is the fieldset to be interpolated and should be on model levels; plist is a list of pressure levels in hPa - the result will be the mfld fieldset interpolated onto these levels. Neither mfld nor plist need to be sorted.

Code Block
languagepy
# retrieve the data in model levels
common_retrieve_params = (
    type : "fc",
    levtype : "ml",
    step : 12,
    grid : [1.5,1.5] )

tmod = retrieve(
    param : "t",
    levelist : [1, 'to', 91],
    common_retrieve_params)

lnsp = retrieve(
    param : "lnsp",
    levelist : 1,
    common_retrieve_params)

# interpolate onto a list of pressure levels
plevels = [1000, 900, 850, 500, 300, 100, 10, 1, 0.1]
tpres = mvl_ml2hPa (lnsp, tmod, plevels)




Anchor
nearest_gridpoint
nearest_gridpoint
number or list nearest_gridpoint ( fieldset,list )
number or list nearest_gridpoint ( fieldset,number,number )
vector or list nearest_gridpoint ( fieldset,vector,vector )

...