Problems with new AVERAGES_DETIDE option

Report or discuss software problems and other woes

Moderators: arango, robertson

Post Reply
Message
Author
jprinehimer
Posts: 20
Joined: Fri Oct 20, 2006 3:34 pm
Location: VIMS

Problems with new AVERAGES_DETIDE option

#1 Unread post by jprinehimer »

Hi -
I'm trying to use the new AVERAGES_DETIDE option in a simple estuary-like domain. The model runs fine without the option, but when I turn it on, I get this error when it tries to write out to the file:

Code: Select all

WRT_TIDES - error while writing variable: Hcount
             into tide forcing NetCDF file:
             Data/Forcing/frc_tides.nc
I suspect this is because my netcdf forcing file does not have a required dimension. Here's a shortened version (attributes removed) of the ncdump -h:

Code: Select all

netcdf frc_tides {
dimensions:
        xi_rho = 102 ;
        eta_rho = 5 ;
        tide_period = 3 ;
variables:
        double tide_period(tide_period) ;                
        double tide_Ephase(tide_period, eta_rho, xi_rho) ;                
        double tide_Eamp(tide_period, eta_rho, xi_rho) ;               
        double tide_Cphase(tide_period, eta_rho, xi_rho) ;                
        double tide_Cangle(tide_period, eta_rho, xi_rho) ;               
        double tide_Cmin(tide_period, eta_rho, xi_rho) ;             
        double tide_Cmax(tide_period, eta_rho, xi_rho) ;
}
As I understand, Hcount is necessary for restart information for the detiding equations. Why is this written to the forcing file and not the restart file? To me, it seems like a big no-no to write to a forcing file.

J.Paul

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

#2 Unread post by arango »

Perhaps, you have a file protection on Data/Forcing/frc_tides.nc and this file cannot be opened for writing. Hcount is an integer variable and does not have a dimension.
As I understand, Hcount is necessary for restart information for the detiding equations. Why is this written to the forcing file and not the restart file? To me, it seems like a big no-no to write to a forcing file.
Thank you for your opinion. Actually, it is because of the way that forcing is processed in ROMS, allowing multiple files, this kind of information cannot be written anywhere but in the tidal forcing NetCDF. It needs to be read only once. I recommend to have separate tidal forcing files in ROMS. This file is usually small. It doesn't have a time record but a tide_period record. You can save a clean copy of such file. We use this strategy a lot in all adjoint-based algorithms. One of the powerful capabilities of NetCDF is that it is possible to open existing files and append data to it.

Recall that we are doing a :arrow: least-squares; the larger the summation the better the filtering. This information needs to be together with all tidal harmonics.

jprinehimer
Posts: 20
Joined: Fri Oct 20, 2006 3:34 pm
Location: VIMS

#3 Unread post by jprinehimer »

Perhaps, you have a file protection on Data/Forcing/frc_tides.nc and this file cannot be opened for writing. Hcount is an integer variable and does not have a dimension.
I have write permission. I did a chmod a+w just in case and put the full path in the ocean.in file and that failed to work. Could there be some other kind of write protection? Could it be related to the cluster setup?
Thank you for your opinion. Actually, it is because of the way that forcing is processed in ROMS, allowing multiple files, this kind of information cannot be written anywhere but in the tidal forcing NetCDF.
I don't know that part of the code well, but if that's the only way it works I'll take your word for it ;-).
I recommend to have separate tidal forcing files in ROMS.
Do you mean two separate tidal files, one to read from and one to write to (I didn't think that was possible). OR do you mean separate from all the other forcing files, which it is in this case. In fact, the tidal forcing file is the only forcing file as everything else is done analytically.

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

#4 Unread post by arango »

I meant separate from other forcing files. In some of our applications we have more than one tidal forcing file. Say, we have a forcing file from ADCIRC model and another for the OTPS (OSU data tidal inversion). In this way you can explore different tidal forcing and their impact.

I don't know why you are having problems. This option works for me.

jprinehimer
Posts: 20
Joined: Fri Oct 20, 2006 3:34 pm
Location: VIMS

#5 Unread post by jprinehimer »

OK. I was able to get it working, but I think I found a bug.

I only had SSH_TIDES set, but UV_TIDES was not set. I don't think the cppdef logic is right in get_idata.F

Line 180 of get_idata.F reads:

Code: Select all

#  if defined AVERAGES_DETIDE && (defined SSH_TIDES || defined UV_TIDES)
But this occurs inside a block of code delimited by (Line 139):

Code: Select all

#  ifdef UV_TIDES
So the code from line 180-405 is not included in the file. I moved the #endif from line 404 to line 178 and it seems to work fine.

I've commited the change to the cstms svn r1457.

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

#6 Unread post by arango »

I see. Good catch. I updated the repository.

Thank you :!:

Post Reply