From 2e3511a57979d638b11460baa4dcd7258d9341ef Mon Sep 17 00:00:00 2001 From: Naoki Mizukami Date: Wed, 18 Mar 2026 20:55:18 -0600 Subject: [PATCH 1/2] add one spacing specified for X edit descriptor --- route/build/src/dfw_route.f90 | 2 +- route/build/src/irf_route.f90 | 2 +- route/build/src/kwe_route.f90 | 2 +- route/build/src/mc_route.f90 | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/route/build/src/dfw_route.f90 b/route/build/src/dfw_route.f90 index ce460886..c2a4e62a 100644 --- a/route/build/src/dfw_route.f90 +++ b/route/build/src/dfw_route.f90 @@ -191,7 +191,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/irf_route.f90 b/route/build/src/irf_route.f90 index e5e0f11a..cfdd5722 100644 --- a/route/build/src/irf_route.f90 +++ b/route/build/src/irf_route.f90 @@ -194,7 +194,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..cd342174 100644 --- a/route/build/src/kwe_route.f90 +++ b/route/build/src/kwe_route.f90 @@ -190,7 +190,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/mc_route.f90 b/route/build/src/mc_route.f90 index b5326f14..e32f56f5 100644 --- a/route/build/src/mc_route.f90 +++ b/route/build/src/mc_route.f90 @@ -189,7 +189,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 From fb47d83965a9f99b1b2b104ac80e5b476a8886b0 Mon Sep 17 00:00:00 2001 From: Naoki Mizukami Date: Thu, 19 Mar 2026 16:47:33 -0600 Subject: [PATCH 2/2] removed unused imorted objects and removed unused local variables --- route/build/src/allocation.f90 | 22 +++++++++++----------- route/build/src/dataTypes.f90 | 2 -- route/build/src/dfw_route.f90 | 1 - route/build/src/domain_decomposition.f90 | 6 +----- route/build/src/hydraulic.f90 | 1 - route/build/src/irf_route.f90 | 1 - route/build/src/kwe_route.f90 | 2 -- route/build/src/lake_route.f90 | 3 +-- route/build/src/main_route.f90 | 1 - route/build/src/mc_route.f90 | 1 - route/build/src/nr_utils.f90 | 6 +++--- route/build/src/pio_utils.f90 | 4 ---- route/build/src/popMetadat.f90 | 8 ++++---- route/build/src/process_param.f90 | 3 --- route/build/src/write_restart_pio.f90 | 7 ++----- 15 files changed, 22 insertions(+), 46 deletions(-) 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 c2a4e62a..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 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/irf_route.f90 b/route/build/src/irf_route.f90 index cfdd5722..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) diff --git a/route/build/src/kwe_route.f90 b/route/build/src/kwe_route.f90 index cd342174..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 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 e32f56f5..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) 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_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/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