Skip to content

River routing for GEOSldas #1023

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

Draft
wants to merge 31 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
7faae9f
branch feature/yujinz/Routing_GEOSroute started, offline model was pu…
Oct 24, 2024
54950b8
change some paths for Discover
Oct 28, 2024
982bdd9
script build is replaced by run
Oct 29, 2024
f2a19da
readme.txt added
Oct 29, 2024
bf8b9a8
update K_str
Oct 31, 2024
71e44c5
Merge remote-tracking branch 'origin/develop' into feature/yujinz/Rou…
Oct 31, 2024
c6e341b
removing some Chinese characters in the comments
Oct 31, 2024
d2a0c95
more cleaning up
Nov 5, 2024
0d8ebcb
Merge remote-tracking branch 'origin/develop' into feature/yujinz/Rou…
Dec 2, 2024
5e9377a
move offline model to dir offline
Dec 2, 2024
7ceed5a
routing model was implemented to GEOSldas
Dec 2, 2024
17b7d4b
back to TAKI
Dec 6, 2024
431674c
back to Discover
Dec 6, 2024
5d98b30
a small bug fix for the offline model
Dec 18, 2024
abcf705
update the offline model to the coupled model
Jan 8, 2025
416a94f
Merge branch 'develop' into feature/yujinz/Routing_GEOSroute
gmao-rreichle Feb 26, 2025
96cbcd6
reservoir module added
Mar 10, 2025
ebe5287
temporarily disable flood control for dams
Mar 19, 2025
a81bcea
preprocessing for routing model added
Mar 20, 2025
0c5d779
code clean up, and comment&documents added
May 8, 2025
af2ec8b
Merge remote-tracking branch 'origin/develop' into feature/yujinz/Rou…
May 8, 2025
9a08d7b
'==' changed to '.eqv.'
May 8, 2025
32fe955
'.eqv.' replaces '=='
May 9, 2025
1fb57bb
Merge branch 'develop' into feature/yujinz/Routing_GEOSroute
gmao-rreichle May 21, 2025
ef58210
changed variable name NUM_CATCH -> NUM_CATCH_ENS for clarity (GEOS_La…
gmao-rreichle May 21, 2025
85af5a7
avoid duplicate hard-coding of #Pfaf catchments; fixed indent, alignm…
gmao-rreichle May 21, 2025
4e3cfec
added comments to clarify connected "RUNOFF" variable (GEOS_LandGridC…
gmao-rreichle May 21, 2025
e367061
Update CMakeLists.txt
weiyuan-jiang May 23, 2025
f1c450d
copying river_input through make_bcs
Jun 18, 2025
c60c59b
river routing input data pointing to bcs
Jun 19, 2025
636cbf1
-diag-disable=10448 added in the building of routing_model preproc
Jun 19, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module GEOS_LandGridCompMod
use GEOS_CatchGridCompMod, only : CatchSetServices => SetServices
use GEOS_CatchCNGridCompMod, only : CatchCNSetServices => SetServices
use GEOS_IgniGridCompMod, only : IgniSetServices => SetServices
! use GEOS_RouteGridCompMod, only : RouteSetServices => SetServices
use GEOS_RouteGridCompMod, only : RouteSetServices => SetServices
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is not about this particular line, but rather about the placement of GEOS_RouteGridComp inside GEOS_LandGridComp. Ultimately, we will need to route runoff from the land and the landice tiles. To do that, I think we need to place GEOS_RouteGridComp one level up, within GEOS_SurfaceGridComp (that is, next to GEOS_LandGridComp). Making this change will likely require extensive re-wiring. I wonder if it's best to tackle this re-wiring first or delay the move until later.


implicit none
private
Expand All @@ -45,7 +45,7 @@ module GEOS_LandGridCompMod


integer :: VEGDYN
integer, allocatable :: CATCH(:), ROUTE (:), CATCHCN (:)
integer, allocatable :: CATCH(:), CATCHCN(:), ROUTE(:)
integer :: LSM_CHOICE, RUN_ROUTE, DO_GOSWIM
integer :: IGNI
logical :: DO_FIRE_DANGER
Expand Down Expand Up @@ -84,7 +84,7 @@ subroutine SetServices ( GC, RC )

character(len=ESMF_MAXSTR) :: GCName
type(ESMF_Config) :: CF, SCF
integer :: NUM_CATCH
integer :: NUM_CATCH_ENS
integer :: I
character(len=ESMF_MAXSTR) :: TMP
type(MAPL_MetaComp),pointer :: MAPL=>null()
Expand Down Expand Up @@ -134,7 +134,7 @@ subroutine SetServices ( GC, RC )
call MAPL_GridCompSetEntryPoint ( GC, ESMF_METHOD_RUN, Run2, RC=STATUS )
VERIFY_(STATUS)

call ESMF_ConfigGetAttribute ( CF, NUM_CATCH, Label="NUM_CATCH_ENSEMBLES:", default=1, RC=STATUS)
call ESMF_ConfigGetAttribute ( CF, NUM_CATCH_ENS, Label="NUM_CATCH_ENSEMBLES:", default=1, RC=STATUS)
VERIFY_(STATUS)

!------------------------------------------------------------
Expand Down Expand Up @@ -163,13 +163,13 @@ subroutine SetServices ( GC, RC )

CASE (1)

allocate (CATCH(NUM_CATCH), stat=status)
allocate (CATCH(NUM_CATCH_ENS), stat=status)
VERIFY_(STATUS)
if (NUM_CATCH == 1) then
if (NUM_CATCH_ENS == 1) then
CATCH(1) = MAPL_AddChild(GC, NAME='CATCH'//trim(tmp), SS=CatchSetServices, RC=STATUS)
VERIFY_(STATUS)
else
do I = 1, NUM_CATCH
do I = 1, NUM_CATCH_ENS
WRITE(TMP,'(I3.3)') I
GCName = 'ens' // trim(TMP) // ':CATCH'
CATCH(I) = MAPL_AddChild(GC, NAME=GCName, SS=CatchSetServices, RC=STATUS)
Expand All @@ -179,13 +179,13 @@ subroutine SetServices ( GC, RC )

CASE (2,3)

allocate (CATCHCN(NUM_CATCH), stat=status)
allocate (CATCHCN(NUM_CATCH_ENS), stat=status)
VERIFY_(STATUS)
if (NUM_CATCH == 1) then
if (NUM_CATCH_ENS == 1) then
CATCHCN(1) = MAPL_AddChild(GC, NAME='CATCHCN'//trim(tmp), SS=CatchCNSetServices, RC=STATUS)
VERIFY_(STATUS)
else
do I = 1, NUM_CATCH
do I = 1, NUM_CATCH_ENS
WRITE(TMP,'(I3.3)') I
GCName = 'ens' // trim(TMP) // ':CATCHCN'
CATCHCN(I) = MAPL_AddChild(GC, NAME=GCName, SS=CatchCNSetServices, RC=STATUS)
Expand All @@ -195,19 +195,21 @@ subroutine SetServices ( GC, RC )

END SELECT

! IF(RUN_ROUTE == 1) THEN
! if (NUM_CATCH == 1) then
! ROUTE(1) = MAPL_AddChild(GC, NAME='ROUTE', SS=RouteSetServices, RC=STATUS)
! VERIFY_(STATUS)
! else
! do I = 1, NUM_CATCH
! WRITE(TMP,'(I3.3)') I
! GCName = 'ens' // trim(TMP) // ':ROUTE'
! ROUTE(I) = MAPL_AddChild(GC, NAME=GCName, SS=RouteSetServices, RC=STATUS)
! VERIFY_(STATUS)
! end do
! end if
! ENDIF
allocate (ROUTE(NUM_CATCH_ENS), stat=status)
VERIFY_(STATUS)
IF(RUN_ROUTE == 1) THEN
if (NUM_CATCH_ENS == 1) then
ROUTE(1) = MAPL_AddChild(GC, NAME='ROUTE', SS=RouteSetServices, RC=STATUS)
VERIFY_(STATUS)
else
do I = 1, NUM_CATCH_ENS
WRITE(TMP,'(I3.3)') I
GCName = 'ens' // trim(TMP) // ':ROUTE'
ROUTE(I) = MAPL_AddChild(GC, NAME=GCName, SS=RouteSetServices, RC=STATUS)
VERIFY_(STATUS)
end do
end if
ENDIF

if (DO_FIRE_DANGER) then
IGNI = MAPL_AddChild(GC, NAME='IGNI'//trim(tmp), SS=IgniSetServices, RC=STATUS)
Expand Down Expand Up @@ -1426,7 +1428,7 @@ subroutine SetServices ( GC, RC )

! !CONNECTIONS:

DO I = 1, NUM_CATCH
DO I = 1, NUM_CATCH_ENS

SELECT CASE (LSM_CHOICE)

Expand All @@ -1453,16 +1455,16 @@ subroutine SetServices ( GC, RC )
VERIFY_(STATUS)
end if

! IF(RUN_ROUTE == 1) THEN
! call MAPL_AddConnectivity ( &
! GC ,&
! SHORT_NAME = (/'RUNOFF '/) ,&
! SRC_ID = CATCH(I) ,&
! DST_ID = ROUTE(I) ,&
!
! RC=STATUS )
! VERIFY_(STATUS)
! ENDIF
IF(RUN_ROUTE == 1) THEN
call MAPL_AddConnectivity ( &
GC ,&
SHORT_NAME = (/'RUNOFF '/) ,& ! RUNOFF = total runoff = surface runoff + baseflow
SRC_ID = CATCH(I) ,&
DST_ID = ROUTE(I) ,&

RC=STATUS )
VERIFY_(STATUS)
ENDIF

CASE (2,3)
call MAPL_AddConnectivity ( &
Expand All @@ -1486,19 +1488,19 @@ subroutine SetServices ( GC, RC )
VERIFY_(STATUS)
end if

! IF(RUN_ROUTE == 1) THEN
! call MAPL_AddConnectivity ( &
! GC ,&
! SHORT_NAME = (/'RUNOFF '/) ,&
! SRC_ID = CATCHCN(I) ,&
! DST_ID = ROUTE(I) ,&
!
! RC=STATUS )
! VERIFY_(STATUS)
! ENDIF
IF(RUN_ROUTE == 1) THEN
call MAPL_AddConnectivity ( &
GC ,&
SHORT_NAME = (/'RUNOFF '/) ,& ! RUNOFF = total runoff = surface runoff + baseflow
SRC_ID = CATCHCN(I) ,&
DST_ID = ROUTE(I) ,&

RC=STATUS )
VERIFY_(STATUS)
ENDIF
END SELECT
END DO


call MAPL_TimerAdd(GC, name="INITIALIZE" ,RC=STATUS)
VERIFY_(STATUS)
Expand Down Expand Up @@ -1669,6 +1671,7 @@ subroutine Run1(GC, IMPORT, EXPORT, CLOCK, RC )
!--------------------------------

DO I = 1, size(GCS)
if (trim(GCnames(i)) == "ROUTE") cycle
call MAPL_TimerOn(MAPL,trim(GCnames(i)), RC=STATUS ); VERIFY_(STATUS)
call ESMF_GridCompRun(GCS(I), importState=GIM(I), exportState=GEX(I), &
CLOCK=CLOCK, PHASE=1, userRC=STATUS)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
esma_set_this ()

set (srcs
#GEOS_RouteGridComp.F90
GEOS_RouteGridComp.F90
routing_model.F90
reservoir.F90
)

esma_add_library (${this} SRCS ${srcs} DEPENDENCIES MAPL ESMF::ESMF NetCDF::NetCDF_Fortran)
esma_add_library (${this} SRCS ${srcs} DEPENDENCIES MAPL GEOS_LandShared ESMF::ESMF NetCDF::NetCDF_Fortran)

install(PROGRAMS build_rivernetwork.py DESTINATION bin)
Loading