From 11ed2f159fc91f9724ce6909ada46f11cc8eb5a4 Mon Sep 17 00:00:00 2001 From: Ting Sun Date: Fri, 15 May 2020 10:13:36 +0100 Subject: [PATCH] v2020a release (#114) * update recent publications * more recent papers * fix * edits to RSL description * update refs * fix sorting order * add more comments * improve formatting * renaming * add water for all surfaces * minor edits * fix subroutine * fixed passing water use within driver subroutine * success in implementing irrigation on all surfaces * improve formatting * improve formatting * update version number: 2019b * Regenerate build artifacts. * update version * update sample run for 2019b * expose variable output level for supy driver * update driver version * recover legacy solweig code * cleaning * cleaning * cleaning * recover a simple version of SOLWEIG back into SUEWS * fix output of SOLWEIG * fix K side in SOLWEIG * fix L side * fix Tg by using SUEWS produced surface temperature * update sample run * update driver version * Revert "cleaning" This reverts commit 2c664108ba873d8d8d98e60fed6192014dd2f907. * add pythonn 3.8 recipe for supy_driver in azure * add SOLWEIG output meta info csv * include solweig into supy_driver * cleaning * add initialisation of wu * several fixes in SOLWEIG * update sample run * update driver version * minor change * fix solweig part in supy driver * refine formatting * add build of supy-driver for python 3.8 * fix manylinux build for python 3.8 * update py3.8 path * update sample run * add new option for roughlenheatmethod * update docs * update ignore * add a release template * update actions * update actions * disable one action * trigger fpretify * Regenerate build artifacts. * update issue template * add 2020a input files * remove binary * update test procedure * update build and test procedure * cleaning * update driver version * update template * update sample run * optimise test procedure * cleaning * Regenerate build artifacts. * cleaning * implemented a ponding-allowed scheme in irrigation module; updated input files * improve formatting * fix a bug in initialisation of irrigation input data * update sample run * update docs * update supy-driver version * minor edits in docs * Regenerate build artifacts. * renaming variables for consistency * update sample run * update the water-to-maintain feature * update supy version * Regenerate build artifacts. * update driver version * test up-to-date numpy build * fix numpy on many-linux * update format * Regenerate build artifacts. * add irrigation fractions for non-vegetative surfaces and update sample input files (CHANGES IN SITESELECT) * implemented irrigation fractions for non-vegetative surfaces * update supy-driver version: irrigation fractions * Regenerate build artifacts. * update driver version * update docs * update azure pipeline for macOS version * update mac version in pipeline * fix a bug in multitstep for supy-driver * update docs requirements * simplify QF interface * simplify QF code 1 * update test python code to include only output files * simplify qf code * simplify QF code * add a new method to calculate HDD/CDD based on U-shape approach * update docs * cleaning * Regenerate build artifacts. * update supy-driver version for the HDD/CDD calculation * fix variable naming in docs * fix glitches in docs * updating the docs for SUEWS_parameters (#112) Co-authored-by: Hamidreza Omidvar * stop using `gitflow`: rather tedious and less agile; remove description from README * minor edits * Regenerate build artifacts. * update docs for input converter * update docs for 2020a * update pipeline * update driver version. Fix #106 - Checklist for V2020a Co-authored-by: sunt05 Co-authored-by: Hamidreza Omidvar --- README.md | 15 +- Release/InputTables/2020a/RunControl.nml | 1 + .../2020a/SUEWS_AnthropogenicEmission.txt | 2 +- .../InputTables/2020a/SUEWS_Irrigation.txt | 12 +- .../InputTables/2020a/SUEWS_SiteSelect.txt | 8 +- SUEWS-SourceCode/suews_ctrl_calculations.f95 | 24 +- SUEWS-SourceCode/suews_ctrl_const.f95 | 221 +++++----- SUEWS-SourceCode/suews_ctrl_driver.f95 | 133 +++--- SUEWS-SourceCode/suews_ctrl_error.f95 | 4 + SUEWS-SourceCode/suews_ctrl_init.f95 | 85 +--- SUEWS-SourceCode/suews_ctrl_input.f95 | 5 +- SUEWS-SourceCode/suews_ctrl_sumin.f95 | 16 +- SUEWS-SourceCode/suews_ctrl_translate.f95 | 55 ++- SUEWS-SourceCode/suews_phys_anemsn.f95 | 115 ++--- SUEWS-SourceCode/suews_phys_dailystate.f95 | 353 +++++---------- SUEWS-SourceCode/suews_phys_rslprof.f95 | 7 +- SUEWS-SourceCode/suews_phys_waterdist.f95 | 56 ++- .../Input/SUEWS_AnthropogenicEmission.txt | 2 +- Test/BaseRun/2020a/Input/SUEWS_Irrigation.txt | 12 +- Test/BaseRun/2020a/Input/SUEWS_SiteSelect.txt | 8 +- .../2020a/Output/test1_2004_state_init.txt | 4 +- .../2020a/Output/test1_2005_state_init.txt | 4 +- Test/BaseRun/2020a/RunControl.nml | 1 + Test/code/Test_SUEWS.py | 409 ++++++++++-------- azure-pipelines.yml | 3 +- docs/requirements.txt | 3 +- .../input_files/RunControl/RunControl.rst | 2 +- .../RunControl/csv-table/BaseTMethod.csv | 3 + .../input_files/RunControl/scheme_options.rst | 12 + .../SUEWS_SiteInfo/Input_Options.rst | 77 +++- .../SUEWS_AnthropogenicEmission.rst | 2 +- .../SUEWS_SiteInfo/SUEWS_BiogenCO2.rst | 2 +- .../SUEWS_SiteInfo/SUEWS_Conductance.rst | 2 +- .../SUEWS_SiteInfo/SUEWS_Irrigation.rst | 2 +- .../SUEWS_SiteInfo/SUEWS_NonVeg.rst | 2 +- .../SUEWS_SiteInfo/SUEWS_OHMCoefficients.rst | 6 +- .../SUEWS_SiteInfo/SUEWS_SiteSelect.rst | 2 +- .../input_files/SUEWS_SiteInfo/SUEWS_Snow.rst | 2 +- .../input_files/SUEWS_SiteInfo/SUEWS_Soil.rst | 2 +- .../input_files/SUEWS_SiteInfo/SUEWS_Veg.rst | 2 +- .../SUEWS_SiteInfo/SUEWS_Water.rst | 2 +- .../SUEWS_WithinGridWaterDist.rst | 2 +- .../csv-table/{BaseTHDD.csv => BaseT_HC.csv} | 0 .../SUEWS_SiteInfo/csv-table/H_maintain.csv | 2 + .../SUEWS_SiteInfo/csv-table/IrrFr_BSoil.csv | 2 + .../SUEWS_SiteInfo/csv-table/IrrFr_Bldgs.csv | 2 + .../SUEWS_SiteInfo/csv-table/IrrFr_Paved.csv | 2 + .../SUEWS_SiteInfo/csv-table/IrrFr_Water.csv | 2 + .../csv-table/SUEWS_AnthropogenicEmission.csv | 2 +- .../csv-table/SUEWS_Irrigation.csv | 41 +- .../csv-table/SUEWS_SiteSelect.csv | 8 +- .../sample-table/SUEWS_SiteSelect.txt | 8 +- docs/source/input_files/input_converter.rst | 48 +- docs/source/prepare-to-run-the-model.rst | 3 +- docs/source/version-history/dev.rst | 6 +- docs/source/version-history/v2019a.rst | 1 - docs/source/version-history/v2020a.rst | 50 +++ .../version-history/version-history.rst | 1 + supy-driver/setup.py | 2 +- supy-driver/supy_driver/version.py | 2 +- 60 files changed, 971 insertions(+), 891 deletions(-) create mode 100644 docs/source/input_files/RunControl/csv-table/BaseTMethod.csv rename docs/source/input_files/SUEWS_SiteInfo/csv-table/{BaseTHDD.csv => BaseT_HC.csv} (100%) create mode 100644 docs/source/input_files/SUEWS_SiteInfo/csv-table/H_maintain.csv create mode 100644 docs/source/input_files/SUEWS_SiteInfo/csv-table/IrrFr_BSoil.csv create mode 100644 docs/source/input_files/SUEWS_SiteInfo/csv-table/IrrFr_Bldgs.csv create mode 100644 docs/source/input_files/SUEWS_SiteInfo/csv-table/IrrFr_Paved.csv create mode 100644 docs/source/input_files/SUEWS_SiteInfo/csv-table/IrrFr_Water.csv create mode 100644 docs/source/version-history/v2020a.rst diff --git a/README.md b/README.md index 4e23b73d0..db0583990 100644 --- a/README.md +++ b/README.md @@ -8,15 +8,14 @@ This is a public repo for SUEWS source code and documentation. - [Developer Note](#developer-note) - [Branch](#branch) - [Central curated branches](#central-curated-branches) - - [Workflow](#workflow) - [Manual](#manual) - [Test](#test) - [Tests and purposes](#tests-and-purposes) - - [Workflow](#workflow-1) + - [Workflow](#workflow) - [Preparation of tests](#preparation-of-tests) - [Debugging with GDB](#debugging-with-gdb) - [GDB on macOS](#gdb-on-macos) - - [debugging with GDB](#debugging-with-gdb) + - [debugging with GDB](#debugging-with-gdb-1) - [Questions](#questions) @@ -30,8 +29,6 @@ This is a public repo for SUEWS source code and documentation. ### Branch -The SUEWS repo follows the [`GitFlow` model](https://nvie.com/posts/a-successful-git-branching-model/) to manage sustainable development. - #### Central curated branches These branches are regularly curated by admin members with specific purposes and set with triggers for automatic deployment (via MS Azure Pipeline) in the [*releases* page](https://github.com/Urban-Meteorology-Reading/SUEWS/releases) named **Latest Release Test**: @@ -43,14 +40,6 @@ These branches are regularly curated by admin members with specific purposes and * `push` is restricted to admin members. -#### Workflow - -Please follow the [`GitFlow` model](https://nvie.com/posts/a-successful-git-branching-model/) for development. - -![`GitFlow` model](https://nvie.com/img/git-model@2x.png) - - - ### Manual * Please keep the development changes documented in the [Documentation repo](https://github.com/Urban-Meteorology-Reading/SUEWS-Docs). diff --git a/Release/InputTables/2020a/RunControl.nml b/Release/InputTables/2020a/RunControl.nml index 9a37ce9f4..67091db52 100644 --- a/Release/InputTables/2020a/RunControl.nml +++ b/Release/InputTables/2020a/RunControl.nml @@ -2,6 +2,7 @@ CBLUse=1 SnowUse=1 NetRadiationMethod=13 +BaseTMethod=1 EmissionsMethod=1 StorageHeatMethod=1 OHMIncQF=0 diff --git a/Release/InputTables/2020a/SUEWS_AnthropogenicEmission.txt b/Release/InputTables/2020a/SUEWS_AnthropogenicEmission.txt index a9cc01f2f..ec6f1c7f9 100644 --- a/Release/InputTables/2020a/SUEWS_AnthropogenicEmission.txt +++ b/Release/InputTables/2020a/SUEWS_AnthropogenicEmission.txt @@ -1,5 +1,5 @@ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 -Code BaseTHDD QF_A_WD QF_B_WD QF_C_WD QF_A_WE QF_B_WE QF_C_WE AHMin_WD AHMin_WE AHSlope_Heating_WD AHSlope_Heating_WE AHSlope_Cooling_WD AHSlope_Cooling_WE TCritic_Heating_WD TCritic_Heating_WE TCritic_Cooling_WD TCritic_Cooling_WE EnergyUseProfWD EnergyUseProfWE ActivityProfWD ActivityProfWE TraffProfWD TraffProfWE PopProfWD PopProfWE MinQFMetab MaxQFMetab MinFCMetab MaxFCMetab FrPDDwe FrFossilFuel_Heat FrFossilFuel_NonHeat EF_umolCO2perJ EnEF_v_Jkm FcEF_v_kgkmWD FcEF_v_kgkmWE CO2PointSource TrafficUnits +Code BaseT_HC QF_A_WD QF_B_WD QF_C_WD QF_A_WE QF_B_WE QF_C_WE AHMin_WD AHMin_WE AHSlope_Heating_WD AHSlope_Heating_WE AHSlope_Cooling_WD AHSlope_Cooling_WE TCritic_Heating_WD TCritic_Heating_WE TCritic_Cooling_WD TCritic_Cooling_WE EnergyUseProfWD EnergyUseProfWE ActivityProfWD ActivityProfWE TraffProfWD TraffProfWE PopProfWD PopProfWE MinQFMetab MaxQFMetab MinFCMetab MaxFCMetab FrPDDwe FrFossilFuel_Heat FrFossilFuel_NonHeat EF_umolCO2perJ EnEF_v_Jkm FcEF_v_kgkmWD FcEF_v_kgkmWE CO2PointSource TrafficUnits 10 18.2000 0.1000 0.0099 0.0102 0.1000 0.0099 0.0102 15.0000 15.0000 2.7000 2.7000 2.7000 2.7000 7.0000 7.0000 7.0000 7.0000 44.0000 45.0000 55663.0000 55664.0000 701.0000 702.0000 801.0000 802.0000 75.0000 175.0000 120.0000 280.0000 1.0000 0.0500 0.0000 1.1590 3970000.0000 0.2850 0.2850 0 1.0000 11 18.2000 0.3081 0.0099 0.0102 0.3081 0.0099 0.0102 -999.0000 -999.0000 -999.0000 -999.0000 -999.0000 -999.0000 -999.0000 -999.0000 -999.0000 -999.0000 44.0000 45.0000 55663.0000 55664.0000 701.0000 702.0000 801.0000 802.0000 75.0000 175.0000 120.0000 280.0000 1.0000 0.0500 0.0000 1.1590 4110000.0000 0.2850 0.2850 0 1.0000 551 18.2000 0.1446 0.0000 0.0037 0.1329 0.0000 0.0038 -999.0000 -999.0000 -999.0000 -999.0000 -999.0000 -999.0000 -999.0000 -999.0000 -999.0000 -999.0000 42.0000 43.0000 55663.0000 55664.0000 701.0000 702.0000 801.0000 802.0000 75.0000 175.0000 120.0000 280.0000 1.0000 0.7000 0.7000 1.1590 3970000.0000 0.2850 0.2850 0 1.0000 diff --git a/Release/InputTables/2020a/SUEWS_Irrigation.txt b/Release/InputTables/2020a/SUEWS_Irrigation.txt index 8cf19e183..eeb213191 100644 --- a/Release/InputTables/2020a/SUEWS_Irrigation.txt +++ b/Release/InputTables/2020a/SUEWS_Irrigation.txt @@ -1,8 +1,8 @@ -1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 -Code Ie_start Ie_end InternalWaterUse Faut Ie_a1 Ie_a2 Ie_a3 Ie_m1 Ie_m2 Ie_m3 DayWat(1) DayWat(2) DayWat(3) DayWat(4) DayWat(5) DayWat(6) DayWat(7) DayWatPer(1) DayWatPer(2) DayWatPer(3) DayWatPer(4) DayWatPer(5) DayWatPer(6) DayWatPer(7) -99999 1 366 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ! No irrigation -1 152 243 0 0.2 -84.535 9.959 3.674 -25.36 2.988 1.102 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -550 1 366 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ! Swindon "(not used, no irrigation)" -660 1 366 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ! London (assume no irrigation at the moment) +1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 +Code Ie_start Ie_end InternalWaterUse Faut H_maintain Ie_a1 Ie_a2 Ie_a3 Ie_m1 Ie_m2 Ie_m3 DayWat(1) DayWat(2) DayWat(3) DayWat(4) DayWat(5) DayWat(6) DayWat(7) DayWatPer(1) DayWatPer(2) DayWatPer(3) DayWatPer(4) DayWatPer(5) DayWatPer(6) DayWatPer(7) +99999 1 366 0 0 -999 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ! No irrigation +1 152 243 0 0.2 -999 -84.535 9.959 3.674 -25.36 2.988 1.102 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +550 1 366 0 0 -999 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ! Swindon "(not used, no irrigation)" +660 1 366 0 0 -999 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ! London (assume no irrigation at the moment) -9 -9 diff --git a/Release/InputTables/2020a/SUEWS_SiteSelect.txt b/Release/InputTables/2020a/SUEWS_SiteSelect.txt index 97246ffe3..dae111cfc 100644 --- a/Release/InputTables/2020a/SUEWS_SiteSelect.txt +++ b/Release/InputTables/2020a/SUEWS_SiteSelect.txt @@ -1,6 +1,6 @@ -1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 -Grid Year StartDLS EndDLS lat lng Timezone SurfaceArea Alt z id ih imin Fr_Paved Fr_Bldgs Fr_EveTr Fr_DecTr Fr_Grass Fr_Bsoil Fr_Water IrrFr_EveTr IrrFr_DecTr IrrFr_Grass H_Bldgs H_EveTr H_DecTr z0 zd FAI_Bldgs FAI_EveTr FAI_DecTr PopDensDay PopDensNight TrafficRate_WD TrafficRate_WE QF0_BEU_WD QF0_BEU_WE Code_Paved Code_Bldgs Code_EveTr Code_DecTr Code_Grass Code_Bsoil Code_Water LUMPS_DrRate LUMPS_Cover LUMPS_MaxRes NARP_Trans CondCode SnowCode SnowClearingProfWD SnowClearingProfWE AnthropogenicCode IrrigationCode WaterUseProfManuWD WaterUseProfManuWE WaterUseProfAutoWD WaterUseProfAutoWE FlowChange RunoffToWater PipeCapacity GridConnection1of8 Fraction1of8 GridConnection2of8 Fraction2of8 GridConnection3of8 Fraction3of8 GridConnection4of8 Fraction4of8 GridConnection5of8 Fraction5of8 GridConnection6of8 Fraction6of8 GridConnection7of8 Fraction7of8 GridConnection8of8 Fraction8of8 WithinGridPavedCode WithinGridBldgsCode WithinGridEveTrCode WithinGridDecTrCode WithinGridGrassCode WithinGridUnmanBSoilCode WithinGridWaterCode AreaWall Fr_ESTMClass_Paved1 Fr_ESTMClass_Paved2 Fr_ESTMClass_Paved3 Code_ESTMClass_Paved1 Code_ESTMClass_Paved2 Code_ESTMClass_Paved3 Fr_ESTMClass_Bldgs1 Fr_ESTMClass_Bldgs2 Fr_ESTMClass_Bldgs3 Fr_ESTMClass_Bldgs4 Fr_ESTMClass_Bldgs5 Code_ESTMClass_Bldgs1 Code_ESTMClass_Bldgs2 Code_ESTMClass_Bldgs3 Code_ESTMClass_Bldgs4 Code_ESTMClass_Bldgs5 -1 2004 85 302 57.7700 11.8700 2.0000 1.0000 15.0000 50.0000 1.0000 0.0000 0.0000 0.2000 0.2000 0.2000 0.1000 0.1000 0.1000 0.1000 0.0000 0.0000 0.0000 15.00 15.000 15.000 0.0100 0.2000 0.3000 0.3000 0.3000 0.0000 0.0000 0.0134 0.0095 0.7442 0.7955 661.0000 662.0000 661.0000 662.0000 663.0000 663.0000 661.0000 0.2500 1.0000 10.0000 1.0000 200.0000 660.0000 660.0000 660.0000 661.0000 660.0000 660.0000 660.0000 660.0000 660.0000 0.0000 0.1000 100.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 661.0000 662.0000 663.0000 664.0000 665.0000 666.0000 667.0000 -999.0000 0.0000 1.0000 0.0000 99999.0000 807.0000 99999.0000 1.0000 0.0000 0.0000 0.0000 0.0000 801.0000 99999.0000 99999.0000 99999.0000 99999.0000 -1 2005 85 302 57.7700 11.8700 2.0000 1.0000 15.0000 50.0000 1.0000 0.0000 0.0000 0.2000 0.2000 0.2000 0.1000 0.1000 0.1000 0.1000 0.0000 0.0000 0.0000 1.00 1.000 1.000 0.0100 0.2000 0.3000 0.3000 0.3000 0.0000 0.0000 0.0134 0.0095 0.7442 0.7955 661.0000 662.0000 661.0000 662.0000 663.0000 663.0000 661.0000 0.2500 1.0000 10.0000 1.0000 200.0000 660.0000 660.0000 660.0000 661.0000 660.0000 660.0000 660.0000 660.0000 660.0000 0.0000 0.1000 100.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 661.0000 662.0000 663.0000 664.0000 665.0000 666.0000 667.0000 -999.0000 0.0000 1.0000 0.0000 99999.0000 807.0000 99999.0000 1.0000 0.0000 0.0000 0.0000 0.0000 801.0000 99999.0000 99999.0000 99999.0000 99999.0000 +1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 +Grid Year StartDLS EndDLS lat lng Timezone SurfaceArea Alt z id ih imin Fr_Paved Fr_Bldgs Fr_EveTr Fr_DecTr Fr_Grass Fr_Bsoil Fr_Water IrrFr_Paved IrrFr_Bldgs IrrFr_EveTr IrrFr_DecTr IrrFr_Grass IrrFr_BSoil IrrFr_Water H_Bldgs H_EveTr H_DecTr z0 zd FAI_Bldgs FAI_EveTr FAI_DecTr PopDensDay PopDensNight TrafficRate_WD TrafficRate_WE QF0_BEU_WD QF0_BEU_WE Code_Paved Code_Bldgs Code_EveTr Code_DecTr Code_Grass Code_Bsoil Code_Water LUMPS_DrRate LUMPS_Cover LUMPS_MaxRes NARP_Trans CondCode SnowCode SnowClearingProfWD SnowClearingProfWE AnthropogenicCode IrrigationCode WaterUseProfManuWD WaterUseProfManuWE WaterUseProfAutoWD WaterUseProfAutoWE FlowChange RunoffToWater PipeCapacity GridConnection1of8 Fraction1of8 GridConnection2of8 Fraction2of8 GridConnection3of8 Fraction3of8 GridConnection4of8 Fraction4of8 GridConnection5of8 Fraction5of8 GridConnection6of8 Fraction6of8 GridConnection7of8 Fraction7of8 GridConnection8of8 Fraction8of8 WithinGridPavedCode WithinGridBldgsCode WithinGridEveTrCode WithinGridDecTrCode WithinGridGrassCode WithinGridUnmanBSoilCode WithinGridWaterCode AreaWall Fr_ESTMClass_Paved1 Fr_ESTMClass_Paved2 Fr_ESTMClass_Paved3 Code_ESTMClass_Paved1 Code_ESTMClass_Paved2 Code_ESTMClass_Paved3 Fr_ESTMClass_Bldgs1 Fr_ESTMClass_Bldgs2 Fr_ESTMClass_Bldgs3 Fr_ESTMClass_Bldgs4 Fr_ESTMClass_Bldgs5 Code_ESTMClass_Bldgs1 Code_ESTMClass_Bldgs2 Code_ESTMClass_Bldgs3 Code_ESTMClass_Bldgs4 Code_ESTMClass_Bldgs5 +1 2004 85 302 57.7700 11.8700 2.0000 1.0000 15.0000 50.0000 1.0000 0.0000 0.0000 0.2000 0.2000 0.2000 0.1000 0.1000 0.1000 0.1000 0.0 0.0 0.0000 0.0000 0.0000 0.0 0.0 15.00 15.000 15.000 0.0100 0.2000 0.3000 0.3000 0.3000 0.0000 0.0000 0.0134 0.0095 0.7442 0.7955 661.0000 662.0000 661.0000 662.0000 663.0000 663.0000 661.0000 0.2500 1.0000 10.0000 1.0000 200.0000 660.0000 660.0000 660.0000 661.0000 660.0000 660.0000 660.0000 660.0000 660.0000 0.0000 0.1000 100.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 661.0000 662.0000 663.0000 664.0000 665.0000 666.0000 667.0000 -999.0000 0.0000 1.0000 0.0000 99999.0000 807.0000 99999.0000 1.0000 0.0000 0.0000 0.0000 0.0000 801.0000 99999.0000 99999.0000 99999.0000 99999.0000 +1 2005 85 302 57.7700 11.8700 2.0000 1.0000 15.0000 50.0000 1.0000 0.0000 0.0000 0.2000 0.2000 0.2000 0.1000 0.1000 0.1000 0.1000 0.0 0.0 0.0000 0.0000 0.0000 0.0 0.0 1.00 1.000 1.000 0.0100 0.2000 0.3000 0.3000 0.3000 0.0000 0.0000 0.0134 0.0095 0.7442 0.7955 661.0000 662.0000 661.0000 662.0000 663.0000 663.0000 661.0000 0.2500 1.0000 10.0000 1.0000 200.0000 660.0000 660.0000 660.0000 661.0000 660.0000 660.0000 660.0000 660.0000 660.0000 0.0000 0.1000 100.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 661.0000 662.0000 663.0000 664.0000 665.0000 666.0000 667.0000 -999.0000 0.0000 1.0000 0.0000 99999.0000 807.0000 99999.0000 1.0000 0.0000 0.0000 0.0000 0.0000 801.0000 99999.0000 99999.0000 99999.0000 99999.0000 -9 -9 diff --git a/SUEWS-SourceCode/suews_ctrl_calculations.f95 b/SUEWS-SourceCode/suews_ctrl_calculations.f95 index 5a7fc98eb..85a7194a5 100644 --- a/SUEWS-SourceCode/suews_ctrl_calculations.f95 +++ b/SUEWS-SourceCode/suews_ctrl_calculations.f95 @@ -35,8 +35,8 @@ SUBROUTINE SUEWS_Calculations(Gridiv, ir, iMB, irMax) USE data_in, ONLY: diagnose, ah_min, ah_slope_cooling, ah_slope_heating, & - alt, avkdn, avrh, avu1, basetHDD, diagqn, diagqs, drainrt, co2pointsource, CBLuse, & - ef_umolco2perj, emissionsmethod, enef_v_jkm, enddls, fcef_v_kgkm, fcld_obs, & + alt, avkdn, avrh, avu1, BaseT_HC, diagqn, diagqs, drainrt, co2pointsource, CBLuse, & + ef_umolco2perj, BaseTMethod, emissionsmethod, enef_v_jkm, enddls, fcef_v_kgkm, fcld_obs, & frfossilfuel_heat, frfossilfuel_nonheat, EvapMethod, & LAIcalcyes, LAI_obs, lat, ldown_obs, lng, maxfcmetab, maxqfmetab, & minfcmetab, minqfmetab, netradiationmethod, ohmincqf, & @@ -45,7 +45,7 @@ SUBROUTINE SUEWS_Calculations(Gridiv, ir, iMB, irMax) qe_obs, qh_obs, qn1_obs, qs_obs, qf_obs, & raincover, rainmaxres, & roughlenmommethod, smdmethod, snowFrac_obs, snowuse, startdls, & - storageheatmethod, t_critic_cooling, t_critic_heating, temp_c, & + storageheatmethod, BaseT_Cooling, BaseT_Heating, temp_c, & timezone, trafficrate, trafficunits, waterusemethod, wu_m3, xsmd USE time, ONLY: iy, id, it, imin, isec, dectime, dt_since_start USE allocateArray, ONLY: & @@ -85,8 +85,11 @@ SUBROUTINE SUEWS_Calculations(Gridiv, ir, iMB, irMax) dataoutBL USE sues_data, ONLY: & aerodynamicresistancemethod, daywat, daywatper, faut, flowchange, & + H_maintain, & ie_a, ie_end, ie_m, ie_start, internalwateruse_h, & - irrfracconif, irrfracdecid, irrfracgrass, & + IrrFracPaved, IrrFracBldgs, & + IrrFracEveTr, IrrFracDecTr, IrrFracGrass, & + IrrFracBSoil, IrrFracWater, & pipecapacity, roughlenheatmethod, runofftowater, stabilitymethod, & surfacearea, tstep, tstep_prev, & qhforCBL, qeforCBL, qh_choice, nsh_real, UStar, psih, is @@ -127,16 +130,21 @@ SUBROUTINE SUEWS_Calculations(Gridiv, ir, iMB, irMax) alb, AlbMax_DecTr, AlbMax_EveTr, AlbMax_Grass, & AlbMin_DecTr, AlbMin_EveTr, AlbMin_Grass, & alpha_bioCO2, alpha_enh_bioCO2, alt, avkdn, avRh, avU1, BaseT, BaseTe, & - BaseTHDD, beta_bioCO2, beta_enh_bioCO2, bldgH, CapMax_dec, CapMin_dec, & + BaseTMethod, & + BaseT_HC, beta_bioCO2, beta_enh_bioCO2, bldgH, CapMax_dec, CapMin_dec, & chAnOHM, CO2PointSource, cpAnOHM, CRWmax, CRWmin, DayWat, DayWatPer, & DecTreeH, Diagnose, DiagQN, DiagQS, DRAINRT, & dt_since_start, dqndt, qn1_av, dqnsdt, qn1_s_av, & EF_umolCO2perJ, emis, EmissionsMethod, EnEF_v_Jkm, endDLS, EveTreeH, FAIBldg, & FAIDecTree, FAIEveTree, Faut, FcEF_v_kgkm, fcld_obs, FlowChange, & FrFossilFuel_Heat, FrFossilFuel_NonHeat, G1, G2, G3, G4, G5, G6, GDD_id, & - GDDFull, Gridiv, gsModel, HDD_id, HumActivity_24hr, & + GDDFull, Gridiv, gsModel, H_maintain, HDD_id, HumActivity_24hr, & IceFrac, id, Ie_a, Ie_end, Ie_m, Ie_start, imin, & - InternalWaterUse_h, IrrFracConif, IrrFracDecid, IrrFracGrass, isec, it, EvapMethod, & + InternalWaterUse_h, & + IrrFracPaved, IrrFracBldgs, & + IrrFracEveTr, IrrFracDecTr, IrrFracGrass, & + IrrFracBSoil, IrrFracWater, & + isec, it, EvapMethod, & iy, kkAnOHM, Kmax, LAI_id, LAICalcYes, LAIMax, LAIMin, LAI_obs, & LAIPower, LAIType, lat, lenDay_id, ldown_obs, lng, MaxConductance, MaxFCMetab, MaxQFMetab, & SnowWater, MetForcingData_grid, MinFCMetab, MinQFMetab, min_res_bioCO2, & @@ -155,7 +163,7 @@ SUBROUTINE SUEWS_Calculations(Gridiv, ir, iMB, irMax) soilstore_id, SoilStoreCap, StabilityMethod, startDLS, state_id, StateLimit, & StorageHeatMethod, StoreDrainPrm, SurfaceArea, Tair_av, tau_a, tau_f, tau_r, & Tmax_id, Tmin_id, & - T_CRITIC_Cooling, T_CRITIC_Heating, Temp_C, TempMeltFact, TH, & + BaseT_Cooling, BaseT_Heating, Temp_C, TempMeltFact, TH, & theta_bioCO2, timezone, TL, TrafficRate, TrafficUnits, & TraffProf_24hr, Ts5mindata_ir, tstep, tstep_prev, veg_type, & WaterDist, WaterUseMethod, WetThresh, wu_m3, & diff --git a/SUEWS-SourceCode/suews_ctrl_const.f95 b/SUEWS-SourceCode/suews_ctrl_const.f95 index 06dbacb50..31d755e5e 100644 --- a/SUEWS-SourceCode/suews_ctrl_const.f95 +++ b/SUEWS-SourceCode/suews_ctrl_const.f95 @@ -28,7 +28,7 @@ MODULE allocateArray INTEGER, PARAMETER:: MaxLinesMet = 8640 !Max no. lines to read in one go (for all grids, ie MaxLinesMet/NumberOfGrids each) ! ---- Set number of columns in input files ---------------------------------------------------- - INTEGER, PARAMETER:: ncolumnsSiteSelect = 101 !SUEWS_SiteSelect.txt + INTEGER, PARAMETER:: ncolumnsSiteSelect = 105 !SUEWS_SiteSelect.txt INTEGER, PARAMETER:: ncolumnsNonVeg = 24 !SUEWS_NonVeg.txt INTEGER, PARAMETER:: ncolumnsVeg = 38 !SUEWS_Veg.txt INTEGER, PARAMETER:: ncolumnsWater = 22 !SUEWS_Water.txt @@ -38,7 +38,7 @@ MODULE allocateArray INTEGER, PARAMETER:: ncolumnsOHMCoefficients = 4 !SUEWS_OHMCoefficients.txt INTEGER, PARAMETER:: ncolumnsESTMCoefficients = 52 !SUEWS_ESTMCoefficients.txt ! S.O. 04 Feb 2016 INTEGER, PARAMETER:: ncolumnsAnthropogenic = 39 !SUEWS_AnthropogenicEmission.txt - INTEGER, PARAMETER:: ncolumnsIrrigation = 25 !SUEWS_Irrigation.txt + INTEGER, PARAMETER:: ncolumnsIrrigation = 26 !SUEWS_Irrigation.txt INTEGER, PARAMETER:: ncolumnsProfiles = 25 !SUEWS_Profiles.txt INTEGER, PARAMETER:: ncolumnsWGWaterDist = 10 !SUEWS_WithinGridWaterDist.txt INTEGER, PARAMETER:: ncolumnsBiogen = 9 !SUEWS_BiogenCO2.txt @@ -620,7 +620,7 @@ MODULE allocateArray INTEGER, PARAMETER:: ccEndO = (ccEndGs + 18*nsurfIncSnow + nsurfIncSnow) ! Anthropogenic Emissions - INTEGER :: c_BaseTHDD = (ccEndO + 1) + INTEGER :: c_BaseT_HC = (ccEndO + 1) INTEGER :: c_QF_A1 = (ccEndO + 2) INTEGER :: c_QF_B1 = (ccEndO + 3) INTEGER :: c_QF_C1 = (ccEndO + 4) @@ -667,13 +667,14 @@ MODULE allocateArray INTEGER :: c_IeEnd = (ccEndA + 2) INTEGER :: c_IntWU = (ccEndA + 3) INTEGER :: c_Faut = (ccEndA + 4) - INTEGER, DIMENSION(3):: c_Ie_a = (/(cc, cc=ccEndA + 4 + 0*3 + 1, ccEndA + 4 + 0*3 + 3, 1)/) ! Automatic irrigation coeffs - INTEGER, DIMENSION(3):: c_Ie_m = (/(cc, cc=ccEndA + 4 + 1*3 + 1, ccEndA + 4 + 1*3 + 3, 1)/) ! Manual irrigation coeffs - INTEGER, DIMENSION(7):: c_DayWat = (/(cc, cc=ccEndA + 10 + 0*7 + 1, ccEndA + 10 + 0*7 + 7, 1)/) ! Irrigation allowed on each day - INTEGER, DIMENSION(7):: c_DayWatPer = (/(cc, cc=ccEndA + 10 + 1*7 + 1, ccEndA + 10 + 1*7 + 7, 1)/) ! Fraction properties using irrigation allowed on each day + INTEGER :: c_h_maintain = (ccEndA + 5) + INTEGER, DIMENSION(3):: c_Ie_a = (/(cc, cc=ccEndA + 5 + 0*3 + 1, ccEndA + 5 + 0*3 + 3, 1)/) ! Automatic irrigation coeffs + INTEGER, DIMENSION(3):: c_Ie_m = (/(cc, cc=ccEndA + 5 + 1*3 + 1, ccEndA + 5 + 1*3 + 3, 1)/) ! Manual irrigation coeffs + INTEGER, DIMENSION(7):: c_DayWat = (/(cc, cc=ccEndA + 11 + 0*7 + 1, ccEndA + 11 + 0*7 + 7, 1)/) ! Irrigation allowed on each day + INTEGER, DIMENSION(7):: c_DayWatPer = (/(cc, cc=ccEndA + 11 + 1*7 + 1, ccEndA + 11 + 1*7 + 7, 1)/) ! Fraction properties using irrigation allowed on each day ! Find current column number - INTEGER, PARAMETER:: ccEndIr = (ccEndA + 10 + 1*7 + 7) + INTEGER, PARAMETER:: ccEndIr = (ccEndA + 11 + 1*7 + 7) ! Hourly profiles INTEGER, DIMENSION(24):: c_HrProfEnUseWD = (/(cc, cc=ccEndIr + 0*24 + 1, ccEndIr + 0*24 + 24, 1)/) ! Energy use, weekdays @@ -974,6 +975,7 @@ MODULE data_in ! ---- Model options set in RunControl -------------------------------------------------------- INTEGER:: EmissionsMethod, & ! + BaseTMethod, & ! CBLuse, & !CBL slab model used (1) or not used (0) MultipleMetFiles, & !Indicates whether a single met file is used for all grids (0) or one for each grid (1) MultipleInitFiles, & !Indicates whether a single initial conditions file is used for all grids (0) or one for each grid (1) @@ -1039,14 +1041,14 @@ MODULE data_in !! Add units REAL(KIND(1d0)):: alpha_qhqe, & !Alpha parameter used in LUMPS QH and QE calculations [-] alt, & !Altitude [m] - ! avdens, & !Average air density, moved to `moist` by TS, 27 Aug 2019 + ! avdens, & !Average air density, moved to by TS, 27 Aug 2019 avkdn, & !Average downwelling shortwave radiation avrh, & !Average relative humidity avts, & !Average surface temperature avu1, & !Average wind speed avU10_ms, & !Average wind speed at 10 m azimuth, & !Sun azimuth in degrees - BaseTHDD, & !Base temperature for QF + BaseT_HC, & !Base temperature for QF BuildEnergyUse, & ! Building energy use CO2mWD, & !Diurnal activity profile (weekday) CO2mWE, & !Diurnal activity profile (weekend) @@ -1137,8 +1139,8 @@ MODULE data_in FcEF_v_kgkm, & ! NumCapita, & PopDensDaytime, & - T_CRITIC_Heating, & !Critical temperature - T_CRITIC_Cooling, & !Critical cooling temperature + BaseT_Heating, & !Critical temperature + BaseT_Cooling, & !Critical cooling temperature TrafficRate, & !Traffic rate QF0_BEU @@ -1514,10 +1516,15 @@ MODULE sues_data !Water use related variables REAL(KIND(1d0)):: ext_wu, & !External water use for the model timestep [mm] (over whole study area) Faut, & !Fraction of irrigated area using automatic irrigation + H_maintain, & ! ponding water depth to maintain [mm] (over whole study area) int_wu, & !Internal water use for the model timestep [mm] (over whole study area) - IrrFracConif, & !Fraction of evergreen trees which are irrigated - IrrFracDecid, & !Fraction of deciduous trees which are irrigated + IrrFracPaved, & !Fraction of paved which are irrigated + IrrFracBldgs, & !Fraction of buildings which are irrigated + IrrFracEveTr, & !Fraction of evergreen trees which are irrigated + IrrFracDecTr, & !Fraction of deciduous trees which are irrigated IrrFracGrass, & !Fraction of grass which is irrigated + IrrFracBSoil, & !Fraction of bare soil which is irrigated + IrrFracWater, & !Fraction of water which is irrigated InternalWaterUse_h !Internal water use [mm h-1] ! 7 - number of days in week @@ -1660,88 +1667,92 @@ MODULE ColNamesInputFiles c_FrBSoil = 19, & c_FrWater = 20, & ! Irrigated fractions - c_IrrEveTrFrac = 21, & - c_IrrDecTrFrac = 22, & - c_IrrGrassFrac = 23, & + c_IrrPavedFrac = 21, & + c_IrrBldgsFrac = 22, & + c_IrrEveTrFrac = 23, & + c_IrrDecTrFrac = 24, & + c_IrrGrassFrac = 25, & + c_IrrBSoilFrac = 26, & + c_IrrWaterFrac = 27, & ! Height information - c_HBldgs = 24, & - c_HEveTr = 25, & - c_HDecTr = 26, & - c_z0m = 27, & - c_zdm = 28, & - c_FAIBldgs = 29, & - c_FAIEveTr = 30, & - c_FAIDecTr = 31, & + c_HBldgs = 28, & + c_HEveTr = 29, & + c_HDecTr = 30, & + c_z0m = 31, & + c_zdm = 32, & + c_FAIBldgs = 33, & + c_FAIEveTr = 34, & + c_FAIDecTr = 35, & ! Population - c_PopDensDay = 32, & - c_PopDensNight = 33, & - c_TrafficRate_WD = 34, & ! Mean traffic rate in modelled area [veh km m-2 s-1] Weekday - c_TrafficRate_WE = 35, & ! Mean traffic rate in modelled area [veh km m-2 s-1] Weekend - c_QF0_BEU_WD = 36, & ! Building energy use for modelled area [W m-2] - QUESTION: could change units? - c_QF0_BEU_WE = 37, & + c_PopDensDay = 36, & + c_PopDensNight = 37, & + c_TrafficRate_WD = 38, & ! Mean traffic rate in modelled area [veh km m-2 s-1] Weekday + c_TrafficRate_WE = 39, & ! Mean traffic rate in modelled area [veh km m-2 s-1] Weekend + c_QF0_BEU_WD = 40, & ! Building energy use for modelled area [W m-2] - QUESTION: could change units? + c_QF0_BEU_WE = 41, & ! Codes for different surfaces - c_PavedCode = 38, & ! Links characteristics in SUEWS_NonVeg.txt - c_BldgsCode = 39, & ! Links characteristics in SUEWS_NonVeg.txt - c_EveTrCode = 40, & ! Links characteristics in SUEWS_Veg.txt - c_DecTrCode = 41, & ! Links characteristics in SUEWS_Veg.txt - c_GrassCode = 42, & ! Links characteristics in SUEWS_Veg.txt - c_BSoilCode = 43, & ! Links characteristics in SUEWS_Veg.txt - c_WaterCode = 44, & ! Links characteristics in SUEWS_Water.txt + c_PavedCode = 42, & ! Links characteristics in SUEWS_NonVeg.txt + c_BldgsCode = 43, & ! Links characteristics in SUEWS_NonVeg.txt + c_EveTrCode = 44, & ! Links characteristics in SUEWS_Veg.txt + c_DecTrCode = 45, & ! Links characteristics in SUEWS_Veg.txt + c_GrassCode = 46, & ! Links characteristics in SUEWS_Veg.txt + c_BSoilCode = 47, & ! Links characteristics in SUEWS_Veg.txt + c_WaterCode = 48, & ! Links characteristics in SUEWS_Water.txt ! LUMPS info - c_LUMPSDr = 45, & - c_LUMPSCover = 46, & - c_LUMPSMaxRes = 47, & + c_LUMPSDr = 49, & + c_LUMPSCover = 50, & + c_LUMPSMaxRes = 51, & ! NARP info - c_NARPTrans = 48, & + c_NARPTrans = 52, & ! Code for conductances - c_CondCode = 49, & ! Links characteristics in SUEWS_Conductance.txt + c_CondCode = 53, & ! Links characteristics in SUEWS_Conductance.txt ! Code for snow - c_SnowCode = 50, & ! Links characteristics in SUEWS_Snow.txt + c_SnowCode = 54, & ! Links characteristics in SUEWS_Snow.txt ! Codes for human impacts on energy, water and snow - c_SnowProfWD = 51, & ! Snow-clearing profile in SUEWS_Profile.txt (weekdays) - c_SnowProfWE = 52, & ! Snow-clearing profile in SUEWS_Profile.txt (weekends) - c_QFCode = 53, & ! Links anthropogenic heat info in SUEWS_AnthropogenicEmission.txt - c_IrrCode = 54, & ! Links irrigation info in SUEWS_Irrigation.txt - c_WProfManuWD = 55, & ! Links to water-use profile in SUEWS_Profile.txt (manual irrigation, weekdays) - c_WProfManuWE = 56, & ! Links to water-use profile in SUEWS_Profile.txt (manual irrigation, weekends) - c_WProfAutoWD = 57, & ! Links to water-use profile in SUEWS_Profile.txt (automatic irrigation, weekdays) - c_WProfAutoWE = 58, & ! Links to water-use profile in SUEWS_Profile.txt (automatic irrigation, weekends) + c_SnowProfWD = 55, & ! Snow-clearing profile in SUEWS_Profile.txt (weekdays) + c_SnowProfWE = 56, & ! Snow-clearing profile in SUEWS_Profile.txt (weekends) + c_QFCode = 57, & ! Links anthropogenic heat info in SUEWS_AnthropogenicEmission.txt + c_IrrCode = 58, & ! Links irrigation info in SUEWS_Irrigation.txt + c_WProfManuWD = 59, & ! Links to water-use profile in SUEWS_Profile.txt (manual irrigation, weekdays) + c_WProfManuWE = 60, & ! Links to water-use profile in SUEWS_Profile.txt (manual irrigation, weekends) + c_WProfAutoWD = 61, & ! Links to water-use profile in SUEWS_Profile.txt (automatic irrigation, weekdays) + c_WProfAutoWE = 62, & ! Links to water-use profile in SUEWS_Profile.txt (automatic irrigation, weekends) ! Flow information - c_FlowChange = 59, & ! Difference in input & output flows for water surface - c_RunoffToWater = 60, & ! Fraction of above-ground runoff flowing to water surface - c_PipeCapacity = 61, & ! Pipe capacity [mm] + c_FlowChange = 63, & ! Difference in input & output flows for water surface + c_RunoffToWater = 64, & ! Fraction of above-ground runoff flowing to water surface + c_PipeCapacity = 65, & ! Pipe capacity [mm] ! Runoff (to 8 adjacent grids) - c_GridConnection1of8 = 62, & - c_Fraction1of8 = 63, & - c_GridConnection2of8 = 64, & - c_Fraction2of8 = 65, & - c_GridConnection3of8 = 66, & - c_Fraction3of8 = 67, & - c_GridConnection4of8 = 68, & - c_Fraction4of8 = 69, & - c_GridConnection5of8 = 70, & - c_Fraction5of8 = 71, & - c_GridConnection6of8 = 72, & - c_Fraction6of8 = 73, & - c_GridConnection7of8 = 74, & - c_Fraction7of8 = 75, & - c_GridConnection8of8 = 76, & - c_Fraction8of8 = 77, & + c_GridConnection1of8 = 66, & + c_Fraction1of8 = 67, & + c_GridConnection2of8 = 68, & + c_Fraction2of8 = 69, & + c_GridConnection3of8 = 70, & + c_Fraction3of8 = 71, & + c_GridConnection4of8 = 72, & + c_Fraction4of8 = 73, & + c_GridConnection5of8 = 74, & + c_Fraction5of8 = 75, & + c_GridConnection6of8 = 76, & + c_Fraction6of8 = 77, & + c_GridConnection7of8 = 78, & + c_Fraction7of8 = 79, & + c_GridConnection8of8 = 80, & + c_Fraction8of8 = 81, & ! Runoff within grid (for each surface type) - c_WGPavedCode = 78, & ! Links to SUEWS_WaterDistibuteWithinGrid.txt - c_WGBldgsCode = 79, & ! Links to SUEWS_WaterDistibuteWithinGrid.txt - c_WGEveTrCode = 80, & ! Links to SUEWS_WaterDistibuteWithinGrid.txt - c_WGDecTrCode = 81, & ! Links to SUEWS_WaterDistibuteWithinGrid.txt - c_WGGrassCode = 82, & ! Links to SUEWS_WaterDistibuteWithinGrid.txt - c_WGBSoilCode = 83, & ! Links to SUEWS_WaterDistibuteWithinGrid.txt - c_WGWaterCode = 84, & ! Links to SUEWS_WaterDistibuteWithinGrid.txt + c_WGPavedCode = 82, & ! Links to SUEWS_WaterDistibuteWithinGrid.txt + c_WGBldgsCode = 83, & ! Links to SUEWS_WaterDistibuteWithinGrid.txt + c_WGEveTrCode = 84, & ! Links to SUEWS_WaterDistibuteWithinGrid.txt + c_WGDecTrCode = 85, & ! Links to SUEWS_WaterDistibuteWithinGrid.txt + c_WGGrassCode = 86, & ! Links to SUEWS_WaterDistibuteWithinGrid.txt + c_WGBSoilCode = 87, & ! Links to SUEWS_WaterDistibuteWithinGrid.txt + c_WGWaterCode = 88, & ! Links to SUEWS_WaterDistibuteWithinGrid.txt ! Additional info for ESTM - c_AreaWall = 85 ! Wall surface fraction (Awall/Agridcell) + c_AreaWall = 89 ! Wall surface fraction (Awall/Agridcell) - INTEGER, DIMENSION(3):: c_Fr_ESTMClass_Paved = (/(ccc, ccc=86, 88, 1)/) ! Fraction of Paved surface with ESTM Class 1-5 - INTEGER, DIMENSION(3):: c_Code_ESTMClass_Paved = (/(ccc, ccc=89, 91, 1)/) ! Code for Paved surface ESTM Class 1-5 - INTEGER, DIMENSION(5):: c_Fr_ESTMClass_Bldgs = (/(ccc, ccc=92, 96, 1)/) ! Fraction of Bldgs surface with ESTM Class 1-5 - INTEGER, DIMENSION(5):: c_Code_ESTMClass_Bldgs = (/(ccc, ccc=97, 101, 1)/) ! Code for Bldgs surface ESTM Class 1-5 + INTEGER, DIMENSION(3)::c_Fr_ESTMClass_Paved = (/(ccc, ccc=90, 92, 1)/) ! Fraction of Paved surface with ESTM Class 1-3 + INTEGER, DIMENSION(3)::c_Code_ESTMClass_Paved = (/(ccc, ccc=93, 95, 1)/) ! Code for Paved surface ESTM Class 1-3 + INTEGER, DIMENSION(5)::c_Fr_ESTMClass_Bldgs = (/(ccc, ccc=96, 100, 1)/) ! Fraction of Bldgs surface with ESTM Class 1-5 + INTEGER, DIMENSION(5)::c_Code_ESTMClass_Bldgs = (/(ccc, ccc=101, 105, 1)/) ! Code for Bldgs surface ESTM Class 1-5 !========== Columns for SUEWS_NonVeg.txt ========================== INTEGER :: ci_Code = 1, & @@ -1948,7 +1959,7 @@ MODULE ColNamesInputFiles !========== Columns for SUEWS_AnthropogenicEmission.txt =================== INTEGER :: cA_Code = 1, & - cA_BaseTHDD = 2, & + cA_BaseT_HC = 2, & cA_QF_A1 = 3, & !Weekday cA_QF_B1 = 4, & !Weekday cA_QF_C1 = 5, & !Weekday @@ -1994,27 +2005,27 @@ MODULE ColNamesInputFiles cIr_IeEnd = 3, & cIr_IntWU = 4, & cIr_Faut = 5, & - cIr_Ie_a1 = 6, & - cIr_Ie_a2 = 7, & - cIr_Ie_a3 = 8, & - cIr_Ie_m1 = 9, & - cIr_Ie_m2 = 10, & - cIr_Ie_m3 = 11, & - cIr_DayWat1 = 12, & - cIr_DayWat2 = 13, & - cIr_DayWat3 = 14, & - cIr_DayWat4 = 15, & - cIr_DayWat5 = 16, & - cIr_DayWat6 = 17, & - cIr_DayWat7 = 18, & - cIr_DayWatPer1 = 19, & - cIr_DayWatPer2 = 20, & - cIr_DayWatPer3 = 21, & - cIr_DayWatPer4 = 22, & - cIr_DayWatPer5 = 23, & - cIr_DayWatPer6 = 24, & - cIr_DayWatPer7 = 25 - + cIr_H_ponding = 6, & + cIr_Ie_a1 = 7, & + cIr_Ie_a2 = 8, & + cIr_Ie_a3 = 9, & + cIr_Ie_m1 = 10, & + cIr_Ie_m2 = 11, & + cIr_Ie_m3 = 12, & + cIr_DayWat1 = 13, & + cIr_DayWat2 = 14, & + cIr_DayWat3 = 15, & + cIr_DayWat4 = 16, & + cIr_DayWat5 = 17, & + cIr_DayWat6 = 18, & + cIr_DayWat7 = 19, & + cIr_DayWatPer1 = 20, & + cIr_DayWatPer2 = 21, & + cIr_DayWatPer3 = 22, & + cIr_DayWatPer4 = 23, & + cIr_DayWatPer5 = 24, & + cIr_DayWatPer6 = 25, & + cIr_DayWatPer7 = 26 !========== Columns for SUEWS_Profile.txt ============================= INTEGER:: cc !Column counter diff --git a/SUEWS-SourceCode/suews_ctrl_driver.f95 b/SUEWS-SourceCode/suews_ctrl_driver.f95 index d5ba8ccad..8265b35e4 100644 --- a/SUEWS-SourceCode/suews_ctrl_driver.f95 +++ b/SUEWS-SourceCode/suews_ctrl_driver.f95 @@ -1,9 +1,12 @@ !======================================================================================== ! SUEWS driver subroutines ! TS 31 Aug 2017: initial version -! TS 02 Oct 2017: added `SUEWS_cal_Main` as the generic wrapper -! TS 03 Oct 2017: added `SUEWS_cal_AnthropogenicEmission` +! TS 02 Oct 2017: added as the generic wrapper +! TS 03 Oct 2017: added MODULE SUEWS_Driver + ! only the following immutable objects are imported: + ! 1. functions/subroutines + ! 2. constant variables USE meteo, ONLY: qsatf, RH2qa, qa2RH USE AtmMoistStab_module, ONLY: cal_AtmMoist, cal_Stab, stab_psi_heat, stab_psi_mom USE NARP_MODULE, ONLY: NARP_cal_SunPosition @@ -45,16 +48,21 @@ SUBROUTINE SUEWS_cal_Main( & alb, AlbMax_DecTr, AlbMax_EveTr, AlbMax_Grass, & AlbMin_DecTr, AlbMin_EveTr, AlbMin_Grass, & alpha_bioCO2, alpha_enh_bioCO2, alt, avkdn, avRh, avU1, BaseT, BaseTe, & - BaseTHDD, beta_bioCO2, beta_enh_bioCO2, bldgH, CapMax_dec, CapMin_dec, & + BaseTMethod, & + BaseT_HC, beta_bioCO2, beta_enh_bioCO2, bldgH, CapMax_dec, CapMin_dec, & chAnOHM, CO2PointSource, cpAnOHM, CRWmax, CRWmin, DayWat, DayWatPer, & DecTreeH, Diagnose, DiagQN, DiagQS, DRAINRT, & dt_since_start, dqndt, qn1_av, dqnsdt, qn1_s_av, & EF_umolCO2perJ, emis, EmissionsMethod, EnEF_v_Jkm, endDLS, EveTreeH, FAIBldg, & FAIDecTree, FAIEveTree, Faut, FcEF_v_kgkm, fcld_obs, FlowChange, & FrFossilFuel_Heat, FrFossilFuel_NonHeat, G1, G2, G3, G4, G5, G6, GDD_id, & - GDDFull, Gridiv, gsModel, HDD_id, HumActivity_24hr, & + GDDFull, Gridiv, gsModel, H_maintain, HDD_id, HumActivity_24hr, & IceFrac, id, Ie_a, Ie_end, Ie_m, Ie_start, imin, & - InternalWaterUse_h, IrrFracConif, IrrFracDecid, IrrFracGrass, isec, it, EvapMethod, & + InternalWaterUse_h, & + IrrFracPaved, IrrFracBldgs, & + IrrFracEveTr, IrrFracDecTr, IrrFracGrass, & + IrrFracBSoil, IrrFracWater, & + isec, it, EvapMethod, & iy, kkAnOHM, Kmax, LAI_id, LAICalcYes, LAIMax, LAIMin, LAI_obs, & LAIPower, LAIType, lat, lenDay_id, ldown_obs, lng, MaxConductance, MaxFCMetab, MaxQFMetab, & SnowWater, MetForcingData_grid, MinFCMetab, MinQFMetab, min_res_bioCO2, & @@ -73,7 +81,7 @@ SUBROUTINE SUEWS_cal_Main( & soilstore_id, SoilStoreCap, StabilityMethod, startDLS, state_id, StateLimit, & StorageHeatMethod, StoreDrainPrm, SurfaceArea, Tair_av, tau_a, tau_f, tau_r, & Tmax_id, Tmin_id, & - T_CRITIC_Cooling, T_CRITIC_Heating, Temp_C, TempMeltFact, TH, & + BaseT_Cooling, BaseT_Heating, Temp_C, TempMeltFact, TH, & theta_bioCO2, timezone, TL, TrafficRate, TrafficUnits, & TraffProf_24hr, Ts5mindata_ir, tstep, tstep_prev, veg_type, & WaterDist, WaterUseMethod, WetThresh, wu_m3, & @@ -87,6 +95,7 @@ SUBROUTINE SUEWS_cal_Main( & ! ######################################################################################## ! input variables INTEGER, INTENT(IN)::AerodynamicResistanceMethod + INTEGER, INTENT(IN)::BaseTMethod INTEGER, INTENT(IN)::Diagnose INTEGER, INTENT(IN)::DiagQN INTEGER, INTENT(IN)::DiagQS @@ -128,7 +137,7 @@ SUBROUTINE SUEWS_cal_Main( & REAL(KIND(1D0)), INTENT(IN)::avkdn REAL(KIND(1D0)), INTENT(IN)::avRh REAL(KIND(1D0)), INTENT(IN)::avU1 - REAL(KIND(1D0)), INTENT(IN)::BaseTHDD + REAL(KIND(1D0)), INTENT(IN)::BaseT_HC REAL(KIND(1D0)), INTENT(IN)::bldgH REAL(KIND(1D0)), INTENT(IN)::CapMax_dec REAL(KIND(1D0)), INTENT(IN)::CapMin_dec @@ -154,10 +163,15 @@ SUBROUTINE SUEWS_cal_Main( & REAL(KIND(1D0)), INTENT(IN)::G4 REAL(KIND(1D0)), INTENT(IN)::G5 REAL(KIND(1D0)), INTENT(IN)::G6 + REAL(KIND(1D0)), INTENT(IN)::H_maintain REAL(KIND(1D0)), INTENT(IN)::InternalWaterUse_h - REAL(KIND(1D0)), INTENT(IN)::IrrFracConif - REAL(KIND(1D0)), INTENT(IN)::IrrFracDecid + REAL(KIND(1D0)), INTENT(IN)::IrrFracPaved + REAL(KIND(1D0)), INTENT(IN)::IrrFracBldgs + REAL(KIND(1D0)), INTENT(IN)::IrrFracEveTr + REAL(KIND(1D0)), INTENT(IN)::IrrFracDecTr REAL(KIND(1D0)), INTENT(IN)::IrrFracGrass + REAL(KIND(1D0)), INTENT(IN)::IrrFracBSoil + REAL(KIND(1D0)), INTENT(IN)::IrrFracWater REAL(KIND(1D0)), INTENT(IN)::Kmax REAL(KIND(1D0)), INTENT(IN)::LAI_obs REAL(KIND(1D0)), INTENT(IN)::lat @@ -220,8 +234,8 @@ SUBROUTINE SUEWS_cal_Main( & REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) ::Qf_B REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) ::Qf_C REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) ::PopDensDaytime - REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) ::T_CRITIC_Cooling - REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) ::T_CRITIC_Heating + REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) ::BaseT_Cooling + REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) ::BaseT_Heating REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) ::TrafficRate REAL(KIND(1D0)), DIMENSION(3), INTENT(IN) ::Ie_a REAL(KIND(1D0)), DIMENSION(3), INTENT(IN) ::Ie_m @@ -462,14 +476,14 @@ SUBROUTINE SUEWS_cal_Main( & REAL(KIND(1D0)), DIMENSION(NSURF)::tsurf_ind ! TODO: TS 25 Oct 2017 - ! the `add-*` variables are not used currently as grid-to-grid connection is NOT set up. + ! the variables are not used currently as grid-to-grid connection is NOT set up. ! set these variables as zero. REAL(KIND(1D0))::addImpervious = 0 REAL(KIND(1D0))::addPipes = 0 REAL(KIND(1D0))::addVeg = 0 REAL(KIND(1D0))::addWaterBody = 0 REAL(KIND(1D0)), DIMENSION(NSURF)::AddWater = 0 - REAL(KIND(1D0)), DIMENSION(NSURF)::AddWaterRunoff = 0 + REAL(KIND(1D0)), DIMENSION(NSURF)::frac_water2runoff = 0 ! values that are derived from tstep INTEGER::nsh ! number of timesteps per hour @@ -490,7 +504,7 @@ SUBROUTINE SUEWS_cal_Main( & ! ######################################################################################## ! TS 19 Sep 2019 ! temporary variables to save values for inout varialbes - ! suffixes `prev` and `next` denote values from last and to next tsteps, respectively + ! suffixes and denote values from last and to next tsteps, respectively ! these variables are introduced to allow safe and robust iterations inccurred in this subroutine ! so that these values won't updated in unexpectedly many times @@ -585,7 +599,7 @@ SUBROUTINE SUEWS_cal_Main( & HDD_id_prev = HDD_id WUDay_id_prev = WUDay_id - ! initialise `_next` variables + ! initialise variables qn1_av_next = qn1_av dqndt_next = dqndt qn1_s_av_next = qn1_s_av @@ -681,9 +695,11 @@ SUBROUTINE SUEWS_cal_Main( & CALL SUEWS_cal_DailyState( & iy, id, it, imin, isec, tstep, tstep_prev, dt_since_start, DayofWeek_id, &!input Tmin_id_prev, Tmax_id_prev, lenDay_id_prev, & + BaseTMethod, & WaterUseMethod, Ie_start, Ie_end, & LAICalcYes, LAIType, & - nsh_real, avkdn, Temp_C, Precip, BaseTHDD, & + nsh_real, avkdn, Temp_C, Precip, BaseT_HC, & + BaseT_Heating, BaseT_Cooling, & lat, Faut, LAI_obs, & AlbMax_DecTr, AlbMax_EveTr, AlbMax_Grass, & AlbMin_DecTr, AlbMin_EveTr, AlbMin_Grass, & @@ -693,6 +709,7 @@ SUBROUTINE SUEWS_cal_Main( & DecidCap_id_prev, StoreDrainPrm_prev, LAI_id_prev, GDD_id_prev, SDD_id_prev, & albDecTr_id_prev, albEveTr_id_prev, albGrass_id_prev, porosity_id_prev, &!input HDD_id_prev, &!input + state_id_prev, soilstore_id_prev, SoilStoreCap, H_maintain, &!input HDD_id_next, &!output Tmin_id_next, Tmax_id_next, lenDay_id_next, & albDecTr_id_next, albEveTr_id_next, albGrass_id_next, porosity_id_next, &!output @@ -718,7 +735,9 @@ SUBROUTINE SUEWS_cal_Main( & CALL SUEWS_cal_WaterUse( & nsh_real, & ! input: wu_m3, SurfaceArea, sfr, & - IrrFracConif, IrrFracDecid, IrrFracGrass, & + IrrFracPaved, IrrFracBldgs, & + IrrFracEveTr, IrrFracDecTr, IrrFracGrass, & + IrrFracBSoil, IrrFracWater, & DayofWeek_id, WUProfA_24hr, WUProfM_24hr, & InternalWaterUse_h, HDD_id_next, WUDay_id_next, & WaterUseMethod, NSH, it, imin, DLS, & @@ -731,7 +750,7 @@ SUBROUTINE SUEWS_cal_Main( & FcEF_v_kgkm, FrFossilFuel_Heat, FrFossilFuel_NonHeat, HDD_id_next, HumActivity_24hr, & id, imin, it, MaxFCMetab, MaxQFMetab, MinFCMetab, MinQFMetab, nsh, & PopDensDaytime, PopDensNighttime, PopProf_24hr, QF, QF0_BEU, Qf_A, Qf_B, Qf_C, & - QF_obs, QF_SAHP, SurfaceArea, T_CRITIC_Cooling, T_CRITIC_Heating, & + QF_obs, QF_SAHP, SurfaceArea, BaseT_Cooling, BaseT_Heating, & Temp_C, TrafficRate, TrafficUnits, TraffProf_24hr, & Fc_anthro, Fc_build, Fc_metab, Fc_point, Fc_traff)! output: @@ -810,7 +829,7 @@ SUBROUTINE SUEWS_cal_Main( & snowUse, NonWaterFraction, addPipes, addImpervious, addVeg, addWaterBody, & state_id_prev, soilstore_id_prev, sfr, StoreDrainPrm_next, WaterDist, nsh_real, & drain_per_tstep, & !output - drain, AddWaterRunoff, & + drain, frac_water2runoff, & AdditionalWater, runoffPipes, runoff_per_interval, & AddWater, stateOld, soilstoreOld) !============= calculate water balance end ============= @@ -841,7 +860,7 @@ SUBROUTINE SUEWS_cal_Main( & NonWaterFraction, wu_nsurf, addVeg, addWaterBody, SnowLimPaved, SnowLimBldg, & SurfaceArea, FlowChange, drain, WetThresh, stateOld, mw_ind, SoilStoreCap, rainonsnow, & freezmelt, freezstate, freezstatevol, Qm_Melt, Qm_rain, Tsurf_ind, sfr, & - StateLimit, AddWater, addwaterrunoff, StoreDrainPrm_next, SnowPackLimit, SnowProf_24hr, & + StateLimit, AddWater, frac_water2runoff, StoreDrainPrm_next, SnowPackLimit, SnowProf_24hr, & SnowPack_next, SnowFrac_next, SnowWater_prev, IceFrac_prev, SnowDens_next, &! input: runoff_per_interval, state_id_prev, soilstore_id_prev, &! input: state_id_next, soilstore_id_next, &! output: @@ -1060,7 +1079,7 @@ SUBROUTINE SUEWS_cal_AnthropogenicEmission( & FcEF_v_kgkm, FrFossilFuel_Heat, FrFossilFuel_NonHeat, HDD_id, HumActivity_24hr, & id, imin, it, MaxFCMetab, MaxQFMetab, MinFCMetab, MinQFMetab, nsh, & PopDensDaytime, PopDensNighttime, PopProf_24hr, QF, QF0_BEU, Qf_A, Qf_B, Qf_C, & - QF_obs, QF_SAHP, SurfaceArea, T_CRITIC_Cooling, T_CRITIC_Heating, & + QF_obs, QF_SAHP, SurfaceArea, BaseT_Cooling, BaseT_Heating, & Temp_C, TrafficRate, TrafficUnits, TraffProf_24hr, & Fc_anthro, Fc_build, Fc_metab, Fc_point, Fc_traff)! output: @@ -1087,8 +1106,8 @@ SUBROUTINE SUEWS_cal_AnthropogenicEmission( & REAL(KIND(1d0)), DIMENSION(2), INTENT(in)::Qf_A REAL(KIND(1d0)), DIMENSION(2), INTENT(in)::Qf_B REAL(KIND(1d0)), DIMENSION(2), INTENT(in)::Qf_C - REAL(KIND(1d0)), DIMENSION(2), INTENT(in)::T_CRITIC_Heating - REAL(KIND(1d0)), DIMENSION(2), INTENT(in)::T_CRITIC_Cooling + REAL(KIND(1d0)), DIMENSION(2), INTENT(in)::BaseT_Heating + REAL(KIND(1d0)), DIMENSION(2), INTENT(in)::BaseT_Cooling REAL(KIND(1d0)), DIMENSION(2), INTENT(in)::TrafficRate REAL(KIND(1d0)), DIMENSION(0:23, 2), INTENT(in)::AHProf_24hr @@ -1130,14 +1149,14 @@ SUBROUTINE SUEWS_cal_AnthropogenicEmission( & ELSEIF ((EmissionsMethod > 0 .AND. EmissionsMethod <= 6) .OR. EmissionsMethod >= 11) THEN CALL AnthropogenicEmissions( & CO2PointSource, EmissionsMethod, & - id, it, imin, DLS, nsh, DayofWeek_id, & + it, imin, DLS, DayofWeek_id, & EF_umolCO2perJ, FcEF_v_kgkm, EnEF_v_Jkm, TrafficUnits, & FrFossilFuel_Heat, FrFossilFuel_NonHeat, & MinFCMetab, MaxFCMetab, MinQFMetab, MaxQFMetab, & PopDensDaytime, PopDensNighttime, & Temp_C, HDD_id, Qf_A, Qf_B, Qf_C, & AH_MIN, AH_SLOPE_Heating, AH_SLOPE_Cooling, & - T_CRITIC_Heating, T_CRITIC_Cooling, & + BaseT_Heating, BaseT_Cooling, & TrafficRate, & QF0_BEU, QF_SAHP, & Fc_anthro, Fc_metab, Fc_traff, Fc_build, Fc_point, & @@ -1618,13 +1637,13 @@ SUBROUTINE SUEWS_cal_Qs( & END SUBROUTINE SUEWS_cal_Qs !======================================================================= - !==========================water balance================================ + !==========================drainage and runoff================================ SUBROUTINE SUEWS_cal_Water( & Diagnose, &!input snowUse, NonWaterFraction, addPipes, addImpervious, addVeg, addWaterBody, & state_id, soilstore_id, sfr, StoreDrainPrm, WaterDist, nsh_real, & drain_per_tstep, & !output - drain, AddWaterRunoff, & + drain, frac_water2runoff, & AdditionalWater, runoffPipes, runoff_per_interval, & AddWater, stateOld, soilstoreOld) @@ -1648,7 +1667,7 @@ SUBROUTINE SUEWS_cal_Water( & REAL(KIND(1d0)), DIMENSION(nsurf + 1, nsurf - 1), INTENT(in)::WaterDist REAL(KIND(1d0)), DIMENSION(nsurf), INTENT(out):: drain !Drainage of surface type "is" [mm] - REAL(KIND(1d0)), DIMENSION(nsurf), INTENT(out):: AddWaterRunoff!Fraction of water going to runoff/sub-surface soil (WGWaterDist) [-] + REAL(KIND(1d0)), DIMENSION(nsurf), INTENT(out):: frac_water2runoff!Fraction of water going to runoff/sub-surface soil (WGWaterDist) [-] REAL(KIND(1d0)), DIMENSION(nsurf), INTENT(out):: AddWater !water from other surfaces (WGWaterDist in SUEWS_ReDistributeWater.f95) [mm] REAL(KIND(1d0)), DIMENSION(nsurf), INTENT(out):: stateOld REAL(KIND(1d0)), DIMENSION(nsurf), INTENT(out):: soilstoreOld @@ -1710,7 +1729,7 @@ SUBROUTINE SUEWS_cal_Water( & !Calculates AddWater(is) CALL ReDistributeWater( & snowUse, WaterDist, sfr, Drain, &! input: - AddWaterRunoff, AddWater)! output + frac_water2runoff, AddWater)! output END SUBROUTINE SUEWS_cal_Water !======================================================================= @@ -2781,7 +2800,7 @@ FUNCTION square_real(x) RESULT(xx) END FUNCTION square_real SUBROUTINE output_name_n(i, name, group, aggreg, outlevel) - ! used by f2py module `SuPy` to handle output names + ! used by f2py module to handle output names IMPLICIT NONE ! the dimension is potentially incorrect, ! which should be consistent with that in output module @@ -2806,7 +2825,7 @@ SUBROUTINE output_name_n(i, name, group, aggreg, outlevel) END SUBROUTINE output_name_n SUBROUTINE output_size(nVar) - ! used by f2py module `SuPy` to get size of the output list + ! used by f2py module to get size of the output list IMPLICIT NONE ! the dimension is potentially incorrect, ! which should be consistent with that in output module @@ -2823,16 +2842,21 @@ SUBROUTINE SUEWS_cal_multitsteps( & alb, AlbMax_DecTr, AlbMax_EveTr, AlbMax_Grass, & AlbMin_DecTr, AlbMin_EveTr, AlbMin_Grass, & alpha_bioCO2, alpha_enh_bioCO2, alt, BaseT, BaseTe, & - BaseTHDD, beta_bioCO2, beta_enh_bioCO2, bldgH, CapMax_dec, CapMin_dec, & + BaseTMethod, & + BaseT_HC, beta_bioCO2, beta_enh_bioCO2, bldgH, CapMax_dec, CapMin_dec, & chAnOHM, CO2PointSource, cpAnOHM, CRWmax, CRWmin, DayWat, DayWatPer, & DecTreeH, Diagnose, DiagQN, DiagQS, DRAINRT, & dt_since_start, dqndt, qn1_av, dqnsdt, qn1_s_av, & EF_umolCO2perJ, emis, EmissionsMethod, EnEF_v_Jkm, endDLS, EveTreeH, FAIBldg, & FAIDecTree, FAIEveTree, Faut, FcEF_v_kgkm, FlowChange, & FrFossilFuel_Heat, FrFossilFuel_NonHeat, G1, G2, G3, G4, G5, G6, GDD_id, & - GDDFull, Gridiv, gsModel, HDD_id, HumActivity_24hr, & + GDDFull, Gridiv, gsModel, H_maintain, HDD_id, HumActivity_24hr, & IceFrac, Ie_a, Ie_end, Ie_m, Ie_start, & - InternalWaterUse_h, IrrFracConif, IrrFracDecid, IrrFracGrass, EvapMethod, & + InternalWaterUse_h, & + IrrFracPaved, IrrFracBldgs, & + IrrFracEveTr, IrrFracDecTr, IrrFracGrass, & + IrrFracBSoil, IrrFracWater, & + EvapMethod, & kkAnOHM, Kmax, LAI_id, LAICalcYes, LAIMax, LAIMin, & LAIPower, LAIType, lat, lng, MaxConductance, MaxFCMetab, MaxQFMetab, & SnowWater, MinFCMetab, MinQFMetab, min_res_bioCO2, & @@ -2849,7 +2873,7 @@ SUBROUTINE SUEWS_cal_multitsteps( & SnowLimBldg, SnowLimPaved, SnowPack, SnowProf_24hr, snowUse, SoilDepth, & soilstore_id, SoilStoreCap, StabilityMethod, startDLS, state_id, StateLimit, & StorageHeatMethod, StoreDrainPrm, SurfaceArea, Tair_av, tau_a, tau_f, tau_r, & - T_CRITIC_Cooling, T_CRITIC_Heating, TempMeltFact, TH, & + BaseT_Cooling, BaseT_Heating, TempMeltFact, TH, & theta_bioCO2, timezone, TL, TrafficRate, TrafficUnits, & Tmin_id, Tmax_id, lenday_id, & TraffProf_24hr, Ts5mindata_ir, tstep, tstep_prev, veg_type, & @@ -2866,6 +2890,7 @@ SUBROUTINE SUEWS_cal_multitsteps( & INTEGER, INTENT(IN) :: len_sim ! input variables INTEGER, INTENT(IN)::AerodynamicResistanceMethod + INTEGER, INTENT(IN)::BaseTMethod INTEGER, INTENT(IN)::Diagnose INTEGER, INTENT(IN)::DiagQN INTEGER, INTENT(IN)::DiagQS @@ -2905,7 +2930,7 @@ SUBROUTINE SUEWS_cal_multitsteps( & ! REAL(KIND(1D0)),INTENT(IN)::avkdn ! REAL(KIND(1D0)),INTENT(IN)::avRh ! REAL(KIND(1D0)),INTENT(IN)::avU1 - REAL(KIND(1D0)), INTENT(IN)::BaseTHDD + REAL(KIND(1D0)), INTENT(IN)::BaseT_HC REAL(KIND(1D0)), INTENT(IN)::bldgH REAL(KIND(1D0)), INTENT(IN)::CapMax_dec REAL(KIND(1D0)), INTENT(IN)::CapMin_dec @@ -2931,10 +2956,15 @@ SUBROUTINE SUEWS_cal_multitsteps( & REAL(KIND(1D0)), INTENT(IN)::G4 REAL(KIND(1D0)), INTENT(IN)::G5 REAL(KIND(1D0)), INTENT(IN)::G6 + REAL(KIND(1D0)), INTENT(IN)::H_maintain REAL(KIND(1D0)), INTENT(IN)::InternalWaterUse_h - REAL(KIND(1D0)), INTENT(IN)::IrrFracConif - REAL(KIND(1D0)), INTENT(IN)::IrrFracDecid + REAL(KIND(1D0)), INTENT(IN)::IrrFracPaved + REAL(KIND(1D0)), INTENT(IN)::IrrFracBldgs + REAL(KIND(1D0)), INTENT(IN)::IrrFracEveTr + REAL(KIND(1D0)), INTENT(IN)::IrrFracDecTr REAL(KIND(1D0)), INTENT(IN)::IrrFracGrass + REAL(KIND(1D0)), INTENT(IN)::IrrFracBSoil + REAL(KIND(1D0)), INTENT(IN)::IrrFracWater REAL(KIND(1D0)), INTENT(IN)::Kmax ! REAL(KIND(1D0)),INTENT(IN)::LAI_obs REAL(KIND(1D0)), INTENT(IN)::lat @@ -2996,8 +3026,8 @@ SUBROUTINE SUEWS_cal_multitsteps( & REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) ::Qf_C ! REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) ::Numcapita REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) ::PopDensDaytime - REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) ::T_CRITIC_Cooling - REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) ::T_CRITIC_Heating + REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) ::BaseT_Cooling + REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) ::BaseT_Heating REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) ::TrafficRate REAL(KIND(1D0)), DIMENSION(3), INTENT(IN) ::Ie_a REAL(KIND(1D0)), DIMENSION(3), INTENT(IN) ::Ie_m @@ -3230,7 +3260,7 @@ SUBROUTINE SUEWS_cal_multitsteps( & ! write (12, *) 'avu1=', avu1 ! write (12, *) 'baset=', baset ! write (12, *) 'basete=', basete - ! write (12, *) 'basethdd=', basethdd + ! write (12, *) 'BaseT_HC=', BaseT_HC ! write (12, *) 'beta_bioco2=', beta_bioco2 ! write (12, *) 'beta_enh_bioco2=', beta_enh_bioco2 ! write (12, *) 'bldgh=', bldgh @@ -3288,8 +3318,8 @@ SUBROUTINE SUEWS_cal_multitsteps( & ! write (12, *) 'ie_start=', ie_start ! write (12, *) 'imin=', imin ! write (12, *) 'internalwateruse_h=', internalwateruse_h - ! write (12, *) 'irrfracconif=', irrfracconif - ! write (12, *) 'irrfracdecid=', irrfracdecid + ! write (12, *) 'IrrFracEveTr=', IrrFracEveTr + ! write (12, *) 'IrrFracDecTr=', IrrFracDecTr ! write (12, *) 'irrfracgrass=', irrfracgrass ! write (12, *) 'isec=', isec ! write (12, *) 'it=', it @@ -3387,8 +3417,8 @@ SUBROUTINE SUEWS_cal_multitsteps( & ! write (12, *) 'tau_r=', tau_r ! write (12, *) 'tmax_id=', tmax_id ! write (12, *) 'tmin_id=', tmin_id - ! write (12, *) 't_critic_cooling=', t_critic_cooling - ! write (12, *) 't_critic_heating=', t_critic_heating + ! write (12, *) 'BaseT_Cooling=', BaseT_Cooling + ! write (12, *) 'BaseT_Heating=', BaseT_Heating ! write (12, *) 'temp_c=', temp_c ! write (12, *) 'tempmeltfact=', tempmeltfact ! write (12, *) 'th=', th @@ -3431,16 +3461,21 @@ SUBROUTINE SUEWS_cal_multitsteps( & alb, AlbMax_DecTr, AlbMax_EveTr, AlbMax_Grass, & AlbMin_DecTr, AlbMin_EveTr, AlbMin_Grass, & alpha_bioCO2, alpha_enh_bioCO2, alt, avkdn, avRh, avU1, BaseT, BaseTe, & - BaseTHDD, beta_bioCO2, beta_enh_bioCO2, bldgH, CapMax_dec, CapMin_dec, & + BaseTMethod, & + BaseT_HC, beta_bioCO2, beta_enh_bioCO2, bldgH, CapMax_dec, CapMin_dec, & chAnOHM, CO2PointSource, cpAnOHM, CRWmax, CRWmin, DayWat, DayWatPer, & DecTreeH, Diagnose, DiagQN, DiagQS, DRAINRT, & dt_since_start, dqndt, qn1_av, dqnsdt, qn1_s_av, & EF_umolCO2perJ, emis, EmissionsMethod, EnEF_v_Jkm, endDLS, EveTreeH, FAIBldg, & FAIDecTree, FAIEveTree, Faut, FcEF_v_kgkm, fcld_obs, FlowChange, & FrFossilFuel_Heat, FrFossilFuel_NonHeat, G1, G2, G3, G4, G5, G6, GDD_id, & - GDDFull, Gridiv, gsModel, HDD_id, HumActivity_24hr, & + GDDFull, Gridiv, gsModel, H_maintain, HDD_id, HumActivity_24hr, & IceFrac, id, Ie_a, Ie_end, Ie_m, Ie_start, imin, & - InternalWaterUse_h, IrrFracConif, IrrFracDecid, IrrFracGrass, isec, it, EvapMethod, & + InternalWaterUse_h, & + IrrFracPaved, IrrFracBldgs, & + IrrFracEveTr, IrrFracDecTr, IrrFracGrass, & + IrrFracBSoil, IrrFracWater, & + isec, it, EvapMethod, & iy, kkAnOHM, Kmax, LAI_id, LAICalcYes, LAIMax, LAIMin, LAI_obs, & LAIPower, LAIType, lat, lenDay_id, ldown_obs, lng, MaxConductance, MaxFCMetab, MaxQFMetab, & SnowWater, MetForcingData_grid, MinFCMetab, MinQFMetab, min_res_bioCO2, & @@ -3459,7 +3494,7 @@ SUBROUTINE SUEWS_cal_multitsteps( & soilstore_id, SoilStoreCap, StabilityMethod, startDLS, state_id, StateLimit, & StorageHeatMethod, StoreDrainPrm, SurfaceArea, Tair_av, tau_a, tau_f, tau_r, & Tmax_id, Tmin_id, & - T_CRITIC_Cooling, T_CRITIC_Heating, Temp_C, TempMeltFact, TH, & + BaseT_Cooling, BaseT_Heating, Temp_C, TempMeltFact, TH, & theta_bioCO2, timezone, TL, TrafficRate, TrafficUnits, & TraffProf_24hr, Ts5mindata_ir, tstep, tstep_prev, veg_type, & WaterDist, WaterUseMethod, WetThresh, wu_m3, & diff --git a/SUEWS-SourceCode/suews_ctrl_error.f95 b/SUEWS-SourceCode/suews_ctrl_error.f95 index 216d88aef..88a33fe15 100644 --- a/SUEWS-SourceCode/suews_ctrl_error.f95 +++ b/SUEWS-SourceCode/suews_ctrl_error.f95 @@ -305,6 +305,10 @@ SUBROUTINE ErrorHint(errh, ProblemFile, VALUE, value2, valueI) text1 = 'Iteration loop stopped for too unstable conditions.' ! returnTrue=.TRUE. v2 = .TRUE. + ELSEIF (errh == 75) THEN + text1 = 'Invalid value for `BaseTMethod`!' + ! returnTrue=.TRUE. + v2 = .TRUE. ENDIF ErrhCount(errh) = ErrhCount(errh) + 1 ! Increase error count by 1 diff --git a/SUEWS-SourceCode/suews_ctrl_init.f95 b/SUEWS-SourceCode/suews_ctrl_init.f95 index 4ec4a62bb..c246ca2be 100644 --- a/SUEWS-SourceCode/suews_ctrl_init.f95 +++ b/SUEWS-SourceCode/suews_ctrl_init.f95 @@ -60,6 +60,7 @@ SUBROUTINE OverallRunControl CBLuse, & SNOWuse, & ! SOLWEIGuse, & + BaseTMethod, & EmissionsMethod, & NetRadiationMethod, & RoughLenHeatMethod, & @@ -1285,7 +1286,7 @@ SUBROUTINE InitializeSurfaceCharacteristics(Gridiv, rr) ! ---- Find code for Anthropogenic heat ---- CALL CodeMatchAnthropogenic(rr, c_QFCode) ! Transfer Anthropogenic heat characteristics to SurfaceChar - SurfaceChar(gridiv, c_BaseTHDD) = Anthropogenic_Coeff(iv5, cA_BaseTHDD) + SurfaceChar(gridiv, c_BaseT_HC) = Anthropogenic_Coeff(iv5, cA_BaseT_HC) SurfaceChar(gridiv, c_QF_A1) = Anthropogenic_Coeff(iv5, cA_QF_A1) SurfaceChar(gridiv, c_QF_B1) = Anthropogenic_Coeff(iv5, cA_QF_B1) SurfaceChar(gridiv, c_QF_C1) = Anthropogenic_Coeff(iv5, cA_QF_C1) @@ -1331,6 +1332,7 @@ SUBROUTINE InitializeSurfaceCharacteristics(Gridiv, rr) SurfaceChar(gridiv, c_IeEnd) = Irrigation_Coeff(iv5, cIr_IeEnd) SurfaceChar(gridiv, c_IntWU) = Irrigation_Coeff(iv5, cIr_IntWU) SurfaceChar(gridiv, c_Faut) = Irrigation_Coeff(iv5, cIr_Faut) + SurfaceChar(gridiv, c_h_maintain) = Irrigation_Coeff(iv5, cIr_h_ponding) SurfaceChar(gridiv, c_Ie_a) = Irrigation_Coeff(iv5, cIr_Ie_a1:cIr_Ie_a3) SurfaceChar(gridiv, c_Ie_m) = Irrigation_Coeff(iv5, cIr_Ie_m1:cIr_Ie_m3) SurfaceChar(gridiv, c_DayWat) = Irrigation_Coeff(iv5, cIr_DayWat1:cIr_DayWat7) @@ -1805,23 +1807,23 @@ SUBROUTINE InitialState(GridName, year_int, Gridiv, NumberOfGrids) ModelDailyState(Gridiv, cMDS_TempCOld3) = Temp_C0 ! -- Anthropogenic heat flux initializations -- - ! Need to get BaseTHDD from SurfaceChar, as info not transferred until SUEWS_Translate called - BaseTHDD = SurfaceChar(Gridiv, c_BaseTHDD) + ! Need to get BaseT_HC from SurfaceChar, as info not transferred until SUEWS_Translate called + BaseT_HC = SurfaceChar(Gridiv, c_BaseT_HC) IF (EmissionsMethod >= 0) THEN - !Calculations related to heating and cooling degree days (BaseT is used always) - IF ((Temp_C0 - BaseTHDD) >= 0) THEN !Cooling + !Calculations related to heating and cooling degree days (BaseT_HC is used always) + IF ((Temp_C0 - BaseT_HC) >= 0) THEN !Cooling gamma2 = 1 ELSE gamma2 = 0 ENDIF - IF ((BaseTHDD - Temp_C0) >= 0) THEN !Heating + IF ((BaseT_HC - Temp_C0) >= 0) THEN !Heating gamma1 = 1 ELSE gamma1 = 0 ENDIF - ModelDailyState(Gridiv, cMDS_HDD1) = gamma1*(BaseTHDD - Temp_C0) ! Heating - ModelDailyState(Gridiv, cMDS_HDD2) = gamma2*(Temp_C0 - BaseTHDD) ! Cooling + ModelDailyState(Gridiv, cMDS_HDD1) = gamma1*(BaseT_HC - Temp_C0) ! Heating + ModelDailyState(Gridiv, cMDS_HDD2) = gamma2*(Temp_C0 - BaseT_HC) ! Cooling ENDIF ! -- Save snow density and snow albedo info in InitialConditions to ModelDailyState array -- @@ -1967,74 +1969,15 @@ SUBROUTINE InitialState(GridName, year_int, Gridiv, NumberOfGrids) iy, id, lat, & !input dayofWeek_id) !output + state_id = [PavedState, BldgsState, EveTrState, DecTrState, GrassState, BSoilState, WaterState] + soilstore_id = [SoilStorePavedState, SoilStoreBldgsState, SoilStoreEveTrstate, SoilStoreDecTrState, & + SoilStoreGrassState, SoilStoreBSoilState, 0d0] CALL update_WaterUse( & id, WaterUseMethod, DayofWeek_id, lat, Faut, HDD_id, &!input + state_id, soilstore_id, SoilStoreCap, H_maintain, &!input Ie_a, Ie_m, Ie_start, Ie_end, DayWatPer, DayWat, & WUDay_id) !output - ! WUDay_id=0 !Initialize WUDay - ! IF (WaterUseMethod==0) THEN !Model water use - ! calc=0 - ! - ! IF (DayWat(wd)==1.0) THEN !if DayWat(wd)=1.0 (irrigation occurs on this day) - ! IF (lat>=0) THEN !Northern Hemisphere - ! IF (id>=Ie_start.AND.id<=Ie_end) calc=1 !if day between irrigation period - ! ELSE !Southern Hemisphere - ! calc=1 - ! IF (id>=Ie_end.AND.id<=Ie_start) calc=0 !if day between irrigation period - ! ENDIF - ! IF(calc==1) THEN - ! ! Model daily water use based on HDD_id(6)(days since rain) and HDD_id(3)(average temp) - ! - ! ! ---- Automatic irrigation (evergreen trees) ---- - ! WUDay_id(2) = Faut*(Ie_a(1)+Ie_a(2)*HDD_id(3)+Ie_a(3)*HDD_id(6))*sfr(ConifSurf)*IrrFracConif*DayWatPer(wd) - ! IF (WUDay_id(2)<0) WUDay_id(2)=0 !If modelled WU is negative -> 0 - ! - ! ! ---- Manual irrigation (evergreen trees) ---- - ! WUDay_id(3) = (1-Faut)*(Ie_m(1)+Ie_m(2)*HDD_id(3)+Ie_m(3)*HDD_id(6))*sfr(ConifSurf)*IrrFracConif*DayWatPer(wd) - ! IF (WUDay_id(3)<0) WUDay_id(3)=0 !If modelled WU is negative -> 0 - ! - ! ! ---- Total evergreen trees water use (automatic + manual) ---- - ! WUDay_id(1)=(WUDay_id(2)+WUDay_id(3)) - ! - ! ! ---- Automatic irrigation (deciduous trees) ---- - ! WUDay_id(5) = Faut*(Ie_a(1)+Ie_a(2)*HDD_id(3)+Ie_a(3)*HDD_id(6))*sfr(DecidSurf)*IrrFracDecid*DayWatPer(wd) - ! IF (WUDay_id(5)<0) WUDay_id(5)=0 !If modelled WU is negative -> 0 - ! - ! ! ---- Manual irrigation (deciduous trees) ---- - ! WUDay_id(6) = (1-Faut)*(Ie_m(1)+Ie_m(2)*HDD_id(3)+Ie_m(3)*HDD_id(6))*sfr(DecidSurf)*& - ! IrrFracDecid*DayWatPer(wd) - ! IF (WUDay_id(6)<0) WUDay_id(6)=0 !If modelled WU is negative -> 0 - ! - ! ! ---- Total deciduous trees water use (automatic + manual) ---- - ! WUDay_id(4)=(WUDay_id(5)+WUDay_id(6)) - ! - ! ! ---- Automatic irrigation (grass) ---- - ! WUDay_id(8) = Faut*(Ie_a(1)+Ie_a(2)*HDD_id(3)+Ie_a(3)*HDD_id(6))*sfr(GrassSurf)*& - ! IrrFracGrass*DayWatPer(wd) - ! IF (WUDay_id(8)<0) WUDay_id(8)=0 !If modelled WU is negative -> 0 - ! ! ---- Manual irrigation (grass) ---- - ! WUDay_id(9) = (1-Faut)*(Ie_m(1)+Ie_m(2)*HDD_id(3)+Ie_m(3)*HDD_id(6))*sfr(GrassSurf)*& - ! IrrFracGrass*DayWatPer(wd) - ! IF (WUDay_id(9)<0) WUDay_id(9)=0 !If modelled WU is negative -> 0 - ! ! ---- Total grass water use (automatic + manual) ---- - ! WUDay_id(7)=(WUDay_id(8)+WUDay_id(9)) - ! ELSE - ! WUDay_id(1)=0 - ! WUDay_id(2)=0 - ! WUDay_id(3)=0 - ! WUDay_id(4)=0 - ! WUDay_id(5)=0 - ! WUDay_id(6)=0 - ! WUDay_id(7)=0 - ! WUDay_id(8)=0 - ! WUDay_id(9)=0 - ! ENDIF - ! ENDIF - ! ENDIF - - ! ----------------------------------------------------------------------- - ! ---- AnOHM TS --------------------- ! initialize Bowen ratio ! Bo_grids(0,:)=2. diff --git a/SUEWS-SourceCode/suews_ctrl_input.f95 b/SUEWS-SourceCode/suews_ctrl_input.f95 index f4d06d84c..2e385bec4 100644 --- a/SUEWS-SourceCode/suews_ctrl_input.f95 +++ b/SUEWS-SourceCode/suews_ctrl_input.f95 @@ -480,7 +480,7 @@ SUBROUTINE InputHeaderCheck(FileName) ! ========== SUEWS_AnthropogenicEmission.txt ====== HeaderAnthropogenic_Reqd(cA_Code) = "Code" - HeaderAnthropogenic_Reqd(cA_BaseTHDD) = "BaseTHDD" + HeaderAnthropogenic_Reqd(cA_BaseT_HC) = "BaseT_HC" HeaderAnthropogenic_Reqd(cA_QF_A1) = "QF_A_WD" HeaderAnthropogenic_Reqd(cA_QF_B1) = "QF_B_WD" HeaderAnthropogenic_Reqd(cA_QF_C1) = "QF_C_WD" @@ -525,6 +525,7 @@ SUBROUTINE InputHeaderCheck(FileName) HeaderIrrigation_Reqd(cIr_IeEnd) = "Ie_end" HeaderIrrigation_Reqd(cIr_IntWU) = "InternalWaterUse" HeaderIrrigation_Reqd(cIr_Faut) = "Faut" + HeaderIrrigation_Reqd(cIr_H_ponding) = "H_maintain" HeaderIrrigation_Reqd(cIr_Ie_a1) = "Ie_a1" HeaderIrrigation_Reqd(cIr_Ie_a2) = "Ie_a2" HeaderIrrigation_Reqd(cIr_Ie_a3) = "Ie_a3" @@ -976,7 +977,7 @@ SUBROUTINE CodeMatchESTM_Class(Gridiv, is, ii) ENDIF ENDDO ELSE - WRITE (*, *) 'Problem with CodeMatchESTM_Class (in SUEWS_CodeMatch.f95). ', is, ' not correct. Needs to be either ', & + WRITE (*, *) 'Problem with CodeMatchESTM_Class (in SUEWS_ctrl_input.f95). ', is, ' not correct. Needs to be either ', & '1 = Paved surfaced, 2 = Bldgs surfaces.' STOP ENDIF diff --git a/SUEWS-SourceCode/suews_ctrl_sumin.f95 b/SUEWS-SourceCode/suews_ctrl_sumin.f95 index c4a9295f5..dfc3581b7 100644 --- a/SUEWS-SourceCode/suews_ctrl_sumin.f95 +++ b/SUEWS-SourceCode/suews_ctrl_sumin.f95 @@ -92,7 +92,7 @@ SUBROUTINE SuMin( & RunoffToWater_id, & StateLimit_id, & WetThresh_id, & - BaseTHDD_id, & + BaseT_HC_id, & Faut_id, & IrrFracConif_id, & IrrFracDecid_id, & @@ -260,7 +260,7 @@ SUBROUTINE SuMin( & REAL(KIND(1d0)), INTENT(INOUT) ::RunoffToWater_id REAL(KIND(1d0)), DIMENSION(7), INTENT(INOUT) ::StateLimit_id REAL(KIND(1d0)), DIMENSION(7), INTENT(INOUT) ::WetThresh_id - REAL(KIND(1d0)), INTENT(INOUT) ::BaseTHDD_id + REAL(KIND(1d0)), INTENT(INOUT) ::BaseT_HC_id REAL(KIND(1d0)), INTENT(INOUT) ::Faut_id REAL(KIND(1d0)), INTENT(INOUT) ::IrrFracConif_id REAL(KIND(1d0)), INTENT(INOUT) ::IrrFracDecid_id @@ -422,15 +422,15 @@ SUBROUTINE SuMin( & !REAL(KIND(1d0)), DIMENSION(7 + 1), PARAMETER:: OHM_threshSW = [10, 10, 10, 10, 10, 10, 10, 10] !Arrays for OHM thresholds !REAL(KIND(1d0)), DIMENSION(7 + 1), PARAMETER:: OHM_threshWD = [0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9] !Arrays for OHM thresholds - !REAL(KIND(1d0)), PARAMETER:: BaseTHDD = 18.9 !Base temperature for QF + !REAL(KIND(1d0)), PARAMETER:: BaseT_HC = 18.9 !Base temperature for QF !not used REAL(KIND(1D0)), PARAMETER::xsmd = 0. !Measured soil moisture deficit !Todo REAL(KIND(1D0)), PARAMETER::wu_m3 = 0 !External water use !REAL(KIND(1D0)), PARAMETER::Faut = 0 !Fraction of irrigated area using automatic irrigation REAL(KIND(1D0)), PARAMETER::InternalWaterUse_h = 0 !Internal water use [mm h-1] - !REAL(KIND(1D0)), PARAMETER::IrrFracConif = 0 !Fraction of evergreen trees which are irrigated - !REAL(KIND(1D0)), PARAMETER::IrrFracDecid = 0 !Fraction of deciduous trees which are irrigated + !REAL(KIND(1D0)), PARAMETER::IrrFracEveTr = 0 !Fraction of evergreen trees which are irrigated + !REAL(KIND(1D0)), PARAMETER::IrrFracDecTr = 0 !Fraction of deciduous trees which are irrigated !REAL(KIND(1D0)), PARAMETER::IrrFracGrass = 0 !Fraction of grass which is irrigated !Todo !REAL(KIND(1D0)), DIMENSION(7), PARAMETER ::DayWat = 0 !Days of watering allowed @@ -474,8 +474,8 @@ SUBROUTINE SuMin( & !REAL(KIND(1D0)), DIMENSION(2), PARAMETER ::Qf_A = [0.1, 0.1]!Qf coefficients !REAL(KIND(1D0)), DIMENSION(2), PARAMETER ::Qf_B = [0.00986, 0.00986]!Qf coefficients !REAL(KIND(1D0)), DIMENSION(2), PARAMETER ::Qf_C = [0.0102, 0.0102]!Qf coefficients - !REAL(KIND(1D0)), DIMENSION(2), PARAMETER ::T_CRITIC_Cooling = [7, 7] !Critical temperature - !REAL(KIND(1D0)), DIMENSION(2), PARAMETER ::T_CRITIC_Heating = [7, 7] !Critical temperature + !REAL(KIND(1D0)), DIMENSION(2), PARAMETER ::BaseT_Cooling = [7, 7] !Critical temperature + !REAL(KIND(1D0)), DIMENSION(2), PARAMETER ::BaseT_Heating = [7, 7] !Critical temperature !REAL(KIND(1D0)), DIMENSION(2), PARAMETER ::TrafficRate = [0.0134, 0.0095] !keep them here REAL(KIND(1D0)), PARAMETER::EF_umolCO2perJ = 1.159 @@ -546,7 +546,7 @@ SUBROUTINE SuMin( & alb, AlbMax_DecTr_id, AlbMax_EveTr_id, AlbMax_Grass_id, & AlbMin_DecTr_id, AlbMin_EveTr_id, AlbMin_Grass_id, & alpha_bioCO2, alpha_enh_bioCO2, alt, avkdn, avRh, avU1, BaseT_id, BaseTe_id, & - BaseTHDD_id, beta_bioCO2, beta_enh_bioCO2, bldgH_id, CapMax_dec_id, CapMin_dec_id, & + BaseT_HC_id, beta_bioCO2, beta_enh_bioCO2, bldgH_id, CapMax_dec_id, CapMin_dec_id, & chAnOHM, cpAnOHM, CRWmax, CRWmin, DayWat_id, DayWatPer_id, & DecTreeH_id, Diagnose, DiagQN, DiagQS, DRAINRT_id, & dt_since_start, dqndt, qn1_av, dqnsdt, qn1_s_av, & diff --git a/SUEWS-SourceCode/suews_ctrl_translate.f95 b/SUEWS-SourceCode/suews_ctrl_translate.f95 index 9329629f8..b7a547ad5 100644 --- a/SUEWS-SourceCode/suews_ctrl_translate.f95 +++ b/SUEWS-SourceCode/suews_ctrl_translate.f95 @@ -52,9 +52,13 @@ SUBROUTINE SUEWS_Translate(Gridiv, ir, iMB) snowdensmin, snowdensmax, tau_r, crwmin, crwmax, & preciplimit, SnowProf_24hr, snowalb, snowfallcum USE sues_data, ONLY: & - surfacearea_ha, surfacearea, irrfracconif, irrfracdecid, irrfracgrass, & + surfacearea_ha, surfacearea, & + IrrFracPaved, IrrFracBldgs, & + IrrFracEveTr, IrrFracDecTr, irrfracgrass, & + IrrFracBSoil, IrrFracWater, & soildensity, soildepthmeas, smcap, soilrocks, pipecapacity, flowchange, & runofftowater, ie_start, ie_end, internalwateruse_h, faut, & + H_maintain, & ie_a, ie_m, daywat, daywatper, & wuareaevetr_m2, wuareadectr_m2, wuareagrass_m2, & AerodynamicResistanceMethod, RoughLenHeatMethod, StabilityMethod, tstep, tstep_prev @@ -125,9 +129,13 @@ SUBROUTINE SUEWS_Translate(Gridiv, ir, iMB) CALL ErrorHint(10, 'Surface fractions (Fr_) should add up to 1.', SUM(sfr), notUsed, notUsedI) ! ---- Irrigated fractions - IrrFracConif = SurfaceChar(Gridiv, c_IrrEveTrFrac) ! Everg - IrrFracDecid = SurfaceChar(Gridiv, c_IrrDecTrFrac) ! Decid + IrrFracPaved = SurfaceChar(Gridiv, c_IrrPavedFrac) ! Paved + IrrFracBldgs = SurfaceChar(Gridiv, c_IrrBldgsFrac) ! Bldgs + IrrFracEveTr = SurfaceChar(Gridiv, c_IrrEveTrFrac) ! Everg + IrrFracDecTr = SurfaceChar(Gridiv, c_IrrDecTrFrac) ! Decid IrrFracGrass = SurfaceChar(Gridiv, c_IrrGrassFrac) ! Grass + IrrFracBSoil = SurfaceChar(Gridiv, c_IrrBSoilFrac) ! BSoil + IrrFracWater = SurfaceChar(Gridiv, c_IrrWaterFrac) ! Water ! --------------------------------------------------------------------------------- ! --------- Surface cover calculations (previously in LUMPS_gis_read) ------------- @@ -144,7 +152,7 @@ SUBROUTINE SUEWS_Translate(Gridiv, ir, iMB) IF (veg_type == 1) THEN ! area vegetated veg_fr = (sfr(ConifSurf) + sfr(DecidSurf) + sfr(GrassSurf) + sfr(BSoilSurf) + sfr(WaterSurf)) ELSEIF (veg_type == 2) THEN ! area irrigated - veg_fr = (IrrFracConif*sfr(ConifSurf) + IrrFracDecid*sfr(DecidSurf) + IrrFracGrass*sfr(GrassSurf)) + veg_fr = (IrrFracEveTr*sfr(ConifSurf) + IrrFracDecTr*sfr(DecidSurf) + IrrFracGrass*sfr(GrassSurf)) ENDIF ImpervFraction = (sfr(PavSurf) + sfr(BldgSurf)) @@ -184,11 +192,11 @@ SUBROUTINE SUEWS_Translate(Gridiv, ir, iMB) IF (PopDensDaytime(1) >= 0 .AND. PopDensNighttime < 0) PopDensNighttime = PopDensDaytime(1) !If only daytime data provided, use them IF (PopDensDaytime(1) < 0 .AND. PopDensNighttime >= 0) PopDensDaytime(1) = PopDensNighttime !If only night-time data provided, use them PopDensDaytime(2) = PopDensNighttime + (PopDensDaytime(1) - PopDensNighttime)*SurfaceChar(Gridiv, c_FrPDDwe) !Use weekend fraction to daytime population - ! the following part has been moved into `SUEWS_cal_Main` as `NumCapita` can be derived there + ! the following part has been moved into as can be derived there ! IF (PopDensDaytime(1) >= 0 .AND. PopDensNighttime >= 0) NumCapita(1) = (PopDensDaytime(1) + PopDensNighttime)/2 !If both, use average ! IF (PopDensDaytime(2) >= 0 .AND. PopDensNighttime >= 0) NumCapita(2) = (PopDensDaytime(2) + PopDensNighttime)/2 !If both, use average - ! ! IF (PopDensDaytime >= 0 .AND. PopDensNighttime >= 0) NumCapita = (PopDensDaytime + PopDensNighttime)/2 !If both, use average ! moved to `AnthropogenicEmissions`, TS 27 Dec 2018 + ! ! IF (PopDensDaytime >= 0 .AND. PopDensNighttime >= 0) NumCapita = (PopDensDaytime + PopDensNighttime)/2 !If both, use average ! moved to , TS 27 Dec 2018 ! ---- Traffic rate TrafficRate = SurfaceChar(Gridiv, (/c_TrafficRate_WD, c_TrafficRate_WE/)) ! Mean traffic rate within modelled area @@ -718,25 +726,25 @@ SUBROUTINE SUEWS_Translate(Gridiv, ir, iMB) END IF ! ---- QF coeffs (was in SUEWS_SAHP.f95, subroutine SAHP_Coefs) - BaseTHDD = -999 ! Initialise QF coeffs + BaseT_HC = -999 ! Initialise QF coeffs QF_A = 0 QF_B = 0 QF_C = 0 AH_min = 0 - T_CRITIC_Heating = 0 - T_CRITIC_Cooling = 0 + BaseT_Heating = 0 + BaseT_Cooling = 0 AH_slope_Heating = 0 AH_slope_Cooling = 0 - BaseTHDD = SurfaceChar(Gridiv, c_BaseTHDD) + BaseT_HC = SurfaceChar(Gridiv, c_BaseT_HC) QF_A = SurfaceChar(Gridiv, (/c_QF_A1, c_QF_A2/)) QF_B = SurfaceChar(Gridiv, (/c_QF_B1, c_QF_B2/)) QF_C = SurfaceChar(Gridiv, (/c_QF_C1, c_QF_C2/)) AH_min = SurfaceChar(Gridiv, (/c_AHMin_WD, c_AHMin_WE/)) AH_slope_Heating = SurfaceChar(Gridiv, (/c_AHSlopeHeating_WD, c_AHSlopeHeating_WE/)) AH_slope_Cooling = SurfaceChar(Gridiv, (/c_AHSlopeCooling_WD, c_AHSlopeCooling_WE/)) - T_Critic_Heating = SurfaceChar(Gridiv, (/c_TCriticHeating_WD, c_TCriticHeating_WE/)) - T_Critic_Cooling = SurfaceChar(Gridiv, (/c_TCriticCooling_WD, c_TCriticCooling_WE/)) + BaseT_Heating = SurfaceChar(Gridiv, (/c_TCriticHeating_WD, c_TCriticHeating_WE/)) + BaseT_Cooling = SurfaceChar(Gridiv, (/c_TCriticCooling_WD, c_TCriticCooling_WE/)) EnProfWD = SurfaceChar(Gridiv, c_EnProfWD) EnProfWE = SurfaceChar(Gridiv, c_EnProfWE) CO2mWD = SurfaceChar(Gridiv, c_CO2mWD) @@ -762,6 +770,7 @@ SUBROUTINE SUEWS_Translate(Gridiv, ir, iMB) Ie_end = INT(SurfaceChar(Gridiv, c_IeEnd)) InternalWaterUse_h = SurfaceChar(Gridiv, c_IntWU) Faut = SurfaceChar(Gridiv, c_Faut) + H_maintain = SurfaceChar(Gridiv, c_h_maintain) !Automatic irrigation model coefficients [mm d-1]; [mm d-1 degC-1]; [mm d-2] Ie_a = SurfaceChar(Gridiv, c_Ie_a) !Automatic irrigation model coefficients [mm d-1]; [mm d-1 degC-1]; [mm d-2] Ie_m = SurfaceChar(Gridiv, c_Ie_m) !Manual irrigation model coefficients [mm d-1]; [mm d-1 degC-1]; [mm d-2] DayWat = SurfaceChar(Gridiv, c_DayWat) @@ -997,7 +1006,7 @@ SUBROUTINE SUEWS_Translate(Gridiv, ir, iMB) ! Characteristics that apply to some or all surface types WRITE (12, '(8a10,a16)') 'Paved', 'Bldgs', 'EveTr', 'DecTr', 'Grass', 'BSoil', 'Water', 'Snow', ' SurfType' WRITE (12, 120) (sfr(iv), iv=1, nsurf), FCskip, ' SurfFr' - WRITE (12, 120) FCskip, FCskip, IrrFracConif, IrrFracDecid, IrrFracGrass, FCskip, FCskip, FCskip, ' IrrFr' + WRITE (12, 120) FCskip, FCskip, IrrFracEveTr, IrrFracDecTr, IrrFracGrass, FCskip, FCskip, FCskip, ' IrrFr' WRITE (12, 120) FCskip, FCskip, WUAreaEveTr_m2, WUAreaDecTr_m2, WUAreaGrass_m2, FCskip, FCskip, FCskip, ' WaterUseArea' WRITE (12, 120) FCskip, BldgH, EveTreeH, DecTreeH, FCskip, FCskip, FCskip, FCskip, ' H' WRITE (12, 120) FCskip, FAIBldg, FAIEveTree, FAIDecTree, FCskip, FCskip, FCskip, FCskip, ' FAI' @@ -1058,10 +1067,10 @@ SUBROUTINE SUEWS_Translate(Gridiv, ir, iMB) WRITE (12, '(a12,11f10.3,i3)') SsG_YYYY, G1, G2, G3, G4, G5, G6, TH, TL, S1, S2, Kmax, gsModel WRITE (12, *) '----- '//TRIM(ADJUSTL(SsG_YYYY))//' Energy-use parameters'//' -----' - WRITE (12, '(a12,11a10)') 'Grid', 'PopDensDaytime', 'BaseTHDD', 'QF_A_WD', 'QF_A_WE', 'QF_B_WD', 'QF_B_WE', 'QF_C_WD', & - 'QF_C_WE', 'AH_Min', 'AH_Slope', 'T_critic_Heating' - WRITE (12, '(a12,11f10.3)') SsG_YYYY, PopDensDaytime, BaseTHDD, QF_A(1:2), QF_B(1:2), QF_C(1:2), & - AH_Min, AH_Slope_Heating, T_critic_Heating + WRITE (12, '(a12,11a10)') 'Grid', 'PopDensDaytime', 'BaseT_HC', 'QF_A_WD', 'QF_A_WE', 'QF_B_WD', 'QF_B_WE', 'QF_C_WD', & + 'QF_C_WE', 'AH_Min', 'AH_Slope', 'BaseT_Heating' + WRITE (12, '(a12,11f10.3)') SsG_YYYY, PopDensDaytime, BaseT_HC, QF_A(1:2), QF_B(1:2), QF_C(1:2), & + AH_Min, AH_Slope_Heating, BaseT_Heating WRITE (12, *) '----- '//TRIM(ADJUSTL(SsG_YYYY))//' Water-use parameters'//' -----' WRITE (12, '(a12,10a10)') 'Grid', 'IeStart', 'IeEnd', 'IntWatUse', 'Faut', & @@ -1116,7 +1125,7 @@ SUBROUTINE SUEWS_Translate(Gridiv, ir, iMB) ! Coefficients for anthropogenic heat models ---------------------------------- IF (EmissionsMethod == 1) THEN !Loridan et al. (2011) calculation - IF (AH_min(1) == 0 .AND. Ah_slope_Heating(1) == 0 .AND. T_Critic_Heating(1) == 0) THEN + IF (AH_min(1) == 0 .AND. Ah_slope_Heating(1) == 0 .AND. BaseT_Heating(1) == 0) THEN CALL ErrorHint(53, 'Check QF calculation coefficients.', notUsed, notUsed, EmissionsMethod) ENDIF @@ -1293,7 +1302,7 @@ SUBROUTINE SUEWS_Translate(Gridiv, ir, iMB) write (12, *) 'avu1=', avu1 write (12, *) 'baset=', baset write (12, *) 'basete=', basete - write (12, *) 'basethdd=', basethdd + write (12, *) 'BaseT_HC=', BaseT_HC write (12, *) 'beta_bioco2=', beta_bioco2 write (12, *) 'beta_enh_bioco2=', beta_enh_bioco2 write (12, *) 'bldgh=', bldgh @@ -1351,8 +1360,8 @@ SUBROUTINE SUEWS_Translate(Gridiv, ir, iMB) write (12, *) 'ie_start=', ie_start write (12, *) 'imin=', imin write (12, *) 'internalwateruse_h=', internalwateruse_h - write (12, *) 'irrfracconif=', irrfracconif - write (12, *) 'irrfracdecid=', irrfracdecid + write (12, *) 'IrrFracEveTr=', IrrFracEveTr + write (12, *) 'IrrFracDecTr=', IrrFracDecTr write (12, *) 'irrfracgrass=', irrfracgrass write (12, *) 'isec=', isec write (12, *) 'it=', it @@ -1450,8 +1459,8 @@ SUBROUTINE SUEWS_Translate(Gridiv, ir, iMB) write (12, *) 'tau_r=', tau_r write (12, *) 'tmax_id=', tmax_id write (12, *) 'tmin_id=', tmin_id - write (12, *) 't_critic_cooling=', t_critic_cooling - write (12, *) 't_critic_heating=', t_critic_heating + write (12, *) 'BaseT_Cooling=', BaseT_Cooling + write (12, *) 'BaseT_Heating=', BaseT_Heating write (12, *) 'temp_c=', temp_c write (12, *) 'tempmeltfact=', tempmeltfact write (12, *) 'th=', th diff --git a/SUEWS-SourceCode/suews_phys_anemsn.f95 b/SUEWS-SourceCode/suews_phys_anemsn.f95 index a65cad00c..f1742d17f 100644 --- a/SUEWS-SourceCode/suews_phys_anemsn.f95 +++ b/SUEWS-SourceCode/suews_phys_anemsn.f95 @@ -28,14 +28,14 @@ module AnEmsn_module SUBROUTINE AnthropogenicEmissions( & CO2PointSource, EmissionsMethod, & - id, it, imin, DLS, nsh, DayofWeek_id, & + it, imin, DLS, DayofWeek_id, & EF_umolCO2perJ, FcEF_v_kgkm, EnEF_v_Jkm, TrafficUnits, & FrFossilFuel_Heat, FrFossilFuel_NonHeat, & MinFCMetab, MaxFCMetab, MinQFMetab, MaxQFMetab, & PopDensDaytime, PopDensNighttime, & Temp_C, HDD_id, Qf_A, Qf_B, Qf_C, & AH_MIN, AH_SLOPE_Heating, AH_SLOPE_Cooling, & - T_CRITIC_Heating, T_CRITIC_Cooling, & + BaseT_Heating, BaseT_Cooling, & TrafficRate, & QF0_BEU, QF_SAHP, & Fc_anthro, Fc_metab, Fc_traff, Fc_build, Fc_point, & @@ -48,11 +48,9 @@ SUBROUTINE AnthropogenicEmissions( & INTEGER, INTENT(in):: & EmissionsMethod, & - id, & !Hour it, & !Hour imin, & !Minutes - DLS, & !day lightsavings =1+1h=0 - nsh !Number of timesteps per hour + DLS !day lightsavings =1+1h=0 INTEGER, DIMENSION(3), INTENT(in)::DayofWeek_id !1 - day of week; 2 - month; 3 - season @@ -65,8 +63,8 @@ SUBROUTINE AnthropogenicEmissions( & AH_SLOPE_Cooling, & FcEF_v_kgkm, & !CO2 Emission factor PopDensDaytime, & !Daytime population density [ha-1] (i.e. workers) - T_CRITIC_Heating, & !Critical temperature - T_CRITIC_Cooling, & !Critical cooling temperature + BaseT_Heating, & !Critical temperature + BaseT_Cooling, & !Critical cooling temperature TrafficRate, & !Traffic rate QF0_BEU @@ -109,8 +107,8 @@ SUBROUTINE AnthropogenicEmissions( & DP_x_RhoPop, DP_x_RhoPop_traff, & QF_build, QF_metab, QF_traff, & QF_SAHP_base, & !Anthropogenic heat flux calculated by SAHP (temp independent part) - QF_SAHP_heat, & !Anthropogenic heat flux calculated by SAHP (heating part only) - QF_SAHP_ac, & !AC contribution + QF_SAHP_heating, & !Anthropogenic heat flux calculated by SAHP (heating part only) + QF_SAHP_cooling, & !AC contribution PopDorNorT, & ! Population ActDorNorT, & ! Human activity TraffDorNorT, & ! Traffic @@ -118,10 +116,10 @@ SUBROUTINE AnthropogenicEmissions( & ! initialisation QF_traff = 0 - QF_SAHP_heat = 0 - QF_SAHP_ac = 0 + QF_SAHP_heating = 0 + QF_SAHP_cooling = 0 - ! Transfer HDD values to local explict variables + ! Transfer HDD/CDD values to local explict variables HDD_daily = HDD_id(7) CDD_daily = HDD_id(8) ! NB: temporarily use 5-day running mean to test the performance @@ -130,7 +128,7 @@ SUBROUTINE AnthropogenicEmissions( & ! Tair_avg_daily= HDD_id_use(3) ! this is daily ! use average of both daytime and nighttime population values - ! TS 20 Sep 2019: moved from `translate` here to simplify the interface + ! TS 20 Sep 2019: moved from here to simplify the interface IF (PopDensDaytime(1) >= 0 .AND. PopDensNighttime >= 0) NumCapita(1) = (PopDensDaytime(1) + PopDensNighttime)/2 !If both, use average IF (PopDensDaytime(2) >= 0 .AND. PopDensNighttime >= 0) NumCapita(2) = (PopDensDaytime(2) + PopDensNighttime)/2 !If both, use average @@ -153,10 +151,10 @@ SUBROUTINE AnthropogenicEmissions( & ! AHDorNorT = AHProf_tstep((NSH*(ih+1-1)+imin*NSH/60+1),iu) ! normalise so the AVERAGE of the multipliers is equal to 1 ! PRINT*, '' ! PRINT*, 'AHDorNorT old:',AHDorNorT - PopDorNorT = get_Prof_SpecTime_inst(ih, imin, 0, PopProf_24hr(:, iu)) - ActDorNorT = get_Prof_SpecTime_inst(ih, imin, 0, HumActivity_24hr(:, iu)) - TraffDorNorT = get_Prof_SpecTime_mean(ih, imin, 0, TraffProf_24hr(:, iu)) - AHDorNorT = get_Prof_SpecTime_mean(ih, imin, 0, AHProf_24hr(:, iu)) + PopDorNorT = get_Prof_SpecTime_inst(ih, imin, 0, PopProf_24hr(:, iu)) ! 1=night, 2=day, 1-2=transition + ActDorNorT = get_Prof_SpecTime_inst(ih, imin, 0, HumActivity_24hr(:, iu)) ! 1=night, 2=day, 1-2=transition + TraffDorNorT = get_Prof_SpecTime_mean(ih, imin, 0, TraffProf_24hr(:, iu)) ! normalise so the AVERAGE of the multipliers is equal to 1 + AHDorNorT = get_Prof_SpecTime_mean(ih, imin, 0, AHProf_24hr(:, iu)) ! normalise so the AVERAGE of the multipliers is equal to 1 ! Diurnal profile times population density [cap ha-1] DP_x_RhoPop = AHDorNorT*NumCapita(iu) @@ -172,38 +170,44 @@ SUBROUTINE AnthropogenicEmissions( & !1-3: CO2 emission is calculated from QF which can be calculated with three methods !41-43: CO2 emission is calculated with local information. QF methods are used for housing and human metabolism - IF (EmissionsMethod == 1 .OR. EmissionsMethod == 4 .OR. EmissionsMethod == 11 .OR. EmissionsMethod == 14 .OR. & - EmissionsMethod == 21 .OR. EmissionsMethod == 24 .OR. EmissionsMethod == 31 .OR. EmissionsMethod == 34 .OR. & + IF (EmissionsMethod == 1 .OR. EmissionsMethod == 4 .OR. & + EmissionsMethod == 11 .OR. EmissionsMethod == 14 .OR. & + EmissionsMethod == 21 .OR. EmissionsMethod == 24 .OR. & + EmissionsMethod == 31 .OR. EmissionsMethod == 34 .OR. & EmissionsMethod == 41 .OR. EmissionsMethod == 44) THEN ! (formerly SAHP_1 subroutine) ! Loridan et al. (2011) JAMC Eq 13: linear relation with air temperature ! Weekday/weekend differences due to profile only ! Now scales with population density - IF (Temp_C < T_CRITIC_Heating(iu)) THEN - QF_SAHP = (AH_MIN(iu) + AH_SLOPE_Heating(iu)*(T_CRITIC_Heating(iu) - Temp_C))*AHDorNorT + IF (Temp_C < BaseT_Heating(iu)) THEN + ! QF_SAHP = (AH_MIN(iu) + AH_SLOPE_Heating(iu)*(BaseT_Heating(iu) - Temp_C))*AHDorNorT + QF_SAHP_heating = (AH_SLOPE_Heating(iu)*(BaseT_Heating(iu) - Temp_C))*AHDorNorT ELSE - QF_SAHP = AH_MIN(iu)*AHDorNorT + QF_SAHP_heating = 0 + ! QF_SAHP = AH_MIN(iu)*AHDorNorT ENDIF ! Need to be checked later, not recommended to use - ! QF_SAHP_base = AH_MIN(iu) * DP_x_RhoPop ! Temperature-independent contribution QF_SAHP_base = AH_MIN(iu)*AHDorNorT ! Temperature-independent contribution - QF_SAHP_heat = QF_SAHP - QF_SAHP_base ! Heating contribution - QF_SAHP_ac = 0 ! No AC contribution with this method + QF_SAHP_cooling = 0 ! No AC contribution with this method - ELSEIF (EmissionsMethod == 2 .OR. EmissionsMethod == 5 .OR. EmissionsMethod == 12 .OR. EmissionsMethod == 15 .OR. & - EmissionsMethod == 22 .OR. EmissionsMethod == 25 .OR. EmissionsMethod == 32 .OR. EmissionsMethod == 35 .OR. & + ELSEIF (EmissionsMethod == 2 .OR. EmissionsMethod == 5 .OR. & + EmissionsMethod == 12 .OR. EmissionsMethod == 15 .OR. & + EmissionsMethod == 22 .OR. EmissionsMethod == 25 .OR. & + EmissionsMethod == 32 .OR. EmissionsMethod == 35 .OR. & EmissionsMethod == 42 .OR. EmissionsMethod == 45) THEN ! (formerly SAHP_2 subroutine) ! Jarvi et al. (2011) JH Eq 3 using HDD and CDD ! Weekday/weekend differences due to profile and coefficients QF_a,b,c ! Scales with population density - QF_SAHP = (Qf_a(iu) + Qf_b(iu)*CDD_daily + Qf_c(iu)*HDD_daily)*DP_x_RhoPop !This contains QF from all three sources: buildings, metabolism and traffic! + ! QF_SAHP = (Qf_a(iu) + Qf_b(iu)*CDD_daily + Qf_c(iu)*HDD_daily)*DP_x_RhoPop !This contains QF from all three sources: buildings, metabolism and traffic! QF_SAHP_base = (Qf_a(iu))*DP_x_RhoPop ! Temperature-independent contribution from buildings, traffic and human metabolism - QF_SAHP_heat = (Qf_c(iu)*HDD_daily)*DP_x_RhoPop ! Heating contribution - QF_SAHP_ac = (Qf_b(iu)*CDD_daily)*DP_x_RhoPop ! Cooling (AC) contribution + QF_SAHP_heating = (Qf_c(iu)*HDD_daily)*DP_x_RhoPop ! Heating contribution + QF_SAHP_cooling = (Qf_b(iu)*CDD_daily)*DP_x_RhoPop ! Cooling (AC) contribution - ELSEIF (EmissionsMethod == 3 .OR. EmissionsMethod == 6 .OR. EmissionsMethod == 13 .OR. EmissionsMethod == 16 .OR. & - EmissionsMethod == 23 .OR. EmissionsMethod == 26 .OR. EmissionsMethod == 33 .OR. EmissionsMethod == 36 .OR. & + ELSEIF (EmissionsMethod == 3 .OR. EmissionsMethod == 6 .OR. & + EmissionsMethod == 13 .OR. EmissionsMethod == 16 .OR. & + EmissionsMethod == 23 .OR. EmissionsMethod == 26 .OR. & + EmissionsMethod == 33 .OR. EmissionsMethod == 36 .OR. & EmissionsMethod == 43 .OR. EmissionsMethod == 46) THEN ! Updated Loridan et al. (2011) method using daily (not instantaneous) air temperature (HDD_id_use(3)) ! Linear relation with air temperature @@ -211,44 +215,47 @@ SUBROUTINE AnthropogenicEmissions( & ! Scales with population density ! Need to be checked later, not recommended to use - ! QF_SAHP_base = AH_MIN(iu) * DP_x_RhoPop ! Temperature-independent contribution QF_SAHP_base = AH_MIN(iu)*AHDorNorT ! Temperature-independent contribution - IF (Tair_avg_daily < T_CRITIC_Heating(iu)) THEN ! Heating - QF_SAHP = (AH_MIN(iu) + AH_SLOPE_Heating(iu)*(T_CRITIC_Heating(iu) - Tair_avg_daily))*AHDorNorT - QF_SAHP_heat = QF_SAHP - QF_SAHP_base ! Heating contribution - QF_SAHP_ac = 0 + IF (Tair_avg_daily < BaseT_Heating(iu)) THEN ! Heating + QF_SAHP_heating = (AH_SLOPE_Heating(iu)*(BaseT_Heating(iu) - Tair_avg_daily))*AHDorNorT ! Heating contribution + QF_SAHP_cooling = 0 - ELSEIF (Tair_avg_daily > T_CRITIC_Cooling(iu)) THEN ! Air-conditioning - QF_SAHP = (AH_MIN(iu) + AH_SLOPE_Cooling(iu)*(Tair_avg_daily - T_CRITIC_Cooling(iu)))*AHDorNorT - QF_SAHP_heat = 0 - QF_SAHP_ac = QF_SAHP - QF_SAHP_base ! AC contribution + ELSEIF (Tair_avg_daily > BaseT_Cooling(iu)) THEN ! Air-conditioning + QF_SAHP_heating = 0 + QF_SAHP_cooling = (AH_SLOPE_Cooling(iu)*(Tair_avg_daily - BaseT_Cooling(iu)))*AHDorNorT ! AC contribution ELSE - QF_SAHP = AH_MIN(iu)*AHDorNorT + QF_SAHP_heating = 0 + QF_SAHP_cooling = 0 ENDIF ENDIF - IF (EmissionsMethod >= 1 .AND. EmissionsMethod <= 3 .OR. EmissionsMethod >= 11 .AND. EmissionsMethod <= 13 .OR. & - EmissionsMethod >= 21 .AND. EmissionsMethod <= 23 .OR. EmissionsMethod >= 31 .AND. EmissionsMethod <= 33 .OR. & + ! total QF as the sum of components + QF_SAHP = QF_SAHP_base + QF_SAHP_heating + QF_SAHP_cooling + + IF (EmissionsMethod >= 1 .AND. EmissionsMethod <= 3 .OR. & + EmissionsMethod >= 11 .AND. EmissionsMethod <= 13 .OR. & + EmissionsMethod >= 21 .AND. EmissionsMethod <= 23 .OR. & + EmissionsMethod >= 31 .AND. EmissionsMethod <= 33 .OR. & EmissionsMethod >= 41 .AND. EmissionsMethod <= 43) THEN - ! Calculate QF from buildings. First remove (if possibe) human metabolism from the total value given by SAHP. + ! Calculate QF from buildings. + ! First remove (if possibe) human metabolism from the total value given by SAHP. IF ((QF_SAHP_base - QF_metab) > 0) THEN - QF_build = QF_SAHP_base*QF0_BEU(iu) + QF_SAHP_heat + QF_SAHP_ac !QF0_BEU = QF0_BuildingEnergyUse = Fraction of base value coming from buildings + QF_build = QF_SAHP_base*QF0_BEU(iu) + QF_SAHP_heating + QF_SAHP_cooling !QF0_BEU = QF0_BuildingEnergyUse = Fraction of base value coming from buildings !relative to traffic as metabolism is separately calculated ELSE - ! CALL ErrorHint(69,'QF metab exceeds base QF.',QF_metab,QF_SAHP_base,notUsedI) CALL ErrorHint(69, 'QF metab exceeds base QF.', QF_metab, QF_SAHP_base) - QF_build = QF_SAHP_heat + QF_SAHP_ac + (QF_SAHP_base - QF_metab) !If human metabolism greater than Base QF, remove this from the heating/cooling contribution also + QF_build = QF_SAHP_heating + QF_SAHP_cooling + (QF_SAHP_base - QF_metab) !If human metabolism greater than Base QF, remove this from the heating/cooling contribution also ENDIF ! Consider the various components of QF_build to calculate Fc_build ! Assume all A/C electric, so QF_SAHP_ac is not associated with any local CO2 emissions ! HDD part is building energy use, split between electricity (no local emissions CO2) and combustion (CO2) heating... - Fc_build = QF_SAHP_heat*FrFossilFuel_Heat*EF_umolCO2perJ + Fc_build = QF_SAHP_heating*FrFossilFuel_Heat*EF_umolCO2perJ ! ... and there is also a temperature-independent contribution from building energy use. IF ((QF_SAHP_base - QF_metab) > 0) THEN @@ -272,8 +279,10 @@ SUBROUTINE AnthropogenicEmissions( & ! Sum components to give anthropogenic CO2 flux [umol m-2 s-1] Fc_anthro = Fc_metab + Fc_traff + Fc_build + Fc_point - ELSEIF (EmissionsMethod >= 4 .AND. EmissionsMethod <= 6 .OR. EmissionsMethod >= 14 .AND. EmissionsMethod <= 16 .OR. & - EmissionsMethod >= 24 .AND. EmissionsMethod <= 26 .OR. EmissionsMethod >= 34 .AND. EmissionsMethod <= 36 .OR. & + ELSEIF (EmissionsMethod >= 4 .AND. EmissionsMethod <= 6 .OR. & + EmissionsMethod >= 14 .AND. EmissionsMethod <= 16 .OR. & + EmissionsMethod >= 24 .AND. EmissionsMethod <= 26 .OR. & + EmissionsMethod >= 34 .AND. EmissionsMethod <= 36 .OR. & EmissionsMethod >= 44 .AND. EmissionsMethod <= 46) THEN ! Calculate QF and Fc using building energy use and transport statistics @@ -298,11 +307,11 @@ SUBROUTINE AnthropogenicEmissions( & ! Energy released from buildings only ! Should buildings have their own profile? Now using population profile - QF_build = ((QF_SAHP_base*QF0_BEU(iu) + QF_SAHP_heat + QF_SAHP_ac)/DP_x_RhoPop)* & + QF_build = ((QF_SAHP_base*QF0_BEU(iu) + QF_SAHP_heating + QF_SAHP_cooling)/DP_x_RhoPop)* & (PopDensNighttime*(2 - PopDorNorT) + PopDensDaytime(iu)*(PopDorNorT - 1)) ! Consider the various components of QF_build to calculate Fc_build - Fc_build = QF_SAHP_heat*FrFossilFuel_Heat*EF_umolCO2perJ + Fc_build = QF_SAHP_heating*FrFossilFuel_Heat*EF_umolCO2perJ ! ... and there is also a temperature-independent contribution from building energy use Fc_build = Fc_build + QF_SAHP_base*QF0_BEU(iu)*FrFossilFuel_NonHeat*EF_umolCO2perJ diff --git a/SUEWS-SourceCode/suews_phys_dailystate.f95 b/SUEWS-SourceCode/suews_phys_dailystate.f95 index 6d63df40f..c7f899a35 100644 --- a/SUEWS-SourceCode/suews_phys_dailystate.f95 +++ b/SUEWS-SourceCode/suews_phys_dailystate.f95 @@ -57,9 +57,11 @@ MODULE DailyState_module SUBROUTINE SUEWS_cal_DailyState( & iy, id, it, imin, isec, tstep, tstep_prev, dt_since_start, DayofWeek_id, &!input Tmin_id_prev, Tmax_id_prev, lenDay_id_prev, & + BaseTMethod, & WaterUseMethod, Ie_start, Ie_end, & LAICalcYes, LAIType, & - nsh_real, avkdn, Temp_C, Precip, BaseTHDD, & + nsh_real, avkdn, Temp_C, Precip, BaseT_HC, & + BaseT_Heating, BaseT_Cooling, & lat, Faut, LAI_obs, & AlbMax_DecTr, AlbMax_EveTr, AlbMax_Grass, & AlbMin_DecTr, AlbMin_EveTr, AlbMin_Grass, & @@ -69,6 +71,7 @@ SUBROUTINE SUEWS_cal_DailyState( & DecidCap_id_prev, StoreDrainPrm_prev, LAI_id_prev, GDD_id_prev, SDD_id_prev, & albDecTr_id_prev, albEveTr_id_prev, albGrass_id_prev, porosity_id_prev, &!input HDD_id_prev, &!input + state_id, soilstore_id, SoilStoreCap, H_maintain, &!input HDD_id_next, &!output Tmin_id_next, Tmax_id_next, lenDay_id_next, & albDecTr_id_next, albEveTr_id_next, albGrass_id_next, porosity_id_next, &!output @@ -89,6 +92,7 @@ SUBROUTINE SUEWS_cal_DailyState( & INTEGER, INTENT(IN)::dt_since_start INTEGER, INTENT(IN)::WaterUseMethod + INTEGER, INTENT(IN)::BaseTMethod INTEGER, INTENT(IN)::Ie_start !Starting time of water use (DOY) INTEGER, INTENT(IN)::Ie_end !Ending time of water use (DOY) INTEGER, INTENT(IN)::LAICalcYes @@ -99,7 +103,9 @@ SUBROUTINE SUEWS_cal_DailyState( & REAL(KIND(1d0)), INTENT(IN)::avkdn REAL(KIND(1d0)), INTENT(IN)::Temp_C REAL(KIND(1d0)), INTENT(IN)::Precip - REAL(KIND(1d0)), INTENT(IN)::BaseTHDD + REAL(KIND(1d0)), INTENT(IN)::BaseT_HC + REAL(KIND(1d0)), DIMENSION(2), INTENT(IN)::BaseT_Heating + REAL(KIND(1d0)), DIMENSION(2), INTENT(IN)::BaseT_Cooling REAL(KIND(1d0)), INTENT(IN)::lat REAL(KIND(1d0)), INTENT(IN)::Faut REAL(KIND(1d0)), INTENT(IN)::LAI_obs @@ -127,6 +133,12 @@ SUBROUTINE SUEWS_cal_DailyState( & REAL(KIND(1d0)), DIMENSION(7), INTENT(IN) ::DayWatPer !% of houses following daily water REAL(KIND(1d0)), DIMENSION(7), INTENT(IN) ::DayWat !Days of watering allowed + ! ponding-water related + REAL(KIND(1d0)), INTENT(IN)::H_maintain ! ponding water depth to maintain [mm] + REAL(KIND(1d0)), DIMENSION(nsurf), INTENT(IN)::state_id ! surface wetness [mm] + REAL(KIND(1d0)), DIMENSION(nsurf), INTENT(IN)::soilstore_id ! soil water store [mm] + REAL(KIND(1d0)), DIMENSION(nsurf), INTENT(in)::SoilStoreCap!Capacity of soil store for each surface [mm] + ! REAL(KIND(1d0)), DIMENSION(nsurf), INTENT(IN) ::SnowPack REAL(KIND(1d0)), DIMENSION(nvegsurf), INTENT(IN) ::BaseT !Base temperature for growing degree days [degC] REAL(KIND(1d0)), DIMENSION(nvegsurf), INTENT(IN) ::BaseTe !Base temperature for senescence degree days [degC] @@ -275,13 +287,16 @@ SUBROUTINE SUEWS_cal_DailyState( & ! -------------------------------------------------------------------------------- ! regular update at all timesteps of a day CALL update_DailyState_Day( & + BaseTMethod, & + DayofWeek_id, & avkdn, &!input Temp_C, & Precip, & - BaseTHDD, & + BaseT_HC, & + BaseT_Heating, BaseT_Cooling, & nsh_real, & Tmin_id, Tmax_id, lenDay_id, &!inout - HDD_id) + HDD_id)!inout ! Update snow density, albedo surface fraction ! IF (snowUse == 1) CALL SnowUpdate( & @@ -302,6 +317,7 @@ SUBROUTINE SUEWS_cal_DailyState( & AlbMax_DecTr, AlbMax_EveTr, AlbMax_Grass, AlbMin_DecTr, AlbMin_EveTr, AlbMin_Grass, & BaseT, BaseTe, CapMax_dec, CapMin_dec, DayWat, DayWatPer, Faut, GDDFull, & Ie_a, Ie_m, LAIMax, LAIMin, LAIPower, lat, PorMax_dec, PorMin_dec, SDDFull, LAI_obs, & + state_id, soilstore_id, SoilStoreCap, H_maintain, &!input GDD_id, SDD_id, & !inout HDD_id, & LAI_id, & @@ -344,6 +360,7 @@ SUBROUTINE update_DailyState_End( & AlbMax_DecTr, AlbMax_EveTr, AlbMax_Grass, AlbMin_DecTr, AlbMin_EveTr, AlbMin_Grass, & BaseT, BaseTe, CapMax_dec, CapMin_dec, DayWat, DayWatPer, Faut, GDDFull, & Ie_a, Ie_m, LAIMax, LAIMin, LAIPower, lat, PorMax_dec, PorMin_dec, SDDFull, LAI_obs, & + state_id, soilstore_id, SoilStoreCap, H_maintain, &!input GDD_id, SDD_id, & !inout HDD_id, & LAI_id, & @@ -395,6 +412,10 @@ SUBROUTINE update_DailyState_End( & REAL(KIND(1d0)), INTENT(IN)::Tmin_id REAL(KIND(1d0)), INTENT(IN)::Tmax_id REAL(KIND(1d0)), INTENT(IN)::lenDay_id + REAL(KIND(1d0)), INTENT(IN)::H_maintain ! ponding water depth to maintain + REAL(KIND(1d0)), DIMENSION(nsurf), INTENT(IN)::state_id ! surface wetness [mm] + REAL(KIND(1d0)), DIMENSION(nsurf), INTENT(IN)::soilstore_id ! soil water store [mm] + REAL(KIND(1d0)), DIMENSION(nsurf), INTENT(in)::SoilStoreCap!Capacity of soil store for each surface [mm] REAL(KIND(1d0)), DIMENSION(3), INTENT(INOUT) ::GDD_id ! Growing Degree Days (see SUEWS_DailyState.f95) REAL(KIND(1d0)), DIMENSION(3), INTENT(INOUT) ::SDD_id ! Senescence Degree Days (see SUEWS_DailyState.f95) @@ -415,22 +436,15 @@ SUBROUTINE update_DailyState_End( & REAL(KIND(1d0)), DIMENSION(6, nsurf), INTENT(inout)::StoreDrainPrm - ! CALL update_HDD(& - ! id,it,imin,tstep,& !input - ! HDD) !inout - + ! Calculate heating degree days ------------------------------------------ CALL update_HDD( & dt_since_start, it, imin, tstep, & !input HDD_id)!inout ! Calculate modelled daily water use ------------------------------------------ - ! CALL update_WaterUse(& - ! id,WaterUseMethod,DayofWeek_id,lat,Faut,HDD_id,&!input - ! Ie_a,Ie_m,Ie_start,Ie_end,DayWatPer,DayWat,& - ! WUDay) !inout - CALL update_WaterUse( & id, WaterUseMethod, DayofWeek_id, lat, Faut, HDD_id, &!input + state_id, soilstore_id, SoilStoreCap, H_maintain, &!input Ie_a, Ie_m, Ie_start, Ie_end, DayWatPer, DayWat, & WUDay_id) !output @@ -445,17 +459,7 @@ SUBROUTINE update_DailyState_End( & ! save initial LAI_id LAI_id_in = LAI_id - ! CALL update_GDDLAI( & - ! id, LAICalcYes, & !input - ! lat, LAI_obs, & - ! BaseT, BaseTe, & - ! GDDFull, SDDFull, & - ! LAIMin, LAIMax, LAIPower, LAIType, & - ! LAI_id_in, & - ! GDD_id, &!inout - ! LAI_id) !output - - CALL update_GDDLAI_x( & + CALL update_GDDLAI( & id, LAICalcYes, & !input lat, LAI_obs, & Tmin_id, Tmax_id, lenDay_id, & @@ -490,21 +494,28 @@ SUBROUTINE update_DailyState_End( & END SUBROUTINE update_DailyState_End SUBROUTINE update_DailyState_Day( & + BaseTMethod, & + DayofWeek_id, & avkdn, &!input Temp_C, & Precip, & - BaseTHDD, & + BaseT_HC, & + BaseT_Heating, BaseT_Cooling, & nsh_real, & Tmin_id, Tmax_id, lenDay_id, &!inout HDD_id)!inout ! use time, only: id, id_prev_t IMPLICIT NONE - ! INTEGER,INTENT(IN)::id + INTEGER, INTENT(IN)::BaseTMethod + INTEGER, DIMENSION(3), INTENT(in)::DayofWeek_id + REAL(KIND(1d0)), INTENT(IN)::avkdn REAL(KIND(1d0)), INTENT(IN)::Temp_C REAL(KIND(1d0)), INTENT(IN)::Precip - REAL(KIND(1d0)), INTENT(IN)::BaseTHDD + REAL(KIND(1d0)), INTENT(IN)::BaseT_HC + REAL(KIND(1d0)), DIMENSION(2), INTENT(IN)::BaseT_Heating + REAL(KIND(1d0)), DIMENSION(2), INTENT(IN)::BaseT_Cooling REAL(KIND(1d0)), INTENT(IN)::nsh_real REAL(KIND(1d0)), INTENT(INOUT)::Tmin_id REAL(KIND(1d0)), INTENT(INOUT)::Tmax_id @@ -518,9 +529,30 @@ SUBROUTINE update_DailyState_Day( & ! REAL(KIND(1d0)), DIMENSION(5), INTENT(INOUT):: GDD_id !Growing Degree Days (see SUEWS_DailyState.f95) REAL(KIND(1d0)), DIMENSION(12), INTENT(INOUT):: HDD_id !Heating Degree Days (see SUEWS_DailyState.f95) ! REAL(KIND(1d0)),DIMENSION(5),INTENT(OUT):: GDD_id_prev !Growing Degree Days (see SUEWS_DailyState.f95) + INTEGER:: iu ! flag for weekday/weekend + + REAL(KIND(1d0))::dT_heating + REAL(KIND(1d0))::dT_cooling + + REAL(KIND(1d0))::BaseT_Heating_use + REAL(KIND(1d0))::BaseT_Cooling_use - INTEGER::gamma1 - INTEGER::gamma2 + ! Set weekday/weekend counter + iu = 1 !Set to 1=weekday + IF (DayofWeek_id(1) == 1 .OR. DayofWeek_id(1) == 7) iu = 2 !Set to 2=weekend + + select case (BaseTMethod) + case (1) + BaseT_Heating_use = BaseT_HC + BaseT_Cooling_use = BaseT_HC + case (2) + BaseT_Heating_use = BaseT_Heating(iu) + BaseT_Cooling_use = BaseT_Cooling(iu) + + case default + call ErrorHint(75, "RunControl.nml", -999, -999, -999) + + end select ! Daily min and max temp (these get updated through the day) --------------------- Tmin_id = MIN(Temp_C, Tmin_id) !Daily min T in column 3 @@ -531,18 +563,11 @@ SUBROUTINE update_DailyState_Day( & ! Calculations related to heating and cooling degree days (HDD) ------------------ ! See Sailor & Vasireddy (2006) EMS Eq 1,2 (theirs is hourly timestep) - gamma1 = MERGE(1, 0, (BaseTHDD - Temp_C) >= 0) - gamma2 = MERGE(1, 0, (Temp_C - BaseTHDD) >= 0) - - ! HDD(id,1)=HDD(id,1) + gamma1*(BaseTHDD-Temp_C) !Heating - ! HDD(id,2)=HDD(id,2) + gamma2*(Temp_C-BaseTHDD) !Cooling - ! HDD(id,3)=HDD(id,3) + Temp_C !Will become daily average temperature - ! ! 4 ------------------------------------! !5-day running mean - ! HDD(id,5)=HDD(id,5) + Precip !Daily precip total - ! 6 ------------------------------------! !Days since rain + dT_heating = BaseT_Heating_use - Temp_C + dT_cooling = Temp_C - BaseT_Cooling_use - HDD_id(1) = HDD_id(1) + gamma1*(BaseTHDD - Temp_C) !Heating - HDD_id(2) = HDD_id(2) + gamma2*(Temp_C - BaseTHDD) !Cooling + HDD_id(1) = HDD_id(1) + MERGE(dT_heating, 0d0, dT_heating >= 0) !Heating + HDD_id(2) = HDD_id(2) + MERGE(dT_cooling, 0d0, dT_cooling >= 0) !Cooling HDD_id(3) = HDD_id(3) + Temp_C !Will become daily average temperature ! 4 ------------------------------------! !5-day running mean HDD_id(5) = HDD_id(5) + Precip !Daily precip total @@ -657,169 +682,6 @@ SUBROUTINE update_Veg( & END SUBROUTINE update_Veg SUBROUTINE update_GDDLAI( & - id, LAICalcYes, & !input - lat, LAI_obs, & - BaseT, BaseTe, & - GDDFull, SDDFull, & - LAIMin, LAIMax, LAIPower, LAIType, & - LAI_id_prev, & - GDD_id, &!inout - LAI_id_next) !output - IMPLICIT NONE - - !------------------------------------------------------------------------------ - ! Calculation of LAI from growing degree days - ! This was revised and checked on 16 Feb 2014 by LJ - !------------------------------------------------------------------------------ - - INTEGER, INTENT(IN)::id - INTEGER, INTENT(IN)::LAICalcYes - - REAL(KIND(1d0)), INTENT(IN)::lat - REAL(KIND(1d0)), INTENT(IN)::LAI_obs - - ! --- Vegetation phenology --------------------------------------------------------------------- - ! Parameters provided in input information for each vegetation surface (SUEWS_Veg.txt) - REAL(KIND(1d0)), DIMENSION(nvegsurf), INTENT(IN) :: BaseT !Base temperature for growing degree days [degC] - REAL(KIND(1d0)), DIMENSION(nvegsurf), INTENT(IN) :: BaseTe !Base temperature for senescence degree days [degC] - REAL(KIND(1d0)), DIMENSION(nvegsurf), INTENT(IN) :: GDDFull !Growing degree days needed for full capacity [degC] - REAL(KIND(1d0)), DIMENSION(nvegsurf), INTENT(IN) :: SDDFull !Senescence degree days needed to initiate leaf off [degC] - REAL(KIND(1d0)), DIMENSION(nvegsurf), INTENT(IN) :: LAIMin !Min LAI [m2 m-2] - REAL(KIND(1d0)), DIMENSION(nvegsurf), INTENT(IN) :: LAIMax !Max LAI [m2 m-2] - REAL(KIND(1d0)), DIMENSION(4, nvegsurf), INTENT(IN):: LAIPower !Coeffs for LAI equation: 1,2 - leaf growth; 3,4 - leaf off - !! N.B. currently DecTr only, although input provided for all veg types - INTEGER, DIMENSION(nvegsurf), INTENT(IN):: LAIType !LAI equation to use: original (0) or new (1) - - REAL(KIND(1d0)), DIMENSION(5), INTENT(INOUT) :: GDD_id !Growing Degree Days (see SUEWS_DailyState.f95) - REAL(KIND(1d0)), DIMENSION(nvegsurf), INTENT(OUT):: LAI_id_next !LAI for each veg surface [m2 m-2] - REAL(KIND(1d0)), DIMENSION(nvegsurf), INTENT(IN)::LAI_id_prev ! LAI of previous day - - REAL(KIND(1d0)):: no !Switches and checks for GDD - REAL(KIND(1d0))::yes !Switches and checks for GDD - REAL(KIND(1d0))::indHelp !Switches and checks for GDD - REAL(KIND(1d0)), DIMENSION(5)::GDD_id_prev ! GDD of previous day - - INTEGER:: critDays - INTEGER::iv - - ! translate values of previous day to local variables - GDD_id_prev = GDD_id - ! LAI_id_prev = LAI_id_next - - critDays = 50 !Critical limit for GDD when GDD or SDD is set to zero - - ! Loop through vegetation types (iv) - DO iv = 1, NVegSurf - ! Calculate GDD for each day from the minimum and maximum air temperature - yes = ((GDD_id_prev(3) + GDD_id_prev(4))/2 - BaseT(iv)) !Leaf on - no = ((GDD_id_prev(3) + GDD_id_prev(4))/2 - BaseTe(iv)) !Leaf off - - indHelp = 0 !Help switch to allow GDD to go to zero in sprint-time !! QUESTION: What does this mean? HCW - - IF (yes < 0) THEN !GDD cannot be negative - indHelp = yes !Amount of negative GDD - yes = 0 - ENDIF - - IF (no > 0) no = 0 !SDD cannot be positive - - ! Calculate cumulative growing and senescence degree days - GDD_id(1) = GDD_id_prev(1) + yes - GDD_id(2) = GDD_id_prev(2) + no - - ! Possibility for cold spring - IF (GDD_id(2) <= SDDFull(iv) .AND. indHelp < 0) THEN - GDD_id(1) = 0 - ENDIF - - IF (GDD_id(1) >= GDDFull(iv)) THEN !Start senescence - GDD_id(1) = GDDFull(iv) !Leaves should not grow so delete yes from earlier - IF (GDD_id(2) < -critDays) GDD_id(1) = 0 - ENDIF - - IF (GDD_id(2) <= SDDFull(iv)) THEN !After senescence now start growing leaves - GDD_id(2) = SDDFull(iv) !Leaves off so add back earlier - IF (GDD_id(1) > critDays) GDD_id(2) = 0 - ENDIF - - ! With these limits SDD, GDD is set to zero - IF (GDD_id(2) < -critDays .AND. GDD_id(2) > SDDFull(iv)) GDD_id(1) = 0 - IF (GDD_id(1) > critDays .AND. GDD_id(1) < GDDFull(iv)) GDD_id(2) = 0 - - ! Now calculate LAI itself - IF (lat >= 0) THEN !Northern hemispere - !If SDD is not zero by mid May, this is forced - IF (id == 140 .AND. GDD_id(2) /= 0) GDD_id(2) = 0 - ! Set SDD to zero in summer time - IF (GDD_id(1) > critDays .AND. id < 170) GDD_id(2) = 0 - ! Set GDD zero in winter time - IF (GDD_id(2) < -critDays .AND. id > 170) GDD_id(1) = 0 - - IF (LAItype(iv) < 0.5) THEN !Original LAI type - IF (GDD_id(1) > 0 .AND. GDD_id(1) < GDDFull(iv)) THEN !Leaves can still grow - LAI_id_next(iv) = (LAI_id_prev(iv)**LAIPower(1, iv)*GDD_id(1)*LAIPower(2, iv)) + LAI_id_prev(iv) - ELSEIF (GDD_id(2) < 0 .AND. GDD_id(2) > SDDFull(iv)) THEN !Start senescence - LAI_id_next(iv) = (LAI_id_prev(iv)**LAIPower(3, iv)*GDD_id(2)*LAIPower(4, iv)) + LAI_id_prev(iv) - ELSE - LAI_id_next(iv) = LAI_id_prev(iv) - ENDIF - ELSEIF (LAItype(iv) >= 0.5) THEN - IF (GDD_id(1) > 0 .AND. GDD_id(1) < GDDFull(iv)) THEN !Leaves can still grow - LAI_id_next(iv) = (LAI_id_prev(iv)**LAIPower(1, iv)*GDD_id(1)*LAIPower(2, iv)) + LAI_id_prev(iv) - !! Use day length to start senescence at high latitudes (N hemisphere) - ELSEIF (GDD_id(5) <= 12 .AND. GDD_id(2) > SDDFull(iv)) THEN !Start senescence - LAI_id_next(iv) = (LAI_id_prev(iv)*LAIPower(3, iv)*(1 - GDD_id(2))*LAIPower(4, iv)) + LAI_id_prev(iv) - ELSE - LAI_id_next(iv) = LAI_id_prev(iv) - ENDIF - ENDIF - - ELSEIF (lat < 0) THEN !Southern hemisphere !! N.B. not identical to N hemisphere - return to later - !If SDD is not zero by late Oct, this is forced - IF (id == 300 .AND. GDD_id(2) /= 0) GDD_id(2) = 0 - ! Set SDD to zero in summer time - IF (GDD_id(1) > critDays .AND. id > 250) GDD_id(2) = 0 - ! Set GDD zero in winter time - IF (GDD_id(2) < -critDays .AND. id < 250) GDD_id(1) = 0 - - IF (LAItype(iv) < 0.5) THEN !Original LAI type - IF (GDD_id(1) > 0 .AND. GDD_id(1) < GDDFull(iv)) THEN - LAI_id_next(iv) = (LAI_id_prev(iv)**LAIPower(1, iv)*GDD_id(1)*LAIPower(2, iv)) + LAI_id_prev(iv) - ELSEIF (GDD_id(2) < 0 .AND. GDD_id(2) > SDDFull(iv)) THEN - LAI_id_next(iv) = (LAI_id_prev(iv)**LAIPower(3, iv)*GDD_id(2)*LAIPower(4, iv)) + LAI_id_prev(iv) - ELSE - LAI_id_next(iv) = LAI_id_prev(iv) - ENDIF - ELSE - IF (GDD_id(1) > 0 .AND. GDD_id(1) < GDDFull(iv)) THEN - LAI_id_next(iv) = (LAI_id_prev(iv)**LAIPower(1, iv)*GDD_id(1)*LAIPower(2, iv)) + LAI_id_prev(iv) - !! Day length not used to start senescence in S hemisphere (not much land) - ELSEIF (GDD_id(2) < 0 .AND. GDD_id(2) > SDDFull(iv)) THEN - LAI_id_next(iv) = (LAI_id_prev(iv)*LAIPower(3, iv)*(1 - GDD_id(2))*LAIPower(4, iv)) + LAI_id_prev(iv) - ELSE - LAI_id_next(iv) = LAI_id_prev(iv) - ENDIF - ENDIF - ENDIF !N or S hemisphere - - ! Check LAI within limits; if not set to limiting value - IF (LAI_id_next(iv) > LAImax(iv)) THEN - LAI_id_next(iv) = LAImax(iv) - ELSEIF (LAI_id_next(iv) < LAImin(iv)) THEN - LAI_id_next(iv) = LAImin(iv) - ENDIF - - ENDDO !End of loop over veg surfaces - - IF (LAICalcYes == 0) THEN ! moved to SUEWS_cal_DailyState, TS 18 Sep 2017 - ! LAI(id-1,:)=LAI_obs ! check -- this is going to be a problem as it is not for each vegetation class - LAI_id_next = LAI_obs - ENDIF - !------------------------------------------------------------------------------ - - END SUBROUTINE update_GDDLAI - - SUBROUTINE update_GDDLAI_x( & id, LAICalcYes, & !input lat, LAI_obs, & Tmin_id_prev, Tmax_id_prev, lenDay_id_prev, & @@ -987,10 +849,11 @@ SUBROUTINE update_GDDLAI_x( & ENDIF !------------------------------------------------------------------------------ - END SUBROUTINE update_GDDLAI_x + END SUBROUTINE update_GDDLAI SUBROUTINE update_WaterUse( & id, WaterUseMethod, DayofWeek_id, lat, FrIrriAuto, HDD_id, &!input + state_id, soilstore_id, SoilStoreCap, H_maintain, &!input Ie_a, Ie_m, Ie_start, Ie_end, DayWatPer, DayWat, & WUDay_id) !output @@ -1006,15 +869,29 @@ SUBROUTINE update_WaterUse( & REAL(KIND(1d0)), INTENT(IN)::FrIrriAuto !Fraction of irrigated area using automatic irrigation REAL(KIND(1d0)), DIMENSION(12), INTENT(IN)::HDD_id - REAL(KIND(1d0)), DIMENSION(3), INTENT(IN)::Ie_a - REAL(KIND(1d0)), DIMENSION(3), INTENT(IN)::Ie_m !Coefficients for automatic and manual irrigation models - REAL(KIND(1d0)), DIMENSION(7), INTENT(IN)::DayWatPer !% of houses following daily water - REAL(KIND(1d0)), DIMENSION(7), INTENT(IN)::DayWat !Days of watering allowed + REAL(KIND(1d0)), DIMENSION(NVegSurf), INTENT(IN)::Ie_a !Coefficients for automatic irrigation models + REAL(KIND(1d0)), DIMENSION(NVegSurf), INTENT(IN)::Ie_m !Coefficients for manual irrigation models + REAL(KIND(1d0)), DIMENSION(nsurf), INTENT(IN)::DayWatPer !% of houses following daily water + REAL(KIND(1d0)), DIMENSION(nsurf), INTENT(IN)::DayWat !Days of watering allowed + + ! ponding control related + REAL(KIND(1d0)), DIMENSION(nsurf), INTENT(IN)::state_id ! surface wetness [mm] + REAL(KIND(1d0)), DIMENSION(nsurf), INTENT(IN)::soilstore_id ! soil water store [mm] + REAL(KIND(1d0)), DIMENSION(nsurf), INTENT(in)::SoilStoreCap!Capacity of soil store for each surface [mm] + REAL(KIND(1d0)), INTENT(IN)::H_maintain ! ponding water depth to maintain [mm] REAL(KIND(1d0)), DIMENSION(9), INTENT(OUT):: WUDay_id !Daily water use for EveTr, DecTr, Grass [mm] (see SUEWS_DailyState.f95) + REAL(KIND(1d0)), DIMENSION(3)::h_need !water level to maintain: surface+soil [mm] + REAL(KIND(1d0)), DIMENSION(3)::store_total !current water level: surface+soil [mm] + REAL(KIND(1d0)), DIMENSION(3)::WUDay_P !water used to maintain ponding level [mm] + REAL(KIND(1d0)), DIMENSION(3)::WUDay_A !automatic irrigation [mm] + REAL(KIND(1d0)), DIMENSION(3)::WUDay_M !manual irrigation [mm] + REAL(KIND(1d0)), DIMENSION(3)::WUDay_total !Coefficients for manual irrigation models + INTEGER::wd !Water use calculation is done when calc = 1 INTEGER::calc !Water use calculation is done when calc = 1 + INTEGER::i REAL(KIND(1d0))::temp_avg REAL(KIND(1d0))::days_since_rain @@ -1044,49 +921,33 @@ SUBROUTINE update_WaterUse( & ! WUDay is the amount of water [mm] per day, applied to each of the irrigated areas ! N.B. These are the same for each vegetation type at the moment - ! ---- Automatic irrigation (evergreen trees) ---- - WUDay_id(2) = FrIrriAuto*(Ie_a(1) + Ie_a(2)*temp_avg + Ie_a(3)*days_since_rain)*DayWatPer(wd) - IF (WUDay_id(2) < 0) WUDay_id(2) = 0 !If modelled WU is negative -> 0 - - ! ---- Manual irrigation (evergreen trees) ---- - WUDay_id(3) = (1 - FrIrriAuto)*(Ie_m(1) + Ie_m(2)*temp_avg + Ie_m(3)*days_since_rain)*DayWatPer(wd) - IF (WUDay_id(3) < 0) WUDay_id(3) = 0 !If modelled WU is negative -> 0 - - ! ---- Total evergreen trees water use (automatic + manual) ---- - WUDay_id(1) = (WUDay_id(2) + WUDay_id(3)) - - ! ---- Automatic irrigation (deciduous trees) ---- - WUDay_id(5) = FrIrriAuto*(Ie_a(1) + Ie_a(2)*temp_avg + Ie_a(3)*days_since_rain)*DayWatPer(wd) - IF (WUDay_id(5) < 0) WUDay_id(5) = 0 !If modelled WU is negative -> 0 - - ! ---- Manual irrigation (deciduous trees) ---- - WUDay_id(6) = (1 - FrIrriAuto)*(Ie_m(1) + Ie_m(2)*temp_avg + Ie_m(3)*days_since_rain)*DayWatPer(wd) - IF (WUDay_id(6) < 0) WUDay_id(6) = 0 !If modelled WU is negative -> 0 + ! ---- irrigation amount to maintain a certain water availability---- + ! NB: H_maintain can be either positive or negative + h_need = SoilStoreCap(3:5) + H_maintain + store_total = state_id(3:5) + soilstore_id(3:5) + WUDay_P = h_need - store_total + WUDay_P = MERGE(WUDay_P, 0d0, WUDay_P > 0) - ! ---- Total deciduous trees water use (automatic + manual) ---- - WUDay_id(4) = (WUDay_id(5) + WUDay_id(6)) + ! ---- automatic irrigation ---- + WUDay_A = FrIrriAuto*(Ie_a(1) + Ie_a(2)*temp_avg + Ie_a(3)*days_since_rain)*DayWatPer(wd) + WUDay_A = MERGE(WUDay_A, 0d0, WUDay_A > 0) + ! add ponding-demand to auto-irrigation + WUDay_A = WUDay_A + WUDay_P - ! ---- Automatic irrigation (grass) ---- - WUDay_id(8) = FrIrriAuto*(Ie_a(1) + Ie_a(2)*temp_avg + Ie_a(3)*days_since_rain)*DayWatPer(wd) - IF (WUDay_id(8) < 0) WUDay_id(8) = 0 !If modelled WU is negative -> 0 + ! ---- Manual irrigation---- + WUDay_M = (1 - FrIrriAuto)*(Ie_m(1) + Ie_m(2)*temp_avg + Ie_m(3)*days_since_rain)*DayWatPer(wd) + WUDay_M = MERGE(WUDay_M, 0d0, WUDay_M > 0) - ! ---- Manual irrigation (grass) ---- - WUDay_id(9) = (1 - FrIrriAuto)*(Ie_m(1) + Ie_m(2)*temp_avg + Ie_m(3)*days_since_rain)*DayWatPer(wd) - IF (WUDay_id(9) < 0) WUDay_id(9) = 0 !If modelled WU is negative -> 0 + ! ---- total irrigation + WUDay_total = WUDay_P + WUDay_A + WUDay_M - ! ---- Total grass water use (automatic + manual) ---- - WUDay_id(7) = (WUDay_id(8) + WUDay_id(9)) + ! transfer values to WUDay_id + WUDay_id([((i - 1)*3 + 1, i=1, 3)]) = WUDay_total + WUDay_id([((i - 1)*3 + 2, i=1, 3)]) = WUDay_A + WUDay_id([((i - 1)*3 + 3, i=1, 3)]) = WUDay_M ELSE !If no irrigation on this day - WUDay_id(1) = 0 - WUDay_id(2) = 0 - WUDay_id(3) = 0 - WUDay_id(4) = 0 - WUDay_id(5) = 0 - WUDay_id(6) = 0 - WUDay_id(7) = 0 - WUDay_id(8) = 0 - WUDay_id(9) = 0 + WUDay_id = 0 ENDIF ENDIF ENDIF @@ -1105,7 +966,7 @@ SUBROUTINE update_HDD( & INTEGER:: days_prev REAL(KIND(1d0))::tstepcount - ! count of timesteps performed during day `id` + ! count of timesteps performed during day tstepcount = (it*60 + imin)*60/tstep*1. ! Heating degree days (HDD) ------------- HDD_id(1) = HDD_id(1)/tstepcount !Heating diff --git a/SUEWS-SourceCode/suews_phys_rslprof.f95 b/SUEWS-SourceCode/suews_phys_rslprof.f95 index 7a530f6fb..605edd3ac 100644 --- a/SUEWS-SourceCode/suews_phys_rslprof.f95 +++ b/SUEWS-SourceCode/suews_phys_rslprof.f95 @@ -11,7 +11,7 @@ module rsl_module SUBROUTINE RSLProfile( & Zh, z0m, zdm, & - L_MOD, sfr, planF, StabilityMethod, & + L_MOD, sfr, FAI, StabilityMethod, & avcp, lv_J_kg, avdens, & avU1, Temp_C, avRH, Press_hPa, zMeas, qh, qe, & ! input T2_C, q2_gkg, U10_ms, RH2, &!output @@ -23,6 +23,7 @@ SUBROUTINE RSLProfile( & ! last modified by: ! NT 16 Mar 2019: initial version ! TS 16 Oct 2019: improved consistency in parameters/varaibles within SUEWS + ! TODO how to improve the speed of this code ! !----------------------------------------------------- @@ -43,7 +44,7 @@ SUBROUTINE RSLProfile( & REAL(KIND(1d0)), INTENT(in):: Zh ! Mean building height [m] REAL(KIND(1d0)), INTENT(in):: z0m ! Mean building height [m] REAL(KIND(1d0)), INTENT(in):: zdm ! Mean building height [m] - REAL(KIND(1d0)), INTENT(in):: planF ! Frontal area index [-] + REAL(KIND(1d0)), INTENT(in):: FAI ! Frontal area index [-] INTEGER, INTENT(in)::StabilityMethod @@ -112,7 +113,7 @@ SUBROUTINE RSLProfile( & call RSL_cal_prms( & Zh_min, & z0m, zdm, & - StabilityMethod, zh, L_MOD, sfr, planF, &!input + StabilityMethod, zh, L_MOD, sfr, FAI, &!input L_MOD_RSL, zH_RSL, Lc, beta, zd, z0, elm, Scc, f) ! Define the height array with consideration of key heights diff --git a/SUEWS-SourceCode/suews_phys_waterdist.f95 b/SUEWS-SourceCode/suews_phys_waterdist.f95 index 5e0f6e4c8..ca9983f9a 100644 --- a/SUEWS-SourceCode/suews_phys_waterdist.f95 +++ b/SUEWS-SourceCode/suews_phys_waterdist.f95 @@ -858,7 +858,9 @@ END SUBROUTINE SUEWS_cal_HorizontalSoilWater SUBROUTINE SUEWS_cal_WaterUse( & nsh_real, & ! input: wu_m3, SurfaceArea, sfr, & - IrrFracConif, IrrFracDecid, IrrFracGrass, & + IrrFracPaved, IrrFracBldgs, & + IrrFracEveTr, IrrFracDecTr, IrrFracGrass, & + IrrFracBSoil, IrrFracWater, & DayofWeek_id, WUProfA_24hr, WUProfM_24hr, & InternalWaterUse_h, HDD_id, WUDay_id, & WaterUseMethod, NSH, it, imin, DLS, & @@ -886,9 +888,13 @@ SUBROUTINE SUEWS_cal_WaterUse( & REAL(KIND(1d0)), INTENT(in)::nsh_real REAL(KIND(1d0)), INTENT(in)::wu_m3 ! external water input (e.g., irrigation) [m3] REAL(KIND(1d0)), INTENT(in)::SurfaceArea !Surface area of the study area [m2] - REAL(KIND(1d0)), INTENT(in)::IrrFracConif!Fraction of evergreen trees which are irrigated - REAL(KIND(1d0)), INTENT(in)::IrrFracDecid!Fraction of deciduous trees which are irrigated - REAL(KIND(1d0)), INTENT(in)::IrrFracGrass!Fraction of grass which is irrigated + REAL(KIND(1D0)), INTENT(IN)::IrrFracPaved!Fraction of paved which are irrigated + REAL(KIND(1D0)), INTENT(IN)::IrrFracBldgs!Fraction of buildings (e.g., green roofs) which are irrigated + REAL(KIND(1D0)), INTENT(IN)::IrrFracEveTr!Fraction of evergreen trees which are irrigated + REAL(KIND(1D0)), INTENT(IN)::IrrFracDecTr!Fraction of deciduous trees which are irrigated + REAL(KIND(1D0)), INTENT(IN)::IrrFracGrass!Fraction of grass which is irrigated + REAL(KIND(1D0)), INTENT(IN)::IrrFracBSoil!Fraction of bare soil trees which are irrigated + REAL(KIND(1D0)), INTENT(IN)::IrrFracWater!Fraction of water which are irrigated REAL(KIND(1d0)), INTENT(in)::InternalWaterUse_h !Internal water use [mm h-1] REAL(KIND(1d0)), DIMENSION(0:23, 2), INTENT(in)::WUProfA_24hr !Automatic water use profiles at hourly scales REAL(KIND(1d0)), DIMENSION(0:23, 2), INTENT(in)::WUProfM_24hr !Manual water use profiles at hourly scales @@ -951,18 +957,24 @@ SUBROUTINE SUEWS_cal_WaterUse( & ! Irrigated Fraction of each surface ! TS: as of 20191130, assuming irrigation fraction as ONE except for vegetated surfaces - IrrFrac = 1 - IrrFrac(ConifSurf) = IrrFracConif - IrrFrac(DecidSurf) = IrrFracDecid - IrrFrac(GrassSurf) = IrrFracGrass + ! IrrFrac = 1 + ! IrrFrac(ConifSurf) = IrrFracEveTr + ! IrrFrac(DecidSurf) = IrrFracDecTr + ! IrrFrac(GrassSurf) = IrrFracGrass + + ! Irrigated Fraction of each surface + ! TS: 20200409, add irrigation fractions for all surfaces + IrrFrac = [IrrFracPaved, IrrFracBldgs, & + IrrFracEveTr, IrrFracDecTr, IrrFracGrass, & + IrrFracBSoil, IrrFracWater] ! -------------------------------------------------------------------------------- ! If water used is observed and provided in the met forcing file, units are m3 ! Divide observed water use (in m3) by water use area to find water use (in mm) IF (WaterUseMethod == 1) THEN !If water use is observed ! Calculate water use area [m2] for each surface type - ! WUAreaEveTr_m2 = IrrFracConif*sfr(ConifSurf)*SurfaceArea - ! WUAreaDecTr_m2 = IrrFracDecid*sfr(DecidSurf)*SurfaceArea + ! WUAreaEveTr_m2 = IrrFracEveTr*sfr(ConifSurf)*SurfaceArea + ! WUAreaDecTr_m2 = IrrFracDecTr*sfr(DecidSurf)*SurfaceArea ! WUAreaGrass_m2 = IrrFracGrass*sfr(GrassSurf)*SurfaceArea ! WUAreaTotal_m2 = WUAreaEveTr_m2 + WUAreaDecTr_m2 + WUAreaGrass_m2 @@ -983,11 +995,11 @@ SUBROUTINE SUEWS_cal_WaterUse( & wu = (wu_m3/WUAreaTotal_m2*1000) !Water use in mm for the whole irrigated area ! IF (WUAreaEveTr_m2 > 0) THEN ! wu_EveTr = wu !Water use for Irr EveTr in mm - these are all the same at the moment - ! wu_EveTr = wu_EveTr*IrrFracConif !Water use for EveTr in mm + ! wu_EveTr = wu_EveTr*IrrFracEveTr !Water use for EveTr in mm ! ENDIF ! IF (WUAreaDecTr_m2 > 0) THEN ! wu_DecTr = wu !Water use for Irr DecTr in mm - these are all the same at the moment - ! wu_DecTr = wu_DecTr*IrrFracDecid !Water use for DecTr in mm + ! wu_DecTr = wu_DecTr*IrrFracDecTr !Water use for DecTr in mm ! ENDIF ! IF (WUAreaGrass_m2 > 0) THEN ! wu_Grass = wu !Water use for Irr Grass in mm - these are all the same at the moment @@ -1035,7 +1047,6 @@ SUBROUTINE SUEWS_cal_WaterUse( & ! wu_DecTr = get_Prof_SpecTime_sum(ih, imin, 0, WUProfA_24hr(:, iu), tstep)*WUDay_id(5) !Automatic deciduous trees ! wu_Grass = get_Prof_SpecTime_sum(ih, imin, 0, WUProfA_24hr(:, iu), tstep)*WUDay_id(8) !Automatic grass - wu_nsurf = WUProfA_tstep*WUDay_A_id ! PRINT*, '' ! PRINT*, 'WUDay_id(2) ',WUDay_id(2) ! PRINT*, 'profile ',get_Prof_SpecTime_sum(ih,imin,0,WUProfA_24hr(:,iu),tstep) @@ -1056,11 +1067,10 @@ SUBROUTINE SUEWS_cal_WaterUse( & ! wu_DecTr = wu_DecTr + (WuFr*WUProfM_tstep((NSH*(ih+1-1)+imin*NSH/60+1),iu)*WUDay_id(6)) !Manual deciduous trees ! wu_Grass = wu_Grass + (WuFr*WUProfM_tstep((NSH*(ih+1-1)+imin*NSH/60+1),iu)*WUDay_id(9)) !Manual grass WUProfM_tstep = get_Prof_SpecTime_sum(ih, imin, 0, WUProfM_24hr(:, iu), tstep) - ! wu_EveTr = wu_EveTr + (get_Prof_SpecTime_sum(ih, imin, 0, WUProfM_24hr(:, iu), tstep)*flag_WuM*WUDay_id(3)) !Manual evergreen trees - ! wu_DecTr = wu_DecTr + (get_Prof_SpecTime_sum(ih, imin, 0, WUProfM_24hr(:, iu), tstep)*flag_WuM*WUDay_id(6)) !Manual deciduous trees - ! wu_Grass = wu_Grass + (get_Prof_SpecTime_sum(ih, imin, 0, WUProfM_24hr(:, iu), tstep)*flag_WuM*WUDay_id(9)) !Manual grass - wu_nsurf = wu_nsurf + WUProfM_tstep*WUDay_M_id*flag_WuM + ! sum up irrigation amount of automatic and manual approaches + wu_nsurf = WUProfA_tstep*WUDay_A_id + WUProfM_tstep*WUDay_M_id*flag_WuM + ! apply irrigation fraction: part of land covers are not irrigated wu_nsurf = wu_nsurf*IrrFrac ! PRINT*, 'auto:' @@ -1068,16 +1078,16 @@ SUBROUTINE SUEWS_cal_WaterUse( & ! PRINT*, 'wu_DecTr',wu_DecTr ! PRINT*, 'wu_Grass',wu_Grass ! Added HCW 12 Feb 2015. - !wu_EveTr=wu_EveTr*sfr(ConifSurf)*IrrFracConif !Water use for EveTr [mm] - !wu_DecTr=wu_DecTr*sfr(DecidSurf)*IrrFracDecid !Water use for DecTr [mm] + !wu_EveTr=wu_EveTr*sfr(ConifSurf)*IrrFracEveTr !Water use for EveTr [mm] + !wu_DecTr=wu_DecTr*sfr(DecidSurf)*IrrFracDecTr !Water use for DecTr [mm] !wu_Grass=wu_Grass*sfr(GrassSurf)*IrrFracGrass !Water use for Grass [mm] - ! wu_EveTr = wu_EveTr*IrrFracConif !Water use for EveTr [mm] - ! wu_DecTr = wu_DecTr*IrrFracDecid !Water use for DecTr [mm] + ! wu_EveTr = wu_EveTr*IrrFracEveTr !Water use for EveTr [mm] + ! wu_DecTr = wu_DecTr*IrrFracDecTr !Water use for DecTr [mm] ! wu_Grass = wu_Grass*IrrFracGrass !Water use for Grass [mm] ! PRINT*, 'auto:' - ! PRINT*, 'IrrFracConif',IrrFracConif - ! PRINT*, 'IrrFracDecid',IrrFracDecid + ! PRINT*, 'IrrFracEveTr',IrrFracEveTr + ! PRINT*, 'IrrFracDecTr',IrrFracDecTr ! PRINT*, 'IrrFracGrass',IrrFracGrass ! Total water use for the whole study area [mm] diff --git a/Test/BaseRun/2020a/Input/SUEWS_AnthropogenicEmission.txt b/Test/BaseRun/2020a/Input/SUEWS_AnthropogenicEmission.txt index a9cc01f2f..ec6f1c7f9 100644 --- a/Test/BaseRun/2020a/Input/SUEWS_AnthropogenicEmission.txt +++ b/Test/BaseRun/2020a/Input/SUEWS_AnthropogenicEmission.txt @@ -1,5 +1,5 @@ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 -Code BaseTHDD QF_A_WD QF_B_WD QF_C_WD QF_A_WE QF_B_WE QF_C_WE AHMin_WD AHMin_WE AHSlope_Heating_WD AHSlope_Heating_WE AHSlope_Cooling_WD AHSlope_Cooling_WE TCritic_Heating_WD TCritic_Heating_WE TCritic_Cooling_WD TCritic_Cooling_WE EnergyUseProfWD EnergyUseProfWE ActivityProfWD ActivityProfWE TraffProfWD TraffProfWE PopProfWD PopProfWE MinQFMetab MaxQFMetab MinFCMetab MaxFCMetab FrPDDwe FrFossilFuel_Heat FrFossilFuel_NonHeat EF_umolCO2perJ EnEF_v_Jkm FcEF_v_kgkmWD FcEF_v_kgkmWE CO2PointSource TrafficUnits +Code BaseT_HC QF_A_WD QF_B_WD QF_C_WD QF_A_WE QF_B_WE QF_C_WE AHMin_WD AHMin_WE AHSlope_Heating_WD AHSlope_Heating_WE AHSlope_Cooling_WD AHSlope_Cooling_WE TCritic_Heating_WD TCritic_Heating_WE TCritic_Cooling_WD TCritic_Cooling_WE EnergyUseProfWD EnergyUseProfWE ActivityProfWD ActivityProfWE TraffProfWD TraffProfWE PopProfWD PopProfWE MinQFMetab MaxQFMetab MinFCMetab MaxFCMetab FrPDDwe FrFossilFuel_Heat FrFossilFuel_NonHeat EF_umolCO2perJ EnEF_v_Jkm FcEF_v_kgkmWD FcEF_v_kgkmWE CO2PointSource TrafficUnits 10 18.2000 0.1000 0.0099 0.0102 0.1000 0.0099 0.0102 15.0000 15.0000 2.7000 2.7000 2.7000 2.7000 7.0000 7.0000 7.0000 7.0000 44.0000 45.0000 55663.0000 55664.0000 701.0000 702.0000 801.0000 802.0000 75.0000 175.0000 120.0000 280.0000 1.0000 0.0500 0.0000 1.1590 3970000.0000 0.2850 0.2850 0 1.0000 11 18.2000 0.3081 0.0099 0.0102 0.3081 0.0099 0.0102 -999.0000 -999.0000 -999.0000 -999.0000 -999.0000 -999.0000 -999.0000 -999.0000 -999.0000 -999.0000 44.0000 45.0000 55663.0000 55664.0000 701.0000 702.0000 801.0000 802.0000 75.0000 175.0000 120.0000 280.0000 1.0000 0.0500 0.0000 1.1590 4110000.0000 0.2850 0.2850 0 1.0000 551 18.2000 0.1446 0.0000 0.0037 0.1329 0.0000 0.0038 -999.0000 -999.0000 -999.0000 -999.0000 -999.0000 -999.0000 -999.0000 -999.0000 -999.0000 -999.0000 42.0000 43.0000 55663.0000 55664.0000 701.0000 702.0000 801.0000 802.0000 75.0000 175.0000 120.0000 280.0000 1.0000 0.7000 0.7000 1.1590 3970000.0000 0.2850 0.2850 0 1.0000 diff --git a/Test/BaseRun/2020a/Input/SUEWS_Irrigation.txt b/Test/BaseRun/2020a/Input/SUEWS_Irrigation.txt index 8cf19e183..eeb213191 100644 --- a/Test/BaseRun/2020a/Input/SUEWS_Irrigation.txt +++ b/Test/BaseRun/2020a/Input/SUEWS_Irrigation.txt @@ -1,8 +1,8 @@ -1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 -Code Ie_start Ie_end InternalWaterUse Faut Ie_a1 Ie_a2 Ie_a3 Ie_m1 Ie_m2 Ie_m3 DayWat(1) DayWat(2) DayWat(3) DayWat(4) DayWat(5) DayWat(6) DayWat(7) DayWatPer(1) DayWatPer(2) DayWatPer(3) DayWatPer(4) DayWatPer(5) DayWatPer(6) DayWatPer(7) -99999 1 366 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ! No irrigation -1 152 243 0 0.2 -84.535 9.959 3.674 -25.36 2.988 1.102 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -550 1 366 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ! Swindon "(not used, no irrigation)" -660 1 366 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ! London (assume no irrigation at the moment) +1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 +Code Ie_start Ie_end InternalWaterUse Faut H_maintain Ie_a1 Ie_a2 Ie_a3 Ie_m1 Ie_m2 Ie_m3 DayWat(1) DayWat(2) DayWat(3) DayWat(4) DayWat(5) DayWat(6) DayWat(7) DayWatPer(1) DayWatPer(2) DayWatPer(3) DayWatPer(4) DayWatPer(5) DayWatPer(6) DayWatPer(7) +99999 1 366 0 0 -999 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ! No irrigation +1 152 243 0 0.2 -999 -84.535 9.959 3.674 -25.36 2.988 1.102 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +550 1 366 0 0 -999 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ! Swindon "(not used, no irrigation)" +660 1 366 0 0 -999 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ! London (assume no irrigation at the moment) -9 -9 diff --git a/Test/BaseRun/2020a/Input/SUEWS_SiteSelect.txt b/Test/BaseRun/2020a/Input/SUEWS_SiteSelect.txt index 97246ffe3..dae111cfc 100644 --- a/Test/BaseRun/2020a/Input/SUEWS_SiteSelect.txt +++ b/Test/BaseRun/2020a/Input/SUEWS_SiteSelect.txt @@ -1,6 +1,6 @@ -1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 -Grid Year StartDLS EndDLS lat lng Timezone SurfaceArea Alt z id ih imin Fr_Paved Fr_Bldgs Fr_EveTr Fr_DecTr Fr_Grass Fr_Bsoil Fr_Water IrrFr_EveTr IrrFr_DecTr IrrFr_Grass H_Bldgs H_EveTr H_DecTr z0 zd FAI_Bldgs FAI_EveTr FAI_DecTr PopDensDay PopDensNight TrafficRate_WD TrafficRate_WE QF0_BEU_WD QF0_BEU_WE Code_Paved Code_Bldgs Code_EveTr Code_DecTr Code_Grass Code_Bsoil Code_Water LUMPS_DrRate LUMPS_Cover LUMPS_MaxRes NARP_Trans CondCode SnowCode SnowClearingProfWD SnowClearingProfWE AnthropogenicCode IrrigationCode WaterUseProfManuWD WaterUseProfManuWE WaterUseProfAutoWD WaterUseProfAutoWE FlowChange RunoffToWater PipeCapacity GridConnection1of8 Fraction1of8 GridConnection2of8 Fraction2of8 GridConnection3of8 Fraction3of8 GridConnection4of8 Fraction4of8 GridConnection5of8 Fraction5of8 GridConnection6of8 Fraction6of8 GridConnection7of8 Fraction7of8 GridConnection8of8 Fraction8of8 WithinGridPavedCode WithinGridBldgsCode WithinGridEveTrCode WithinGridDecTrCode WithinGridGrassCode WithinGridUnmanBSoilCode WithinGridWaterCode AreaWall Fr_ESTMClass_Paved1 Fr_ESTMClass_Paved2 Fr_ESTMClass_Paved3 Code_ESTMClass_Paved1 Code_ESTMClass_Paved2 Code_ESTMClass_Paved3 Fr_ESTMClass_Bldgs1 Fr_ESTMClass_Bldgs2 Fr_ESTMClass_Bldgs3 Fr_ESTMClass_Bldgs4 Fr_ESTMClass_Bldgs5 Code_ESTMClass_Bldgs1 Code_ESTMClass_Bldgs2 Code_ESTMClass_Bldgs3 Code_ESTMClass_Bldgs4 Code_ESTMClass_Bldgs5 -1 2004 85 302 57.7700 11.8700 2.0000 1.0000 15.0000 50.0000 1.0000 0.0000 0.0000 0.2000 0.2000 0.2000 0.1000 0.1000 0.1000 0.1000 0.0000 0.0000 0.0000 15.00 15.000 15.000 0.0100 0.2000 0.3000 0.3000 0.3000 0.0000 0.0000 0.0134 0.0095 0.7442 0.7955 661.0000 662.0000 661.0000 662.0000 663.0000 663.0000 661.0000 0.2500 1.0000 10.0000 1.0000 200.0000 660.0000 660.0000 660.0000 661.0000 660.0000 660.0000 660.0000 660.0000 660.0000 0.0000 0.1000 100.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 661.0000 662.0000 663.0000 664.0000 665.0000 666.0000 667.0000 -999.0000 0.0000 1.0000 0.0000 99999.0000 807.0000 99999.0000 1.0000 0.0000 0.0000 0.0000 0.0000 801.0000 99999.0000 99999.0000 99999.0000 99999.0000 -1 2005 85 302 57.7700 11.8700 2.0000 1.0000 15.0000 50.0000 1.0000 0.0000 0.0000 0.2000 0.2000 0.2000 0.1000 0.1000 0.1000 0.1000 0.0000 0.0000 0.0000 1.00 1.000 1.000 0.0100 0.2000 0.3000 0.3000 0.3000 0.0000 0.0000 0.0134 0.0095 0.7442 0.7955 661.0000 662.0000 661.0000 662.0000 663.0000 663.0000 661.0000 0.2500 1.0000 10.0000 1.0000 200.0000 660.0000 660.0000 660.0000 661.0000 660.0000 660.0000 660.0000 660.0000 660.0000 0.0000 0.1000 100.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 661.0000 662.0000 663.0000 664.0000 665.0000 666.0000 667.0000 -999.0000 0.0000 1.0000 0.0000 99999.0000 807.0000 99999.0000 1.0000 0.0000 0.0000 0.0000 0.0000 801.0000 99999.0000 99999.0000 99999.0000 99999.0000 +1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 +Grid Year StartDLS EndDLS lat lng Timezone SurfaceArea Alt z id ih imin Fr_Paved Fr_Bldgs Fr_EveTr Fr_DecTr Fr_Grass Fr_Bsoil Fr_Water IrrFr_Paved IrrFr_Bldgs IrrFr_EveTr IrrFr_DecTr IrrFr_Grass IrrFr_BSoil IrrFr_Water H_Bldgs H_EveTr H_DecTr z0 zd FAI_Bldgs FAI_EveTr FAI_DecTr PopDensDay PopDensNight TrafficRate_WD TrafficRate_WE QF0_BEU_WD QF0_BEU_WE Code_Paved Code_Bldgs Code_EveTr Code_DecTr Code_Grass Code_Bsoil Code_Water LUMPS_DrRate LUMPS_Cover LUMPS_MaxRes NARP_Trans CondCode SnowCode SnowClearingProfWD SnowClearingProfWE AnthropogenicCode IrrigationCode WaterUseProfManuWD WaterUseProfManuWE WaterUseProfAutoWD WaterUseProfAutoWE FlowChange RunoffToWater PipeCapacity GridConnection1of8 Fraction1of8 GridConnection2of8 Fraction2of8 GridConnection3of8 Fraction3of8 GridConnection4of8 Fraction4of8 GridConnection5of8 Fraction5of8 GridConnection6of8 Fraction6of8 GridConnection7of8 Fraction7of8 GridConnection8of8 Fraction8of8 WithinGridPavedCode WithinGridBldgsCode WithinGridEveTrCode WithinGridDecTrCode WithinGridGrassCode WithinGridUnmanBSoilCode WithinGridWaterCode AreaWall Fr_ESTMClass_Paved1 Fr_ESTMClass_Paved2 Fr_ESTMClass_Paved3 Code_ESTMClass_Paved1 Code_ESTMClass_Paved2 Code_ESTMClass_Paved3 Fr_ESTMClass_Bldgs1 Fr_ESTMClass_Bldgs2 Fr_ESTMClass_Bldgs3 Fr_ESTMClass_Bldgs4 Fr_ESTMClass_Bldgs5 Code_ESTMClass_Bldgs1 Code_ESTMClass_Bldgs2 Code_ESTMClass_Bldgs3 Code_ESTMClass_Bldgs4 Code_ESTMClass_Bldgs5 +1 2004 85 302 57.7700 11.8700 2.0000 1.0000 15.0000 50.0000 1.0000 0.0000 0.0000 0.2000 0.2000 0.2000 0.1000 0.1000 0.1000 0.1000 0.0 0.0 0.0000 0.0000 0.0000 0.0 0.0 15.00 15.000 15.000 0.0100 0.2000 0.3000 0.3000 0.3000 0.0000 0.0000 0.0134 0.0095 0.7442 0.7955 661.0000 662.0000 661.0000 662.0000 663.0000 663.0000 661.0000 0.2500 1.0000 10.0000 1.0000 200.0000 660.0000 660.0000 660.0000 661.0000 660.0000 660.0000 660.0000 660.0000 660.0000 0.0000 0.1000 100.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 661.0000 662.0000 663.0000 664.0000 665.0000 666.0000 667.0000 -999.0000 0.0000 1.0000 0.0000 99999.0000 807.0000 99999.0000 1.0000 0.0000 0.0000 0.0000 0.0000 801.0000 99999.0000 99999.0000 99999.0000 99999.0000 +1 2005 85 302 57.7700 11.8700 2.0000 1.0000 15.0000 50.0000 1.0000 0.0000 0.0000 0.2000 0.2000 0.2000 0.1000 0.1000 0.1000 0.1000 0.0 0.0 0.0000 0.0000 0.0000 0.0 0.0 1.00 1.000 1.000 0.0100 0.2000 0.3000 0.3000 0.3000 0.0000 0.0000 0.0134 0.0095 0.7442 0.7955 661.0000 662.0000 661.0000 662.0000 663.0000 663.0000 661.0000 0.2500 1.0000 10.0000 1.0000 200.0000 660.0000 660.0000 660.0000 661.0000 660.0000 660.0000 660.0000 660.0000 660.0000 0.0000 0.1000 100.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 661.0000 662.0000 663.0000 664.0000 665.0000 666.0000 667.0000 -999.0000 0.0000 1.0000 0.0000 99999.0000 807.0000 99999.0000 1.0000 0.0000 0.0000 0.0000 0.0000 801.0000 99999.0000 99999.0000 99999.0000 99999.0000 -9 -9 diff --git a/Test/BaseRun/2020a/Output/test1_2004_state_init.txt b/Test/BaseRun/2020a/Output/test1_2004_state_init.txt index a9ea05388..182322f63 100644 --- a/Test/BaseRun/2020a/Output/test1_2004_state_init.txt +++ b/Test/BaseRun/2020a/Output/test1_2004_state_init.txt @@ -77,8 +77,8 @@ ie_start= 1 imin= 5 internalwateruse_h= 0.0000000000000000 - irrfracconif= 0.0000000000000000 - irrfracdecid= 0.0000000000000000 + IrrFracEveTr= 0.0000000000000000 + IrrFracDecTr= 0.0000000000000000 irrfracgrass= 0.0000000000000000 isec= 0 it= 0 diff --git a/Test/BaseRun/2020a/Output/test1_2005_state_init.txt b/Test/BaseRun/2020a/Output/test1_2005_state_init.txt index 559830f93..34dc0b284 100644 --- a/Test/BaseRun/2020a/Output/test1_2005_state_init.txt +++ b/Test/BaseRun/2020a/Output/test1_2005_state_init.txt @@ -77,8 +77,8 @@ ie_start= 1 imin= 5 internalwateruse_h= 0.0000000000000000 - irrfracconif= 0.0000000000000000 - irrfracdecid= 0.0000000000000000 + IrrFracEveTr= 0.0000000000000000 + IrrFracDecTr= 0.0000000000000000 irrfracgrass= 0.0000000000000000 isec= 0 it= 0 diff --git a/Test/BaseRun/2020a/RunControl.nml b/Test/BaseRun/2020a/RunControl.nml index 9a37ce9f4..67091db52 100644 --- a/Test/BaseRun/2020a/RunControl.nml +++ b/Test/BaseRun/2020a/RunControl.nml @@ -2,6 +2,7 @@ CBLUse=1 SnowUse=1 NetRadiationMethod=13 +BaseTMethod=1 EmissionsMethod=1 StorageHeatMethod=1 OHMIncQF=0 diff --git a/Test/code/Test_SUEWS.py b/Test/code/Test_SUEWS.py index d4df42c99..4c714f2fe 100644 --- a/Test/code/Test_SUEWS.py +++ b/Test/code/Test_SUEWS.py @@ -48,27 +48,23 @@ def load_SUEWS_table(fileX): # remove case issues fileX = path_insensitive(fileX) rawdata = pd.read_csv( - fileX, - delim_whitespace=True, - comment='!', error_bad_lines=True, - skiprows=1).dropna() + fileX, delim_whitespace=True, comment="!", error_bad_lines=True, skiprows=1 + ).dropna() return rawdata # load results def load_SUEWS_results(n_grid, n_year): - path_out = os.path.join('Output/*SUEWS_60.txt') + path_out = os.path.join("Output/*SUEWS_60.txt") # re-order results into [year, grid] layout fl_res = np.array(sorted(glob(path_out))) fl_res = fl_res.reshape(n_grid, n_year).swapaxes(0, 1) res_sim = [ np.array( - [ - pd.read_csv(f_grid, sep=r'\s+', header=0).values - for f_grid in fl_year - ] + [pd.read_csv(f_grid, sep=r"\s+", header=0).values for f_grid in fl_year] ) - for fl_year in fl_res] + for fl_year in fl_res + ] # re-order the results into [grid,time] res_sim = np.concatenate(res_sim, axis=1) @@ -76,14 +72,16 @@ def load_SUEWS_results(n_grid, n_year): # load results as pandas dataframe -def load_df_SUEWS(dir_out='Output', fn_pattern='*SUEWS_60.txt'): +def load_df_SUEWS(dir_out="Output", fn_pattern="*SUEWS_60.txt"): fl_res = list(Path(dir_out).glob(fn_pattern)) # re-order results into [year, grid] layout fl_res = sorted(list(Path(dir_out).glob(fn_pattern))) - list_grid = [fn.stem.split('_')[0] for fn in fl_res] + list_grid = [fn.stem.split("_")[0] for fn in fl_res] # load individual files with extra level named by grid - list_df = [pd.concat([pd.read_csv(fn, sep=r'\s+', header=0)], keys=[grid]) - for fn, grid in zip(fl_res, list_grid)] + list_df = [ + pd.concat([pd.read_csv(fn, sep=r"\s+", header=0)], keys=[grid]) + for fn, grid in zip(fl_res, list_grid) + ] # re-order the results into [grid,time] res_sim = pd.concat(list_df).sort_index() @@ -91,7 +89,7 @@ def load_df_SUEWS(dir_out='Output', fn_pattern='*SUEWS_60.txt'): # save SiteSelect to file -def save_SiteSelect(df_siteselect, fn_ss='Input/SUEWS_SiteSelect.txt'): +def save_SiteSelect(df_siteselect, fn_ss="Input/SUEWS_SiteSelect.txt"): # process SiteSelect # fn_ss = 'SUEWS_SiteSelect.txt' cfg_siteselect_base = df_siteselect @@ -100,33 +98,37 @@ def save_SiteSelect(df_siteselect, fn_ss='Input/SUEWS_SiteSelect.txt'): # n_year = cfg_siteselect_dim[0] cfg_siteselect_header = np.vstack( - (np.arange(1, cfg_siteselect_dim[1] + 1), cfg_siteselect_base.columns)) + (np.arange(1, cfg_siteselect_dim[1] + 1), cfg_siteselect_base.columns) + ) # generate header for SiteSelect.txt - header_SS = '\n'.join( - [' '.join(line) for line in cfg_siteselect_header.astype(str)]) + header_SS = "\n".join( + [" ".join(line) for line in cfg_siteselect_header.astype(str)] + ) # create SiteSelect.txt np.savetxt( - fn_ss, cfg_siteselect_x, - fmt=' '.join(['%i'] * 4 + ['%1.4f'] * (cfg_siteselect_dim[1] - 4)), - header=header_SS, footer='-9\n-9', comments='') + fn_ss, + cfg_siteselect_x, + fmt=" ".join(["%i"] * 4 + ["%1.4f"] * (cfg_siteselect_dim[1] - 4)), + header=header_SS, + footer="-9\n-9", + comments="", + ) # print('SiteSelect saved!') # save InitCond to file -def save_InitCond(dict_initcond, year, grid=''): - InitCond = {'initialconditions': dict_initcond.copy()} - for k, v in InitCond['initialconditions'].items(): +def save_InitCond(dict_initcond, year, grid=""): + InitCond = {"initialconditions": dict_initcond.copy()} + for k, v in InitCond["initialconditions"].items(): if int(v) == v: - InitCond['initialconditions'][k] = int(v) + InitCond["initialconditions"][k] = int(v) # save RunControl to file - fn_nml = os.path.join( - 'Input', - 'InitialConditionstest{grid}_{year}.nml').format( - grid=grid, - year=year) + fn_nml = os.path.join("Input", "InitialConditionstest{grid}_{year}.nml").format( + grid=grid, year=year + ) if os.path.exists(fn_nml): os.remove(fn_nml) f90nml.write(InitCond, fn_nml) @@ -139,39 +141,48 @@ def gen_SiteSelect_multi(df_siteselect, n_grid): cfg_siteselect_base = df_siteselect.iloc[[0]] year0 = cfg_siteselect_base.Year[0] cfg_siteselect_base = pd.concat([cfg_siteselect_base, cfg_siteselect_base]) - cfg_siteselect_base.loc[:, 'Year'] = [year0, year0 + 1] + cfg_siteselect_base.loc[:, "Year"] = [year0, year0 + 1] cfg_siteselect_dim = cfg_siteselect_base.shape n_year = cfg_siteselect_dim[0] # create random surface fraction info for multiple grids # n_grid = 2 # number of grids cfg_siteselect = np.tile(cfg_siteselect_base.values, (n_grid, 1)) - fr_multigrid = [fr_line / np.sum(fr_line) - for fr_line in np.random.rand(n_grid, 7)] - loc_fr = cfg_siteselect_base.columns.get_loc('Fr_Paved') - cfg_siteselect[:, loc_fr:loc_fr + 7] = np.repeat( - fr_multigrid, cfg_siteselect_dim[0], axis=0) + fr_multigrid = [fr_line / np.sum(fr_line) for fr_line in np.random.rand(n_grid, 7)] + loc_fr = cfg_siteselect_base.columns.get_loc("Fr_Paved") + cfg_siteselect[:, loc_fr : loc_fr + 7] = np.repeat( + fr_multigrid, cfg_siteselect_dim[0], axis=0 + ) # specify grid numbers - cfg_siteselect[:, 0] = np.repeat( - np.arange(1, n_grid + 1), cfg_siteselect_dim[0]) + cfg_siteselect[:, 0] = np.repeat(np.arange(1, n_grid + 1), cfg_siteselect_dim[0]) # re-order results into [year, grid] layout - cfg_siteselect_x = cfg_siteselect.reshape( - n_grid, n_year, -1).swapaxes(0, 1).reshape( - n_grid * n_year, -1) + cfg_siteselect_x = ( + cfg_siteselect.reshape(n_grid, n_year, -1) + .swapaxes(0, 1) + .reshape(n_grid * n_year, -1) + ) # perform multi-grid run: df_siteselect_multi = pd.DataFrame( - cfg_siteselect_x, columns=cfg_siteselect_base.columns) + cfg_siteselect_x, columns=cfg_siteselect_base.columns + ) return df_siteselect_multi # run simulation -def run_sim(name_sim, dir_input, dir_exe, name_exe, - dict_runcontrol, dict_initcond, df_siteselect, - dir_save=tempfile.mkdtemp()): +def run_sim( + name_sim, + dir_input, + dir_exe, + name_exe, + dict_runcontrol, + dict_initcond, + df_siteselect, + dir_save=tempfile.mkdtemp(), +): # TODO: support for user-specified forcing condition # create dir_save if not exisitng dir_save = os.path.abspath(os.path.expanduser(dir_save)) @@ -183,45 +194,45 @@ def run_sim(name_sim, dir_input, dir_exe, name_exe, os.chdir(dir_save) os.mkdir(name_sim) os.chdir(name_sim) - os.mkdir('Output') + os.mkdir("Output") except OSError as e: if e.errno == errno.EEXIST: - print('Directory not created.') + print("Directory not created.") else: raise # copy base input files - copytree(dir_input, 'Input') + copytree(dir_input, "Input") # get sim info - yr_sim = df_siteselect.loc[:, 'Year'].unique().astype(int) - grid_sim = df_siteselect.loc[:, 'Grid'].unique().astype(int) + yr_sim = df_siteselect.loc[:, "Year"].unique().astype(int) + grid_sim = df_siteselect.loc[:, "Grid"].unique().astype(int) n_grid = len(grid_sim) n_year = len(yr_sim) # RunControl # set default values - RunControl = {'runcontrol': dict_runcontrol.copy()} - RunControl['runcontrol']['filecode'] = 'test' - RunControl['runcontrol']['fileoutputpath'] = './Output/' + RunControl = {"runcontrol": dict_runcontrol.copy()} + RunControl["runcontrol"]["filecode"] = "test" + RunControl["runcontrol"]["fileoutputpath"] = "./Output/" # Initial condition # multi-grid initcond or not? if np.array_equal(grid_sim, list(dict_initcond.keys())): # use specific InitCond - RunControl['runcontrol']['multipleinitfiles'] = 1 + RunControl["runcontrol"]["multipleinitfiles"] = 1 # set default values for grid in grid_sim: save_InitCond(dict_initcond[grid], min(yr_sim), grid) else: # use same InitCond - RunControl['runcontrol']['multipleinitfiles'] = 0 + RunControl["runcontrol"]["multipleinitfiles"] = 0 save_InitCond(dict_initcond, min(yr_sim)) # save SiteSelect to file save_SiteSelect(df_siteselect) # save RunControl to file - f90nml.write(RunControl, 'RunControl.nml') + f90nml.write(RunControl, "RunControl.nml") # copy SUEWS executable # name_exe = 'SUEWS_V2018a' @@ -232,19 +243,20 @@ def run_sim(name_sim, dir_input, dir_exe, name_exe, # perform multi-grid run: # exit_code = os.system('./SUEWS_V2018a') # suppress output info - os.system('./' + name_exe + ' &>/dev/null') + os.system("./" + name_exe + " &>/dev/null") # check if results generated: - fl_output = glob('Output/*SUEWS_60.txt') + fl_output = glob("Output/*SUEWS_60.txt") if len(fl_output) > 0: # load results # res_sim = load_SUEWS_results(n_grid, n_year) - res_sim = load_df_SUEWS('Output','*SUEWS_60.txt') + res_sim = load_df_SUEWS("Output", "*SUEWS_60.txt") return res_sim else: # change back to original path os.chdir(dir_sys) - return 'run failed!' + return "run failed!" + # %% @@ -258,24 +270,37 @@ def run_sim(name_sim, dir_input, dir_exe, name_exe, # %%if single-grid multi-year run OK? def test_multiyear( - name_sim, name_exe, dict_runcontrol, dict_initcond, df_siteselect, - dir_exe, dir_input, dir_save=tempfile.mkdtemp()): - - print(('test_multiyear for', name_exe)) - print(('running here:', dir_save)) + name_sim, + name_exe, + dict_runcontrol, + dict_initcond, + df_siteselect, + dir_exe, + dir_input, + dir_save=tempfile.mkdtemp(), +): + + print(("test_multiyear for", name_exe)) + print(("running here:", dir_save)) # generate a multi-grid SiteSelect file using only one grid df_siteselect_multi = gen_SiteSelect_multi(df_siteselect, n_grid=1) # process RunControl - dict_runcontrol['resolutionfilesout'] = 3600 - dict_runcontrol['KeepTstepFilesOut'] = 0 + dict_runcontrol["resolutionfilesout"] = 3600 + dict_runcontrol["KeepTstepFilesOut"] = 0 # result in [year, grid] order res_sim_multiyear = run_sim( - name_sim, dir_input, dir_exe, name_exe, - dict_runcontrol, dict_initcond, df_siteselect_multi, - dir_save) + name_sim, + dir_input, + dir_exe, + name_exe, + dict_runcontrol, + dict_initcond, + df_siteselect_multi, + dir_save, + ) # test if multiple years have been run res_test = len(res_sim_multiyear.shape) > 0 @@ -285,9 +310,16 @@ def test_multiyear( # %%if multi-grid run produce the same resutls as their single-grid runs? def test_multigrid( - name_sim, name_exe, - dict_runcontrol, dict_initcond, df_siteselect, - n_grid, dir_exe, dir_input, dir_save=tempfile.mkdtemp()): + name_sim, + name_exe, + dict_runcontrol, + dict_initcond, + df_siteselect, + n_grid, + dir_exe, + dir_input, + dir_save=tempfile.mkdtemp(), +): # create folder `name_sim` dir_sys = os.getcwd() try: @@ -297,40 +329,50 @@ def test_multigrid( # os.mkdir('Output') except OSError as e: if e.errno == errno.EEXIST: - print('Directory not created.') + print("Directory not created.") else: raise - print(('test_multigrid for', name_exe)) - print(('running here:', dir_save)) + print(("test_multigrid for", name_exe)) + print(("running here:", dir_save)) # generate a multi-grid SiteSelect file df_siteselect_multi = gen_SiteSelect_multi(df_siteselect, n_grid) # process RunControl - dict_runcontrol['resolutionfilesout'] = 3600 - dict_runcontrol['KeepTstepFilesOut'] = 0 + dict_runcontrol["resolutionfilesout"] = 3600 + dict_runcontrol["KeepTstepFilesOut"] = 0 # perform one multi-grid simulation and load results - name_sim = 'multi_grid' + name_sim = "multi_grid" # result in [year, grid] order res_sim_multigrid = run_sim( - name_sim, dir_input, dir_exe, name_exe, - dict_runcontrol, dict_initcond, + name_sim, + dir_input, + dir_exe, + name_exe, + dict_runcontrol, + dict_initcond, df_siteselect_multi, - dir_save) + dir_save, + ) # perform multiple single-grid simulation and load results res_sim_singlegrid = [] - list_grid = df_siteselect_multi.loc[:, 'Grid'].unique() + list_grid = df_siteselect_multi.loc[:, "Grid"].unique() for grid_name in list_grid: # grid_name = df_siteselect.loc[ind_grid, 'Grid'] - name_sim = 'single_grid_' + str(int(grid_name)) + name_sim = "single_grid_" + str(int(grid_name)) res_sim_grid = run_sim( - name_sim, dir_input, dir_exe, name_exe, - dict_runcontrol, dict_initcond, + name_sim, + dir_input, + dir_exe, + name_exe, + dict_runcontrol, + dict_initcond, df_siteselect_multi.loc[df_siteselect_multi.Grid == grid_name], - dir_save) + dir_save, + ) res_sim_singlegrid.append(res_sim_grid) # combine `res_sim_singlegrid` @@ -344,21 +386,27 @@ def test_multigrid( # change back to previous path os.chdir(dir_sys) - return res_test # %% if the test run can produce the same results as the SampleRun -def test_samerun(name_sim, name_exe, - dict_runcontrol, dict_initcond, df_siteselect, - dir_exe, dir_baserun, dir_save=tempfile.mkdtemp()): +def test_samerun( + name_sim, + name_exe, + dict_runcontrol, + dict_initcond, + df_siteselect, + dir_exe, + dir_baserun, + dir_save=tempfile.mkdtemp(), +): dir_sys = os.getcwd() # load RunControl dict_runcontrol = load_SUEWS_RunControl( - os.path.join(dir_baserun, 'RunControl.nml') - )['runcontrol'] + os.path.join(dir_baserun, "RunControl.nml") + )["runcontrol"] # dir_input = dict_runcontrol['fileoutiutpath'] - dir_output = dict_runcontrol['fileoutputpath'] + dir_output = dict_runcontrol["fileoutputpath"] # temp dir for testing dir_test = dir_save @@ -372,9 +420,9 @@ def test_samerun(name_sim, name_exe, os.chdir(dir_test) # use long-term forcing for this testing - path_input = Path(dict_runcontrol['fileinputpath']) - input_short = list(path_input.glob('*.txt.long'))[0] - move(input_short, input_short.parent/input_short.stem) + path_input = Path(dict_runcontrol["fileinputpath"]) + input_short = list(path_input.glob("*.txt.long"))[0] + move(input_short, input_short.parent / input_short.stem) if os.path.exists(dir_output): rmtree(dir_output) @@ -390,7 +438,7 @@ def test_samerun(name_sim, name_exe, # perform simulation # exit_code = os.system('./SUEWS_V2018a') - os.system('./' + name_exe + ' &>/dev/null') + os.system("./" + name_exe + " &>/dev/null") # compare results dir_res_sample = os.path.join(dir_baserun, dir_output) @@ -401,21 +449,22 @@ def test_samerun(name_sim, name_exe, common_files = [ os.path.basename(x) - for x in glob(os.path.join(dir_res_sample, '*'))] + for x in glob(os.path.join(dir_res_sample, "*")) + # exclude certain files + if not any(excl in x for excl in ["FileChoices.txt", "state_init.txt"]) + ] comp_files_test = filecmp.cmpfiles( - dir_res_sample, - dir_res_test, - common_files, - shallow=False) - print(('comp_files_test', comp_files_test)) - print(('common_files', common_files)) + dir_res_sample, dir_res_test, common_files, shallow=False + ) + print(("comp_files_test", comp_files_test)) + print(("common_files", common_files)) # test if mismatch list non-empty res_test = len(comp_files_test[1]) == 0 if not res_test: # if not match, print mismatch list - print('these files are different:') + print("these files are different:") print(sorted(comp_files_test[1])) # res_test = (set(comp_files_test[0]) == set(common_files)) @@ -427,34 +476,41 @@ def test_samerun(name_sim, name_exe, dir_sys = os.chdir(dir_sys) # rmtree(dir_test) - print(('test_samerun for', name_exe)) - print(('running here:', dir_save)) + print(("test_samerun for", name_exe)) + print(("running here:", dir_save)) return res_test # %% diagnose working&faulty physics options -def test_physics(name_exe, dir_input, dir_exe, - dict_runcontrol, dict_initcond, df_siteselect, - dict_phy_opt_sel, - test_complete=True, - test_number=50, - dir_save=tempfile.mkdtemp()): - - print(('test_physics for', name_exe)) - print('running here:', dir_save) +def test_physics( + name_exe, + dir_input, + dir_exe, + dict_runcontrol, + dict_initcond, + df_siteselect, + dict_phy_opt_sel, + test_complete=True, + test_number=50, + dir_save=tempfile.mkdtemp(), +): + + print(("test_physics for", name_exe)) + print("running here:", dir_save) # get options to test # matrix-like combinations of all test options methods, options = list(zip(*list(dict_phy_opt_sel.items()))) options = [x if type(x) == list else [x] for x in options] - list_to_test_all = [dict(list(zip(methods, v))) - for v in itertools.product(*options)] + list_to_test_all = [ + dict(list(zip(methods, v))) for v in itertools.product(*options) + ] if test_complete: # 1. use all possible combinations # really time consuming! - list_to_test=list_to_test_all - if test_number>0: + list_to_test = list_to_test_all + if test_number > 0: list_to_test = np.random.choice(list_to_test_all, test_number).tolist() else: # 2. simple test by incorporating each entry into the basis scheme options @@ -468,63 +524,78 @@ def test_physics(name_exe, dir_input, dir_exe, else: list_to_test.append({method: options}) - print('number of tests:', len(list_to_test)) + print("number of tests:", len(list_to_test)) # test selected physics schemes dict_test = {} for ind, cfg in enumerate(list_to_test): - print(f'testing {ind+1}/{len(list_to_test)}:') + print(f"testing {ind+1}/{len(list_to_test)}:") runcontrol_test = dict_runcontrol.copy() runcontrol_test.update(cfg) runcontrol_test_sel = {x: runcontrol_test[x] for x in dict_phy_opt_sel} - print(f'{runcontrol_test_sel}') + print(f"{runcontrol_test_sel}") name_sim = str(ind) res_sim = run_sim( - name_sim, dir_input, dir_exe, name_exe, + name_sim, + dir_input, + dir_exe, + name_exe, runcontrol_test, - dict_initcond, df_siteselect, - dir_save) + dict_initcond, + df_siteselect, + dir_save, + ) dict_test.update({ind: res_sim}) - dict_test_OK = {k: 'fail' if type(v) == str else 'pass' - for k, v in iter(dict_test.items())} + dict_test_OK = { + k: "fail" if type(v) == str else "pass" for k, v in iter(dict_test.items()) + } df_test = pd.DataFrame(list_to_test) df_test = df_test.assign(result=list(dict_test_OK.values())) - df_test.to_csv('~/df_test.csv') + df_test.to_csv("~/df_test.csv") # test results - list_method_test = [c for c in df_test.columns if not c == 'result'] + list_method_test = [c for c in df_test.columns if not c == "result"] df_test_pass = pd.concat( - [df_test.loc[:, [c, 'result']].pivot_table( - index='result', columns=c, aggfunc=len) - for c in list_method_test], + [ + df_test.loc[:, [c, "result"]].pivot_table( + index="result", columns=c, aggfunc=len + ) + for c in list_method_test + ], keys=list_method_test, sort=True, - axis=1) - df_test_pass = df_test_pass\ - .loc['pass', :]\ - .to_frame()\ - .rename(columns={'pass': 'result'})\ - .applymap(lambda x: 'pass' if x > 0 else 'fail') - df_test_pass.index.set_names(['method', 'option'], inplace=True) + axis=1, + ) + df_test_pass = ( + df_test_pass.loc["pass", :] + .to_frame() + .rename(columns={"pass": "result"}) + .applymap(lambda x: "pass" if x > 0 else "fail") + ) + df_test_pass.index.set_names(["method", "option"], inplace=True) # get `fail` options: - list_fail = df_test_pass.loc[ - df_test_pass['result'] == 'fail'].index.tolist() + list_fail = df_test_pass.loc[df_test_pass["result"] == "fail"].index.tolist() return list_fail -def test_ok_multiyear(name_exe, - dict_runcontrol, dict_initcond, df_siteselect, - dir_exe, dir_input): - print('***************************************') - print('testing single-grid multi-year run ... ') - name_sim = 'test-multi-year' + str(np.random.randint(10000)) +def test_ok_multiyear( + name_exe, dict_runcontrol, dict_initcond, df_siteselect, dir_exe, dir_input +): + print("***************************************") + print("testing single-grid multi-year run ... ") + name_sim = "test-multi-year" + str(np.random.randint(10000)) res_test = test_multiyear( - name_sim, name_exe, - dict_runcontrol, dict_initcond, df_siteselect, - dir_exe, dir_input) + name_sim, + name_exe, + dict_runcontrol, + dict_initcond, + df_siteselect, + dir_exe, + dir_input, + ) # xx = unittest.TestCase.assertTrue(res_test) return res_test @@ -595,15 +666,15 @@ def test_ok_multiyear(name_exe, def test_code(fn_nml): # load path nml = f90nml.read(fn_nml) - cfg_file = nml['file'] + cfg_file = nml["file"] dir_input, dir_exe, dir_baserun = ( - os.path.abspath(cfg_file[x]) - for x in ['dir_input', 'dir_exe', 'dir_baserun']) + os.path.abspath(cfg_file[x]) for x in ["dir_input", "dir_exe", "dir_baserun"] + ) # dir_exe = os.path.abspath(path_base[]) # dir_baserun = path_base[] # load name of programme for testing - name_exe = cfg_file['name_exe'] + name_exe = cfg_file["name_exe"] # load physics options to test # dict_phy_opt_sel = nml['physics_test'] @@ -611,23 +682,24 @@ def test_code(fn_nml): # load basic configurations # runcontrol settings dict_runcontrol = load_SUEWS_nml( - os.path.join(dir_input, 'RunControl.nml')).to_dict()['runcontrol'] + os.path.join(dir_input, "RunControl.nml") + ).to_dict()["runcontrol"] # initial condition - dict_initcond = (load_SUEWS_nml( - os.path.join(dir_input, 'InitialConditionstest_2004.nml')).to_dict()[ - 'initialconditions']) + dict_initcond = load_SUEWS_nml( + os.path.join(dir_input, "InitialConditionstest_2004.nml") + ).to_dict()["initialconditions"] # siteselect info - df_siteselect = load_SUEWS_table( - os.path.join(dir_input, 'SUEWS_SiteSelect.txt')) + df_siteselect = load_SUEWS_table(os.path.join(dir_input, "SUEWS_SiteSelect.txt")) # test code # unittest.main() - xx = test_ok_multiyear(name_exe, - dict_runcontrol, dict_initcond, df_siteselect, - dir_exe, dir_input) + xx = test_ok_multiyear( + name_exe, dict_runcontrol, dict_initcond, df_siteselect, dir_exe, dir_input + ) return xx + ############################################################################## # auxiliary functions # resolve path case issues @@ -663,16 +735,16 @@ def _path_insensitive(path): Recursive part of path_insensitive to do the work. """ - if path == '' or os.path.exists(path): + if path == "" or os.path.exists(path): return path base = os.path.basename(path) # may be a directory or a file dirname = os.path.dirname(path) - suffix = '' + suffix = "" if not base: # dir ends with a slash? if len(dirname) < len(path): - suffix = path[:len(path) - len(dirname)] + suffix = path[: len(path) - len(dirname)] base = os.path.basename(dirname) dirname = os.path.dirname(dirname) @@ -699,4 +771,3 @@ def _path_insensitive(path): return os.path.join(dirname, basefinal) + suffix else: return - diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4531a4447..0a47ac576 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,7 +1,6 @@ trigger: # branch names - master -- release/* - develop # Set variables once @@ -25,7 +24,7 @@ jobs: condition: succeeded() pool: - vmImage: 'macOS-10.13' + vmImage: 'macOS-10.15' steps: # Use Python Version # Retrieves the specified version of Python from the tool cache. Optionally add it to PATH. diff --git a/docs/requirements.txt b/docs/requirements.txt index b61aa1fa7..eee1be6cb 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,3 +1,4 @@ +sphinx==3.0.0 pybtex==0.22.2 f90nml==1.0.2 pandas==0.25.3 @@ -5,4 +6,4 @@ numpy==1.15.4 nbsphinx==0.4.2 exhale==0.2.3 sphinxcontrib_programoutput==0.15 -sphinxcontrib.bibtex \ No newline at end of file +sphinxcontrib.bibtex diff --git a/docs/source/input_files/RunControl/RunControl.rst b/docs/source/input_files/RunControl/RunControl.rst index bb7fdc73f..7a5ebdfab 100644 --- a/docs/source/input_files/RunControl/RunControl.rst +++ b/docs/source/input_files/RunControl/RunControl.rst @@ -1,5 +1,4 @@ .. _RunControl: -.. _RunControl.nml: RunControl.nml -------------- @@ -28,6 +27,7 @@ The parameters and their setting instructions are provided through the links bel + :option:`CBLuse` + :option:`SnowUse` + :option:`NetRadiationMethod` + + :option:`BaseTMethod` + :option:`EmissionsMethod` + :option:`StorageHeatMethod` + :option:`OHMIncQF` diff --git a/docs/source/input_files/RunControl/csv-table/BaseTMethod.csv b/docs/source/input_files/RunControl/csv-table/BaseTMethod.csv new file mode 100644 index 000000000..f4bb7e5d7 --- /dev/null +++ b/docs/source/input_files/RunControl/csv-table/BaseTMethod.csv @@ -0,0 +1,3 @@ +"Value","Comments" +1,"V-shape approach: a single `BaseT_HC` is used" +2,"U-shape approach: `TCritic_Heating_WD` (`TCritic_Heating_WE`) and `TCritic_Cooling_WD` (`TCritic_Cooling_WE`) are used for HDD and CDD calculations in weekdays (weekends), respectively." diff --git a/docs/source/input_files/RunControl/scheme_options.rst b/docs/source/input_files/RunControl/scheme_options.rst index 1848669cf..3e689cfb9 100644 --- a/docs/source/input_files/RunControl/scheme_options.rst +++ b/docs/source/input_files/RunControl/scheme_options.rst @@ -44,6 +44,18 @@ Scheme options :widths: 10 80 +.. option:: BaseTMethod + + :Requirement: + Required + :Description: + Determines method for base temperature used in HDD/CDD calculations. + :Configuration: + .. csv-table:: + :file: csv-table/BaseTMethod.csv + :header-rows: 1 + :widths: 10 80 + .. option:: EmissionsMethod :Requirement: diff --git a/docs/source/input_files/SUEWS_SiteInfo/Input_Options.rst b/docs/source/input_files/SUEWS_SiteInfo/Input_Options.rst index 92fd8dde6..296984806 100644 --- a/docs/source/input_files/SUEWS_SiteInfo/Input_Options.rst +++ b/docs/source/input_files/SUEWS_SiteInfo/Input_Options.rst @@ -301,7 +301,7 @@ Input Options :widths: 44 18 38 -.. option:: BaseTHDD +.. option:: BaseT_HC :Description: Base temperature for heating degree days [°C] @@ -309,7 +309,7 @@ Input Options :Configuration: .. csv-table:: :class: longtable - :file: csv-table/BaseTHDD.csv + :file: csv-table/BaseT_HC.csv :header-rows: 1 :widths: 44 18 38 @@ -1071,6 +1071,8 @@ Input Options :header-rows: 1 :widths: 44 18 38 + + .. option:: FcEF_v_kgkmWD :Description: @@ -1758,6 +1760,21 @@ Input Options :header-rows: 1 :widths: 44 18 38 +.. option:: H_maintain + + :Description: + water depth to maintain used in automatic irrigation (e.g., ponding water due to flooding irrigation in rice crop-field) [mm]. + + .. note:: + 1. `H_maintain` can be positive (e.g., ponding water due to flooding irrigation in rice crop-field) or negative (e.g., soil water store level to maintain: `SoilStoreCap` + `H_maintain` ) or zero (e.g., to maintain a maximum soil store level, i.e., `SoilStoreCap`). + 2. Disable this feature by setting this parameter to ``-999``: then no restrictions will be applied to maintain available water level. + + :Configuration: + .. csv-table:: + :class: longtable + :file: csv-table/H_maintain.csv + :header-rows: 1 + :widths: 44 18 38 .. option:: id @@ -2188,10 +2205,36 @@ Input Options :widths: 44 18 38 +.. option:: IrrFr_Paved + + :Description: + Fraction of `Paved` that is irrigated [-] + + :Configuration: + .. csv-table:: + :class: longtable + :file: csv-table/IrrFr_Paved.csv + :header-rows: 1 + :widths: 44 18 38 + + +.. option:: IrrFr_Bldgs + + :Description: + Fraction of `Bldgs` that is irrigated [-] + + :Configuration: + .. csv-table:: + :class: longtable + :file: csv-table/IrrFr_Bldgs.csv + :header-rows: 1 + :widths: 44 18 38 + + .. option:: IrrFr_DecTr :Description: - Fraction of deciduous trees that are irrigated [-] + Fraction of `DecTr` that is irrigated [-] :Configuration: .. csv-table:: @@ -2204,7 +2247,7 @@ Input Options .. option:: IrrFr_EveTr :Description: - Fraction of evergreen trees that are irrigated [-] + Fraction of `EveTr` that is irrigated [-] :Configuration: .. csv-table:: @@ -2227,6 +2270,32 @@ Input Options :widths: 44 18 38 +.. option:: IrrFr_BSoil + + :Description: + Fraction of `BSoil` that is irrigated [-] + + :Configuration: + .. csv-table:: + :class: longtable + :file: csv-table/IrrFr_BSoil.csv + :header-rows: 1 + :widths: 44 18 38 + + +.. option:: IrrFr_Water + + :Description: + Fraction of `Water` that is irrigated [-] + + :Configuration: + .. csv-table:: + :class: longtable + :file: csv-table/IrrFr_Water.csv + :header-rows: 1 + :widths: 44 18 38 + + .. option:: IrrigationCode :Description: diff --git a/docs/source/input_files/SUEWS_SiteInfo/SUEWS_AnthropogenicEmission.rst b/docs/source/input_files/SUEWS_SiteInfo/SUEWS_AnthropogenicEmission.rst index 9b66e17fa..fd1403a78 100644 --- a/docs/source/input_files/SUEWS_SiteInfo/SUEWS_AnthropogenicEmission.rst +++ b/docs/source/input_files/SUEWS_SiteInfo/SUEWS_AnthropogenicEmission.rst @@ -20,7 +20,7 @@ The sub-daily variation in anthropogenic heat flux is modelled according to the daily cycles specified in SUEWS_Profiles.txt. -Alternatively, if available, the anthropogenic heat flux can be provided in the met forcing file (and set `EmissionsMethod` = 0 in `RunControl.nml`) by filling the `qf` column with valid values. +Alternatively, if available, the anthropogenic heat flux can be provided in the met forcing file (and set `EmissionsMethod` = 0 in `RunControl.nml`) by filling the :option:`qf` column with valid values. .. DON'T manually modify the csv file below .. as it is always automatically regenrated by each build: diff --git a/docs/source/input_files/SUEWS_SiteInfo/SUEWS_BiogenCO2.rst b/docs/source/input_files/SUEWS_SiteInfo/SUEWS_BiogenCO2.rst index e84309796..84bfe5fb9 100644 --- a/docs/source/input_files/SUEWS_SiteInfo/SUEWS_BiogenCO2.rst +++ b/docs/source/input_files/SUEWS_SiteInfo/SUEWS_BiogenCO2.rst @@ -1,4 +1,4 @@ -.. _SUEWS_BiogenCO2.txt: +.. _SUEWS_BiogenCO2: SUEWS_BiogenCO2.txt ~~~~~~~~~~~~~~~~~~~ diff --git a/docs/source/input_files/SUEWS_SiteInfo/SUEWS_Conductance.rst b/docs/source/input_files/SUEWS_SiteInfo/SUEWS_Conductance.rst index 5b4037f09..4e5ec6baa 100644 --- a/docs/source/input_files/SUEWS_SiteInfo/SUEWS_Conductance.rst +++ b/docs/source/input_files/SUEWS_SiteInfo/SUEWS_Conductance.rst @@ -1,4 +1,4 @@ -.. _SUEWS_Conductance.txt: +.. _SUEWS_Conductance: SUEWS_Conductance.txt ~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/source/input_files/SUEWS_SiteInfo/SUEWS_Irrigation.rst b/docs/source/input_files/SUEWS_SiteInfo/SUEWS_Irrigation.rst index 90d519596..35f02fbc2 100644 --- a/docs/source/input_files/SUEWS_SiteInfo/SUEWS_Irrigation.rst +++ b/docs/source/input_files/SUEWS_SiteInfo/SUEWS_Irrigation.rst @@ -1,4 +1,4 @@ -.. _SUEWS_Irrigation.txt: +.. _SUEWS_Irrigation: SUEWS_Irrigation.txt ~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/source/input_files/SUEWS_SiteInfo/SUEWS_NonVeg.rst b/docs/source/input_files/SUEWS_SiteInfo/SUEWS_NonVeg.rst index 8627eb06e..e9dd53916 100644 --- a/docs/source/input_files/SUEWS_SiteInfo/SUEWS_NonVeg.rst +++ b/docs/source/input_files/SUEWS_SiteInfo/SUEWS_NonVeg.rst @@ -1,4 +1,4 @@ -.. _SUEWS_NonVeg.txt: +.. _SUEWS_NonVeg: SUEWS_NonVeg.txt ~~~~~~~~~~~~~~~~ diff --git a/docs/source/input_files/SUEWS_SiteInfo/SUEWS_OHMCoefficients.rst b/docs/source/input_files/SUEWS_SiteInfo/SUEWS_OHMCoefficients.rst index f69165c31..c17348a92 100644 --- a/docs/source/input_files/SUEWS_SiteInfo/SUEWS_OHMCoefficients.rst +++ b/docs/source/input_files/SUEWS_SiteInfo/SUEWS_OHMCoefficients.rst @@ -1,4 +1,4 @@ -.. _SUEWS_OHMCoefficients.txt: +.. _SUEWS_OHMCoefficients: SUEWS_OHMCoefficients.txt ~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -21,9 +21,9 @@ and surface characteristics. .. note:: - + #. AnOHM (set in `RunControl.nml` by `StorageHeatMethod` = 3) does not use the coefficients specified in `SUEWS_OHMCoefficients.txt` but instead requires three parameters to be specified for each surface type (including snow): heat capacity (`AnOHM_Cp`), thermal conductivity (`AnOHM_Kk`) and bulk transfer coefficient (`AnOHM_Ch`). These are specified in `SUEWS_NonVeg.txt`, `SUEWS_Veg.txt`, `SUEWS_Water.txt` and `SUEWS_Snow.txt`. No additional files are required for AnOHM. - + #. AnOHM is under development in v2018b and should NOT be used! .. DON'T manually modify the csv file below diff --git a/docs/source/input_files/SUEWS_SiteInfo/SUEWS_SiteSelect.rst b/docs/source/input_files/SUEWS_SiteInfo/SUEWS_SiteSelect.rst index 76df97d9f..38fe9593d 100644 --- a/docs/source/input_files/SUEWS_SiteInfo/SUEWS_SiteSelect.rst +++ b/docs/source/input_files/SUEWS_SiteInfo/SUEWS_SiteSelect.rst @@ -1,4 +1,4 @@ -.. _SUEWS_SiteSelect.txt: +.. _SUEWS_SiteSelect: SUEWS_SiteSelect.txt ~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/source/input_files/SUEWS_SiteInfo/SUEWS_Snow.rst b/docs/source/input_files/SUEWS_SiteInfo/SUEWS_Snow.rst index 54cc5b2f9..e60d90350 100644 --- a/docs/source/input_files/SUEWS_SiteInfo/SUEWS_Snow.rst +++ b/docs/source/input_files/SUEWS_SiteInfo/SUEWS_Snow.rst @@ -1,4 +1,4 @@ -.. _SUEWS_Snow.txt: +.. _SUEWS_Snow: SUEWS_Snow.txt ~~~~~~~~~~~~~~ diff --git a/docs/source/input_files/SUEWS_SiteInfo/SUEWS_Soil.rst b/docs/source/input_files/SUEWS_SiteInfo/SUEWS_Soil.rst index 585061ba7..7e1096e68 100644 --- a/docs/source/input_files/SUEWS_SiteInfo/SUEWS_Soil.rst +++ b/docs/source/input_files/SUEWS_SiteInfo/SUEWS_Soil.rst @@ -1,4 +1,4 @@ -.. _SUEWS_Soil.txt: +.. _SUEWS_Soil: SUEWS_Soil.txt ~~~~~~~~~~~~~~ diff --git a/docs/source/input_files/SUEWS_SiteInfo/SUEWS_Veg.rst b/docs/source/input_files/SUEWS_SiteInfo/SUEWS_Veg.rst index ef744f8e7..b611ddc0b 100644 --- a/docs/source/input_files/SUEWS_SiteInfo/SUEWS_Veg.rst +++ b/docs/source/input_files/SUEWS_SiteInfo/SUEWS_Veg.rst @@ -1,4 +1,4 @@ -.. _SUEWS_Veg.txt: +.. _SUEWS_Veg: SUEWS_Veg.txt ~~~~~~~~~~~~~ diff --git a/docs/source/input_files/SUEWS_SiteInfo/SUEWS_Water.rst b/docs/source/input_files/SUEWS_SiteInfo/SUEWS_Water.rst index f35a45c6c..a88120974 100644 --- a/docs/source/input_files/SUEWS_SiteInfo/SUEWS_Water.rst +++ b/docs/source/input_files/SUEWS_SiteInfo/SUEWS_Water.rst @@ -1,4 +1,4 @@ -.. _SUEWS_Water.txt: +.. _SUEWS_Water: SUEWS_Water.txt ~~~~~~~~~~~~~~~ diff --git a/docs/source/input_files/SUEWS_SiteInfo/SUEWS_WithinGridWaterDist.rst b/docs/source/input_files/SUEWS_SiteInfo/SUEWS_WithinGridWaterDist.rst index 6b29f5dcc..b05f7baa4 100644 --- a/docs/source/input_files/SUEWS_SiteInfo/SUEWS_WithinGridWaterDist.rst +++ b/docs/source/input_files/SUEWS_SiteInfo/SUEWS_WithinGridWaterDist.rst @@ -1,4 +1,4 @@ -.. _SUEWS_WithinGridWaterDist.txt: +.. _SUEWS_WithinGridWaterDist: SUEWS_WithinGridWaterDist.txt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/source/input_files/SUEWS_SiteInfo/csv-table/BaseTHDD.csv b/docs/source/input_files/SUEWS_SiteInfo/csv-table/BaseT_HC.csv similarity index 100% rename from docs/source/input_files/SUEWS_SiteInfo/csv-table/BaseTHDD.csv rename to docs/source/input_files/SUEWS_SiteInfo/csv-table/BaseT_HC.csv diff --git a/docs/source/input_files/SUEWS_SiteInfo/csv-table/H_maintain.csv b/docs/source/input_files/SUEWS_SiteInfo/csv-table/H_maintain.csv new file mode 100644 index 000000000..73b556ee6 --- /dev/null +++ b/docs/source/input_files/SUEWS_SiteInfo/csv-table/H_maintain.csv @@ -0,0 +1,2 @@ +"Referencing Table","Requirement","Comment" +"`SUEWS_Irrigation.txt`","`MU`","water depth to maintain used in automatic irrigation." diff --git a/docs/source/input_files/SUEWS_SiteInfo/csv-table/IrrFr_BSoil.csv b/docs/source/input_files/SUEWS_SiteInfo/csv-table/IrrFr_BSoil.csv new file mode 100644 index 000000000..30873b2fe --- /dev/null +++ b/docs/source/input_files/SUEWS_SiteInfo/csv-table/IrrFr_BSoil.csv @@ -0,0 +1,2 @@ +"Referencing Table","Requirement","Comment" +"`SUEWS_SiteSelect.txt`","`MU`","Fraction of bare soil that are irrigated [-]" diff --git a/docs/source/input_files/SUEWS_SiteInfo/csv-table/IrrFr_Bldgs.csv b/docs/source/input_files/SUEWS_SiteInfo/csv-table/IrrFr_Bldgs.csv new file mode 100644 index 000000000..32d8c056c --- /dev/null +++ b/docs/source/input_files/SUEWS_SiteInfo/csv-table/IrrFr_Bldgs.csv @@ -0,0 +1,2 @@ +"Referencing Table","Requirement","Comment" +"`SUEWS_SiteSelect.txt`","`MU`","Fraction of rooftop of buildings (e.g., green roofs) that are irrigated [-]" diff --git a/docs/source/input_files/SUEWS_SiteInfo/csv-table/IrrFr_Paved.csv b/docs/source/input_files/SUEWS_SiteInfo/csv-table/IrrFr_Paved.csv new file mode 100644 index 000000000..2cd752950 --- /dev/null +++ b/docs/source/input_files/SUEWS_SiteInfo/csv-table/IrrFr_Paved.csv @@ -0,0 +1,2 @@ +"Referencing Table","Requirement","Comment" +"`SUEWS_SiteSelect.txt`","`MU`","Fraction of paved surfaces that are irrigated [-]" diff --git a/docs/source/input_files/SUEWS_SiteInfo/csv-table/IrrFr_Water.csv b/docs/source/input_files/SUEWS_SiteInfo/csv-table/IrrFr_Water.csv new file mode 100644 index 000000000..c2d418240 --- /dev/null +++ b/docs/source/input_files/SUEWS_SiteInfo/csv-table/IrrFr_Water.csv @@ -0,0 +1,2 @@ +"Referencing Table","Requirement","Comment" +"`SUEWS_SiteSelect.txt`","`MU`","Fraction of water that are irrigated [-]" diff --git a/docs/source/input_files/SUEWS_SiteInfo/csv-table/SUEWS_AnthropogenicEmission.csv b/docs/source/input_files/SUEWS_SiteInfo/csv-table/SUEWS_AnthropogenicEmission.csv index 29cef8857..523ab0d74 100644 --- a/docs/source/input_files/SUEWS_SiteInfo/csv-table/SUEWS_AnthropogenicEmission.csv +++ b/docs/source/input_files/SUEWS_SiteInfo/csv-table/SUEWS_AnthropogenicEmission.csv @@ -1,6 +1,6 @@ No.,Column Name,Use,Description 1,`Code`,`L`,Code linking to a corresponding look-up table. -2,`BaseTHDD`,`MU`,Base temperature for heating degree days [°C] +2,`BaseT_HC`,`MU`,Base temperature for heating degree days [°C] 3,`QF_A_WD`,`MU` `O`,Base value for QF on weekdays [W |m^-2| (Cap |ha^-1| |)^-1| ] 4,`QF_B_WD`,`MU` `O`,Parameter related to cooling degree days on weekdays [W |m^-2| |K^-1| (Cap |ha^-1| |)^-1|] 5,`QF_C_WD`,`MU` `O`,Parameter related to heating degree days on weekdays [W |m^-2| |K^-1| (Cap |ha^-1| |)^-1|] diff --git a/docs/source/input_files/SUEWS_SiteInfo/csv-table/SUEWS_Irrigation.csv b/docs/source/input_files/SUEWS_SiteInfo/csv-table/SUEWS_Irrigation.csv index 8d297225e..3fde8e895 100644 --- a/docs/source/input_files/SUEWS_SiteInfo/csv-table/SUEWS_Irrigation.csv +++ b/docs/source/input_files/SUEWS_SiteInfo/csv-table/SUEWS_Irrigation.csv @@ -4,23 +4,24 @@ No.,Column Name,Use,Description 3,`Ie_end`,`MU`,Day when irrigation ends [DOY] 4,`InternalWaterUse`,`MU`,Internal water use [mm |h^-1|] 5,`Faut`,`MU`,Fraction of irrigated area that is irrigated using automated systems -6,`Ie_a1`,`MD`,Coefficient for automatic irrigation model [mm |d^-1| ] -7,`Ie_a2`,`MD`,Coefficient for automatic irrigation model [mm |d^-1| |K^-1|] -8,`Ie_a3`,`MD`,Coefficient for automatic irrigation model [mm |d^-2| ] -9,`Ie_m1`,`MD`,Coefficient for manual irrigation model [mm |d^-1| ] -10,`Ie_m2`,`MD`,Coefficient for manual irrigation model [mm |d^-1| |K^-1|] -11,`Ie_m3`,`MD`,Coefficient for manual irrigation model [mm |d^-2| ] -12,`DayWat(1)`,`MU`,"Irrigation allowed on Sundays [1], if not [0]" -13,`DayWat(2)`,`MU`,"Irrigation allowed on Mondays [1], if not [0]" -14,`DayWat(3)`,`MU`,"Irrigation allowed on Tuesdays [1], if not [0]" -15,`DayWat(4)`,`MU`,"Irrigation allowed on Wednesdays [1], if not [0]" -16,`DayWat(5)`,`MU`,"Irrigation allowed on Thursdays [1], if not [0]" -17,`DayWat(6)`,`MU`,"Irrigation allowed on Fridays [1], if not [0]" -18,`DayWat(7)`,`MU`,"Irrigation allowed on Saturdays [1], if not [0]" -19,`DayWatPer(1)`,`MU`,Fraction of properties using irrigation on Sundays [0-1] -20,`DayWatPer(2)`,`MU`,Fraction of properties using irrigation on Mondays [0-1] -21,`DayWatPer(3)`,`MU`,Fraction of properties using irrigation on Tuesdays [0-1] -22,`DayWatPer(4)`,`MU`,Fraction of properties using irrigation on Wednesdays [0-1] -23,`DayWatPer(5)`,`MU`,Fraction of properties using irrigation on Thursdays [0-1] -24,`DayWatPer(6)`,`MU`,Fraction of properties using irrigation on Fridays [0-1] -25,`DayWatPer(7)`,`MU`,Fraction of properties using irrigation on Saturdays [0-1] +6,`H_maintain`,`MU`,"water depth to maintain used in automatic irrigation (e.g., ponding water due to flooding irrigation in rice crop-field) [mm]." +7,`Ie_a1`,`MD`,Coefficient for automatic irrigation model [mm |d^-1| ] +8,`Ie_a2`,`MD`,Coefficient for automatic irrigation model [mm |d^-1| |K^-1|] +9,`Ie_a3`,`MD`,Coefficient for automatic irrigation model [mm |d^-2| ] +10,`Ie_m1`,`MD`,Coefficient for manual irrigation model [mm |d^-1| ] +11,`Ie_m2`,`MD`,Coefficient for manual irrigation model [mm |d^-1| |K^-1|] +12,`Ie_m3`,`MD`,Coefficient for manual irrigation model [mm |d^-2| ] +13,`DayWat(1)`,`MU`,"Irrigation allowed on Sundays [1], if not [0]" +14,`DayWat(2)`,`MU`,"Irrigation allowed on Mondays [1], if not [0]" +15,`DayWat(3)`,`MU`,"Irrigation allowed on Tuesdays [1], if not [0]" +16,`DayWat(4)`,`MU`,"Irrigation allowed on Wednesdays [1], if not [0]" +17,`DayWat(5)`,`MU`,"Irrigation allowed on Thursdays [1], if not [0]" +18,`DayWat(6)`,`MU`,"Irrigation allowed on Fridays [1], if not [0]" +19,`DayWat(7)`,`MU`,"Irrigation allowed on Saturdays [1], if not [0]" +20,`DayWatPer(1)`,`MU`,Fraction of properties using irrigation on Sundays [0-1] +21,`DayWatPer(2)`,`MU`,Fraction of properties using irrigation on Mondays [0-1] +22,`DayWatPer(3)`,`MU`,Fraction of properties using irrigation on Tuesdays [0-1] +23,`DayWatPer(4)`,`MU`,Fraction of properties using irrigation on Wednesdays [0-1] +24,`DayWatPer(5)`,`MU`,Fraction of properties using irrigation on Thursdays [0-1] +25,`DayWatPer(6)`,`MU`,Fraction of properties using irrigation on Fridays [0-1] +26,`DayWatPer(7)`,`MU`,Fraction of properties using irrigation on Saturdays [0-1] diff --git a/docs/source/input_files/SUEWS_SiteInfo/csv-table/SUEWS_SiteSelect.csv b/docs/source/input_files/SUEWS_SiteInfo/csv-table/SUEWS_SiteSelect.csv index ac519e47a..2576d2e95 100644 --- a/docs/source/input_files/SUEWS_SiteInfo/csv-table/SUEWS_SiteSelect.csv +++ b/docs/source/input_files/SUEWS_SiteInfo/csv-table/SUEWS_SiteSelect.csv @@ -19,9 +19,13 @@ No.,Column Name,Use,Description 18,`Fr_Grass`,`MU`,Surface cover fraction of `Grass` [-] 19,`Fr_Bsoil`,`MU`,Surface cover fraction of bare soil or unmanaged land [-] 20,`Fr_Water`,`MU`,Surface cover fraction of open water [-] -21,`IrrFr_EveTr`,`MU`,Fraction of evergreen trees that are irrigated [-] -22,`IrrFr_DecTr`,`MU`,Fraction of deciduous trees that are irrigated [-] +21,`IrrFr_Paved`,`MU`,Fraction of `Paved` that is irrigated [-] +21,`IrrFr_Bldgs`,`MU`,Fraction of `Bldgs` that is irrigated [-] +21,`IrrFr_EveTr`,`MU`,Fraction of `EveTr` that is irrigated [-] +22,`IrrFr_DecTr`,`MU`,Fraction of `DecTr` that is irrigated [-] 23,`IrrFr_Grass`,`MU`,Fraction of `Grass` that is irrigated [-] +23,`IrrFr_BSoil`,`MU`,Fraction of `BSoil` that is irrigated [-] +23,`IrrFr_Water`,`MU`,Fraction of `Water` that is irrigated [-] 24,`H_Bldgs`,`MU`,Mean building height [m] 25,`H_EveTr`,`MU`,Mean height of evergreen trees [m] 26,`H_DecTr`,`MU`,Mean height of deciduous trees [m] diff --git a/docs/source/input_files/SUEWS_SiteInfo/sample-table/SUEWS_SiteSelect.txt b/docs/source/input_files/SUEWS_SiteInfo/sample-table/SUEWS_SiteSelect.txt index 9f265c557..dae111cfc 100644 --- a/docs/source/input_files/SUEWS_SiteInfo/sample-table/SUEWS_SiteSelect.txt +++ b/docs/source/input_files/SUEWS_SiteInfo/sample-table/SUEWS_SiteSelect.txt @@ -1,6 +1,6 @@ -1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 -Grid Year StartDLS EndDLS lat lng Timezone SurfaceArea Alt z id ih imin Fr_Paved Fr_Bldgs Fr_EveTr Fr_DecTr Fr_Grass Fr_Bsoil Fr_Water IrrFr_EveTr IrrFr_DecTr IrrFr_Grass H_Bldgs H_EveTr H_DecTr z0 zd FAI_Bldgs FAI_EveTr FAI_DecTr PopDensDay PopDensNight TrafficRate_WD TrafficRate_WE QF0_BEU_WD QF0_BEU_WE Code_Paved Code_Bldgs Code_EveTr Code_DecTr Code_Grass Code_Bsoil Code_Water LUMPS_DrRate LUMPS_Cover LUMPS_MaxRes NARP_Trans CondCode SnowCode SnowClearingProfWD SnowClearingProfWE AnthropogenicCode IrrigationCode WaterUseProfManuWD WaterUseProfManuWE WaterUseProfAutoWD WaterUseProfAutoWE FlowChange RunoffToWater PipeCapacity GridConnection1of8 Fraction1of8 GridConnection2of8 Fraction2of8 GridConnection3of8 Fraction3of8 GridConnection4of8 Fraction4of8 GridConnection5of8 Fraction5of8 GridConnection6of8 Fraction6of8 GridConnection7of8 Fraction7of8 GridConnection8of8 Fraction8of8 WithinGridPavedCode WithinGridBldgsCode WithinGridEveTrCode WithinGridDecTrCode WithinGridGrassCode WithinGridUnmanBSoilCode WithinGridWaterCode AreaWall Fr_ESTMClass_Paved1 Fr_ESTMClass_Paved2 Fr_ESTMClass_Paved3 Code_ESTMClass_Paved1 Code_ESTMClass_Paved2 Code_ESTMClass_Paved3 Fr_ESTMClass_Bldgs1 Fr_ESTMClass_Bldgs2 Fr_ESTMClass_Bldgs3 Fr_ESTMClass_Bldgs4 Fr_ESTMClass_Bldgs5 Code_ESTMClass_Bldgs1 Code_ESTMClass_Bldgs2 Code_ESTMClass_Bldgs3 Code_ESTMClass_Bldgs4 Code_ESTMClass_Bldgs5 -1 2004 85 302 57.7700 11.8700 2.0000 1.0000 15.0000 10.0000 1.0000 0.0000 0.0000 1.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0010 0.0000 0.0000 0.0100 0.2000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0134 0.0095 0.7442 0.7955 661.0000 662.0000 661.0000 662.0000 663.0000 663.0000 661.0000 0.2500 1.0000 10.0000 1.0000 200.0000 660.0000 660.0000 660.0000 661.0000 660.0000 660.0000 660.0000 660.0000 660.0000 0.0000 0.1000 100.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 661.0000 662.0000 663.0000 664.0000 665.0000 666.0000 667.0000 -999.0000 0.0000 1.0000 0.0000 99999.0000 807.0000 99999.0000 1.0000 0.0000 0.0000 0.0000 0.0000 801.0000 99999.0000 99999.0000 99999.0000 99999.0000 -1 2005 85 302 57.7700 11.8700 2.0000 1.0000 15.0000 10.0000 1.0000 0.0000 0.0000 1.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0010 0.0000 0.0000 0.0100 0.2000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0134 0.0095 0.7442 0.7955 661.0000 662.0000 661.0000 662.0000 663.0000 663.0000 661.0000 0.2500 1.0000 10.0000 1.0000 200.0000 660.0000 660.0000 660.0000 661.0000 660.0000 660.0000 660.0000 660.0000 660.0000 0.0000 0.1000 100.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 661.0000 662.0000 663.0000 664.0000 665.0000 666.0000 667.0000 -999.0000 0.0000 1.0000 0.0000 99999.0000 807.0000 99999.0000 1.0000 0.0000 0.0000 0.0000 0.0000 801.0000 99999.0000 99999.0000 99999.0000 99999.0000 +1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 +Grid Year StartDLS EndDLS lat lng Timezone SurfaceArea Alt z id ih imin Fr_Paved Fr_Bldgs Fr_EveTr Fr_DecTr Fr_Grass Fr_Bsoil Fr_Water IrrFr_Paved IrrFr_Bldgs IrrFr_EveTr IrrFr_DecTr IrrFr_Grass IrrFr_BSoil IrrFr_Water H_Bldgs H_EveTr H_DecTr z0 zd FAI_Bldgs FAI_EveTr FAI_DecTr PopDensDay PopDensNight TrafficRate_WD TrafficRate_WE QF0_BEU_WD QF0_BEU_WE Code_Paved Code_Bldgs Code_EveTr Code_DecTr Code_Grass Code_Bsoil Code_Water LUMPS_DrRate LUMPS_Cover LUMPS_MaxRes NARP_Trans CondCode SnowCode SnowClearingProfWD SnowClearingProfWE AnthropogenicCode IrrigationCode WaterUseProfManuWD WaterUseProfManuWE WaterUseProfAutoWD WaterUseProfAutoWE FlowChange RunoffToWater PipeCapacity GridConnection1of8 Fraction1of8 GridConnection2of8 Fraction2of8 GridConnection3of8 Fraction3of8 GridConnection4of8 Fraction4of8 GridConnection5of8 Fraction5of8 GridConnection6of8 Fraction6of8 GridConnection7of8 Fraction7of8 GridConnection8of8 Fraction8of8 WithinGridPavedCode WithinGridBldgsCode WithinGridEveTrCode WithinGridDecTrCode WithinGridGrassCode WithinGridUnmanBSoilCode WithinGridWaterCode AreaWall Fr_ESTMClass_Paved1 Fr_ESTMClass_Paved2 Fr_ESTMClass_Paved3 Code_ESTMClass_Paved1 Code_ESTMClass_Paved2 Code_ESTMClass_Paved3 Fr_ESTMClass_Bldgs1 Fr_ESTMClass_Bldgs2 Fr_ESTMClass_Bldgs3 Fr_ESTMClass_Bldgs4 Fr_ESTMClass_Bldgs5 Code_ESTMClass_Bldgs1 Code_ESTMClass_Bldgs2 Code_ESTMClass_Bldgs3 Code_ESTMClass_Bldgs4 Code_ESTMClass_Bldgs5 +1 2004 85 302 57.7700 11.8700 2.0000 1.0000 15.0000 50.0000 1.0000 0.0000 0.0000 0.2000 0.2000 0.2000 0.1000 0.1000 0.1000 0.1000 0.0 0.0 0.0000 0.0000 0.0000 0.0 0.0 15.00 15.000 15.000 0.0100 0.2000 0.3000 0.3000 0.3000 0.0000 0.0000 0.0134 0.0095 0.7442 0.7955 661.0000 662.0000 661.0000 662.0000 663.0000 663.0000 661.0000 0.2500 1.0000 10.0000 1.0000 200.0000 660.0000 660.0000 660.0000 661.0000 660.0000 660.0000 660.0000 660.0000 660.0000 0.0000 0.1000 100.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 661.0000 662.0000 663.0000 664.0000 665.0000 666.0000 667.0000 -999.0000 0.0000 1.0000 0.0000 99999.0000 807.0000 99999.0000 1.0000 0.0000 0.0000 0.0000 0.0000 801.0000 99999.0000 99999.0000 99999.0000 99999.0000 +1 2005 85 302 57.7700 11.8700 2.0000 1.0000 15.0000 50.0000 1.0000 0.0000 0.0000 0.2000 0.2000 0.2000 0.1000 0.1000 0.1000 0.1000 0.0 0.0 0.0000 0.0000 0.0000 0.0 0.0 1.00 1.000 1.000 0.0100 0.2000 0.3000 0.3000 0.3000 0.0000 0.0000 0.0134 0.0095 0.7442 0.7955 661.0000 662.0000 661.0000 662.0000 663.0000 663.0000 661.0000 0.2500 1.0000 10.0000 1.0000 200.0000 660.0000 660.0000 660.0000 661.0000 660.0000 660.0000 660.0000 660.0000 660.0000 0.0000 0.1000 100.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 661.0000 662.0000 663.0000 664.0000 665.0000 666.0000 667.0000 -999.0000 0.0000 1.0000 0.0000 99999.0000 807.0000 99999.0000 1.0000 0.0000 0.0000 0.0000 0.0000 801.0000 99999.0000 99999.0000 99999.0000 99999.0000 -9 -9 diff --git a/docs/source/input_files/input_converter.rst b/docs/source/input_files/input_converter.rst index 7ab5dd6c7..48c6afab1 100644 --- a/docs/source/input_files/input_converter.rst +++ b/docs/source/input_files/input_converter.rst @@ -3,48 +3,24 @@ SUEWS input converter ******************************** -SUEWS input converter is a Python 3 script to convert input files between different versions based on pre-defined rules. - -How to use ----------------- -`Download the converter script and rule.csv ` below, and specify these arguments in the script: - -#. :code:`fromVer`: which version to convert from. -#. :code:`toVer`: which version to convert to. -#. :code:`fromDir`: where the input files are located. -#. :code:`toDir`: where the converted files are produced. - - -.. _download_converter: - -Downloads ----------------- - -- SUEWS input converter in python - - :download:`SUEWS_TableConverter.py ` +.. note:: + The SUEWS table converter has been integrated into SuPy as a command line tool :ref:`suews-convert` since v2020a. + Please install SuPy and run :ref:`suews-convert` to convert input tables from an older version to a newer one. +Usage +----- -- Rules for conversions between different SUEWS versions +Please refer to the :ref:`SuPy API page `. - :download:`rules.csv ` -Description of rules --------------------- -The converter currently picks up the following types of actions: +Example (from 2018a to 2020a) +----------------------------- -#. Add: New entries or files to be added with default values. -#. Rename: Entries to be renamed from one version to another. -#. Delete: Entries to be deleted from one version to another. -.. note:: +Assuming your 2018a files are all included in the folder ``your_2018a_folder`` and your desirable converted files should be placed in a new folder ``your_2020a_folder``, please do the following in your command line tool: - For entries introduced in a version via a new file, the new file will be created to hold the new entries without extra delaration for new files. +.. code-block:: shell -The current available rules are listed below: + suews-convert -f 2018a -t 2020a -i your_2018a_folder -o your_2020a_folder -.. csv-table:: - :class: longtable - :file: rules.csv - :header-rows: 1 - :widths: auto +.. tip:: `suews-convert` will use the ``RunControl.nml`` file in your original folder to determine the location of input tables. diff --git a/docs/source/prepare-to-run-the-model.rst b/docs/source/prepare-to-run-the-model.rst index 394835f92..3b8bdfeab 100644 --- a/docs/source/prepare-to-run-the-model.rst +++ b/docs/source/prepare-to-run-the-model.rst @@ -140,7 +140,8 @@ The information required to run SUEWS for your site consists of: land cover, heights of buildings and trees, radiative characteristics (e.g. albedo, emissivity), drainage characteristics, soil characteristics, snow characteristics, phenological characteristics - (e.g. seasonal cycle of LAI). + (e.g. seasonal cycle of LAI). For guidance on how to derive parameters related to + LAI, albedo, surface conductance and surface roughness, the reader is referred to this `link `_. #. Information about *human behaviour*, including energy use and water use (e.g. for irrigation or street cleaning) and snow clearing (if applicable). The anthropogenic energy use and water use may be diff --git a/docs/source/version-history/dev.rst b/docs/source/version-history/dev.rst index 3a72ba814..0171943de 100644 --- a/docs/source/version-history/dev.rst +++ b/docs/source/version-history/dev.rst @@ -5,17 +5,17 @@ **THIS RELEASE IS ONLY FOR VALIDATING THE SUEWS CI WORKFLOW.** -Version in Development +Version 2020b (in development) ---------------------------------------------------- - **Improvement** - None. + 1. TO ADD - **Changes** - None. + 1. TO ADD - **Fix** diff --git a/docs/source/version-history/v2019a.rst b/docs/source/version-history/v2019a.rst index 85fc01645..50c3e11ca 100644 --- a/docs/source/version-history/v2019a.rst +++ b/docs/source/version-history/v2019a.rst @@ -1,5 +1,4 @@ -.. _new_latest: .. _new_2019a: diff --git a/docs/source/version-history/v2020a.rst b/docs/source/version-history/v2020a.rst new file mode 100644 index 000000000..9eb9dd8eb --- /dev/null +++ b/docs/source/version-history/v2020a.rst @@ -0,0 +1,50 @@ + +.. _new_latest: + +.. _new_2020a: + +Version 2020a (Released on 14 May 2020) +---------------------------------------------------- + +.. note:: + In a future release, we will **ONLY** deliver SUEWS along with `SuPy `_ as a command line tool `suews-run`: release of standalone SUEWS binaries **will be stopped** to ease our maintenance load and to facilitate rapid developments. + Users will need to have Python 3.6+ to install SuPy: + + .. code-block:: shell + + python3 -m pip install -U supy + + However, as the source code of SUEWS are public, users can feel free to compile standalone binaries for platforms of their own interests. + + +- **Improvement** + + #. A ponding water scheme is added in the automatic irrigation calculation; useful when a certain depth of ponding water to maintain in irrigation (e.g., flooding irrigation in rice crop-field). + + #. Irrigation fraction can be specified for all surfaces (previously only available for vegetated surfaces) + + #. A U-shape approach for calculating HDD/CDD is introduced to account for a wide comfort zone between heating and cooling critical temperatures. + + + +- **Changes** + + #. A new `RoughLenHeatMethod` option `5`: adaptively choose option `1` for fully pervious surface or `2` otherwise (if any impervious surface exists). + + #. A new column `H_maintain` is added in `SUEWS_Irrigation.txt` to set ponding water depth. + + #. New columns to specify irrigation fractions for non-vegetated surfaces in `SUEWS_SiteSelect.txt`. + + #. A new `scheme option <:ref:scheme_options>`_ `BaseTMethod` in `RunControl.nml` to set calculation scheme for HDD/CDD. + +- **Fix** + + NONE. + + +- **Known issues** + + #. Wind direction is not currently downscaled so non -999 values will cause an error. + + + diff --git a/docs/source/version-history/version-history.rst b/docs/source/version-history/version-history.rst index 54ea3096d..f1235ffcb 100644 --- a/docs/source/version-history/version-history.rst +++ b/docs/source/version-history/version-history.rst @@ -7,6 +7,7 @@ Version History .. toctree:: :maxdepth: 1 + v2020a v2019a v2018c v2018b diff --git a/supy-driver/setup.py b/supy-driver/setup.py index 1638201b1..f9881d4be 100644 --- a/supy-driver/setup.py +++ b/supy-driver/setup.py @@ -147,7 +147,7 @@ def is_pure(self): setup( name="supy_driver", # update version info here! - version=get_suews_version(ver_minor=1), + version=get_suews_version(ver_minor=9), description="the SUEWS driver driven by f2py", long_description=readme(), url="https://github.com/sunt05/SuPy", diff --git a/supy-driver/supy_driver/version.py b/supy-driver/supy_driver/version.py index 5219e3d4d..a6d045863 100644 --- a/supy-driver/supy_driver/version.py +++ b/supy-driver/supy_driver/version.py @@ -1 +1 @@ -__version__='2019b5' \ No newline at end of file +__version__='2020a8' \ No newline at end of file