Ocean Modeling Discussion

ROMS/TOMS

Search for:
It is currently Sun Nov 18, 2018 12:22 pm




Post new topic Reply to topic  [ 7 posts ] 

All times are UTC

Author Message
PostPosted: Wed Oct 31, 2018 6:49 pm 
Offline

Joined: Wed Nov 11, 2015 4:49 pm
Posts: 27
Location: Georgia Institute of Technology
Hi,

I have a model grid from years ago. And I need to generate a child grid and the corresponding contact netcdf file. The problem is the old model grid that I have is not created from the rutgers/grid tools. So when I use coarse2fine.m, it is not working. Can someone show me how to deal with this?

Best,
Amy


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 31, 2018 7:33 pm 
Offline

Joined: Wed Dec 31, 2003 6:16 pm
Posts: 722
Location: USGS, USA
what exactly is the problem? do you get an error message?
the commands would be something like this:

ref_ratio=3;
roms_child_grid='Sandy_roms_grid_ref3.nc';
F=coarse2fine('Sandy_roms_grid.nc','Sandy_roms_grid_ref3.nc', ...
ref_ratio,Istr,Iend,Jstr,Jend);
Gnames={'Sandy_roms_grid.nc','Sandy_roms_grid_ref3.nc'};
[S,G]=contact(Gnames,'Sandy_roms_contact.nc');

where Istr,Iend, Jstr, Jend are the indices of the parent grid that define where the child should be.
-j


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 01, 2018 2:49 pm 
Offline
User avatar

Joined: Mon Apr 28, 2003 5:44 pm
Posts: 462
Location: Rutgers University
Problems we have seen with other users starting from old grids is that the parent grid is missing the psi points coordinates.

You may need to add the psi points if they are absent because the grid subsetting is defined in terms of the psi-points corners.

If you need a Matlab function to compute the psi points coordinates (and mask) from the rho points I can send you one.

_________________
John Wilkin: IMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 01, 2018 2:50 pm 
Offline

Joined: Wed Nov 11, 2015 4:49 pm
Posts: 27
Location: Georgia Institute of Technology
I used the exact same code:
Code:
F=coarse2fine(Ginp,Gout,Gfactor,163,190,217,240);

Ginp is my parent grid and Gout is my output child grid.

This is my error message:
Code:
Error using netcdflib
The NetCDF library encountered an error during execution of 'getVaraDouble' function -
'Index exceeds dimension bound (NC_EINVALCOORDS)'.
Error in netcdf.getVar (line 136)
    data = netcdflib(funcstr,ncid,varid,varargin{:});
Error in nc_read>nc_read_matlab (line 397)
  f = netcdf.getVar(ncid, varid, start, count);
Error in nc_read (line 95)
    f = nc_read_matlab(ncfile,Vname,Tindex,ReplaceValue,PreserveType,Info);
Error in coarse2fine (line 552)
  C.hraw = nc_read(Ginp,'hraw',1);
Error in childGrd_forSFB (line 4)
F=coarse2fine(Ginp,Gout,Gfactor,163,190,217,240);


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 01, 2018 2:54 pm 
Offline

Joined: Wed Nov 11, 2015 4:49 pm
Posts: 27
Location: Georgia Institute of Technology
Psi points? Do you mean lon_psi, lat_psi, mask_psi, x_psi, y_psi? My parent grid has all of these...

Thank you all for your prompt response!!! I really appreciate it!


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 01, 2018 3:05 pm 
Offline

Joined: Wed Nov 11, 2015 4:49 pm
Posts: 27
Location: Georgia Institute of Technology
I have created a child grid using the method that I had been using, which works fine for old version ROMS and COAWST. But the new model needs contact.nc. So initially, I tried this

Code:
name = 'contact.nc';
c_contact(name,true,2)

grd = {'parent_grd.nc','child_grd.nc'};
[S,G]=contact(grd,name);


My error message shows that

Code:
   Contact   Donor   Receiver
    Region    Grid       Grid
 
 
Reference to non-existent field 'contact'.
Error in contact (line 316)
  dg = S.contact(cr).donor_grid;


So I have done some searches on the forum and found out that if I am using some other packages to create child grid, it is lack of some information that is needed for creating the contact.nc. That is why I tried to use coarse2fine.m to generate a new child grid.

Best,
Amy


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 01, 2018 7:45 pm 
Offline

Joined: Wed Nov 11, 2015 4:49 pm
Posts: 27
Location: Georgia Institute of Technology
I have figured out my problem and successfully created the contact.nc. Moving on to run the model and test my grid setting!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 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:  
cron
Powered by phpBB® Forum Software © phpBB Group