Skip to content

Commit

Permalink
last Shom dev on output
Browse files Browse the repository at this point in the history
  • Loading branch information
heloisemichaud committed Oct 9, 2024
1 parent 5aad643 commit 8bb1442
Show file tree
Hide file tree
Showing 15 changed files with 190 additions and 63 deletions.
19 changes: 15 additions & 4 deletions model/src/pdlib_field_vec.F90
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ SUBROUTINE GET_ARRAY_SIZE(TheSize)
END IF
IF ( FLGRDALL( 2, 19) ) THEN
IH = IH + 1
END IF
IF ( FLGRDALL( 2, 20) ) THEN
IH = IH + 1
END IF
IF ( FLGRDALL( 3, 1) ) THEN
DO IK=E3DF(2,1),E3DF(3,1)
Expand Down Expand Up @@ -830,7 +833,7 @@ SUBROUTINE DO_OUTPUT_EXCHANGES(IMOD)
STH2M, HSIG, TAUICE, PHICE, PTHP0, PQP,&
PPE, PGW, PSW, PTM1, PT1, PT2, PEP, &
QP, MSSD, MSCD, STMAXE, STMAXD, HMAXE, &
HCMAXE, HMAXD, HCMAXD, WBT, USSP
HCMAXE, HMAXD, HCMAXD, WBT, USSP, BRCOEF
USE W3GDATMD, ONLY: NK, NSEAL
USE W3ODATMD, ONLY: NDST, IAPROC, NAPROC, NTPROC, FLOUT, &
NAPFLD, NAPPNT, NAPRST, NAPBPT, NAPTRK,&
Expand Down Expand Up @@ -968,6 +971,10 @@ SUBROUTINE DO_OUTPUT_EXCHANGES(IMOD)
IH = IH + 1
Arrexch(IH,JSEA)=WNMEAN(JSEA)
END IF
IF ( FLGRDALL( 2, 20) ) THEN
IH = IH + 1
Arrexch(IH,JSEA)=BRCOEF(JSEA)
END IF
IF ( FLGRDALL( 3, 1) ) THEN
DO IK=E3DF(2,1),E3DF(3,1)
IH = IH + 1
Expand Down Expand Up @@ -1098,11 +1105,11 @@ SUBROUTINE DO_OUTPUT_EXCHANGES(IMOD)
END IF
IF ( FLGRDALL( 5, 1) ) THEN
IH = IH + 1
Arrexch(IH,JSEA)=UST(ISEA)
Arrexch(IH,JSEA)=UST(JSEA)
IH = IH + 1
Arrexch(IH,JSEA)=USTDIR(ISEA)
Arrexch(IH,JSEA)=USTDIR(JSEA)
IH = IH + 1
Arrexch(IH,JSEA)=ASF(ISEA)
Arrexch(IH,JSEA)=ASF(JSEA)
END IF
IF ( FLGRDALL( 5, 2) ) THEN
IH = IH + 1
Expand Down Expand Up @@ -1411,6 +1418,10 @@ SUBROUTINE DO_OUTPUT_EXCHANGES(IMOD)
IH = IH + 1
WNMEAN(1:NSEA) = ARRtotal(IH,:)
END IF
IF ( FLGRDALL( 2, 20) ) THEN
IH = IH + 1
BRCOEF(1:NSEA) = ARRtotal(IH,:)
END IF
IF ( FLGRDALL( 3, 1) ) THEN
DO IK=E3DF(2,1),E3DF(3,1)
IH = IH + 1
Expand Down
22 changes: 18 additions & 4 deletions model/src/w3adatmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -407,14 +407,15 @@ MODULE W3ADATMD
THS(:), THP0(:), &
HSIG(:), STMAXE(:), STMAXD(:), &
HMAXE(:), HCMAXE(:), HMAXD(:), &
HCMAXD(:), QP(:), WBT(:), WNMEAN(:)
HCMAXD(:), QP(:), WBT(:), WNMEAN(:),&
BRCOEF(:)
REAL, POINTER :: XHS(:), XWLM(:), XT02(:), XT0M1(:), &
XT01 (:), XFP0(:), XTHM(:), &
XTHS(:), XTHP0(:), &
XHSIG(:), XSTMAXE(:), XSTMAXD(:), &
XHMAXE(:), XHCMAXE(:), XHMAXD(:), &
XHCMAXD(:), XQP(:), XWBT(:), &
XWNMEAN(:)
XWNMEAN(:), XBRCOEF(:)
!
! Output fields group 3)
!
Expand Down Expand Up @@ -589,7 +590,7 @@ MODULE W3ADATMD
THP0(:), HSIG(:), &
STMAXE(:), STMAXD(:), HMAXE(:), &
HCMAXE(:), HMAXD(:), HCMAXD(:), &
QP(:), WBT(:), WNMEAN(:)
QP(:), WBT(:), WNMEAN(:), BRCOEF(:)
!
REAL, POINTER :: EF(:,:), TH1M(:,:), STH1M(:,:), &
TH2M(:,:), STH2M(:,:)
Expand Down Expand Up @@ -1050,6 +1051,7 @@ SUBROUTINE W3DIMA ( IMOD, NDSE, NDST, D_ONLY )
WADATS(IMOD)%HCMAXD(NSEALM), WADATS(IMOD)%QP(NSEALM), &
WADATS(IMOD)%WBT(NSEALM), &
WADATS(IMOD)%WNMEAN(NSEALM), &
WADATS(IMOD)%BRCOEF(NSEALM), &
STAT=ISTAT )
CHECK_ALLOC_STATUS ( ISTAT )
!
Expand All @@ -1072,6 +1074,7 @@ SUBROUTINE W3DIMA ( IMOD, NDSE, NDST, D_ONLY )
WADATS(IMOD)%QP = UNDEF
WADATS(IMOD)%WBT = UNDEF
WADATS(IMOD)%WNMEAN = UNDEF
WADATS(IMOD)%BRCOEF = UNDEF

