diff --git a/build/source/actors/hru_actor/cppwrap_hru.f90 b/build/source/actors/hru_actor/cppwrap_hru.f90 index e4f48be16ea54229458047b1b5b977ccf436721a..11b27e42a0427b2f57d6d7aa5cccdd225395d9d2 100644 --- a/build/source/actors/hru_actor/cppwrap_hru.f90 +++ b/build/source/actors/hru_actor/cppwrap_hru.f90 @@ -6,7 +6,8 @@ USE data_types USE globalData implicit none -! public::Initialize +! public::Initialize ! This is called Directly by the actors code +! The above is here just in case I look here again public::SetupParam public::Restart public::Forcing @@ -16,182 +17,6 @@ public::Write_Param_C contains -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! *************** Initalize Structures For HRU ************************ -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! subroutine Initialize(& -! indxGRU, & -! num_steps, & -! ! statistics structures -! handle_forcStat, & ! model forcing data -! handle_progStat, & ! model prognostic (state) variables -! handle_diagStat, & ! model diagnostic variables -! handle_fluxStat, & ! model fluxes -! handle_indxStat, & ! model indices -! handle_bvarStat, & ! basin-average variables -! ! primary data structures (scalars) -! handle_timeStruct, & ! model time data -! handle_forcStruct, & ! model forcing data -! handle_attrStruct, & ! local attributes for each HRU -! handle_typeStruct, & ! local classification of soil veg etc. for each HRU -! handle_idStruct, & ! -! ! primary data structures (variable length vectors) -! handle_indxStruct, & ! model indices -! handle_mparStruct, & ! model parameters -! handle_progStruct, & ! model prognostic (state) variables -! handle_diagStruct, & ! model diagnostic variables -! handle_fluxStruct, & ! model fluxes -! ! basin-average structures -! handle_bparStruct, & ! basin-average parameters -! handle_bvarStruct, & ! basin-average variables -! ! ancillary data structures -! handle_dparStruct, & ! default model parameters -! ! local HRU data -! handle_startTime, & ! start time for the model simulation -! handle_finshTime, & ! end time for the model simulation -! handle_refTime, & ! reference time for the model simulation -! handle_oldTime, & ! time for the previous model time step -! ! miscellaneous variables -! err) bind(C,name='Initialize') - -! use summa4chm_init,only:summa4chm_initialize - -! implicit none -! ! calling variables -! integer(c_int),intent(in) :: indxGRU -! integer(c_int),intent(out) :: num_steps -! ! statistics structures -! type(c_ptr), intent(in), value :: handle_forcStat ! model forcing data -! type(c_ptr), intent(in), value :: handle_progStat ! model prognostic (state) variables -! type(c_ptr), intent(in), value :: handle_diagStat ! model diagnostic variables -! type(c_ptr), intent(in), value :: handle_fluxStat ! model fluxes -! type(c_ptr), intent(in), value :: handle_indxStat ! model indices -! type(c_ptr), intent(in), value :: handle_bvarStat ! basin-average variables -! ! primary data structures (scalars) -! type(c_ptr), intent(in), value :: handle_timeStruct ! model time data -! type(c_ptr), intent(in), value :: handle_forcStruct ! model forcing data -! type(c_ptr), intent(in), value :: handle_attrStruct ! local attributes for each HRU -! type(c_ptr), intent(in), value :: handle_typeStruct ! local classification of soil veg etc. for each HRU -! type(c_ptr), intent(in), value :: handle_idStruct ! -! ! primary data structures (variable length vectors) -! type(c_ptr), intent(in), value :: handle_indxStruct ! model indices -! type(c_ptr), intent(in), value :: handle_mparStruct ! model parameters -! type(c_ptr), intent(in), value :: handle_progStruct ! model prognostic (state) variables -! type(c_ptr), intent(in), value :: handle_diagStruct ! model diagnostic variables -! type(c_ptr), intent(in), value :: handle_fluxStruct ! model fluxes -! ! basin-average structures -! type(c_ptr), intent(in), value :: handle_bparStruct ! basin-average parameters -! type(c_ptr), intent(in), value :: handle_bvarStruct ! basin-average variables -! ! ancillary data structures -! type(c_ptr), intent(in), value :: handle_dparStruct ! default model parameters -! ! local hru data structures -! type(c_ptr), intent(in), value :: handle_startTime ! start time for the model simulation -! type(c_ptr), intent(in), value :: handle_finshTime ! end time for the model simulation -! type(c_ptr), intent(in), value :: handle_refTime ! reference time for the model simulation -! type(c_ptr), intent(in), value :: handle_oldTime ! time for the previous model time step -! integer(c_int),intent(inout) :: err -! !--------------------------------------------------------------------------------------------------- -! ! local variables - -! ! statistics structures -! type(var_dlength),pointer :: forcStat ! model forcing data -! type(var_dlength),pointer :: progStat ! model prognostic (state) variables -! type(var_dlength),pointer :: diagStat ! model diagnostic variables -! type(var_dlength),pointer :: fluxStat ! model fluxes -! type(var_dlength),pointer :: indxStat ! model indices -! type(var_dlength),pointer :: bvarStat ! basin-average variabl -! ! primary data structures (scalars) -! type(var_i),pointer :: timeStruct ! model time data -! type(var_d),pointer :: forcStruct ! model forcing data -! type(var_d),pointer :: attrStruct ! local attributes for each HRU -! type(var_i),pointer :: typeStruct ! local classification of soil veg etc. for each HRU -! type(var_i8),pointer :: idStruct ! -! ! primary data structures (variable length vectors) -! type(var_ilength),pointer :: indxStruct ! model indices -! type(var_dlength),pointer :: mparStruct ! model parameters -! type(var_dlength),pointer :: progStruct ! model prognostic (state) variables -! type(var_dlength),pointer :: diagStruct ! model diagnostic variables -! type(var_dlength),pointer :: fluxStruct ! model fluxes -! ! basin-average structures -! type(var_d),pointer :: bparStruct ! basin-average parameters -! type(var_dlength),pointer :: bvarStruct ! basin-average variables -! ! ancillary data structures -! type(var_d),pointer :: dparStruct ! default model parameters -! ! local HRU data structures -! type(var_i),pointer :: startTime ! start time for the model simulation -! type(var_i),pointer :: finshTime ! end time for the model simulation -! type(var_i),pointer :: refTime ! reference time for the model simulation -! type(var_i),pointer :: oldTime ! time for the previous model time step -! character(len=256) :: message - - -! ! getting data -! call c_f_pointer(handle_forcStat, forcStat) -! call c_f_pointer(handle_progStat, progStat) -! call c_f_pointer(handle_diagStat, diagStat) -! call c_f_pointer(handle_fluxStat, fluxStat) -! call c_f_pointer(handle_indxStat, indxStat) -! call c_f_pointer(handle_bvarStat, bvarStat) -! call c_f_pointer(handle_timeStruct, timeStruct) -! call c_f_pointer(handle_forcStruct, forcStruct) -! call c_f_pointer(handle_attrStruct, attrStruct) -! call c_f_pointer(handle_typeStruct, typeStruct) -! call c_f_pointer(handle_idStruct, idStruct) -! call c_f_pointer(handle_indxStruct, indxStruct) -! call c_f_pointer(handle_mparStruct, mparStruct) -! call c_f_pointer(handle_progStruct, progStruct) -! call c_f_pointer(handle_diagStruct, diagStruct) -! call c_f_pointer(handle_fluxStruct, fluxStruct) -! call c_f_pointer(handle_bparStruct, bparStruct) -! call c_f_pointer(handle_bvarStruct, bvarStruct) -! call c_f_pointer(handle_dparStruct, dparStruct) -! call c_f_pointer(handle_startTime, startTime) -! call c_f_pointer(handle_finshTime, finshTime) -! call c_f_pointer(handle_refTime, refTime) -! call c_f_pointer(handle_oldTime, oldTime) - - -! call summa4chm_initialize(& -! indxGRU, & ! index of the parent GRU -! num_steps, & -! ! statistics structures -! forcStat, & ! model forcing data -! progStat, & ! model prognostic (state) variables -! diagStat, & ! model diagnostic variables -! fluxStat, & ! model fluxes -! indxStat, & ! model indices -! bvarStat, & ! basin-average variables -! ! primary data structures (scalars) -! timeStruct, & ! model time data -! forcStruct, & ! model forcing data -! attrStruct, & ! local attributes for each HRU -! typeStruct, & ! local classification of soil veg etc. for each HRU -! idStruct, & ! -! ! primary data structures (variable length vectors) -! indxStruct, & ! model indices -! mparStruct, & ! model parameters -! progStruct, & ! model prognostic (state) variables -! diagStruct, & ! model diagnostic variables -! fluxStruct, & ! model fluxes -! ! basin-average structures -! bparStruct, & ! basin-average parameters -! bvarStruct, & ! basin-average variables -! ! ancillary data structures -! dparStruct, & ! default model parameters -! startTime, & ! start time for the model simulation -! finshTime, & ! end time for the model simulation -! refTime, & ! reference time for the model simulation -! oldTime, & ! time for the previous model time step -! ! miscellaneous variables -! err, message) - -! if(err/=0)then -! message=trim(message) -! print*, message -! endif - -! end subroutine Initialize - ! ********************************************************************************************************** ! public subroutine SetupParam: initializes parameter data structures (e.g. vegetation and soil parameters). ! ********************************************************************************************************** diff --git a/build/source/driver/SummaActors_modelRun.f90 b/build/source/driver/SummaActors_modelRun.f90 index 7aaba25108d23c91e700bb7189f186651304cb49..3310197b9d4d11d891122068989d35fb0189b288 100755 --- a/build/source/driver/SummaActors_modelRun.f90 +++ b/build/source/driver/SummaActors_modelRun.f90 @@ -213,7 +213,9 @@ contains ! initialize runoff variables bvarStruct%var(iLookBVAR%basin__SurfaceRunoff)%dat(1) = 0._dp ! surface runoff (m s-1) + bvarStruct%var(iLookBVAR%basin__SoilDrainage)%dat(1) = 0._dp bvarStruct%var(iLookBVAR%basin__ColumnOutflow)%dat(1) = 0._dp ! outflow from all "outlet" HRUs (those with no downstream HRU) + bvarStruct%var(iLookBVAR%basin__TotalRunoff)%dat(1) = 0._dp ! initialize baseflow variables bvarStruct%var(iLookBVAR%basin__AquiferRecharge)%dat(1) = 0._dp ! recharge to the aquifer (m s-1) @@ -343,20 +345,28 @@ contains + fluxStruct%var(iLookFLUX%scalarAquiferBaseflow)%dat(1) * fracHRU end if + ! perform the routing + associate(totalArea => bvarStruct%var(iLookBVAR%basin__totalArea)%dat(1) ) + ! compute water balance for the basin aquifer if(model_decisions(iLookDECISIONS%spatial_gw)%iDecision == singleBasin)then message=trim(message)//'multi_driver/bigBucket groundwater code not transferred from old code base yet' err=20; return end if - ! perform the routing - associate(totalArea => bvarStruct%var(iLookBVAR%basin__totalArea)%dat(1) ) + ! calculate total runoff depending on whether aquifer is connected + if(model_decisions(iLookDECISIONS%groundwatr)%iDecision == bigBucket) then + ! aquifer + bvarStruct%var(iLookBVAR%basin__TotalRunoff)%dat(1) = bvarStruct%var(iLookBVAR%basin__SurfaceRunoff)%dat(1) + bvarStruct%var(iLookBVAR%basin__ColumnOutflow)%dat(1)/totalArea + bvarStruct%var(iLookBVAR%basin__AquiferBaseflow)%dat(1) + else + ! no aquifer + bvarStruct%var(iLookBVAR%basin__TotalRunoff)%dat(1) = bvarStruct%var(iLookBVAR%basin__SurfaceRunoff)%dat(1) + bvarStruct%var(iLookBVAR%basin__ColumnOutflow)%dat(1)/totalArea + bvarStruct%var(iLookBVAR%basin__SoilDrainage)%dat(1) + endif + call qOverland(& ! input - model_decisions(iLookDECISIONS%subRouting)%iDecision, & ! intent(in): index for routing method - bvarStruct%var(iLookBVAR%basin__SurfaceRunoff)%dat(1), & ! intent(in): surface runoff (m s-1) - bvarStruct%var(iLookBVAR%basin__ColumnOutflow)%dat(1)/totalArea, & ! intent(in): outflow from all "outlet" HRUs (those with no downstream HRU) - bvarStruct%var(iLookBVAR%basin__AquiferBaseflow)%dat(1), & ! intent(in): baseflow from the aquifer (m s-1) + model_decisions(iLookDECISIONS%subRouting)%iDecision, & ! intent(in): index for routing method + bvarStruct%var(iLookBVAR%basin__TotalRunoff)%dat(1), & ! intent(in): total runoff to the channel from all active components (m s-1) bvarStruct%var(iLookBVAR%routingFractionFuture)%dat, & ! intent(in): fraction of runoff in future time steps (m s-1) bvarStruct%var(iLookBVAR%routingRunoffFuture)%dat, & ! intent(in): runoff in future time steps (m s-1) ! output diff --git a/build/source/dshare/get_ixname.f90 b/build/source/dshare/get_ixname.f90 index 3e4c59ac6828f480dfcf4bef9e73879cb86e563a..fbf9c4e3e37d3ac67a9c823f8e57f243f2379990 100755 --- a/build/source/dshare/get_ixname.f90 +++ b/build/source/dshare/get_ixname.f90 @@ -888,6 +888,7 @@ contains case('basin__AquiferRecharge' ); get_ixbvar = iLookBVAR%basin__AquiferRecharge ! recharge to the aquifer (m s-1) case('basin__AquiferBaseflow' ); get_ixbvar = iLookBVAR%basin__AquiferBaseflow ! baseflow from the aquifer (m s-1) case('basin__AquiferTranspire' ); get_ixbvar = iLookBVAR%basin__AquiferTranspire ! transpiration from the aquifer (m s-1) + case('basin__TotalRunoff' ); get_ixbvar = iLookBVAR%basin__TotalRunoff ! total runoff to channel from all active components (m s-1) case('basin__SoilDrainage' ); get_ixbvar = iLookBVAR%basin__SoilDrainage ! variables to compute runoff case('routingRunoffFuture' ); get_ixbvar = iLookBVAR%routingRunoffFuture ! runoff in future time steps (m s-1) diff --git a/build/source/dshare/popMetadat.f90 b/build/source/dshare/popMetadat.f90 index cec88e3ff6837115d4fa9834452595d86dd3de2a..4c2b371e64ea8dcb3f5294d6966f10242bc75e52 100755 --- a/build/source/dshare/popMetadat.f90 +++ b/build/source/dshare/popMetadat.f90 @@ -588,6 +588,7 @@ subroutine popMetadat(err,message) bvar_meta(iLookBVAR%basin__AquiferRecharge) = var_info('basin__AquiferRecharge' , 'recharge to the aquifer' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) bvar_meta(iLookBVAR%basin__AquiferBaseflow) = var_info('basin__AquiferBaseflow' , 'baseflow from the aquifer' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) bvar_meta(iLookBVAR%basin__AquiferTranspire) = var_info('basin__AquiferTranspire', 'transpiration loss from the aquifer' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) + bvar_meta(iLookBVAR%basin__TotalRunoff) = var_info('basin__TotalRunoff' , 'total runoff to channel from all active components' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) bvar_meta(iLookBVAR%basin__SoilDrainage) = var_info('basin__SoilDrainage' , 'soil drainage' , 'm s-1' , get_ixVarType('scalarv'), iMissVec, iMissVec, .false.) bvar_meta(iLookBVAR%routingRunoffFuture) = var_info('routingRunoffFuture' , 'runoff in future time steps' , 'm s-1' , get_ixVarType('routing'), iMissVec, iMissVec, .false.) bvar_meta(iLookBVAR%routingFractionFuture) = var_info('routingFractionFuture' , 'fraction of runoff in future time steps' , '-' , get_ixVarType('routing'), iMissVec, iMissVec, .false.) diff --git a/build/source/dshare/var_lookup.f90 b/build/source/dshare/var_lookup.f90 index 8030472178a03b8f77b84973e099c1265695ab24..b1ae8c0ad725c0c80862e549b26dc1e118ac482d 100755 --- a/build/source/dshare/var_lookup.f90 +++ b/build/source/dshare/var_lookup.f90 @@ -705,6 +705,7 @@ MODULE var_lookup integer(i4b) :: basin__AquiferRecharge = integerMissing ! recharge to the aquifer (m s-1) integer(i4b) :: basin__AquiferBaseflow = integerMissing ! baseflow from the aquifer (m s-1) integer(i4b) :: basin__AquiferTranspire = integerMissing ! transpiration from the aquifer (m s-1) + integer(i4b) :: basin__TotalRunoff = integerMissing ! total runoff to channel from all active components (m s-1) integer(i4b) :: basin__SoilDrainage = integerMissing ! define variables for runoff integer(i4b) :: routingRunoffFuture = integerMissing ! runoff in future time steps (m s-1) @@ -843,7 +844,7 @@ MODULE var_lookup ! named variables: basin-average variables type(iLook_bvar), public,parameter :: iLookBVAR =ilook_bvar ( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,& - 11, 12) + 11, 12, 13) ! named variables in varibale type structure type(iLook_varType), public,parameter :: iLookVarType =ilook_varType ( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,& diff --git a/build/source/engine/qTimeDelay.f90 b/build/source/engine/qTimeDelay.f90 index 75cb75c0a5c382900d3faee3eccc70a56a645b1f..abcec24dc110612071dbc6c3ea651379e4cbeb48 100755 --- a/build/source/engine/qTimeDelay.f90 +++ b/build/source/engine/qTimeDelay.f90 @@ -40,9 +40,7 @@ contains subroutine qOverland(& ! input ixRouting, & ! index for routing method - averageSurfaceRunoff, & ! surface runoff (m s-1) - averageSoilBaseflow, & ! baseflow from the soil profile (m s-1) - averageAquiferBaseflow,& ! baseflow from the aquifer (m s-1) + averageTotalRunoff, & ! total runoff to the channel from all active components (m s-1) fracFuture, & ! fraction of runoff in future time steps (m s-1) qFuture, & ! runoff in future time steps (m s-1) ! output @@ -52,9 +50,7 @@ contains implicit none ! input integer(i4b),intent(in) :: ixRouting ! index for routing method - real(dp),intent(in) :: averageSurfaceRunoff ! surface runoff (m s-1) - real(dp),intent(in) :: averageSoilBaseflow ! baseflow from the soil profile (m s-1) - real(dp),intent(in) :: averageAquiferBaseflow ! baseflow from the aquifer (m s-1) + real(dp),intent(in) :: averageTotalRunoff ! total runoff to the channel from all active components (m s-1)ß real(dp),intent(in) :: fracFuture(:) ! fraction of runoff in future time steps (m s-1) real(dp),intent(inout) :: qFuture(:) ! runoff in future time steps (m s-1) ! output @@ -69,7 +65,7 @@ contains err=0; message='qOverland/' ! compute instantaneous runoff (m s-1) - averageInstantRunoff = averageSurfaceRunoff + averageAquiferBaseflow + averageSoilBaseflow + averageInstantRunoff = averageTotalRunoff ! compute routed runoff (m s-1) select case(ixRouting) ! (select option for sub-grid routing) diff --git a/utils/containers/docker/launch_docker_container.sh b/utils/containers/docker/launch_docker_container.sh index 0e65916ae278dceb628345adfa279174087159e8..0bf72c7c341e6d854dc6fd4c2e26e67a8b87269e 100755 --- a/utils/containers/docker/launch_docker_container.sh +++ b/utils/containers/docker/launch_docker_container.sh @@ -2,7 +2,8 @@ export PROJECT_DIR=/Users/kyleklenk/SUMMA-Projects/Summa-Actors export NA_TEST=/home/local/kck540/NA_Summa_Test -export SUMMA=/home/local/kck540/SUMMA-Projects/summa-reference/summa -docker run -d -it --name SUMMA-Actors --mount type=bind,source=${PROJECT_DIR},target=/Summa-Actors summa-actors:latest +export SUMMA=/Users/kyleklenk/SUMMA-Projects/summa +docker run -d -it --name SUMMA-Actors --mount type=bind,source=${PROJECT_DIR},target=/Summa-Actors \ + --mount type=bind,source=${SUMMA},target=/SUMMA summa-actors:latest # --mount type=bind,source=${NA_TEST},target=/NA_Test \ - # --mount type=bind,source=${SUMMA},target=/SUMMA \ \ No newline at end of file + # \ \ No newline at end of file diff --git a/utils/laugh_tests/celia1990/output/runinfo.txt b/utils/laugh_tests/celia1990/output/runinfo.txt index 55a31cd9e749019031fa048613548b5355dfe016..0fb846b9dd8b00d41150efe03496908681b8bf59 100644 --- a/utils/laugh_tests/celia1990/output/runinfo.txt +++ b/utils/laugh_tests/celia1990/output/runinfo.txt @@ -1 +1 @@ - Run start time on system: ccyy=2022 - mm=08 - dd=12 - hh=20 - mi=23 - ss=57.838 + Run start time on system: ccyy=2022 - mm=08 - dd=15 - hh=02 - mi=49 - ss=46.316 diff --git a/utils/laugh_tests/celia1990/output/summa-actors_celia1990GRU1-1_timestep.nc b/utils/laugh_tests/celia1990/output/summa-actors_celia1990GRU1-1_timestep.nc index 95cf6292d904873fd6445707dd67fdbf9a2249ee..d173a6235ac81f1f920965a1ab7d4091db3dcb0a 100644 Binary files a/utils/laugh_tests/celia1990/output/summa-actors_celia1990GRU1-1_timestep.nc and b/utils/laugh_tests/celia1990/output/summa-actors_celia1990GRU1-1_timestep.nc differ diff --git a/utils/laugh_tests/celia1990/verification_data/runinfo.txt b/utils/laugh_tests/celia1990/verification_data/runinfo.txt index 50770b1d1d98ba99f1e937a222bae9fcc0a2a90f..a4397e2edc523fc1a3bb76f702aaaa11af1ddba9 100644 --- a/utils/laugh_tests/celia1990/verification_data/runinfo.txt +++ b/utils/laugh_tests/celia1990/verification_data/runinfo.txt @@ -1 +1 @@ - Run start time on system: ccyy=2022 - mm=08 - dd=11 - hh=19 - mi=08 - ss=25.918 + Run start time on system: ccyy=2022 - mm=08 - dd=15 - hh=02 - mi=49 - ss=51.739 diff --git a/utils/laugh_tests/celia1990/verification_data/summa_celia1990_G1-1_timestep.nc b/utils/laugh_tests/celia1990/verification_data/summa_celia1990_G1-1_timestep.nc index 2533407a54d2558d4c82ccd4342f64891ebb8ec3..e1319892d362595775ea3f6668ad8dd00667cf1e 100644 Binary files a/utils/laugh_tests/celia1990/verification_data/summa_celia1990_G1-1_timestep.nc and b/utils/laugh_tests/celia1990/verification_data/summa_celia1990_G1-1_timestep.nc differ