MATLAB routines for curvilinear grid generation in "box_curvilinear"

79 views
Skip to first unread message

Kevin Chou

unread,
Oct 31, 2022, 3:58:40 AM10/31/22
to GETM-users
Dear all,

I am doing an idealized study with analytically-prescribed coastline and bathymetry. Can the corresponding curvilinear grid also be generated analytically (instead of tools like Seagrid, etc.)?

I am currently going through the GETM setup case of "box_curvilinear". Within the last few lines of README, it says "MATLAB routines are available to produce the topo-files for this
and other topographies." However, I am unable to locate those MATLAB routines from the web. It would be great someone could share or let me know how to access them. Thanks!

Best regards,
Kevin

Knut

unread,
Nov 2, 2022, 8:35:53 AM11/2/22
to getm-...@googlegroups.com

Hi Kevin,

I think Lars Umlauf wrote these matlab scripts decades ago. Not sure whether he can still find them somewhere to share. Maybe I am wrong, but I think these scripts only calculated additional quantities required by GETM based on an existing curvilinear grid generated by seagrid (e.g. convc). So they will probably not help to generate a curvilinear grid.

But if you can already describe your grid analytically, it should be pretty easy to write this information into topo.nc(?) If not, Xiangyu Li and Nina Reese could share their expertise with the Delft3D curvilinear grid generator. See the attached Fig. 2 from Xiangyu's paper https://doi.org/10.1175/JPO-D-21-0292.1 for his GETM setup for the Pearl River Estuary.

Cheers, Knut

Kevin --

---
You received this message because you are subscribed to the Google Groups "GETM-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to getm-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/getm-users/32d198ad-2ae8-4fcc-a1c6-aa976ad4b775n%40googlegroups.com.
full-JPO-D-21-0292.1-f2.jpg

Lars Umlauf

unread,
Nov 2, 2022, 8:46:51 AM11/2/22
to getm-...@googlegroups.com

Hi, I just had a look - but I can't find them any more. Must be more than 15 years ago that I coded this...

Sorry!

Lars

To view this discussion on the web visit https://groups.google.com/d/msgid/getm-users/e4660609-8264-8b5f-37c0-a0a639491d7d%40gmx.net.
-- 
------------------------------------------------
Lars Umlauf

Physical Oceanography and Instrumentation
Leibniz-Institute for Baltic Sea Research

phone : ++49 381 5197 223
fax   : ++49 381 5197 114
web   : www.io-warnemuende.de/lars-umlauf-en.html

address:
Leibniz-Institute for Baltic Sea Research
Seestrasse 15
D-18119 Rostock-Warnemuende
Germany
-------------------------------------------------

Ilja Maljutenko

unread,
Nov 2, 2022, 9:36:13 AM11/2/22
to getm-...@googlegroups.com
Hi

I think I have recovered these old bathymetry scripts and examples from my old backups.   
After all these were my first matlab scripts to study/understand. Thanks for teaching me Matlab, Lars j* :) 
I'm not sure how well these work, since I'm using version (even older)  which use snc_tools functions to write nc-files :)

Regards
~Ilja

--

---
You received this message because you are subscribed to the Google Groups "GETM-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to getm-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/getm-users/32d198ad-2ae8-4fcc-a1c6-aa976ad4b775n%40googlegroups.com.


--
~ Ilja 

bathymetry4GETM.tar.gz

Bjarne Büchmann

unread,
Nov 4, 2022, 5:51:17 AM11/4/22
to getm-...@googlegroups.com

Hey Knut et al,

 

While seagrid seems like a great tool, I wonder if there is a similar code (or port of), which is based on python or some other free software.

While Matlab may be free for students and universities, we have tried to break free of Matlab for quite some time due to the inhibitive costs of the program. We really aim for a free and open software stack.

 

Any ideas on how to generate orthogonal curvilinear grids for bathymetry based only on free software?

 

As some of you may know I maintain a set of scripts and programs useful for getm applications

 https://sourceforge.net/projects/getm-utils/

