NCEPLIBS-ip
4.2.0
|
Private Member Functions | |
subroutine | ipolatev_grib1 (ip, ipopt, kgdsi, kgdso, mi, mo, km, ibi, li, ui, vi, no, rlat, rlon, crot, srot, ibo, lo, uo, vo, iret) |
This subprogram interpolates vector field from any grid to any grid given a grib1 Grid Descriptor Section. More... | |
subroutine | ipolatev_grib1_single_field (ip, ipopt, kgdsi, kgdso, mi, mo, km, ibi, li, ui, vi, no, rlat, rlon, crot, srot, ibo, lo, uo, vo, iret) |
Special case of ipolatev_grib1 when interpolating a single field. More... | |
subroutine | ipolatev_grib2 (ip, ipopt, igdtnumi, igdtmpli, igdtleni, igdtnumo, igdtmplo, igdtleno, mi, mo, km, ibi, li, ui, vi, no, rlat, rlon, crot, srot, ibo, lo, uo, vo, iret) |
This subprogram interpolates vector fields from any grid to any grid given a grib2 descriptor. More... | |
subroutine | ipolatev_grib2_single_field (ip, ipopt, igdtnumi, igdtmpli, igdtleni, igdtnumo, igdtmplo, igdtleno, mi, mo, km, ibi, li, ui, vi, no, rlat, rlon, crot, srot, ibo, lo, uo, vo, iret) |
This subprogram interpolates vector fields from any grid to any grid given a grib2 descriptor. More... | |
Definition at line 21 of file ipolatev.F90.
|
private |
This subprogram interpolates vector field from any grid to any grid given a grib1 Grid Descriptor Section.
Only horizontal interpolation is performed. The following interpolation methods are possible:
Some of these methods have interpolation options and/or restrictions on the input or output grids, both of which are documented more fully in their respective subprograms.
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.
As an added bonus the number of output grid points and their latitudes and longitudes are also returned.
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. for the budget approach, a subsection of the grid may be output by subtracting kgdso(1) from 255 and passing in the latitudes and longitudes of the points. Input bitmaps will be interpolated to output bitmaps.
Output bitmaps will also 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.
ip | Interpolation method
| |
ipopt | Interpolation options
| |
[in] | kgdsi | Input gds parameters as decoded by w3fi63. |
[in] | kgdso | Output gds parameters. |
[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 | Input bitmap flags. |
[in] | li | Input bitmaps (if respective ibi(k)=1). |
[in] | ui | Input u-component fields to interpolate. |
[in] | vi | Input v-component fields to interpolate. |
[out] | no | Number of output points (only if kgdso(1)<0). |
[out] | rlat | Output latitudes in degrees (if kgdso(1)<0). |
[out] | rlon | Output longitudes in degrees (if kgdso(1)<0). |
[in,out] | crot | Vector rotation cosines (if igdtnumo>=0). |
[in,out] | srot | Vector rotation sines (if igdtnumo>=0). |
[out] | ibo | Output bitmap flags. |
[out] | lo | Output bitmaps (always output). |
[out] | uo | Output u-component fields interpolated. |
[out] | vo | Output v-component fields interpolated. |
[out] | iret | Return code.
|
The example times are for the c90. As a reference, the cp time for unpacking the global 12 temperature fields is 0.07 seconds.
METHOD | IP | IPOPT | CP SECONDS |
---|---|---|---|
BILINEAR | 0 | 0.05 | |
BICUBIC | 1 | 0 | 0.16 |
BICUBIC | 1 | 1 | 0.17 |
NEIGHBOR | 2 | 0.02 | |
BUDGET | 3 | -1,-1 | 0.94 |
SPECTRAL | 4 | 0,40 | 0.31 |
SPECTRAL | 4 | 1,40 | 0.33 |
SPECTRAL | 4 | 0,-1 | 0.59 |
N-BUDGET | 6 | -1,-1 | 0.31 |
The spectral interpolation is fast for the mercator grid. However, for some grids the spectral interpolation is slow.
The following example is interpolating 12 levels of temperatures from the 360 x 181 global grid (ncep grid 3) to the 93 x 65 conus lambert conformal grid (ncep grid 211).
METHOD | IP | IPOPT | CP SECONDS |
---|---|---|---|
BILINEAR | 0 | 0.05 | |
BICUBIC | 1 | 0 | 0.15 |
BICUBIC | 1 | 1 | 0.16 |
NEIGHBOR | 2 | 0.02 | |
BUDGET | 3 | -1,-1 | 0.92 |
SPECTRAL | 4 | 0,40 | 4.51 |
SPECTRAL | 4 | 1,40 | 5.77 |
SPECTRAL | 4 | 0,-1 | 12.60 |
N-BUDGET | 6 | -1,-1 | 0.33 |
Definition at line 565 of file ipolatev.F90.
References ipolatev_mod::ipolatev_grid().
|
private |
Special case of ipolatev_grib1 when interpolating a single field.
Removes the km dimension of input arrays so vectors can be passed to ibi/ibo.
ip | Interpolation method
| |
ipopt | Interpolation options
| |
[in] | kgdsi | Input gds parameters as decoded by w3fi63. |
[in] | kgdso | Output gds parameters. |
[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 | Input bitmap flags. |
[in] | li | Input bitmaps (if respective ibi(k)=1). |
[in] | ui | Input u-component fields to interpolate. |
[in] | vi | Input v-component fields to interpolate. |
[out] | no | Number of output points (only if kgdso(1)<0). |
[out] | rlat | Output latitudes in degrees (if kgdso(1)<0). |
[out] | rlon | Output longitudes in degrees (if kgdso(1)<0). |
[in,out] | crot | Vector rotation cosines (if igdtnumo>=0). |
[in,out] | srot | Vector rotation sines (if igdtnumo>=0). |
[out] | ibo | Output bitmap flags. |
[out] | lo | Output bitmaps (always output). |
[out] | uo | Output u-component fields interpolated. |
[out] | vo | Output v-component fields interpolated. |
[out] | iret | Return code.
|
Definition at line 680 of file ipolatev.F90.
References ipolatev_mod::ipolatev_grid().
|
private |
This subprogram interpolates vector fields from any grid to any grid given a grib2 descriptor.
This is a wrapper for ipolates_grid which converts a grib1 descriptor into an ip_grid_descriptor, which is used to create an ip_grid. Only horizontal interpolation is performed.
The following interpolation methods are possible:
Some of these methods have interpolation options and/or restrictions on the input or output grids, both of which are documented more fully in their respective subprograms.
Input and output grids are defined by their grib 2 grid definition template as decoded by the ncep g2 library. The current code recognizes the following projections, where "igdtnumi/o" is the grib 2 grid defintion template number for the input and output grids, respectively:
As an added bonus the number of output grid points and their latitudes and longitudes are also returned.
On the other hand, data may be interpolated to a set of station points if "igdtnumo"<0 (or subtracted from 255 for the budget option), in which case the number of points and their latitudes and longitudes must be input.
Input bitmaps will be interpolated to output bitmaps. Output bitmaps will also 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.
[in] | ip | Interpolation method
|
[in] | ipopt | Interpolation options
|
[in] | igdtnumi | Grid definition template number for the input grid. Corresponds to the gfldigdtnum component of the ncep g2 library gridmod data structure:
|
[in] | igdtmpli | Grid definition template array input grid. Corresponds to the gfldigdtmpl component of the NCEPLIBS-g2 gridmod data structure |
Section 3 Info:
All map projections:
Equidistant Cyclindrical:
Mercator Cyclindrical:
Lambert Conformal Conical:
Gaussian Cylindrical:
Polar Stereographic Azimuthal:
Rotated Equidistant Cyclindrical:
[in] | igdtleni | Number of elements of the grid definition template array for the input grid. Corresponds to the gfldigdtlen component of the ncep g2 library gridmod data structure. |
[in] | igdtnumo | Grid definition template number for the output grid. Corresponds to the gfldigdtnum component of the ncep g2 library gridmod data structure. See "igdtnumi" for specific template definitions. Note: igdtnumo<0 means interpolate to random station points. |
[in] | igdtmplo | Grid definition template array for the output grid. Corresponds to the gfldigdtmpl component of the ncep g2 library gridmod data structure. See "igdtmpli" for definition of array elements. |
[in] | igdtleno | Number of elements of the grid definition template array for the 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 | Input bitmap flags. |
[in] | li | Input bitmaps (if respective ibi(k)=1). |
[in] | ui | Input u-component fields to interpolate. |
[in] | vi | Input v-component fields to interpolate. |
[out] | no | Number of output points (only if kgdso(1)<0). |
[in,out] | rlat | Output latitudes in degrees (if kgdso(1)<0). |
[in,out] | rlon | Output longitudes in degrees (if kgdso(1)<0). |
[in,out] | crot | Vector rotation cosines (if igdtnumo>=0). |
[in,out] | srot | Vector rotation sines (if igdtnumo>=0). |
[out] | ibo | Output bitmap flags. |
[out] | lo | Output bitmaps (always output). |
[out] | uo | Output u-component fields interpolated. |
[out] | vo | Output v-component fields interpolated. |
[out] | iret | Return code.
|
The example times are for the c90. As a reference, the cp time for unpacking the global 12 wind fields is 0.07 seconds.
METHOD | IP | IPOPT | CP SECONDS |
---|---|---|---|
BILINEAR | 0 | 0.05 | |
BICUBIC | 1 | 0 | 0.16 |
BICUBIC | 1 | 1 | 0.17 |
NEIGHBOR | 2 | 0.02 | |
BUDGET | 3 | -1,-1 | 0.94 |
SPECTRAL | 4 | 0,40 | 0.31 |
SPECTRAL | 4 | 1,40 | 0.33 |
SPECTRAL | 4 | 0,-1 | 0.59 |
N-BUDGET | 6 | -1,-1 | 0.31 |
The spectral interpolation is fast for the mercator grid. However, for some grids the spectral interpolation is slow.
The following example is interpolating 12 levels of winds from the 360 x 181 global grid (ncep grid 3) to the 93 x 65 conus lambert conformal grid (ncep grid 211).
METHOD | IP | IPOPT | CP SECONDS |
---|---|---|---|
BILINEAR | 0 | 0.05 | |
BICUBIC | 1 | 0 | 0.15 |
BICUBIC | 1 | 1 | 0.16 |
NEIGHBOR | 2 | 0.02 | |
BUDGET | 3 | -1,-1 | 0.92 |
SPECTRAL | 4 | 0,40 | 4.51 |
SPECTRAL | 4 | 1,40 | 5.77 |
SPECTRAL | 4 | 0,-1 | 12.60 |
N-BUDGET | 6 | -1,-1 | 0.33 |
Definition at line 382 of file ipolatev.F90.
References ipolatev_mod::ipolatev_grid().
|
private |
This subprogram interpolates vector fields from any grid to any grid given a grib2 descriptor.
[in] | ip | Interpolation method
|
[in] | ipopt | Interpolation options
|
[in] | igdtnumi | Grid definition template number for the input grid. Corresponds to the gfldigdtnum component of the ncep g2 library gridmod data structure:
|
[in] | igdtmpli | Grid definition template array input grid. Corresponds to the gfldigdtmpl component of the NCEPLIBS-g2 gridmod data structure |
[in] | igdtleni | Number of elements of the grid definition template array for the input grid. Corresponds to the gfldigdtlen component of the ncep g2 library gridmod data structure. |
[in] | igdtnumo | Grid definition template number for the output grid. Corresponds to the gfldigdtnum component of the ncep g2 library gridmod data structure. See "igdtnumi" for specific template definitions. Note: igdtnumo<0 means interpolate to random station points. |
[in] | igdtmplo | Grid definition template array for the output grid. Corresponds to the gfldigdtmpl component of the ncep g2 library gridmod data structure. See "igdtmpli" for definition of array elements. |
[in] | igdtleno | Number of elements of the grid definition template array for the 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 | Input bitmap flags. |
[in] | li | Input bitmaps (if respective ibi(k)=1). |
[in] | ui | Input u-component fields to interpolate. |
[in] | vi | Input v-component fields to interpolate. |
[out] | no | Number of output points (only if kgdso(1)<0). |
[in,out] | rlat | Output latitudes in degrees (if kgdso(1)<0). |
[in,out] | rlon | Output longitudes in degrees (if kgdso(1)<0). |
[in,out] | crot | Vector rotation cosines (if igdtnumo>=0). |
[in,out] | srot | Vector rotation sines (if igdtnumo>=0). |
[out] | ibo | Output bitmap flags. |
[out] | lo | Output bitmaps (always output). |
[out] | uo | Output u-component fields interpolated. |
[out] | vo | Output v-component fields interpolated. |
[out] | iret | Return code.
|
Definition at line 832 of file ipolatev.F90.
References ipolatev_mod::ipolatev_grid().