Skip to content

Commit

Permalink
correction for the wave setup at some output points
Browse files Browse the repository at this point in the history
  • Loading branch information
heloisemichaud committed Oct 24, 2024
1 parent 8bb1442 commit 509b38e
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 32 deletions.
40 changes: 20 additions & 20 deletions model/src/w3iopomd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ MODULE W3IOPOMD
!> Variable name for the netCDF point output file, for DAIRO.
character(*), parameter, private :: VNAME_DAIRO = 'DAIRO'

!> Variable name for the netCDF point output file, for ZET_SETO.
character(*), parameter, private :: VNAME_ZET_SETO = 'ZET_SETO'
!> Variable name for the netCDF point output file, for ZETA_SETUPO.
character(*), parameter, private :: VNAME_ZETA_SETUPO = 'ZETA_SETUPO'

!> Variable name for the netCDF point output file, for ASO.
character(*), parameter, private :: VNAME_ASO = 'ASO'
Expand Down Expand Up @@ -801,7 +801,7 @@ SUBROUTINE W3IOPE ( A )
#endif
#ifdef W3_SETUP
USE W3WDATMD, ONLY: ZETA_SETUP
USE W3ODATMD, ONLY: ZET_SETO
USE W3ODATMD, ONLY: ZETA_SETUPO
#endif
#ifdef W3_MPI
USE W3ODATMD, ONLY: IRQPO2
Expand Down Expand Up @@ -947,7 +947,7 @@ SUBROUTINE W3IOPE ( A )
DPO(I) = RD(1)*DW(IS(1)) + RD(2)*DW(IS(2)) + &
RD(3)*DW(IS(3)) + RD(4)*DW(IS(4))
#ifdef W3_SETUP
DPO(I) = RD(1)*ZETA_SETUP(IS(1)) + &
ZETA_SETUPO(I) = RD(1)*ZETA_SETUP(IS(1)) + &
RD(2)*ZETA_SETUP(IS(2)) + &
RD(3)*ZETA_SETUP(IS(3)) + &
RD(4)*ZETA_SETUP(IS(4))
Expand Down Expand Up @@ -1156,13 +1156,13 @@ SUBROUTINE W3IOPON_READ(IOTST, IMOD_IN, filename, ncerr)
USE W3ODATMD, ONLY: NDST, NDSE, IPASS => IPASS2, NOPTS, IPTINT, &
IL, IW, II, PTLOC, PTIFAC, DPO, WAO, WDO, &
ASO, CAO, CDO, SPCO, PTNME, O2INIT, FNMPRE, &
GRDID, ICEO, ICEHO, ICEFO, W3DMO2
GRDID, ICEO, ICEHO, ICEFO, W3DMO2,ZETA_SETUPO
USE W3SERVMD, ONLY: EXTCDE
#ifdef W3_FLX5
USE W3ODATMD, ONLY: TAUAO, TAUDO, DAIRO
#endif
#ifdef W3_SETUP
USE W3ODATMD, ONLY: ZET_SETO
USE W3WDATMD,, ONLY: ZETA_SETUP
#endif
IMPLICIT NONE

