Water preprocessor: Difference between revisions

From Pardee Wiki
Jump to navigation Jump to search
(Created page with "Back to water data")
 
No edit summary
 
(50 intermediate revisions by the same user not shown)
Line 1: Line 1:
Back to [[Water_data|water data]]
= Series pulled into water preprocessor =
 
{| border="1" cellpadding="0" cellspacing="0" width="320"
|-
| height="20" width="64" | Table
| width="64" | Definition
| width="64" | Source
| width="64" | Notes
| width="64" | Last IFs Update
|-
| height="20" | SeriesWaterFossilWithdrawal
| Water withdrawal from fossil water aquifers
| UNESCO Non-Renewable Groundwater Report 2006
| SGH
| 2014/08/29
|-
| height="20" | SeriesWaterResFossil
| Water withdrawal from fossil water aquifers
| UNESCO Non-Renewable Groundwater Report 2006; Aquastat country profiles
| SGH
| 2014/08/29
|-
| height="20" | SeriesWaterResGroundAfrica
| Water withdrawal from fossil water aquifers for African countries
| Quantitative maps of groundwater resources in Africa
| SGH
| 2014/08/29
|-
| height="20" | SeriesWasterwaterTreated
| Wastewater: treated volume (10^9 m3/yr)<br/>
| AQU&nbsp; BATCH PULL
| KK,JM
| 2016/05/21
|-
| height="20" | SeriesWastewaterProduced
| Wastewater: produced volume (10^9 m3/yr)<br/>
| AQU&nbsp; BATCH PULL
| KK,JM
| 2016/05/21
|-
| height="20" | SeriesWastewaterTreatedReused
| Treated wastewater reused (10^9 m3/yr)<br/>
| AQU&nbsp; BATCH PULL
| KK,JM
| 2016/05/21
|-
| height="20" | SeriesWaterDesalinated
| Desalinated Water Produced
| AQU&nbsp; BATCH PULL
| KK,JM
| 2016/05/21
|-
| height="20" | SeriesWaterGroundWithD
| Ground Water Withdrawal
| AQU&nbsp; BATCH PULL
| KK,JM
| 2016/05/21
|-
| height="20" | SeriesWaterResExploitGround
| Exploitable: regular renewable groundwater (10^9 m3/yr)
| AQU&nbsp; BATCH PULL
| KK,JM
| 2016/05/21
|-
| height="20" | SeriesWaterResExploitSurface
| Exploitable: total renewable surface water (10^9 m3/yr)
| AQU&nbsp; BATCH PULL
| KK,JM
| 2016/05/21
|-
| height="20" | SeriesWaterResOverlap
| Overlap between surface and groundwater
| AQU&nbsp; BATCH PULL
| KK,JM
| 2016/05/21
|-
| height="20" | SeriesWaterResTotalExploit
| Water resources: total exploitable
| AQU&nbsp; BATCH PULL
| KK,JM
| 2016/05/21
|-
| height="20" | SeriesWaterResTotalRenew
| Water resources: total renewable (actual)
| AQU&nbsp; BATCH PULL
| KK,JM
| 2016/05/21
|-
| height="20" | SeriesWaterResTotalRenewGround
| Total renewable groundwater (actual) (10^9 m3/yr)
| AQU&nbsp; BATCH PULL
| KK,JM
| 2016/05/21
|-
| height="20" | SeriesWaterResTotalRenewSurface
| Total renewable suface water (actual)
| AQU&nbsp; BATCH PULL
| KK,JM
| 2016/05/21
|-
| height="20" | SeriesWaterSurfaceWithD
| Surface Water Withdrawal
| AQU&nbsp; BATCH PULL
| KK,JM
| 2016/05/21
|-
| height="20" | SeriesWaterTotalWithdSources
| Total water withdrawal (summed by sources)
| AQU&nbsp; BATCH PULL
| KK,JM
| 2016/05/21
|-
| height="20" | SeriesWaterWithdAgriculture
| Agricultural water withdrawal
| AQU&nbsp; BATCH PULL
| KK,JM
| 2016/05/21
|-
| height="20" | SeriesWaterWithdIndustrial
| Industrial water withdrawal
| AQU&nbsp; BATCH PULL
| KK,JM
| 2016/05/21
|-
| height="20" | SeriesWaterWithdMunicipal
| Municipal water withdrawal
| AQU&nbsp; BATCH PULL
| KK,JM
| 2016/05/21
|-
| height="20" | SeriesLandIrActual%Equip
| Area equipped for irrigation: actually irrigated,&nbsp;%
| AQU&nbsp; BATCH PULL
| KK;JM
| 2016/06/06
|}
 
