Skip to content

Commit

Permalink
Moved detailed run-time info to yowstat
Browse files Browse the repository at this point in the history
  • Loading branch information
awnawab committed Jul 13, 2023
1 parent 4220668 commit abe771b
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 56 deletions.
26 changes: 14 additions & 12 deletions src/ecwam/runwam.F90
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
! (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
Expand Down Expand Up @@ -101,7 +101,8 @@ SUBROUTINE RUNWAM
& NEMONSTEP, NEMOCSTEP, NEMOWSTEP
USE YOWMPP , ONLY : IRANK ,NPROC
USE YOWSTAT , ONLY : CDATEE ,CDTPRO , &
& IPROPAGS ,LSUBGRID ,IREFRA ,IDELPRO
& IPROPAGS ,LSUBGRID ,IREFRA ,IDELPRO, TIME_PHYS, &
& TIME_PROPAG
USE YOWWAMI , ONLY : CBPLTDT ,CEPLTDT
USE YOWALTAS , ONLY : LODBRALT
USE MPL_MODULE, ONLY : MPL_INIT, MPL_END, MPL_COMM
Expand Down Expand Up @@ -157,7 +158,7 @@ SUBROUTINE RUNWAM
REAL(KIND=JPHOOK) :: ZHOOK_HANDLE
REAL(KIND=JWRB) :: RMISS
REAL(KIND=JWRB) :: ZRCHAR
REAL(KIND=JWRU) :: time0, time, timestep_start, timestep0_start, time1(2)
REAL(KIND=JWRU) :: time0, time, timestep_start, timestep0_start

CHARACTER(LEN=3) :: DBNAME
CHARACTER(LEN=14) :: ZERO,CBEGDAT
Expand All @@ -180,14 +181,15 @@ SUBROUTINE RUNWAM


time0=-wam_user_clock()
time1=0.
TIME_PROPAG=0_JWRB
TIME_PHYS=0_JWRB
IU06=6

! 0.1 INITIALISE MESSAGE PASSING PROTOCOL
! 0.1 INITIALISE MESSAGE PASSING PROTOCOL
! -----------------------------------

CALL MPL_INIT(KERROR=KERROR)
IF (KERROR < 0) THEN
IF (KERROR < 0) THEN
IU06=6
WRITE (IU06,*) ' ******************************************'
WRITE (IU06,*) ' * *'
Expand Down Expand Up @@ -235,7 +237,7 @@ SUBROUTINE RUNWAM

CALL GSTATS(0,0)

! 0.3 DETERMINE GRID DOMAIN DECOMPOSITION
! 0.3 DETERMINE GRID DOMAIN DECOMPOSITION
! -----------------------------------

NADV=0
Expand Down Expand Up @@ -339,7 +341,7 @@ SUBROUTINE RUNWAM
& MASK_IN, MASK_OUT, &
& FRSTIME, NADV, PRPLRADI, PRPLRG, &
& RNU_ATM, RNUM_ATM, &
& IDUM,IDUM, .FALSE., time1)
& IDUM,IDUM, .FALSE.)
time = (timestep_start+wam_user_clock())*1.e-6
ISTEP = ISTEP+1
IF (IRANK==1) THEN
Expand Down Expand Up @@ -383,9 +385,9 @@ SUBROUTINE RUNWAM
WRITE (IU06,'(A)') ' + TOTAL USER TIME IN SECONDS +'
WRITE (IU06,'(A,F18.2,A)') ' + ', time, ' +'
WRITE (IU06,'(A)') ' + WAVE PROPAGATION TIME +'
WRITE (IU06,'(A,F18.2,A)') ' + ', time1(1), ' +'
WRITE (IU06,'(A,F18.2,A)') ' + ', TIME_PROPAG, ' +'
WRITE (IU06,'(A)') ' + SOURCE TERM TIME +'
WRITE (IU06,'(A,F18.2,A)') ' + ', time1(2), ' +'
WRITE (IU06,'(A,F18.2,A)') ' + ', TIME_PHYS, ' +'
WRITE (IU06,'(A)') ' + +'
WRITE (IU06,'(A,I8,A)') ' + ON PE : ', IRANK, ' +'
WRITE (IU06,'(A)') ' ++++++++++++++++++++++++++++++'
Expand All @@ -394,9 +396,9 @@ SUBROUTINE RUNWAM
WRITE (6,'(A)') ' + TOTAL USER TIME IN SECONDS +'
WRITE (6,'(A,F18.2,A)') ' + ', time, ' +'
WRITE (6,'(A)') ' + WAVE PROPAGATION TIME +'
WRITE (6,'(A,F18.2,A)') ' + ', time1(1), ' +'
WRITE (6,'(A,F18.2,A)') ' + ', TIME_PROPAG, ' +'
WRITE (6,'(A)') ' + SOURCE TERM TIME +'
WRITE (6,'(A,F18.2,A)') ' + ', time1(2), ' +'
WRITE (6,'(A,F18.2,A)') ' + ', TIME_PHYS, ' +'
WRITE (6,'(A)') ' + +'
WRITE (6,'(A,I8,A)') ' + ON PE : ', IRANK, ' +'
WRITE (6,'(A)') ' ++++++++++++++++++++++++++++++'
Expand Down
10 changes: 5 additions & 5 deletions src/ecwam/wamintgr.F90
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
SUBROUTINE WAMINTGR (CDTPRA, CDATE, CDATEWH, CDTIMP, CDTIMPNEXT, &
& BLK2GLO, &
& WVENVI, WVPRPT, FF_NOW, FF_NEXT, INTFLDS, &
& WAM2NEMO, MIJ, FL1, XLLWS, TIME1)
& WAM2NEMO, MIJ, FL1, XLLWS)