this includes scripts for dealing with bathymetry. The repository is not totally clean and a lot of documentation is missing, but hopefully, it can be the basis of bathymetry generation for getm.

BTW, even for getm_utils, part of the repo (in particular the subdomain subdivision part) still relies on Matlab, so I am fully aware of the problem of legacy software.

For now, I just try to not add any new ties to commercial software products.

 

MED VENLIG HILSEN / BEST REGARDS
 
Bjarne Büchmann
Joint GEOMETOC Support Centre

MOBIL +45 40 78 73 20

To view this discussion on the web visit https://groups.google.com/d/msgid/getm-users/e4660609-8264-8b5f-37c0-a0a639491d7d%40gmx.net.

 


This email was scanned by Bitdefender

Knut

unread,
Nov 4, 2022, 5:54:03 AM11/4/22
to getm-...@googlegroups.com

@Nina and Xiangyu: can you provide a link and some comments for the grid generation tool from Delft3D you used?

Xiangyu Li

unread,
Nov 4, 2022, 8:20:43 AM11/4/22
to getm-...@googlegroups.com, Knut
Hi,

the grid generation tool from delft3d can be obtained after registration on the webpage as shown in our paper which Knut has mentioned. You might also need to fill in a form on that website to ask for the license. If I remember correctly, the link to that form only appears to registered users.

This tool is more suitable if you are building meshgrid for a realistic estuary rather than an idealized one. 
Besides, I found the following blog article handy for beginners of that tool: https://www.kunyangcoastal.com/post/delft3d-grid-generation-tutorial

If there are more questions please let us know. I might be able to reply soon though, because we have a plane to catch.

Cheers,
Xiangyu


On Nov 4, 2022, at 17:54, Knut <knut...@gmx.net> wrote:



Bjarne Büchmann

unread,
Nov 4, 2022, 8:50:55 AM11/4/22
to getm-...@googlegroups.com

Hi Xiangyu,

 

Thank you for the input.

I have not (yet) tried to build the Delft3D source, but the instructions for Linux are truly problematic.

https://oss.deltares.nl/web/delft3d/get-started

 

As far as I can see, the use of Windows pre-build binaries are restricted to license costing EUR3600 or more.

Building on Windows requires M$ compiler suite, and even if that was not the case, I would prefer to not build *anything* on Windows.

So we are effectively left with building from source on a Linux-based system, Right?

 

Only supported OSs are RedHat7 and CentOS7. Both are obsolete – at or near end-of-life.

As for open-source compilers, they write “GNU Fortran compiler 4.9.1.” and “Do not use GNU Fortran compiler 8.x.x or newer”.

Gfortran is presently at v. 11.3.0 even for and OS/Ubuntu installation (not from source). Installing v7 or older is out of the question.

 

It is not clear how old the instructions are, but they must be quite a few years old – and are badly outdated.

So, building Delft3D seems problematic – and might even be overkill for this kind of operation. It might still be a good chose, I just cant see any evidence to that effect.

 

The examples given at https://www.kunyangcoastal.com/post/delft3d-grid-generation-tutorial seems - at least at first glance – to be problematic in numerical sense. I am really not a believer in  coast-following coordinates – at least not for a code like GETM. For a pure “river”-code things may be different – that would be outside my scope. But the extreme difference in size of neighboring cells seems problematic. I would much prefer to use smoother grid, and then use land-masking to actually fix the coastline. In  any case, we need the final bathymetry to be map’able to an I,j rectangular domain, and I don’t even know if that

 

The grid from the paper reference, eg

https://journals.ametsoc.org/view/journals/phoc/52/9/JPO-D-21-0292.1.xml#fig2

seem very interesting/cool, but presumably also very “hand-held” in terms of fiddling with “bending” along river sections and arms(?)

 

With these caveats, I think that the tool may actually look promising, and probably, I should give it a try.

 

Do you have any recommendations/experience (or even log) regarding the installation/use of the Delft3D grid generation.

