NCEPLIBS-ip  5.0.0
bicubic_interp_mod Module Reference

Bicubic interpolation routines for scalars and vectors. More...

Data Types

interface  interpolate_bicubic
 

Functions/Subroutines

subroutine interpolate_bicubic_scalar (IPOPT, grid_in, grid_out, MI, MO, KM, IBI, LI, GI, NO, RLAT, RLON, IBO, LO, GO, IRET)
 This subprogram performs bicubic interpolation from any grid to any grid for scalar fields. More...
 
subroutine interpolate_bicubic_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 bicubic interpolation from any grid to any grid for vector fields. More...
 

Detailed Description

Bicubic interpolation routines for scalars and vectors.

Author
George Gayno, Mark Iredell, Kyle Gerheiser, Eric Engle

Function/Subroutine Documentation

◆ interpolate_bicubic_scalar()

subroutine bicubic_interp_mod::interpolate_bicubic_scalar ( integer, dimension(20), intent(in)  IPOPT,
class(ip_grid), intent(in)  grid_in,
class(ip_grid), intent(in)  grid_out,
integer, intent(in)  MI,
integer, intent(in)  MO,
integer, intent(in)  KM,
integer, dimension(km), intent(in)  IBI,
logical*1, dimension(mi,km), intent(in)  LI,
real, dimension(mi,km), intent(in)  GI,
integer, intent(inout)  NO,
real, dimension(mo), intent(inout)  RLAT,
real, dimension(mo), intent(inout)  RLON,
integer, dimension(km), intent(out)  IBO,
logical*1, dimension(mo,km), intent(out)  LO,
real, dimension(mo,km), intent(out)  GO,
integer, intent(out)  IRET 
)
private

This subprogram performs bicubic interpolation from any grid to any grid for scalar fields.

Bitmaps are now allowed even when invalid points are within the bicubic template provided the minimum weight is reached.

Options allow choices between straight bicubic (ipopt(1)=0) and constrained bicubic (ipopt(1)=1) where the value is confined within the range of the surrounding 16 points.

Another option is the minimum percentage for mask, i.e. percent valid input data required to make output data, (ipopt(2)) which defaults to 50 (if ipopt(2)=-1).

Bilinear used within one grid length of boundaries. Only horizontal interpolation is performed.

The code recognizes the following projections, where 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, 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. 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.

Parameters
[in]ipoptInterpolation options.
  • ipopt(1)=0 For straight bicubic;
  • ipopt(1)=1 For constrained bicubic where value is confined within the range of the surrounding 4 points.
  • ipopt(2) Is minimum percentage for mask (defaults to 50 if ipopt(2)=-1)
[in]grid_inInput grid.
[in]grid_outOutput grid.
[in]miSkip number between input grid fields if km>1 or dimension of input grid fields if km=1.
[out]moSkip number between output grid fields if km>1 or dimension of output grid fields if km=1.
[in]kmNumber of fields to interpolate.
[in]ibiInput bitmap flags.
[in]liInput bitmaps (if some ibi(k)=1).
[in]giInput fields to interpolate.
[in,out]noNumber of output points (only if igdtnumo<0).
[in,out]rlatOutput latitudes in degrees (if igdtnumo<0).
[in,out]rlonOutput longitudes in degrees (if igdtnumo<0).
[out]iboOutput bitmap flags.
[out]loOutput bitmaps (always output).
[out]goOutput fields interpolated.
[out]iretReturn code.
  • 0 successful interpolation,
  • 2 unrecognized input grid or no grid overlap
  • 3 unrecognized output grid
Author
George Gayno, Mark Iredell, Kyle Gerheiser, Eric Engle

Definition at line 80 of file bicubic_interp_mod.F90.

◆ interpolate_bicubic_vector()

subroutine bicubic_interp_mod::interpolate_bicubic_vector ( integer, dimension(20), intent(in)  ipopt,
class(ip_grid), intent(in)  grid_in,
class(ip_grid), intent(in)  grid_out,
integer, intent(in)  mi,
integer, intent(in)  mo,
integer, intent(in)  km,
integer, dimension(km), intent(in)  ibi,
logical*1, dimension(mi,km), intent(in)  li,
real, dimension(mi,km), intent(in)  ui,
real, dimension(mi,km), intent(in)  vi,
integer, intent(inout)  no,
real, dimension(mo), intent(inout)  rlat,
real, dimension(mo), intent(inout)  rlon,
real, dimension(mo), intent(inout)  crot,
real, dimension(mo), intent(inout)  srot,
integer, dimension(km), intent(out)  ibo,
logical*1, dimension(mo,km), intent(out)  lo,
real, dimension(mo,km), intent(out)  uo,
real, dimension(mo,km), intent(out)  vo,
integer, intent(out)  iret 
)
private

This subprogram performs bicubic interpolation from any grid to any grid for vector fields.

Bitmaps are now allowed even when invalid points are within the bicubic template provided the minimum weight is reached.

Options allow choices between straight bicubic (ipopt(1)=0) and constrained bicubic (ipopt(1)=1) where the value is confined within the range of the surrounding 16 points.

Another option is the minimum percentage for mask, i.e. percent valid input data required to make output data, (ipopt(2)) which defaults to 50 (if ipopt(2)=-1).

Bilinear used within one grid length of boundaries. Only horizontal interpolation is performed.

The code recognizes the following projections, where 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, 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.

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.

Parameters
[in]ipoptinteger (20) interpolation options
  • ipopt(1)=0 for straight bicubic;
  • ipopt(1)=1 for constrained bicubic where value is confined within the range of the surrounding 4 points.
  • ipopt(2) is minimum percentage for mask (defaults to 50 if ipopt(2)=-1)
[in]grid_inInput grid.
[in]grid_outOutput grid.
[in]miSkip number between input grid fields if km>1 or dimension of input grid fields if km=1.
[out]moSkip number between output grid fields if km>1 or dimension of output grid fields if km=1.
[in]kmNumber of fields to interpolate.
[in]ibiInput bitmap flags.
[in]liInput bitmaps (if some ibi(k)=1).
[in]uiInput u-component fields to interpolate.
[in]viInput v-component fields to interpolate.
[in,out]noNumber of output points (only if igdtnumo<0).
[in,out]rlatOutput latitudes in degrees (if igdtnumo<0).
[in,out]rlonOutput longitudes in degrees (if igdtnumo<0).
[in,out]crotVector rotation cosines (if igdtnumo<0) ugrid=crot*uearth-srot*vearth.
[in,out]srotVector rotation sines (if igdtnumo<0) vgrid=srot*uearth+crot*vearth).
[out]iboOutput bitmap flags.
[out]loOutput bitmaps (always output).
[out]uoOutput u-component fields interpolated.
[out]voOutput v-component fields interpolated.
[out]iretReturn code.
  • 0 successful interpolation
  • 2 unrecognized input grid or no grid overlap
  • 3 unrecognized output grid
Author
George Gayno, Mark Iredell, Kyle Gerheiser, Eric Engle

Definition at line 338 of file bicubic_interp_mod.F90.