[Thread Prev][Thread Next][Index]

Re: [ferret_users] How to flip a variable? U is read at reverse

Hi Karen,

There is the 'positive' netcdf attribute for the Z-axis, which can be 'up' or 'down'.   In your case,
    depth_u:positive = "up";

If not specified, Ferret assumes 'down' for an axis whose name starts with 'depth', and assumes 'up' for names starting with 'elev', 'height', 'level', 'layer'.  So you could also try a different name that is more typical for positive values going up.

Kind regards,

On Wed, Jan 31, 2018 at 1:32 PM, karen guihou <karen.guihou@xxxxxxxxx> wrote:
Hi all

I am struggling with some ROMS files that I try to read. The surface is at level 40, and the bottom at level 1.
When I import the netcdf, Ferret automatically flips (I do not understand how/why) the U,V,T,S variables so that k=1 is now at the surface and k=40 is at the bottom. However, it does not flip the depth variable. My depths levels are negative values.

If I do u*depth, I end up multiplying the bottom by the surface. If I plot a vertical section of U, the max velocities are at the bottom...

Any idea of option to give, or some missing attribute in the netcdf? I created the nc from a mat file.
Thank you in advance!

netcdf U_climato_CMM {
z = 40 ;
lat = 384 ;
lon = 349 ;
time = UNLIMITED ; // (1 currently)
float depth_u(z, lat, lon) ;
depth_u:units = "m" ;
float dz(z, lat, lon) ;
dz:units = "m" ;
float lat(lat) ;
lat:units = "degrees south" ;
float latitude(lat) ;
latitude:units = "degrees south" ;
float lon(lon) ;
lon:units = "degrees west" ;
float longitude(lon) ;
longitude:units = "degrees west" ;
float taux(time, lat, lon) ;
taux:units = "N/m2" ;
taux:cell_methods = "time: mean" ;
float time(time) ;
time:units = "days since 1980-01-01" ;
time:cell_methods = "time: mean" ;
float u(time, z, lat, lon) ;
u:units = "m/s" ;
u:cell_methods = "time: mean" ;
float ubar(time, lat, lon) ;
ubar:units = "m/s" ;
ubar:cell_methods = "time: mean" ;

Karl M. Smith, Ph.D.
JISAO Univ. Wash. and PMEL NOAA
"The contents of this message are mine personally and do
not necessarily reflect any position of the Government
or the National Oceanic and Atmospheric Administration."

[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement