source: CONFIG_DEVT/IPSLCM6.5_work_ENSEMBLES/oasis3-mct/examples/toy_configuration_components_C/def_parallel_decomposition.F90 @ 5725

Last change on this file since 5725 was 5725, checked in by aclsce, 3 years ago

Added new oasis3-MCT version to be used to handle ensembles simulations with XIOS.

File size: 1.5 KB
Line 
1module def_parallel_decomposition
2!
3! The global grid is split in npes rectangle partitions with local extent in x = global extent
4!
5contains
6   SUBROUTINE def_local_partition (nlon, nlat, npes, mype, &
7                         il_extentx, il_extenty, il_size, il_offsetx, il_offsety, il_offset)
8  IMPLICIT NONE
9  INTEGER, INTENT(in)  :: nlon, nlat, npes, mype
10  INTEGER, INTENT(out) :: il_extentx, il_extenty, il_size, il_offsetx, il_offsety, il_offset
11  !
12  il_extentx = nlon
13  il_extenty = nlat/npes ; IF (mype == npes-1)  il_extenty = nlat - (nlat/npes * mype)
14  il_size = il_extentx * il_extenty
15  il_offsetx = 0
16  il_offsety = (nlat/npes * mype)
17  il_offset = nlon * il_offsety
18  !
19END SUBROUTINE def_local_partition
20!
21SUBROUTINE def_paral_size (il_paral_size)
22  IMPLICIT NONE
23  INTEGER, INTENT(out) :: il_paral_size 
24#ifdef DECOMP_APPLE
25  il_paral_size = 3
26#elif defined DECOMP_BOX
27  il_paral_size = 5
28#endif
29  !
30END SUBROUTINE def_paral_size
31!
32SUBROUTINE def_paral(il_offset, il_size, il_extentx, il_extenty, nlon, il_paral_size, il_paral)
33  IMPLICIT NONE
34  INTEGER, INTENT(IN) :: il_offset, il_size, il_extentx, il_extenty, nlon, il_paral_size
35  INTEGER, INTENT(OUT) :: il_paral(il_paral_size) 
36#ifdef DECOMP_APPLE
37  il_paral(1) = 1
38  il_paral(2) = il_offset
39  il_paral(3) = il_size
40#elif defined DECOMP_BOX
41  il_paral(1) = 2
42  il_paral(2) = il_offset
43  il_paral(3) = il_extentx
44  il_paral(4) = il_extenty
45  il_paral(5) = nlon
46#endif
47  !
48END SUBROUTINE def_paral
49!
50end module def_parallel_decomposition 
Note: See TracBrowser for help on using the repository browser.