Expand All @@ -1180,7 +1180,7 @@ SUBROUTINE W3IOPON_READ(IOTST, IMOD_IN, filename, ncerr)
integer :: v_tauao,v_taudo, v_dairo
#endif
#ifdef W3_SETUP
integer :: v_zet_seto
integer :: v_zeta_setup
#endif
integer :: v_aso, v_cao, v_cdo, v_iceo
integer :: v_iceho, v_icefo, v_grdid, v_spco
Expand Down Expand Up @@ -1341,9 +1341,9 @@ SUBROUTINE W3IOPON_READ(IOTST, IMOD_IN, filename, ncerr)
if (nf90_err(ncerr) .ne. 0) return
#endif
#ifdef W3_SETUP
ncerr = nf90_inq_varid(fh, ZET_SETO, v_zet_seto)
ncerr = nf90_inq_varid(fh, ZETA_SETUP, v_zeta_setup)
if (nf90_err(ncerr) .ne. 0) return
ncerr = nf90_get_var(fh, v_zet_seto, ZET_SETO, start = (/ 1, IPASS/), &
ncerr = nf90_get_var(fh, v_zeta_setup, ZETA_SETUP, start = (/ 1, IPASS/), &
count = (/ NOPTS, 1 /))
if (nf90_err(ncerr) .ne. 0) return
#endif
Expand Down Expand Up @@ -1436,7 +1436,7 @@ SUBROUTINE W3IOPON_WRITE(timestep_only,filename, ncerr)
USE W3ODATMD, ONLY: TAUAO, TAUDO, DAIRO
#endif
#ifdef W3_SETUP
USE W3ODATMD, ONLY: ZET_SETO
USE W3WDATMD, ONLY: ZETA_SETUP
#endif

IMPLICIT NONE
Expand Down Expand Up @@ -1539,7 +1539,7 @@ SUBROUTINE W3IOPON_WRITE(timestep_only,filename, ncerr)
if (nf90_err(ncerr) .ne. 0) return
#endif
#ifdef W3_SETUP
ncerr = nf90_def_var(fh, VNAME_ZET_SETO, NF90_FLOAT, (/d_nopts, d_time/), v_zet_seto)
ncerr = nf90_def_var(fh, VNAME_ZETA_SETUPO, NF90_FLOAT, (/d_nopts, d_time/), v_zeta_setupo)
if (nf90_err(ncerr) .ne. 0) return
#endif
ncerr = nf90_def_var(fh, VNAME_ASO, NF90_FLOAT, (/d_nopts, d_time/), v_aso)
Expand Down Expand Up @@ -1630,7 +1630,7 @@ SUBROUTINE W3IOPON_WRITE(timestep_only,filename, ncerr)
if (nf90_err(ncerr) .ne. 0) return
#endif
#ifdef W3_SETUP
ncerr = nf90_inq_varid(fh, VNAME_ZET_SETO, v_zet_seto)
ncerr = nf90_inq_varid(fh, VNAME_ZETA_SETUPO, v_zeta_setupo)
if (nf90_err(ncerr) .ne. 0) return
#endif
ncerr = nf90_inq_varid(fh, VNAME_ASO, v_aso)
Expand Down Expand Up @@ -1677,7 +1677,7 @@ SUBROUTINE W3IOPON_WRITE(timestep_only,filename, ncerr)
if (nf90_err(ncerr) .ne. 0) return
#endif
#ifdef W3_SETUP
ncerr = nf90_put_var(fh, v_zet_seto, ZET_SETO, start = (/ 1, itime/), &
ncerr = nf90_put_var(fh, v_zeta_setupo, ZETA_SETUPO, start = (/ 1, itime/), &
count = (/ nopts, 1 /))
if (nf90_err(ncerr) .ne. 0) return
#endif
Expand Down Expand Up @@ -1867,7 +1867,7 @@ END SUBROUTINE W3IOPON
!> 4 | real | TAUAO | (W3_FLX5 only) Interpolated atmospheric stresses.
!> 4 | real | TAUDO | (W3_FLX5 only) Interpolated atmospheric stress directions.
!> 4 | real | DAIRO | (W3_FLX5 only) Interpolated rho atmosphere.
!> 4 | real | ZET_SETO | (W3_SETUP only) Used for wave setup.
!> 4 | real | ZETA_SETUPO | (W3_SETUP only) Used for wave setup.
!> 4 | real | ASO | Interpolated air-sea temperature difference
!> 4 | real | CAO | Interpolated current speeds.
!> 4 | real | CDO | Interpolated current directions.
Expand Down Expand Up @@ -1990,14 +1990,14 @@ SUBROUTINE W3IOPO ( INXOUT, NDSOP, IOTST, IMOD &
USE W3ODATMD, ONLY: NDST, NDSE, IPASS => IPASS2, NOPTS, IPTINT, &
IL, IW, II, PTLOC, PTIFAC, DPO, WAO, WDO, &
ASO, CAO, CDO, SPCO, PTNME, O2INIT, FNMPRE, &
GRDID, ICEO, ICEHO, ICEFO
GRDID, ICEO, ICEHO, ICEFO,ZETA_SETUPO
#ifdef W3_FLX5
USE W3ODATMD, ONLY: TAUAO, TAUDO, DAIRO
#endif
USE W3ODATMD, ONLY : OFILES
!/
#ifdef W3_SETUP
USE W3ODATMD, ONLY: ZET_SETO
USE W3WDATMD, ONLY: ZETA_SETUP
#endif
!/
USE W3SERVMD, ONLY: EXTCDE
Expand Down Expand Up @@ -2281,7 +2281,7 @@ SUBROUTINE W3IOPO ( INXOUT, NDSOP, IOTST, IMOD &
TAUAO(I), TAUDO(I), DAIRO(I), &
#endif
#ifdef W3_SETUP
ZET_SETO(I), &
ZETA_SETUPO(I), &
#endif
ASO(I), CAO(I), CDO(I), ICEO(I), ICEHO(I), &
ICEFO(I), GRDID(I), (SPCO(J,I),J=1,NSPEC)
Expand All @@ -2294,8 +2294,8 @@ SUBROUTINE W3IOPO ( INXOUT, NDSOP, IOTST, IMOD &
TAUAO(I), TAUDO(I), DAIRO(I), &
#endif
#ifdef W3_SETUP
'ZET_SETO(I):', &
ZET_SETO(I), &
'ZETA_SETUPO(I):', &
ZETA_SETUPO(I), &
#endif
'ASO(I), CAO(I), CDO(I), ICEO(I), ICEHO(I):', &
ASO(I), CAO(I), CDO(I), ICEO(I), ICEHO(I), &
Expand All @@ -2309,7 +2309,7 @@ SUBROUTINE W3IOPO ( INXOUT, NDSOP, IOTST, IMOD &
TAUAO(I), TAUDO(I), DAIRO(I), &
#endif
#ifdef W3_SETUP
ZET_SETO(I), &
ZETA_SETUPO(I), &
#endif
ASO(I), CAO(I), CDO(I), ICEO(I), ICEHO(I), &
ICEFO(I), GRDID(I), (SPCO(J,I),J=1,NSPEC)
Expand Down
8 changes: 4 additions & 4 deletions model/src/w3odatmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ MODULE W3ODATMD
#endif
CAO(:), CDO(:), ICEO(:), ICEHO(:), &
ICEFO(:), SPCO(:,:)
REAL, POINTER :: ZET_SETO(:) ! For the wave setup.
REAL, POINTER :: ZETA_SETUPO(:) ! For the wave setup.

CHARACTER(LEN=40), POINTER :: PTNME(:)
CHARACTER(LEN=13), POINTER :: GRDID(:)
Expand Down Expand Up @@ -496,7 +496,7 @@ MODULE W3ODATMD
#endif
CAO(:), CDO(:), ICEO(:), ICEHO(:), &
ICEFO(:), SPCO(:,:)
REAL, POINTER :: ZET_SETO(:)
REAL, POINTER :: ZETA_SETUPO(:)
!
CHARACTER(LEN=40), POINTER :: PTNME(:)
CHARACTER(LEN=13), POINTER :: GRDID(:)
Expand Down Expand Up @@ -1078,7 +1078,7 @@ SUBROUTINE W3DMO2 ( IMOD, NDSE, NDST, NPT )
OUTPTS(IMOD)%OUT2%GRDID(NPT) , &
OUTPTS(IMOD)%OUT2%DPO(NPT) , &
OUTPTS(IMOD)%OUT2%WAO(NPT) , &
OUTPTS(IMOD)%OUT2%ZET_SETO(NPT) , &
OUTPTS(IMOD)%OUT2%ZETA_SETUPO(NPT) , &
OUTPTS(IMOD)%OUT2%WDO(NPT) , &
OUTPTS(IMOD)%OUT2%ASO(NPT) , &
#ifdef W3_FLX5
Expand Down Expand Up @@ -1703,7 +1703,7 @@ SUBROUTINE W3SETO ( IMOD, NDSERR, NDSTST )
PTIFAC => OUTPTS(IMOD)%OUT2%PTIFAC
DPO => OUTPTS(IMOD)%OUT2%DPO
WAO => OUTPTS(IMOD)%OUT2%WAO
ZET_SETO => OUTPTS(IMOD)%OUT2%ZET_SETO
ZETA_SETUPO => OUTPTS(IMOD)%OUT2%ZETA_SETUPO
WDO => OUTPTS(IMOD)%OUT2%WDO
ASO => OUTPTS(IMOD)%OUT2%ASO
#ifdef W3_FLX5
Expand Down
12 changes: 6 additions & 6 deletions model/src/w3wavset.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1758,12 +1758,12 @@ SUBROUTINE TRIG_WAVE_SETUP_COMPUTATION
!DW (ISEA) = MAX ( 0. , WLVeff-ZB(ISEA) )
DW (IX) = MAX ( 0. , ZETA_WORK_ALL(IX) - ZB(IX) )
END DO
IF (IAPROC .EQ. 1) THEN
write(6666) 1.
write(6667) 1.
write(6666) (ZETA_WORK_ALL(IX), ZETA_WORK_ALL(IX), ZETA_WORK_ALL(IX), IX = 1, NX)
write(6667) (ZETA_WORK_ALL(IX), ZETA_WORK_ALL(IX), DW(IX), IX = 1, NX)
ENDIF
! IF (IAPROC .EQ. 1) THEN
! write(6666) 1.
! write(6667) 1.
! write(6666) (ZETA_WORK_ALL(IX), ZETA_WORK_ALL(IX), ZETA_WORK_ALL(IX), IX = 1, NX)
! write(6667) (ZETA_WORK_ALL(IX), ZETA_WORK_ALL(IX), DW(IX), IX = 1, NX)
! ENDIF
!WRITE(*,*) SUM(ZETA_WORK_ALL), SUM(ZETA_SETUP), SUM(ZETA_WORK_ALL), SUM(ZETA_WORK), MAXVAL(ZETA_SETUP), MINVAL(ZETA_SETUP), MAXVAL(DW), MINVAL(DW)
#ifdef W3_DEBUGSTP
WRITE(740+IAPROC,*) 'Now exiting TRIG_WAVE_SETUP_COMPUTATION'
Expand Down
4 changes: 2 additions & 2 deletions model/src/ww3_ounp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ PROGRAM W3OUNP
USE W3ODATMD, ONLY: NDST
#endif
#ifdef W3_SETUP
USE W3ODATMD, ONLY: ZET_SETO
USE W3ODATMD, ONLY: ZETA_SETUPO
#endif
!
#ifdef W3_O14
Expand Down Expand Up @@ -2750,7 +2750,7 @@ SUBROUTINE W3EXNC(I,NCID,NREQ,INDREQ,ORDER)
IRET=NF90_PUT_VAR(NCID,VARID(9),WAO(J),(/ J1,IOUT /))
IRET=NF90_PUT_VAR(NCID,VARID(10),UDIR,(/ J1,IOUT /))
#ifdef W3_SETUP
IRET=NF90_PUT_VAR(NCID,VARID(11),ZET_SETO,(/ J1,IOUT /))
IRET=NF90_PUT_VAR(NCID,VARID(11),ZETA_SETUPO(J),(/ J1,IOUT /))
#endif

!
Expand Down

0 comments on commit 509b38e

Please sign in to comment.