-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from ecmwf-ifs/naan-promote-data-movement
Run all of `WAMINTGR` on GPU
- Loading branch information
Showing
16 changed files
with
406 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
! (C) Copyright 1989- ECMWF. | ||
! | ||
! This software is licensed under the terms of the Apache Licence Version 2.0 | ||
! which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. | ||
! In applying this licence, ECMWF does not waive the privileges and immunities | ||
! granted to it by virtue of its status as an intergovernmental organisation | ||
! nor does it submit to any jurisdiction. | ||
! | ||
|
||
SUBROUTINE CIREDUCE_LOKI_GPU (WVPRPT, FF_NOW) | ||
|
||
! ---------------------------------------------------------------------- | ||
|
||
!**** *CIREDUCE* - COMPUTE SEA ICE REDUCTION FACTOR FOR SOURCE TERMS | ||
! AND THE SEA ICE WAVE ATTENUATION FACTORS | ||
|
||
! IF THERE IS NO SEA ICE INFORMATION OR | ||
! ALL SEA ICE COVER POINTS WILL BE MASKED | ||
! THEN CIWA WILL BE SET ON THE FIRST CALL. NOTHING WILL BE DONE | ||
! IN ALL FOLLOWING CALLS | ||
|
||
!!!! currently also setting parametric sea ice thickness !!!! | ||
|
||
!* PURPOSE. | ||
! -------- | ||
|
||
! CIREDUCE COMPUTES SEA ICE SOURCE TERM REDUCTION FACTOR. | ||
|
||
!** INTERFACE. | ||
! ---------- | ||
|
||
! *CALL* *CIREDUCE (CGROUP, CICOVER, CITHICK, CIWA) | ||
|
||
! *CGROUP* - GROUP SPEED. | ||
! *CICOVER* - SEA ICE COVER. | ||
! *CITHICK* - SEA ICE THICKNESS. | ||
! *CIWA*- SEA ICE WAVE ATTENUATION FACTOR. | ||
|
||
! METHOD. | ||
! ------- | ||
|
||
! EXTERNALS. | ||
! ---------- | ||
|
||
|
||
! ---------------------------------------------------------------------- | ||
|
||
USE PARKIND_WAVE, ONLY : JWIM, JWRB, JWRU | ||
|
||
USE YOWGRID , ONLY : NPROMA_WAM, NCHNK | ||
USE YOWICE , ONLY : LICERUN ,LMASKICE | ||
USE YOWPARAM , ONLY : NFRE | ||
|
||
USE YOMHOOK , ONLY : LHOOK, DR_HOOK, JPHOOK | ||
USE YOWDRVTYPE ,ONLY: FREQUENCY, FORCING_FIELDS | ||
USE YOWSTAT, ONLY: LUPDATE_GPU_GLOBALS | ||
|
||
! ---------------------------------------------------------------------- | ||
IMPLICIT NONE | ||
|
||
#include "ciwaf.intfb.h" | ||
|
||
TYPE(FREQUENCY), INTENT(INOUT) :: WVPRPT | ||
TYPE(FORCING_FIELDS), INTENT(IN) :: FF_NOW | ||
|
||
|
||
INTEGER(KIND=JWIM) :: IJ, M | ||
INTEGER(KIND=JWIM) :: ICHNK | ||
|
||
REAL(KIND=JPHOOK) :: ZHOOK_HANDLE | ||
|
||
LOGICAL, SAVE :: LLFRST | ||
|
||
DATA LLFRST / .TRUE. / | ||
|
||
! ---------------------------------------------------------------------- | ||
|
||
IF (LHOOK) CALL DR_HOOK('CIREDUCE',0,ZHOOK_HANDLE) | ||
|
||
IF( .NOT. LICERUN .OR. LMASKICE ) THEN | ||
|
||
IF (LLFRST) THEN | ||
LLFRST=.FALSE. | ||
! NO REDUCTION, EITHER THERE IS NO SEA ICE INFORMATION OR | ||
! ALL SEA ICE COVER POINTS WILL BE MASKED | ||
CALL GSTATS(1493,0) | ||
!$acc kernels present(WVPRPT) | ||
DO ICHNK = 1, NCHNK | ||
WVPRPT%CIWA(:,:,ICHNK) = 1.0_JWRB | ||
ENDDO | ||
!$acc end kernels | ||
CALL GSTATS(1493,1) | ||
ENDIF | ||
|
||
ELSE | ||
|
||
IF(LUPDATE_GPU_GLOBALS)THEN | ||
!$loki update_device | ||
ENDIF | ||
CALL GSTATS(1493,0) | ||
! DETERMINE THE WAVE ATTENUATION FACTOR | ||
!$acc parallel loop gang present(FF_NOW, WVPRPT) vector_length(NPROMA_WAM) | ||
DO ICHNK = 1, NCHNK | ||
CALL CIWAF(1, NPROMA_WAM, WVPRPT%CGROUP(:,:,ICHNK), FF_NOW%CICOVER(:,ICHNK), & | ||
& FF_NOW%CITHICK(:,ICHNK), WVPRPT%CIWA(:,:,ICHNK)) | ||
ENDDO | ||
!$acc end parallel loop | ||
CALL GSTATS(1493,1) | ||
ENDIF | ||
|
||
IF (LHOOK) CALL DR_HOOK('CIREDUCE',1,ZHOOK_HANDLE) | ||
|
||
END SUBROUTINE CIREDUCE_LOKI_GPU |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.