gduvfwd

FORTRAN

integer gduvfwd, ier
ier = gduvfwd(gdid, uugdout, vvgdout, spdllin, dirllin, lat, lon, n)
integer gdid, n
real uugdout(n), vvgdout(n), spdllin(*), dirllin(*), lat(n), lon(n)

C

int c_gduvfwd(int gdid,  float *uugdout, float *vvgdout, float *spdllin, float *dirllin,
              float *lat, float *lon, int npts)

Routine description

gduvfwd converts, on grid gdid, meteorological winds (speed/direction) to grid winds (uu/vv). The lat/lon coordinates of each grid point have to be present.

Description of parameters

gdid

a valid grid identifier (returned by ezqkdef or ezgdef) that will be used as the source (input) grid.

uugdout, vvgdout

Output rotated winds, in grid coordinates based on gdid. There is 1:1 relationship with uugdout, vvgdout, lat and lon; that is, interpolated values at point lat(1), lon(1) are uugdout(1) and vvgdout(1).

spdllin, dirllin

Input (source) winds. spdllin and dirllin are assumed to have the dimensions referred by gdid (the input grid).

lat

Stream of latitude points

lon

Stream of longitude points

n

Number of points

?

Sample FORTRAN code :

We have meteorological winds at selected lat-lon points, and want to convert these winds in GEM grid coordinates. Assume necessary memory space has been allocated.

      datev = -1
      etiket = '        '
      typvar = ' '
      nomvar = 'UU'
      
      ip1 = 500
      ip2 = 0
      ip3 = -1
      iun = 13
      
***   read fld info and data
      key = FSTINF(iun, NI, NJ, NK, datev, etiket, ip1, ip2, ip3, typvar,
     $     nomuu) 
      ier = FSTPRM(uukey, DATEO, DEET, NPAS, NI, NJ, NK, NBITS, DATYP, IP1,
     $     IP2, IP3, TYPVAR, NOMVAR, ETIKET, GRTYP, IG1, IG2, IG3,
     $     IG4, SWA, LNG, DLTF, UBC, EX1, EX2, EX3)
     
***   Define input grid         
      
      gdgem = ezqkdef(nigem,njgem ,'Z',ig1, ig2, ig3, ig4, iun)
***   Define latlon values and wind speed/directions
      lat(1)     =   45.73
      lon(1)     =  -73.75
      spdllin(1) = 20.0
      dirllin(1) = 270.0
      lat(2)     =   43.40
      lon(2)     =  -79.38
      spdllin(2) =   10.0
      dirllin(2) =  180.0
      lat(3)     =   49.18
      lon(3)     = -123.18 
      spdllin(1) =   40.0
      dirllin(1) =    0.0
***   Do wind coordinate conversion. Returned values are in x,y coordinates,
***   uugdout is x-component (east-west) of the wind
***   vvgdout is y-component (north-south) of the wind
      call gduvfwd(gdgem, uugdout, vvgdout, spdllin, dirllin, lat, lon, 3)

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