Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions model/src/w3adatmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ MODULE W3ADATMD
#endif
REAL, POINTER :: SPPNT(:,:,:)
!
INTEGER :: ITIME, IPASS, IDLAST, NSEALM
INTEGER :: ITIME, IPASS, IDLAST, NSEALM, ITSTEP
REAL, POINTER :: ALPHA(:,:)
LOGICAL :: AINIT, AINIT2, FL_ALL, FLCOLD, FLIWND
!
Expand Down Expand Up @@ -690,7 +690,7 @@ MODULE W3ADATMD
#endif
REAL, POINTER :: SPPNT(:,:,:)
!
INTEGER, POINTER :: ITIME, IPASS, IDLAST, NSEALM
INTEGER, POINTER :: ITIME, IPASS, IDLAST, NSEALM, ITSTEP
REAL, POINTER :: ALPHA(:,:)
LOGICAL, POINTER :: AINIT, AINIT2, FL_ALL, FLCOLD, FLIWND
!/
Expand Down Expand Up @@ -805,6 +805,7 @@ SUBROUTINE W3NAUX ( NDSE, NDST )
WADATS(I)%IPASS = 0
WADATS(I)%IDLAST = 0
WADATS(I)%NSEALM = 0
WADATS(I)%ITSTEP = 0
WADATS(I)%FLCOLD = .FALSE.
WADATS(I)%FLIWND = .FALSE.
WADATS(I)%AINIT = .FALSE.
Expand Down Expand Up @@ -2789,6 +2790,7 @@ SUBROUTINE W3SETA ( IMOD, NDSE, NDST )
IPASS => WADATS(IMOD)%IPASS
IDLAST => WADATS(IMOD)%IDLAST
NSEALM => WADATS(IMOD)%NSEALM
ITSTEP => WADATS(IMOD)%ITSTEP
FLCOLD => WADATS(IMOD)%FLCOLD
FLIWND => WADATS(IMOD)%FLIWND
AINIT => WADATS(IMOD)%AINIT
Expand Down
4 changes: 2 additions & 2 deletions model/src/w3pro2md.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1412,7 +1412,7 @@ SUBROUTINE W3KTP2 ( ISEA, FACTH, FACK, CTHG0, CG, WN, DEPTH, &
USE W3GDATMD, ONLY: NK, NK2, NTH, NSPEC, SIG, DSIP, ECOS, ESIN, &
EC2, ESC, ES2, FACHFA, MAPWN, FLCTH, FLCK, &
CTMAX
USE W3ADATMD, ONLY: MAPTH2, MAPWN2, ITIME
USE W3ADATMD, ONLY: MAPTH2, MAPWN2, ITIME, ITSTEP
USE W3IDATMD, ONLY: FLCUR
USE W3ODATMD, ONLY: NDSE, NDST
#ifdef W3_S
Expand Down Expand Up @@ -1604,7 +1604,7 @@ SUBROUTINE W3KTP2 ( ISEA, FACTH, FACK, CTHG0, CG, WN, DEPTH, &
!
! 5. Propagate ------------------------------------------------------ *
!
IF ( MOD(ITIME,2) .EQ. 0 ) THEN
IF ( MOD(ITSTEP,2) .EQ. 0 ) THEN
IF ( FLCK ) THEN
DO ITH=1, NTH
VQ(NK+2+(ITH-1)*NK2) = FACHFA * VQ(NK+1+(ITH-1)*NK2)
Expand Down
4 changes: 2 additions & 2 deletions model/src/w3pro3md.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1625,7 +1625,7 @@ SUBROUTINE W3KTP3 ( ISEA, FACTH, FACK, CTHG0, CG, WN, DW, &
USE W3GDATMD, ONLY: NK, NK2, NTH, NSPEC, SIG, DSIP, ECOS, ESIN, &
EC2, ESC, ES2, FACHFA, MAPWN, FLCTH, FLCK, &
CTMAX, DMIN
USE W3ADATMD, ONLY: MAPTH2, MAPWN2, ITIME
USE W3ADATMD, ONLY: MAPTH2, MAPWN2, ITIME, ITSTEP
USE W3IDATMD, ONLY: FLCUR
USE W3ODATMD, ONLY: NDSE, NDST
#ifdef W3_S
Expand Down Expand Up @@ -1848,7 +1848,7 @@ SUBROUTINE W3KTP3 ( ISEA, FACTH, FACK, CTHG0, CG, WN, DW, &
!
! 5. Propagate ------------------------------------------------------ *
!
IF ( MOD(ITIME,2) .EQ. 0 ) THEN
IF ( MOD(ITSTEP,2) .EQ. 0 ) THEN
IF ( FLCK ) THEN
DO ITH=1, NTH
VQ(NK+2+(ITH-1)*NK2) = FACHFA * VQ(NK+1+(ITH-1)*NK2)
Expand Down
6 changes: 5 additions & 1 deletion model/src/w3wavemd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,10 @@ SUBROUTINE W3WAVE ( IMOD, ODAT, TEND, STAMP, NO_OUT &
DTGA = DTTST / REAL(NT)
IF ( DTTST .EQ. 0. ) THEN
IT0 = 0
IF ( .NOT.FLZERO ) ITIME = ITIME - 1
IF ( .NOT.FLZERO ) THEN
ITIME = ITIME - 1
ITSTEP = ITSTEP - 1
END IF
NT = 0
ELSE
IT0 = 1
Expand Down Expand Up @@ -1072,6 +1075,7 @@ SUBROUTINE W3WAVE ( IMOD, ODAT, TEND, STAMP, NO_OUT &
call print_memcheck(memunit, 'memcheck_____:'//' WW3_WAVE TIME LOOP 0')
!
ITIME = ITIME + 1
ITSTEP = ITSTEP + 1
!
DTG = REAL(NINT(DTGA+DTRES+0.0001))
DTRES = DTRES + DTGA - DTG
Expand Down
38 changes: 31 additions & 7 deletions model/src/wav_restart_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ module wav_restart_mod
subroutine write_restart (fname, va, mapsta)

use w3odatmd , only : time_origin, calendar_name, elapsed_secs
use w3adatmd , only : ITSTEP

real , intent(in) :: va(1:nspec,0:nsealm)
integer , intent(in) :: mapsta(ny,nx)
Expand Down Expand Up @@ -131,10 +132,17 @@ subroutine write_restart (fname, va, mapsta)
if (addrstflds) then
do i = 1,rstfldcnt
vname = trim(rstfldlist(i))
ierr = pio_def_var(pioid, trim(vname), PIO_REAL, (/xtid, ytid, timid/), varid)
call handle_err(ierr, 'define variable '//trim(vname))
ierr = pio_put_att(pioid, varid, '_FillValue', nf90_fill_float)
call handle_err(ierr, 'define _FillValue '//trim(vname))
if (vname == 'itstep' .or. vname == 'itstep_w') then
ierr = pio_def_var(pioid, 'itstep', PIO_INT, (/timid/), varid)
call handle_err(ierr,'def_itstep')
ierr = pio_put_att(pioid, varid, '_FillValue', nf90_fill_int)
call handle_err(ierr,'def_itstep_fillvalue')
else
ierr = pio_def_var(pioid, trim(vname), PIO_REAL, (/xtid, ytid, timid/), varid)
call handle_err(ierr, 'define variable '//trim(vname))
ierr = pio_put_att(pioid, varid, '_FillValue', nf90_fill_float)
call handle_err(ierr, 'define _FillValue '//trim(vname))
end if
end do
end if
! end variable definitions
Expand Down Expand Up @@ -202,7 +210,15 @@ subroutine write_restart (fname, va, mapsta)
if (addrstflds) then
do i = 1,rstfldcnt
vname = trim(rstfldlist(i))
if (vname == 'ice')call write_globalfield(vname, nseal_cpl, ice(1:nsea))
if (vname == 'ice') then
call write_globalfield(vname, nseal_cpl, ice(1:nsea))
end if
if (vname == 'itstep' .or. vname == 'itstep_w') then
ierr = pio_inq_varid(pioid, 'itstep', varid)
call handle_err(ierr, 'inquire variable itstep ')
ierr = pio_put_var(pioid, varid, (/1/), ITSTEP)
call handle_err(ierr, 'put itstep')
end if
end do
end if

Expand All @@ -229,7 +245,7 @@ end subroutine write_restart
subroutine read_restart (fname, va, mapsta, mapst2)

use mpi_f08
use w3adatmd , only : mpi_comm_wave
use w3adatmd , only : mpi_comm_wave, itstep
use w3gdatmd , only : sig
use w3idatmd , only : icei
use w3wdatmd , only : time, tlev, tice, trho, tic1, tic5, wlv, asf, fpis
Expand Down Expand Up @@ -371,7 +387,15 @@ subroutine read_restart (fname, va, mapsta, mapst2)
if (addrstflds) then
do i = 1,rstfldcnt
vname = trim(rstfldlist(i))
if (vname == 'ice')call read_globalfield(wave_communicator, vname, nseal_cpl, ice(1:nsea), icei)
if (vname == 'ice') then
call read_globalfield(wave_communicator, vname, nseal_cpl, ice(1:nsea), icei)
end if
if (vname == 'itstep' .or. vname == 'itstep_r') then
ierr = pio_inq_varid(pioid, 'itstep', varid)
call handle_err(ierr, 'inquire variable itstep ')
ierr = pio_get_var(pioid, varid, (/1/), ITSTEP)
call handle_err(ierr, 'get variable itstep')
end if
end do
end if

Expand Down
Loading