Skip to content

Commit 79206f1

Browse files
committed
add a link to reference for modflow coupling
1 parent 95d833a commit 79206f1

1 file changed

Lines changed: 17 additions & 17 deletions

File tree

docs/notebooks/bmi_MODFLOW_coupling.ipynb

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"source": [
77
"# STEMMUS_SCOPE & MODFLOW 6 BMI coupling\n",
88
"\n",
9-
"This Python notebook shows a simple example of BMI coupling between the STEMMUS_SCOPE model and the MODFLOW 6 model. The example is prepared for one of the PLUMBER2 dataset (https://researchdata.edu.au/plumber2-forcing-evaluation-surface-models/1656048): the LooBos site, the Netherlands (NL-Loo). To run this notebook, the following are required:\n",
9+
"This Python notebook shows a simple example of BMI coupling between the STEMMUS_SCOPE model and the MODFLOW 6 model, based on research carried by \"M. Daoud\", as a part of [EcoExtreML](https://research-software-directory.org/projects/ecoextreml) project, for more info see [this reference](https://research.utwente.nl/en/publications/investigating-the-role-of-groundwater-in-mitigating-vegetation-wa). The example is prepared for one of the PLUMBER2 dataset (https://researchdata.edu.au/plumber2-forcing-evaluation-surface-models/1656048): the LooBos site, the Netherlands (NL-Loo). To run this notebook, the following are required:\n",
1010
"- Install the related packages:\n",
1111
" - pyStemmusScope package (https://pystemmusscope.readthedocs.io/en/latest/).\n",
1212
" - modflowapi Python package (https://github.com/MODFLOW-USGS/modflowapi?tab=readme-ov-file#installation).\n",
@@ -124,11 +124,11 @@
124124
}
125125
],
126126
"source": [
127-
"# Add the matlab runtime compiler locations: \n",
127+
"# Add the matlab runtime compiler locations:\n",
128128
"matlab_version = 'R2023a'\n",
129-
"matlab_path = '/opt/matlab/MATLAB_Runtime/' + matlab_version \n",
130-
" \n",
131-
"os.environ['LD_LIBRARY_PATH'] = ( \n",
129+
"matlab_path = '/opt/matlab/MATLAB_Runtime/' + matlab_version\n",
130+
"\n",
131+
"os.environ['LD_LIBRARY_PATH'] = (\n",
132132
" f\"{matlab_path}/runtime/glnxa64:\"\n",
133133
" f\"{matlab_path}/bin/glnxa64:\"\n",
134134
" f\"{matlab_path}/sys/os/glnxa64:\"\n",
@@ -262,7 +262,7 @@
262262
],
263263
"source": [
264264
"sim = ApiSimulation.load(modflow)\n",
265-
"gwf_name = sim.model_names[0] # groundwater flow model \n",
265+
"gwf_name = sim.model_names[0] # groundwater flow model\n",
266266
"gwe_name = sim.model_names[1] # groundwater energy (heat) model\n",
267267
"gwf_name, gwe_name"
268268
]
@@ -399,7 +399,7 @@
399399
"source": [
400400
"stemmus_scope.set_value(\"groundwater_elevation_top_aquifer\", top_elev)\n",
401401
"stemmus_scope.set_value(\"groundwater_head_bottom_layer\", gwhead_init)\n",
402-
"stemmus_scope.set_value(\"groundwater_temperature\", gwtemp_init) "
402+
"stemmus_scope.set_value(\"groundwater_temperature\", gwtemp_init)"
403403
]
404404
},
405405
{
@@ -6650,9 +6650,9 @@
66506650
],
66516651
"source": [
66526652
"while modflow.get_current_time() < modflow.get_end_time():\n",
6653-
" while stemmus_scope.get_current_time() < stemmus_scope.get_end_time(): \n",
6654-
" \n",
6655-
" # Get STEMMUS_SCOPE variables (soil moisture, soil temperature, groundwater recharge) \n",
6653+
" while stemmus_scope.get_current_time() < stemmus_scope.get_end_time():\n",
6654+
"\n",
6655+
" # Get STEMMUS_SCOPE variables (soil moisture, soil temperature, groundwater recharge)\n",
66566656
" stemmus_scope.get_value(\"soil_moisture\", soil_moisture[i])\n",
66576657
" stemmus_scope.get_value(\"soil_temperature\", soil_temperature[i])\n",
66586658
" stemmus_scope.get_value(\"groundwater_recharge\", gw_recharge)\n",
@@ -6669,19 +6669,19 @@
66696669
" # Set STEMMUS_SCOPE variables (groundwater head, groundwater temperature)\n",
66706670
" stemmus_scope.set_value(\"groundwater_head_bottom_layer\", gwhead)\n",
66716671
" stemmus_scope.set_value(\"groundwater_temperature\", gwtemp)\n",
6672-
" \n",
6672+
"\n",
66736673
" # Set MODFLOW 6 variables (groundwater recharge)\n",
6674-
" kstp, kper = sim.kstp, sim.kper \n",
6674+
" kstp, kper = sim.kstp, sim.kper\n",
66756675
" if kstp == nstp - 1:\n",
6676-
" # groundwater recharge per stress period = sum of groundwater recharge per time step \n",
6676+
" # groundwater recharge per stress period = sum of groundwater recharge per time step\n",
66776677
" gw_recharge_nper = np.array([-1 * np.sum(gw_recharge_nstp) / 100]) # multiply by -1 due to different signs of both models\n",
66786678
" modflow.set_value(rch_tag, gw_recharge_nper)\n",
6679-
" gw_recharge_nstp = np.array([]) \n",
6680-
" \n",
6681-
" # Track the simulation time of MODFLOW 6 \n",
6679+
" gw_recharge_nstp = np.array([])\n",
6680+
"\n",
6681+
" # Track the simulation time of MODFLOW 6\n",
66826682
" print('Updating MODFLOW Stress period ' + str(kper + 1) + ', time step ' + str(kstp + 1))\n",
66836683
" # print(kper + 1, kstp + 1, gwhead, gwtemp)\n",
6684-
" \n",
6684+
"\n",
66856685
" # Update models\n",
66866686
" stemmus_scope.update()\n",
66876687
" modflow.update()"

0 commit comments

Comments
 (0)