My Project
Functions/Subroutines
viscofh.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine viscof_h
 

Function/Subroutine Documentation

◆ viscof_h()

subroutine viscof_h ( )

Definition at line 45 of file viscofh.f90.

45 
46 !------------------------------------------------------------------------------|
47  USE mod_utils
48  USE all_vars
49 
50  IMPLICIT NONE
51  REAL(SP) :: PUPX,PUPY,PVPX,PVPY
52  REAL(SP) :: tmp1,tmp2
53  INTEGER :: I,I1,K,J
54 
55 
56  IF(dbg_set(dbg_sbr)) WRITE(ipt,*) "Start: viscofh"
57 
58  SELECT CASE(horizontal_mixing_type)
59  CASE ('closure')
60  ! Run Subroutine
61  CASE('constant')
62  IF(dbg_set(dbg_sbr)) WRITE(ipt,*) "End: viscofh (constant)"
63  CASE DEFAULT
64  CALL fatal_error("UNKNOW HORIZONTAL MIXING TYPE:",&
65  & trim(horizontal_mixing_type) )
66  END SELECT
67 
68 
69  DO k=1,kbm1
70  DO i=1,m
71  pupx=0.0_sp
72  pupy=0.0_sp
73  pvpx=0.0_sp
74  pvpy=0.0_sp
75 
76  j=1
77  i1=nbve(i,j)
78 
79 
80  pupx=pupx+u(i1,k)*dltyecec(i,j)
81  pupy=pupy+u(i1,k)*dltxecec(i,j)
82  pvpx=pvpx+v(i1,k)*dltyecec(i,j)
83  pvpy=pvpy+v(i1,k)*dltxecec(i,j)
84 
85 
86  IF(isonb(i) /= 0) THEN
87 
88  pupx=pupx+u(i1,k)*dltynec(i,j)
89  pupy=pupy+u(i1,k)*dltxnec(i,j)
90  pvpx=pvpx+v(i1,k)*dltynec(i,j)
91  pvpy=pvpy+v(i1,k)*dltxnec(i,j)
92 
93  END IF
94 
95  DO j=2,ntve(i)-1
96  i1=nbve(i,j)
97 
98  pupx=pupx+u(i1,k)*dltyecec(i,j)
99  pupy=pupy+u(i1,k)*dltxecec(i,j)
100  pvpx=pvpx+v(i1,k)*dltyecec(i,j)
101  pvpy=pvpy+v(i1,k)*dltxecec(i,j)
102 
103  END DO
104 
105  j=ntve(i)
106  i1=nbve(i,j)
107 
108 
109  pupx=pupx+u(i1,k)*dltyecec(i,j)
110  pupy=pupy+u(i1,k)*dltxecec(i,j)
111  pvpx=pvpx+v(i1,k)*dltyecec(i,j)
112  pvpy=pvpy+v(i1,k)*dltxecec(i,j)
113 
114 
115  IF(isonb(i) /= 0) THEN
116 
117  pupx=pupx+u(i1,k)*(-dltynec(i,j))
118  pupy=pupy+u(i1,k)*(-dltxnec(i,j))
119  pvpx=pvpx+v(i1,k)*(-dltynec(i,j))
120  pvpy=pvpy+v(i1,k)*(-dltxnec(i,j))
121 
122  END IF
123 
124  pupx=pupx/art1(i)
125  pupy=pupy/art1(i)
126  pvpx=pvpx/art1(i)
127  pvpy=pvpy/art1(i)
128  tmp1=pupx**2+pvpy**2
129  tmp2=0.5_sp*(pupy+pvpx)**2
130  viscofh(i,k)=sqrt(tmp1+tmp2)*art1(i)
131 
132  END DO
133  END DO
134 
135 
136  IF(dbg_set(dbg_sbr)) WRITE(ipt,*) "End: viscofh"
137 
real(sp), dimension(:,:), allocatable, target viscofh
Definition: mod_main.f90:1359
real(sp), dimension(:,:), allocatable, target v
Definition: mod_main.f90:1269
logical function dbg_set(vrb)
Definition: mod_utils.f90:182
real(sp), dimension(:,:), allocatable, target dltxnec
Definition: mod_main.f90:1069
real(sp), dimension(:), allocatable, target art1
Definition: mod_main.f90:1010
integer m
Definition: mod_main.f90:56
real(sp), dimension(:,:), allocatable, target u
Definition: mod_main.f90:1268
integer, dimension(:), allocatable, target ntve
Definition: mod_main.f90:1022
real(sp), dimension(:,:), allocatable, target dltyecec
Definition: mod_main.f90:1067
real(sp), dimension(:,:), allocatable, target dltynec
Definition: mod_main.f90:1070
integer, dimension(:,:), allocatable, target nbve
Definition: mod_main.f90:1034
subroutine fatal_error(ER1, ER2, ER3, ER4)
Definition: mod_utils.f90:230
real(sp), dimension(:,:), allocatable, target dltxecec
Definition: mod_main.f90:1066
character(len=80) horizontal_mixing_type
Definition: mod_main.f90:351
integer ipt
Definition: mod_main.f90:922
integer, parameter dbg_sbr
Definition: mod_utils.f90:69
integer kbm1
Definition: mod_main.f90:65
integer, dimension(:), allocatable, target isonb
Definition: mod_main.f90:1024
Here is the call graph for this function:
Here is the caller graph for this function: