Delft3D grid to roms

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
lehel
Posts: 5
Joined: Wed Jul 01, 2009 6:24 pm
Location: Hohai University

Delft3D grid to roms

#1 Unread post by lehel »

I was trying to use Delft3D grid generator to make curvilinear, orthogonal grids for roms. But a problem troubled me. By 3D software, the land grid could be deleted. But when converted to roms grid, the locations and depth are 0. So it seems that the land grid should not be deleted.
Then I tried the case, but it seems impossible to edit masking.
Anyone who uses Delft3D can help me?

bjagers
Posts: 5
Joined: Tue Nov 28, 2006 5:55 pm
Location: Deltares

Re: Delft3D grid to roms

#2 Unread post by bjagers »

I was trying to use Delft3D grid generator to make curvilinear, orthogonal grids for roms. But a problem troubled me. By 3D software, the land grid could be deleted. But when converted to roms grid, the locations and depth are 0. So it seems that the land grid should not be deleted.
Correct; as far as I know roms does not accept clipping of the grid, i.e. the coordinates of the full grid matrix should be defined. So, you should be able to use rgfgrid (the Delft3D grid generator) but when creating a grid for roms, you should avoid removing grid points. As long as the different regions in the grid are more or less aligned it might be relatively easy to have a nice grid in between, but if two regions (close to each other in the grid index space) are far apart (e.g. two river branches going north and west) then it may be hard or impossible since I vaguely remember that roms has some requirements for the smoothness of the grid on the transition from active to inactive points. The use of the new domain decomposition feature in roms might then offer a solution.
Then I tried the case, but it seems impossible to edit masking.
I don't understand what you mean. Did you try to edit masking in roms or in rgfgrid? In rgfgrid deleted grid points don't have coordinates anymore (their x and y coordinates will be 0), so you can't unmask those points. You will have to construct new grid points by means of "point insert", "line mirror" (both for small gaps) or creation of a new grid and subsequently "paste two grids" (for bigger holes) or create the whole grid anew. It would be nice if we had an equivalent of the "internal diffusion" for depth values in quickin (the bathymetry editor of Delft3D) for missing/clipped coordinates.
Anyone who uses Delft3D can help me?
You'll probably find more Delft3D users on the Delft3D forum, but you'll still find very few active roms experts there. By the way, when exporting a grid file from rgfgrid you can also select to write the data to a netcdf file. We have considered to make the (or at least a) netcdf export option compatible with roms, but I don't know the exact requirements for a roms grid netcdf file. Anyone to comment on this?

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

Re: Delft3D grid to roms

#3 Unread post by kate »

I know Lyon Lanerolle at NOAA has successfully used grids from Delft3d to run ROMS. He at least sometimes reads this forum.

bjagers
Posts: 5
Joined: Tue Nov 28, 2006 5:55 pm
Location: Deltares

Re: Delft3D grid to roms

#4 Unread post by bjagers »

Hi Kate,

Thanks for refreshing my memory. It made me realize that I have been in touch with Lyon before ... a quick search ... Yes! He sent me his MATLAB scripts in April 2008. We'll have a look at these tools again in the new context.

Bert

lehel
Posts: 5
Joined: Wed Jul 01, 2009 6:24 pm
Location: Hohai University

Re: Delft3D grid to roms

#5 Unread post by lehel »

Thank you for your reply.
Then I tried the case, but it seems impossible to edit masking.
I don't understand what you mean. Did you try to edit masking in roms or in rgfgrid? In rgfgrid deleted grid points don't have coordinates anymore (their x and y coordinates will be 0), so you can't unmask those points. You will have to construct new grid points by means of "point insert", "line mirror" (both for small gaps) or creation of a new grid and subsequently "paste two grids" (for bigger holes) or create the whole grid anew. It would be nice if we had an equivalent of the "internal diffusion" for depth values in quickin (the bathymetry editor of Delft3D) for missing/clipped coordinates.
Anyone who uses Delft3D can help me?
You'll probably find more Delft3D users on the Delft3D forum, but you'll still find very few active roms experts there. By the way, when exporting a grid file from rgfgrid you can also select to write the data to a netcdf file. We have considered to make the (or at least a) netcdf export option compatible with roms, but I don't know the exact requirements for a roms grid netcdf file. Anyone to comment on this?[/quote]

