Skip to content

Commit e4653fd

Browse files
Change the OASIS decomposition for regular and curvilinear grids from
orange to points partition
1 parent d82913b commit e4653fd

File tree

1 file changed

+13
-29
lines changed

1 file changed

+13
-29
lines changed

model/src/w3oacpmd.F90

+13-29
Original file line numberDiff line numberDiff line change
@@ -427,58 +427,41 @@ SUBROUTINE CPL_OASIS_DEFINE(NDSO,RCV_STR,SND_STR)
427427
!/ ------------------------------------------------------------------- /
428428
!/ Local parameters
429429
!/
430-
INTEGER :: IB_I,I
430+
INTEGER :: IB_I
431431
INTEGER :: IL_PART_ID ! PartitionID
432432
INTEGER, ALLOCATABLE, DIMENSION(:) :: ILA_PARAL ! Description of the local partition in the global index space
433433
INTEGER, DIMENSION(4) :: ILA_SHAPE ! Vector giving the min & max index for each dim of the fields
434434
INTEGER, DIMENSION(2) :: ILA_VAR_NODIMS ! rank of fields & number of bundles (1 with OASIS3-MCT)
435435
INTEGER :: ISEA, JSEA, IX, IY
436-
INTEGER :: NHXW, NHXE, NHYS, NHYN ! size of the halo at the western, eastern, southern, northern boundaries
437-
LOGICAL :: LL_MPI_FILE ! to check if there an mpi.txt file for domain decompasition
438436
!/
439437
!/ ------------------------------------------------------------------- /
440438
!/ Executable part
441439
!/
442440
!
441+
ALLOCATE(ILA_PARAL(2+NSEAL))
442+
!
443+
! * Define the partition : OASIS POINTS partition
444+
ILA_PARAL(1) = 4
445+
!
446+
! * total number of segments of the global domain
447+
ILA_PARAL(2) = NSEAL
448+
!
443449
IF (GTYPE .EQ. RLGTYPE .OR. GTYPE .EQ. CLGTYPE) THEN
444450
!
445451
! 1.1. regular and curvilinear grids
446452
! ----------------------------------
447-
NHXW = 1 ; NHXE = NX ; NHYS = 1 ; NHYN = NY
448-
NHXW = NHXW - 1
449-
NHXE = NX - NHXE
450-
NHYS = NHYS - 1
451-
NHYN = NY - NHYN
452-
!
453-
ALLOCATE(ILA_PARAL(2+NSEAL*2))
454-
!
455-
! * Define the partition : OASIS ORANGE partition
456-
ILA_PARAL(1) = 3
457-
!
458-
! * total number of segments of the global domain
459-
ILA_PARAL(2) = NSEAL
460-
!
461453
DO JSEA=1, NSEAL
462454
CALL INIT_GET_ISEA(ISEA,JSEA)
463455

464456
IX = MAPSF(ISEA,1)
465457
IY = MAPSF(ISEA,2)
466-
ILA_PARAL(JSEA*2+1) = (IY - NHYN -1)*(NX - NHXE - NHXW) + (IX - NHXW - 1)
467-
ILA_PARAL(JSEA*2+2) = 1
458+
ILA_PARAL(JSEA+2) = (IY - 1)*NX + IX
468459
END DO
469460
#ifdef W3_SMC
470461
ELSE IF( GTYPE .EQ. SMCTYPE ) THEN
471462
!
472463
! 1.2. SMC grids
473464
! ----------------------------------
474-
ALLOCATE(ILA_PARAL(2+NSEAL))
475-
!
476-
! * Define the partition : OASIS POINTS partition
477-
ILA_PARAL(1) = 4
478-
!
479-
! * total number of segments of the global domain
480-
ILA_PARAL(2) = NSEAL
481-
!
482465
DO JSEA=1, NSEAL
483466
ILA_PARAL(JSEA+2) = IAPROC + (JSEA-1)*NAPROC
484467
ENDDO
@@ -492,8 +475,7 @@ SUBROUTINE CPL_OASIS_DEFINE(NDSO,RCV_STR,SND_STR)
492475
STOP
493476
!
494477
DO JSEA=1,NSEAL
495-
ILA_PARAL(JSEA*2+1) = (IAPROC-1) + (JSEA-1)*NAPROC
496-
ILA_PARAL(JSEA*2+2) = 1
478+
ILA_PARAL(JSEA+2) = IAPROC + (JSEA-1)*NAPROC
497479
END DO
498480
!
499481
ENDIF
@@ -505,6 +487,8 @@ SUBROUTINE CPL_OASIS_DEFINE(NDSO,RCV_STR,SND_STR)
505487
CALL OASIS_ABORT(IL_COMPID, 'CPL_OASIS_DEFINE', 'Problem during oasis_def_partition')
506488
ENDIF
507489
!
490+
DEALLOCATE(ILA_PARAL)
491+
!
508492
! 3. Coupling fields declaration
509493
! ----------------------------------
510494
ILA_SHAPE(:) = (/1, NSEAL, 1, 1 /)

0 commit comments

Comments
 (0)