Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions build/cmake/build.mac.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
# Actual settings may vary

# Mac Example using MacPorts:
export FC=/opt/local/bin/gfortran # Fortran compiler family
export FC=/opt/homebrew/bin/gfortran # Fortran compiler family
#export FLAGS_OPT="-flto=1" # -flto=1 is slow to compile, but might want to use
export LIBRARY_LINKS='-llapack' # list of library links
export SUNDIALS_DIR=../../../sundials/instdir/
export SUNDIALS_DIR=$HOME/local/sundials

cmake -B ../cmake_build -S ../. -DUSE_SUNDIALS=ON -DSPECIFY_LAPACK_LINKS=ON -DCMAKE_BUILD_TYPE=Release
#cmake -B ../cmake_build -S ../. -DUSE_SUNDIALS=ON -DSPECIFY_LAPACK_LINKS=ON -DCMAKE_BUILD_TYPE=Debug
#cmake -B ../cmake_build -S ../. -DCMAKE_BUILD_TYPE=Debug \
# -DCMAKE_Fortran_FLAGS_DEBUG="-O0 -g -Wall -Wextra -Wuninitialized -Wmaybe-uninitialized -fcheck=all -finit-real=snan -finit-integer=2147483647"
cmake --build ../cmake_build --target all -j
3 changes: 3 additions & 0 deletions build/source/driver/summa_forcing.f90
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ subroutine summa_readForcing(modelTimeStep, summa1_struc, err, message)
! timing variables
USE globalData,only:startRead,endRead ! date/time for the start and end of reading forcing data
USE globalData,only:elapsedRead ! elapsed time to read forcing data
! model decisions
USE globalData,only:model_decisions ! model decision structure
! ---------------------------------------------------------------------------------------
! * variables
! ---------------------------------------------------------------------------------------
Expand Down Expand Up @@ -73,6 +75,7 @@ subroutine summa_readForcing(modelTimeStep, summa1_struc, err, message)
call read_force(&
! input
modelTimeStep, & ! intent(in): time step index
model_decisions, & ! intent(in): model decisions structure
! input-output
iFile, & ! intent(inout): index of current forcing file in forcing file list
forcingStep, & ! intent(inout): index of read position in time dimension in current netcdf file
Expand Down
2 changes: 1 addition & 1 deletion build/source/driver/summa_setup.f90
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ subroutine summa_paramSetup(summa1_struc, err, message)
USE nrtype ! variable types, etc.
USE summa_type, only:summa1_type_dec ! master summa data type
! subroutines and functions
use time_utils_module,only:elapsedSec ! calculate the elapsed time
USE time_utils_module,only:elapsedSec ! calculate the elapsed time
USE mDecisions_module,only:mDecisions ! module to read model decisions
USE ffile_info_module,only:ffile_info ! module to read information on forcing datafile
USE read_attrb_module,only:read_attrb ! module to read local attributes
Expand Down
1 change: 1 addition & 0 deletions build/source/dshare/get_ixname.f90
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ function get_ixdecisions(varName)
case('infRateMax' ); get_ixdecisions=iLookDECISIONS%infRateMax ! choice of maximum infiltration rate method
case('surfRun_IE' ); get_ixdecisions=iLookDECISIONS%surfRun_IE ! choice of parameterization for infiltration excess surface runoff
case('surfRun_SE' ); get_ixdecisions=iLookDECISIONS%surfRun_SE ! choice of parameterization for saturation excess surface runoff
case('read_force' ); get_ixdecisions=iLookDECISIONS%read_force ! method used to read forcing data (per step or full read)
! get to here if cannot find the variable
case default
get_ixdecisions = integerMissing
Expand Down
7 changes: 6 additions & 1 deletion build/source/dshare/globalData.f90
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ MODULE globalData
USE data_types,only:extended_info ! extended metadata for variables in each model structure
USE data_types,only:struct_info ! summary information on all data structures
USE data_types,only:var_i ! vector of integers
USE data_types,only:gru_hru_double ! x%gru(:)%hru(:)%var(:) (rkind)
! number of variables in each data structure
USE var_lookup,only:maxvarTime ! time: maximum number variables
USE var_lookup,only:maxvarForc ! forcing data: maximum number variables
Expand Down Expand Up @@ -232,14 +233,18 @@ MODULE globalData
integer(i4b),save,public :: chunksize=1024 ! chunk size for the netcdf read/write
integer(i4b),save,public :: outputPrecision=nf90_double ! variable type
integer(i4b),save,public :: outputCompressionLevel=4 ! output netcdf file deflate level: 0-9. 0 is no compression.
! define vectors for the buffered read
integer(i4b),save,public :: ixStartRead ! start index of the data read
real(rkind),save,public,allocatable :: fulltimeVec(:) ! full time vector in an input file (nRead)
type(gru_hru_double),save,public,allocatable :: fullforcingStruct(:) ! x(:)%gru(:)%hru(:)%var(:) -- full model forcing data
! define result from the time calls
integer(i4b),dimension(8),save,public :: startInit,endInit ! date/time for the start and end of the initialization
integer(i4b),dimension(8),save,public :: startSetup,endSetup ! date/time for the start and end of the parameter setup
integer(i4b),dimension(8),save,public :: startRestart,endRestart ! date/time for the start and end to read restart data
integer(i4b),dimension(8),save,public :: startRead,endRead ! date/time for the start and end of the data read
integer(i4b),dimension(8),save,public :: startWrite,endWrite ! date/time for the start and end of the stats/write
integer(i4b),dimension(8),save,public :: startPhysics,endPhysics ! date/time for the start and end of the physics
! define elapsed time
! define elapsed time
real(rkind),save,public :: elapsedInit ! elapsed time for the initialization
real(rkind),save,public :: elapsedSetup ! elapsed time for the parameter setup
real(rkind),save,public :: elapsedRestart ! elapsed time to read restart data
Expand Down
3 changes: 2 additions & 1 deletion build/source/dshare/var_lookup.f90
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ MODULE var_lookup
integer(i4b) :: infRateMax = integerMissing ! choice of method to determine maximum infiltration rate
integer(i4b) :: surfRun_IE = integerMissing ! choice of parameterization for infiltration excess surface runoff
integer(i4b) :: surfRun_SE = integerMissing ! choice of parameterization for saturation excess surface runoff
integer(i4b) :: read_force = integerMissing ! method used to read forcing data (per step or full read)

endtype iLook_decision

Expand Down Expand Up @@ -906,7 +907,7 @@ MODULE var_lookup
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)
41, 42, 43, 44)
! named variables: model time
type(iLook_time), public,parameter :: iLookTIME =iLook_time ( 1, 2, 3, 4, 5, 6, 7)
! named variables: model forcing data
Expand Down
12 changes: 12 additions & 0 deletions build/source/engine/mDecisions.f90
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ module mDecisions_module
integer(i4b),parameter,public :: FUSEPRMS = 353 ! FUSE PRMS surface runoff
integer(i4b),parameter,public :: FUSEAVIC = 354 ! FUSE ARNO/VIC surface runoff
integer(i4b),parameter,public :: FUSETOPM = 355 ! FUSE TOPMODEL surface runoff
! look-up values for the handling of forcing data
integer(i4b),parameter,public :: readPerStep = 361 ! read forcing data per time step (defualt)
integer(i4b),parameter,public :: readFullSeries = 362 ! read full forcing series

! -----------------------------------------------------------------------------------------------------------

Expand Down Expand Up @@ -713,6 +716,15 @@ subroutine mDecisions(err,message)
err=10; message=trim(message)//"unknown option for saturation excess surface runoff method [option="//trim(model_decisions(iLookDECISIONS%surfRun_SE)%cDecision)//"]"; return
end select

! method used to read forcing data (per step or full read)
! NOTE: use read forcing data per time step as the defualt
select case(trim(model_decisions(iLookDECISIONS%read_force)%cDecision))
case('readPerStep','notPopulatedYet'); model_decisions(iLookDECISIONS%read_force)%iDecision = readPerStep ! read forcing data per time step (defualt)
case('readFullSeries' ); model_decisions(iLookDECISIONS%read_force)%iDecision = readFullSeries ! read full forcing series
case default
err=10; message=trim(message)//"unknown option for method used to read forcing data [option="//trim(model_decisions(iLookDECISIONS%read_force)%cDecision)//"]"; return
end select

! -----------------------------------------------------------------------------------------------------------------------------------------------
! check for consistency among options
! -----------------------------------------------------------------------------------------------------------------------------------------------
Expand Down
Loading