Question about tidal forcing in the nesting application

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
lizengocean09
Posts: 5
Joined: Mon Dec 31, 2018 8:42 pm
Location: China Institute of Water Resources and Hydropower

Question about tidal forcing in the nesting application

#1 Unread post by lizengocean09 »

Dear all,
I used otps2frc_v5 in ROMS_TOOL to generate a tidal forcing file my_test_tides_a.nc. However, when I used this forcing file in a nesting application, some errors appeared. The error messages are as follows.

Found Error: ** Line: 8378 Source: ROMS/Modules/mod_netcdf.F, netcdf_open
NETCDF_OPEN - unable to open existing NetCDF file:
my_test_tides_a.nc
call from: ROMS/Utility/inp_decode.F, find_file
Found Error: 03 Line: 1423 Source: ROMS/Modules/mod_netcdf.F, netcdf_inq_var
Found Error: 03 Line: 178 Source: ROMS/Modules/mod_tides.F, allocate_tides
At line 123 of file mod_tides.f90
Fortran runtime error: Index '2' of dimension 1 of array 'tides' above upper bound of 0
Error termination. Backtrace:
At line 123 of file mod_tides.f90
Fortran runtime error: Index '2' of dimension 1 of array 'tides' above upper bound of 0.

In the header file, the CPPs for tidal forcing are as follows
#define SSH_TIDES
#define UV_TIDES
#define ADD_FSOBC
#define ADD_M2OBC
#define ANA_FSOBC
#define ANA_M2OBC

I don’t understand the meaning of “Fortran runtime error: Index '2' of dimension 1 of array 'tides' above upper bound of 0”.

I am sure that the file my_test_tides_a.nc exists in the working directory, but why I got this error “unable to open existing NetCDF file”.

The version of ROMS I used is 3.7.

It would be much appreciated.

Best wishes,

Li

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

Re: Question about tidal forcing in the nesting application

#2 Unread post by wilkin »

NETCDF_OPEN - unable to open existing NetCDF file:
my_test_tides_a.nc
This suggests ROMS did not find your tides file. The path to the file that you specified in ocean.in (or roms.in these days) may be incorrect or, if it is a relative path, not consistent with the directory in which you are running the model. Check your ocean.in

You mention tides in a nesting application. With nesting, the inner child grid gets its boundary sea level from the parent, not from a tides file (your LBC flags for the child grid should be "Nes").

Does this application run OK with tides when you do not activate nesting?
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

lizengocean09
Posts: 5
Joined: Mon Dec 31, 2018 8:42 pm
Location: China Institute of Water Resources and Hydropower

Re: Question about tidal forcing in the nesting application

#3 Unread post by lizengocean09 »

John Wilkin, Thank you very much for your help!

I have checked the path of the tidal forcing file my_test_tides_a.nc. Indeed, it is in the correct drectory.

The tidal forcing is set in the my_test_nested_2g_ab.in file.
! Input tidal forcing file name.
TIDENAME == ../Data/my_test_tides_a.nc

I have also checked the boundary condition, and the inner child grid can get its surface level from the parent. The boundary conditions are specified as follows
LBC(isFsur) == Clo Cha Cha Cha \
Nes Nes Nes Nes
LBC(isUbar) == Clo Fla Fla Fla \
Nes Nes Nes Nes
LBC(isVbar) == Clo Fla Fla Fla \
Nes Nes Nes Nes
LBC(isUvel) == Clo Rad Rad Rad \
Nes Nes Nes Nes
LBC(isVvel) == Clo Rad Rad Rad \
Nes Nes Nes Nes
LBC(isMtke) == Clo Gra Gra Gra \
Nes Nes Nes Nes

LBC(isTvar) == Clo Rad Rad Rad \
Clo Rad Rad Rad \
Nes Nes Nes Nes \
Nes Nes Nes Nes

Are there any special settings in the file my_test_nested_2g_ab.in or corresponding .h file for ROMS nesting application?

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

Re: Question about tidal forcing in the nesting application

#4 Unread post by wilkin »

If indeed the TIDENAME is where it is supposed to be ...
! Input tidal forcing file name.
TIDENAME == ../Data/my_test_tides_a.nc
then the message ...
NETCDF_OPEN - unable to open existing NetCDF file:
my_test_tides_a.nc
presumably means the permissions on the file are denying read access.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

lizengocean09
Posts: 5
Joined: Mon Dec 31, 2018 8:42 pm
Location: China Institute of Water Resources and Hydropower

Re: Question about tidal forcing in the nesting application

#5 Unread post by lizengocean09 »

John Wilkin, Thanks a lot!

I am wondering whether I set the .h file correctly?

#define UV_ADV
#define UV_COR
#define DJ_GRADPS
#define NONLIN_EOS
#define SALINITY
#define SOLVE3D
#define MASKING

#define WEST_WALL

#define SOUTH_FSCHAPMAN
#define SOUTH_M2FLATHER
#define SOUTH_TRADITION
#define SOUTH_M3GRDIENT
#define SOUTH_TGRADIENT

#define EAST_FSCHAPMAN
#define EAST_M2FLATHER
#define EAST_TRADITION
#define EAST_M3GRDIENT
#define EAST_TGRADIENT

#define NORTH_FSCHAPMAN
#define NORTH_M2FLATHER
#define NORTH_TRADITION
#define NORTH_M3GRDIENT
#define NORTH_TGRADIENT

#define SSH_TIDES
#define UV_TIDES
#define ADD_FSOBC
#define ADD_M2OBC
#define ANA_FSOBC
#define ANA_M2OBC

#define ANA_SMFLUX
#define ANA_STFLUX
#define ANA_SSFLUX
#define ANA_BPFLUX
#define ANA_BTFLUX
#define ANA_BSFLUX
#define ANA_SPFLUX
#define ANA_SRFLUX

What could deny the access to the tidal forcing file? Is it being accessed by other subroutines? This may be related to the basic codes of ROMS.

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

Re: Question about tidal forcing in the nesting application

#6 Unread post by wilkin »

Update your code. Those boundary condition #define(s) have been superseded by logical switches in ocean.in.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

Post Reply