Personal tools

Eutrofização Albufeiras

From MohidWiki

Revision as of 14:07, 29 August 2009 by Davidbrito (talk | contribs) (Steps)
Jump to: navigation, search

Overview

It is intended to produce a step-by-step procedure to run reservoir model CE-QUAL-W2

Where to Start?

  1. If you need to have first insights on CEQUAL-W2 model, applications already done see \\datacenter\Albufeiras_Eutrofizacao\ComoFazer\0.Bibliografia
  2. If you already feel ready to start, initiate with collecting all the data available for your reservoir and watershed in snirh (http://snirh.pt). First use the shapes in \\datacenter\Albufeiras_Eutrofizacao\Produtos\ProjectosGIS\ShapesBase to check which flow and quality stations are in the reservoir and watershed. Then, go to snirh to download the desired data from that stations.
  3. Follow the steps in \\datacenter\Albufeiras_Eutrofizacao\ComoFazer

Tasks

1.Get Input Data

Water Quantity in the reservoir

  1. Go to http://snirh.pt
  2. For water quantity in the reservoir click "Albufeiras->Dados de base".
  3. Choose your desired station (reservoir name) and click "Seleccionar estações"
  4. click "Validar Lista". Check below which parameters to choose to download (holding shift or ctrl while clicking will perform multiple selections)
  5. After all desired parameters selected, click "Ver/Guardar Dados"
  6. Wait until all data is dowloaded and the click upper right button "Export CSV"
  7. Choose a folder and a name for your file (use the recommended folder structure and a name that identifies the type of data)
  8. Open and transform your data using "Data->Text to Columns" then save the .csv file into excel .xls.

List of input data needed:

Consumo agrícola mensal
Consumo municipal mensal
Descarga de fundo mensal
Descarga de superfície mensal
Volume armazenado mensal (final do mês) 
Cota da Albufeira - recommned to download together with the next to a different file because is daily data (sometimes also hourly)
Volume armazenado (convencional) - recommned  to download together with the previous to a different file because is daily data

Water Quality in the reservoir

  1. Go to http://snirh.pt
  2. For water quality in the reservoir click "Rios->Dados de base(qualidade)".
  3. Choose your desired station (reservoir name) and click "Seleccionar estações"
  4. click "Validar Lista". Check below which parameters to choose to download (holding shift or ctrl while clicking will perform multiple selections)
  5. After all desired parameters selected, click "Ver/Guardar Dados"
  6. Wait until all data is dowloaded and the click upper right button "Export CSV"
  7. Choose a folder and a name for your file (use the recommended structure)
  8. Open and transform your data using "Data->Text to Columns" then save the .csv file into excel .xls.

List of input data needed:

Temperatura da amostra
Transparência
Nitrato Total (em NO3)
Amónia Total  (em NH4)
Nitrito Total (em NO2)
Azoto Orgânico(ou Azoto Kjeldahl)
Azoto Total
Ortofosfato Total
Fósforo Total
Clorofila-a
Fitoplancton ... (Espécies de algas - normalmente não existe esta informação) 
Sólidos Suspensos Totais
Oxigénio dissolvido (normalmente aparecem vários)
CBO 5dias
Ferro dissolvido
Ferro total
Ferro particulado

Meteorology - need to know which station are closer. Use ArcGIS, reservoir and station shapefiles in \\Datacenter\Albufeiras_Eutrofizacao\Produtos\ProjectosGIS\ShapesBase to check them. See the video using MOHID GIS in http://screencast.com/t/vOa6esZAjFL

  1. Go to http://snirh.pt
  2. For meteorology click "Meteorologia->Dados de base".
  3. Choose your desired stations and click "Seleccionar estações"
  4. click "Validar Lista". Check below which parameters to choose to download (holding shiftor ctrl while clicking will perform multiple selections)
  5. After all desired parameters selected, click "Ver/Guardar Dados"
  6. Wait until all data is dowloaded and the click upper right button "Export CSV"
  7. Choose a folder and a name for your file (use the recommended structure)
  8. Open and transform your data using "Data->Text to Columns" then save the .csv file into excel .xls.

List of input data needed:

Temperatura do ar média diária
Humidade relativa média diária  - for dew point calculation
Velocidade do vento médio diário
Direcção do vento horário - recommned to download to a different file because is hourly data


Water Quantity in the incoming rivers - need to know which station are in the inflowing rivers. Use ArcGIS, reservoir, river and station shapefiles in \\Datacenter\Albufeiras_Eutrofizacao\Produtos\ProjectosGIS\ShapesBase to check them. See the video using MOHID GIS in http://screencast.com/t/vOa6esZAjFL

  1. Go to http://snirh.pt
  2. For water quantity in the river click "Rios->Dados de base(quantidade)".
  3. Choose your desired station and click "Seleccionar estações"
  4. click "Validar Lista". Check below which parameters to choose to download (holding shift or ctrl while clicking will perform multiple selections)
  5. After all desired parameters selected, click "Ver/Guardar Dados"
  6. Wait until all data is dowloaded and the click upper right button "Export CSV"
  7. Choose a folder and a name for your file (use the recommended structure)
  8. Open and transform your data using "Data->Text to Columns" then save the .csv file into excel .xls.

List of input data needed:

Caudal médio diário
Nível médio diário (se não existir caudal)

Water Quality in the incoming rivers- need to know which station are in the inflowing rivers. Use ArcGIS, reservoir, river and station shapefiles in \\Datacenter\Albufeiras_Eutrofizacao\Produtos\ProjectosGIS\ShapesBase to check them. See the video using MOHID GIS in http://screencast.com/t/vOa6esZAjFL

  1. Go to http://snirh.pt
  2. For water quality in the river click "Rios->Dados de base(qualidade)".
  3. Choose your desired station and click "Seleccionar estações"
  4. click "Validar Lista". Check below which parameters to choose to download (holding shift or ctrl while clicking will perform multiple selections)
  5. After all desired parameters selected, click "Ver/Guardar Dados"
  6. Wait until all data is dowloaded and the click upper right button "Export CSV"
  7. Choose a folder and a name for your file (use the recommended structure)
  8. Open and transform your data using "Data->Text to Columns" then save the .csv file into excel .xls.

List of input data needed:

Temperatura da amostra
Nitrato Total (em NO3)
Amónia Total  (em NH4)
Nitrito Total (em NO2)
Azoto Orgânico(ou Azoto Kjeldahl)
Azoto Total
Ortofosfato Total
Fósforo Total
Clorofila-a
Fitoplancton ... (Espécies de algas - normalmente não existe esta informação) 
Sólidos Suspensos Totais
Oxigénio dissolvido (normalmente aparecem vários)
CBO 5dias
Ferro dissolvido
Ferro total


How to prepare input data for model to run see \\datacenter\Albufeiras_Eutrofizacao\ComoFazer\1.PreparaInputs

2.Check Data

Note It is important to check input data for a) outliers b) detection limit values c) understanding the reservoir or river dynamic. As so, always perform time serie graphs for each property or/and flow. Also ploting several related properties (e.g. nutrients and chlorofila) or several meteorological stations will help in understanding the data consistency.


3.Create Bathymetry

Prepare Carta Militar

  1. See in which "carta militar" your reservoir is in, opening in MOHID GIS the reservoir shapefiles and the file Portugal_cartas.img (as Background Image) from \\datacenter\Albufeiras_Eutrofizacao\Produtos\ProjectosGIS\imagens
  2. Go to \\Kepler\DataCenter1\DataCenter\DadosBase\Terra\Cartas Militares. The folders are named with the range number of the "carta militares". Enter in the directory where your carta is and copy it to your directory.
  3. Check if the .jpg file is associated with one .jpgw. If it is, you can proceed to the next step. If not search for assistance.
  4. Open your just copied image in MOHID GIS using the steps in How to Import georeferenced images in MOHID GIS

Use Carta Militar and some drawing to get reservoir geometry

  1. Check your NPA ("Nivel de Pleno Armazenamento") height and bottom level of your reservoir at http://cnpgb.inag.pt/gr_barragens/gbportugal/Lista.htm
  2. If your reservoir appears in the Carta Militar, check if the water surface represented is the NPA; In the other end, if the reservoir does not appear in the Carta Militar (only the river prior to the costruction), draw the inundated area at NPA (insert polygon in MOHID GIS).
  3. Draw lines where top geometry of the reservoir (or NPA) changes to help you define the next steps.

