Area averaging routines These routines are used for area-average mapping of a field from one grid to another for the purposes of downscaling and using the fine mesh grid
USES:
use clm_varpar , only : numrad use clm_varctl , only : iulog use domainMod , only : domain_type, domain_setptrs, latlon_type use shr_const_mod, only : SHR_CONST_PI use shr_kind_mod , only : r8 => shr_kind_r8 use spmdMod , only : iam,masterproc use abortutils , only : endrun use nanModPUBLIC TYPES:
implicit none private type map_type private ! lower level in hierarchy character(len=32) :: name character(len=16) :: type ! global, dst, src, etc integer :: ni_i,nj_i ! size of src grid ni,nj integer :: ni_o,nj_o ! size of dst grid ni,nj integer :: nwts ! size of row, col, S (local) integer , pointer :: src(:) ! src index (COL) integer , pointer :: dst(:) ! dst index (ROW) real(r8), pointer :: S(:) ! wt of overlap input cell integer :: dstmo ! max num of overlaps of dst cell end type map_type public map_type type(map_type),public :: map1dl_a2l ! a2l mapping 1d loc glo to gdc type(map_type),public :: map1dl_l2a ! l2a mapping 1d loc gdc to glo character(len=16),parameter,public :: map_typelocal = 'local' character(len=16),parameter,public :: map_typeglobal = 'global'PUBLIC MEMBER FUNCTIONS:
public :: map_init public :: map_setptrs public :: map_setmapsFM public :: map_setgatmFM public :: map_maparrayl public :: map_maparrayg interface map_maparrayl module procedure map_maparrayl_arr module procedure map_maparrayl_rev module procedure map_maparrayl_av end interfaceREVISION HISTORY:
Created by Sam Levis Updated to clm2.1 data structures by Mariana Vertenstein 2005.11.01 Updated and cleaned by T CraigPRIVATE MEMBER FUNCTIONS: