Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temporary fix on history file frequency #177

Merged
merged 1 commit into from
Mar 27, 2021
Merged
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
53 changes: 27 additions & 26 deletions route/build/cpl/RtmMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ SUBROUTINE route_run(rstwr)
USE globalData, ONLY: rch_per_proc ! number of reaches assigned to each proc (i.e., node)
USE globalData, ONLY: basinRunoff_main ! mainstem only HRU runoff
USE globalData, ONLY: basinRunoff_trib ! tributary only HRU runoff
USE write_simoutput_pio, ONLY: prep_output
USE write_simoutput_pio, ONLY: main_new_file !
USE mpi_routine, ONLY: mpi_route ! MPI routing call
USE write_simoutput_pio, ONLY: output
USE write_restart_pio, ONLY: restart_output
Expand Down Expand Up @@ -427,31 +427,32 @@ SUBROUTINE route_run(rstwr)

enddo

if (npes==1) then
allocate(RCHFLX_local(rch_per_proc(-1)), stat=ierr)
RCHFLX_local(1:rch_per_proc(-1)) = RCHFLX_main(iens,1:rch_per_proc(-1))
else
if (masterproc) then
associate(nRch_main => rch_per_proc(-1), nRch_trib => rch_per_proc(0))
allocate(RCHFLX_local(nRch_main+nRch_trib), stat=ierr)
if (nRch_main/=0) then
RCHFLX_local(1:nRch_main) = RCHFLX_main(iens, 1:nRch_main)
end if
if (nRch_trib/=0) then
RCHFLX_local(nRch_main+1:nRch_main+nRch_trib) = RCHFLX_trib(iens,1:nRch_trib)
end if
end associate
else
allocate(RCHFLX_local(rch_per_proc(iam)), stat=ierr)
RCHFLX_local(1:rch_per_proc(iam)) = RCHFLX_trib(iens, 1:rch_per_proc(iam))
endif
endif

do nr = rtmCTL%begr,rtmCTL%endr
rtmCTL%volr(nr) = 0._r8
rtmCTL%flood(nr) = 0._r8
rtmCTL%discharge(nr,1) = rtmCTL%discharge(nr,1) + RCHFLX_local(nr)%REACH_Q
enddo
! if (npes==1) then
! allocate(RCHFLX_local(rch_per_proc(-1)), stat=ierr)
! RCHFLX_local(1:rch_per_proc(-1)) = RCHFLX_main(iens,1:rch_per_proc(-1))
! else
! if (masterproc) then
! associate(nRch_main => rch_per_proc(-1), nRch_trib => rch_per_proc(0))
! allocate(RCHFLX_local(nRch_main+nRch_trib), stat=ierr)
! if (nRch_main/=0) then
! RCHFLX_local(1:nRch_main) = RCHFLX_main(iens, 1:nRch_main)
! end if
! if (nRch_trib/=0) then
! RCHFLX_local(nRch_main+1:nRch_main+nRch_trib) = RCHFLX_trib(iens,1:nRch_trib)
! end if
! end associate
! else
! allocate(RCHFLX_local(rch_per_proc(iam)), stat=ierr)
! RCHFLX_local(1:rch_per_proc(iam)) = RCHFLX_trib(iens, 1:rch_per_proc(iam))
! endif
! endif

! Need to fix nr index is for hru. if hru number and rch number are different, this does not work
! do nr = rtmCTL%begr,rtmCTL%endr
! rtmCTL%volr(nr) = 0._r8
! rtmCTL%flood(nr) = 0._r8
! rtmCTL%discharge(nr,1) = rtmCTL%discharge(nr,1) + RCHFLX_local(nr)%REACH_Q
! enddo


call t_stopf('mizuRoute_subcycling')
Expand Down