Create the reservoir bathymetry

  1. To create the bathymetry there are two excel files in \\Datacenter\Albufeiras_Eutrofizacao\ComoFazer\1.PreparaInputs\1.Batimetria\Geometria. One is the tool if your reservoir appears in Carta Militar and the other if it wont.
  2. Follow specific instructions for the filling of excel file in \\Datacenter\Albufeiras_Eutrofizacao\ComoFazer\1.PreparaInputs\1.Batimetria\Geometria - HowtoUseExcelFiles.txt
  3. Open W2i Program in \\Datacenter\Albufeiras_Eutrofizacao\ComoFazer\1.PreparaInputs\1.Batimetria\W2i. This program will generate the cequal bathymetry file.
  4. Select "New Build" and browse for the excel file that you just did.
  5. W2i will produce bathymetry file and other cequal input files.
  6. Select now in W2i "View Bat" and browse in the excel folder for the w2.con file that W2i produced.
  7. Check if your bathymetry is like you imagined it!

Validate your bathymetry

  1. Check total volume of your reservoir (in INAG page above) with excel file.
  2. For a finer comparison use W2i to get reservoir volume curve ("view bat") and then "Volume = f(Height)" and compare it with water quantity in the reservoir downloaded (first step of this tutorial) - "cota" and "volume armazenado" - check the video Step 3 at the bottom of the page

4. Run CE-QUAL model

See video link in http://www.screencast.com/t/9HMApeM21VPs or video file (larger screen) in \\Datacenter\Albufeiras_Eutrofizacao\Produtos\Apresentacoes\200908-Albufeiras (comofuncionacequal.swf)

How does the model work?

The model has a core file "w2.con" where all information about how many branches, segments, layers, water inputs and uptakes, hydrodynamic and quality parameters, output information, other files needed names... Basically has it all. All other files have their names in w2.con and model will search for them if needed. When running the executable the model will process all the information in "w2.con" and the needed information from the other files (meteorology, inflows and outflows) and the evolution with time appears (lines are printed out to screen with julian day of simulation, dt and other info).

How do I run the model?

After performing all the steps to prepare the model to run (next chapters), just need to double click on the .bat file present (see next steps) and that is it. The .bat file function is to pause the .exe file if program crashes in order to see error info.

First Run

In the first run we are going just to put the model running with less concern to boundary conditions. In order to see the project example that we are going to use go to \\datacenter\Albufeiras_Eutrofizacao\ComoFazer\2.CorreCe-Qual\ExemploBase_Maranhao\RunRef38_Maranhao\WithoutOutputFiles The w2.con file is there and all the input files associated (.npt)

The w2.con file

To understand w2.con file follow cequal manual in \\datacenter\Albufeiras_Eutrofizacao\ComoFazer\0.Bibliografia from page 297 and on where all the keywords are explained. Take at least a couple of minutes to understand its structure and type of parameters.

Steps

