NCEPLIBS-ip 5.2.0
|
Interpolate scalar fields (neighbor). More...
Data Types | |
interface | interpolate_neighbor_budget |
Functions/Subroutines | |
subroutine | interpolate_neighbor_budget_scalar (ipopt, grid_in, grid_out, mi, mo, km, ibi, li, gi, no, rlat, rlon, ibo, lo, go, iret) |
Interpolate scalar fields (budget). | |
subroutine | interpolate_neighbor_budget_vector (ipopt, grid_in, grid_out, mi, mo, km, ibi, li, ui, vi, no, rlat, rlon, crot, srot, ibo, lo, uo, vo, iret) |
Interpolate vector fields (budget). | |
Interpolate scalar fields (neighbor).
|
private |
Interpolate scalar fields (budget).
This subprogram performs budget interpolation from any grid to any grid for scalar fields.
The algorithm simply computes (weighted) averages of neighbor points arranged in a square box centered around each output grid point and stretching nearly halfway to each of the neighboring grid points.
Options allow choices of number of points in each radius from the center point (ipopt(1)) which defaults to 2 (if ipopt(1)=-1) meaning that 25 points will be averaged; further options are the respective weights for the radius points starting at the center point (ipopt(2:2+ipopt(1)) which defaults to all 1 (if ipopt(1)=-1 or ipopt(2)=-1).
Another option is the minimum percentage for mask, i.e. percent valid input data required to make output data, (ipopt(3+ipopt(1)) which defaults to 50 (if -1).
Only horizontal interpolation is performed.
The 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. 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.
Date | Programmer | Comments |
---|---|---|
96-04-10 | Iredell | Initial |
96-10-04 | Iredell | neighbor points not bilinear interpolation |
1999-04-08 | Iredell | split ijkgds into two pieces |
2001-06-18 | Iredell | include minimum mask percentage option |
2015-01-27 | Gayno | replace calls to gdswiz with new merged version of gdswzd. |
2015-07-13 | Gayno | replace grib 1 kgds arrays with grib 2 grid definition template arrays. |
2023-05-04 | Engle | allow calls to GDSWZD for station points |
[in] | ipopt | (20) interpolation options ipopt(1) is number of radius points (defaults to 2 if ipopt(1)=-1); ipopt(2:2+ipopt(1)) are respective weights (defaults to all 1 if ipopt(1)=-1 or ipopt(2)=-1). ipopt(3+ipopt(1)) is minimum percentage for mask (defaults to 50 if ipopt(3+ipopt(1)=-1) |
[in] | grid_in | The input grid. |
[in] | grid_out | The output grid. |
[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 |
[in] | li | (mi,km) input bitmaps (if some ibi(k)=1) |
[in] | gi | (mi,km) input fields to interpolate |
[out] | no | number of output points |
[out] | rlat | (mo) output latitudes in degrees |
[out] | rlon | (mo) output longitudes in degrees |
[out] | ibo | (km) output bitmap flags |
[out] | lo | (mo,km) output bitmaps (always output) |
[out] | go | (mo,km) output fields interpolated |
[out] | iret | return code
|
Definition at line 107 of file neighbor_budget_interp_mod.F90.
|
private |
Interpolate vector fields (budget).
This subprogram performs budget interpolation from any grid to any grid for vector fields.
The algorithm simply computes (weighted) averages of neighbor points arranged in a square box centered around each output grid point and stretching nearly halfway to each of the neighboring grid points.
Options allow choices of number of points in each radius from the center point (ipopt(1)) which defaults to 2 (if ipopt(1)=-1) meaning that 25 points will be averaged; further options are the respective weights for the radius points starting at the center point (ipopt(2:2+ipopt(1)) which defaults to all 1 (if ipopt(1)=-1 or ipopt(2)=-1).
Another option is the minimum percentage for mask, i.e. percent valid input data required to make output data, (ipopt(3+ipopt(1)) which defaults to 50 (if -1).
Only horizontal interpolation is performed.
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. 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.
Date | Programmer | Comments |
---|---|---|
96-04-10 | Iredell | Initial |
1999-04-08 | Iredell | split ijkgds into two pieces |
2001-06-18 | Iredell | include minimum mask percentage option |
2002-01-17 | Iredell | save data from last call for optimization |
2015-01-27 | Gayno | replace calls to gdswiz with new merged routine gdswzd. |
2015-07-13 | Gayno | replace grib 1 kgds arrays with grib 2 grid definition template arrays. |
2023-05-04 | Engle | allow calls to GDSWZD for station points |
[in] | ipopt | (20) interpolation options ipopt(1) is number of radius points (defaults to 2 if ipopt(1)=-1); ipopt(2:2+ipopt(1)) are respective weights (defaults to all 1 if ipopt(1)=-1 or ipopt(2)=-1). ipopt(3+ipopt(1)) is minimum percentage for mask (defaults to 50 if ipopt(3+ipopt(1)=-1) |
[in] | grid_in | The input grid. |
[in] | grid_out | The output grid. |
[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 |
[in] | li | (mi,km) input bitmaps (if some ibi(k)=1) |
[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 |
[out] | rlat | (mo) output latitudes in degrees |
[out] | rlon | (mo) output longitudes in degrees |
[out] | crot | (mo) vector rotation cosines |
[out] | srot | (mo) vector rotation sines (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 351 of file neighbor_budget_interp_mod.F90.