Delft3d-FLOW

Quick Start Manual

Michael Kliphuis

8 dec 2017

1. Introduction

Delft3D-FLOW is a multi-dimensional (2D or 3D) hydrodynamic (and transport) simulation program which calculates non-steady flow and transport phenomena that result from tidal andmeteorological forcing on a rectilinear or a curvilinear, boundary fitted grid.

Chapter twodescribes how to start a parallel Delft3d-FLOW run on a cluster like Cartesiusand chapter three how to plot the results of a run with an application called QUICKPLOT.

2. Run Delft3d-FLOW

This chapter describes how to quickly setup and start a Delft3d-FLOW run.

As an example we take a low resolution (approximately 200m) run that simulates the Lake Garda in Italy on the ‘dijkbio’ login on Cartesius.

2.1Log in to Cartesius

ssh –X

with password: ******

you know it, I better not mention it because this document will be on my website

All the needed files to start a run are on Cartesius[*]on the ‘dijkbio’ login in the directory:

/projects/0/samoc/henk/delft3d/garda/F2004/200m/scripts/run_template

If you want to start a new run to test parameters, e.g. let’s call it pm_run1 then type:

cd /projects/0/samoc/henk/delft3d/garda/F2004/200m/scripts

cp –r run_template pm_run1

cd pm_run1

then in run.sh change the line

cd /projects/0/samoc/henk/delft3d/garda/F2004/200m/scripts/run_template

into

cd /projects/0/samoc/henk/delft3d/garda/F2004/200m/scripts/pm_run1

If needed change any of the parameters in the file g2004.mdf

check the meaning of the parameters via the manual

After that you are ready to start the run.

2.2Start run (in the batch queue)

  1. cd /projects/0/samoc/henk/delft3d/garda/F2004/200m/scripts/pm_run1
  1. Open the MDF file g2004.mdf
  • Determine the reference start date of the run.

e.g. set it to:

Itdate = #2004-01-01#

  • Set the restart file from which you want to restart from. We did a spinup run of 5modelyears and we want to start from restart file

trim-Y2008_21jun-31dec_F2004.dat containing all modeldays from 21 jun 2008-31dec2008.

Restid = #trim-Y2008_21jun-31dec_F2004#

  • Set the start time 'Tstart' of your run. Since the value of 'Tunit' is #M# which means minutes, set it to:

Tstart=2630880

In this example we want to start on the last day of restart file

Restid = trim-Y2008_21jun-31dec_F2004. The name is a bit misleading but this is actually 1 jan 2009 = day 1827 with respect to Itdate = 1 jan 2004 (366*2 + 3*365 = 1827). So the start minute Tstart = 1827*60*24=2630880

  • Set the stop time 'Tstop' of your run. Since the value of 'Tunit' is #M# which means minutes, set it to:

Tstop = 3156480

Tstop is the last day of year 2009=(1827+365)*60*24=3156480.

Note that year 2004 and 2008 are leap years

  • Set the frequency of writing 3D output like temperature and velocities to a so called map file (in this case trim-g2004.dat)

e.g. set it to:

Flmap = 0 1440 3156480

which means start writing at minute 0 and stop at minute 3156480 with a time interval of every 1440 minutes. In other words write to the trim file every model day.

  • Set the frequency of writing 2D output like temperature and velocities in certain observation points (set in file obspoints_unitn_62x222.obs in table 1 above)to a so called history file (in this case trih-g2004.dat)

e.g. set it to:

Flhis = 0 60 3156480

which means start writing at minute 0 and stop at minute 3156480 with a time interval of every 60 minutes. In other words write to the trim file every model hour.

  • Set the frequency of writing a restart file (in this case for instance tri-rst.g2004.20090131.000000)

e.g. set it to:

Flrst = 43200

which means write every 43200 minutes (30 model days) .

In fact these restart files are not used, we use the trim*dat files (also possible). Perhaps we can just leave this empty then???

These were the main keyword settings but there are many more keywords you can set in the MDF file. For a complete list go to section A.1.2 on page 417 of the user manual at

  1. Open the file run.sh
  • Set the number of cores you want to run on, e.g. set it to 32:

#SBATCH -n 32

  • Set the name of the job, e.g. set it to 200m_garda:

#SBATCH -J 200m_garda

  • Reserve time for running this job in the batch, e.g. reserve 30 hours.

#SBATCH -t 30:00:00

Make sure this is long enough for the job to finish. If it finishes sooner then this is no problem. The higher you set this value the longer it can take for a job to get picked up.

  1. Start the job by submitting it to the batch queue by typing:

sbatch run.sh

5.Check the status of the job by typing:

mysqueue (this is an alias for squeue -u dijkbio

-u to denote the login you work on is dijkbio)

you then see for instance:

