A working FLOOD version
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 30/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- fortran
- Área
- backend
Línea de trabajo
Comienza en src/riverroute/RtmMod.F90 leyendo Rtmini y Rtmrun, incluido el flujo existente de RtmFloodInit y los cálculos de inundación propuestos. Traza cómo interactúan TRunoff, TUnit y rtmCTL antes de implementar el comportamiento de FLOOD; la tarea estará terminada cuando haya una versión de FLOOD instalada y funcional, con pruebas que lo cubran.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
As a followup to #80 we do want in place a working version of FLOOD for MOSART. This will take some work to put into place. And we should have some tests for it when it is installed.
Here is what @swensosc suggests we should do, first remove the contents of the RtmFloodInit subroutine and then do the following...
index c597256..fe42015 100644
--- a/src/riverroute/RtmMod.F90
+++ b/src/riverroute/RtmMod.F90
@@ -974,24 +974,9 @@ subroutine Rtmini
call RunoffInit(rtmCTL%begr, rtmCTL%endr, rtmCTL%numr)
- !-------------------------------------------------------
- ! Initialize mosart flood - rtmCTL%fthresh and evel
- !-------------------------------------------------------
-
- if (do_rtmflood) then
- write(iulog,*) subname,' Flood not validated in this version, abort'
- call shr_sys_abort(subname//' Flood feature unavailable')
- call RtmFloodInit (frivinp_rtm, rtmCTL%begr, rtmCTL%endr, rtmCTL%fthresh, evel)
- else
- effvel(:) = effvel0 ! downstream velocity (m/s)
- rtmCTL%fthresh(:) = abs(spval)
- do nt = 1,nt_rtm
- do nr = rtmCTL%begr,rtmCTL%endr
- evel(nr,nt) = effvel(nt)
- enddo
- enddo
- end if
+!scs: I think all of the code, even the evel/effvel stuff can be removed; it appears to be local
+
!-------------------------------------------------------
! Initialize runoff data type
!-------------------------------------------------------
@@ -1420,6 +1405,12 @@ subroutine Rtmrun(rstwr,nlend,rdate)
real(r8) :: qgwl_volume ! volume of runoff during time step [m3]
real(r8) :: irrig_volume ! volume of irrigation demand during time step [m3]
+ real(r8) :: scalar
+ real(r8) :: bheight ! height above bankfull (m)
+ real(r8) :: swidth ! river surface width (m)
+ real(r8) :: rarea_cross ! river cross section area (m2)
+ real(r8) :: rarea_surface ! river surface area (m2)
+
character(len=*),parameter :: subname = '(Rtmrun) '
!-----------------------------------------------------------------------
@@ -1542,33 +1533,55 @@ subroutine Rtmrun(rstwr,nlend,rdate)
! rtmCTL%flood is m3/s here
!-----------------------------------
- call t_startf('mosartr_flood')
- nt = 1
- rtmCTL%flood = 0._r8
- do nr = rtmCTL%begr,rtmCTL%endr
- ! initialize rtmCTL%flood to zero
- if (rtmCTL%mask(nr) == 1) then
- if (rtmCTL%volr(nr,nt) > rtmCTL%fthresh(nr)) then
- ! determine flux that is sent back to the land
- ! this is in m3/s
- rtmCTL%flood(nr) = &
- (rtmCTL%volr(nr,nt)-rtmCTL%fthresh(nr)) / (delt_coupling)
+ !scs
+ if (do_rtmflood) then
+ ! determine flux that is sent back to the land, in m3/s
+
+ call t_startf('mosartr_flood')
+ nt = 1
+ rtmCTL%flood = 0._r8
+ do nr = rtmCTL%begr,rtmCTL%endr
+ ! initialize rtmCTL%flood to zero
+ if (rtmCTL%mask(nr) == 1) then
+ if (TRunoff%yr(nr,1) > TUnit%rdepth(nr)) then
+ ! compute flooding flux when water depth is greater than bankfull depth
+ scalar = 5e-2_r8
+
+ ! height of water surface above bankfull height
+ bheight = TRunoff%yr(nr,1) - TUnit%rdepth(nr)
+
+ if (bheight > 0._r8) then
+ ! river surface width
+ swidth = TUnit%rwidth(nr) + 2._r8*bheight/0.1_r8
+
+ ! river cross section area
+ rarea_cross = (TUnit%rwidth(nr) * TUnit%rdepth(nr)) + 0.5*bheight*(swidth + TUnit%rwidth(nr))
+
+ ! river surface area
+ rarea_surface = swidth * TRunoff%wr(nr,1) / TRunoff%mr(nr,1)
+
+ ! surface area of river sets scale for scalar
+ rtmCTL%flood(nr) = scalar * bheight * rarea_surface / delt_coupling
+
+ ! limit flood water to above bankfull water amount
+ if (TRunoff%wr(nr,1) - (rtmCTL%flood(nr) * delt_coupling) < (TRunoff%wr(nr,1) * TUnit%rwidth(nr) * TUnit%rdepth(nr) / TRunoff%mr(nr,1))) then
+ rtmCTL%flood(nr) = (TRunoff%wr(nr,1) - (TRunoff%wr(nr,1) * TUnit%rwidth(nr) * TUnit%rdepth(nr) / TRunoff%mr(nr,1)))/delt_coupling
+ endif
+
+ ! remove flood water from wr (main channel)
+ TRunoff%wr(nr,1) = TRunoff%wr(nr,1) - rtmCTL%flood(nr) * delt_coupling
+
+ if(TRunoff%wr(nr,1) < 0._r8) then
+ write(iulog,*) ' negative_wr ',TRunoff%wr(nr,1), rtmCTL%flood(nr) * delt_coupling
+ endif
+ endif
+ endif
- ! rtmCTL%flood will be sent back to land - so must subtract this
- ! from the input runoff from land
- ! tcraig, comment - this seems like an odd approach, you
- ! might create negative forcing. why not take it out of
- ! the volr directly? it's also odd to compute this
- ! at the initial time of the time loop. why not do
- ! it at the end or even during the run loop as the
- ! new volume is computed. fluxout depends on volr, so
- ! how this is implemented does impact the solution.
- TRunoff%qsur(nr,nt) = TRunoff%qsur(nr,nt) - rtmCTL%flood(nr)
endif
- endif
- enddo
- call t_stopf('mosartr_flood')
-
+ enddo
+ call t_stopf('mosartr_flood')
+ endif
+
!-----------------------------------------------------
! DIRECT sMAT transfer to outlet point using sMat
! Remember to subtract water from TRunoff forcing
@@ -1892,6 +1905,11 @@ subroutine Rtmrun(rstwr,nlend,rdate)
rtmCTL%wr = TRunoff%wr
rtmCTL%erout = TRunoff%erout
+ !scs: set river water height for history (just tracer 1 i.e. liquid)
+ rtmCTL%rheight = TRunoff%yr(:,1)
+ rtmCTL%fheight = TRunoff%yr(:,1) - TUnit%rdepth
+ rtmCTL%flood_flux = 1e3*rtmCTL%flood/rtmCTL%area ! mm/s
+
do nt = 1,nt_rtm
do nr = rtmCTL%begr,rtmCTL%endr
volr_init = rtmCTL%volr(nr,nt)
- Lenguaje dominante
- Fortran
- Estrellas
- 12
- Forks
- 35
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Aún no hemos revisado los archivos de configuración de este proyecto. Empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de ESCOMP/MOSART
-
MOSART does not have the `history_tape_in_use` functionalityQuizá libre de nuevo @slevis-lmwg la tomó hace 450 días y no hay ningún pull request abierto. Abiertoenhancement low priority
-
Fix logic for ctl%rof_from_glcAbiertobug
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
-
code cleanup enhancement low priority
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
-
Create long-standing development "GW" branch for GroundWater component developmentQuizá libre de nuevo @ekluzek la tomó hace 994 días y no hay ningún pull request abierto. Abiertoquestion
Todos los issues de ESCOMP/MOSART
Issues similares
-
pydanty:is-working
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
pydantic/pydantic-ai#8843 ·
Los mantenedores suelen responder en 1 día
-
breaking change enhancement server
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
openhab/openhab-core#5847 ·
Los mantenedores suelen responder en 1 día
-
bug P2 reliability
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
afreidah/s3-orchestrator#1564 ·
Los mantenedores suelen responder en 1 día
-
SSH workspace restore rewrites relative symlinks into the deleted sync-back staging directoryAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
paperclipai/paperclip#14173 ·
Los mantenedores suelen responder en 1 día