As you have changed the number of arguments of SATUR_O2 subroutine, could you provide the other modified files to run your suggested modifications (e.g. calcs3d_eutro.f, calcs3d_o2.f, calcs2d_eutro.f calcs2d_o2.f, interface_waqtel.f)?
Is this formula also relevant for 2D?
I suppose you had to give a salinity value (constant over the time? Did you have to declare it in declarations_waqtel.f and/or in the dictionary as a new keyword)? Please provide the modified files in that case also.
Do you have a test case to validate this formula? If not, perhaps you can start from the basis of the waq3d_eutro example?
Have you updated the WAQTEL theory guide and WAQTEL user manual with this new formula?
Working on a branch is quite convenient to discuss between developers.
If you are not familiar with git and in a hurry, we can first start by exchanging files here.
If you are not familiar with LaTeX for the documentation, if you provide the information in ASCII or Word, I can try to help.
Yes, the formula is valid in 2D. This formulation is to be used by default when a tracer "salinity" is activited in TELEMAC-2D or TELEMAC-3D. Not sure yet that a new keyword to select a default constant and uniform salinity value for WAQTEL is necessary, when the tracer salinity is not activated. I will prepare and share the additional files including documentations in LaTex to integrate it in the most useful way.
A good practice is to verify the implementation of the formula in the code using a set of test values generally provided by authors in the reference publication, in the same way as the equation of state established by UNESCO (density as a function of salinity, temperature and pressure). Rather than a test case, I would suggest to create a new variable Cs "concentration of oxygen saturation" in the VARIABLES FOR 2D GRAPHIC PRINTOUTS and VARIABLES FOR 3D GRAPHIC PRINTOUTS. This will allow the users to save the DO saturation concentration in the outputs and derive the percentage of oxygen saturation, a common parameter of water quality.
Benson and Krause (1984) is the reference publication, however I work mainly with the following book (in french only) which provides a comprehensive and practical documentation (conversion tables, examples and excel spreadsheets) for the calculation:
Hydrologie des écosystèmes marins : paramètres et analyses / Auteurs Alain Aminot, Roger Kérouel ; Ifremer Brest, direction de l'Environnement et de l'aménagement littoral [préface de Philippe Quevauviller]
Aminot, Alain; Kérouel Roger,; Quevauviller, Philippe
Plouzané : Ifremer; DL 2004, 2004
OK for the potential keyword for salinity value. When reading the whole set of subroutines, it should be easier to decide. At worst, 0.D0 can be provided as dummy value if no salinity as a tracer (Benson and Krause formula would not be used as not salinity is provided and the 2 others do not use it).
I suppose you have checked the implementation of the formula by yourself outside TELEMAC?
Rather than nothing, a test-case based on waq3d_eutro adding SALINITY as a tracer and this new law for saturated oxygen may be enough, at least to validate that the implementation runs and still runs in the future.
OK for you idea to save DO (T2_1 in CALCS3D_EUTRO). It has then to be duplicated in a permanent array when calling SOURCE_WAQ. I can try to do it for next release and will then ask for your feedback if you are OK.
It can be done for EUTRO and O2 in 2D and 3D.
In 3D, as it is only computed at the surface, it will be stored as a VARIABLES FOR 2D GRAPHIC PRINTOUTS no the VARIABLES FOR 3D GRAPHIC PRINTOUTS if I correctly understand.
The most urgent is to provide the source files so that we can discuss.
I have created a new branch called CSO2 to solve the idea to store O2 saturation concentration.
If you agree, you can review a Merge Request that I could create when you come back.
see attached a test case : the Streeter-Phelps model, works in V8P4R0 and includes the calculation of Cs as a function of temperature and salinity
case 1 : temperature and salinity taken from default values (temperature from waqtel steering file and salinity prescribed by an internal variable WATSAL in fortran)
case 2 : salinity and temperature activated in TELEMAC-3D.
O2 saturation concentration at 100% ( or Cs) is saved in PRIVE2D(1) and the percentage of O2 saturation in PRIVE2D(2). The exact analytical solution is in the excel file, which can be compared accurately only with a 2D model.
The same test case can be developped using the submodule O2 instead of EUTRO, to test the implementation of the calculation of Cs as a function of temperature and salinity in calcs3d_o2.f (not done here).
It would also be helpful to implement Cs (saturation concentration) as a 3D variable instead of 2D, as it is a very useful graphical output, necessary to calculate the percentage of O2 saturation over the whole water column.
Thanks a lot for the test case. I will have a look at it.
After reading the new files for this feature, if using formula Benson and Krause formula, I wonder if temperature and salinity should not have to be declared as tracers in the TELEMAC steering file. In that case, no need to declare an additional variable WATSAL (salinity value can then be taken from keyword INITIAL VALUES OF TRACERS if it does not change).
In that case, we can only keep your 2nd test case, which may be sufficient.
Just to be sure to understand your claim to implement CS (saturation concentration) as a 3D variable.
At the moment (in release v8p4r0 in CALCS3D_EUTRO), it is the 1st argument of subroutine SATUR_O2 and is only computed at the surface. In 3D, what you want is to compute this 1st argument for every 3D node (thus a loop from 1 to NPOIN3) and save the array as a 3D array, am I right?
Are you interested in computing and keeping these values both in 3D (in the 3D RESULT FILE) and also at the surface (in the 2D RESULT FILE)? Or in 3D, you do not often look only at free surface value for saturation concentration and my previous suggestion can be changed to only 3D (no problem), but I prefer not changing to useless variables.
At last, if saving saturation concentration CS in 3D, is the ratio O2 concentration over saturation concentration CS a usual variable to be looked at and should it also be saved as a 3D variable by TELEMAC. If not so usual, it can be let to be done by the users as O2 concentration and Cs will be available in 3D.
Thanks for your feedback, I will be able to do the changes after it.
I would rather go for the implementation of a constant salinity value WATSAL as a keyword 'WATER SALINITY' in WAQTEL, as it already exists a constant temperature WATTEMP associated to the keyword 'WATER TEMPERATURE'. In this way one make sure that a default constant salinity value is set up, and that this default value can be easily modified.
The idea is to compute Cs for every 3D nodes, save it in the 3D result file and save the vertical mean (not the surface values) in the 2D result file. The surface Cs will be in the 3D result file. No need to create a special 2D variable for surface Cs in the 2D result file.
Yes, percentage of oxygen saturation ( ratio of O2 concentration over Cs) is an usual variable to look at, especially in estuary as Cs varies greatly with salinity. It worth saving it in the 3D result file.
OK for the writing of Cs and percentage of O2 saturation as 3D variables and not saving special surface CS in the 2D result file.
I wonder if average value of Cs over the vertical is usual and really needed in 3D or not (possibly to save time and space if not). If it is, no problem, I will compute it for the 2D result, just to be sure it is really needed.
I will start with these new features separately from the new formula to compute Cs as they are independent, in a separate branch.
Visualising the mean vertical Cs and percentage of O2 saturation allows to focus on the longitudinal variations in estuaries or rivers for example, even if vertical variations also exists. In the same way as for any other tracers ( salinity, sediment...). During the development of a model, it is also useful to check the general pattern of a variable in 2D before looking into the details of the full 3D spatial distribution. So yes, saving Cs and the percentage of O2 saturation as vertical mean in the 2D results of TELEMAC-3D is meaningful.
vertical average of percentage of oxygen saturation = vertical average of the ratio [O2]/Cs x 100 calculated for every 3D node.
Percentage of O2 saturation is equal to [O2]/Cs x 100. So no problem if [O2] is equal to zero.
Cs is independant from [O2]. It depends only on temperature and salinity. Within the range of validity of Benson&Krause (Temp=0-35°C, Sal=0-40g/l), the range of value for Cs is maximum 14.62mg/l ( Temp=0°C, Salinity=0 g/l) to mimimum 5.62mg/l (temp=35°C, salinity=40g/l). So Cs is never zero. However it is important to ensure in the code that the temperature and salinity used for the calculation of Cs is within the range of validity.
For example if [O2]=0mg/l, whatever Cs is, the percentage of saturation will be 0%.
OK thanks for the clarification and warnings. My bad, I have read too quickly for the order in the ratio for percentage of O2 saturation.
I will implement the new variables and will come back to you when it is ready.
If coupling EUTRO (or O2) with TELEMAC-2D, should both 2 variables Cs and percentage of oxygen saturation also be saved in the RESULT FILE like in 3D? It can be implemented in the same push.
Hello Anne,
The branch CSO2 is up to date with the writing of Cs and the percentage of O2 saturation in the results file for TELEMAC-2D and TELEMAC-3D.
I am going to create a Merge Request to integrate it into the main. When reviewed (possibly by you?) and OK, it will be merged and then, the specific part with the new formula with Cs will be able to be integrated as well.
See attached the test case of Streeter-Phelps in TELEMAC-2D coupled with WAQTEL.
It is minimal at this stage, but the comparison with the analytical solution is valuable.
waq2d_eutro_streeter_phelps.zipwaqtel_validation_main.pdf