call print_memcheck(memunit, 'memcheck_____:'//' W3DIMA 3')
!
Expand Down Expand Up @@ -1732,7 +1735,15 @@ SUBROUTINE W3XDMA ( IMOD, NDSE, NDST, OUTFLAGS )
ALLOCATE ( WADATS(IMOD)%XWNMEAN(1), STAT=ISTAT )
CHECK_ALLOC_STATUS ( ISTAT )
END IF
!
!
IF ( OUTFLAGS( 2, 20) ) THEN
ALLOCATE ( WADATS(IMOD)%XBRCOEF(NXXX), STAT=ISTAT )
CHECK_ALLOC_STATUS ( ISTAT )
ELSE
ALLOCATE ( WADATS(IMOD)%XBRCOEF(1), STAT=ISTAT )
CHECK_ALLOC_STATUS ( ISTAT )
END IF
!
WADATS(IMOD)%XHS = UNDEF
WADATS(IMOD)%XWLM = UNDEF
WADATS(IMOD)%XT02 = UNDEF
Expand All @@ -1751,6 +1762,7 @@ SUBROUTINE W3XDMA ( IMOD, NDSE, NDST, OUTFLAGS )
WADATS(IMOD)%XHCMAXD= UNDEF
WADATS(IMOD)%XWBT = UNDEF
WADATS(IMOD)%XWNMEAN= UNDEF
WADATS(IMOD)%XBRCOEF= UNDEF
!
IF ( OUTFLAGS( 3, 1) ) THEN
ALLOCATE ( WADATS(IMOD)%XEF(NXXX,E3DF(2,1):E3DF(3,1)), STAT=ISTAT )
Expand Down Expand Up @@ -2860,6 +2872,7 @@ SUBROUTINE W3SETA ( IMOD, NDSE, NDST )
QP => WADATS(IMOD)%QP
WBT => WADATS(IMOD)%WBT
WNMEAN => WADATS(IMOD)%WNMEAN
BRCOEF => WADATS(IMOD)%BRCOEF
!
EF => WADATS(IMOD)%EF
TH1M => WADATS(IMOD)%TH1M
Expand Down Expand Up @@ -3203,6 +3216,7 @@ SUBROUTINE W3XETA ( IMOD, NDSE, NDST )
QP => WADATS(IMOD)%XQP
WBT => WADATS(IMOD)%XWBT
WNMEAN => WADATS(IMOD)%XWNMEAN
BRCOEF => WADATS(IMOD)%XBRCOEF
!
EF => WADATS(IMOD)%XEF
TH1M => WADATS(IMOD)%XTH1M
Expand Down
5 changes: 3 additions & 2 deletions model/src/w3gdatmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,7 @@ MODULE W3GDATMD
#endif
#ifdef W3_DB1
REAL :: SDBC1, SDBC2
LOGICAL :: FDONLY
LOGICAL :: FDONLY, FSLOPE
REAL :: SDBSC
#endif
END TYPE SDBP
Expand Down Expand Up @@ -1392,7 +1392,7 @@ MODULE W3GDATMD
!/
#ifdef W3_DB1
REAL, POINTER :: SDBC1, SDBC2
LOGICAL, POINTER :: FDONLY
LOGICAL, POINTER :: FDONLY, FSLOPE
REAL, POINTER :: SDBSC
#endif
!/
Expand Down Expand Up @@ -2816,6 +2816,7 @@ SUBROUTINE W3SETG ( IMOD, NDSE, NDST )
SDBC1 => MPARS(IMOD)%SDBPS%SDBC1
SDBC2 => MPARS(IMOD)%SDBPS%SDBC2
FDONLY => MPARS(IMOD)%SDBPS%FDONLY
FSLOPE => MPARS(IMOD)%SDBPS%FSLOPE
SDBSC => MPARS(IMOD)%SDBPS%SDBSC
#endif
!
Expand Down
21 changes: 16 additions & 5 deletions model/src/w3gridmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,7 @@ MODULE W3GRIDMD
#ifdef W3_DB1
REAL :: BJALFA, BJGAM
LOGICAL :: BJFLAG
LOGICAL :: BRFLAG
#endif
#ifdef W3_PR2
REAL :: DTIME
Expand Down Expand Up @@ -1067,7 +1068,7 @@ MODULE W3GRIDMD
BOTROUGHMIN, BOTROUGHFAC
#endif
#ifdef W3_DB1
NAMELIST /SDB1/ BJALFA, BJGAM, BJFLAG
NAMELIST /SDB1/ BJALFA, BJGAM, BJFLAG, BRFLAG
#endif
#ifdef W3_UOST
NAMELIST /UOST/ UOSTFILELOCAL, UOSTFILESHADOW, &
Expand Down Expand Up @@ -2359,6 +2360,7 @@ SUBROUTINE W3GRID()
BJALFA = 1.
BJGAM = 0.73
BJFLAG = .TRUE.
BRFLAG = .FALSE.
CALL READNL ( NDSS, 'SDB1', STATUS )
WRITE (NDSO,928) STATUS
BJALFA = MAX ( 0. , BJALFA )
Expand All @@ -2374,6 +2376,7 @@ SUBROUTINE W3GRID()
SDBC1 = BJALFA
SDBC2 = BJGAM
FDONLY = BJFLAG
FSLOPE = BRFLAG
#endif
!
!
Expand Down Expand Up @@ -3317,9 +3320,17 @@ SUBROUTINE W3GRID()
#endif
#ifdef W3_DB1
IF ( BJFLAG ) THEN
WRITE (NDSO,2928) BJALFA, BJGAM, '.TRUE.'
IF (BRFLAG) THEN
WRITE (NDSO,2928) BJALFA, BJGAM, '.TRUE.', '.TRUE.'
ELSE
WRITE (NDSO,2928) BJALFA, BJGAM, '.TRUE.', '.FALSE.'
END IF
ELSE
WRITE (NDSO,2928) BJALFA, BJGAM, '.FALSE.'
IF (BRFLAG) THEN
WRITE (NDSO,2928) BJALFA, BJGAM, '.FALSE.', '.TRUE.'
ELSE
WRITE (NDSO,2928) BJALFA, BJGAM, '.FALSE.', '.FALSE.'
END IF
END IF
#endif
#ifdef W3_PR1
Expand All @@ -3336,7 +3347,7 @@ SUBROUTINE W3GRID()
WRITE (NDSO,2953) CFLTM, WDTHCG, WDTHTH
#endif
!
WRITE (NDSO,2956) UGBCCFL, UGOBCAUTO, UGOBCDEPTH,TRIM(UGOBCFILE), &
WRITE (NDSO,*) UGBCCFL, UGOBCAUTO, UGOBCDEPTH,TRIM(UGOBCFILE), &
EXPFSN, EXPFSPSI, EXPFSFCT, IMPFSN, EXPTOTAL,&
IMPTOTAL, IMPREFRACTION, IMPFREQSHIFT, &
IMPSOURCE, LREAD2DM, SETUP_APPLY_WLV, &
Expand Down Expand Up @@ -6527,7 +6538,7 @@ SUBROUTINE W3GRID()
929 FORMAT ( ' alpha :',F8.3/ &
' gamma :',F8.3)
2928 FORMAT ( ' &SDB1 BJALFA =',F7.3,', BJGAM =',F7.3, &
', BJFLAG = ',A,' /')
', BJFLAG = ',A, ', BRFLAG = ',A,' /')
#endif
!
#ifdef W3_TR0
Expand Down
7 changes: 4 additions & 3 deletions model/src/w3initmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1595,8 +1595,8 @@ SUBROUTINE W3INIT ( IMOD, IsMulti, FEXT, MDS, MTRACE, ODAT, FLGRD, FLGR2, FLGD,
985 FORMAT &
(/' point | X | Y | name '/ &
' --------|-------------|-------------|----------------')
980 FORMAT ( 5X,I5,' |',2(F10.2,' |'),2X,A)
986 FORMAT ( 5X,I5,' |',2(F8.1,'E3 |'),2X,A)
980 FORMAT ( 5X,I5,' |',2(F15.10,' |'),2X,A)
986 FORMAT ( 5X,I5,' |',2(F15.10,'E3 |'),2X,A)
!
981 FORMAT (/' Initial time : ',A)
982 FORMAT ( ' Water level time : ',A)
Expand Down Expand Up @@ -2150,7 +2150,8 @@ SUBROUTINE W3MPIO ( IMOD )
STMAXE, STMAXD, HMAXE, HCMAXE, HMAXD, &
HCMAXD, QP, PTHP0, PQP, PPE, PGW, PSW, &
PTM1, PT1, PT2, PEP, WBT, CX, CY, &
TAUOCX, TAUOCY, WNMEAN, QKK, SKEW, EMBIA1, EMBIA2
TAUOCX, TAUOCY, WNMEAN, &
QKK, SKEW, EMBIA1, EMBIA2,BRCOEF
#endif

#ifdef W3_MPI
Expand Down
16 changes: 14 additions & 2 deletions model/src/w3iogomd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -917,10 +917,13 @@ SUBROUTINE W3FLDTOIJ(FLD, I, J, IAPROC, NAPOUT, NDSEN)
CASE('WNM')
I = 2
J = 19
CASE('BRCOEF')
I = 2
J = 20
#ifdef W3_OASOCM
CASE('THM')
I = 2
J = 20
J = 21
#endif
!
! Group 3
Expand Down Expand Up @@ -2522,7 +2525,7 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD &
USE W3ADATMD, ONLY: AINIT, DW, UA, UD, AS, CX, CY, WN, &
TAUA, TAUADIR
USE W3ADATMD, ONLY: HS, WLM, T02, T0M1, T01, FP0, THM, THS, THP0,&
WBT, WNMEAN
WBT, WNMEAN, BRCOEF
USE W3ADATMD, ONLY: DTDYN, FCUT, ABA, ABD, UBA, UBD, SXX, SYY, SXY,&
PHS, PTP, PLP, PDIR, PSI, PWS, PWST, PNR, &
PTHP0, PQP, PPE, PGW, PSW, PTM1, PT1, PT2, &
Expand Down Expand Up @@ -2846,6 +2849,7 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD &
IF ( FLOGRD( 2,16) ) HCMAXD(ISEA) = UNDEF
IF ( FLOGRD( 2,17) ) WBT (ISEA) = UNDEF
IF ( FLOGRD( 2,19) ) WNMEAN(ISEA) = UNDEF
IF ( FLOGRD( 2,20) ) BRCOEF(ISEA) = UNDEF
!
IF ( FLOGRD( 3, 1) ) EF (ISEA,:) = UNDEF
IF ( FLOGRD( 3, 2) ) TH1M (ISEA,:) = UNDEF
Expand Down Expand Up @@ -3215,6 +3219,11 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD &
WRITE ( NDSOG ) WNMEAN(1:NSEA)
#ifdef W3_ASCII
WRITE ( NDSOA,* ) 'WNMEAN:', WNMEAN(1:NSEA)
#endif
ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 20 ) THEN
WRITE ( NDSOG ) BRCOEF(1:NSEA)
#ifdef W3_ASCII
WRITE ( NDSOA,* ) 'BRCOEF:', BRCOEF(1:NSEA)
#endif
!
! Section 3)
Expand Down Expand Up @@ -3784,6 +3793,9 @@ SUBROUTINE W3IOGO ( INXOUT, NDSOG, IOTST, IMOD &
ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 19 ) THEN
READ (NDSOG,END=801,ERR=802,IOSTAT=IERR) &
WNMEAN(1:NSEA)
ELSE IF ( IFI .EQ. 2 .AND. IFJ .EQ. 20 ) THEN
READ (NDSOG,END=801,ERR=802,IOSTAT=IERR) &
BRCOEF(1:NSEA)
!
! Section 3)
!
Expand Down
10 changes: 5 additions & 5 deletions model/src/w3iogrmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1809,18 +1809,18 @@ SUBROUTINE W3IOGR ( INXOUT, NDSM, IMOD, FEXT &
#ifdef W3_DB1
IF ( WRITE ) THEN
WRITE (NDSM) &
SDBC1, SDBC2, FDONLY
SDBC1, SDBC2, FDONLY, FSLOPE
#ifdef W3_ASCII
WRITE (NDSA,*) &
'SDBC1, SDBC2, FDONLY:', &
SDBC1, SDBC2, FDONLY
'SDBC1, SDBC2, FDONLY, FSLOPE:', &
SDBC1, SDBC2, FDONLY, FSLOPE
#endif
ELSE
READ (NDSM,END=801,ERR=802,IOSTAT=IERR) &
SDBC1, SDBC2, FDONLY
SDBC1, SDBC2, FDONLY, FSLOPE
END IF
!
IF ( FLTEST ) WRITE (NDST,9053) SDBC1, SDBC2, FDONLY
IF ( FLTEST ) WRITE (NDST,9053) SDBC1, SDBC2, FDONLY, FSLOPE
#endif

#ifdef W3_UOST
Expand Down
16 changes: 8 additions & 8 deletions model/src/w3oacpmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -926,14 +926,14 @@ SUBROUTINE GET_LIST_EXCH_FIELD(NDSO, RCV, SND, ID_NB_RCV, ID_NB_SND, RCV_STR, SN
ID_NB_RCV=ID_NB_RCV+1
RCV(ID_NB_RCV)%CL_FIELD_NAME='WW3__SSH'
!
! CASE('CUR')
! ! uz : sea surface zonal currents (m.s-1)
! ID_NB_RCV=ID_NB_RCV+1
! RCV(ID_NB_RCV)%CL_FIELD_NAME='WW3_OSSU'
! !
! ! vz : sea surface meridional currents (m.s-1)
! ID_NB_RCV=ID_NB_RCV+1
! RCV(ID_NB_RCV)%CL_FIELD_NAME='WW3_OSSV'
CASE('CUR')
! uz : sea surface zonal currents (m.s-1)
ID_NB_RCV=ID_NB_RCV+1
RCV(ID_NB_RCV)%CL_FIELD_NAME='WW3_OSSU'
!
! vz : sea surface meridional currents (m.s-1)
ID_NB_RCV=ID_NB_RCV+1
RCV(ID_NB_RCV)%CL_FIELD_NAME='WW3_OSSV'
#endif
!
!
Expand Down
Loading

0 comments on commit 8bb1442

Please sign in to comment.