generate nested grid using pyroms

Discussion about analysis, visualization, and collaboration tools and techniques

Moderators: arango, robertson

Post Reply
Message
Author
m567tej
Posts: 10
Joined: Tue Feb 28, 2012 3:10 pm
Location: Iranian National Institute for Oceanography and Atmospheric Sciences

generate nested grid using pyroms

#1 Unread post by m567tej »

Dear all / pyroms users

I am working on nesting a ~700 x 700 m grid inside a ~4.9 x 4.9 km grid form a three level nesting project. Parent grid is made by pyroms which able to control rx0 (grid stiffness ratio (gf)) but child grid is made using coarse2fine matlab script from Rutgers. Matlab script is relatively fast but it can not be able to control rx0; using Shapiro filter may be useful for decreasing rx0 but for nearshore modeling gives unrealised bathymetry. Also changing h by using griddata on a finer bathymetry couldn't help and it caused an increase in rx0. However there are old MATLAB Toolbox from Mathieu Dutout (http://www.irb.hr/users/mdsikir/Bathymetry/index.html for control rx0 during smoothing bathymetry.

Is there any pyroms code (or code template) for generating nested grid with specific grid stiffness ratio? could someone tell me how can I make a nested grid using pyroms?

thank you!

regards,

User avatar
kate
Posts: 4088
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: generate nested grid using pyroms

#2 Unread post by kate »

I made grids with one level of nesting according to Hernan's prescription of starting by making a large grid at the fine resolution. Here are some notes I left for myself:
grid_Palau_0 is the full grid at high resolution.
grid_Palau_1 is the full grid at low resolution.
grid_Palau_2 is small grid at high resolution.

I ran Sasha's

gshhs_to_roms_mask grid_Palau_0.nc
copymask mask.nc grid_Palau_0.nc
single_connect 100 1500 grid_Palau_0.nc

Sasha's tools only update the mask_rho. Ideally, ROMS would just read that
and compute consistent mask_u, mask_v but that's not how it goes today,
though ROMS does compute mask_psi. Running editmask.py will update mask_u,
mask_v for you.

Run test_fine2coarse.m to get grid_1.

palau (ncks -d xi_rho,271,872 -d xi_psi,271,871 -d xi_u,271,871 -d xi_v,271,872 -d eta_rho,652,1133 -d eta_psi,652,1132 -d eta_u,652,1133 -d eta_v,652,1132) \
grid_Palau_0.nc grid_Palau_2.nc
ncatted -O -a refine_factor,global,a,l,3 grid_Palau_2.nc
ncatted -O -a parent_Imin,global,a,l,91 grid_Palau_2.nc
ncatted -O -a parent_Imax,global,a,l,291 grid_Palau_2.nc
ncatted -O -a parent_Jmin,global,a,l,218 grid_Palau_2.nc
ncatted -O -a parent_Jmax,global,a,l,378 grid_Palau_2.nc
ncatted -O -a parent_grid,global,a,c,'grid_Palau_1.nc' grid_Palau_2.nc

python add_Jwtype_map.py grid_Palau_1.nc (Should be on Palau_0.nc, heh)
python add_Jwtype_map.py grid_Palau_2.nc

Run compute_contacts.m.
I then fussed with bathymetry separately for grids 1 and 2, which doesn't preserve any volume-matching or anything, which was probably the whole point of starting with the large, fine mesh.

Did you see what pyroms offers for generating the ocean.in for nested domains?

Post Reply