Restart issue

Bug reports, work arounds and fixes

Moderators: arango, robertson

Post Reply
Message
Author
User avatar
kate
Posts: 4088
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Restart issue

#1 Unread post by kate »

I usually set my restart frequency to once a day, ditto my writing of averages files (each file with one record). However, I tried a restart at less than a day and failed:

Code: Select all

 NETCDF_OPEN - unable to open existing NetCDF file:
               nwgoa_avg_0000.nc
               call from:  def_avg.F
 No such file or directory
I got it to restart with this patch:

Code: Select all

diff --git a/ROMS/Nonlinear/output.F b/ROMS/Nonlinear/output.F
index 8a33e14..65697f5 100644
--- a/ROMS/Nonlinear/output.F
+++ b/ROMS/Nonlinear/output.F
@@ -263,7 +263,7 @@
             END IF
           END IF
           IF ((nrrec(ng).ne.0).and.(iic(ng).eq.ntstart(ng))) THEN
-            IF ((iic(ng)-1).eq.idefAVG(ng)) THEN
+            IF ((iic(ng)-1).le.idefAVG(ng)) THEN
               Ldefine=.FALSE.                 ! finished file, delay
             ELSE                              ! creation of next file
               NewFile=.FALSE.
I don't know if this is right for all situations.

User avatar
kate
Posts: 4088
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: Restart issue

#2 Unread post by kate »

Perhaps this is a better fix:

Code: Select all

diff --git a/ROMS/Nonlinear/output.F b/ROMS/Nonlinear/output.F
index 8a33e14..6800a2b 100644
--- a/ROMS/Nonlinear/output.F
+++ b/ROMS/Nonlinear/output.F
@@ -303,7 +303,7 @@
             IF (AVG(ng)%ncid.ne.-1) THEN
               CALL netcdf_close (ng, iNLM, AVG(ng)%ncid)
             END IF
-            CALL def_avg (ng, Newfile)
+            IF (ifile .ne. 0) CALL def_avg (ng, Newfile)
             IF (exit_flag.ne.NoError) RETURN
             LwrtAVG(ng)=.TRUE.
           END IF

Post Reply