Skip to content

Commit

Permalink
Adding more testing and documentation in support of PR to merge LGART…
Browse files Browse the repository at this point in the history
…O to main. Here, I have included a notebook called LGARTO_demo, in tests, that demonstrates that there are not significant changes between LGAR and LGARTO with TO_enabled set to false. I have included the stability tests, which currently yield no unstable model runs over 160k parameter set and forcing dataset combinations, across both options for TO_enabled. I have also included notebooks that compare HYDRUS and LGARTO results for 4 short, synthetic simulations, and 4 year long simulations using real forcing and soils data from USDA SCAN sites. Finally, I have added notebooks that animate LGARTO simulations, which helps a lot with visualization and communication. Also minor edits to documentation of lgar.cxx, and moderate edits to the readme in the tests directory.
  • Loading branch information
Peter La Follette authored and Peter La Follette committed Oct 25, 2024
1 parent ac14a69 commit 492cc5e
Show file tree
Hide file tree
Showing 73 changed files with 234,647 additions and 387 deletions.
18 changes: 18 additions & 0 deletions configs/config_lasam_LHS_Geneva_1_layer.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
verbosity=none
forcing_file=./forcing/forcing_data_resampled_uniform_Geneva.txt
soil_params_file=./data/vG_default_params_LHS_Geneva_3_layer.dat
layer_thickness=100.0[cm]
initial_psi=2432.3485[cm]
timestep=300[sec]
endtime=8760[hr]
forcing_resolution=3600[sec]
ponded_depth_max=5[cm]
use_closed_form_G=true
layer_soil_type=1
max_valid_soil_types=25
wilting_point_psi=15495.0[cm]
field_capacity_psi=340.62081000000006[cm]
root_zone_depth=55.0[cm]
giuh_ordinates=0.06,0.51,0.28,0.12,0.03
adaptive_timestep=true
TO_enabled=true
18 changes: 18 additions & 0 deletions configs/config_lasam_LHS_Geneva_3_layer.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
verbosity=none
forcing_file=./forcing/forcing_data_resampled_uniform_Geneva.txt
soil_params_file=./data/vG_default_params_LHS_Geneva_3_layer.dat
layer_thickness=25.0,50.0,100.0[cm]
initial_psi=1551.1954999999998[cm]
timestep=300[sec]
endtime=8760[hr]
forcing_resolution=3600[sec]
ponded_depth_max=0[cm]
use_closed_form_G=true
layer_soil_type=1,2,3
max_valid_soil_types=25
wilting_point_psi=15495.0[cm]
field_capacity_psi=330.39557[cm]
root_zone_depth=55.0[cm]
giuh_ordinates=0.06,0.51,0.28,0.12,0.03
adaptive_timestep=true
TO_enabled=true
18 changes: 18 additions & 0 deletions configs/config_lasam_LHS_Koptis_Farms_1_layer.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
verbosity=none
forcing_file=./forcing/forcing_data_resampled_uniform_Koptis_Farms.txt
soil_params_file=./data/vG_default_params_LHS_Koptis_Farms_3_layer.dat
layer_thickness=100.0[cm]
initial_psi=1760.7945[cm]
timestep=300[sec]
endtime=8760[hr]
forcing_resolution=3600[sec]
ponded_depth_max=0[cm]
use_closed_form_G=true
layer_soil_type=1
max_valid_soil_types=25
wilting_point_psi=15495.0[cm]
field_capacity_psi=438.41865[cm]
root_zone_depth=55.0[cm]
giuh_ordinates=0.06,0.51,0.28,0.12,0.03
adaptive_timestep=true
TO_enabled=true
18 changes: 18 additions & 0 deletions configs/config_lasam_LHS_Koptis_Farms_3_layer.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
verbosity=none
forcing_file=./forcing/forcing_data_resampled_uniform_Koptis_Farms.txt
soil_params_file=./data/vG_default_params_LHS_Koptis_Farms_3_layer.dat
layer_thickness=25.0,50.0,100.0[cm]
initial_psi=1543.7205000000001[cm]
timestep=300[sec]
endtime=8760[hr]
forcing_resolution=3600[sec]
ponded_depth_max=0[cm]
use_closed_form_G=true
layer_soil_type=1,2,3
max_valid_soil_types=25
wilting_point_psi=15495.0[cm]
field_capacity_psi=147.96109[cm]
root_zone_depth=55.0[cm]
giuh_ordinates=0.06,0.51,0.28,0.12,0.03
adaptive_timestep=true
TO_enabled=true
19 changes: 19 additions & 0 deletions configs/config_lasam_LHS_Kukuihaele_1_layer.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
verbosity=none
forcing_file=./forcing/forcing_data_resampled_uniform_Kukuihaele.txt
soil_params_file=./data/vG_default_params_LHS_humid_1_layer.dat
layer_thickness=100.0[cm]
initial_psi=2040.6585[cm]
timestep=300[sec]
endtime=8760[hr]
forcing_resolution=3600[sec]
ponded_depth_max=2[cm]
use_closed_form_G=true
layer_soil_type=1
max_valid_soil_types=25
wilting_point_psi=15495.0[cm]
field_capacity_psi=189.01391[cm]
root_zone_depth=55.0[cm]
giuh_ordinates=0.06,0.51,0.28,0.12,0.03
adaptive_timestep=true
TO_enabled=false
free_drainage_enabled=true
19 changes: 19 additions & 0 deletions configs/config_lasam_LHS_Kukuihaele_3_layer.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
verbosity=none
forcing_file=./forcing/forcing_data_resampled_uniform_Kukuihaele.txt
soil_params_file=./data/vG_default_params_LHS_humid_3_layer.dat
layer_thickness=25.0,50.0,100.0[cm]
initial_psi=2040.6585[cm]
timestep=300[sec]
endtime=8760[hr]
forcing_resolution=3600[sec]
ponded_depth_max=2[cm]
use_closed_form_G=true
layer_soil_type=1,2,3
max_valid_soil_types=25
wilting_point_psi=15495.0[cm]
field_capacity_psi=189.01391[cm]
root_zone_depth=55.0[cm]
giuh_ordinates=0.06,0.51,0.28,0.12,0.03
adaptive_timestep=true
TO_enabled=false
free_drainage_enabled=true
18 changes: 18 additions & 0 deletions configs/config_lasam_LHS_Onward_1_layer.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
verbosity=none
forcing_file=./forcing/forcing_data_resampled_uniform_Onward.txt
soil_params_file=./data/vG_default_params_LHS_Onward_3_layer.dat
layer_thickness=100.0[cm]
initial_psi=438.61650000000003[cm]
timestep=300[sec]
endtime=8760[hr]
forcing_resolution=3600[sec]
ponded_depth_max=5[cm]
use_closed_form_G=true
layer_soil_type=1
max_valid_soil_types=25
wilting_point_psi=15495.0[cm]
field_capacity_psi=409.10967000000005[cm]
root_zone_depth=55.0[cm]
giuh_ordinates=0.06,0.51,0.28,0.12,0.03
adaptive_timestep=true
TO_enabled=true
18 changes: 18 additions & 0 deletions configs/config_lasam_LHS_Onward_3_layer.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
verbosity=none
forcing_file=./forcing/forcing_data_resampled_uniform_Onward.txt
soil_params_file=./data/vG_default_params_LHS_Onward_3_layer.dat
layer_thickness=25.0,50.0,100.0[cm]
initial_psi=2909.8515[cm]
timestep=300[sec]
endtime=8760[hr]
forcing_resolution=3600[sec]
ponded_depth_max=0[cm]
use_closed_form_G=true
layer_soil_type=1,2,3
max_valid_soil_types=25
wilting_point_psi=15495.0[cm]
field_capacity_psi=274.35923[cm]
root_zone_depth=55.0[cm]
giuh_ordinates=0.06,0.51,0.28,0.12,0.03
adaptive_timestep=true
TO_enabled=true
18 changes: 18 additions & 0 deletions configs/config_lasam_LHS_Phillipsburg.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
verbosity=none
forcing_file=./forcing/forcing_data_resampled_uniform_Phillipsburg.csv
soil_params_file=./data/vG_default_params_LHS_arid.dat
layer_thickness=200.0[cm]
initial_psi=2990.2825000000003[cm]
timestep=300[sec]
endtime=7500.0[hr]
forcing_resolution=3600[sec]
ponded_depth_max=0[cm]
use_closed_form_G=true
layer_soil_type=1
max_valid_soil_types=25
wilting_point_psi=15495.0[cm]
field_capacity_psi=283.97703000000007[cm]
root_zone_depth=55.0[cm]
giuh_ordinates=0.06,0.51,0.28,0.12,0.03
adaptive_timestep=true
TO_enabled=false
18 changes: 18 additions & 0 deletions configs/config_lasam_LHS_Phillipsburg_3_layer.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
verbosity=none
forcing_file=./forcing/forcing_data_resampled_uniform_Phillipsburg.csv
soil_params_file=./data/vG_default_params_LHS_arid_3_layer.dat
layer_thickness=25.0,50.0,100.0[cm]
initial_psi=2040.6585[cm]
timestep=300[sec]
endtime=7500.0[hr]
forcing_resolution=3600[sec]
ponded_depth_max=2[cm]
use_closed_form_G=true
layer_soil_type=1,2,3
max_valid_soil_types=25
wilting_point_psi=15495.0[cm]
field_capacity_psi=189.01391[cm]
root_zone_depth=55.0[cm]
giuh_ordinates=0.06,0.51,0.28,0.12,0.03
adaptive_timestep=true
TO_enabled=false
2 changes: 1 addition & 1 deletion configs/config_lasam_Phillipsburg.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ initial_psi=2000.0[cm]
timestep=300[sec]
endtime=7500.0[hr]
forcing_resolution=3600[sec]
ponded_depth_max=0[cm]
ponded_depth_max=2[cm]
use_closed_form_G=false
layer_soil_type=13,14,15
max_valid_soil_types=25
Expand Down
19 changes: 19 additions & 0 deletions data/vG_default_params_LHS.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"Texture theta_r theta_e alpha (cm^-1) n Ks (cm/h)"
"Clay" 0.1 0.46 1.00E-02 1.25 0.612
"Clay-loam" 0.08 0.44 2.00E-02 1.42 0.3348
"Loam" 0.06 0.4 1.00E-02 1.47 0.504
"Loamy-sand" 0.05 0.39 3.00E-02 1.75 4.32
"Sand" 0.05 0.38 4.00E-02 3.18 26.64
"Sandy-clay" 0.12 0.39 3.00E-02 1.21 0.468
"Sandy-clay loam" 0.06 0.38 2.00E-02 1.33 0.54
"Sandy-loam" 0.04 0.39 3.00E-02 1.45 1.584
"Silt" 0.05 0.49 1.00E-02 1.68 1.836
"Silty-clay" 0.11 0.48 2.00E-02 1.32 0.432
"Silty-clay loam" 0.09 0.48 1.00E-02 1.52 0.468
"Silt-loam" 0.07 0.44 1.00E-02 1.66 0.756
"P-1" 0.0648 0.4513 0.0031297 1.6858 0.45
"P-2" 0.0831 0.4773 0.0083272 1.299 0.07
"P-3" 0.0668 0.4617 0.0037454 1.6151 0.45
"B-1" 0.0649 0.4481 0.009567 1.3579 0.07
"B-2" 0.0672 0.4760 0.005288 1.5276 0.02
"B-3" 0.0823 0.4782 0.004467 1.4585 0.20
13 changes: 13 additions & 0 deletions data/vG_default_params_LHS_Geneva_3_layer.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"Texture theta_r theta_e alpha (cm^-1) n Ks (cm/h)"
"Clay" 0.050705 0.577475 0.025733567644261095 1.5780455 0.009914024778060783
"Clay" 0.040485 0.781625 0.035878642271230464 1.4401385 0.03324681141677865
"Clay" 0.059959 0.5453749999999999 0.14150767647376097 1.6210295000000001 0.5864756698965781
"loam" 0.078 0.43 0.036 1.56 1.04
"silt" 0.034 0.46 0.016 1.37 0.25
"silt_loam" 0.067 0.45 0.02 1.41 0.45
"sandy_clay_loam" 0.1 0.39 0.059 1.48 1.31
"clay_loam" 0.095 0.41 0.019 1.31 0.26
"silty_clay_loam" 0.089 0.43 0.01 1.23 0.07
"sandy_clay" 0.1 0.38 0.027 1.23 0.12
"silty_clay" 0.07 0.36 0.005 1.09 0.02
"clay" 0.068 0.38 0.008 1.09 0.2
13 changes: 13 additions & 0 deletions data/vG_default_params_LHS_Koptis_Farms_3_layer.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"Texture theta_r theta_e alpha (cm^-1) n Ks (cm/h)"
"Clay" 0.054065 0.627975 0.01301331672487773 1.7945575 0.012683817950005425
"Clay" 0.050705 0.577475 0.025733567644261095 1.5780455 0.009914024778060783
"Clay" 0.040485 0.781625 0.035878642271230464 1.4401385 0.03324681141677865
"loam" 0.078 0.43 0.036 1.56 1.04
"silt" 0.034 0.46 0.016 1.37 0.25
"silt_loam" 0.067 0.45 0.02 1.41 0.45
"sandy_clay_loam" 0.1 0.39 0.059 1.48 1.31
"clay_loam" 0.095 0.41 0.019 1.31 0.26
"silty_clay_loam" 0.089 0.43 0.01 1.23 0.07
"sandy_clay" 0.1 0.38 0.027 1.23 0.12
"silty_clay" 0.07 0.36 0.005 1.09 0.02
"clay" 0.068 0.38 0.008 1.09 0.2
13 changes: 13 additions & 0 deletions data/vG_default_params_LHS_Onward_3_layer.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"Texture theta_r theta_e alpha (cm^-1) n Ks (cm/h)"
"Clay" 0.040485 0.781625 0.035878642271230464 1.4401385 0.03324681141677865
"Clay" 0.059959 0.5453749999999999 0.14150767647376097 1.6210295000000001 0.5864756698965781
"Clay" 0.11980899999999998 0.614375 0.029362159939896892 2.3963335 32.34074350510777
"loam" 0.078 0.43 0.036 1.56 1.04
"silt" 0.034 0.46 0.016 1.37 0.25
"silt_loam" 0.067 0.45 0.02 1.41 0.45
"sandy_clay_loam" 0.1 0.39 0.059 1.48 1.31
"clay_loam" 0.095 0.41 0.019 1.31 0.26
"silty_clay_loam" 0.089 0.43 0.01 1.23 0.07
"sandy_clay" 0.1 0.38 0.027 1.23 0.12
"silty_clay" 0.07 0.36 0.005 1.09 0.02
"clay" 0.068 0.38 0.008 1.09 0.2
19 changes: 19 additions & 0 deletions data/vG_default_params_LHS_arid.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"Texture theta_r theta_e alpha (cm^-1) n Ks (cm/h)"
"Clay" 0.14888700000000002 0.419275 0.25048400579688757 2.8783115 0.0022503496384425497
"Clay-loam" 0.08 0.44 2.00E-02 1.42 0.3348
"Loam" 0.06 0.4 1.00E-02 1.47 0.504
"Loamy-sand" 0.05 0.39 3.00E-02 1.75 4.32
"Sand" 0.05 0.38 4.00E-02 3.18 26.64
"Sandy-clay" 0.12 0.39 3.00E-02 1.21 0.468
"Sandy-clay loam" 0.06 0.38 2.00E-02 1.33 0.54
"Sandy-loam" 0.04 0.39 3.00E-02 1.45 1.584
"Silt" 0.05 0.49 1.00E-02 1.68 1.836
"Silty-clay" 0.11 0.48 2.00E-02 1.32 0.432
"Silty-clay loam" 0.09 0.48 1.00E-02 1.52 0.468
"Silt-loam" 0.07 0.44 1.00E-02 1.66 0.756
"P-1" 0.0648 0.4513 0.0031297 1.6858 0.45
"P-2" 0.0831 0.4773 0.0083272 1.299 0.07
"P-3" 0.0668 0.4617 0.0037454 1.6151 0.45
"B-1" 0.0649 0.4481 0.009567 1.3579 0.07
"B-2" 0.0672 0.4760 0.005288 1.5276 0.02
"B-3" 0.0823 0.4782 0.004467 1.4585 0.20
13 changes: 13 additions & 0 deletions data/vG_default_params_LHS_arid_3_layer.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"Texture theta_r theta_e alpha (cm^-1) n Ks (cm/h)"
"Clay" 0.019863 0.352975 0.03824828792704365 2.0642025000000004 0.010672102800646677
"Clay" 0.09908899999999998 0.695575 0.0018344251671177291 1.3390465 0.6882559902933154
"Clay" 0.138387 0.664775 0.0039564711202626415 1.3376535 1.701178949159976
"loam" 0.078 0.43 0.036 1.56 1.04
"silt" 0.034 0.46 0.016 1.37 0.25
"silt_loam" 0.067 0.45 0.02 1.41 0.45
"sandy_clay_loam" 0.1 0.39 0.059 1.48 1.31
"clay_loam" 0.095 0.41 0.019 1.31 0.26
"silty_clay_loam" 0.089 0.43 0.01 1.23 0.07
"sandy_clay" 0.1 0.38 0.027 1.23 0.12
"silty_clay" 0.07 0.36 0.005 1.09 0.02
"clay" 0.068 0.38 0.008 1.09 0.2
13 changes: 13 additions & 0 deletions data/vG_default_params_LHS_humid_1_layer.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"Texture theta_r theta_e alpha (cm^-1) n Ks (cm/h)"
"Clay" 0.019863 0.352975 0.03824828792704365 2.0642025000000004 0.010672102800646677
"Clay" 0.09908899999999998 0.695575 0.0018344251671177291 1.3390465 0.6882559902933154
"Clay" 0.138387 0.664775 0.0039564711202626415 1.3376535 1.701178949159976
"loam" 0.078 0.43 0.036 1.56 1.04
"silt" 0.034 0.46 0.016 1.37 0.25
"silt_loam" 0.067 0.45 0.02 1.41 0.45
"sandy_clay_loam" 0.1 0.39 0.059 1.48 1.31
"clay_loam" 0.095 0.41 0.019 1.31 0.26
"silty_clay_loam" 0.089 0.43 0.01 1.23 0.07
"sandy_clay" 0.1 0.38 0.027 1.23 0.12
"silty_clay" 0.07 0.36 0.005 1.09 0.02
"clay" 0.068 0.38 0.008 1.09 0.2
13 changes: 13 additions & 0 deletions data/vG_default_params_LHS_humid_3_layer.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"Texture theta_r theta_e alpha (cm^-1) n Ks (cm/h)"
"Clay" 0.019863 0.352975 0.03824828792704365 2.0642025000000004 0.010672102800646677
"Clay" 0.09908899999999998 0.695575 0.0018344251671177291 1.3390465 0.6882559902933154
"Clay" 0.138387 0.664775 0.0039564711202626415 1.3376535 1.701178949159976
"loam" 0.078 0.43 0.036 1.56 1.04
"silt" 0.034 0.46 0.016 1.37 0.25
"silt_loam" 0.067 0.45 0.02 1.41 0.45
"sandy_clay_loam" 0.1 0.39 0.059 1.48 1.31
"clay_loam" 0.095 0.41 0.019 1.31 0.26
"silty_clay_loam" 0.089 0.43 0.01 1.23 0.07
"sandy_clay" 0.1 0.38 0.027 1.23 0.12
"silty_clay" 0.07 0.36 0.005 1.09 0.02
"clay" 0.068 0.38 0.008 1.09 0.2
7 changes: 4 additions & 3 deletions src/lgar.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1944,9 +1944,10 @@ extern double lgar_move_wetting_fronts(bool TO_enabled, double timestep_h, doubl
break;
}
if ( (current->is_WF_GW==1) && (current->depth_cm>0.0) && (current->psi_cm>(next->psi_cm + 0.99*cum_layer_thickness_cm[num_layers]) ) && (current->to_bottom==FALSE) && (in_order) && (current->psi_cm > cum_layer_thickness_cm[num_layers]) && (current->psi_cm<5*cum_layer_thickness_cm[num_layers]) ){
//high accuracy version: change the factor 0.99 above to 0.1
//the factor 0.99 in the line above has also been 0.5, it's not terribly important. Basically it will determine how frequently a new WF will be inserted, becasue a larger factor here will make it so that a larger gap is psi is required before a new WF is inserted.
//reducing this factor (values as low as 0.05 have been explored) theoretically increases both computational expense and accuracy, but in practice for year long simulations the impact seems fairly small.
double first_mass = lgar_calc_mass_bal(cum_layer_thickness_cm, *head); //tune here
double first_mass = lgar_calc_mass_bal(cum_layer_thickness_cm, *head);

int soil_num = soil_type[current->layer_num];

Expand Down Expand Up @@ -4294,7 +4295,7 @@ extern void lgarto_ensure_rooting_zone_population(double rzd, double PET_timeste

while (( (num_TO_WFs_in_rz - listLength_surface(*head))<4) && (PET_timestep_cm>0.0) && (listLength_surface(*head)==0) && current->psi_cm<1.E6 ){//the 1.E-6 ensures that we don't get absurdly dry WFs towards surface
// while (( (num_TO_WFs_in_rz - listLength_surface(*head))<15) && current->psi_cm<1.E6 ){//the 1.E-6 ensures that we don't get absurdly dry WFs towards surface
//tune here //10
//high accuracy version: use the version where new wetting fronts are created regardless of PET
current = *head;
// double new_psi = current->psi_cm + 30.0; //this could be a parameter ... or perhas calculated as some fraction of the thickness of the model domain.
double new_psi = current->psi_cm + 0.25*rzd; //0.25 or 0.05
Expand Down Expand Up @@ -5200,7 +5201,7 @@ extern void lgarto_consolidate_excessive_fronts(double* cum_layer_thickness_cm,
printf("states before lgarto_consolidate_excessive_fronts: \n");
listPrint(*head);
}
while (lgarto_count_fronts_for_excessive_calc(head) > 6){ //6 //tune here //20
while (lgarto_count_fronts_for_excessive_calc(head) > 6){
listDeleteFront(1, head, soil_type, soil_properties);
}
double end_mass = lgar_calc_mass_bal(cum_layer_thickness_cm, *head);
Expand Down
Loading

0 comments on commit 492cc5e

Please sign in to comment.