Skip to content

Commit

Permalink
add test on output times to match source term time stepping and defin…
Browse files Browse the repository at this point in the history
…e MIJ when no call to source term integration
  • Loading branch information
jrbidlot authored and awnawab committed Jan 20, 2025
1 parent 33d575a commit 6ea4f8d
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 2 deletions.
71 changes: 69 additions & 2 deletions src/ecwam/userin.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1590,6 +1590,18 @@ SUBROUTINE USERIN (IFORCA, LWCUR)
WRITE(IU06,*) '+ PROGRAM WILL IGNORE THIS OUTPUT TIME +'
WRITE(IU06,*) '+ +'
WRITE(IU06,*) '++++++++++++++++++++++++++++++++++++++++'
ELSE IF (MOD(ISHIFT,IDELT) /= 0 .AND. LLSOURCE ) THEN
WRITE(IU06,*) '++++++++++++++++++++++++++++++++++++++++'
WRITE(IU06,*) '+ +'
WRITE(IU06,*) '+ WARNING ERROR IN SUB. USERIN +'
WRITE(IU06,*) '+ ============================ +'
WRITE(IU06,*) '+ OUTPUT DATE IS NOT AT THE END OF A +'
WRITE(IU06,*) '+ SOURCE TERM TIMESTEP IDELT= ', IDELT
WRITE(IU06,*) '+ DATE IS : ', COUTT(J)
WRITE(IU06,*) '+ PROGRAM WILL ABORT '
WRITE(IU06,*) '+ +'
WRITE(IU06,*) '+++++++++++++++++++++++++++++++++++++++++'
LERROR = .TRUE.
ENDIF
ENDDO
ELSE
Expand All @@ -1611,7 +1623,7 @@ SUBROUTINE USERIN (IFORCA, LWCUR)
WRITE(IU06,*) '* *'
WRITE(IU06,*) '* FATAL ERROR IN SUB. USERIN *'
WRITE(IU06,*) '* ========================== *'
WRITE(IU06,*) '* OUTPUT OF INTEGRATED DATA (TOTAL SEA) *'
WRITE(IU06,*) '* OUTPUT OF INTEGRATED DATA *'
WRITE(IU06,*) '* IS REQUESTED. *'
WRITE(IU06,*) '* OUTPUT TIME STEP HAS TO BE A MULTIPLE *'
WRITE(IU06,*) '* OF THE PROPAGATION TIME STEP. *'
Expand All @@ -1621,6 +1633,23 @@ SUBROUTINE USERIN (IFORCA, LWCUR)
WRITE(IU06,*) '*******************************************'
LERROR = .TRUE.
ENDIF
IF (LLSOURCE) THEN
IF ((FFLAG20 .OR. GFLAG20) .AND. MOD(IDELINT,IDELT) /= 0) THEN
WRITE(IU06,*) '*******************************************'
WRITE(IU06,*) '* *'
WRITE(IU06,*) '* FATAL ERROR IN SUB. USERIN *'
WRITE(IU06,*) '* ========================== *'
WRITE(IU06,*) '* OUTPUT OF INTEGRATED DATA *'
WRITE(IU06,*) '* IS REQUESTED. *'
WRITE(IU06,*) '* OUTPUT TIME STEP HAS TO BE A MULTIPLE *'
WRITE(IU06,*) '* OF THE SOURCE TERM TIME STEP. *'
WRITE(IU06,*) '* OUTPUT TIME STEP IS IDELINT = ', IDELINT
WRITE(IU06,*) '* SOURCE TERM TIME STEP IS IDELT = ', IDELT
WRITE(IU06,*) '* *'
WRITE(IU06,*) '*******************************************'
LERROR = .TRUE.
ENDIF
ENDIF
ENDIF

