diff --git a/route/build/src/allocation.f90 b/route/build/src/allocation.f90 index 655dc8a8..60fe0ba9 100644 --- a/route/build/src/allocation.f90 +++ b/route/build/src/allocation.f90 @@ -19,13 +19,13 @@ MODULE allocation USE globalData, ONLY: meta_PFAF ! network topology ! named variables -USE var_lookup, ONLY: ixStruct, nStructures ! index of data structures -USE var_lookup, ONLY: ixDims, nDimensions ! index of dimensions -USE var_lookup, ONLY: ixHRU, nVarsHRU ! index of variables for the HRUs -USE var_lookup, ONLY: ixSEG, nVarsSEG ! index of variables for the stream segments -USE var_lookup, ONLY: ixHRU2SEG,nVarsHRU2SEG ! index of variables for the hru2segment mapping -USE var_lookup, ONLY: ixNTOPO, nVarsNTOPO ! index of variables for the network topology -USE var_lookup, ONLY: ixPFAF, nVarsPFAF ! index of variables for the pfafstetter code +USE var_lookup, ONLY: ixStruct, nStructures ! index of nStructures data structures +USE var_lookup, ONLY: ixDims ! index of dimensions +USE var_lookup, ONLY: ixSEG, nVarsSEG ! index of nVarsSEG variables for the stream segments +USE var_lookup, ONLY: ixNTOPO, nVarsNTOPO ! index of nVarsNTOPO variables for the network topology +USE var_lookup, ONLY: nVarsHRU ! number of variables for the HRUs +USE var_lookup, ONLY: nVarsHRU2SEG ! number of variables for the hru2segment mapping +USE var_lookup, ONLY: nVarsPFAF ! number of variables for the pfafstetter code implicit none @@ -71,18 +71,18 @@ SUBROUTINE alloc_struct(nHRU, & ! input: number of HRUs ! allocate the spatial dimension in all data structures allocate(structHRU(nHRU), structHRU2seg(nHRU), structSeg(nSeg), structNTOPO(nSeg), structPFAF(nSeg), stat=ierr) - if(ierr/=0)then; ierr=20; message=trim(message)//'problem allocating [structHRU,structHRU2seg,structNTOPO,structPFAF]'; return; endif + if(ierr/=0)then; message=trim(message)//'problem allocating structHRU, structHRU2seg, structNTOPO or structPFAF'; return; endif ! allocate the variable dimension in the data structures with length nHRU do iHRU=1,nHRU allocate(structHRU(iHRU)%var(nVarsHRU), structHRU2seg(iHRU)%var(nVarsHRU2SEG), stat=ierr) - if(ierr/=0)then; ierr=20; message=trim(message)//'problem allocating variables for HRUs'; return; endif + if(ierr/=0)then; message=trim(message)//'problem allocating variables for HRUs'; return; endif end do ! allocate the variable dimension in the data structures with length nSeg do iSeg=1,nSeg allocate(structSeg(iSeg)%var(nVarsSEG), structNTOPO(iSeg)%var(nVarsNTOPO), structPFAF(iSeg)%var(nVarsPFAF),stat=ierr) - if(ierr/=0)then; ierr=20; message=trim(message)//'problem allocating variables for stream segments'; return; endif + if(ierr/=0)then; message=trim(message)//'problem allocating var of structSeg,structNTOPO or structPFAF'; return; endif end do ! ---------- allocate space for the scalar variables -------------------------------------------------------------- @@ -122,7 +122,7 @@ SUBROUTINE alloc_struct(nHRU, & ! input: number of HRUs case(ixStruct%PFAF ); if(isDimScalar) allocate(structPFAF( iSpace)%var(iVar)%dat(1), stat=ierr) case default; ierr=20; message=trim(message)//'unable to identify data structure'; return end select - if(ierr/=0)then; ierr=20; message=trim(message)//'problem allocating space for the data vectors'; return; endif + if(ierr/=0)then; message=trim(message)//'problem allocating space for the data vectors'; return; endif end do ! loop through variab;es end do ! loop through space diff --git a/route/build/src/dataTypes.f90 b/route/build/src/dataTypes.f90 index 40cd31f8..0dde0e07 100644 --- a/route/build/src/dataTypes.f90 +++ b/route/build/src/dataTypes.f90 @@ -3,7 +3,6 @@ MODULE dataTypes ! used to create specific data types USE nrtype -USE public_var, ONLY: realMissing USE public_var, ONLY: integerMissing USE datetime_data, ONLY: datetime @@ -427,7 +426,6 @@ END MODULE dataTypes MODULE objTypes USE nrtype - USE public_var, only: realMissing USE public_var, only: integerMissing ! define derived type for model variables, including name, description, and units diff --git a/route/build/src/dfw_route.f90 b/route/build/src/dfw_route.f90 index ce460886..73a712cc 100644 --- a/route/build/src/dfw_route.f90 +++ b/route/build/src/dfw_route.f90 @@ -10,7 +10,6 @@ MODULE dfw_route_module USE dataTypes, ONLY: dwRCH ! dw specific state data structure USE public_var, ONLY: iulog ! i/o logical unit number USE public_var, ONLY: realMissing ! missing value for real number -USE public_var, ONLY: integerMissing ! missing value for integer number USE public_var, ONLY: desireId ! ID or reach where detailed reach state is print in log USE public_var, ONLY: dt ! simulation time step [sec] USE public_var, ONLY: is_flux_wm ! logical water management components fluxes should be read @@ -191,7 +190,7 @@ SUBROUTINE dfw_rch(this, & ! dfw_route_rch object to bound this proced RCHFLX_out, & ! inout: reach fluxes datq structure ierr, cmessage) ! output: error control if(ierr/=0)then - write(message,'(A,X,I12,X,A)') trim(message)//'/segment=', NETOPO_in(segIndex)%REACHID, '/'//trim(cmessage); return + write(message,'(A,1X,I12,1X,A)') trim(message)//'/segment=', NETOPO_in(segIndex)%REACHID, '/'//trim(cmessage); return endif end if diff --git a/route/build/src/domain_decomposition.f90 b/route/build/src/domain_decomposition.f90 index ac09540b..c53e858a 100644 --- a/route/build/src/domain_decomposition.f90 +++ b/route/build/src/domain_decomposition.f90 @@ -493,8 +493,6 @@ SUBROUTINE classify_river_basin(nDivs, & ! input: number of divisions ( integer(i4b), allocatable :: HRUindex(:) ! local array for HRU indices integer(i4b), allocatable :: ixEndorheic(:) ! local array for endorheic HRU indices integer(i4b), allocatable :: index_array(:) ! local index array - integer(i4b) :: segIndex(nSeg) ! reach index for all the reaches - integer(i4b) :: downIndex(nSeg) ! downstream reach index for all the reacheds logical(lgt) :: majorMainstem(nSeg) ! logical to indicate reach is "major" mainstem integer(i4b) :: nUpSeg ! number of upstream reaches for a reach integer(i4b) :: sumHruLocal ! sum of hrus that contribute to the segments @@ -516,9 +514,7 @@ SUBROUTINE classify_river_basin(nDivs, & ! input: number of divisions ( ! put ntopo data structure components into a separate array do iSeg = 1, nSeg - segIndex(iSeg) = structNTOPO(iSeg)%var(ixNTOPO%segIndex)%dat(1) - downIndex(iSeg) = structNTOPO(iSeg)%var(ixNTOPO%downSegIndex)%dat(1) - nUpSeg = size(structNTOPO(iSeg)%var(ixNTOPO%allUpSegIndices)%dat) + nUpSeg = size(structNTOPO(iSeg)%var(ixNTOPO%allUpSegIndices)%dat) if (nUpSeg > maxSegs) majorMainstem(iSeg) = .true. enddo diff --git a/route/build/src/hydraulic.f90 b/route/build/src/hydraulic.f90 index c0a7bbc5..50028c8e 100644 --- a/route/build/src/hydraulic.f90 +++ b/route/build/src/hydraulic.f90 @@ -32,7 +32,6 @@ MODULE hydraulic logical(lgt), parameter :: useFrictionSlope = .true. ! .false. -> approximate friction slope with channel slope real(dp), parameter :: const13=1._dp/3._dp ! constant real(dp), parameter :: const23=2._dp/3._dp ! constant -real(dp), parameter :: const43=4._dp/3._dp ! constant real(dp), parameter :: const53=5._dp/3._dp ! constant real(dp), parameter :: const103=10._dp/3._dp ! constant real(dp), parameter :: err_thresh=0.005_dp ! newton method convergence threshold diff --git a/route/build/src/init_model_data.f90 b/route/build/src/init_model_data.f90 index 62a3fae1..c61a49f4 100644 --- a/route/build/src/init_model_data.f90 +++ b/route/build/src/init_model_data.f90 @@ -18,9 +18,6 @@ MODULE init_model_data implicit none -integer(i4b),parameter :: upstream_size=1 -integer(i4b),parameter :: stream_order=2 - private public :: get_mpi_omp public :: init_model @@ -337,7 +334,6 @@ END SUBROUTINE update_time SUBROUTINE init_state_data(pid, nNodes, comm, ierr, message) ! external routines - USE ascii_utils, ONLY: lower ! convert string to lower case USE read_restart, ONLY: read_state_nc ! read netcdf state output file USE mpi_process, ONLY: mpi_restart ! shared data @@ -645,9 +641,6 @@ SUBROUTINE init_ntopo(nHRU_out, nRch_out, ! options USE public_var, ONLY: ntopAugmentMode ! River network augmentation mode USE public_var, ONLY: idSegOut ! River network subset mode (idSegOut > 0) - ! common variables - USE public_var, ONLY: realMissing ! missing value for real - USE public_var, ONLY: integerMissing ! missing value for integers ! global data USE globalData, ONLY: meta_PFAF ! meta for pfafstetter code ! external subroutines diff --git a/route/build/src/irf_route.f90 b/route/build/src/irf_route.f90 index e5e0f11a..cd9cbecd 100644 --- a/route/build/src/irf_route.f90 +++ b/route/build/src/irf_route.f90 @@ -8,7 +8,6 @@ MODULE irf_route_module USE dataTypes, ONLY: irfRCH ! irf specific state data structure USE public_var, ONLY: iulog ! i/o logical unit number USE public_var, ONLY: realMissing ! missing value for real number -USE public_var, ONLY: integerMissing ! missing value for integer number USE public_var, ONLY: desireId ! ID or reach where detailed reach state is print in log USE public_var, ONLY: dt ! simulation time step [sec] USE public_var, ONLY: qmodOption ! qmod option (use 1==direct insertion) @@ -194,7 +193,7 @@ SUBROUTINE irf_rch(this, & ! irf_route_rch object to bound this procedur RCHFLX_out, & ! inout: reach fluxes datq structure ierr, cmessage) ! output: error control if(ierr/=0)then - write(message,'(A,X,I12,X,A)') trim(message)//'/segment=', NETOPO_in(segIndex)%REACHID, '/'//trim(cmessage); return + write(message,'(A,1X,I12,1X,A)') trim(message)//'/segment=', NETOPO_in(segIndex)%REACHID, '/'//trim(cmessage); return endif end if diff --git a/route/build/src/kwe_route.f90 b/route/build/src/kwe_route.f90 index 9165e5e0..7541f81a 100644 --- a/route/build/src/kwe_route.f90 +++ b/route/build/src/kwe_route.f90 @@ -10,7 +10,6 @@ MODULE kw_route_module USE dataTypes, ONLY: kwRCH ! kw specific state data structure USE public_var, ONLY: iulog ! i/o logical unit number USE public_var, ONLY: realMissing ! missing value for real number -USE public_var, ONLY: integerMissing ! missing value for integer number USE public_var, ONLY: desireId ! ID or reach where detailed reach state is print in log USE public_var, ONLY: dt ! simulation time step [sec] USE public_var, ONLY: is_flux_wm ! logical water management components fluxes should be read @@ -24,7 +23,6 @@ MODULE kw_route_module USE hydraulic, ONLY: flow_depth USE hydraulic, ONLY: water_height USE hydraulic, ONLY: celerity -USE hydraulic, ONLY: diffusivity USE data_assimilation, ONLY: direct_insertion ! qmod option (use 1==direct insertion) implicit none @@ -190,7 +188,7 @@ SUBROUTINE kw_rch(this, & ! kwe_route_rch object to bound this procedu RCHFLX_out, & ! inout: reach fluxes datq structure ierr, cmessage) ! output: error control if(ierr/=0)then - write(message,'(A,X,I12,X,A)') trim(message)//'/segment=', NETOPO_in(segIndex)%REACHID, '/'//trim(cmessage); return + write(message,'(A,1X,I12,1X,A)') trim(message)//'/segment=', NETOPO_in(segIndex)%REACHID, '/'//trim(cmessage); return endif end if diff --git a/route/build/src/kwt_route.f90 b/route/build/src/kwt_route.f90 index 3cff7b78..b5b7f87a 100644 --- a/route/build/src/kwt_route.f90 +++ b/route/build/src/kwt_route.f90 @@ -12,7 +12,6 @@ MODULE kwt_route_module USE public_var, ONLY: is_lake_sim ! logical if lakes are activated in simulation USE public_var, ONLY: verySmall ! a very small value USE public_var, ONLY: realMissing ! missing value for real number -USE public_var, ONLY: integerMissing ! missing value for integer number USE globalData, ONLY: idxKWT ! routing method index for lagrangian kinematic wave method USE nr_utils, ONLY: arth ! Num. Recipies utilities USE base_route, ONLY: base_route_rch ! base (abstract) reach routing method class diff --git a/route/build/src/lake_route.f90 b/route/build/src/lake_route.f90 index a7a6cd6b..594f7fc3 100644 --- a/route/build/src/lake_route.f90 +++ b/route/build/src/lake_route.f90 @@ -10,7 +10,6 @@ MODULE lake_route_module USE public_var, ONLY: pi ! parameter: pi value of 3.14159265359_dp USE globalData, ONLY: isColdStart ! parameter: restart flag USE water_balance, ONLY: comp_reach_wb ! routine: compute water balance error -USE ascii_utils, ONLY: lower ! routine: convert string to lower case implicit none integer(i4b),parameter :: endorheic=0 @@ -65,7 +64,7 @@ SUBROUTINE lake_route(segIndex, & ! input: index of runoff reach to be proc real(dp) :: c ! storage to yearly activity ratio real(dp) :: I_yearly, D_yearly ! mean annual inflow and demand real(dp), dimension(12) :: I_months, D_months ! mean monthly inflow and demand - integer(i4b), dimension(2) :: array_size(2) ! get the size of array_size + integer(i4b), dimension(2) :: array_size ! get the size of array_size integer(i4b) :: start_month=0 ! start month of the operational year integer(i4b) :: i ! index integer(i4b) :: past_length_I ! pas length for inflow based on length in year and floor diff --git a/route/build/src/main_route.f90 b/route/build/src/main_route.f90 index 5cb13135..2fc69801 100644 --- a/route/build/src/main_route.f90 +++ b/route/build/src/main_route.f90 @@ -5,7 +5,6 @@ MODULE main_route_module USE dataTypes, ONLY: STRFLX ! fluxes in each reach USE dataTypes, ONLY: RCHTOPO ! Network topology USE dataTypes, ONLY: RCHPRP ! Reach parameter -USE dataTypes, ONLY: runoff ! runoff data type USE dataTypes, ONLY: subbasin_omp ! mainstem+tributary data structures USE obs_data, ONLY: gageObs USE globalData, ONLY: routeMethods ! Active routing method IDs diff --git a/route/build/src/mc_route.f90 b/route/build/src/mc_route.f90 index b5326f14..c9840886 100644 --- a/route/build/src/mc_route.f90 +++ b/route/build/src/mc_route.f90 @@ -10,7 +10,6 @@ MODULE mc_route_module USE dataTypes, ONLY: mcRCH ! MC specific state data structure USE public_var, ONLY: iulog ! i/o logical unit number USE public_var, ONLY: realMissing ! missing value for real number -USE public_var, ONLY: integerMissing ! missing value for integer number USE public_var, ONLY: desireId ! ID or reach where detailed reach state is print in log USE public_var, ONLY: dt ! simulation time step [sec] USE public_var, ONLY: qmodOption ! qmod option (use 1==direct insertion) @@ -189,7 +188,7 @@ SUBROUTINE mc_rch(this, & ! mc_route_rch object to bound this procedur RCHFLX_out, & ! inout: reach fluxes datq structure ierr, cmessage) ! output: error control if(ierr/=0)then - write(message,'(A,X,I12,X,A)') trim(message)//'/segment=', NETOPO_in(segIndex)%REACHID, '/'//trim(cmessage); return + write(message,'(A,1X,I12,1X,A)') trim(message)//'/segment=', NETOPO_in(segIndex)%REACHID, '/'//trim(cmessage); return endif end if diff --git a/route/build/src/mpi_process.f90 b/route/build/src/mpi_process.f90 index 39aba17a..60691435 100644 --- a/route/build/src/mpi_process.f90 +++ b/route/build/src/mpi_process.f90 @@ -18,18 +18,15 @@ MODULE mpi_process USE dataTypes, ONLY: var_ilength ! integer type: var(:)%dat USE dataTypes, ONLY: var_dlength ! double precision type: var(:)%dat USE dataTypes, ONLY: var_clength ! character type: var(:)%dat -USE dataTypes, ONLY: subbasin_omp ! openMP domain data structure ! named variables -USE var_lookup, ONLY:ixHRU, nVarsHRU ! index of variables for the HRUs -USE var_lookup, ONLY:ixSEG, nVarsSEG ! index of variables for the stream segments -USE var_lookup, ONLY:ixHRU2SEG,nVarsHRU2SEG ! index of variables for the hru2segment mapping +USE var_lookup, ONLY:nVarsHRU ! index of variables for the HRUs +USE var_lookup, ONLY:nVarsSEG ! index of variables for the stream segments +USE var_lookup, ONLY:nVarsHRU2SEG ! index of variables for the hru2segment mapping USE var_lookup, ONLY:ixNTOPO, nVarsNTOPO ! index of variables for the network topology -USE var_lookup, ONLY:ixPFAF, nVarsPFAF ! index of variables for the pfafstetter code ! general utility USE nr_utils, ONLY: indexx ! create sorted index array USE nr_utils, ONLY: arth ! build a vector of regularly spaced numbers USE nr_utils, ONLY: sizeo ! get size of allocatable array (if not allocated, zero) -USE nr_utils, ONLY: findIndex ! find index within a vector USE nr_utils, ONLY: match_index ! USE perf_mod, ONLY: t_startf ! timing start USE perf_mod, ONLY: t_stopf ! timing stop @@ -38,7 +35,6 @@ MODULE mpi_process USE mpi_utils, ONLY: shr_mpi_gatherV USE mpi_utils, ONLY: shr_mpi_scatterV USE mpi_utils, ONLY: shr_mpi_allgather -USE mpi_utils, ONLY: shr_mpi_abort implicit none @@ -748,7 +744,6 @@ subroutine mpi_restart(pid, & ! input: proc id ! local variables character(len=strLen) :: cmessage ! error message from subroutine integer(i4b) :: iSeg,jSeg ! loop indices - integer(i4b) :: nTbound = 2 real(dp), allocatable :: flux_global(:) ! basin runoff (m/s) for entire reaches real(dp), allocatable :: vol_global_tmp(:) ! temporary reach/lake volume (m3) for entire network real(dp), allocatable :: flux_local(:) ! basin runoff (m/s) for tributaries diff --git a/route/build/src/network_topo.f90 b/route/build/src/network_topo.f90 index 2d3f8e45..6d8888b6 100644 --- a/route/build/src/network_topo.f90 +++ b/route/build/src/network_topo.f90 @@ -8,24 +8,16 @@ MODULE network_topo ! public parameters USE public_var, ONLY: iulog ! i/o logical unit number -! metadata on data structures -USE globalData, ONLY: meta_struct ! structure information -USE globalData, ONLY: meta_HRU ! HRU properties -USE globalData, ONLY: meta_HRU2SEG ! HRU-to-segment mapping -USE globalData, ONLY: meta_SEG ! stream segment properties -USE globalData, ONLY: meta_NTOPO ! network topology - ! named variables USE public_var, ONLY: true,false ! named integers for true/false USE public_var, ONLY: verySmall ! a very small value USE public_var, ONLY: integerMissing ! named variables -USE var_lookup, ONLY:ixStruct, nStructures ! index of data structures -USE var_lookup, ONLY:ixHRU, nVarsHRU ! index of variables for the HRUs -USE var_lookup, ONLY:ixSEG, nVarsSEG ! index of variables for the stream segments -USE var_lookup, ONLY:ixHRU2SEG,nVarsHRU2SEG ! index of variables for the hru2segment mapping -USE var_lookup, ONLY:ixNTOPO, nVarsNTOPO ! index of variables for the network topology +USE var_lookup, ONLY:ixHRU ! index of variables for the HRUs +USE var_lookup, ONLY:ixSEG ! index of variables for the stream segments +USE var_lookup, ONLY:ixHRU2SEG ! index of variables for the hru2segment mapping +USE var_lookup, ONLY:ixNTOPO ! index of variables for the network topology ! external utilities USE nr_utils, ONLY: findIndex ! Num. Recipies utilities diff --git a/route/build/src/nr_utils.f90 b/route/build/src/nr_utils.f90 index 94ccfd62..c6889194 100644 --- a/route/build/src/nr_utils.f90 +++ b/route/build/src/nr_utils.f90 @@ -29,12 +29,12 @@ MODULE nr_utils END INTERFACE INTERFACE char2int - module procedure :: char2int_1d - module procedure :: char2int_2d + module procedure char2int_1d + module procedure char2int_2d END INTERFACE INTERFACE match_index - module procedure :: match_index_i4b, match_index_i8b + module procedure match_index_i4b, match_index_i8b END INTERFACE private diff --git a/route/build/src/pio_utils.f90 b/route/build/src/pio_utils.f90 index 4dfd0715..de5bdee5 100644 --- a/route/build/src/pio_utils.f90 +++ b/route/build/src/pio_utils.f90 @@ -3,7 +3,6 @@ MODULE pio_utils USE mpi USE nrtype USE pio - USE public_var, only : iulog implicit none @@ -486,11 +485,8 @@ SUBROUTINE def_var(pioFileDesc, & ! input: file descriptor integer(i4b), intent(out) :: ierr character(*), intent(out) :: message ! error message ! local variables - integer(i4b) :: dimid0(1) ! dimid for no dimension type(var_desc_t) :: pioVarId - dimid0 = 0 - if (present(pioDimId)) then ierr = pio_def_var(pioFileDesc, trim(vname), ivtype, pioDimId, pioVarId) else diff --git a/route/build/src/popMetadat.f90 b/route/build/src/popMetadat.f90 index 7f81a157..5446daca 100644 --- a/route/build/src/popMetadat.f90 +++ b/route/build/src/popMetadat.f90 @@ -40,10 +40,10 @@ module popMetadat_module USE globalData, ONLY: meta_solute ! tracer state variables ! indices of named variables -USE var_lookup, ONLY: ixStruct , nStructures -USE var_lookup, ONLY: ixDims , nDimensions -USE var_lookup, ONLY: ixStateDims, nStateDims -USE var_lookup, ONLY: ixQdims , nQdims +USE var_lookup, ONLY: ixStruct +USE var_lookup, ONLY: ixDims +USE var_lookup, ONLY: ixStateDims +USE var_lookup, ONLY: ixQdims USE var_lookup, ONLY: ixHRU , nVarsHRU USE var_lookup, ONLY: ixHRU2SEG , nVarsHRU2SEG USE var_lookup, ONLY: ixSEG , nVarsSEG diff --git a/route/build/src/process_ntopo.f90 b/route/build/src/process_ntopo.f90 index 5429f269..b0e08c19 100644 --- a/route/build/src/process_ntopo.f90 +++ b/route/build/src/process_ntopo.f90 @@ -1,10 +1,9 @@ MODULE process_ntopo -USE nrtype, ONLY: i4b,dp,lgt ! variable types, etc. +USE nrtype, ONLY: i4b,dp ! variable types, etc. USE nrtype, ONLY: strLen ! length of characters ! data types USE dataTypes, ONLY: var_ilength ! integer type: var(:)%dat -USE dataTypes, ONLY: var_clength ! integer type: var(:)%dat USE dataTypes, ONLY: var_dlength,dlength ! double precision type: var(:)%dat, or dat ! global vars USE globalData, ONLY: onRoute ! logical to indicate which routing method(s) is on @@ -15,20 +14,13 @@ MODULE process_ntopo USE public_var, ONLY: topoNetworkOption ! option to compute network topology USE public_var, ONLY: computeReachList ! option to compute reach list USE public_var, ONLY: impulseResponseFunc ! option for routing methods - IRF -USE public_var, ONLY: kinematicWaveTracking ! option for routing methods - Lagrangian kinematic wave -USE public_var, ONLY: kinematicWave ! option for routing methods - kinematic wave -USE public_var, ONLY: muskingumCunge ! option for routing methods - muskingum-cunge -USE public_var, ONLY: diffusiveWave ! option for routing methods - diffusive wave ! named variables USE public_var, ONLY: true,false ! named integers for true/false ! named variables USE var_lookup, ONLY: ixSEG ! index of variables for the stream segments USE var_lookup, ONLY: ixNTOPO ! index of variables for the network topology -USE var_lookup, ONLY: ixPFAF ! index of variables for the pfafstetter code ! common variables USE public_var, ONLY: compute ! compute given variable -USE public_var, ONLY: doNotCompute ! do not compute given variable -USE public_var, ONLY: readFromFile ! read given variable from a file USE public_var, ONLY: realMissing ! missing value for real USE public_var, ONLY: integerMissing ! missing value for integers @@ -106,12 +98,12 @@ SUBROUTINE augment_ntopo(nHRU, & ! input: number of HRUs integer(i4b) :: iSeg ! indices for stream segment real(dp) , allocatable :: seg_length(:) ! temporal array for segment length type(dlength), allocatable :: temp_dat(:) ! temporal storage for dlength data structure - integer*8 :: time0,time1,cr ! for timing + !integer(i8b) :: time0,time1,cr ! for timing ierr=0; message='augment_ntopo/' - call system_clock(count_rate=cr) - call system_clock(time0) + !call system_clock(count_rate=cr) + !call system_clock(time0) ! ---------- get the mapping between HRUs and segments ------------------------------------------------------ @@ -129,9 +121,9 @@ SUBROUTINE augment_ntopo(nHRU, & ! input: number of HRUs ierr, cmessage) ! output: error control if(ierr/=0)then; message=trim(message)//trim(cmessage); return; endif - ! get timing - call system_clock(time1) - !write(*,'(a,1x,1PG15.7,A)') 'after hru2segment: time = ', real(time1-time0,kind(dp))/real(cr), ' s' + !call system_clock(time1) + !write(*,'(a,1x,1PG15.7,A)') 'hru2segment: elapsed time = ', real(time1-time0,kind(dp))/real(cr), ' s' + !call system_clock(time0) endif ! if need to compute network topology @@ -147,9 +139,9 @@ SUBROUTINE augment_ntopo(nHRU, & ! input: number of HRUs ierr, cmessage) ! output: error control if(ierr/=0)then; message=trim(message)//trim(cmessage); return; endif - ! get timing - call system_clock(time1) - !write(*,'(a,1x,1PG15.7,A)') 'after up2downSegment: time = ', real(time1-time0,kind(dp))/real(cr), ' s' + !call system_clock(time1) + !write(*,'(a,1x,1PG15.7,A)') 'up2downSegment: elapsed time = ', real(time1-time0,kind(dp))/real(cr), ' s' + !call system_clock(time0) endif ! if need to compute network topology @@ -164,9 +156,9 @@ SUBROUTINE augment_ntopo(nHRU, & ! input: number of HRUs ierr, cmessage) ! output: error control if(ierr/=0)then; message=trim(message)//trim(cmessage); return; endif - ! get timing - call system_clock(time1) - !write(*,'(a,1x,1PG15.7,A)') 'after reachOrder: time = ', real(time1-time0,kind(dp))/real(cr), ' s' + !call system_clock(time1) + !write(*,'(a,1x,1PG15.7,A)') 'reachOrder: elapsed time = ', real(time1-time0,kind(dp))/real(cr), ' s' + !call system_clock(time0) endif ! if need to compute network topology @@ -181,9 +173,9 @@ SUBROUTINE augment_ntopo(nHRU, & ! input: number of HRUs ierr, cmessage) ! output: error control if(ierr/=0)then; message=trim(message)//trim(cmessage); return; endif - ! get timing - call system_clock(time1) - !write(*,'(a,1x,1PG15.7,A)') 'after streamOrder: time = ', real(time1-time0,kind(dp))/real(cr), ' s' + !call system_clock(time1) + !write(*,'(a,1x,1PG15.7,A)') 'streamOrder: elapsed time = ', real(time1-time0,kind(dp))/real(cr), ' s' + !call system_clock(time0) endif ! if need to compute network topology @@ -198,9 +190,9 @@ SUBROUTINE augment_ntopo(nHRU, & ! input: number of HRUs ierr, cmessage) ! Error control if(ierr/=0)then; message=trim(message)//trim(cmessage); return; endif - ! get timing - call system_clock(time1) - !write(*,'(a,1x,1PG15.7,A)') 'after reach_list: time = ', real(time1-time0,kind(dp))/real(cr), ' s' + !call system_clock(time1) + !write(*,'(a,1x,1PG15.7,A)') 'reach_list: elapsed time = ', real(time1-time0,kind(dp))/real(cr), ' s' + !call system_clock(time0) ! ---------- Compute routing parameters -------------------------------------------------------------------- ! compute channel geometry parameters (width, depth, Manning's n, and floodplain slope) @@ -234,9 +226,9 @@ SUBROUTINE augment_ntopo(nHRU, & ! input: number of HRUs bankDepth=structSEG(iSeg)%var(ixSEG%depth)%dat(1)) end do - ! get timing - call system_clock(time1) - !write(*,'(a,1x,1PG15.7,A)') 'after river geometry: time = ', real(time1-time0,kind(dp))/real(cr), ' s' + !call system_clock(time1) + !write(*,'(a,1x,1PG15.7,A)') 'river geometry: elapsed time = ', real(time1-time0,kind(dp))/real(cr), ' s' + !call system_clock(time0) ! get the channel unit hydrograph if(topoNetworkOption==compute)then @@ -264,9 +256,9 @@ SUBROUTINE augment_ntopo(nHRU, & ! input: number of HRUs enddo end if ! if using the impulse response function - ! get timing - call system_clock(time1) - !write(*,'(a,1x,1PG15.7,A)') 'after reach parameters: time = ', real(time1-time0,kind(dp))/real(cr), ' s' + !call system_clock(time1) + !write(*,'(a,1x,1PG15.7,A)') 'reach parameters: elapsed time = ', real(time1-time0,kind(dp))/real(cr), ' s' + !call system_clock(time0) endif ! if there is a need to compute the channel unit hydrograph @@ -287,9 +279,8 @@ SUBROUTINE augment_ntopo(nHRU, & ! input: number of HRUs ierr, cmessage ) ! output: error control if(ierr/=0)then; message=trim(message)//trim(cmessage); return; endif - ! get timing - call system_clock(time1) - !write(*,'(a,1x,1PG15.7,A)') 'after reach_mask: time = ', real(time1-time0,kind(dp))/real(cr), ' s' + !call system_clock(time1) + !write(*,'(a,1x,1PG15.7,A)') 'reach_mask: elapsed time = ', real(time1-time0,kind(dp))/real(cr), ' s' ! for optional output if (present(tot_hru)) tot_hru=tot_hru_tmp diff --git a/route/build/src/process_param.f90 b/route/build/src/process_param.f90 index 6d5bdbc8..637baf66 100644 --- a/route/build/src/process_param.f90 +++ b/route/build/src/process_param.f90 @@ -1,9 +1,6 @@ MODULE process_param USE nrtype -! global parameters -USE public_var, ONLY: realMissing ! missing value for real number -USE public_var, ONLY: integerMissing ! missing value for integer number implicit none diff --git a/route/build/src/process_remap.f90 b/route/build/src/process_remap.f90 index 76329b2d..313a7ff5 100644 --- a/route/build/src/process_remap.f90 +++ b/route/build/src/process_remap.f90 @@ -4,19 +4,11 @@ MODULE process_remap_module USE nrtype USE dataTypes, ONLY: remap ! remapping data type USE dataTypes, ONLY: runoff ! runoff data type - USE dataTypes, ONLY: var_ilength ! integer type: var(:)%dat - USE dataTypes, ONLY: var_dlength ! double precision type: var(:)%dat ! parameter structures USE dataTypes, ONLY: RCHPRP ! Reach parameters (properties) USE dataTypes, ONLY: RCHTOPO ! Network topology - ! look-up variables - USE var_lookup, ONLY: ixHRU, nVarsHRU ! index of variables for the HRUs - USE var_lookup, ONLY: ixSEG, nVarsSEG ! index of variables for the stream segments - USE var_lookup, ONLY: ixHRU2SEG,nVarsHRU2SEG ! index of variables for the hru2segment mapping - USE var_lookup, ONLY: ixNTOPO, nVarsNTOPO ! index of variables for the network topology - ! global data USE public_var, ONLY: iulog ! i/o logical unit number USE public_var, ONLY: runoffMin diff --git a/route/build/src/read_restart.f90 b/route/build/src/read_restart.f90 index b87b2898..705eae82 100644 --- a/route/build/src/read_restart.f90 +++ b/route/build/src/read_restart.f90 @@ -24,7 +24,7 @@ SUBROUTINE read_state_nc(fname, & ! input: state netcdf name USE ncio_utils, ONLY: check_variable USE dataTypes, ONLY: states ! meta data - USE var_lookup, ONLY: ixStateDims, nStateDims + USE var_lookup, ONLY: ixStateDims USE globalData, ONLY: meta_stateDims ! dimension for state variables USE globalData, ONLY: idxDW ! DW routing method index (now tracer use only dw method) USE globalData, ONLY: RCHFLX ! reach flux data structure for the entire domain @@ -318,7 +318,6 @@ SUBROUTINE read_IRF_state(ierr, message1) integer(i4b) :: jSeg ! index loops for reaches respectively integer(i4b), allocatable :: numQF(:) ! number of future Q time steps for each segment integer(i4b) :: ntdh_irf ! dimenion sizes - integer(i4b) :: nTbound=2 ! dimenion sizes ierr=0; message1='read_IRF_state/' diff --git a/route/build/src/read_streamSeg.f90 b/route/build/src/read_streamSeg.f90 index d136f919..207cfbe6 100644 --- a/route/build/src/read_streamSeg.f90 +++ b/route/build/src/read_streamSeg.f90 @@ -19,11 +19,8 @@ MODULE read_streamSeg ! named variables USE var_lookup, ONLY: ixStruct, nStructures ! index of data structures -USE var_lookup, ONLY: ixHRU, nVarsHRU ! index of variables for the HRUs -USE var_lookup, ONLY: ixSEG, nVarsSEG ! index of variables for the stream segments -USE var_lookup, ONLY: ixHRU2SEG,nVarsHRU2SEG ! index of variables for the hru2segment mapping -USE var_lookup, ONLY: ixNTOPO, nVarsNTOPO ! index of variables for the network topology -USE var_lookup, ONLY: ixPFAF, nVarsPFAF ! index of variables for the pfafstetter code +USE var_lookup, ONLY: ixSEG ! index of variables for the stream segments +USE var_lookup, ONLY: ixNTOPO ! index of variables for the network topology ! netcdf modules USE netcdf diff --git a/route/build/src/water_balance.f90 b/route/build/src/water_balance.f90 index 979f3940..b698a05e 100644 --- a/route/build/src/water_balance.f90 +++ b/route/build/src/water_balance.f90 @@ -3,7 +3,6 @@ MODULE water_balance USE nrtype ! data type USE dataTypes, ONLY: STRFLX ! fluxes in each reach -USE dataTypes, ONLY: RCHTOPO ! Network topology ! global parameters USE public_var, ONLY: iulog ! i/o logical unit number USE public_var, ONLY: dt ! simulation time step diff --git a/route/build/src/write_restart_pio.f90 b/route/build/src/write_restart_pio.f90 index 4382a991..c229bdb0 100644 --- a/route/build/src/write_restart_pio.f90 +++ b/route/build/src/write_restart_pio.f90 @@ -5,7 +5,7 @@ MODULE write_restart_pio USE var_lookup, ONLY: ixRFLX, nVarsRFLX USE var_lookup, ONLY: ixHFLX, nVarsHFLX -USE var_lookup, ONLY: ixStateDims, nStateDims +USE var_lookup, ONLY: ixStateDims USE var_lookup, ONLY: ixIRFbas, nVarsIRFbas USE var_lookup, ONLY: ixIRF, nVarsIRF USE var_lookup, ONLY: ixKWT, nVarsKWT @@ -28,7 +28,6 @@ MODULE write_restart_pio USE public_var, ONLY: tracer ! tracer logical ! variable meta data - see popMeta.f90 USE globalData, ONLY: meta_stateDims ! states output dimensions -USE globalData, ONLY: meta_qDims ! history output dimensions USE globalData, ONLY: meta_irf_bas ! h2o catchment routing variables USE globalData, ONLY: meta_bas_solute ! solute catchment (hru) routing variables USE globalData, ONLY: meta_basinQ ! catchment runoff variables @@ -41,9 +40,8 @@ MODULE write_restart_pio USE globalData, ONLY: meta_rflx ! reach history output variables USE globalData, ONLY: meta_hflx ! hru history output variables ! pio stuff -USE globalData, ONLY: pid, nNodes +USE globalData, ONLY: pid USE globalData, ONLY: masterproc -USE globalData, ONLY: mpicom_route USE globalData, ONLY: pioSystem USE public_var, ONLY: pio_netcdf_format USE public_var, ONLY: pio_typename @@ -210,7 +208,6 @@ SUBROUTINE restart_fname(fname, timeStamp, ierr, message) USE public_var, ONLY: restart_dir USE public_var, ONLY: case_name ! simulation name ==> output filename head - USE public_var, ONLY: secprday USE globalData, ONLY: simDatetime ! current model datetime implicit none diff --git a/route/build/src/write_simoutput_pio.f90 b/route/build/src/write_simoutput_pio.f90 index a951b93e..2e859614 100644 --- a/route/build/src/write_simoutput_pio.f90 +++ b/route/build/src/write_simoutput_pio.f90 @@ -2,15 +2,13 @@ MODULE write_simoutput_pio ! Moudle wide shared data/routines USE nrtype -USE var_lookup, ONLY: ixRFLX, nVarsRFLX -USE dataTypes, ONLY: STRFLX USE datetime_data, ONLY: datetime USE public_var, ONLY: iulog USE public_var, ONLY: integerMissing USE globalData, ONLY: runMode ! 'standalone' or 'cesm-coupling' -USE globalData, ONLY: pid, nNodes +USE globalData, ONLY: pid USE globalData, ONLY: masterproc -USE globalData, ONLY: hfileout, hfileout_gage, rfileout +USE globalData, ONLY: hfileout, hfileout_gage USE globalData, ONLY: initHvars USE historyFile, ONLY: histFile USE histVars_data, ONLY: histVars @@ -348,7 +346,6 @@ SUBROUTINE get_hfilename(inDatetime, ierr, message) integer(i4b) :: sec_in_day ! second within day character(len=strLen) :: timeString character(len=27),parameter :: fmtYMDS='(I0.4,a,I0.2,a,I0.2,a,I0.5)' - character(len=20),parameter :: fmtYMD ='(I0.4,a,I0.2,a,I0.2)' character(len=13),parameter :: fmtYM ='(I0.4,a,I0.2)' character(len=6),parameter :: fmtY ='(I0.4)' diff --git a/route/build/src/write_streamSeg.f90 b/route/build/src/write_streamSeg.f90 index 5b459b9e..41640434 100644 --- a/route/build/src/write_streamSeg.f90 +++ b/route/build/src/write_streamSeg.f90 @@ -22,11 +22,6 @@ MODULE write_streamSeg ! named variables USE var_lookup, ONLY: ixStruct, nStructures ! index of data structures USE var_lookup, ONLY: ixDims, nDimensions ! index of dimensions -USE var_lookup, ONLY: ixHRU, nVarsHRU ! index of variables for the HRUs -USE var_lookup, ONLY: ixSEG, nVarsSEG ! index of variables for the stream segments -USE var_lookup, ONLY: ixHRU2SEG,nVarsHRU2SEG ! index of variables for the hru2segment mapping -USE var_lookup, ONLY: ixNTOPO, nVarsNTOPO ! index of variables for the network topology -USE var_lookup, ONLY: ixPFAF, nVarsPFAF ! index of variables for the pfafstetter code ! netcdf modules USE netcdf