diff --git a/source/src/sfincs_data.f90 b/source/src/sfincs_data.f90 index 22de7978..45b7917b 100644 --- a/source/src/sfincs_data.f90 +++ b/source/src/sfincs_data.f90 @@ -151,7 +151,8 @@ module sfincs_data character*256 :: sbgfile character*256 :: thdfile character*256 :: weirfile - character*256 :: qinffile + character*256 :: qinffile + character*256 :: runofffile character*256 :: netbndbzsbzifile character*256 :: netsrcdisfile character*256 :: netamuamvfile diff --git a/source/src/sfincs_domain.f90 b/source/src/sfincs_domain.f90 index 67f7ed6a..e4893f2e 100644 --- a/source/src/sfincs_domain.f90 +++ b/source/src/sfincs_domain.f90 @@ -1993,7 +1993,7 @@ subroutine initialize_infiltration() ! 1) Spatially-uniform constant infiltration ! Requires: - ! 2) Spatially-varying constant infiltration - ! Requires: qinfmap (does not require qinffield !) + ! Requires: qinfmap (does not require qinffield !) ! 3) Spatially-varying infiltration with CN numbers (old) ! Requires: cumprcp, cuminf, qinfmap, qinffield ! 4) Spatially-varying infiltration with CN numbers (new) @@ -2024,6 +2024,13 @@ subroutine initialize_infiltration() inftype = 'c2d' infiltration = .true. ! + elseif (runofffile /= 'none') then + ! + ! Spatially-varying constant run off + ! + inftype = 'r2d' + infiltration = .true. + ! elseif (scsfile /= 'none') then ! ! Spatially-varying infiltration with CN numbers (old) @@ -2115,6 +2122,22 @@ subroutine initialize_infiltration() do nm = 1, np qinffield(nm) = qinffield(nm)/3.6e3/1.0e3 ! convert to +m/s enddo + ! + elseif (inftype == 'r2d') then + ! + ! Spatially-varying constant runoff + ! + write(logstr,'(a)')'Info : turning on spatially-varying constant run-off' + call write_log(logstr, 0) + ! + ! Read spatially-varying runoff (only binary, specified in %) + ! + write(logstr,'(a,a)')'Info : reading infiltration file ', trim(runofffile) + call write_log(logstr, 0) + allocate(qinffield(np)) + open(unit = 500, file = trim(runofffile), form = 'unformatted', access = 'stream') + read(500)qinffield + close(500) ! elseif (inftype == 'cna') then ! diff --git a/source/src/sfincs_infiltration.f90 b/source/src/sfincs_infiltration.f90 index 76897f2d..8301fed4 100644 --- a/source/src/sfincs_infiltration.f90 +++ b/source/src/sfincs_infiltration.f90 @@ -47,6 +47,36 @@ subroutine update_infiltration_map(dt) !$omp end do !$omp end parallel ! + elseif (inftype == 'r2d') then + ! + ! Run-off coefficient map + ! + !$omp parallel & + !$omp private ( nm ) + !$omp do + do nm = 1, np + ! + qinfmap(nm) = qinffield(nm) + ! + ! No infiltration if there is no water + ! + if (subgrid) then + if (z_volume(nm)<=0.0) then + qinfmap(nm) = 100.0 + endif + else + if (zs(nm)<=zb(nm)) then + qinfmap(nm) = 100.0 + endif + endif + ! + cuminf(nm) = cuminf(nm) + (1.0-qinfmap(nm)/100.0)*netprcp(nm)*dt + netprcp(nm) = netprcp(nm) - (1.0-qinfmap(nm)/100.0)*netprcp(nm) + ! + enddo + !$omp end do + !$omp end parallel + ! elseif (inftype == 'cna') then ! ! Determine infiltration rate with Curve Number (old method; no recovery) diff --git a/source/src/sfincs_input.f90 b/source/src/sfincs_input.f90 index 01c3921a..388d1a43 100644 --- a/source/src/sfincs_input.f90 +++ b/source/src/sfincs_input.f90 @@ -182,6 +182,7 @@ subroutine read_sfincs_input() call read_char_input(500,'z0lfile',z0lfile,'none') call read_char_input(500,'wvmfile',wvmfile,'none') call read_char_input(500,'qinffile',qinffile,'none') + call read_char_input(500,'runofffile',runofffile,'none') ! Curve Number files call read_char_input(500,'scsfile',scsfile,'none') call read_char_input(500,'smaxfile',smaxfile,'none') diff --git a/source/src/sfincs_ncoutput.F90 b/source/src/sfincs_ncoutput.F90 index a2af3431..a72542ad 100644 --- a/source/src/sfincs_ncoutput.F90 +++ b/source/src/sfincs_ncoutput.F90 @@ -1236,8 +1236,12 @@ subroutine ncoutput_quadtree_map_init() if (infiltration) then NF90(nf90_def_var(map_file%ncid, 'qinf', NF90_FLOAT, (/map_file%nmesh2d_face_dimid/), map_file%qinf_varid)) NF90(nf90_def_var_deflate(map_file%ncid, map_file%qinf_varid, 1, 1, nc_deflate_level)) - NF90(nf90_put_att(map_file%ncid, map_file%qinf_varid, '_FillValue', FILL_VALUE)) - if (inftype == 'cna') then + NF90(nf90_put_att(map_file%ncid, map_file%qinf_varid, '_FillValue', FILL_VALUE)) + if (inftype == 'r2d') then + NF90(nf90_put_att(map_file%ncid, map_file%qinf_varid, 'standard_name', 'runoff')) + NF90(nf90_put_att(map_file%ncid, map_file%qinf_varid, 'long_name', 'Run-off - constant in time')) + NF90(nf90_put_att(map_file%ncid, map_file%qinf_varid, 'units', '%')) + elseif (inftype == 'cna') then NF90(nf90_put_att(map_file%ncid, map_file%qinf_varid, 'standard_name', 'S')) NF90(nf90_put_att(map_file%ncid, map_file%qinf_varid, 'long_name', 'moisture storage (S) capacity - Curve number')) NF90(nf90_put_att(map_file%ncid, map_file%qinf_varid, 'units', 'm'))