|
FORTRAN integer gdwdfuv, ier ier = gdwdfuv(gdid, spdllout, dirlldout, uugdin, vvgdin, lat, lon, n) integer gdid, n real spdllout(n), dirllout(n), uugdin(*), vvgdin(*), lat(n), lon(n) |
|
C int c_gdwdfuv(int gdid, float *spdllout, float *dirllout, float *uugdin, float *vvgdin,
float *lat, float *lon, int npts)
|
Routine description
|
gdwdfuv converts, on grid gdid, grid winds (uu/vv) to meteorological winds (speed/direction). The lat/lon coordinates of each 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. |
|
spdllout, dirllout |
Output rotated winds, in grid coordinates based on gdid. There is 1:1 relationship with spdllout, dirllout, lat and lon; that is, interpolated values at point lat(1), lon(1) are spdllout(1) and dirllout(1). |
|
uugdin, vvgdin |
Input (source) winds. uugdin and vvgdin 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 :
The following code read 500 mb grid winds on a GEM grid, and converts them to meteorological wind speed and direction. Assume necessary memory space has been allocated.
datev = -1
etiket = ' '
typvar = ' '
nomuu = 'UU'
nomvv = 'VV'
ip1 = 500
ip2 = 0
ip3 = -1
iun = 13
*** read fld info and data
uukey = 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)
ier = FSTLUK(uugem, key, NI, NJ, NK)
vvkey = FSTINF(iun, NI, NJ, NK, datev, etiket, ip1, ip2, ip3, typvar,nomvv)
ier = FSTPRM(vvkey, 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)
ier = FSTLUK(vvgem, key, NI, NJ, NK)
*** Define input grid
gdgem = ezqkdef(nigem,njgem ,'Z',ig1, ig2, ig3, ig4, iun)
*** Define latlon values and wind speed/directions
ier = gdll(gdgem, lat, lon)
*** Do wind coordinate conversion. Returned values are in spd,dir coordinates,
*** spdllout is wind speed
*** dirllout is meteorological wind direction
call gdwdfuv(gdgem, spdllout, dirllout, uugem, vvgem, lat, lon, nigem*njgem)
Go to the list of functions, or the general index.