Skip to content

Commit

Permalink
Change the orange to points partition OASIS decomposition (#1361)
Browse files Browse the repository at this point in the history
  • Loading branch information
ukmo-juan-castillo authored Feb 12, 2025
1 parent de282b4 commit 2178a7b
Showing 1 changed file with 14 additions and 29 deletions.
43 changes: 14 additions & 29 deletions model/src/w3oacpmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ SUBROUTINE CPL_OASIS_DEFINE(NDSO,RCV_STR,SND_STR)
!/ (R. Baraille & J. Pianezze)
!/ April-2016 : Add comments (J. Pianezze) ( version 5.07 )
!/ 08-Jun-2018 : use INIT_GET_ISEA ( version 6.04 )
!/ Feb-2025 : OASIS points partition (J.M. Castillo) ( version X.XX )
!/
! 1. Purpose :
!
Expand Down Expand Up @@ -419,58 +420,41 @@ SUBROUTINE CPL_OASIS_DEFINE(NDSO,RCV_STR,SND_STR)
!/ ------------------------------------------------------------------- /
!/ Local parameters
!/
INTEGER :: IB_I,I
INTEGER :: IB_I
INTEGER :: IL_PART_ID ! PartitionID
INTEGER, ALLOCATABLE, DIMENSION(:) :: ILA_PARAL ! Description of the local partition in the global index space
INTEGER, DIMENSION(4) :: ILA_SHAPE ! Vector giving the min & max index for each dim of the fields
INTEGER, DIMENSION(2) :: ILA_VAR_NODIMS ! rank of fields & number of bundles (1 with OASIS3-MCT)
INTEGER :: ISEA, JSEA, IX, IY
INTEGER :: NHXW, NHXE, NHYS, NHYN ! size of the halo at the western, eastern, southern, northern boundaries
LOGICAL :: LL_MPI_FILE ! to check if there an mpi.txt file for domain decompasition
!/
!/ ------------------------------------------------------------------- /
!/ Executable part
!/
!
ALLOCATE(ILA_PARAL(2+NSEAL))
!
! * Define the partition : OASIS POINTS partition
ILA_PARAL(1) = 4
!
! * total number of segments of the global domain
ILA_PARAL(2) = NSEAL
!
IF (GTYPE .EQ. RLGTYPE .OR. GTYPE .EQ. CLGTYPE) THEN
!
! 1.1. regular and curvilinear grids
! ----------------------------------
NHXW = 1 ; NHXE = NX ; NHYS = 1 ; NHYN = NY
NHXW = NHXW - 1
NHXE = NX - NHXE
NHYS = NHYS - 1
NHYN = NY - NHYN
!
ALLOCATE(ILA_PARAL(2+NSEAL*2))
!
! * Define the partition : OASIS ORANGE partition
ILA_PARAL(1) = 3
!
! * total number of segments of the global domain
ILA_PARAL(2) = NSEAL
!
DO JSEA=1, NSEAL
CALL INIT_GET_ISEA(ISEA,JSEA)

IX = MAPSF(ISEA,1)
IY = MAPSF(ISEA,2)
ILA_PARAL(JSEA*2+1) = (IY - NHYN -1)*(NX - NHXE - NHXW) + (IX - NHXW - 1)
ILA_PARAL(JSEA*2+2) = 1
ILA_PARAL(JSEA+2) = (IY - 1)*NX + IX
END DO
#ifdef W3_SMC
ELSE IF( GTYPE .EQ. SMCTYPE ) THEN
!
! 1.2. SMC grids
! ----------------------------------
ALLOCATE(ILA_PARAL(2+NSEAL))
!
! * Define the partition : OASIS POINTS partition
ILA_PARAL(1) = 4
!
! * total number of segments of the global domain
ILA_PARAL(2) = NSEAL
!
DO JSEA=1, NSEAL
ILA_PARAL(JSEA+2) = IAPROC + (JSEA-1)*NAPROC
ENDDO
Expand All @@ -484,8 +468,7 @@ SUBROUTINE CPL_OASIS_DEFINE(NDSO,RCV_STR,SND_STR)
STOP
!
DO JSEA=1,NSEAL
ILA_PARAL(JSEA*2+1) = (IAPROC-1) + (JSEA-1)*NAPROC
ILA_PARAL(JSEA*2+2) = 1
ILA_PARAL(JSEA+2) = IAPROC + (JSEA-1)*NAPROC
END DO
!
ENDIF
Expand All @@ -497,6 +480,8 @@ SUBROUTINE CPL_OASIS_DEFINE(NDSO,RCV_STR,SND_STR)
CALL OASIS_ABORT(IL_COMPID, 'CPL_OASIS_DEFINE', 'Problem during oasis_def_partition')
ENDIF
!
DEALLOCATE(ILA_PARAL)
!
! 3. Coupling fields declaration
! ----------------------------------
ILA_SHAPE(:) = (/1, NSEAL, 1, 1 /)
Expand Down

0 comments on commit 2178a7b

Please sign in to comment.