intro story D-Flow FM

 

D-Flow Flexible Mesh

D-Flow Flexible Mesh (D-Flow FM) is the new software engine for hydrodynamical simulations on unstructured grids in 1D-2D-3D. Together with the familiar curvilinear meshes from Delft3D 4, the unstructured grid can consist of triangles, pentagons (etc.) and 1D channel networks, all in one single mesh. It combines proven technology from the hydrodynamic engines of Delft3D 4 and SOBEK 2 and adds flexible administration, resulting in:

  • Easier 1D-2D-3D model coupling, intuitive setup of boundary conditions and meteorological forcings (amongst others).
  • More flexible 2D gridding in delta regions, river junctions, harbours, intertidal flats and more.
  • High performance by smart use of multicore architectures, and grid computing clusters.
An overview of the current developments can be found here.
 
The D-Flow FM - team would be delighted if you would participate in discussions on the generation of meshes, the specification of boundary conditions, the running of computations, and all kinds of other relevant topics. Feel free to share your smart questions and/or brilliant solutions! 

 

=======================================================
We have launched a new website (still under construction so expect continuous improvements) and a new forum dedicated to Delft3D Flexible Mesh.

Please follow this link to the new forum: 
/web/delft3dfm/forum

Post your questions, issues, suggestions, difficulties related to our Delft3D Flexible Mesh Suite on the new forum.

=======================================================

** PLEASE TAG YOUR POST! **

 

 

Sub groups
D-Flow Flexible Mesh
DELWAQ
Cohesive sediments & muddy systems

 


Message Boards

Fortran runtime error

ML
Moritz Lehmann, modified 4 Years ago.

Fortran runtime error

Youngling Posts: 8 Join Date: 1/16/15 Recent Posts
Hi,
My compilation of tag 5389 on an Ubuntu system has succeeded. The tests run, but they are complaining about
Fortran runtime error: Sequential READ or WRITE not allowed after EOF marker, possibly use REWIND or BACKSPACE

Apparently, this is related to a change in gfortran that makes reading in an entire file the default, which you can counter with -fn-whole-file. I've tried that, by adding -fno-whole-file to the FFLAGS and FCFLAGS in the build script, but it hasn't alleviated the issue.

Has anyone else run into this issue and perhaps solved it?
Cheers, Moritz
Adri Mourits, modified 4 Years ago.

RE: Fortran runtime error (Answer)

Yoda Posts: 1224 Join Date: 1/3/11 Recent Posts
Hi Moritz,

After some Googling: I don't think that -fno-whole-file will solve your problem. The (default) -fwhole-file flag is an optimization flag that force the compiler to optimize a complete source code file. I don't see a relation with reading/writing files.

At the runtime error, is there a stack trace showing at what line of code the error appears?

Regards,

Adri
ML
Moritz Lehmann, modified 4 Years ago.

RE: Fortran runtime error

Youngling Posts: 8 Join Date: 1/16/15 Recent Posts
Hi Adri,
Thanks for looking into this so quickly.

Here is the error message when running the examples.

At line 831 of file prterr.f90 (unit = 33, file = 'tri-diag.f34')
Fortran runtime error: Sequential READ or WRITE not allowed after EOF marker, possibly use REWIND or BACKSPACE
Adri Mourits, modified 4 Years ago.

RE: Fortran runtime error

Yoda Posts: 1224 Join Date: 1/3/11 Recent Posts
Hi Moritz,

That statement tries to write a message/warning/error to the tri-diag file. Very strange that you run into this problem. The tri-diag file should already exist and previous write statements did not run into this problem. Do all FLOW examples have this problem?

Regards,

Adri
ML
Moritz Lehmann, modified 4 Years ago.

RE: Fortran runtime error

Youngling Posts: 8 Join Date: 1/16/15 Recent Posts
Yes, this error occurs for examples 1-3. The file tri-diag.f34 exists and I attach it. Strangely, this file says that the simulation finished. There is no netCDF map- or his-file.

Do you think the problem might be with the netCDF library? I compiled
netcdf-4.3.3.1 and
netcdf-fortran-4.4.2
with the same compiler.


Here are some modifications we had to make to get it compiled. Perhaps we broke something with it?:

In build.sh in the section...
# Additional library settings

export MPILIBS_ADDITIONAL="-L/usr/local/lib -lfmpich -lmpich -lmpl"


Then I changed the export for NETCDFROOT to point to /usr/local
# netcdf
#export NETCDFROOT=/p/delft3d/opt/netcdf-4.1.3mt/intel11.1
export NETCDFROOT=/usr/local


I had to make one change to the source code to get it to compile:
The file engines_gpl/waq/packages/waq_kernel/src/waq_kernel/dlwq19.f, line 1132,

