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

Feature/mpi pio #162

Merged
merged 5 commits into from
Dec 9, 2020
Merged
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
3 changes: 3 additions & 0 deletions route/build/src/remap.f90
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,9 @@ subroutine sort_flux (ID_in, & ! input: the array of ids for HRU/seg

end do ! looping through basins in the mapping layer

! removing the negative values and also the realmissing
where (sorted_flux <0._dp) sorted_flux = 0._dp

end subroutine sort_flux

! *****
Expand Down
10 changes: 5 additions & 5 deletions route/build/src/standalone/model_setup.f90
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ END SUBROUTINE inFile_pop
! private subroutine: to synchronize the iTimebound of
! the inputfileinfo_wm to match the inputfileinfo
! *********************************************************************
SUBROUTINE inFile_sync_time(inputfileinfo, & ! input: the structure of simulated runoff, evapo and
SUBROUTINE inFile_sync_time(inputfileinfo, & ! input: the structure of simulated runoff, evapo and
inputfileinfo_wm, & ! inout: input file information
ierr, message) ! output: error control

Expand All @@ -349,7 +349,7 @@ SUBROUTINE inFile_sync_time(inputfileinfo, & ! input: the structure of simu
integer(i4b) :: nFile ! number of nc files for the simulated runoff
integer(i4b) :: nFile_wm ! number of nc files for the water managent
integer(i4b) :: iFile ! for loop over the nc files
real(dp) :: refJulday_local ! the reference julian day based on the first nc file
real(dp) :: day_runoff_start ! the Julian day that runoff starts
real(dp) :: day_start_diff ! conversion of the day to the local time
real(dp) :: day_end_diff ! conversion of the day to the local time

Expand All @@ -358,16 +358,16 @@ SUBROUTINE inFile_sync_time(inputfileinfo, & ! input: the structure of simu
ierr=0; message='inFile_sync_time/'

! set the reference julday based on the first nc file of simulation
refJulday_local = inputfileinfo(1)%ncrefjulday
nFile = size(inputfileinfo)
nFile_wm = size(inputfileinfo_wm)
day_runoff_start = inputfileinfo(1)%timeVar(1)/inputfileinfo(1)%convTime2Days+inputfileinfo(1)%ncrefjulday

do iFile=1,nFile_wm

nt = inputfileinfo_wm(iFile)%nTime ! get the number of time

day_start_diff = inputfileinfo_wm(iFile)%timeVar(1) /inputfileinfo_wm(iFile)%convTime2Days+inputfileinfo_wm(iFile)%ncrefjulday - refJulday_local
day_end_diff = inputfileinfo_wm(iFile)%timeVar(nt)/inputfileinfo_wm(iFile)%convTime2Days+inputfileinfo_wm(iFile)%ncrefjulday - refJulday_local
day_start_diff = inputfileinfo_wm(iFile)%timeVar(1) /inputfileinfo_wm(iFile)%convTime2Days+inputfileinfo_wm(iFile)%ncrefjulday - day_runoff_start
day_end_diff = inputfileinfo_wm(iFile)%timeVar(nt)/inputfileinfo_wm(iFile)%convTime2Days+inputfileinfo_wm(iFile)%ncrefjulday - day_runoff_start

inputfileinfo_wm(iFile)%iTimebound(1) = day_start_diff * secprday/dt + 1 ! to convert the day difference into time step difference
inputfileinfo_wm(iFile)%iTimebound(2) = day_end_diff * secprday/dt + 1 ! to convert the day difference into time step difference
Expand Down
64 changes: 34 additions & 30 deletions route/build/src/standalone/read_runoff.f90
Original file line number Diff line number Diff line change
Expand Up @@ -138,24 +138,26 @@ subroutine read_1D_runoff_metadata(&
ierr, message) ! output: error control
implicit none
! input variables
character(*), intent(in) :: fname ! filename
character(*), intent(in) :: var_time_name ! name of the varibale time
character(*), intent(in) :: dim_time_name ! name of dimension for time
character(*), intent(in) :: var_hru_name ! name of the varibale hru
character(*), intent(in) :: dim_hru_name ! name of dimension for hydrological HRUs
character(*), intent(in) :: fname ! filename
character(*), intent(in) :: var_time_name ! name of the varibale time
character(*), intent(in) :: dim_time_name ! name of dimension for time
character(*), intent(in) :: var_hru_name ! name of the varibale hru
character(*), intent(in) :: dim_hru_name ! name of dimension for hydrological HRUs
! output variables
integer(i4b), intent(out) :: nSpace(1:2) ! nSpace of the input in runoff or wm strcuture
integer(i4b), intent(out) :: nTime ! nTime of the input in runoff or wm strcuture
real(dp), allocatable, intent(out) :: sim(:) ! 1D simulation
real(dp), allocatable, intent(out) :: sim2D(:,:) ! 2D simulation
integer(i4b), allocatable, intent(out) :: ID_array(:) ! ID of seg or hru in data
character(*), intent(out) :: timeUnits ! time units
character(*), intent(out) :: calendar ! calendar
integer(i4b), intent(out) :: nSpace(1:2) ! nSpace of the input in runoff or wm strcuture
integer(i4b), intent(out) :: nTime ! nTime of the input in runoff or wm strcuture
real(dp), allocatable, intent(out) :: sim(:) ! 1D simulation
real(dp), allocatable, intent(out) :: sim2D(:,:) ! 2D simulation
integer(i4b), allocatable, intent(out) :: ID_array(:) ! ID of seg or hru in data
character(*), intent(out) :: timeUnits ! time units
character(*), intent(out) :: calendar ! calendar
! error control
integer(i4b), intent(out) :: ierr ! error code
character(*), intent(out) :: message ! error message
integer(i4b), intent(out) :: ierr ! error code
character(*), intent(out) :: message ! error message
! local variables
character(len=strLen) :: cmessage ! error message from subroutine
character(len=strLen) :: cmessage ! error message from subroutine


! initialize error control
ierr=0; message='read_1D_runoff_metadata/'

Expand Down Expand Up @@ -217,24 +219,26 @@ subroutine read_2D_runoff_metadata(&
ierr, message) ! output: error control
implicit none
! input variables
character(*), intent(in) :: fname ! filename
character(*), intent(in) :: var_time_name ! name of the varibale time
character(*), intent(in) :: dim_time_name ! name of dimension for time
character(*), intent(in) :: dim_ylat_name ! name of dimension along lat
character(*), intent(in) :: dim_xlon_name ! name of dimension along lon
character(*), intent(in) :: fname ! filename
character(*), intent(in) :: var_time_name ! name of the varibale time
character(*), intent(in) :: dim_time_name ! name of dimension for time
character(*), intent(in) :: dim_ylat_name ! name of dimension along lat
character(*), intent(in) :: dim_xlon_name ! name of dimension along lon
! output variables
integer(i4b), intent(out) :: nSpace(1:2) ! nSpace of the input in runoff or wm strcuture
integer(i4b), intent(out) :: nTime ! nTime of the input in runoff or wm strcuture
real(dp), allocatable, intent(out) :: sim(:) ! 1D simulation
real(dp), allocatable, intent(out) :: sim2D(:,:) ! 2D simulation
integer(i4b), allocatable, intent(out) :: ID_array(:) ! ID of seg or hru in data
character(*), intent(out) :: timeUnits ! time units
character(*), intent(out) :: calendar ! calendar
integer(i4b), intent(out) :: nSpace(1:2) ! nSpace of the input in runoff or wm strcuture
integer(i4b), intent(out) :: nTime ! nTime of the input in runoff or wm strcuture
real(dp), allocatable, intent(out) :: sim(:) ! 1D simulation
real(dp), allocatable, intent(out) :: sim2D(:,:) ! 2D simulation
integer(i4b), allocatable, intent(out) :: ID_array(:) ! ID of seg or hru in data
character(*), intent(out) :: timeUnits ! time units
character(*), intent(out) :: calendar ! calendar
! error control
integer(i4b), intent(out) :: ierr ! error code
character(*), intent(out) :: message ! error message
integer(i4b), intent(out) :: ierr ! error code
character(*), intent(out) :: message ! error message
! local variables
character(len=strLen) :: cmessage ! error message from subroutine
character(len=strLen) :: cmessage ! error message from subroutine


! initialize error control
ierr=0; message='read_2D_runoff_metadata/'

Expand Down