From 7742889d83966ac24db5cec86a8a4dbacd0d1792 Mon Sep 17 00:00:00 2001 From: Sam Hatfield Date: Mon, 17 Jun 2024 14:25:41 +0000 Subject: [PATCH] Handle KOPT_MEMORY_TR option for gpu/SETUP_TRANS0 --- src/trans/gpu/external/setup_trans0.F90 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/trans/gpu/external/setup_trans0.F90 b/src/trans/gpu/external/setup_trans0.F90 index 87e55c7f8..6fd40bbd7 100755 --- a/src/trans/gpu/external/setup_trans0.F90 +++ b/src/trans/gpu/external/setup_trans0.F90 @@ -12,7 +12,7 @@ SUBROUTINE SETUP_TRANS0(KOUT,KERR,KPRINTLEV,KMAX_RESOL,KPROMATR,& & KPRGPNS,KPRGPEW,KPRTRW,KCOMBFLEN,& & LDMPOFF,LDSYNC_TRANS,KTRANS_SYNC_LEVEL,& & LDEQ_REGIONS,K_REGIONS_NS,K_REGIONS_EW,K_REGIONS,& -& PRAD,LDALLOPERM) +& PRAD,LDALLOPERM,KOPT_MEMORY_TR) !**** *SETUP_TRANS0* - General setup routine for transform package @@ -44,6 +44,8 @@ SUBROUTINE SETUP_TRANS0(KOUT,KERR,KPRINTLEV,KMAX_RESOL,KPROMATR,& ! K_REGIONS_EW - Maximum number of EW partitions ! PRAD - Radius of the planet ! LDALLOPERM - Allocate certain arrays permanently +! KOPT_MEMORY_TR - memory strategy (stack vs heap) in gripoint transpositions + ! The total number of (MPI)-processors has to be equal to KPRGPNS*KPRGPEW ! Method. @@ -62,6 +64,7 @@ SUBROUTINE SETUP_TRANS0(KOUT,KERR,KPRINTLEV,KMAX_RESOL,KPROMATR,& ! R. El Khatib 03-01-24 LDMPOFF ! G. Mozdzynski 2006-09-13 LDEQ_REGIONS ! N. Wedi 2009-11-30 add radius +! R. El Khatib 09-Sep-2020 NSTACK_MEMORY_TR ! ------------------------------------------------------------------ @@ -96,6 +99,7 @@ SUBROUTINE SETUP_TRANS0(KOUT,KERR,KPRINTLEV,KMAX_RESOL,KPROMATR,& LOGICAL ,OPTIONAL,INTENT(IN) :: LDEQ_REGIONS LOGICAL ,OPTIONAL,INTENT(IN) :: LDALLOPERM REAL(KIND=JPRD) ,OPTIONAL,INTENT(IN) :: PRAD +INTEGER(KIND=JPIM) ,OPTIONAL,INTENT(IN) :: KOPT_MEMORY_TR INTEGER(KIND=JPIM) ,OPTIONAL,INTENT(OUT) :: K_REGIONS(:) INTEGER(KIND=JPIM) ,OPTIONAL,INTENT(OUT) :: K_REGIONS_NS INTEGER(KIND=JPIM) ,OPTIONAL,INTENT(OUT) :: K_REGIONS_EW @@ -249,6 +253,13 @@ SUBROUTINE SETUP_TRANS0(KOUT,KERR,KPRINTLEV,KMAX_RESOL,KPROMATR,& IF(PRESENT(LDEQ_REGIONS)) THEN LEQ_REGIONS = LDEQ_REGIONS ENDIF +IF(PRESENT(KOPT_MEMORY_TR)) THEN + WRITE(NOUT,'(A)') + WRITE(NOUT,'(A)') '*** WARNING ***' + WRITE(NOUT,'(A)') 'KOPT_MEMORY_TR argument passed to SETUP_TRANS0 will be ignored' + WRITE(NOUT,'(A)') 'This option only applies to the CPU version of ecTrans' + WRITE(NOUT,'(A)') +ENDIF ! Initial setup CALL SUMP_TRANS0