Ocean Modeling Discussion


Search for:
It is currently Wed Sep 18, 2019 8:02 pm

Post new topic Reply to topic  [ 2 posts ] 

All times are UTC

Author Message
PostPosted: Mon May 21, 2007 10:24 am 

Joined: Thu Oct 13, 2005 4:26 pm
Posts: 10
Location: Frontier Research Center for Global Change

I want to convert the ROMS output on Spherical grid to a regular lat-lon grid. Is there any utility available for this.


Reply with quote  
 Post subject:
PostPosted: Tue May 22, 2007 9:34 am 

Joined: Fri Oct 22, 2004 8:32 pm
Posts: 9
Location: Numerics Warehouse Ltd.
Hi Ratnam,

We use PMEL's Ferret (http://ferret.wrc.noaa.gov/Ferret/) to do this. It is very fast, free and can be installed on desktops or 64 bits servers. The regridding to a regular lat lon grid is done in two stages :- firstly you need to make a mapping function, which can take a lot of processing power (use a server?). This is a one off operation :-

set memory/size=150 ! give ferret lots of memory to work with
use ne_atl_his_0434.nc ! pull in the NetCDF history data
define axis/x=-40:10:0.1/modulo/units=degrees xax ! specify new grid
define axis/y=40:70:0.05/modulo/units=degrees yax
let lonlatout = y[gy=yax] + x[gx=xax] ! define your new lat lon grid
let lonin = lon_rho[d=1]
let latin = lat_rho[d=1]
let map = curv_to_rect_map ( lonin,latin,lonlatout,0.5) ! regrid
save/clobber/file=ne_atl_curv_map_rho_hires.nc map ! save to an nc file

Now you can use the mapping function on your data :-

use ne_atl_his_0434.nc ! pull in the NetCDF history data
use ne_atl_curv_map_rho.nc
let out_salt = curv_to_rect(salt[d=1,K=1,L=1], map[d=2])
shade out_salt ! plot it to look at it
save/clobber/file=salt_regrid.nc out_salt

You can add extra 2D or 3D variables using the 'append' option to save (removing 'clobber' of course)

By the way if you want to regrid from sigma to z levels, you do this before the lat lon regridding :-

In Matlab use the zlevs.m function to generate a 3D grid of depths of each s level and then save this to a netCDF file called z_rho.nc. Then in Ferret, do something like this :-

set memory/size=150
use ne_atl_his_0434.nc ! d=1
use z_rho.nc ! d=2
def axis/z=-4500:0:100/depth/units=m z100 ! new z axis
let znew = z[gz=z100]
let zz=z_rho[d=2]*-1000 ! not sure why I do this!
let salt_depth=zaxreplace(salt[d=1],zz,znew) ! regrid the data
save/clobber/file=salt_z_regrid.nc salt_depth[k=10:40] ! save to new nc file

Ferret is not particularly intuitive, but it does the job and this kind of regridding is useful to generate model output which is compliant with OGC standards WMS/WCS/WFS.

Good luck,


Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group