Delft3D grid to roms
Delft3D grid to roms
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?
Then I tried the case, but it seems impossible to edit masking.
Anyone who uses Delft3D can help me?
Re: Delft3D grid to roms
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.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.
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.Then I tried the case, but it seems impossible to edit masking.
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?Anyone who uses Delft3D can help me?
Re: Delft3D grid to roms
I know Lyon Lanerolle at NOAA has successfully used grids from Delft3d to run ROMS. He at least sometimes reads this forum.
Re: Delft3D grid to roms
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
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
Re: Delft3D grid to roms
Thank you for your reply.
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.
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.Then I tried the case, but it seems impossible to edit masking.
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]Anyone who uses Delft3D can help me?
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.
Re: Delft3D grid to roms
Could you send me the scripts, let me have a try?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
Thanks.
Re: Delft3D grid to roms
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
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
Re: Delft3D grid to roms
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?
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?
Re: Delft3D grid to roms
I always use
to get the full grid without deleting any land point.
And then
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.
Code: Select all
[lon_rho, lat_rho, ~, ~, ~] = wlgrid('read', 'd3d_all.grd');
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;
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.
Re: Delft3D grid to roms
Hello,bjagers! I will be appriciate if you can send me the scripts.I have met some problems about the deleted grid file. Please!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