Canyon test case: unable to open restart NetCDF file

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
breed

Canyon test case: unable to open restart NetCDF file

#1 Unread post by breed »

Hi,

I cannot get the canyon 2D test case to work, but weirdly the 3D case works fine. For 2D it's failing at the very start when it tries to create/open the restart ncfile. I checked the directory and it doesn't get created (whereas it does for the 3D case).

Code: Select all

 TIME-STEP YYYY-MM-DD hh:mm:ss.ss  KINETIC_ENRG   POTEN_ENRG    TOTAL_ENRG    NET_VOLUME
                       C => (i,j)       Cu            Cv           C Max       Max Speed

         1 0001-01-01 00:00:05.00  0.000000E+00  0.000000E+00  0.000000E+00  3.414983E+13
                          (00,00)  0.000000E+00  0.000000E+00  0.000000E+00  0.000000E+00
  DEF_RST_NF90     - inquiring restart file,           Grid 01: roms_rst.nc
 Found Error: 02   Line: 8960     Source: ROMS/Modules/mod_netcdf.F, netcdf_open

 NETCDF_OPEN - unable to open existing NetCDF file:
               roms_rst.nc
               call from:  ROMS/Utility/def_rst.F, def_rst_nf90
               No such file or directory                                                       
 Found Error: 03   Line: 1597     Source: ROMS/Utility/def_rst.F, def_rst_nf90

 DEF_RST_NF90 - unable to open restart NetCDF file: roms_rst.nc
 Found Error: 03   Line: 82       Source: ROMS/Utility/def_rst.F
 Found Error: 03   Line: 585      Source: ROMS/Nonlinear/output.F
 Found Error: 03   Line: 407      Source: ROMS/Nonlinear/main2d.F
 Found Error: 03   Line: 298      Source: ROMS/Drivers/nl_roms.h, ROMS_run
Does anyone have any ideas? Do I need to provide more information?

Thanks,
Brad
Attachments
runout-50751306.txt
(14.28 KiB) Downloaded 115 times

MIDHILAVARNAV
Posts: 30
Joined: Fri Dec 15, 2017 6:07 pm

Re: Canyon test case: unable to open restart NetCDF file

#2 Unread post by MIDHILAVARNAV »

The reason for this is probably the location of the file directory you provided, ROMS could not locate the restart file location. Pl check if the location you provided in .in file is correct or not.

User avatar
wilkin
Posts: 872
Joined: Mon Apr 28, 2003 5:44 pm
Location: Rutgers University
Contact:

Re: Canyon test case: unable to open restart NetCDF file

#3 Unread post by wilkin »

That looks like a write permissions error.

ROMS is not reading the restart file ... because you have ANA_INITIAL and it creates the initial conditions internally.

The log shows the error occurs in DEF_RST_NF90, i.e., when ROMS is trying to define/create the restart file.

You may not have permissions to write in the output directory, or you have set a path to the restart file that does not exist.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

breed

Re: Canyon test case: unable to open restart NetCDF file

#4 Unread post by breed »

Thank you both for your suggestions.
wilkin wrote: Tue Nov 01, 2022 12:54 pm That looks like a write permissions error.

ROMS is not reading the restart file ... because you have ANA_INITIAL and it creates the initial conditions internally.

The log shows the error occurs in DEF_RST_NF90, i.e., when ROMS is trying to define/create the restart file.

You may not have permissions to write in the output directory, or you have set a path to the restart file that does not exist.
What confuses me about it being a permissions issue is why the 3D works fine but the 2D doesn't. All model runs get written to the same parent directory.

It seems like the 2D run fails in def_rst_nf90 (line 1597) when trying to call netcdf_open - but this should be after it has already created the nc file earlier in the script. I don't quite understand the following section of code in def_rst.F (lines 144-148), but this appears to be the switch to ensure the netcdf file gets written (on line 163):

Code: Select all

IF (((nrrec(ng).eq.0).and.(iic(ng).eq.ntstart(ng))).or.           &
     &    ((nrrec(ng).ne.0).and.                                        &
     &     (TRIM(ncname).ne.TRIM(INI(ng)%name)))) THEN
        Ldefine=.TRUE.
      END IF

In the process of trying to diagnose this I noticed some other things that differ between the 2D and 3D cases that I don't understand. Please can you help clarify them if possible?
  • In the 3D log file (attached) there is a 0 timestep, whilst there isn't for the 2D case
  • In the 3D log file (attached) it says that it creates the history, average and restart files (in that order at timestep 0), whereas for 2D it just says 'inquiring restart file' (at timestep 1), without the his, avg first
Attachments
runout-52886208.txt
(2.99 MiB) Downloaded 98 times

User avatar
wilkin
Posts: 872
Joined: Mon Apr 28, 2003 5:44 pm
Location: Rutgers University
Contact:

Re: Canyon test case: unable to open restart NetCDF file

#5 Unread post by wilkin »

That does look like a bug.

There aren't a lot of of users running 2D ROMS, so it's possible some bug crept in with file handling.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

User avatar
arango
Site Admin
Posts: 1347
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Re: Canyon test case: unable to open restart NetCDF file

#6 Unread post by arango »

Yes, I fixed main2d.F some time ago in my research repositories, but I forgot to do it in the distributed svn and git repositories. Please update for code. Here is that :arrow: trac ticket.

breed

Re: Canyon test case: unable to open restart NetCDF file

#7 Unread post by breed »

Thank you for the update, works perfectly!

Post Reply