FORTRAN
integer ezgdef, gdid gdid = ezgdef_fmem(ni, nj, grtyp, grref, ig1, ig2, ig3, ig4, ax, ay) integer ni, nj, ig1, ig2, ig3, ig4 character*1 grtyp, grref real ax(*), ay(*) |
C
gdid = c_ezgdef_fmem(int ni, int nj, char *grtyp, char *grref, int ig1ref, int ig2ref, int ig3ref, int ig4ref, float *ax, float *ay) |
Routine description
![]() |
This
function is one of the most general entry point of the ezscint
package to define a grid in conformance with the RPN standard
file grid descriptors. It is applicable to both regular and
irregular ('Y', 'Z') grids, although it is not very useful for
regular grids. It also has a simpler front-end, ezqkdef.
ezgdef_fmem insert a grid entry into the list of grids managed by the ezscint package. On completion, it returns "gdid", a token that can be used in later calls as a key to identify the grid, like the keys used in the RPN standard files. The values of the IG1-IG4 parameters will change depending on the context. If grtyp='Y' or 'Z', and grref='E', 'G', 'L', 'N', or 'S', the positional records are read from ax and ay, and the values of IG1 thru IG4 are those associated with the reference grid; they are normally obtained from a call to FSTPRM on the positional parameters ('^^', '>>'), and are referred to IG1REF thru IG4REF. If the grid type corresponds to a regular grid type (eg. 'A', 'G', 'N', etc.), then the parameters IG1 through IG4 are taken from an ordinary data record and grref, ax and ay are not used. |
Description of parameters
ni, nj | horizontal dimensions of the grid |
grtyp | type of grid ('A', 'B', 'E', 'G', 'L', 'N', 'S','Y', 'Z', '#', '!') |
grref | Reference grid type ('E', 'G', 'L', 'N', 'S') |
ig1ref, ig2ref, ig3ref, ig4ref | RPN standard file grid parameters of the positional parameters ('^^', '>>'), as returned by fstprm |
ax, ay | positional axes. ax is mapped to the '>>' record, ay to '^^'. If grtyp == 'Z' or '#', the dimensions of ax=ni and ay=nj. If grtyp == 'Y', the dimensions of ax=ay=ni*nj. |
The following functions can be invoked to get supplemental information about the grid.
gdgaxes | value of the positional records |
gdll | lat-lon coordinates of the grid points |
ezgprm | grid attributes of grid |
ezgfstp or ezgxfstp | standard file attributes of the positional records |
Sample FORTRAN code :
We want to interpolate data from any grid to a 400x200 Gaussian grid. Assume necessary memory space has been allocated.
datev = -1 etiket = ' ' typvar = ' nomvar = 'GZ' 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, $ nomvar) ier = FSTPRM(key, 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(zgem, key, NI, NJ, NK) *** Define input grid gdgem = ezgdef(nigem,njgem ,'Z','FILE', ig1, ig2, ig3, iun, unused, unused) *** Define output grid and define grid set gdgauss = ezgdef(nigauss, njgauss, 'G', 0,0,0,0,unused, unused) ier = ezdefset(gdgauss, gdgem) *** Now call ezsint ier = ezsint(zgauss, zgem)
Go to the list of functions, or the general index.