From ee729d96bcc72b903c6df80e9846329baa7c9938 Mon Sep 17 00:00:00 2001 From: Jessica Meixner Date: Fri, 24 Jan 2025 01:34:37 +0000 Subject: [PATCH 1/2] make sure ww3 restart is read --- model/src/w3initmd.F90 | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/model/src/w3initmd.F90 b/model/src/w3initmd.F90 index 2389539f1..12dc75bf7 100644 --- a/model/src/w3initmd.F90 +++ b/model/src/w3initmd.F90 @@ -985,9 +985,22 @@ SUBROUTINE W3INIT ( IMOD, IsMulti, FEXT, MDS, MTRACE, ODAT, FLGRD, FLGR2, FLGD, call extcde (60, msg="required restart file " // trim(fname) // " does not exist") end if else - call read_restart('none') - ! mapst2 is module variable defined in read of mod_def; maptst is from 2.b above - flcold = .true. + if (restart_from_binary) then + call set_user_timestring(time,user_timestring) + fname = trim(user_restfname)//trim(user_timestring) + inquire(file=trim(fname), exist=exists) + if (exists) then + call w3iors('READ', nds(6), sig(nk), imod, filename=trim(fname)) + else + call read_restart('none') + ! mapst2 is module variable defined in read of mod_def; maptst is from 2.b above + flcold = .true. + end if + else + call read_restart('none') + ! mapst2 is module variable defined in read of mod_def; maptst is from 2.b above + flcold = .true. + end if end if else #endif From 5e7dcf04d4180241df1cb2626ca08b1c81db6c51 Mon Sep 17 00:00:00 2001 From: Jessica Meixner Date: Mon, 27 Jan 2025 21:19:34 +0000 Subject: [PATCH 2/2] fail if restart does not exist for initial run and binary restart --- model/src/w3initmd.F90 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/model/src/w3initmd.F90 b/model/src/w3initmd.F90 index 12dc75bf7..a49637653 100644 --- a/model/src/w3initmd.F90 +++ b/model/src/w3initmd.F90 @@ -992,10 +992,8 @@ SUBROUTINE W3INIT ( IMOD, IsMulti, FEXT, MDS, MTRACE, ODAT, FLGRD, FLGR2, FLGD, if (exists) then call w3iors('READ', nds(6), sig(nk), imod, filename=trim(fname)) else - call read_restart('none') - ! mapst2 is module variable defined in read of mod_def; maptst is from 2.b above - flcold = .true. - end if + call extcde (60, msg="required restart file " // trim(fname) // " does not exist") + end if else call read_restart('none') ! mapst2 is module variable defined in read of mod_def; maptst is from 2.b above