NCEPLIBS-ip
5.0.0
|
Private Member Functions | |
subroutine | polatev4_grib1 (IPOPT, KGDSI, KGDSO, MI, MO, KM, IBI, UI, VI, NO, RLAT, RLON, CROT, SROT, IBO, LO, UO, VO, IRET) |
Interpolate vector fields (spectral). More... | |
subroutine | polatev4_grib2 (IPOPT, IGDTNUMI, IGDTMPLI, IGDTLENI, IGDTNUMO, IGDTMPLO, IGDTLENO, MI, MO, KM, IBI, UI, VI, NO, RLAT, RLON, CROT, SROT, IBO, LO, UO, VO, IRET) |
Interpolate vector fields (spectral). More... | |
Definition at line 29 of file spectral_interp_mod.F90.
|
private |
Interpolate vector fields (spectral).
This subprogram performs spectral interpolation from any grid to any grid for vector fields. It requires that the input fields be uniformly global. Options allow choices between triangular shape (ipopt(1)=0) and rhomboidal shape (ipopt(1)=1) which has no default; a second option is the truncation (ipopt(2)) which defaults to a sensible truncation for the input grid (if opt(2)=-1).
Only horizontal interpolation is performed. The grids are defined by their grid description sections (passed in integer form as decoded by subprogram w3fi63).
The current code recognizes the following projections:
Where kgds could be either input kgdsi or output kgdso.
The input and output vectors are rotated so that they are either resolved relative to the defined grid in the direction of increasing x and y coordinates or resolved relative to easterly and northerly directions, as designated by their respective grid description sections. As an added bonus the number of output grid points and their latitudes and longitudes are also returned along with their vector rotation parameters. On the other hand, the output can be a set of station points if kgdso(1)<0, in which case the number of points and their latitudes and longitudes must be input along with their vector rotation parameters.
Output bitmaps will only be created when the output grid extends outside of the domain of the input grid. The output field is set to 0 where the output bitmap is off.
Date | Programmer | Comments |
---|---|---|
96-04-10 | iredell | initial. |
2001-06-18 | iredell | improve detection of special fast transform |
2015-01-27 | gayno | replace calls to gdswiz() with new merged routine gdswzd(). |
[in] | ipopt | (20) interpolation options ipopt(1)=0 for triangular, ipopt(1)=1 for rhomboidal; ipopt(2) is truncation number (defaults to sensible if ipopt(2)=-1). |
[in] | kgdsi | (200) input gds parameters as decoded by w3fi63. |
[in] | kgdso | (200) output gds parameters (kgdso(1)<0 implies random station points). |
[in] | mi | skip number between input grid fields if km>1 or dimension of input grid fields if km=1. |
[in] | mo | skip number between output grid fields if km>1 or dimension of output grid fields if km=1. |
[in] | km | number of fields to interpolate |
[in] | ibi | (km) input bitmap flags (must be all 0) |
[in] | ui | (mi,km) input u-component fields to interpolate |
[in] | vi | (mi,km) input v-component fields to interpolate |
[out] | no | number of output points (only if kgdso(1)<0) |
[out] | rlat | (no) output latitudes in degrees (if kgdso(1)<0) |
[out] | rlon | (no) output longitudes in degrees (if kgdso(1)<0) |
[out] | crot | (no) vector rotation cosines (if kgdso(1)<0) |
[out] | srot | (no) vector rotation sines (if kgdso(1)<0) (ugrid=crot*uearth-srot*vearth; vgrid=srot*uearth+crot*vearth) |
[out] | ibo | (km) output bitmap flags |
[out] | lo | (mo,km) output bitmaps (always output) |
[out] | uo | (mo,km) output u-component fields interpolated |
[out] | vo | (mo,km) output v-component fields interpolated |
[out] | iret | return code
|
Definition at line 1221 of file spectral_interp_mod.F90.
References sptrungv(), sptrunmv(), sptrunsv(), and sptrunv().
|
private |
Interpolate vector fields (spectral).
This subprogram performs spectral interpolation from any grid to any grid for vector fields. It requires that the input fields be uniformly global. Options allow choices between triangular shape (ipopt(1)=0) and rhomboidal shape (ipopt(1)=1) which has no default; a second option is the truncation (ipopt(2)) which defaults to a sensible truncation for the input grid (if opt(2)=-1).
The input and output grids are defined by their grib 2 grid definition template as decoded by the ncep g2 library. The code recognizes the following projections, where "igdtnumi/o" is the grib 2 grid defintion template number for the input and output grids, respectively:
The input and output vectors are rotated so that they are either resolved relative to the defined grid in the direction of increasing x and y coordinates or resolved relative to easterly and northerly directions, as designated by their respective grid description sections.
As an added bonus the number of output grid points and their latitudes and longitudes are also returned along with their vector rotation parameters. On the other hand, the output can be a set of station points if igdtnumo<0, in which case the number of points and their latitudes and longitudes must be input along with their vector rotation parameters.
Output bitmaps will only be created when the output grid extends outside of the domain of the input grid. the output field is set to 0 where the output bitmap is off.
Date | Programmer | Comments |
---|---|---|
96-04-10 | iredell | initial |
2001-06-18 | iredell | improve detection of special fast transform |
2015-01-27 | gayno | replace calls to gdswiz() with new merged routine gdswzd(). |
2015-07-13 | gayno | convert to grib 2. replace grib 1 kgds arrays with grib 2 grid definition template arrays. |
[in] | ipopt | (20) interpolation options ipopt(1)=0 for triangular, ipopt(1)=1 for rhomboidal; ipopt(2) is truncation number (defaults to sensible if ipopt(2)=-1). |
[in] | igdtnumi | grid definition template number - input grid. Corresponds to the gfldigdtnum component of the ncep g2 library gridmod data structure:
|
[in] | igdtmpli | (igdtleni) grid definition template array - input grid. corresponds to the gfldigdtmpl component of the ncep g2 library gridmod data structure (section 3 info). see comments in routine ipolatev for complete definition. |
[in] | igdtleni | number of elements of the grid definition template array - input grid. corresponds to the gfldigdtlen component of the ncep g2 library gridmod data structure. |
[in] | igdtnumo | grid definition template number - output grid. Corresponds to the gfldigdtnum component of the ncep g2 library gridmod data structure. igdtnumo<0 means interpolate to random station points. Otherwise, same definition as "igdtnumi". |
[in] | igdtmplo | (igdtleno) grid definition template array - output grid. corresponds to the gfldigdtmpl component of the ncep g2 library gridmod data structure (section 3 info). see comments in routine ipolatev() for complete definition. |
[in] | igdtleno | number of elements of the grid definition template array - output grid. Corresponds to the gfldigdtlen component of the ncep g2 library gridmod data structure. |
[in] | mi | skip number between input grid fields if km>1 or dimension of input grid fields if km=1. |
[in] | mo | skip number between output grid fields if km>1 or dimension of output grid fields if km=1. |
[in] | km | number of fields to interpolate |
[in] | ibi | (km) input bitmap flags (must be all 0) |
[in] | ui | (mi,km) input u-component fields to interpolate |
[in] | vi | (mi,km) input v-component fields to interpolate |
[out] | no | number of output points (only if igdtnumo>=0) |
[in,out] | rlat | (mo) output latitudes in degrees (if igdtnumo<0) |
[in,out] | rlon | (mo) output longitudes in degrees (if igdtnumo<0) |
[in,out] | crot | (mo) vector rotation cosines (if igdtnumo<0) |
[in,out] | srot | (mo) vector rotation sines (if igdtnumo<0) (ugrid=crot*uearth-srot*vearth; vgrid=srot*uearth+crot*vearth) |
[out] | ibo | (km) output bitmap flags |
[out] | lo | (mo,km) output bitmaps (always output) |
[out] | uo | (mo,km) output u-component fields interpolated |
[out] | vo | (mo,km) output v-component fields interpolated |
[out] | iret | return code
|
Definition at line 887 of file spectral_interp_mod.F90.
References earth_radius_mod::earth_radius(), sptrungv(), sptrunmv(), sptrunsv(), and sptrunv().