PUBLIC INTERFACE ~ PUBLIC DATA ~ PUBLIC ROUTINES ~ NAMELIST ~ DIAGNOSTIC FIELDS ~ ERROR MESSAGES ~ REFERENCES ~ NOTES

## Module horiz_interp_spherical_mod

Contact: Matthew Harrison , Zhi Liang
Reviewers:
Change History: WebCVS Log

#### OVERVIEW

Performs spatial interpolation between grids using inverse-distance-weighted scheme.

This module can interpolate data from rectangular/tripolar grid to rectangular/tripolar grid. The interpolation scheme is inverse-distance-weighted scheme. There is an optional mask field for missing input data. An optional output mask field may be used in conjunction with the input mask to show where output data exists.

#### OTHER MODULES USED

                  mpp_mod
                  fms_mod
            constants_mod
    horiz_interp_type_mod

#### PUBLIC INTERFACE

horiz_interp_spherical_init:
  Initialization routine.
horiz_interp_spherical:
  Subroutine for performing the horizontal interpolation between two grids.
horiz_interp_spherical_end:
  Deallocates memory used by "horiz_interp_type" variables. Must be called before reinitializing with horiz_interp_init.

#### PUBLIC DATA

None.

#### PUBLIC ROUTINES

1. #### horiz_interp_spherical_init

       call horiz_interp_spherical_init (Interp, lon_in,lat_in,lon_out,lat_out, num_nbrs, max_dist, src_modulo)

   DESCRIPTION
     Allocates space and initializes a derived-type variable that contains pre-computed interpolation indices and weights.
   INPUT

     `lon_in` | Longitude (in radians) for source data grid. [real, dimension(:,:)]
     `lat_in` | Latitude (in radians) for source data grid. [real, dimension(:,:)]
     `lon_out` | Longitude (in radians) for source data grid. [real, dimension(:,:)]
     `lat_out` | Latitude (in radians) for source data grid. [real, dimension(:,:)]
     `num_nbrs` | Number of nearest neighbors for regridding. When number of neighbors within the radius max_dist ( namelist variable) is less than num_nbrs, All the neighbors will be used to interpolate onto destination grid. when number of neighbors within the radius max_dist ( namelist variable) is greater than num_nbrs, at least "num_nbrs" neighbors will be used to remap onto destination grid. [integer, optional]
     `max_dist` | Maximum region of influence around destination grid points. [real, optional]
     `src_modulo` | logical variable to indicate if the boundary condition along zonal boundary is cyclic or not. When true, the zonal boundary condition is cyclic. [logical, optional]

   INPUT/OUTPUT

     `Interp` | A derived-type variable containing indices and weights used for subsequent interpolations. To reinitialize this variable for a different grid-to-grid interpolation you must first use the "horiz_interp_end" interface. [type(horiz_interp_type)]

2. #### horiz_interp_spherical

       call horiz_interp_spherical ( Interp, data_in, data_out, verbose, mask_in, mask_out, missing_value)

   DESCRIPTION
     Subroutine for performing the horizontal interpolation between two grids. horiz_interp_spherical_init must be called before calling this routine.
   INPUT

     `Interp` | Derived-type variable containing interpolation indices and weights. Returned by a previous call to horiz_interp_init. [type(horiz_interp_type)]
     `data_in` | Input data on source grid. [real, dimension(:,:)]
     `verbose` | flag for the amount of print output. verbose = 0, no output; = 1, min,max,means; = 2, still more [integer, optional]
     `mask_in` | Input mask, must be the same size as the input data. The real value of mask_in must be in the range (0.,1.). Set mask_in=0.0 for data points that should not be used or have missing data. [real, dimension(:,:),optional]
     `missing_value` | Use the missing_value to indicate missing data. [real, optional]

   OUTPUT

     `data_out` | Output data on destination grid. [real, dimension(:,:)]
     `mask_out` | Output mask that specifies whether data was computed. [real, dimension(:,:),optional]

3. #### horiz_interp_spherical_end

       call horiz_interp_spherical_end ( Interp )

   DESCRIPTION
     Deallocates memory used by "horiz_interp_type" variables. Must be called before reinitializing with horiz_interp_init.
   INPUT/OUTPUT

     `Interp` | A derived-type variable returned by previous call to horiz_interp_init. The input variable must have allocated arrays. The returned variable will contain deallocated arrays. [horiz_interp_type]

#### NAMELIST

&horiz_interp_spherical_nml

`search_method`

indicate the searching method to find the nearest neighbor points. Its value can be "radial_search" and "full_search", with default value "radial_search". when search_method is "radial_search", the search may be not quite accurate for some cases. Normally the search will be ok if you chose suitable max_dist. When search_method is "full_search", it will be always accurate, but will be slower comparing to "radial_search". Normally these two search algorithm will produce same results other than order of operation. "radial_search" are recommended to use. The purpose to add "full_search" is in case you think you interpolation results is not right, you have other option to verify.
[character(len=32)]

#### DATA SETS

None.

#### ERROR MESSAGES

None.

top