CBARNES1() and CBARNESN()

Fortran version:

    SUBROUTINE CBARNES1( NG, LAT, LON,
 &                      NP, YLAT, XLON, Z, WL50, GRID )

    SUBROUTINE CBARNESN( NG, LAT, LON,
 &                      NP, NV, YLAT, XLON, ZN, WL50, GRIDN )

        INTEGER, INTENT(IN   ) :: NG               !  Number of output values (=NCOLS*NROWS)
        REAL   , INTENT(IN   ) :: LAT( NG )        !  single-indexed output latitudes
        REAL   , INTENT(IN   ) :: LON( NG )        !  single-indexed output longitudes
        INTEGER, INTENT(IN   ) :: NP               !  number of input sources
        INTEGER, INTENT(IN   ) :: NV               !  number of input variables
        REAL   , INTENT(IN   ) :: YLAT( NP )       !  input latitudes
        REAL   , INTENT(IN   ) :: XLON( NP )       !  input longitudes
        REAL   , INTENT(IN   ) :: Z   ( NP )       !  input values
        REAL   , INTENT(IN   ) :: ZN  ( NP, NV )   !  input values
        REAL   , INTENT(IN   ) :: WL50             !  50 Percent filtered wavelength  (KM)
        REAL   , INTENT(  OUT) :: GRID(  NG )      !  output values
        REAL   , INTENT(  OUT) :: GRIDN( NG, NV )  !  output values
 

C version:

There isn't one; however, you can usually call these routines from C if you do it right (all arguments pass by reference; the C caller will see the subroutine as "void cbarnes1_" (etc.) under most UNIX systems, "void cbarnes1" for IBM AIX or HP HP-UX, or "void CBARNES1" for Crays.)

Summary:

CBARNES1() grids one variable Z and CBARNESN() grids an array of variables ZN, from locations with lat-lon coordinates <YLAT(1...NP),XLON(1...NP)> and produce output array GRID(1...NG) or GRIDN(1...NG,1...NV) at the locations <LAT(1...NG),LON(1...NG)>. For gridding purposes, NG should be NCOLS*NROWS; the CBARNES routines will regard the corresponding output array as single indexed in the first subscript.

These routines are an extension of a spatial analysis technique with scale dependent filtering that was originally proposed by Stanly Barnes in 1964 and was expanded in 1973. The scale dependent response function of the filtering effect is analytically calculable and can be adjusted by the choice of two parameters in the Gaussian weighting function used.

Input data point locations should be specified in latitude and longitude degrees. The separation distances between these data points and the grid points where the estimates are made is calculated from a function that is determined by spherical geometry under the assumption of a spherical Earth.

These routines were modified by Carlie Coats from routines originally produced for the EPA Regional Oxidant Model and adapted also for UAM BEIS. They use "exact" spherical-geometry distance formulas instead of the "flat-earth" approximations used earlier, as well as correct calculation of residuals instead of the earlier incomplete linear-interpolation approximation of the residuals.

Note that there are not explicit MODULE M3UTILIO INTERFACEs for these routines, because of the single-indexing frequently employed by their callers.

Fortran Usage:

!! Under construction !!
Previous: C/Fortran String Conversion

Next: DSCGRID

Up: Coordinate and Grid Related Routines

Up: Utility Routines

To: Models-3/EDSS I/O API: The Help Pages