Create an initial vertical profile of constituents (e.g., temperature, salinity, pollutants and tracers) to use as data input for Delft3d numerical model
In the current stage, this program has been tested only to create a temperature stratification profile; further tests must be conducted to check if it works for other constituents too.
The algorithm requires as input data the following information:
- the number of grid points in m- and n- direction (same pair of integer name specified in mdf file)
- a text file indicating the profile of each activated constituent (profile must be specified from bottom to surface)
The program generates an output file, stratification.ini, that can be used in the Delft3D model. The input file must be specified in the Delf3D: Flow > Flow input > Initial conditions. In the dropdown list, you must select Initial conditions file and specify the file generated by the program.
PS 1: Make sure that the activated constituent has been activated in Delft3D. For example, if you wish to create an initial temperature profile, make sure that Temperature is selected in Flow > Flow input > Processes > Constituents.
PS 2: Make sure that the pair of integers specified in the program correspond with the values displayed in the .mdf file
To run the code, the user must have installed the following packages in a Python interpreter:
- Numpy
- Tkinter (for the GUI)
----- How to install Python and run the script above ------
The steps below describes the installation instruction to install Anaconda, which is the simplest way to run the codes in a Python interpreter.
- Go to Anaconda website (https://www.anaconda.com/) and find the option for Anaconda distribution;
- Choose the Python 3.x graphical installer version (note that there are three options for operating system: Windows, macOS, and Linux);
- Install the Anaconda interpreter;
- Nitime (0.7 or compatible): conda install -c conda-forge nitime
- Reportlab (3.5 or compatible): conda install -c anaconda reportlab
Attention: If you already have anaconda installed in your computer, make sure that the above packages are installed and the anaconda version has Python 3.X. If you use another interpreter, make sure that the following packages are installed in the your python interpreter: Numpy 1.16.3 and tk (tkinter) 8.6.8, or compatibles versions.
- After the installation of a python interpreter, download both scripts (stratification.py and stratification-gui.py) from this repository;
- Put everything in the same folder and run the script called stratification-gui.py;
- A graphical user interface (GUI) should be launched in seconds;