NCEPLIBS-ip
5.1.0
|
Top-level driver for scalar interpolation interpolation routine ipolates(). More...
Data Types | |
interface | ipolates |
Functions/Subroutines | |
subroutine, public | ipolates_grib1 (ip, ipopt, kgdsi, kgdso, mi, mo, km, ibi, li, gi, no, rlat, rlon, ibo, lo, go, iret) |
This subprogram interpolates scalar field from any grid to any grid given a grib1 Grid Descriptor Section. More... | |
subroutine, public | ipolates_grib1_single_field (ip, ipopt, kgdsi, kgdso, mi, mo, km, ibi, li, gi, no, rlat, rlon, ibo, lo, go, iret) |
Special case of ipolates_grib1 when interpolating a single field. More... | |
subroutine, public | ipolates_grib2 (IP, IPOPT, IGDTNUMI, IGDTMPLI, IGDTLENI, IGDTNUMO, IGDTMPLO, IGDTLENO, MI, MO, KM, IBI, LI, GI, NO, RLAT, RLON, IBO, LO, GO, IRET) |
This subprogram interpolates scalar field from any grid to any grid given a grib2 descriptor. More... | |
subroutine, public | ipolates_grib2_single_field (IP, IPOPT, IGDTNUMI, IGDTMPLI, IGDTLENI, IGDTNUMO, IGDTMPLO, IGDTLENO, MI, MO, KM, IBI, LI, GI, NO, RLAT, RLON, IBO, LO, GO, IRET) |
Special case of ipolates_grib2 when interpolating a single field. More... | |
subroutine | ipolates_grid (ip, ipopt, grid_in, grid_out, mi, mo, km, ibi, li, gi, no, rlat, rlon, ibo, lo, go, iret) |
Interpolates scalar fields between grids given ip_grid objects. More... | |
Top-level driver for scalar interpolation interpolation routine ipolates().
ipolates() is overloaded with interfaces for GRIB1 and GRIB2 descriptors.
subroutine, public ipolates_mod::ipolates_grib1 | ( | integer(c_int), intent(in) | ip, |
integer(c_int), dimension(20), intent(in) | ipopt, | ||
integer(c_int), dimension(200), intent(in) | kgdsi, | ||
integer(c_int), dimension(200), intent(in) | kgdso, | ||
integer(c_int), intent(in) | mi, | ||
integer(c_int), intent(in) | mo, | ||
integer(c_int), intent(in) | km, | ||
integer(c_int), dimension(km), intent(in) | ibi, | ||
logical(c_bool), dimension(mi,km), intent(in) | li, | ||
real(c_double), dimension(mi,km), intent(in) | gi, | ||
integer(c_int), intent(inout) | no, | ||
real(c_double), dimension(mo), intent(inout) | rlat, | ||
real(c_double), dimension(mo), intent(inout) | rlon, | ||
integer(c_int), dimension(km), intent(out) | ibo, | ||
logical(c_bool), dimension(mo,km), intent(out) | lo, | ||
real(c_double), dimension(mo,km), intent(out) | go, | ||
integer(c_int), intent(out) | iret | ||
) |
This subprogram interpolates scalar 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] | gi | Input 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). |
[out] | ibo | Output bitmap flags. |
[out] | lo | Output bitmaps (always output). |
[out] | go | Output fields interpolated. |
[out] | iret | Return code.
|
Definition at line 293 of file ipolates.F90.
subroutine, public ipolates_mod::ipolates_grib1_single_field | ( | integer(c_int), intent(in) | ip, |
integer(c_int), dimension(20), intent(in) | ipopt, | ||
integer(c_int), dimension(200), intent(in) | kgdsi, | ||
integer(c_int), dimension(200), intent(in) | kgdso, | ||
integer(c_int), intent(in) | mi, | ||
integer(c_int), intent(in) | mo, | ||
integer(c_int), intent(in) | km, | ||
integer(c_int), intent(in) | ibi, | ||
logical(c_bool), dimension(mi), intent(in) | li, | ||
real(c_double), dimension(mi), intent(in) | gi, | ||
integer(c_int), intent(inout) | no, | ||
real(c_double), dimension(mo), intent(inout) | rlat, | ||
real(c_double), dimension(mo), intent(inout) | rlon, | ||
integer(c_int), intent(out) | ibo, | ||
logical(c_bool), dimension(mo), intent(out) | lo, | ||
real(c_double), dimension(mo), intent(out) | go, | ||
integer(c_int), intent(out) | iret | ||
) |
Special case of ipolates_grib1 when interpolating a single field.
Removes the km dimension of input arrays so scalars 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] | gi | Input 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). |
[out] | ibo | Output bitmap flags. |
[out] | lo | Output bitmaps (always output). |
[out] | go | Output fields interpolated. |
[out] | iret | Return code.
|
Definition at line 158 of file ipolates.F90.
subroutine, public ipolates_mod::ipolates_grib2 | ( | integer(c_int), intent(in) | IP, |
integer(c_int), dimension(20), intent(in) | IPOPT, | ||
integer(c_int), intent(in) | IGDTNUMI, | ||
integer(c_int), dimension(igdtleni), intent(in) | IGDTMPLI, | ||
integer(c_int), intent(in) | IGDTLENI, | ||
integer(c_int), intent(in) | IGDTNUMO, | ||
integer(c_int), dimension(igdtleno), intent(in) | IGDTMPLO, | ||
integer(c_int), intent(in) | IGDTLENO, | ||
integer(c_int), intent(in) | MI, | ||
integer(c_int), intent(in) | MO, | ||
integer(c_int), intent(in) | KM, | ||
integer(c_int), dimension(km), intent(in) | IBI, | ||
logical(c_bool), dimension(mi,km), intent(in) | LI, | ||
real(c_double), dimension(mi,km), intent(in) | GI, | ||
integer(c_int), intent(out) | NO, | ||
real(c_double), dimension(mo), intent(inout) | RLAT, | ||
real(c_double), dimension(mo), intent(inout) | RLON, | ||
integer(c_int), dimension(km), intent(out) | IBO, | ||
logical(c_bool), dimension(mo,km), intent(out) | LO, | ||
real(c_double), dimension(mo,km), intent(out) | GO, | ||
integer(c_int), intent(out) | IRET | ||
) |
This subprogram interpolates scalar field from any grid to any grid given a grib2 descriptor.
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. c 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] | gi | Input 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). |
[out] | ibo | Output bitmap flags. |
[out] | lo | Output bitmaps (always output). |
[out] | go | Output 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.04 seconds.
METHOD | IP | IPOPT | CP SECONDS |
---|---|---|---|
BILINEAR | 0 | 0.03 | |
BICUBIC | 1 | 0 | 0.07 |
BICUBIC | 1 | 1 | 0.07 |
NEIGHBOR | 2 | 0.01 | |
BUDGET | 3 | -1,-1 | 0.48 |
SPECTRAL | 4 | 0,40 | 0.22 |
SPECTRAL | 4 | 1,40 | 0.24 |
SPECTRAL | 4 | 0,-1 | 0.42 |
N-BUDGET | 6 | -1,-1 | 0.15 |
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.03 | |
BICUBIC | 1 | 0 | 0.07 |
BICUBIC | 1 | 1 | 0.07 |
NEIGHBOR | 2 | 0.01 | |
BUDGET | 3 | -1,-1 | 0.51 |
SPECTRAL | 4 | 0,40 | 3.94 |
SPECTRAL | 4 | 1,40 | 5.02 |
SPECTRAL | 4 | 0,-1 | 11.36 |
N-BUDGET | 6 | -1,-1 | 0.18 |
Definition at line 587 of file ipolates.F90.
subroutine, public ipolates_mod::ipolates_grib2_single_field | ( | integer(c_int), intent(in) | IP, |
integer(c_int), dimension(20), intent(in) | IPOPT, | ||
integer(c_int), intent(in) | IGDTNUMI, | ||
integer(c_int), dimension(igdtleni), intent(in) | IGDTMPLI, | ||
integer(c_int), intent(in) | IGDTLENI, | ||
integer(c_int), intent(in) | IGDTNUMO, | ||
integer(c_int), dimension(igdtleno), intent(in) | IGDTMPLO, | ||
integer(c_int), intent(in) | IGDTLENO, | ||
integer(c_int), intent(in) | MI, | ||
integer(c_int), intent(in) | MO, | ||
integer(c_int), intent(in) | KM, | ||
integer(c_int), intent(in) | IBI, | ||
logical(c_bool), dimension(mi), intent(in) | LI, | ||
real(c_double), dimension(mi), intent(in) | GI, | ||
integer(c_int), intent(out) | NO, | ||
real(c_double), dimension(mo), intent(inout) | RLAT, | ||
real(c_double), dimension(mo), intent(inout) | RLON, | ||
integer(c_int), intent(out) | IBO, | ||
logical(c_bool), dimension(mo), intent(out) | LO, | ||
real(c_double), dimension(mo), intent(out) | GO, | ||
integer(c_int), intent(out) | IRET | ||
) |
Special case of ipolates_grib2 when interpolating a single field.
Removes the km dimension of input arrays so scalars can be passed to ibi/ibo.
[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. c 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] | gi | Input 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). |
[out] | ibo | Output bitmap flags. |
[out] | lo | Output bitmaps (always output). |
[out] | go | Output fields interpolated. |
[out] | iret | Return code.
|
Definition at line 808 of file ipolates.F90.
|
private |
Interpolates scalar fields between grids given ip_grid objects.
Calls the specific interpolation routines on the generic ip_grids created from a grib1/grib2 descriptor.
[in] | ip | Interpolation method. |
[in] | ipopt | Interpolation options. |
[in] | grid_in | Input grid. |
[in] | grid_out | Output grid object created. |
[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] | gi | Input 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). |
[out] | ibo | Output bitmap flags. |
[out] | lo | Output bitmaps (always output). |
[out] | go | Output fields interpolated. |
[out] | iret | Return code.
|
Definition at line 63 of file ipolates.F90.
References ip_interpolators_mod::bicubic_interp_id, ip_interpolators_mod::bilinear_interp_id, ip_interpolators_mod::budget_interp_id, ip_interpolators_mod::neighbor_budget_interp_id, ip_interpolators_mod::neighbor_interp_id, and ip_interpolators_mod::spectral_interp_id.
Referenced by ipolates_mod::ipolates::ipolates_grib1(), ipolates_mod::ipolates::ipolates_grib1_single_field(), ipolates_mod::ipolates::ipolates_grib2(), and ipolates_mod::ipolates::ipolates_grib2_single_field().