next up previous contents
Next: areaovr_point Up: Fortran: Module Interface areaMod Previous: areaini_point   Contents

areamap_point


INTERFACE:

   subroutine areamap_point (io     , jo       , nlon_i  , nlat_i , nlon_o , &
                             nlat_o , numlon_i , lon_i   , lat_i  , mask_i , &
                             lon_o  , lat_o    , fland_o , area_o , n_ovr  , &
                             i_ovr  , j_ovr    , w_ovr   , lon_i_offset)
DESCRIPTION:

   weights and indices for area of overlap between grids
   Get indices and weights for area-averaging between input and output grids.
   For each output grid cell find:
      o number of input grid cells that overlap with output grid cell (n_ovr)
      o longitude index (1 <= i_ovr <= nlon_i) of the overlapping input grid cell
      o latitude index  (1 <= j_ovr <= nlat_i) of the overlapping input grid cell
      o fractional overlap of input grid cell (w_ovr)
   so that for
   field values fld_i on an  input grid with dimensions nlon_i and nlat_i
   field values fld_o on an output grid with dimensions nlon_o and nlat_o are
   fld_o(io,jo) = 
   fld_i(i_ovr(io,jo,     1),j_ovr(io,jo,     1)) * w_ovr(io,jo,     1) +
                               ... + ... +
   fld_i(i_ovr(io,jo,maxovr),j_ovr(io,jo,maxovr)) * w_ovr(io,jo,maxovr) 
   Note: maxovr is some number greater than n_ovr. Weights of zero are 
   used for the excess points
ARGUMENTS:
     implicit none
     integer ,intent(in)   :: io                     !output grid longitude index  
     integer ,intent(in)   :: jo                     !output grid latitude index 
     integer ,intent(in)   :: nlon_i                 !input grid : max number of long points
     integer ,intent(in)   :: nlat_i                 !input grid : number of latitude points
     integer ,intent(in)   :: nlon_o                 !output grid: max number of long points
     integer ,intent(in)   :: nlat_o                 !output grid: number of latitude points
     integer ,intent(in)   :: numlon_i(nlat_i)       !input grid : number long points for lat
     real(r8),intent(in)   :: lon_i(nlon_i+1,nlat_i) !input grid : cell lons, west edge (deg)
     real(r8),intent(in)   :: lon_i_offset(nlon_i+1,nlat_i) !input grid : cell lons, west edge (deg)
     real(r8),intent(in)   :: lat_i(nlat_i+1)        !input grid : cell lats, south edge (deg)
     real(r8),intent(in)   :: mask_i(nlon_i,nlat_i)  !input grid : mask (0, 1) 
     real(r8),intent(in)   :: lon_o(nlon_o+1,nlat_o) !output grid: cell lons, west edge  (deg)
     real(r8),intent(in)   :: lat_o(nlat_o+1)        !output grid: cell lats, south edge (deg)
     real(r8),intent(in)   :: fland_o                !output grid: fraction that is land
     real(r8),intent(in)   :: area_o                 !output grid: cell area
     integer ,intent(out)  :: n_ovr                  !number of overlapping input cells
     integer ,intent(out)  :: i_ovr(maxovr)          !lon index, overlapping input cell
     integer ,intent(out)  :: j_ovr(maxovr)          !lat index, overlapping input cell
     real(r8),intent(out)  :: w_ovr(maxovr)          !overlap weights for input cells
REVISION HISTORY:
   Created by Gordon Bonan



Mariana Vertenstein 2003-01-14