next up previous contents
Next: domain_init Up: Routine/Function Prologues Previous: get_clmlevel_gsmap   Contents

Fortran: Module Interface domainMod (Source File: domainMod.F90)

Module containing 2-d global surface boundary data information


USES:

   use shr_kind_mod, only : r8 => shr_kind_r8
   use nanMod
   use spmdMod     , only : masterproc
   use abortutils  , only : endrun
   use clm_varctl  , only : iulog
PUBLIC TYPES:
   implicit none
   private
   public :: domain_type
   public :: latlon_type
 
   !--- this typically contains local domain info with arrays dim begg:endg ---
   type domain_type
      integer          :: ns         ! global size of domain
      integer          :: ni,nj      ! global axis if 2d (nj=1 if unstructured)
      integer          :: nbeg,nend  ! local beg/end indices
      character(len=8) :: clmlevel   ! grid type
      logical          :: decomped   ! decomposed locally or global copy
      logical          :: regional   ! regional or global grid
      logical          :: areaset    ! has area been set
      integer ,pointer :: mask(:)    ! land mask: 1 = land, 0 = ocean
      real(r8),pointer :: frac(:)    ! fractional land
      real(r8),pointer :: topo(:)    ! topography
      real(r8),pointer :: latc(:)    ! latitude of grid cell (deg)
      real(r8),pointer :: lonc(:)    ! longitude of grid cell (deg)
      real(r8),pointer :: area(:)    ! grid cell area (km**2)
      real(r8),pointer :: asca(:)    ! area scaling from CESM driver
      character*16     :: set        ! flag to check if domain is set
      integer ,pointer :: glcmask(:) ! glc mask: 1=sfc mass balance required by GLC component
                                     !           0=SMB not required (default)
      !--- following are valid only for land domain ---
      integer ,pointer :: pftm(:)    ! pft mask: 1=real, 0=fake, -1=notset
      real(r8),pointer :: nara(:)    ! normalized area in upscaling (km**2),
      real(r8),pointer :: ntop(:)    ! normalized topo for downscaling (m)
   end type domain_type
 
   !--- this contains global info about a grid, lats and lons are 1d
   !--- global arrays of size ni or nj which assume regular lat/lon grids only
   type latlon_type
      integer          :: ns         ! global size of domain
      integer          :: ni,nj      ! global axis if 2d (nj=1 if unstructured)
      character*16     :: set        ! flag to check if domain is set
      logical          :: regional   ! regional or global grid
      real(r8)         :: edges(4)   ! global edges (N,E,S,W)
      real(r8),pointer :: latc(:)    ! latitude of 1d grid cell (deg)
      real(r8),pointer :: lonc(:)    ! longitude of 1d grid cell (deg)
      real(r8),pointer :: lats(:)    ! latitude of 1d south grid cell edge (deg)
      real(r8),pointer :: latn(:)    ! latitude of 1d north grid cell edge (deg)
      real(r8),pointer :: lonw(:)    ! longitude of 1d west grid cell edge (deg)
      real(r8),pointer :: lone(:)    ! longitude of 1d east grid cell edge (deg)
   end type latlon_type
 
   type(domain_type),public    :: adomain
   type(domain_type),public    :: ldomain
 
   type(latlon_type),public    :: alatlon
   type(latlon_type),public    :: llatlon
 
   integer ,pointer,public     :: gatm(:)   ! gatm pulled out of domain
   integer ,pointer,public     :: amask(:)  ! global atm mask
   integer, pointer,public     :: pftm(:)   ! pft mask for lnd grid
PUBLIC MEMBER FUNCTIONS:
   public domain_init          ! allocates/nans domain types
   public domain_clean         ! deallocates domain types
   public domain_setptrs       ! sets external pointer arrays into domain
   public domain_check         ! write out domain info
   public latlon_init          ! allocates/nans domain types
   public latlon_check         ! write out domain info
   public latlon_clean         ! deallocate domain info
   public latlon_setsame          ! copy one domain to another
REVISION HISTORY:
   Originally clm_varsur by Mariana Vertenstein
   Migrated from clm_varsur to domainMod by T Craig
   character*16,parameter :: set   = 'domain_set      '
   character*16,parameter :: unset = 'NOdomain_unsetNO'



Subsections

Erik Kluzek 2011-06-15