76 REAL*8 :: dt_old , dt_old_old
90 CALL allocate_solver_variables
98 IF( riemann_flag .EQV. .true. )
THEN 115 WRITE(*,*)
'******** START COMPUTATION *********' 118 IF ( verbose_level .GE. 1 )
THEN 120 WRITE(*,*)
'Min q(1,:,:)=',minval(
q(1,:,:))
121 WRITE(*,*)
'Max q(1,:,:)=',maxval(
q(1,:,:))
123 WRITE(*,*)
'Min B(:,:)=',minval(
b_cent(:,:))
124 WRITE(*,*)
'Max B(:,:)=',maxval(
b_cent(:,:))
129 WRITE(*,*)
'SUM(q(1,:,:)=',sum(
q(1,:,:))
130 WRITE(*,*)
'SUM(B_cent(:,:)=',sum(
b_cent(:,:))
140 IF ( output_runout_flag )
CALL output_runout(t,stop_flag)
142 CALL output_solution(t)
146 WRITE(*,fmt=
"(A3,F10.4,A5,F9.5,A15,ES12.3E3,A15,ES12.3E3)") &
147 't =',t,
'dt =',dt0, &
148 ' total volume = ',
dx*
dy*(sum(
q(1,:,:)-
b_cent(:,:))) , &
149 ' total sediment fraction = ',
dx*
dy*(sum(
q(4,:,:)))
153 WRITE(*,fmt=
"(A3,F10.4,A5,F9.5,A15,ES12.3E3)")
't =',t,
'dt =',dt0, &
154 ' total volume = ',
dx*
dy*(sum(
q(1,:,:)-
b_cent(:,:)))
158 DO WHILE ( ( t .LT. t_end ) .AND. ( t .LT. t_steady ) )
169 IF ( t+
dt .GT. t_end )
dt = t_end - t
170 IF ( t+
dt .GT. t_output )
dt = t_output - t
172 IF ( output_runout_flag )
THEN 174 IF ( t+
dt .GT. t_runout )
dt = t_runout - t
178 dt = min(
dt,1.1d0*0.5d0*(dt_old+dt_old_old))
189 WRITE(*,fmt=
"(A3,F10.4,A5,F9.5,A15,ES12.3E3,A15,ES12.3E3)") &
191 ' total volume = ',
dx*
dy*(sum(
q(1,:,:)-
b_cent(:,:))) , &
192 ' total sediment fraction = ',
dx*
dy*(sum(
q(4,:,:)))
196 WRITE(*,fmt=
"(A3,F10.4,A5,F9.5,A15,ES12.3E3)")
't =',t,
'dt =',
dt, &
197 ' total volume = ',
dx*
dy*(sum(
q(1,:,:)-
b_cent(:,:)))
201 IF ( output_runout_flag )
THEN 203 IF ( ( t .GE. t_runout ) .OR. ( t .GE. t_end ) )
THEN 205 IF ( output_runout_flag )
CALL output_runout(t,stop_flag)
207 IF ( stop_flag )
THEN 219 IF ( ( t .GE. t_output ) .OR. ( t .GE. t_end ) )
THEN 221 CALL output_solution(t)
227 CALL deallocate_solver_variables
233 WRITE(*,*)
'Time taken by the code was',t2-t1,
'seconds' real *8 dy
Control volumes size.
real *8 t_steady
end time when reached steady solution
real *8, dimension(:,:), allocatable b_cent
Topography at the centers of the control volumes.
subroutine read_solution
Read the solution from the restart unit.
real *8 dx
Control volumes size.
real *8 t_end
end time for the run
subroutine deallocate_solver_variables
Memory deallocation.
subroutine update_param
Read the input file.
subroutine initial_conditions
Problem initialization.
real *8 dt0
Initial time step.
program imex_sflow_2d
Main Program.
subroutine init_grid
Finite volume grid initialization.
logical restart
Flag to start a run from a previous output: .
subroutine output_runout(time, stop_flag)
Write runout on file.
subroutine output_solution(time)
Write the solution on the output unit.
subroutine init_problem_param
Initialization of relaxation flags.
subroutine timestep2
Time-step computation.
logical riemann_flag
Flag to choose the sort of problem to solve.
real *8 t_output
time of the next output
subroutine read_param
Read the input file.
subroutine timestep
Time-step computation.
real *8 t_runout
time of the next runout output
subroutine riemann_problem
Riemann problem initialization.
subroutine init_param
Initialization of the variables read from the input file.
subroutine imex_rk_solver
Runge-Kutta integration.
logical solid_transport_flag
Flag to choose if we model solid phase transport.
subroutine allocate_solver_variables
Memory allocation.
logical output_runout_flag
Flag to save the max runout at ouput times.
real *8 t_start
initial time for the run
real *8, dimension(:,:,:), allocatable q
Conservative variables.