Skip to content

Commit

Permalink
Merge pull request #25 from lreis2415/dev
Browse files Browse the repository at this point in the history
unified coding style of python scripts
  • Loading branch information
lreis-2415 authored Sep 4, 2017
2 parents e15db22 + abec3a5 commit 90bc20d
Show file tree
Hide file tree
Showing 112 changed files with 4,185 additions and 3,190 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,9 @@ dist
# ignore doxygen files
doc/html
doc/img/
#nfs files on linux
.nfs*

# add nogit directory which contains personal test code
seims/nogit
seims/nogit/*
5 changes: 5 additions & 0 deletions TODO/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,10 @@
~~利用[DownloadProject](https://github.com/Crascit/DownloadProject)在CMake构建工程的时候自动克隆[GoogleTest](https://github.com/google/googletest),并在项目编译之前自动编译,从而可供UnitTest自动构建、测试。在CMake命令后追加`-DUNITTEST=1`开启单元测试。参考[这篇博客](https://crascit.com/2015/07/25/cmake-gtest/)~~
目前,基于gtest/gmock的单元测试框架已经搭建好,后续写模块的过程中应当同步写单元测试代码!
+ 9.增加flood模拟方法。如openLISEM
+ 10.增加泥沙汇流模块,采用水流功率模型计算,目前需将SWAT中的4种模型集成进来:
+ ~~Simplified Bagnold model (DONE)~~
+ Kodatie model (for streams with bed material size ranging from silt to gravel)
+ Molinas and Wu model (for primarily sand size particles)
+ Yang sand and gravel model (for primarily sand and gravel size particles)


Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
## ORGP: Organic phosphorus concentration kg/'size'/day
## CAPEX: capital expenditures RMB/'size'
## OPEX: operation expenses RMB/'size'/year
## INCOME: additional incoime RMB/'size'/year
## INCOME: additional income RMB/'size'/year
SUBSCENARIO,NAME,ARSRC,SEQUENCE,SYear,SMonth,SDay,EYear,EMonth,EDay,Q,SED,TN,NO3,NH4,ORGN,TP,SOLP,ORGP,COD,CAPEX,OPEX,INCOME
10001,traditional,10000,0,-9999,-9999,-9999,-9999,-9999,-9999,0,0,0,0,0,0,0,0,0,0,0,0,0
9 changes: 7 additions & 2 deletions data/dianbu/data_prepare/management2/BMP_scenarios.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
ID,NAME,BMPID,SUBSCENARIO,DISTRIBUTION,COLLECTION,LOCATION
0,Base1,12,0,RASTER|MGT_FIELDS,plant_management,ALL
0,Base1,12,1,RASTER|MGT_FIELDS,plant_management,ALL
0,Base1,17,1,RASTER|MGT_FIELDS,areal_struct_management,1-2-3
0,Base1,17,2,RASTER|MGT_FIELDS,areal_struct_management,4-5-6
0,Base1,17,3,RASTER|MGT_FIELDS,areal_struct_management,7-8-9
0,Base1,17,4,RASTER|MGT_FIELDS,areal_struct_management,10-11
0,Base1,17,5,RASTER|MGT_FIELDS,areal_struct_management,12
0,Base1,12,0,RASTER|LANDUSE,plant_management,ALL
0,Base1,12,1,RASTER|LANDUSE,plant_management,ALL
0,Base1,1,10001,ARRAY|point_source_distribution|10000,point_source_management,10001-10002
0,Base1,1,20001,ARRAY|point_source_distribution|20000,point_source_management,20001-20002-20003-20004-20005-20006-20007-20008-20009-20010-20011-20012-20013-20014-20015-20016-20017-20018-20019-20020-20021-20022-20023-20024-20025-20026-20027-20028
0,Base1,1,40001,ARRAY|point_source_distribution|40000,point_source_management,40001
Expand Down
18 changes: 18 additions & 0 deletions data/dianbu/data_prepare/management2/areal_struct_management.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## This file define areal structural BMPs parameters.
# SUBSCENARIO: BMP unique ID
# NAME: BMP Name
# DESC: BMP Description
# REFERENCE: Literature reference
# LANDUSE: Suitable landuse ID, if not sure, please fill in 'ALL', separated by '-', such as '2-4'
# PARAMETERS: Spatial parameters that the BMP affects, the format MUST be:
# NAME1:DESC1:CHANGE1:IMPACT1-NAME2:DESC2:CHANGE2:IMPACT2-...
# where, NAME is the parameter's ID, which will be one of the GridFS file in SPATIAL.files
# DESC is the corresponding description
# CHANGE is the change method, which can be VC,RC,AC. VC: replace, RC: multiply, AC: add.
# IMPACT is the impact value.
SUBSCENARIO,NAME,DESC,REFERENCE,LANDUSE,PARAMETERS
1,fengjin,fengjin,fengjin,7-16,Interc_max:Maximum Interception Capacity:AC:1-Conductivity:Soil hydraulic conductivity:RC:3.5-USLE_C:Cover management factor:VC:0.0008-USLE_K:Soil erodibility factor:RC:0.64
2,shengtailincao,shengtailincao,shengtailincao,4-7-16-33,Interc_max:Maximum Interception Capacity:AC:2.5-Depression:Depression storage capacity:RC:2-Conductivity:Soil hydraulic conductivity:RC:5-USLE_C:Cover management factor:VC:0.0012-USLE_K:Soil erodibility factor:RC:0.095-USLE_P:the erosion control practice factor:RC:0.8
3,jingjilinguo,jingjilinguo,jingjilinguo,4-7-16-33,Interc_max:Maximum Interception Capacity:AC:1.5-Depression:Depression storage capacity:RC:5-Conductivity:Soil hydraulic conductivity:RC:4-USLE_C:Cover management factor:VC:0.0015-USLE_K:Soil erodibility factor:RC:0.65-USLE_P:the erosion control practice factor:RC:0.6
4,dixiaolingaizao,dixiaolingaizao,dixiaolingaizao,7-16,Interc_max:Maximum Interception Capacity:AC:2.5-Depression:Depression storage capacity:RC:1.5-Conductivity:Soil hydraulic conductivity:RC:3.5-USLE_C:Cover management factor:VC:0.0024-USLE_K:Soil erodibility factor:RC:0.98-USLE_P:the erosion control practice factor:RC:0.8
5,chaguoyuanpogaiti,chaguoyuanpogaiti,chaguoyuanpogaiti,4-7-16,Interc_max:Maximum Interception Capacity:AC:1-Depression:Depression storage capacity:RC:5-Conductivity:Soil hydraulic conductivity:RC:3-USLE_C:Cover management factor:VC:0.0008-USLE_K:Soil erodibility factor:RC:0.78-USLE_P:the erosion control practice factor:RC:0.3-Slope:Slope:VC:0.001
3 changes: 2 additions & 1 deletion data/examples/1.preprocess/dianbu2_30m_omp_dgpm.ini
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ landuseFile = landuse_30m.tif
landcoverInitFile = landcover_initial_parameters.txt
soilSEQNFile = soil_SEQN_30m.tif
soilSEQNText = soil_properties_lookup.txt
mgtFieldFile = mgtfield_t100_2.tif

additionalFile = {"MGT_FIELDS": "mgtfield_t100_2.tif"}

[OPTIONAL_PARAMETERS]
isTauDEMD8 = True
Expand Down
3 changes: 2 additions & 1 deletion data/examples/1.preprocess/dianbu2_30m_omp_mac.ini
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ landuseFile = landuse_30m.tif
landcoverInitFile = landcover_initial_parameters.txt
soilSEQNFile = soil_SEQN_30m.tif
soilSEQNText = soil_properties_lookup.txt
mgtFieldFile = mgtfield_t100_2.tif

additionalFile = {"MGT_FIELDS": "mgtfield_t100_2.tif"}

[OPTIONAL_PARAMETERS]
isTauDEMD8 = True
Expand Down
3 changes: 2 additions & 1 deletion data/examples/1.preprocess/dianbu2_30m_omp_win.ini
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ landuseFile = landuse_30m.tif
landcoverInitFile = landcover_initial_parameters.txt
soilSEQNFile = soil_SEQN_30m.tif
soilSEQNText = soil_properties_lookup.txt
mgtFieldFile = mgtfield_t100_2.tif

additionalFile = {"MGT_FIELDS": "mgtfield_t100_2.tif"}

[OPTIONAL_PARAMETERS]
isTauDEMD8 = True
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
### ZHU LJ-Windows-T430
[PATH]
MODEL_DIR = C:\z_code\Hydro\SEIMS\data\dianbu\model_dianbu2_30m_demo
ScenarioID = 0

[MONGODB]
HOSTNAME = 127.0.0.1
PORT = 27017
ClimateDBName = HydroClimate_dianbu2_demo
BMPScenarioDBName = BMP_Scenario_dianbu2_30m_demo
SpatialDBName = model_dianbu2_30m_demo

[PARAMETERS]
PLOT_SUBBASINID = 4
PLOT_VARIABLES = Q QI QG QS CH_COD CH_TP CH_TN CH_NO3 CH_NH4 CH_ORGN SED GWNO3 PERCO_N_GW SUR_NO3_TOCH SUR_SOLP_TOCH CH_SOLP
[OPTIONAL_PARAMETERS]
#UTCTIME
Time_start = 2013-01-01
Time_end = 2013-12-31
Resolution = 300
[SWITCH]
LANG_CN = False
18 changes: 0 additions & 18 deletions data/examples/3.postprocess/post_dianbu_30m_longterm_omp_dgpm.ini

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

8 changes: 4 additions & 4 deletions data/examples/5.scenarios/dgpm_hosts_SCOOP
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dgpm-cluster.local 1
dgpm-compute-1.local 2
dgpm-compute-2.local 2
dgpm-compute-3.local 2
dgpm-cluster.local 1
dgpm-compute-1.local 2
dgpm-compute-2.local 2
dgpm-compute-3.local 2
dgpm-compute-4.local 2
78 changes: 39 additions & 39 deletions data/examples/5.scenarios/nsgaii_dianbu2_30m_longterm_omp_dgpm.ini
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
# Linux-cluster 192.168.6.55, logged in with user: zhulj

[PATH]
MODEL_DIR = /home/zhulj/SEIMS/models
fieldFile = /home/zhulj/SEIMS/models/dianbu/data_prepare/spatial/mgtfield_t100_2.txt
pointFile = /home/zhulj/SEIMS/models/dianbu/data_prepare/management2/point_source_distribution.txt
pointBMPsFile = /home/zhulj/SEIMS/models/dianbu/data_prepare/management2/point_source_management.txt

[NSGAII]
GenerationsNum = 2
PopulationSize = 4
CrossoverRate = 0.75
MutateRate = 0.05

[MONGODB]
HOSTNAME = 192.168.6.55
PORT = 27017
BMPScenarioDBName = BMP_Scenario_dianbu2_30m_longterm

[SEIMS_Model]
model_Exe = /home/zhulj/SEIMS/seims_omp_rel_x86-201611/seims_omp
model_Workdir = /home/zhulj/SEIMS/models/dianbu/model_dianbu2_30m_longterm
threadsNum = 4
layeringMethod = 0
timeStart = 2014-01-01
timeEnd = 2014-12-31

[BMPs]
# BMPs
bmps_farm = 0 1
# bmps_cattle = 1 2 3 4
bmps_cattle = 2 3
# bmps_pig = 1 2 3 4
bmps_pig = 2 3
bmps_sewage = 1 2 3 4 5 6 7 8
# BMPs cost (Index Correspond with BMPs id, e.g.)
bmps_farm_cost = 208. 166.
bmps_cattle_cost = 0. 15. 15. 160. 15.
bmps_pig_cost = 0. 6. 6. 70. 6.
# Linux-cluster 192.168.6.55, logged in with user: zhulj

[PATH]
MODEL_DIR = /home/zhulj/SEIMS/models
fieldFile = /home/zhulj/SEIMS/models/dianbu/data_prepare/spatial/mgtfield_t100_2.txt
pointFile = /home/zhulj/SEIMS/models/dianbu/data_prepare/management2/point_source_distribution.txt
pointBMPsFile = /home/zhulj/SEIMS/models/dianbu/data_prepare/management2/point_source_management.txt

[NSGAII]
GenerationsNum = 2
PopulationSize = 4
CrossoverRate = 0.75
MutateRate = 0.05

[MONGODB]
HOSTNAME = 192.168.6.55
PORT = 27017
BMPScenarioDBName = BMP_Scenario_dianbu2_30m_longterm

[SEIMS_Model]
model_Exe = /home/zhulj/SEIMS/seims_omp_rel_x86-201611/seims_omp
model_Workdir = /home/zhulj/SEIMS/models/dianbu/model_dianbu2_30m_longterm
threadsNum = 4
layeringMethod = 0
timeStart = 2014-01-01
timeEnd = 2014-12-31

[BMPs]
# BMPs
bmps_farm = 0 1
# bmps_cattle = 1 2 3 4
bmps_cattle = 2 3
# bmps_pig = 1 2 3 4
bmps_pig = 2 3
bmps_sewage = 1 2 3 4 5 6 7 8
# BMPs calculate_economy (Index Correspond with BMPs id, e.g.)
bmps_farm_cost = 208. 166.
bmps_cattle_cost = 0. 15. 15. 160. 15.
bmps_pig_cost = 0. 6. 6. 70. 6.
bmps_sewage_cost = 0. 1000. 1000. 1000. 1000. 8000.15 8000.15 8000.15 8000.15
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
## GaoHR-Windows

[PATH]
MODEL_DIR = D:\GaohrWS\GithubPrj\SEIMS\model_data
fieldFile = D:\GaohrWS\GithubPrj\SEIMS\model_data\dianbu\data_prepare\spatial\mgtfield_t100_2.txt
pointFile = D:\GaohrWS\GithubPrj\SEIMS\model_data\dianbu\data_prepare\management2\point_source_distribution.txt
pointBMPsFile = D:\GaohrWS\GithubPrj\SEIMS\model_data\dianbu\data_prepare\management2\point_source_management.txt
scenariosInfo = D:\SEIMS_model\Model_data\model_dianbu2_30m_longterm\NSGAII_OUTPUT\scenarios_info.txt

[NSGAII]
GenerationsNum = 2
PopulationSize = 4
CrossoverRate = 0.75
MutateRate = 0.1
SelectRate = 0.25

[MONGODB]
HOSTNAME = 192.168.6.55
PORT = 27017
BMPScenarioDBName = BMP_Scenario_dianbu2_30m_longterm

[SEIMS_Model]
model_Exe = D:\SEIMS_model\SEIMS\Release\seims_omp
model_Workdir = D:\SEIMS_model\Model_data\model_dianbu2_30m_longterm
threadsNum = 2
layeringMethod = 0
timeStart = 2014-01-01
timeEnd = 2014-12-31

[BMPs]
# BMPs
bmps_farm = 0 1
# bmps_cattle = 1 2 3 4
bmps_cattle = 2 3
# bmps_pig = 1 2 3 4
bmps_pig = 2 3
bmps_sewage = 1 2 3 4 5 6 7 8
# BMPs cost (Index Correspond with BMPs id, e.g.)
bmps_farm_cost = 208000. 166000.
bmps_cattle_cost = 0. 15. 15. 160. 15.
bmps_pig_cost = 0. 6. 6. 70. 6.
bmps_sewage_cost = 0. 2000. 2000. 2000. 2000. 8000.15 8000.15 8000.15 8000.15

## GaoHR-Windows

[PATH]
MODEL_DIR = D:\GaohrWS\GithubPrj\SEIMS\model_data
fieldFile = D:\GaohrWS\GithubPrj\SEIMS\model_data\dianbu\data_prepare\spatial\mgtfield_t100_2.txt
pointFile = D:\GaohrWS\GithubPrj\SEIMS\model_data\dianbu\data_prepare\management2\point_source_distribution.txt
pointBMPsFile = D:\GaohrWS\GithubPrj\SEIMS\model_data\dianbu\data_prepare\management2\point_source_management.txt
scenariosInfo = D:\SEIMS_model\Model_data\model_dianbu2_30m_longterm\NSGAII_OUTPUT\scenarios_info.txt

[NSGAII]
GenerationsNum = 2
PopulationSize = 4
CrossoverRate = 0.75
MutateRate = 0.1
SelectRate = 0.25

[MONGODB]
HOSTNAME = 192.168.6.55
PORT = 27017
BMPScenarioDBName = BMP_Scenario_dianbu2_30m_longterm

[SEIMS_Model]
model_Exe = D:\SEIMS_model\SEIMS\Release\seims_omp
model_Workdir = D:\SEIMS_model\Model_data\model_dianbu2_30m_longterm
threadsNum = 2
layeringMethod = 0
timeStart = 2014-01-01
timeEnd = 2014-12-31

[BMPs]
# BMPs
bmps_farm = 0 1
# bmps_cattle = 1 2 3 4
bmps_cattle = 2 3
# bmps_pig = 1 2 3 4
bmps_pig = 2 3
bmps_sewage = 1 2 3 4 5 6 7 8
# BMPs calculate_economy (Index Correspond with BMPs id, e.g.)
bmps_farm_cost = 208000. 166000.
bmps_cattle_cost = 0. 15. 15. 160. 15.
bmps_pig_cost = 0. 6. 6. 70. 6.
bmps_sewage_cost = 0. 2000. 2000. 2000. 2000. 8000.15 8000.15 8000.15 8000.15

Loading

0 comments on commit 90bc20d

Please sign in to comment.