= Water demand =
 
Start with demand. Read in water demand data by sector (municipal, industrial, agriculture, and total) and fill holes if we have 3 of those 4. Then fill holes for each sector using the same equations we would use to forecast those variables. Then normalize with total water demand (by sector) if there are data.
 
== Fill holes ==
 
If we have 3 of the 4 components of water demand (municipal, industrial, agriculture, and total by sector) then we can deduce the 4th.
 
For example,
 
<math>WatWithdMun_c=WatWithdTotalSector_c-WatWithdInd_c-WatWithdAg_c</math>
 
We do the same for each sector as well as WatWithdTotalSector.
 
== Municipal water demand ==
 
Use SeriesWaterWithdMunicipal to initialize municipal water demand (WatWithdMun).
 
If null, then calculate urban population:
 
<math>UrbanPercent = POPURBAN_c / POP_c</math>
 
Then estimate municipal water demand using the equation:&nbsp;"MunDemandPC (Linear) versus GDP2011PCPPP(MOSTRECENT) (Log) AND Connections" which is in AnalFunc.
 
<math>Prediction = (x_1*ln(GDPPCP_c)) + (x_2*ln(UrbanPercent)) + (x_3*ln(WATSAFE_{c,3})) + b</math>
 
Multiply municipal water demand per capita by the size of the urban population.
 
<math>WatWithdMun_c = Prediction * POPURBAN_r</math>
 
== Industrial water demand ==
 
Use SeriesWaterWithdIndustrial to initialize industrial water demand (WatWithdInd).
 
If null, then estimate using manufacturing value added. The equation is, "WaterWithdIndustrial(MOSTRECENT minus elec) (Linear) versus Man (Linear)" and is in TablFunc.
 
<math>Prediction = x_c*VADD_{c,manufacturing}</math>
 
== Agricultural water demand ==
 
Initialize agriculture water demand using SeriesWatWithdAg. If null, estimate using land irrigated.
 
Initialize land irrigated (LANDIRAREAACTUAL) using&nbsp;SeriesLandIrActual%Equip.
 
If null, set to 90 (percent).
 
Multiply by land equipped for irrigation:
 
<math>LANDIRAREAACTUAL_r = LANDIRAREAACTUAL_c * (CLandIrAreaEquip_c / 100)</math>
 
If LANDIRAREAACTUAL is still null, then set to 0.001.
 
Use LANDIRAREAACTUAL to estimate agricultural water demand using the equation: "WaterWithdAgriculture(MOSTRECENT) (Linear) versus Irrigated land (Linear)"
 
<math>WatWithdAg_c=x*LANDIRAREAACTUAL_c+b</math>
 
== Normalize with total demand ==
 
If we have data for total water demand (WatWithdTotalSector) but it does not match with the sum of our sectors, we normalize the sectors to match the total data. For example,
 
<math>WatWithdMun_c=(WatWithdMun_c/WatTotalDemand)*WatWithdTotalSector_c</math>
 
where
 
<math>WatTotalDemand = \sum_{sector}^3 WaterDemand_{c,sector}</math>
 
== Water withdrawal growth rates ==
 
Initialize water withdrawal growth rates (WaterWithdrawalSurfaceGR, WaterWithdrawalGroundGR, WaterWithdrawalFossilGroundGR) using the "getAnnualGrowthRate" function and the tables: SeriesWatWithdSurface, SeriesWatWithDGround, and SeriesWatWithDFossilGround.
 
= Total and exploitable renewable resources =
 
Initialize total renewable surface water resources (WatResTotalRenewSurface) using SeriesWaterResTotalRenewSurface.&nbsp;
 
Initialize total renewable groundwater resources (WatResTotalRenewGround) using SeriesWaterResTotalRenewGround.
 
Initialize total renewable water resources (WatResTotalRenew) using SeriesWaterResTotalRenew.
 
=== Fill holes ===
 
If WatResTotalRenewGround is null but WatResTotalRenewSurface and WaterResTotalRenew are not null, then:
 
<math>WatResTotalRenewGround_c=WaterResTotalRenew_c-WatResTotalRenewSurface_c</math>
 
If WatResTotalRenewSurface is null, but WatResTotalRenewGround and WaterResTotalRenew are not null, then:
 
