Skip to content
Closed
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
17 changes: 16 additions & 1 deletion hrldas/IO_code/module_NoahMP_hrldas_driver.F
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,16 @@ subroutine land_driver_ini(NTIME_out,wrfits,wrfite,wrfjts,wrfjte)
NoahmpIO%CROPTYPE, NoahmpIO%PLANTING, NoahmpIO%HARVEST, NoahmpIO%SEASON_GDD)
endif

!------------------------------------------------------------------------
! For surface wetland scheme, read in necessary extra fields
!------------------------------------------------------------------------
NoahmpIO%FSATMX = 0.38
NoahmpIO%WCAP = 0.1
if (NoahmpIO%IOPT_WETLAND == 2) then ! use wetland_option=2 for reading wetland extra fields
call READ_WETLAND_INPUT(NoahmpIO%HRLDAS_SETUP_FILE, NoahmpIO%XSTART, NoahmpIO%XEND, NoahmpIO%YSTART, NoahmpIO%YEND,&
NoahmpIO%FSATMX,NoahmpIO%WCAP)
endif

!------------------------------------------------------------------------
! For IOPT_TDRN = 1 or 2 READ TILE DRAIN MAP
!------------------------------------------------------------------------
Expand Down Expand Up @@ -1271,6 +1281,12 @@ subroutine land_driver_exe(itime)
call add_to_output(NoahmpIO%QSLATXY , "QSLAT" , "accumulated lateral flow" , "mm" )
call add_to_output(NoahmpIO%QLATXY , "QLAT" , "instantaneous lateral flow" , "m" )
endif

! Wetland model
if (NoahmpIO%IOPT_WETLAND > 0) then
call add_to_output(NoahmpIO%FSATXY , "FSAT" , "saturated fraction of the grid" , "-" )
call add_to_output(NoahmpIO%WSURFXY , "WSURF" , "Wetland Water Storage" , "mm" )
endif

! For now, no urban output variables included

Expand Down Expand Up @@ -1635,4 +1651,3 @@ END SUBROUTINE LOCAL_TIME


end module module_NoahMP_hrldas_driver

66 changes: 66 additions & 0 deletions hrldas/IO_code/module_hrldas_netcdf_io.F
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,72 @@ subroutine read_crop_input(wrfinput_flnm, &

end subroutine read_crop_input

!---------------------------------------------------------------------------------------------------------
subroutine read_wetland_input(wrfinput_flnm, &
xstart, xend, &
ystart, yend, &
fsatmx, wcap)
implicit none
character(len=*), intent(in) :: wrfinput_flnm
integer, intent(in) :: xstart, xend, ystart, yend
real, dimension(xstart:xend, ystart:yend), intent(out) :: fsatmx
real, dimension(xstart:xend, ystart:yend), intent(out) :: wcap

character(len=256) :: units
character(len=24) :: name
integer :: ierr,iret
integer :: ncid, varid
integer :: rank

#ifdef _PARALLEL_
call MPI_COMM_RANK(MPI_COMM_WORLD, rank, ierr)
if (ierr /= MPI_SUCCESS) stop "MPI_COMM_RANK"
#else
rank = 0
#endif


! Open the NetCDF file.
if (rank == 0) write(*,'("wrfinput_flnm: ''", A, "''")') trim(wrfinput_flnm)
#ifdef _PARALLEL_
ierr = nf90_open_par(wrfinput_flnm, NF90_NOWRITE, MPI_COMM_WORLD, MPI_INFO_NULL, ncid)
#else
ierr = nf90_open(wrfinput_flnm, NF90_NOWRITE, ncid)
#endif
if (ierr /= 0) then
write(*,'("read_wetland_input: Problem opening wrfinput file: ''", A, "''")') trim(wrfinput_flnm)
#ifdef _PARALLEL_
call mpi_finalize(ierr)
if (ierr /= 0) write(*, '("Problem with MPI_finalize.")')
#endif
stop
endif

! Get maximum saturated fraction (FSATMX)
name = "FSATMX"
iret = nf90_inq_varid(ncid, name, varid)
if (iret == 0) then
ierr = nf90_get_var(ncid, varid, fsatmx, start=(/xstart,ystart/), count=(/xend-xstart+1,yend-ystart+1/))
else
write(*,*) "MODULE_HRLDAS_NETCDF_IO: Problem finding variable '"//trim(name)//"' in NetCDF file. Using default values."
endif

! Get maximum water storeage (WSTORE)
name = "WCAP"
iret = nf90_inq_varid(ncid, name, varid)
if (iret == 0) then
ierr = nf90_get_var(ncid, varid, wcap, start=(/xstart,ystart/), count=(/xend-xstart+1,yend-ystart+1/))
else
write(*,*) "MODULE_HRLDAS_NETCDF_IO: Problem finding variable '"//trim(name)//"' in NetCDF file. Using default values."
endif


! Close the NetCDF file
ierr = nf90_close(ncid)
if (ierr /= 0) stop "MODULE_NOAHLSM_HRLDAS_INPUT: read_wetland_input: NF90_CLOSE"

end subroutine read_wetland_input

!---------------------------------------------------------------------------------------------------------

subroutine read_tile_drain_map(tdinput_flnm, &
Expand Down
2 changes: 2 additions & 0 deletions hrldas/run/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ OBJS = \
../../noahmp/src/SurfaceEmissivityGlacierMod.o \
../../noahmp/src/SurfaceEnergyFluxGlacierMod.o \
../../noahmp/src/SurfaceRadiationGlacierMod.o \
../../noahmp/src/RunoffSurfaceWetlandMod.o \
../../noahmp/src/WaterWetlandMod.o \
../../noahmp/src/WaterMainGlacierMod.o

CMD = hrldas.exe
Expand Down
5 changes: 5 additions & 0 deletions hrldas/run/README.namelist
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@
! 7 -> Xinanjiang Infiltration and surface runoff scheme ((Jayawardena and Zhou, 2000)
! 8 -> Dynamic VIC surface runoff scheme (Liang and Xie, 2001)

WETLAND_OPTION = 0 ! options for wetland model [default = 0]
! wetland water budget model in (Zhang et al. 2022 WRR)
! 1 -> Single point, read parameters from table
! 2 -> 2-D, read parameters from the input file

DVIC_INFILTRATION_OPTION = 1 ! options for infiltration in dynamic VIC runoff scheme (only works when RUNOFF_OPTION=8, default=1)
! **1 -> Philip scheme
! 2 -> Green-Ampt scheme
Expand Down
1 change: 1 addition & 0 deletions hrldas/run/namelist.hrldas_example
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
BTR_OPTION = 1
SURFACE_RUNOFF_OPTION = 3
SUBSURFACE_RUNOFF_OPTION = 3
WETLAND_OPTION = 0
DVIC_INFILTRATION_OPTION = 1
SURFACE_DRAG_OPTION = 1
FROZEN_SOIL_OPTION = 1
Expand Down