For the first problem, I mean that the land grid does not clipped, then use the delft2roms.m to convert the grid. but the all masking is 1.
For the sencond problem, I mean that the users who use Delft3D to generator roms grid and convert it to roms grid successfully.

lehel
Posts: 5
Joined: Wed Jul 01, 2009 6:24 pm
Location: Hohai University

Re: Delft3D grid to roms

#6 Unread post by lehel »

bjagers wrote:Hi Kate,

Thanks for refreshing my memory. It made me realize that I have been in touch with Lyon before ... a quick search ... Yes! He sent me his MATLAB scripts in April 2008. We'll have a look at these tools again in the new context.

Bert
Could you send me the scripts, let me have a try?
Thanks.

tony1230
Posts: 87
Joined: Wed Mar 31, 2010 3:29 pm
Location: SKLEC,ECNU,Shanghai,China

Re: Delft3D grid to roms

#7 Unread post by tony1230 »

Firstly, you would like to delete the Land-points and make your masking subsequently(to produce a variable,mask_rho or what you like,contains the value 1 for wet and 0 for land);

Secondly, you could use you undeleted grid file to generate the NetCDF grd file. But here, you should have your mask variable(mask_rho.mat) imported in so the wet points to be identified(mask out by yr mask value). Bear in mind, you do not take the deleted grid file to generate the NetCDF grd file.

shou

zsurenj
Posts: 9
Joined: Fri Apr 24, 2015 4:06 pm
Location: Zhongshan university

Re: Delft3D grid to roms

#8 Unread post by zsurenj »

I made a very complex, curvilinear and orthogonal grids by using DELFT3D grid generator. Now I need to artificially construct land points (coordinates ) because I already deleted them in DELFT3D-RGFGRID. It was not successful when I tried some times.
I know that Lanerolle of NOAA developed a matlab script to do it. I send email several times but I don't receive reply. Can you help me?

mjfconan
Posts: 22
Joined: Mon Mar 03, 2014 1:57 pm
Location: SKLEC, ECNU, China

Re: Delft3D grid to roms

#9 Unread post by mjfconan »

I always use

Code: Select all

[lon_rho, lat_rho, ~, ~, ~] = wlgrid('read', 'd3d_all.grd');
to get the full grid without deleting any land point.

And then

Code: Select all

[tmp_lon_mask, ~, ~, ~, ~] = wlgrid('read', 'd3d_water.grd');
mask_rho = ones(size(lon_rho));
mask_rho(tmp_lon_mask == 0 | isnan(tmp_lon_mask)) = 0;
to create a mask_rho from another .grd file whose land grids have been removed.

The function can be gotten by svn from
https://svn.oss.deltares.nl/repos/delft ... ot/progsrc

PS:
Two other advices for your reference.
1) Do not delete a whole grid line in Delft3D, or the matrix sizes will be inconsistent.
2) Be careful with some "solo" water points which are surrounded by land mask completely.

Vera
Posts: 15
Joined: Wed Apr 26, 2017 5:23 pm
Location: Sun Yat-sen University

Re: Delft3D grid to roms

#10 Unread post by Vera »

bjagers wrote:Hi Kate,

Thanks for refreshing my memory. It made me realize that I have been in touch with Lyon before ... a quick search ... Yes! He sent me his MATLAB scripts in April 2008. We'll have a look at these tools again in the new context.

Bert
Hello,bjagers! I will be appriciate if you can send me the scripts.I have met some problems about the deleted grid file. Please!

Post Reply