Next: Module atm_lndMod (File: atm_lndMod.F90) Up: Module areaMod (File: areaMod.F90) Previous: areaovr_point   Contents   Index

## mkmxovr

INTERFACE:

```   subroutine mkmxovr (nlon_i, nlat_i, numlon_i, lon_i, lat_i, &
nlon_o, nlat_o, numlon_o, lon_o, lat_o, &
mxovr , n_ovr  )
```
DESCRIPTION:

```   find maxinum numver of overlapping cells
For each output grid cell: find overlapping input grid cells that
that overlap with output grid cell. Cells overlap if:
southern edge of input grid < northern edge of output grid AND
northern edge of input grid > southern edge of output grid
western edge of input grid < eastern edge of output grid AND
eastern edge of input grid > western edge of output grid
lon_o(io,jo)      lon_o(io+1,jo)
|                   |
--------------------- lat_o(jo+1)
|                   |
|                   |
xxxxxxxxxxxxxxx lat_i(ji+1)   |
x         |   x               |
x  input  |   x   output      |
x  cell   |   x    cell       |
x  ii,ji  |   x   io,jo       |
x         |   x               |
x         ----x---------------- lat_o(jo  )
x             x
xxxxxxxxxxxxxxx lat_i(ji  )
x             x
lon_i(ii,ji) lon_i(ii+1,ji)
The above diagram assumes both grids are oriented South to North. Other
combinations of North to South and South to North grids are possible:
Input Grid    Output Grid
-------------------------
(1)   S to N        S to N
(2)   N to S        N to S
(3)   S to N        N to S
(4)   N to S        S to N
The code has been modified to allow for North to South grids. Verification
that these changes work are:
o (1) and (4) give same results for output grid
o (2) and (3) give same results for output grid
o (2) and (4) give same results for output grid when output grid inverte
```
ARGUMENTS:
```     implicit none
integer , intent(in) :: nlon_i                 !input grid : max number o
integer , intent(in) :: nlat_i                 !input grid : number of la
integer , intent(in) :: numlon_i(nlat_i)       !input grid : number of lo
real(r8), intent(inout) :: lon_i(nlon_i+1,nlat_i) !input grid : cell long
real(r8), intent(in) :: lat_i(nlat_i+1)        !input grid : cell latitud
integer , intent(in) :: nlon_o                 !output grid: max number o
integer , intent(in) :: nlat_o                 !output grid: number of la
integer , intent(in) :: numlon_o(nlat_o)       !output grid: number of lo
real(r8), intent(in) :: lon_o(nlon_o+1,nlat_o) !output grid: cell longitu
real(r8), intent(in) :: lat_o(nlat_o+1)        !output grid: cell latitud
integer , intent(out):: n_ovr(nlon_o,nlat_o)   !number of overlapping inp
integer , intent(out):: mxovr                  !maximum number of overlap
```
REVISION HISTORY:
```   Created by Mariana Vertenstein
```

Mariana Vertenstein 2004-06-21