NCEPLIBS-ip 5.2.0
|
Budget interpolation routines for scalars and vectors. More...
Data Types | |
interface | interpolate_budget |
Functions/Subroutines | |
subroutine | interpolate_budget_scalar (ipopt, grid_in, grid_out, mi, mo, km, ibi, li, gi, no, rlat, rlon, ibo, lo, go, iret) |
Performs budget interpolation from any grid to any grid (or to random station points) for scalar fields. | |
subroutine | interpolate_budget_vector (ipopt, grid_in, grid_out, mi, mo, km, ibi, li, ui, vi, no, rlat, rlon, crot, srot, ibo, lo, uo, vo, iret) |
This subprogram performs budget interpolation from any grid to any grid (or to random station points) for vector fields. | |
Budget interpolation routines for scalars and vectors.
|
private |
Performs budget interpolation from any grid to any grid (or to random station points) for scalar fields.
The algorithm simply computes (weighted) averages of bilinearly interpolated 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).
A special interpolation is done if ipopt(2)=-2. in this case, the boxes stretch nearly all the way to each of the neighboring grid points and the weights are the adjoint of the bilinear interpolation weights. This case gives quasi-second-order budget interpolation.
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).
In cases where there is no or insufficient valid input data, the user may choose to search for the nearest valid data. this is invoked by setting ipopt(20) to the width of the search square. The default is 1 (no search). Squares are searched for valid data in a spiral pattern starting from the center. No searching is done where the output grid is outside the input grid.
Only horizontal interpolation is performed.
[in] | ipopt | Interpolation options
|
[in] | grid_in | Input grid |
[in] | grid_out | Output grid |
[in] | mi | Skip number between input grid fields if km>1 or dimension of input grid fields if km=1. |
[out] | 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 some ibi(k)=1). |
[in] | gi | Input fields to interpolate. |
[in,out] | no | Number of output points (only if igdtnumo<0). |
[in,out] | rlat | Output latitudes in degrees (if igdtnumo<0). |
[in,out] | rlon | Output longitudes in degrees (if igdtnumo<0). |
[out] | ibo | Output bitmap flags. |
[out] | lo | Output bitmaps (always output). |
[out] | go | Output fields interpolated. |
[out] | iret | Return code.
|
Definition at line 94 of file budget_interp_mod.F90.
|
private |
This subprogram performs budget interpolation from any grid to any grid (or to random station points) for vector fields.
The algorithm simply computes (weighted) averages of bilinearly interpolated 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).
A special interpolation is done if ipopt(2)=-2. in this case, the boxes stretch nearly all the way to each of the neighboring grid points and the weights are the adjoint of the bilinear interpolation weights. This case gives quasi-second-order budget interpolation.
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).
In cases where there is no or insufficient valid input data, the user may choose to search for the nearest valid data. this is invoked by setting ipopt(20) to the width of the search square. The default is 1 (no search). Squares are searched for valid data in a spiral pattern starting from the center. No searching is done where the output grid is outside the input grid.
Only horizontal interpolation is performed.
[in] | ipopt | interpolation options ipopt(1) Number of radius points (defaults to 2 if ipopt(1)=-1); ipopt(2:2+ipopt(1)) Respective weights (defaults to all 1 if ipopt(1)=-1 or ipopt(2)=-1). ipopt(3+ipopt(1)) Minimum percentage for mask (defaults to 50 if ipopt(3+ipopt(1)=-1) |
[in] | grid_in | Input grid. |
[in] | grid_out | Output grid. |
[in] | mi | skip Number between input grid fields if km>1 or dimension of input grid fields if km=1. |
[out] | 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 some ibi(k)=1). |
[in] | ui | Input u-component fields to interpolate. |
[in] | vi | Input v-component fields to interpolate. |
[in,out] | no | Number of output points (only if igdtnumo<0) |
[in,out] | rlat | Output latitudes in degrees (if igdtnumo<0) |
[in,out] | rlon | Output longitudes in degrees (if igdtnumo<0) |
[in,out] | crot | Vector rotation cosines. If interpolating subgrid ugrid=crot * uearth - srot * vearth. |
[in,out] | srot | Vector rotation sines. If interpolating subgrid vgrid = srot * uearth + crot * vearth. |
[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 423 of file budget_interp_mod.F90.