<math>WatResTotalRenewSurface_c=WaterResTotalRenew_c-WatResTotalRenewGround_c</math>
 
If WaterResTotalRenew is null, but WatResTotalRenewGround and WatResTotalRenewSurface are not null, then:
 
<math>WaterResTotalRenew_c=WatResTotalRenewGround_c+WatResTotalRenewSurface_c</math>
 
If we do not have data for any of them, estimate total using land area:
 
<math>WaterResTotalRenew_c=x*LANDAREA_c</math>
 
and then assume surface water is 71 percent of total and ground water is 29 percent.
 
<math>WatResTotalRenewGround_c = 0.29 * WaterResTotalRenew_c</math>
 
<math>WatResTotalRenewSurface_c = 0.71 * WaterResTotalRenew_c</math>
 
If we only have data for total, then assume surface is 71 percent and groundwater is 29 percent.
 
If we only have surface then assume surface is 71 percent of total:
 
<math>WaterResTotalRenew_c = WatResTotalRenewSurface_c / 0.71</math>
 
and that groundwater is 29 percent of total.
 
If we only have data for groundwater then assume groundwater is 29 percent of total:
 
<math>WaterResTotalRenew_c=WatResTotalRenewGround_c / 0.29</math>
 
and that surface is 71 percent of total.
 
 
Subtract overlap between surface and groundwater out. Initialize overlap with SeriesWaterResOverlap.
 
<math>WatResTotalRenewSurface_c=\dfrac{WatResTotalRenewSurface_c}{WaterResTotalSurfaceGround_c}*(WaterResTotalSurfaceGround_c-Overlap_c)</math>
 
<math>WatResTotalRenewGround_c=\dfrac{WatResTotalRenewGround_c}{WaterResTotalSurfaceGround_c}*(WaterResTotalSurfaceGround_c-Overlap_c)</math>
 
 
If we have data for total renewable water resources (TRWR) but not TRWR surface and ground then we estimate based on the total using global averages. If we do not have data for exploitable surface and ground water resources we estimate using TRWR surface and ground resources.
 
If WatResTotalRenewGround is still 0 then: <math>WatResTotalRenewGround_c=0.29*WaterResTotalRenew_c</math>
 
If WatResTotalRenewSurface is still 0 then: <math>WatResTotalRenewSurface_c=0.71*WaterResTotalRenew_c</math>
 
If WatResExploitRenewGround is 0 then: <math>WatResExploitRenewGround_c=0.89*WatResTotalRenewGround_c</math>
 
If WatResExploitRenewSurface is 0 then: <math>WatResExploitRenewSurface_c=0.36*WatResTotalRenewSurface_c</math>
 
WatResExploitRenewSurface was initialized using SeriesWaterResExploitSurface and WatResExploitRenewGround was initialized using SeriesWaterResExploitGround.
 
If total exploitable is 0 then use sum of surface and ground: <math>WaterResTotalExploit_c=WatResExploitSurface_c+WatResExploitRenewGround_c</math>
 
If total renewable is still 0 then use sum of surface and ground: <math>WaterResTotalRenew_c=WatResTotalRenewSurface_c+WatResTotalRenewGround_c</math>
 
= Withdrawals (by source) =
 
AQUASTAT includes fossil water withdrawals in their groundwater withdrawal data so we must subtract it out.
 
<math>WatWithDGround_c=WatWithDGround_c-WatWithDFossilGround_c</math>
 
The fossil water reserve data we have (WaterResGroundAfrica) also includes both renewable and fossil, so we must subtract out renewable.
 
<math>WATERRESFOSSIL_c=WaterResGroundAfrica_c-WatResTotalRenewGround_c</math>
 
If we do not have fossil water data resources (WATERRESFOSSIL) but we do have fossil water withdrawals (WatWithDFossilGround) then we estimate that withdrawals are 10 percent of reserves.
 
<math>WATERRESFOSSIL_c=10*WatWithDFossilGround_c</math>
 
If we have no data for either fossil water reserves or withdrawals, then assume they are 0.
 
If we have data for both total renewable withdrawals and groundwater withdrawals, we estimate surface water withdrawals:
 
<math>WatWithDSurface_c=WatWithDTotalSources_c-WatWithDGround_c</math> [check this]
 
If we have data for both total renewable withdrawals and surface water withdrawals, we estimate groundwater withdrawals:
 
<math>WatWithDGround_c=WatWithDTotalSources_c-WatWithDSurface_c</math>
 
If we have total water withdrawal, but not for surface and ground then we estimate using global averages:
 