JOBID PARTITION NAME USER TIME_LIMIT START_TIME ST TIME NODES NODELIST(REASON)

3163469 broadwell 200m_g dijkbio 4-00:00:00 20170522T14:28:34 R 10:50 1 tcn921

which means that the job has jobid 3163469, it is running on a broadwell node and has name 200m_g. It is reserved to run for 96 wallclock hours (4 wallclock days), it started on 22 May 2017 at 14:28:34, it has status (ST) running (R) and it is already running for 10m 50s on 1 node namely node tcn921.

If you want to stop the run then type:

scancel 3163469

  1. Check how far the run is by opening the file slurm-3163469.out. I usually type:

tail -f slurm-3163469.out

  1. Finally AND THIS IS VERY IMPORTANT! When the run is finished rename the outputfiles:

trih-g2004.dat

trih-g2004.def

trim-g2004.dat

trim-g2004.def

If you do not do this then starting the run again or restarting it from another restartfile

will overwrite these files and you lost all data. I usually run for 1 modelyear e.g. year

2009 and when the run is done I type:

mv trih-g2004.dat trih-Y2009_F2004.dat

mv trih-g2004.def trih-Y2009_F2004.def

mv trim-g2004.def trim-Y2009_F2004.def

mv trim-g2004.dat trim-Y2009_F2004.dat

cp g2004.mdf g2004.mdf_y2009

After that you can restart the run to simulate year 2010 by setting in g2004.mdf

Tstart = 3156480

Tstop = 3682080

Restid = #trim-Y2009_F2004#

The next section describes all the files in the run directory that are needed for the run

2.3More info on the needed files

The table below showsall the files (and information about them) in directory run_template (and pm_run1) These files are needed in order to run this/aDelft3d-FLOW run:

g2004.mdf / the so called“Master Definition Flow”
file (MDF-file) which contains all information to execute a flow simulation. It is the main input file in which a user sets thetime step, the start and stop time, used parametrizations etc. but also the name of the grid file (.grd), bathymetry file (.dep), the forcing files containing the atmospheric wind forcing (.amu and .amv) and all other files in this table. Here it is called g2004.mdf because it starts a run that is forced with a year 2004 atmospheric forcing
Gardagrid_unitn.grd / grid file
Gardagrid_unitn.enc / grid enclosure file
benaco_05052017.dep / bathymetry file
drypoints_unitn.dry / indices of dry points file
obspoints_unitn_62x222.obs / observation points file
2004-2010_interp.amc / air cloudiness forcing file
7 years all containing forcing of year 2004
2004-2010_interp.amp / atmospheric pressure forcing file
7 years all containing forcing of year 2004
2004-2010_interp.amr / relative air humidity forcing file
7 years all containing forcing of year 2004
2004-2010_interp.amt / air temperature forcing file
7 years all containing forcing of year 2004
2004-2010_interp.amu / wind speed in East direction forcing file
7 years all containing forcing of year 2004
2004-2010_interp.amv / wind speed in North direction forcing file
7 years all containing forcing of year 2004
2004-2010_interp.ams / Solar radiationforcing file
7 years all containing forcing of year 2004
2004_interp.grd / forcing grid file (set in the 7 forcing files above)
config_d_hydro.xml / config file expected as argument for Delft3d-FLOW executable d_hydro.exe. It contains the name of the MDF file (in this case g2004.mdf)
run.sh / script to start the run in the batch on Cartesius

Making the grid (.grd) and enclosure (.enc) files is done with the Delft3d application RGFGRID. The bathymetry (.dep) file is made with Delft3d application QUICKIN. The way to do this is not in the scope of this document. The following manuals show how:

3. Plot the results with QUICKPLOT

Running Delft3d-FLOW will generate 3D map and 2D history files like. The easiest way to check these output files is with QUICKPLOT which is a Matlab program. You do this as follows:

1.cd /projects/0/samoc/henk/delft3d/garda/F2004/200m/matlab

2.type:

matlab

3.In the Matlab command window type:

d3d_qp

Don’t worry about all the WARNINGS you will get! You will soon see the following window:

5.Then select an input file by clicking on File followed by Open File and select for instance the map output file one directory up in scripts/pm_run1called trim-g2004.datas shown in the figure below:

6.Standard the selected variable is 'morphological grid'.

Select one of the many other variables for instance 'temperature flux'

7.This variable is valid for all 100 depth values. If you only want to see the temperature flux in the highest level (100) then deselect the 'all' box and set value 100 as shown in the figure below:

8.Then plot the 'temperature flux' by clicking the button 'Quick View' righ below.

You then get a new window showing the plot.

You can loop to other time frames by clicking on the < or > of the slide pointed to by the red arrows in the figure above.

For more information about the use of QUICKPLOT check its manual at:

[*]If you want to run it on another login on Cartesius or on another machine please contact

Michael Kliphuis ()