POLATEV1

The POLATEV1 routine performs bicubic interpolation
             from any grid to any grid for scalar fields.
             Bitmaps are now allowed, but bilinear interpolation is done
             when any invalid data is within the bicubic template.
             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 4 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 grids are defined by their grid description sections
             (passed in integer form as decoded by subprogram w3fi63).

             The current code recognizes the following projections:
                (KGDS(1)=000) EQUIDISTANT CYLINDRICAL
                (KGDS(1)=001) MERCATOR CYLINDRICAL
                (KGDS(1)=003) LAMBERT CONFORMAL CONICAL
                (KGDS(1)=004) GAUSSIAN CYLINDRICAL (SPECTRAL NATIVE)
                (KGDS(1)=005) POLAR STEREOGRAPHIC AZIMUTHAL
                (KGDS(1)=202) ROTATED EQUIDISTANT CYLINDRICAL (ETA NATIVE)

             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.
             Along with their vector rotation parameters.
             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
             along with their vector rotation parameters.
             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.

USAGE:    CALL POLATEV1(IPOPT,KGDSI,KGDSO,MI,MO,KM,IBI,LI,UI,VI,
                        NO,RLAT,RLON,CROT,SROT,IBO,LO,UO,VO,IRET)

   Input argument list:
      IPOPT    - INTEGER (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)
      KGDSI    - INTEGER (200) INPUT GDS PARAMETERS AS DECODED BY W3FI63
      KGDSO    - INTEGER (200) OUTPUT GDS PARAMETERS
                 (KGDSO(1)<0 IMPLIES RANDOM STATION POINTS)
      MI       - INTEGER SKIP NUMBER BETWEEN INPUT GRID FIELDS IF KM>1
                 OR DIMENSION OF INPUT GRID FIELDS IF KM=1
      MO       - INTEGER SKIP NUMBER BETWEEN OUTPUT GRID FIELDS IF KM>1
                 OR DIMENSION OF OUTPUT GRID FIELDS IF KM=1
      KM       - INTEGER NUMBER OF FIELDS TO INTERPOLATE
      IBI      - INTEGER (KM) INPUT BITMAP FLAGS
      LI       - LOGICAL*1 (MI,KM) INPUT BITMAPS (IF SOME IBI(K)=1)
      UI       - REAL (MI,KM) INPUT U-COMPONENT FIELDS TO INTERPOLATE
      VI       - REAL (MI,KM) INPUT V-COMPONENT FIELDS TO INTERPOLATE
      NO       - INTEGER NUMBER OF OUTPUT POINTS (ONLY IF KGDSO(1)<0)
      RLAT     - REAL (NO) OUTPUT LATITUDES IN DEGREES (IF KGDSO(1)<0)
      RLON     - REAL (NO) OUTPUT LONGITUDES IN DEGREES (IF KGDSO(1)<0)
      CROT     - REAL (NO) VECTOR ROTATION COSINES (IF KGDSO(1)<0)
      SROT     - REAL (NO) VECTOR ROTATION SINES (IF KGDSO(1)<0)
                 (UGRID=CROT*UEARTH-SROT*VEARTH;
                  VGRID=SROT*UEARTH+CROT*VEARTH)
 
   Output argument list:
      NO       - INTEGER NUMBER OF OUTPUT POINTS (ONLY IF KGDSO(1)>=0)
      RLAT     - REAL (MO) OUTPUT LATITUDES IN DEGREES (IF KGDSO(1)>=0)
      RLON     - REAL (MO) OUTPUT LONGITUDES IN DEGREES (IF KGDSO(1)>=0)
      CROT     - REAL (NO) VECTOR ROTATION COSINES (IF KGDSO(1)>=0)
      SROT     - REAL (NO) VECTOR ROTATION SINES (IF KGDSO(1)>=0)
                 (UGRID=CROT*UEARTH-SROT*VEARTH;
                  VGRID=SROT*UEARTH+CROT*VEARTH)
      IBO      - INTEGER (KM) OUTPUT BITMAP FLAGS
      LO       - LOGICAL*1 (MO,KM) OUTPUT BITMAPS (ALWAYS OUTPUT)
      UO       - REAL (MO,KM) OUTPUT U-COMPONENT FIELDS INTERPOLATED
      VO       - REAL (MO,KM) OUTPUT V-COMPONENT FIELDS INTERPOLATED
      IRET     - INTEGER RETURN CODE
                 0    SUCCESSFUL INTERPOLATION
                 2    UNRECOGNIZED INPUT GRID OR NO GRID OVERLAP
                 3    UNRECOGNIZED OUTPUT GRID
 
 
iplib.tar Library contains subroutines to be used for interpolating almost any grids used at NCEP. (Fortran90)
Date posted: 2/22/2007