Skip to content

Commit

Permalink
Merge pull request #197 from nmizukami/develop_bugfix_restart
Browse files Browse the repository at this point in the history
Develop bugfix restart
  • Loading branch information
nmizukami authored Aug 12, 2021
2 parents 2c96a0d + cd8dc2e commit b3a9332
Show file tree
Hide file tree
Showing 5 changed files with 244 additions and 68 deletions.
2 changes: 2 additions & 0 deletions route/build/src/globalData.f90
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ module globalData
USE var_lookup, only : nVarsPFAF ! number of variables for data structure
USE var_lookup, only : nVarsRFLX ! number of variables for data structure
USE var_lookup, only : nVarsIRFbas ! number of variables for data structure
USE var_lookup, only : nVarsBasinQ ! number of variables for data structure
USE var_lookup, only : nVarsIRF ! number of variables for data structure
USE var_lookup, only : nVarsKWT ! number of variables for data structure

Expand Down Expand Up @@ -91,6 +92,7 @@ module globalData
type(var_info) , public :: meta_PFAF (nVarsPFAF ) ! pfafstetter code
type(meta_var) , public :: meta_rflx (nVarsRFLX ) ! reach flux variables
type(meta_var) , public :: meta_irf_bas(nVarsIRFbas ) ! basin IRF routing fluxes/states
type(meta_var) , public :: meta_basinQ (nVarsBasinQ ) ! reach inflow from basin
type(meta_var) , public :: meta_kwt (nVarsKWT ) ! KWT routing fluxes/states
type(meta_var) , public :: meta_irf (nVarsIRF ) ! IRF routing fluxes/states

Expand Down
22 changes: 13 additions & 9 deletions route/build/src/popMetadat.f90
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ module popMetadat_module
USE globalData, only : meta_PFAF ! pfafstetter code

USE globalData, only : meta_rflx ! reach flux variables
USE globalData, only : meta_irf_bas ! within-basin irf routing fluxes and states
USE globalData, only : meta_irf_bas ! within-basin irf routing future flow
USE globalData, only : meta_basinQ ! reach inflow from basin
USE globalData, only : meta_irf ! irf routing fluxes and states in a segment
USE globalData, only : meta_kwt ! kinematic wave routing fluxes and states in a segment

Expand All @@ -44,10 +45,11 @@ module popMetadat_module
USE var_lookup, only : ixNTOPO , nVarsNTOPO ! index of variables for data structure
USE var_lookup, only : ixPFAF , nVarsPFAF ! index of variables for data structure

USE var_lookup, only : ixRFLX , nVarsRFLX ! index of variables for data structure
USE var_lookup, only : ixKWT , nVarsKWT ! index of variables for data structure
USE var_lookup, only : ixIRF , nVarsIRF ! index of variables for data structure
USE var_lookup, only : ixIRFbas , nVarsIRFbas ! index of variables for data structure
USE var_lookup, only : ixRFLX ! index of variables for data structure
USE var_lookup, only : ixKWT ! index of variables for data structure
USE var_lookup, only : ixIRF ! index of variables for data structure
USE var_lookup, only : ixIRFbas ! index of variables for data structure
USE var_lookup, only : ixBasinQ ! index of variables for data structure

implicit none

Expand Down Expand Up @@ -154,20 +156,22 @@ subroutine popMetadat(err,message)
call meta_rflx(ixRFLX%KWTroutedRunoff )%init('KWTroutedRunoff' , 'KWT routed runoff in each reach' , 'm3/s', nf90_float, [ixQdims%seg,ixQdims%time], .true.)
call meta_rflx(ixRFLX%IRFroutedRunoff )%init('IRFroutedRunoff' , 'IRF routed runoff in each reach' , 'm3/s', nf90_float, [ixQdims%seg,ixQdims%time], .true.)

! Kinematic Wave varName varDesc unit, varType, varDim, writeOut
! Kinematic Wave varName varDesc unit, varType, varDim, writeOut
call meta_kwt(ixKWT%tentry )%init('tentry' , 'time when a wave enters a segment' , 'sec' , nf90_double, [ixStateDims%seg,ixStateDims%wave,ixStateDims%ens], .true.)
call meta_kwt(ixKWT%texit )%init('texit' , 'time when a wave is expected to exit a segment', 'sec' , nf90_double, [ixStateDims%seg,ixStateDims%wave,ixStateDims%ens], .true.)
call meta_kwt(ixKWT%qwave )%init('qwave' , 'flow of a wave' , 'm2/sec', nf90_double, [ixStateDims%seg,ixStateDims%wave,ixStateDims%ens], .true.)
call meta_kwt(ixKWT%qwave_mod)%init('qwave_mod', 'modified flow of a wave' , 'm2/sec', nf90_double, [ixStateDims%seg,ixStateDims%wave,ixStateDims%ens], .true.)
call meta_kwt(ixKWT%routed )%init('routed' , 'routing flag' , '-' , nf90_int, [ixStateDims%seg,ixStateDims%wave,ixStateDims%ens], .true.)

! Impulse Response Function varName varDesc unit, varType, varDim, writeOut
! Impulse Response Function varName varDesc unit, varType, varDim, writeOut
call meta_irf(ixIRF%qfuture)%init('irf_qfuture', 'future flow series', 'm3/sec' ,nf90_double, [ixStateDims%seg,ixStateDims%tdh_irf,ixStateDims%ens] , .true.)
call meta_irf(ixIRF%irfVol) %init('irf_volume' , 'IRF reach volume' , 'm3' ,nf90_double, [ixStateDims%seg,ixStateDims%ens] , .true.)

! Basin Impulse Response Function varName varDesc unit, varType, varDim, writeOut
! Basin Impulse Response Function varName varDesc unit, varType, varDim, writeOut
call meta_irf_bas(ixIRFbas%qfuture)%init('qfuture', 'future flow series', 'm3/sec' ,nf90_double, [ixStateDims%seg,ixStateDims%tdh,ixStateDims%ens], .true.)
call meta_irf_bas(ixIRFbas%q )%init('basin_q', 'basin routed flow' , 'm3/sec' ,nf90_double, [ixStateDims%seg,ixStateDims%ens] , .true.)

! reach inflow from basin varName varDesc unit, varType, varDim, writeOut
call meta_basinQ(ixBasinQ%q )%init('basin_q', 'inflow into reach from hru' , 'm3/sec' ,nf90_double, [ixStateDims%seg,ixStateDims%ens] , .true.)

end subroutine popMetadat

Expand Down
Loading

0 comments on commit b3a9332

Please sign in to comment.