IF (NOUTS > 0) THEN
Expand All @@ -1639,6 +1668,24 @@ SUBROUTINE USERIN (IFORCA, LWCUR)
WRITE(IU06,*) '+++++++++++++++++++++++++++++++++++++++++'
ENDIF
ENDDO
IF (LLSOURCE) THEN
DO J=1,NOUTS
CALL DIFDATE (CDATEA, COUTS(J), ISHIFT)
IF (ISHIFT <= 0 .OR. MOD(ISHIFT,IDELT) /= 0) THEN
WRITE(IU06,*) '+++++++++++++++++++++++++++++++++++++++++'
WRITE(IU06,*) '+ +'
WRITE(IU06,*) '+ WARNING ERROR IN SUB. USERIN +'
WRITE(IU06,*) '+ ============================ +'
WRITE(IU06,*) '+ SPECTRA OUTPUT DATE IS NOT AT THE END +'
WRITE(IU06,*) '+ OF A SOURCE TERM TIMESTEP IDELT= ', IDELT
WRITE(IU06,*) '+ DATE IS : ', COUTS(J)
WRITE(IU06,*) '+ PROGRAM WILL ABORT '
WRITE(IU06,*) '+ +'
WRITE(IU06,*) '+++++++++++++++++++++++++++++++++++++++++'
LERROR = .TRUE.
ENDIF
ENDDO
ENDIF
ENDIF

IF (NASS > 0 .AND. IASSI == 1) THEN
Expand All @@ -1655,7 +1702,23 @@ SUBROUTINE USERIN (IFORCA, LWCUR)
WRITE(IU06,*) '+ PROGRAM WILL ABORT '
WRITE(IU06,*) '+ +'
WRITE(IU06,*) '+++++++++++++++++++++++++++++++++++++++++'
CALL WAM_ABORT(__FILENAME__,__LINE__)
LERROR = .TRUE.
ENDIF
ENDDO
DO J=1,NASS
CALL DIFDATE (CDATEA, CASS(J), ISHIFT)
IF (ISHIFT <= 0 .OR. MOD(ISHIFT,IDELT) /= 0) THEN
WRITE(IU06,*) '+++++++++++++++++++++++++++++++++++++++++'
WRITE(IU06,*) '+ +'
WRITE(IU06,*) '+ WARNING ERROR IN SUB. USERIN +'
WRITE(IU06,*) '+ ============================ +'
WRITE(IU06,*) '+ ASSIMILATION DATE IS NOT AT THE END +'
WRITE(IU06,*) '+ OF A SOURCE TERM TIMESTEP IDELT= ', IDELT
WRITE(IU06,*) '+ DATE IS : ', CASS(J)
WRITE(IU06,*) '+ PROGRAM WILL ABORT '
WRITE(IU06,*) '+ +'
WRITE(IU06,*) '+++++++++++++++++++++++++++++++++++++++++'
LERROR = .TRUE.
ENDIF
ENDDO
ENDIF
Expand All @@ -1677,6 +1740,10 @@ SUBROUTINE USERIN (IFORCA, LWCUR)
WRITE(IU06,*) '* PROGRAM ABORTS. PROGRAM ABORTS. *'
WRITE(IU06,*) '* --------------- -------------- *'
WRITE(IU06,*) '*******************************************'
WRITE(NULERR,*) '*******************************************'
WRITE(NULERR,*) '* FATAL ERROR(S) IN SUB. USERIN *'
WRITE(NULERR,*) '* SEE LOGFILE *'
WRITE(NULERR,*) '*******************************************'
CALL WAM_ABORT(__FILENAME__,__LINE__)
ELSE

Expand Down
8 changes: 8 additions & 0 deletions src/ecwam/wamintgr.F90
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,14 @@ SUBROUTINE WAMINTGR (CDTPRA, CDATE, CDATEWH, CDTIMP, CDTIMPNEXT, &
CDTIMP=CDTIMPNEXT
CALL INCDATE(CDTIMPNEXT, IDELT)

ELSE
! NO SOURCE TERM CONTRIBUTION
!$OMP PARALLEL DO SCHEDULE(STATIC) PRIVATE(ICHNK)
DO ICHNK = 1, NCHNK
MIJ%PTR(:,ICHNK) = NFRE
VARS_4D%XLLWS(:,:,:,ICHNK) = 0.0_JWRB
ENDDO
!$OMP END PARALLEL DO
ENDIF

IF (LHOOK) CALL DR_HOOK('WAMINTGR',1,ZHOOK_HANDLE)
Expand Down

0 comments on commit 6ea4f8d

Please sign in to comment.