<math>WatWithDSurface_c=0.67*WatWithDTotalSources_c</math> <math>WatWithDGround_c=0.33*WatWithDTotalSources_c</math>
 
If we do not have data for total withdrawals, or surface, or ground, then estimate total using demand and then global averages for surface and ground.
 
<math>WatWithDSurface_c=0.67*TotalDemand_c</math> <math>WatWithDGround_c=0.33*TotalDemand_c</math> [make sure this is OK, feel like we're missing the third piece in this branch of the logic]
 
= Wastewater =
 
Initialize produced wastewater (WastewaterProduced) using '''SeriesWastewaterProduced'''
 
Initialize treated wastewater (WastewaterTreated)&nbsp;using '''SeriesWasterwaterTreated'''
 
Initialize treated and reused wastewater (WastewaterTreatedReused) using '''SeriesWastewaterTreatedReused'''
 
If we have data for both wastewater produced and wastewater treated and the data says that treated > produced we change volume treated to a portion of produced. This is because a country cannot treat more wastewater than is produced and is probably from a problem in taking the most recent data i.e. we are taking different years for treated v. produced.
 
If WastewaterTreated > WasteWaterProduced then
 
<math>WastewaterTreated_c=0.95*WastewaterProduced_c</math>
 
The same logic that applies to the relationship between treated wastewater and produced wastewater applies to the relationship between treated wastewater and treated-and-reused wastewater i.e. if we have data for both and treated and reused exceeds treated then we know there is a problem with the data and assume that the country reused 95% of treated wastewater.
 
If WastewaterTreatedReused > WastewaterTreated then
 
<math>WastewaterTreatedReused_c=0.95*WastewaterTreated_c</math>
 
If we do not have data for wastewater produced then we estimate using municipal water demand.
 
<math>WastewaterProduced_c=x*WatWithDMun_c+b</math>
 
If treated wastewater is still greater than produced wastewater then that means that there was data for treated wastewater but not produced wastewater and that the equation we used to estimate produced wastewater (using Mun demand) was an underestimation. We correct for this by assuming these countries treat 80% of their produced wastewater.
 
If WastewaterTreated > WastewaterProduced then <math>WastewaterProduced_c=WastewaterTreated_c*1.2</math>
 
If WastewaterTreated is still 0 then use GDP per capita (2011) to estimate the portion of produced wastewater that's treated. The equation is called: "WastewaterTreated pct of produced (Linear) versus GDP2011PCPPP(MOSTRECENT) (Log)"
 
<math>TreatedPortionProduced_c=x*GDPPCP_c+b</math> <math>WastewaterTreated_c=TreatedPortionProduced_c*WastewaterProduced_c</math>
 
If WastewaterTreatedReused is still null, then assume it is 66 percent of WastewaterTreated <math>WasteWaterTreatedReused_c=0.66*WastewaterTreated_c</math>
 
==  ==
 
= Total water supply =
 
Before calculating total water supply, we need to add secondary water into exploitable surface water. Secondary water is treated wastewater that is not directly reused.
 
<math>WatResExploitRenewSurface_c+WatResExploitRenewSurface_c+WastewaterTreated_c-WastewaterTreatedReused_c</math>
 
Calculate total water supply
 
<math>WATERTOTALSUPPLY_c=WatWithDFossilGround_c+WatResExploitRenewSurface_c+WatResExploitRenewGround_c+WastewaterTreatedReused_c+WATERDESALINATED_c</math>

Latest revision as of 00:14, 19 January 2017

Series pulled into water preprocessor

Table Definition Source Notes Last IFs Update
SeriesWaterFossilWithdrawal Water withdrawal from fossil water aquifers UNESCO Non-Renewable Groundwater Report 2006 SGH 2014/08/29
SeriesWaterResFossil Water withdrawal from fossil water aquifers UNESCO Non-Renewable Groundwater Report 2006; Aquastat country profiles SGH 2014/08/29
SeriesWaterResGroundAfrica Water withdrawal from fossil water aquifers for African countries Quantitative maps of groundwater resources in Africa SGH 2014/08/29
SeriesWasterwaterTreated Wastewater: treated volume (10^9 m3/yr)
AQU  BATCH PULL KK,JM 2016/05/21
SeriesWastewaterProduced Wastewater: produced volume (10^9 m3/yr)
AQU  BATCH PULL KK,JM 2016/05/21
SeriesWastewaterTreatedReused Treated wastewater reused (10^9 m3/yr)
AQU  BATCH PULL KK,JM 2016/05/21
SeriesWaterDesalinated Desalinated Water Produced AQU  BATCH PULL KK,JM 2016/05/21
SeriesWaterGroundWithD Ground Water Withdrawal AQU  BATCH PULL KK,JM 2016/05/21
SeriesWaterResExploitGround Exploitable: regular renewable groundwater (10^9 m3/yr) AQU  BATCH PULL KK,JM 2016/05/21
SeriesWaterResExploitSurface Exploitable: total renewable surface water (10^9 m3/yr) AQU  BATCH PULL KK,JM 2016/05/21
SeriesWaterResOverlap Overlap between surface and groundwater AQU  BATCH PULL KK,JM 2016/05/21
SeriesWaterResTotalExploit Water resources: total exploitable AQU  BATCH PULL KK,JM 2016/05/21
SeriesWaterResTotalRenew Water resources: total renewable (actual) AQU  BATCH PULL KK,JM 2016/05/21
SeriesWaterResTotalRenewGround Total renewable groundwater (actual) (10^9 m3/yr) AQU  BATCH PULL KK,JM 2016/05/21
SeriesWaterResTotalRenewSurface Total renewable suface water (actual) AQU  BATCH PULL KK,JM 2016/05/21
SeriesWaterSurfaceWithD Surface Water Withdrawal AQU  BATCH PULL KK,JM 2016/05/21
SeriesWaterTotalWithdSources Total water withdrawal (summed by sources) AQU  BATCH PULL KK,JM 2016/05/21
SeriesWaterWithdAgriculture Agricultural water withdrawal AQU  BATCH PULL KK,JM 2016/05/21
SeriesWaterWithdIndustrial Industrial water withdrawal AQU  BATCH PULL KK,JM 2016/05/21
SeriesWaterWithdMunicipal Municipal water withdrawal AQU  BATCH PULL KK,JM 2016/05/21
SeriesLandIrActual%Equip Area equipped for irrigation: actually irrigated, % AQU  BATCH PULL KK;JM 2016/06/06

Water demand

Start with demand. Read in water demand data by sector (municipal, industrial, agriculture, and total) and fill holes if we have 3 of those 4. Then fill holes for each sector using the same equations we would use to forecast those variables. Then normalize with total water demand (by sector) if there are data.

Fill holes

If we have 3 of the 4 components of water demand (municipal, industrial, agriculture, and total by sector) then we can deduce the 4th.

For example,

We do the same for each sector as well as WatWithdTotalSector.

Municipal water demand

Use SeriesWaterWithdMunicipal to initialize municipal water demand (WatWithdMun).

If null, then calculate urban population:

Then estimate municipal water demand using the equation: "MunDemandPC (Linear) versus GDP2011PCPPP(MOSTRECENT) (Log) AND Connections" which is in AnalFunc.

Multiply municipal water demand per capita by the size of the urban population.

Industrial water demand

Use SeriesWaterWithdIndustrial to initialize industrial water demand (WatWithdInd).

If null, then estimate using manufacturing value added. The equation is, "WaterWithdIndustrial(MOSTRECENT minus elec) (Linear) versus Man (Linear)" and is in TablFunc.

Agricultural water demand

Initialize agriculture water demand using SeriesWatWithdAg. If null, estimate using land irrigated.

Initialize land irrigated (LANDIRAREAACTUAL) using SeriesLandIrActual%Equip.

If null, set to 90 (percent).

Multiply by land equipped for irrigation:

If LANDIRAREAACTUAL is still null, then set to 0.001.

Use LANDIRAREAACTUAL to estimate agricultural water demand using the equation: "WaterWithdAgriculture(MOSTRECENT) (Linear) versus Irrigated land (Linear)"

Normalize with total demand

If we have data for total water demand (WatWithdTotalSector) but it does not match with the sum of our sectors, we normalize the sectors to match the total data. For example,

where

Water withdrawal growth rates

Initialize water withdrawal growth rates (WaterWithdrawalSurfaceGR, WaterWithdrawalGroundGR, WaterWithdrawalFossilGroundGR) using the "getAnnualGrowthRate" function and the tables: SeriesWatWithdSurface, SeriesWatWithDGround, and SeriesWatWithDFossilGround.

Total and exploitable renewable resources

Initialize total renewable surface water resources (WatResTotalRenewSurface) using SeriesWaterResTotalRenewSurface. 

Initialize total renewable groundwater resources (WatResTotalRenewGround) using SeriesWaterResTotalRenewGround.

Initialize total renewable water resources (WatResTotalRenew) using SeriesWaterResTotalRenew.

Fill holes

If WatResTotalRenewGround is null but WatResTotalRenewSurface and WaterResTotalRenew are not null, then:

If WatResTotalRenewSurface is null, but WatResTotalRenewGround and WaterResTotalRenew are not null, then:

If WaterResTotalRenew is null, but WatResTotalRenewGround and WatResTotalRenewSurface are not null, then:

If we do not have data for any of them, estimate total using land area:

and then assume surface water is 71 percent of total and ground water is 29 percent.

If we only have data for total, then assume surface is 71 percent and groundwater is 29 percent.

If we only have surface then assume surface is 71 percent of total:

and that groundwater is 29 percent of total.

If we only have data for groundwater then assume groundwater is 29 percent of total:

and that surface is 71 percent of total.


Subtract overlap between surface and groundwater out. Initialize overlap with SeriesWaterResOverlap.


If we have data for total renewable water resources (TRWR) but not TRWR surface and ground then we estimate based on the total using global averages. If we do not have data for exploitable surface and ground water resources we estimate using TRWR surface and ground resources.

If WatResTotalRenewGround is still 0 then:

If WatResTotalRenewSurface is still 0 then:

If WatResExploitRenewGround is 0 then:

If WatResExploitRenewSurface is 0 then:

WatResExploitRenewSurface was initialized using SeriesWaterResExploitSurface and WatResExploitRenewGround was initialized using SeriesWaterResExploitGround.

If total exploitable is 0 then use sum of surface and ground:

If total renewable is still 0 then use sum of surface and ground:

Withdrawals (by source)

AQUASTAT includes fossil water withdrawals in their groundwater withdrawal data so we must subtract it out.

The fossil water reserve data we have (WaterResGroundAfrica) also includes both renewable and fossil, so we must subtract out renewable.

If we do not have fossil water data resources (WATERRESFOSSIL) but we do have fossil water withdrawals (WatWithDFossilGround) then we estimate that withdrawals are 10 percent of reserves.

If we have no data for either fossil water reserves or withdrawals, then assume they are 0.

If we have data for both total renewable withdrawals and groundwater withdrawals, we estimate surface water withdrawals:

[check this]

If we have data for both total renewable withdrawals and surface water withdrawals, we estimate groundwater withdrawals:

If we have total water withdrawal, but not for surface and ground then we estimate using global averages:

If we do not have data for total withdrawals, or surface, or ground, then estimate total using demand and then global averages for surface and ground.

[make sure this is OK, feel like we're missing the third piece in this branch of the logic]

Wastewater

Initialize produced wastewater (WastewaterProduced) using SeriesWastewaterProduced

Initialize treated wastewater (WastewaterTreated) using SeriesWasterwaterTreated

Initialize treated and reused wastewater (WastewaterTreatedReused) using SeriesWastewaterTreatedReused

If we have data for both wastewater produced and wastewater treated and the data says that treated > produced we change volume treated to a portion of produced. This is because a country cannot treat more wastewater than is produced and is probably from a problem in taking the most recent data i.e. we are taking different years for treated v. produced.

If WastewaterTreated > WasteWaterProduced then

The same logic that applies to the relationship between treated wastewater and produced wastewater applies to the relationship between treated wastewater and treated-and-reused wastewater i.e. if we have data for both and treated and reused exceeds treated then we know there is a problem with the data and assume that the country reused 95% of treated wastewater.

If WastewaterTreatedReused > WastewaterTreated then

If we do not have data for wastewater produced then we estimate using municipal water demand.

If treated wastewater is still greater than produced wastewater then that means that there was data for treated wastewater but not produced wastewater and that the equation we used to estimate produced wastewater (using Mun demand) was an underestimation. We correct for this by assuming these countries treat 80% of their produced wastewater.

If WastewaterTreated > WastewaterProduced then

If WastewaterTreated is still 0 then use GDP per capita (2011) to estimate the portion of produced wastewater that's treated. The equation is called: "WastewaterTreated pct of produced (Linear) versus GDP2011PCPPP(MOSTRECENT) (Log)"

If WastewaterTreatedReused is still null, then assume it is 66 percent of WastewaterTreated

Total water supply

Before calculating total water supply, we need to add secondary water into exploitable surface water. Secondary water is treated wastewater that is not directly reused.

Calculate total water supply