Many thanks for your time!
Moritz
s = sign ( 1.0 , e2 ) needed to be changed to s = sign ( 1.0_8 , e2 ) to get it to compile as per the bottom of the first post in http://oss.deltares.nl/web/delft3d/coast-/-estuary/-/message_boards/view_message/703345
Adri Mourits, modified 4 Years ago.

RE: Fortran runtime error (Answer)

Yoda Posts: 1224 Join Date: 1/3/11 Recent Posts
Hi Moritz,

I don't think this is related to NetCDF. Only example 11 writes NetCDF files.

Your changes look ok.

If the simulation is finished, it should not visit prterr anymore. Be aware that output is appended to the tri-diag file when it already exists. What happens if you remove the tri-diag file and run example 1 (only once). Is the simulation still finished (according to the screen output and according to the tri-diag file contents) when the error occurs? Or does the simulation continue after the error?

May be this gives more information:
Subroutine "...\src\engines_gpl\flow2d3d\packages\kernel\src\general\prterr.f90", line 831 reads:
write (lundia, '(a)') msg(:msglen)
If you replace "lundia" by "*" it will write the message to screen instead of to the tri-diag file:
write (*, '(a)') msg(:msglen)
I expect the error will not occur. Can you check what it tries to write after the simulation is finished by comparing the screen output with the original screen output?

This is very curious.

Regards,

Adri
BM
Bradley Monahan, modified 4 Years ago.

RE: Fortran runtime error

Youngling Posts: 2 Join Date: 7/31/14 Recent Posts
Hi Adri

I have just tried your suggestion and get the following message on the screen

*** MESSAGE Removing file: TMP_zz3.grd
*** MESSAGE Removing file: TMP_zz3.bch
*** MESSAGE Removing file: TMP_zz3.bcc
D_Hydro [1447972873.902414] <anonymous> >> d_hydro shutting down normally

I wonder if it is a compiler issue that is causing the error that Mortiz mentioned.

I have compiled Delft3D and its dependencies using gcc v. 4.8.4 (the latest gnu for Ubuntu LTS 14.04) and have the same error during the close of the d3dflow test cases.

this error does not seem to cause any issue during the running of the model just during the write of the tri-diag file

Thanks,
Bradley


Adri Mourits:
Hi Moritz,

I don't think this is related to NetCDF. Only example 11 writes NetCDF files.

Your changes look ok.

If the simulation is finished, it should not visit prterr anymore. Be aware that output is appended to the tri-diag file when it already exists. What happens if you remove the tri-diag file and run example 1 (only once). Is the simulation still finished (according to the screen output and according to the tri-diag file contents) when the error occurs? Or does the simulation continue after the error?

May be this gives more information:
Subroutine "...\src\engines_gpl\flow2d3d\packages\kernel\src\general\prterr.f90", line 831 reads:
write (lundia, '(a)') msg(:msglen)
If you replace "lundia" by "*" it will write the message to screen instead of to the tri-diag file:
write (*, '(a)') msg(:msglen)
I expect the error will not occur. Can you check what it tries to write after the simulation is finished by comparing the screen output with the original screen output?

This is very curious.

Regards,

Adri
Adri Mourits, modified 4 Years ago.

RE: Fortran runtime error (Answer)

Yoda Posts: 1224 Join Date: 1/3/11 Recent Posts
Hi Bradley,

Thanks for posting this.

I think, you're right: the problem occurs after the simulation itself is finished, even after writing the nefis/netcdf output files. Only the writing to the tri-diag file is experiencing problems. It might be related to the compiler used. Unfortunately I don't have time to analyse this further. So you can choose: leave it, or try to debug it yourself.

Regards,

Adri
RC
Rob Campbell, modified 4 Years ago.

RE: Fortran runtime error

Youngling Posts: 1 Join Date: 1/29/16 Recent Posts
Dear Adri,

we are running into the same phenomena with ifort 2015 and gfortran 4.8.4. Is it safe to ignore this warning?

Regards
Adri Mourits, modified 4 Years ago.

RE: Fortran runtime error (Answer)

Yoda Posts: 1224 Join Date: 1/3/11 Recent Posts
Hi Rob,

I must be very careful with saying "it is safe to ignore" this error, because I can't reproduce it myself. But if the error occurs at the very end of the simulation only, and if it related to writing to the tri-diag file only, then it looks safe to ignore it.

Regards,

Adri
Adri Mourits, modified 3 Years ago.

RE: Fortran runtime error (Answer)

Yoda Posts: 1224 Join Date: 1/3/11 Recent Posts
This problem is solved in revision 6123.