conversion of sigma levels in to depth

Facts, news, and guidance about ROMS software

Moderators: arango, robertson

Post Reply
Message
Author
nagaraju

conversion of sigma levels in to depth

#1 Unread post by nagaraju »

Hi all,
can anyone help me how to get depth values of each sigma level?
Thanks in advance
Nagaraju

jcwarner
Posts: 1171
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

compute depths

#2 Unread post by jcwarner »

One way would be to acquire the matlab toolbox from the ROMS web site:
Software / Processing Packages / matlab.tar.gz
and use depths.m.

theresiaao

Re: conversion of sigma levels in to depth

#3 Unread post by theresiaao »

Hi, may I ask, I'm new to this, sorry for the basic question but I'm confuse for giving the input on depths.m script,

% This function computes the depths at the requested staggered C-grid.
% If the time record (tindex) is not provided, a zero free-surface is
% assumed and the unperturbed depths are returned.
%
% On Input:
%
% fname NetCDF data file name (character string)
% gname NetCDF grid file name (character string)
% igrid Staggered grid C-type (integer):
% igrid=1 => density points
% igrid=2 => streamfunction points
% igrid=3 => u-velocity points
% igrid=4 => v-velocity points
% igrid=5 => w-velocity points
% idims Depths dimension order switch (integer):
% idims=0 => (i,j,k) column-major order (Fortran)
% idims=1 => (j,i,k) row-major order (C-language)
% tindex Time index (integer)

for fname, which file I have to input? is it the history output file? and for tindex, is it the ocean_time variable from the history file?

thank you in advance..

jcwarner
Posts: 1171
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: conversion of sigma levels in to depth

#4 Unread post by jcwarner »

wow, i originally answered this in 2006. there are some different options now.
i am not sure if that m file is still around, but you can also use get_roms_grid.m
and you can enter the grid name, or this ocean_his name, and the time index from a history file.
that m file has example input commands at the top, such as
Gout = get_roms_grid('ocean_his.nc', MyTimeRec);

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

Re: conversion of sigma levels in to depth

#5 Unread post by wilkin »

The vertical coordinate is documented here in WikiROMS https://www.myroms.org/wiki/Vertical_S-coordinate.

In the depths.m function you quote fname is any ROMS output file - history, averages, restart etc.
Strictly speaking, the vertical coordinate changes in time with sea level zeta. The input tindex is not required, but if given depths.m will read zeta from that number record in fname. If you don't give tindex it assumes zeta = 0 which is usually perfectly fine for visualization purposes.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

Post Reply