! ----------------------------------------------------------------------
Expand Down Expand Up @@ -39,7 +39,8 @@ SUBROUTINE WAMINTGR (CDTPRA, CDATE, CDATEWH, CDTIMP, CDTIMPNEXT, &
USE YOWGRID , ONLY : NPROMA_WAM, NCHNK
USE YOWPARAM , ONLY : NIBLO, NANG, NFRE
USE YOWPCONS , ONLY : EPSMIN
USE YOWSTAT , ONLY : CDTPRO, IDELPRO, IDELT, IDELWI, LLSOURCE
USE YOWSTAT , ONLY : CDTPRO, IDELPRO, IDELT, IDELWI, LLSOURCE, TIME_PROPAG, &
& TIME_PHYS
USE YOWWIND , ONLY : CDAWIFL, CDATEWO, CDATEFL
USE YOWFIELD_MOD, ONLY : FREQUENCY_FIELD, ENVIRONMENT_FIELD, FORCING_FIELDS_FIELD, &
& WAVE2OCEAN_FIELD, INTGT_PARAM_FIELDS_FIELD, SOURCE_CONTRIBS_FIELD
Expand Down Expand Up @@ -72,7 +73,6 @@ SUBROUTINE WAMINTGR (CDTPRA, CDATE, CDATEWH, CDTIMP, CDTIMPNEXT, &
REAL(KIND=JWRB), DIMENSION(NPROMA_WAM, NANG, NFRE, NCHNK), INTENT(INOUT) :: FL1
REAL(KIND=JWRB), DIMENSION(NPROMA_WAM, NANG, NFRE, NCHNK), INTENT(INOUT) :: XLLWS ! TOTAL WINDSEA MASK FROM INPUT SOURCE TERM

REAL(KIND=JWRB), INTENT(INOUT) :: TIME1(2)
REAL(KIND=JWRB) :: TIME0


Expand Down Expand Up @@ -105,7 +105,7 @@ SUBROUTINE WAMINTGR (CDTPRA, CDATE, CDATEWH, CDTIMP, CDTIMPNEXT, &
IF (CDATE == CDTPRA) THEN
TIME0=-WAM_USER_CLOCK()
CALL PROPAG_WAM(BLK2GLO, WVENVI, WVPRPT, FL1)
TIME1(1) = TIME1(1) + (TIME0+WAM_USER_CLOCK())*1.E-06
TIME_PROPAG = TIME_PROPAG + (TIME0+WAM_USER_CLOCK())*1.E-06
CDATE = CDTPRO
ENDIF

Expand Down Expand Up @@ -180,7 +180,7 @@ SUBROUTINE WAMINTGR (CDTPRA, CDATE, CDATEWH, CDTIMP, CDTIMPNEXT, &
CALL INTFLDS_FIELD%FINAL()
CALL SRC_CONTRIBS%FINAL()

TIME1(2) = TIME1(2) + (TIME0+WAM_USER_CLOCK())*1.E-06
TIME_PHYS = TIME_PHYS + (TIME0+WAM_USER_CLOCK())*1.E-06

IF (LWNEMOCOU) NEMONTAU = NEMONTAU + 1

Expand Down
32 changes: 15 additions & 17 deletions src/ecwam/wamodel.F90
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
! (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
Expand All @@ -9,7 +9,7 @@

SUBROUTINE WAMODEL (NADV, LDSTOP, LDWRRE, BLK2GLO, &
& WVENVI, WVPRPT, FF_NOW, FF_NEXT, INTFLDS, &
& WAM2NEMO, NEMO2WAM, FL1, TIME1)
& WAM2NEMO, NEMO2WAM, FL1)

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

Expand Down Expand Up @@ -65,8 +65,8 @@ SUBROUTINE WAMODEL (NADV, LDSTOP, LDWRRE, BLK2GLO, &
USE YOWFRED , ONLY : FR ,TH
USE YOWGRID , ONLY : NPROMA_WAM, NCHNK
USE YOWICE , ONLY : LICERUN ,LMASKICE
USE YOWMESPAS, ONLY : LFDBIOOUT,LGRIBOUT ,LNOCDIN ,LWAVEWIND
USE YOWMPP , ONLY : IRANK ,NPROC ,KTAG
USE YOWMESPAS, ONLY : LFDBIOOUT,LGRIBOUT ,LNOCDIN ,LWAVEWIND
USE YOWMPP , ONLY : IRANK ,NPROC ,KTAG
USE YOWPARAM , ONLY : NIBLO ,NANG ,NFRE
USE YOWSTAT , ONLY : CDATEA ,CDATEE ,CDATEF ,CDTPRO ,CDTRES , &
& CDATER ,CDATES ,CDTINTT ,IDELPRO ,IDELT , &
Expand All @@ -86,7 +86,7 @@ SUBROUTINE WAMODEL (NADV, LDSTOP, LDWRRE, BLK2GLO, &
USE WAM_MULTIO_MOD, ONLY : WAM_MULTIO_FLUSH
USE YOMHOOK , ONLY : LHOOK, DR_HOOK, JPHOOK


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

IMPLICIT NONE
Expand Down Expand Up @@ -124,8 +124,6 @@ SUBROUTINE WAMODEL (NADV, LDSTOP, LDWRRE, BLK2GLO, &
TYPE(OCEAN2WAVE), INTENT(IN) :: NEMO2WAM
REAL(KIND=JWRB), DIMENSION(NPROMA_WAM, NANG, NFRE, NCHNK), INTENT(INOUT) :: FL1

REAL(KIND=JWRB), INTENT(INOUT) :: TIME1(2)


INTEGER(KIND=JWIM) :: IJ, K, M, J, IRA, KADV, ICH
INTEGER(KIND=JWIM) :: IFIL, IC, ICL, ICR, II, ILOOP
Expand Down Expand Up @@ -160,7 +158,7 @@ SUBROUTINE WAMODEL (NADV, LDSTOP, LDWRRE, BLK2GLO, &

! TIME FOR THE NEXT SOURCE TERM INTEGRATION
CDTIMPNEXT = CDTPRO
CALL INCDATE(CDTIMPNEXT, IDELT)
CALL INCDATE(CDTIMPNEXT, IDELT)
! TIME FOR WIND INPUT UPDATE (SEE NEWWIND)
CDTIMP = CDTPRO

Expand Down Expand Up @@ -253,7 +251,7 @@ SUBROUTINE WAMODEL (NADV, LDSTOP, LDWRRE, BLK2GLO, &
CALL WAMINTGR (CDTPRA, CDATE, CDATEWH, CDTIMP, CDTIMPNEXT, &
& BLK2GLO, &
& WVENVI, WVPRPT, FF_NOW, FF_NEXT, INTFLDS, &
& WAM2NEMO, MIJ, FL1, XLLWS, TIME1)
& WAM2NEMO, MIJ, FL1, XLLWS)
ILOOP = ILOOP +1
ENDDO

Expand Down Expand Up @@ -281,11 +279,11 @@ SUBROUTINE WAMODEL (NADV, LDSTOP, LDWRRE, BLK2GLO, &
IF (IBOUNF == 1) CALL BOUINPT (IU02, FL1, NBLKS, NBLKE)
!* 1.4.2 OUTPUT OF BOUNDARY POINTS.
! --------------------------
IF (IBOUNC == 1) CALL OUTBC (FL1, BLK2GLO, IU19)
IF (IBOUNC == 1) CALL OUTBC (FL1, BLK2GLO, IU19)
!NEST


!* 1.5 POINT OUTPUT (not usually used at ECMWF)
!* 1.5 POINT OUTPUT (not usually used at ECMWF)
! ----------------------------------------
IF ( NGOUT > 0 .AND. (CDTINTT == CDTPRO .OR. LRST) ) THEN
! OUTPUT POINT SPECTRA (not usually used at ECMWF)
Expand Down Expand Up @@ -357,7 +355,7 @@ SUBROUTINE WAMODEL (NADV, LDSTOP, LDWRRE, BLK2GLO, &
WRITE(IU06,*) ' '
WRITE(IU06,*) ' GRIB WAVE SPECTRA DISPOSED AT........ CDTPRO = ', CDTPRO
WRITE(IU06,*) ' '
ENDIF
ENDIF

! 1.8.2 SAVE RESTART FILES IN PURE BINARY FORM (in needed)
! --------------------------------------
Expand All @@ -378,7 +376,7 @@ SUBROUTINE WAMODEL (NADV, LDSTOP, LDWRRE, BLK2GLO, &
!* 1.8.3 UPDATE, WRITE AND SAVE WAMINFO FILE.
! -----------------------------------
IF (LRST .AND. IRANK == 1) THEN
ICH = 7
ICH = 7
CALL DIFDATE (CDATEF, CDATEE, IFOREPD)
IF (CDTPRO <= CDATEF) THEN
CALL DIFDATE (CDTPRO, CDATEF, IANALPD)
Expand All @@ -402,7 +400,7 @@ SUBROUTINE WAMODEL (NADV, LDSTOP, LDWRRE, BLK2GLO, &
& IDELWIN, CDATER, CDATES, CBPLTDT, CEPLTDT, &
& IASSI, NFCST, ISTAT, CDTCUR, &
& LRSTPARALW, NPROC)

CLOSE (IU04)
WRITE(IU06,*) ' WAMINFO FILE WRITTEN FOR RESTART... CDTPRO = ', CDTPRO
WRITE(IU06,*) ' CDATEF = ', CDATEF
Expand Down Expand Up @@ -459,7 +457,7 @@ SUBROUTINE WAMODEL (NADV, LDSTOP, LDWRRE, BLK2GLO, &
CALL GSTATS(1976,0)
CALL WAM_MULTIO_FLUSH()
CALL GSTATS(1976,1)
WRITE(IU06,*) ' '
WRITE(IU06,*) ' '
WRITE(IU06,*) ' FDB FLUSHED AT ', CDTPRO, ' FROM WAMODEL. '
CALL FLUSH (IU06)
LLFLUSH=.FALSE.
Expand All @@ -486,12 +484,12 @@ SUBROUTINE WAMODEL (NADV, LDSTOP, LDWRRE, BLK2GLO, &
& CBCPREF(II), 'S')
IF (CDTBC < CDATEE) &
& CALL HEADBC (IPOGBO(II)-IPOGBO(II-1), IDELPRO, &
& TH(1), FR(1), IU19(II), IU06)
& TH(1), FR(1), IU19(II), IU06)
ENDDO
ENDIF
ENDIF
!NEST


!* 1.12 WAM-NEMO COUPLING (!!!!! WHEN NO atmospheric model !!!!!!) (currently not used at ECMWF)
! (when coupled see cnt4 in ifs)
Expand Down
26 changes: 12 additions & 14 deletions src/ecwam/wavemdl.F90
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
! (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
Expand All @@ -20,7 +20,7 @@ SUBROUTINE WAVEMDL (CBEGDAT, PSTEP, KSTOP, KSTPW, &
& FRSTIME, NADV, PRPLRADI, PRPLRG, &
& RNU_ATM, RNUM_ATM, &
& IDATE_TIME_WINDOW_END, NSTEP, &
& LDIFS_IO_SERV_ENABLED, TIME1 )
& LDIFS_IO_SERV_ENABLED )

!**** *WAVEMDL* - SUPERVISES EXECUTION OF THE WAVE MODEL

Expand Down Expand Up @@ -114,7 +114,7 @@ SUBROUTINE WAVEMDL (CBEGDAT, PSTEP, KSTOP, KSTPW, &
& IFSTSTEP, IFSNSTEP, &
& LIFS_IO_SERV_ENABLED
USE YOWGRIBHD, ONLY : NDATE_TIME_WINDOW_END
USE YOWGRID , ONLY : NPROMA_WAM, NCHNK, KIJL4CHNK, IJFROMCHNK
USE YOWGRID , ONLY : NPROMA_WAM, NCHNK, KIJL4CHNK, IJFROMCHNK
USE YOWCURR , ONLY : IDELCUR ,LLCHKCFL
USE YOWFRED , ONLY : FR
USE YOWGRID , ONLY : IJS ,IJL
Expand All @@ -135,7 +135,7 @@ SUBROUTINE WAVEMDL (CBEGDAT, PSTEP, KSTOP, KSTPW, &
USE YOWTEST , ONLY : IU06
USE YOWWNDG , ONLY : ICODE_CPL
USE YOWTEXT , ONLY : LRESTARTED
USE YOWSPEC , ONLY : NSTART ,NEND ,FF_NOW ,FL1
USE YOWSPEC , ONLY : NSTART ,NEND ,FF_NOW ,FL1
USE YOWWIND , ONLY : CDAWIFL ,IUNITW ,CDATEWO ,CDATEFL , &
& FF_NEXT , &
& NXFFS ,NXFFE ,NYFFS ,NYFFE, &
Expand Down Expand Up @@ -228,16 +228,14 @@ SUBROUTINE WAVEMDL (CBEGDAT, PSTEP, KSTOP, KSTPW, &
! KINEMATIC AIR DENSITY
REAL(KIND=JWRB), INTENT(IN) :: RNU_ATM
! REDUCED KINEMATIC AIR DENSITY FOR MOMENTUM TRANSFER
REAL(KIND=JWRB), INTENT(IN) :: RNUM_ATM
! USED TO SPECIFY THE END OF THE 4DVAR ANALYSIS WINDOW WHEN COUPLED
REAL(KIND=JWRB), INTENT(IN) :: RNUM_ATM
! USED TO SPECIFY THE END OF THE 4DVAR ANALYSIS WINDOW WHEN COUPLED
INTEGER(KIND=JWIM), INTENT(IN) :: IDATE_TIME_WINDOW_END
! ATMOSPHERIC NSTEP (CT3)
INTEGER(KIND=JWIM), INTENT(IN) :: NSTEP
! IFS IO SERVER ENABLED
LOGICAL, INTENT(IN) :: LDIFS_IO_SERV_ENABLED

REAL(KIND=JWRB), INTENT(INOUT) :: TIME1(2)

INTEGER(KIND=JWIM) :: IJ, I, J, K, ICPLEN,ICPLEN_ECF
INTEGER(KIND=JWIM) :: KDELWI, IDURAT
INTEGER(KIND=JWIM) :: NDUR, KSTOP_BY, ISTOP
Expand Down Expand Up @@ -450,12 +448,12 @@ SUBROUTINE WAVEMDL (CBEGDAT, PSTEP, KSTOP, KSTPW, &
& FL1, &
& NFIELDS, NGPTOTG, NC, NR, &
& FIELDS, LWCUR, MASK_IN, PRPLRADI, &
& NEMO2WAM)
& NEMO2WAM)


LLCHKCFL=.FALSE.

FRSTIME = .FALSE.
FRSTIME = .FALSE.

IF (LWCOU) THEN
IF (NLONW /= NGX .OR. NLATW /= NGY) THEN
Expand Down Expand Up @@ -564,7 +562,7 @@ SUBROUTINE WAVEMDL (CBEGDAT, PSTEP, KSTOP, KSTPW, &
IF (LFRSTCHK) THEN
! CHECK THAT THE STRUCTURE OF FIELDS IS IN AGREEMENT WITH IFROMIJ AND JFROMIJ
DO ICHNK = 1, NCHNK
DO IJ = 1, KIJL4CHNK(ICHNK)
DO IJ = 1, KIJL4CHNK(ICHNK)
I = BLK2LOC%IFROMIJ(IJ,ICHNK)
J = BLK2LOC%JFROMIJ(IJ,ICHNK)
IF (I < NXS .OR. I > NXE .OR. J < NYS .OR. J > NYE) THEN
Expand Down Expand Up @@ -598,7 +596,7 @@ SUBROUTINE WAVEMDL (CBEGDAT, PSTEP, KSTOP, KSTPW, &
& LLINIT, IREAD, &
& NFIELDS, NGPTOTG, NC, NR, &
& FIELDS, LWCUR, MASK_IN, &
& NEMO2WAM)
& NEMO2WAM)

ENDIF

Expand All @@ -616,7 +614,7 @@ SUBROUTINE WAVEMDL (CBEGDAT, PSTEP, KSTOP, KSTPW, &

CALL WAMODEL (NADV, LDSTOP, LDWRRE, BLK2GLO, &
& WVENVI, WVPRPT, FF_NOW, FF_NEXT, INTFLDS, &
& WAM2NEMO, NEMO2WAM, FL1, TIME1)
& WAM2NEMO, NEMO2WAM, FL1)


!* 2.2 DATA ASSIMILATION
Expand Down Expand Up @@ -764,7 +762,7 @@ SUBROUTINE WAVEMDL (CBEGDAT, PSTEP, KSTOP, KSTPW, &
KIJS = 1
IJSB = IJFROMCHNK(KIJS,ICHNK)
KIJL = KIJL4CHNK(ICHNK)
IJLB = IJFROMCHNK(KIJL,ICHNK)
IJLB = IJFROMCHNK(KIJL,ICHNK)

IFLDOFFSET=1
WVBLOCK(IJSB:IJLB,IFLDOFFSET)=BETAM(KIJS:KIJL,ICHNK)
Expand Down
Loading

0 comments on commit abe771b

Please sign in to comment.