NCEPLIBS-ip  5.0.0
bilinear_interp_mod Module Reference

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

Data Types

interface  interpolate_bilinear
 

Functions/Subroutines

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

Detailed Description

Bilinear interpolation routines for scalars and vectors.

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

Function/Subroutine Documentation

◆ interpolate_bilinear_scalar()

subroutine bilinear_interp_mod::interpolate_bilinear_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 bilinear interpolation from any grid to any grid for scalar fields.

Options allow varying the minimum percentage for mask, i.e. percent valid input data required to make output data, (ipopt(1)) which defaults to 50 (if ipopt(1)=-1). only horizontal interpolation is performed. if no input data is found near the output point, a spiral search may be invoked by setting ipopt(2)> 0. no searching is done if output point is outside the input grid. 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. 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.

Parameters
[in]ipoptinterpolation options
  • ipopt(1) is minimum percentage for mask (defaults to 50 if ipopt(1)=-1)
  • ipopt(2) is width of square to examine in spiral search (defaults to no search 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 72 of file bilinear_interp_mod.F90.

◆ interpolate_bilinear_vector()

subroutine bilinear_interp_mod::interpolate_bilinear_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 bilinear interpolation from any grid to any grid for vector fields.

Options allow varying the minimum percentage for mask, i.e. percent valid input data required to make output data, (ipopt(1)) which defaults to 50 (if ipopt(1)=-1).

Only horizontal interpolation is performed. 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. on the other hand, the data may be interpolated to a set of station points if igdtnumo < 0, in which case the number of points and their latitudes and longitudes must be input 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.

Parameters
[in]ipoptinterpolation options
  • ipopt(1) is minimum percentage for mask (defaults to 50 if ipopt(1)=-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 329 of file bilinear_interp_mod.F90.