source: CPL/oasis3-mct_5.0/examples/regrid_environment/src/def_parallel_decomposition.F90 @ 6328

Last change on this file since 6328 was 6328, checked in by aclsce, 17 months ago

First import of oasis3-mct_5.0 (from oasis git server, branch OASIS3-MCT_5.0)

File size: 1.2 KB
Line 
1module def_parallel_decomposition
2!
3! For LR grids, the global grid is split in npes rectangle partitions with local extent in x = global extent
4! For U or D grids, the first dimension is split in npes segments
5!
6contains
7   SUBROUTINE def_local_partition (nlon, nlat, npes, mype, cl_type_src, &
8                         il_extentx, il_extenty, il_size, il_offsetx, il_offsety, il_offset)
9  IMPLICIT NONE
10  INTEGER, INTENT(in)  :: nlon, nlat, npes, mype
11  CHARACTER(len=2), INTENT(in)   :: cl_type_src
12  INTEGER, INTENT(out) :: il_extentx, il_extenty, il_size, il_offsetx, il_offsety, il_offset
13  !
14  if (cl_type_src == 'LR') then
15     il_extentx = nlon
16     il_extenty = nlat/npes ; IF (mype == npes-1)  il_extenty = nlat - (nlat/npes * mype)
17     il_size = il_extentx * il_extenty
18     il_offsetx = 0
19     il_offsety = (nlat/npes * mype)
20     il_offset = nlon * il_offsety
21  else if (cl_type_src == 'U' .or. cl_type_src == 'D') then
22     il_extentx = nlon/npes ; IF (mype == npes-1)  il_extentx = nlon - (nlon/npes * mype)
23     il_extenty = nlat
24     il_size = il_extentx * il_extenty
25     il_offsetx = (nlon/npes * mype)
26     il_offsety = 0
27     il_offset = nlat * il_offsetx
28  endif
29  !
30END SUBROUTINE def_local_partition
31!
32end module def_parallel_decomposition 
Note: See TracBrowser for help on using the repository browser.