32 REAL*8,
ALLOCATABLE ::
b_ver(:,:)
136 IF ( verbose_level .GE. 1 )
WRITE(*,*)
'eps_sing = ',
eps_sing 252 IF ( verbose_level .GE. 2 )
THEN 381 REAL*8,
INTENT(IN),
DIMENSION(:) :: x1, f1
382 REAL*8,
INTENT(IN) :: x2
383 REAL*8,
INTENT(OUT) :: f2
385 REAL*8 :: grad , rel_pos
395 search:
DO n = 1, n1x-1
397 rel_pos = ( x2 - x1(n) ) / ( x1(n+1) - x1(n) )
399 IF ( ( rel_pos .GE. 0.d0 ) .AND. ( rel_pos .LE. 1.d0 ) )
THEN 401 grad = ( f1(n+1)-f1(n) ) / ( x1(n+1)-x1(n) )
402 f2 = f1(n) + ( x2-x1(n) ) * grad
406 ELSEIF ( rel_pos .LT. 0.d0 )
THEN 439 REAL*8,
INTENT(IN),
DIMENSION(:,:) :: x1, y1, f1
440 REAL*8,
INTENT(IN) :: x2, y2
441 REAL*8,
INTENT(OUT) :: f2
444 REAL*8 :: alfa_x , alfa_y
446 IF (
size(x1,1) .GT. 1 )
THEN 448 ix = floor( ( x2 - x1(1,1) ) / ( x1(2,1) - x1(1,1) ) ) + 1
449 ix = min( ix ,
SIZE(x1,1)-1 )
450 alfa_x = ( x1(ix+1,1) - x2 ) / ( x1(ix+1,1) - x1(ix,1) )
459 IF (
size(x1,2) .GT. 1 )
THEN 461 iy = floor( ( y2 - y1(1,1) ) / ( y1(1,2) - y1(1,1) ) ) + 1
462 iy = min( iy ,
SIZE(x1,2)-1 )
463 alfa_y = ( y1(1,iy+1) - y2 ) / ( y1(1,iy+1) - y1(1,iy) )
472 IF (
size(x1,1) .EQ. 1 )
THEN 474 f2 = alfa_y * f1(ix,iy) + ( 1.d0 - alfa_y ) * f1(ix,iy+1)
476 ELSEIF (
size(x1,2) .EQ. 1 )
THEN 478 f2 = alfa_x * f1(ix,iy) + ( 1.d0 - alfa_x ) * f1(ix+1,iy)
482 f2 = alfa_x * ( alfa_y * f1(ix,iy) + ( 1.d0 - alfa_y ) * f1(ix,iy+1) ) &
483 + ( 1.d0 - alfa_x ) * ( alfa_y * f1(ix+1,iy) + ( 1.d0 - alfa_y ) &
509 REAL*8,
INTENT(IN),
DIMENSION(:) :: x1, y1
510 REAL*8,
INTENT(IN),
DIMENSION(:,:) :: f1
511 REAL*8,
INTENT(IN) :: x2, y2
512 REAL*8,
INTENT(OUT) :: f2
515 REAL*8 :: alfa_x , alfa_y
517 IF (
size(x1) .GT. 1 )
THEN 519 ix = floor( ( x2 - x1(1) ) / ( x1(2) - x1(1) ) ) + 1
520 ix = min( ix ,
SIZE(x1)-1 )
521 alfa_x = ( x1(ix+1) - x2 ) / ( x1(ix+1) - x1(ix) )
530 IF (
size(y1) .GT. 1 )
THEN 532 iy = floor( ( y2 - y1(1) ) / ( y1(2) - y1(1) ) ) + 1
533 iy = min( iy ,
SIZE(x1)-1 )
534 alfa_y = ( y1(iy+1) - y2 ) / ( y1(iy+1) - y1(iy) )
543 IF (
size(x1) .EQ. 1 )
THEN 545 f2 = alfa_y * f1(ix,iy) + ( 1.d0 - alfa_y ) * f1(ix,iy+1)
547 ELSEIF (
size(y1) .EQ. 1 )
THEN 549 f2 = alfa_x * f1(ix,iy) + ( 1.d0 - alfa_x ) * f1(ix+1,iy)
553 f2 = alfa_x * ( alfa_y * f1(ix,iy) + ( 1.d0 - alfa_y ) * f1(ix,iy+1) ) &
554 + ( 1.d0 - alfa_x ) * ( alfa_y * f1(ix+1,iy) + ( 1.d0 - alfa_y ) &
574 REAL*8,
INTENT(IN) :: x,y
576 REAL*8,
PARAMETER :: pig = 4.0*atan(1.0)
577 REAL*8,
PARAMETER :: eps_dis = 1.d-8
617 IF(abs(y).LE.0.5.AND.x.LE.(y-1.0)/2.0)
THEN 621 ELSEIF(abs(y).GT.0.5.AND.x.LE.(y-1.0)/2.0)
THEN 623 a=y**2+0.1*sin(pig*x)
627 a=max(0.125,y**2+0.1*sin(pig*x))
632 & 1.0/8.0*exp(-30.0*(x+0.1)**2-90.0*(y+0.2)**2) + a
real *8, dimension(:,:), allocatable b_prime_x
Topography slope (x direction) at the centers of the control volumes.
logical topography_demfile
Flag for uploading topography from a different file (topography_dem.asc)
real *8 dy
Control volumes size.
real *8, dimension(:), allocatable x_comp
Location of the centers (x) of the control volume of the domain.
real *8 y0
Bottom of the physical domain.
real *8, dimension(:,:), allocatable b_cent
Topography at the centers of the control volumes.
integer comp_cells_x
Number of control volumes x in the comp. domain.
real *8, dimension(:,:), allocatable grav_surf
gravity vector wrt surface coordinates for each cell
real *8, dimension(:), allocatable y_comp
Location of the centers (y) of the control volume of the domain.
integer n_topography_profile_y
real *8 dx
Control volumes size.
integer comp_cells_y
Number of control volumes y in the comp. domain.
real *8, dimension(:,:), allocatable curv_xy
curvature wrt mixed directions for each cell
integer n_topography_profile_x
integer comp_interfaces_y
Number of interfaces (comp_cells_y+1)
real *8 xn
Right of the physical domain.
subroutine init_grid
Finite volume grid initialization.
real *8 yn
Top of the physical domain.
real *8 x0
Left of the physical domain.
real *8, dimension(:,:), allocatable b_ver
Topography at the vertices of the control volumes.
real *8, dimension(:,:), allocatable grid_output
Solution in ascii grid format (ESRI)
real *8, dimension(:,:), allocatable b_stag_x
Topography at the boundaries (x) of the control volumes.
real *8 function topography_function(x, y)
Topography function.
real *8, dimension(:,:,:), allocatable topography_profile
real *8, dimension(:,:), allocatable b_prime_y
Topography slope (y direction) at the centers of the control volumes.
real *8, dimension(:,:), allocatable b_stag_y
Topography at the boundaries (y) of the control volumes.
real *8, dimension(:), allocatable x_stag
Location of the boundaries (x) of the control volumes of the domain.
subroutine interp_2d_scalarb(x1, y1, f1, x2, y2, f2)
Scalar interpolation (2D)
subroutine interp_2d_scalar(x1, y1, f1, x2, y2, f2)
Scalar interpolation (2D)
real *8 dx2
Half x Control volumes size.
integer comp_interfaces_x
Number of interfaces (comp_cells_x+1)
real *8 eps_sing
parameter for desingularization
real *8, dimension(:), allocatable y_stag
Location of the boundaries (x) of the control volumes of the domain.
subroutine interp_1d_scalar(x1, f1, x2, f2)
Scalar interpolation.
real *8 dy2
Half y Control volumes size.