ezwdint?

FORTRAN

integer ier, ezuvint
ier = ezwdint(spdout, wdout, uuin, vvin)
real spdout(*), wdout(*), uuin(*), vvin(*)

C

int c_ezuvint(float *spdout, float *wdout, float *uuin, float *vvin)

Routine description

ezwdint does a bi-dimensional interpolation on the values contained in uuin and vvin, and then a rotation of the grid coordinates to generate spdout and wdout. This pre-supposes that 2 functions of the ezscint package have been called, either ezqkdef or ezgdef, and ezdefset.

Description of parameters

spdout, wdout

Output (interpolated) winds, in meteorological wind speed (in degrees) and direction. spdout and wdout are assumed to have the dimensions referred by gdout (the output grid).

uuin, vvin

Input (source) winds, in the input grid coordinate system (i.e. as normally read from an RPN standard file, without modification). uuin and vvin are assumed to have the dimensions referred by gdin (the input grid).

?

It is the responsibility of the coder to make sure that uuout, vvout, uuin and vvin have dimensions that are consistent with the definition of gdout and gdin. Unpredictable results will follow if the fields arenot mapped 1:1 to gdout and gdin. In fact, the parameters are mere address locations used to inform the package where zin and zout can be found.

Sample FORTRAN code :

We want to interpolate data from a GEM grid to a 400x200 Gaussian grid, amd then back into the GEM grid. Assume necessary memory space has been allocated.

      datev = -1
      etiket = '        '
      typvar = ' '
      eastwnd = 'UU'
      northwnd= 'VV'
      
      ip1 = 500
      ip2 = 0
      ip3 = -1
      iun = 13
      
***   read fld info and data
      keyuu = FSTINF(iun, NI, NJ, NK, datev, etiket, ip1, ip2, ip3, typvar,
     $        eastwnd) 
      keyvv = FSTINF(iun, NI, NJ, NK, datev, etiket, ip1, ip2, ip3, typvar,
     $        northwnd) 
      ier = FSTPRM(keyuu, DATEO, DEET, NPAS, NI, NJ, NK, NBITS, DATYP, IP1,
     $             IP2, IP3, TYPVAR, EASTWND, ETIKET, GRTYP, IG1, IG2, IG3,
     $             IG4, SWA, LNG, DLTF, UBC, EX1, EX2, EX3)
      ier = FSTLUK(uugem, keyuu, NI, NJ, NK)
      ier = FSTLUK(vvgem, keyvv, NI, NJ, NK)
      
***   Define input grid         
      
      gdgem = ezqkdef(nigem,njgem ,'Z',ig1, ig2, ig3, ig4, iun)
***   Define output grid and define grid set
      gdgauss = ezqkdef(nigauss, njgauss, 'G', 0,0,0,0,0)
      ier = ezdefset(gdgauss, gdgem)
      
***   Now call ezwdint
      ier = ezwdint(spdgauss, wdgauss, uugem, vvgem)

*** Now re-interpolate the values from the gaussian grid back to the gem grid (a method 
*** that could be used in coupled models).
      ier = ezdefset(gdgem, gdgauss)
      
***   Now convert meteorological winds to grid winds on the gaussian grid. 
***   For this we need to get the lat/lon coordinates of the grid points 
***   of the gaussian grid
      ier = gdll(gdgauss, gausslat, gausslon)
      ier = gduvfwd(uugauss, vvgauss, spdgauss, wdgauss, gausslat, gausslon, 
     *      nigauss*njgauss)
      Then re-interpolate the gaussian grid winds on the gem grid, in wind 
      speed/direction coordinate
*** 
      ier = ezwdint(spdgem, wdgem, uugauss, vvgauss)

Go to the list of functions, or the general index.