14 REAL*8,
ALLOCATABLE :: x_comp(:)
17 REAL*8,
ALLOCATABLE :: x_stag(:)
20 REAL*8,
ALLOCATABLE :: B_stag(:)
23 REAL*8,
ALLOCATABLE :: B_cent(:)
26 REAL*8,
ALLOCATABLE :: B_prime(:)
28 REAL*8,
ALLOCATABLE :: batimetry_profile(:,:)
30 INTEGER :: n_batimetry_profile
36 INTEGER :: comp_interfaces
49 USE parameters, ONLY: eps_sing, batimetry_function_flag
53 INTEGER j !> loop counter
55 comp_interfaces = comp_cells+1
57 ALLOCATE( x_comp(comp_cells) )
58 ALLOCATE( x_stag(comp_interfaces) )
60 ALLOCATE( b_cent(comp_cells) )
61 ALLOCATE( b_prime(comp_cells) )
62 ALLOCATE( b_stag(comp_interfaces) )
64 dx = ( xn - x0 ) / comp_cells
68 WRITE(*,*)
'eps_sing = ',eps_sing
70 x_comp(1) = x0 + 0.5d0 * dx
74 IF(batimetry_function_flag.EQV..false.)
THEN
76 batimetry_profile(1,:) = x0 + ( xn - x0 ) * batimetry_profile(1,:)
81 IF(batimetry_function_flag.EQV..false.)
THEN
83 b_stag(1) = batimetry_profile(2,1)
87 x_stag(j+1) = x_stag(j) + dx
89 x_comp(j) = 0.5 * ( x_stag(j) + x_stag(j+1) )
92 x_stag(j+1) , b_stag(j+1) )
95 b_cent(j) = 0.5 * ( b_stag(j) + b_stag(j+1) )
97 b_prime(j) = ( b_stag(j+1) - b_stag(j) ) / ( x_stag(j+1) - x_stag(j) )
99 IF ( verbose_level .GE. 2 )
THEN
101 WRITE(*,*) batimetry_profile(1,:)
102 WRITE(*,*) batimetry_profile(2,:)
103 WRITE(*,*) x_stag(j+1) , b_stag(j+1) ,x_comp(j) , b_cent(j) , b_prime(j)
117 x_stag(j+1) = x_stag(j) + dx
119 x_comp(j) = 0.5 * ( x_stag(j) + x_stag(j+1) )
123 b_cent(j) = 0.5 * ( b_stag(j) + b_stag(j+1) )
125 b_prime(j) = ( b_stag(j+1) - b_stag(j) ) / ( x_stag(j+1) - x_stag(j) )
127 IF ( verbose_level .GE. 2 )
THEN
129 WRITE(*,*) batimetry_profile(1,:)
130 WRITE(*,*) batimetry_profile(2,:)
131 WRITE(*,*) x_stag(j+1) , b_stag(j+1) ,x_comp(j) , b_cent(j) , b_prime(j)
157 REAL*8,
INTENT(IN),
DIMENSION(:) :: x1, f1
158 REAL*8,
INTENT(IN) :: x2
159 REAL*8,
INTENT(OUT) :: f2
161 REAL*8 :: grad , rel_pos
171 search:
DO n = 1, n1x-1
173 rel_pos = ( x2 - x1(n) ) / ( x1(n+1) - x1(n) )
175 IF ( ( rel_pos .GE. 0.d0 ) .AND. ( rel_pos .LE. 1.d0 ) )
THEN
177 grad = ( f1(n+1)-f1(n) ) / ( x1(n+1)-x1(n) )
178 f2 = f1(n) + ( x2-x1(n) ) * grad
182 ELSEIF ( rel_pos .LT. 0.d0 )
THEN
209 REAL*8,
INTENT(IN) :: x
211 REAL*8,
PARAMETER :: pig = 4.0*atan(1.0)
212 REAL*8,
PARAMETER :: eps_dis = 10.0**(-8)
219 ELSEIF(x.GE.0.0.AND.x.LE.0.4)
THEN
223 ELSEIF(x.GT.0.4.AND.x.LE.0.5)
THEN
227 ELSEIF(x.GT.0.5.AND.x.LE.0.6)
THEN
231 ELSEIF(x.GT.0.6.AND.x.LT.1.0-eps_dis)
THEN
235 ELSEIF(x.GE.1.0-eps_dis.AND.x.LE.1.0+eps_dis)
THEN
239 ELSEIF(x.GT.1.0+eps_dis.AND.x.LE.1.5)
THEN
real *8 function batimetry_function(x)
Batimetry function.
subroutine interp_1d_scalar(x1, f1, x2, f2)
Scalar interpolation.
subroutine init_grid
Finite volume grid initialization.