Preferably on a reasonably modern Linux version (eg Alma Linux 9, RockyLinux v9, or Ubuntu 22.04) using OS-installable compilers and tools?

 

 

MED VENLIG HILSEN / BEST REGARDS
 
Bjarne Büchmann
Joint GEOMETOC Support Centre

MOBIL +45 40 78 73 20

 

Xiangyu Li

unread,
Nov 4, 2022, 10:27:20 AM11/4/22
to getm-...@googlegroups.com
Hi Bjarne,

thanks for the quick feedback.
Here are some of my quick replies,
since we are taking off soon.

I have not (yet) tried to build the Delft3D source, but the instructions for Linux are truly problematic.

https://oss.deltares.nl/web/delft3d/get-started

 

As far as I can see, the use of Windows pre-build binaries are restricted to license costing EUR3600 or more.

Sorry about the confusion. The tool we used was the free version after request (link as shown in the attached figure, from the same link shown in that paper).image0.jpeg
 
It is a pre-compiled software which only works on Windows.

Building on Windows requires M$ compiler suite, and even if that was not the case, I would prefer to not build *anything* on Windows.

So we are effectively left with building from source on a Linux-based system, Right?

 

Only supported OSs are RedHat7 and CentOS7. Both are obsolete – at or near end-of-life.

As for open-source compilers, they write “GNU Fortran compiler 4.9.1.” and “Do not use GNU Fortran compiler 8.x.x or newer”.

Gfortran is presently at v. 11.3.0 even for and OS/Ubuntu installation (not from source). Installing v7 or older is out of the question.

 

It is not clear how old the instructions are, but they must be quite a few years old – and are badly outdated.

So, building Delft3D seems problematic – and might even be overkill for this kind of operation. It might still be a good chose, I just cant see any evidence to that effect.

 

The examples given at https://www.kunyangcoastal.com/post/delft3d-grid-generation-tutorial seems - at least at first glance – to be problematic in numerical sense. I am really not a believer in  coast-following coordinates – at least not for a code like GETM. For a pure “river”-code things may be different – that would be outside my scope. But the extreme difference in size of neighboring cells seems problematic. I would much prefer to use smoother grid, and then use land-masking to actually fix the coastline. In  any case, we need the final bathymetry to be map’able to an I,j rectangular domain, and I don’t even know if that

 

I agree. I just found this blog article when I wrote last email. The way I see it is this article does introduce some basic skills of using this software. As for the example it shows, I would say a smoother grid would of course be much better.

The grid from the paper reference, eg

https://journals.ametsoc.org/view/journals/phoc/52/9/JPO-D-21-0292.1.xml#fig2

seem very interesting/cool, but presumably also very “hand-held” in terms of fiddling with “bending” along river sections and arms(?)

Yes, some drag and drop of grid points were made.

With these caveats, I think that the tool may actually look promising, and probably, I should give it a try.

 

Do you have any recommendations/experience (or even log) regarding the installation/use of the Delft3D grid generation.

Preferably on a reasonably modern Linux version (eg Alma Linux 9, RockyLinux v9, or Ubuntu 22.04) using OS-installable compilers and tools?

 

Unfortunately this pre-compiled tool only works on Windows.

Have to go, the plane is about to take off.

Cheers,
Xiangyu

Yunzhu Yin

unread,
Nov 6, 2022, 6:37:16 PM11/6/22
to getm-...@googlegroups.com
Hi Bjarne,

Here is the link for latest rgfgrid version:
and also the quickin (where do bathymetry interpolation) in parent directory.

The one you mentioned with Linux stuff are the Delft3D kernels, which is totally separated to the GUI. So I think you may not need that one. Just request the GUI package and run.

The latest rgfgrid could export the grids to roms netcdf grid, from which, I assume, could change to GETM file with a minimum further coding.
Alternatively, as Xiangyu and Nina did, could code to transfer ASCII style of Delft3D grid to GETM netcdf file.

Hope this help.

Best
Yunzhu Yin


Reply all
Reply to author
Forward
0 new messages