Skip to content

Commit

Permalink
Handle KOPT_MEMORY_TR option for gpu/SETUP_TRANS0
Browse files Browse the repository at this point in the history
  • Loading branch information
samhatfield committed Jun 17, 2024
1 parent 91624d0 commit 7742889
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/trans/gpu/external/setup_trans0.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.
Expand All @@ -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

! ------------------------------------------------------------------

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7742889

Please sign in to comment.