My Project
Functions/Subroutines
depth_grad.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine depth_gradient
 

Function/Subroutine Documentation

◆ depth_gradient()

subroutine depth_gradient ( )

Definition at line 45 of file depth_grad.f90.

45 
46 !==============================================================================|
47  USE all_vars
48  USE mod_par
49 
50  IMPLICIT NONE
51  REAL(SP) :: PHPX,PHPY,F1
52  INTEGER :: I,J,I1,I2
53 !==============================================================================|
54 
55 !----------CALCULATE DERIVATIVES OF DEPTH WITH X AND Y AT NODES----------------!
56 
57  DO i=1,m
58  phpx = 0.0_sp ; phpy = 0.0_sp
59  DO j=1,ntsn(i)-1
60  i1 = nbsn(i,j)
61  i2 = nbsn(i,j+1)
62  f1 = 0.50_sp*(h(i1)+h(i2))
63  phpx = phpx + f1*(vy(i1)-vy(i2))
64  phpy = phpy + f1*(vx(i2)-vx(i1))
65  END DO
66  phpx = phpx/art2(i)
67  phpy = phpy/art2(i)
68 
69  IF(phpx==0.0_sp .AND. phpy ==0.0_sp)THEN
70  sita_gd(i) = 0.0_sp ; phpn(i) = 0.0_sp
71  ELSE
72  sita_gd(i) = atan2(phpy,phpx)
73  phpn(i) = sqrt(phpy*phpy+phpx*phpx)
74  END IF
75 
76  END DO
77 
78 
79  RETURN
integer, dimension(:), allocatable, target ntsn
Definition: mod_main.f90:1023
real(sp), dimension(:), allocatable, target h
Definition: mod_main.f90:1131
integer m
Definition: mod_main.f90:56
real(sp), dimension(:), allocatable, target art2
Definition: mod_main.f90:1011
real(sp), dimension(:), allocatable, target vx
Definition: mod_main.f90:1001
real(sp), dimension(:), allocatable, target phpn
Definition: mod_main.f90:1341
real(sp), dimension(:), allocatable, target vy
Definition: mod_main.f90:1002
real(sp), dimension(:), allocatable, target sita_gd
Definition: mod_main.f90:1344
integer, dimension(:,:), allocatable, target nbsn
Definition: mod_main.f90:1030
Here is the caller graph for this function: