ESMG / pyroms

Python tools for the Regional Ocean Modeling System (ROMS)
Other
138 stars 88 forks source link

Should the RHS be hist.Vtrans #11

Closed bilgetutak closed 5 years ago

bilgetutak commented 5 years ago

If you are reading a grid file using a gridid, it works ok, since the gridinfo is filled with Vtrans information. However, if you are reading a grid file using grid file it self, and a history file, it resorts to the line below, which results in wrong Vtrans for my case. I am not sure, may be it is a legacy issue between different ROMS versions? https://github.com/ESMG/pyroms/blob/9ac92eada262ce0aca466dcc6df172ad8bfc6996/pyroms/pyroms/grid.py#L154

kshedstrom commented 5 years ago

This should work correctly, in that what ROMS calls Vstretching is called Vtrans by pyroms. What values are you using and what are you seeing?

bilgetutak commented 5 years ago

I have in the gridid.txt file the definition of the grid as;

id = BSea05 name = BSea05 grdfile = BlackSea_v5.nc N = 16 grdtype = roms Vtrans = 2 theta_s = 7 theta_b = 0.2 Tcline = 200

In the model setup file (ocean.in) I have; Vtransform == 2 ! transformation equation Vstretching == 4 ! stretching function

In the history file I have the same values as above.

If the function works as implemented above, it returns the self.Vtrans as 4.0 (as float), but in reality in my setup it is 2. Reading from gridid.txt returns the correct Vtrans as 2 (as integer).

I am using ROMS version 3.7/SVN 904.

kshedstrom commented 5 years ago

Really, this was a most unfortunate naming convention in pyroms. For a setup such as you and I have, one wants:

 Vtransform = 2 ;
 Vstretching = 4 ;

in ocean.in and:

id      = NGOA4
name    = NGOA4
grdfile = /archive/AKWATERS/kshedstrom/gridpak/Cook_inlet/NGOA_grid_4.nc
N       = 50
grdtype = roms
Vtrans  = 4 
theta_s = 7 
theta_b = 2 
Tcline  = 250 

in gridid.txt.