See video link in http://www.screencast.com/t/wWYfZPFk9t or video (larger screen) file in \\Datacenter\Albufeiras_Eutrofizacao\Produtos\Apresentacoes\200908-Albufeiras (comofazerprimeirasimulacao.swf)

  1. Create a new folder for the process
  2. Copy to the folder i) the manual from \\datacenter\Albufeiras_Eutrofizacao\ComoFazer\0.Bibliografia; ii) the files created by W2i program when producing the bathymetry; iii) the w2.con file, the .exe file, the .bat files and graph.npt from the Maranhão project in \\datacenter\Albufeiras_Eutrofizacao\ComoFazer\2.CorreCe-Qual\ExemploBase_Maranhao\RunRef38_Maranhao\WithoutOutputFiles
  3. Copy your meteo file for this run from \\Datacenter\Albufeiras_Eutrofizacao\ComoFazer\2.CorreCe-Qual\meteo_files. Use for example the one for Alentejo. In this simulation it is not important to have local climatology, that will be important in the next run.
  4. Now the hard task is to convert the w2.con from the Maranhão project to your reservoir project. W2.con file is very strict on where keywords and values are aligned. As so, try to follow the structure already initiated. IMPORTANT: Always have the cequal manual in hand to search for any keyword that you want to kown what it is; after page 297 the control file (w2.con) is all detailed what parameters mean and how to fill them.
  5. Change w2.con - Check the adaptations nedded comparing w2.con file to file (use for instance WinDiff that comes with Compaq Fortran compiler or download at http://www.grigsoft.com/download-windiff.htm Grig Software) from the example with Beliche reservoir: i) the original files coming from w2i program: \\Datacenter\Albufeiras_Eutrofizacao\ComoFazer\2.CorreCe-Qual\ExemploBase_Maranhao\1.SimulacaoZero\OriginalFromW2iProgram; and 2) the final files adapted with w2.con from Maranhão \\Datacenter\Albufeiras_Eutrofizacao\ComoFazer\2.CorreCe-Qual\ExemploBase_Maranhao\1.SimulacaoZero\AdaptedToW2con. Always follow the changes with the manual in order to understand what means each parameter.
  6. Change w2.con - The above example has same number of branches as Maranhão so there were no more changes to do. However, w2.con needs one line per branch even if parameters are not defined. So if you have more than 3 branches add one line with branch number when appears "Br1" "Br2" "Br3", or delete all the lines with "Br2" and "Br3" if you have for instance only one branch.
  7. For this initial run give zero input flows (Qin.npt), zero concentrations (Cin.npt) and constant temperature (Tin.npt) meaning that there will be no flow entering in the reservoir. Remind that the order of Concentrations species in controled in "CIN" keyword in W2.con.
  8. Also remind to give initial and final date inputs (Qin.npt, Cin.npt, Tin.npt or wsc.npt) that comprise the simulation period.

Running with local boundary conditions

5. Evaluating Results

FAQ

Q: What is the software that I need to install?

A: For Cequal you only will need an .exe file that will be distributed. For the first steps you will need any GIS software that opens shapefiles and georeferenced images (ArcGIS, MohidGIS, etc.). If any doubt on how to install them call David. IE or Mozilla web browser will work just fine in www.snirh.pt

Q: Where do I find data?

A: All the data needed up to now is from http://snirh.pt. Water flows in the reservoir, water height and volumes are taken from "Albufeiras" network. However, water quality in the reservoir is taken from "Rios->Dados de base (qualidade)"; this may cause confusion because reservoir data is in river network. Water flow and water quality entering in the reservoir from tributaries are taken from "Rios->Dados de base (qualidade)" and "Rios->Dados de base (quantidade)" - remember to check first which stations are inside the reservoir watershed.

Q: What is the desired period time of the simulation?

A: The desired period of simulation is around 10-20 years. The best practice is not to filter data (as much of it e.g. water quality has not yet reached 10 years) because all the data may be needed.

Q: My excel 2003 doesn't open big csv files (with more than 65545 lines. What can I do?

A: Use excel 2007. Use Data-->TextToColumns to spread your csv data on several columns.

Q: How to convert excel dates into Julian dates?

A: Define a year where to start as for example 1990 (e.g. first year of simulation). 1-1-1990 will be your julian day 1, all other days will be in this reference. To convert excel dates to julian dates in this example do Julian date = Excel Date - (1-1-1990) + 1, meaning that you have to subtract all excel dates with the date of your first julian date (1-1-1990 in the example) and add 1 because 1-1-1990 has to be day one and not day zero, and so on.

Q: O braço dum afluente encaixa na margem errada do braço principal. Como posso indicar para o afluente encaixar na "outra margem"?

A: Tenta mudar a orientação do segmento do braço principal (o segmento aonde se vai encaixar o braço do afluente). Mudar a orientação do segmento do afluente que encaixa no braço principal não serve de nada. Eis um exemplo: antes e depois.

Support Material

  • The kick-off internal meeting video is available at \\datacenter\Albufeiras_Eutrofizacao\Produtos\Apresentacoes

Video tutorials