My Project
Functions/Subroutines
conv_over.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine conv_over
 

Function/Subroutine Documentation

◆ conv_over()

subroutine conv_over ( )

Definition at line 45 of file conv_over.f90.

45 
46 !==============================================================================|
47  USE all_vars
48  USE mod_utils
49  IMPLICIT NONE
50  REAL(SP):: AVE_T,AVE_S,AVE_R
51  INTEGER :: I,K,KK,J1,J2,J3
52 !==============================================================================|
53 
54  IF (dbg_set(dbg_sbr)) WRITE(ipt,*) "Start: conv_over"
55 
56 
57 !--APPROXIMATE CONVECTIVE OVERTURNING------------------------------------------!
58 
59  DO i=1,m
60  DO k=kbm1,2,-1
61  DO kk=k-1,1,-1
62  IF(rho1(i,k) < rho1(i,kk)) THEN
63  ave_t = sum( t1(i,kk:k))/float(k-kk+1)
64  ave_s = sum( s1(i,kk:k))/float(k-kk+1)
65  ave_r = sum(rho1(i,kk:k))/float(k-kk+1)
66  t1(i,kk:k) = ave_t
67  s1(i,kk:k) = ave_s
68  rho1(i,kk:k) = ave_r
69  END IF
70  END DO
71  END DO
72  END DO
73 
74 !-----RECALCULATE ELEMENT-BASED VALUES OF SALINITY/TEMP/DENSITY----------------!
75 
76  DO i=1,n
77  j1=nv(i,1) ; j2 = nv(i,2) ; j3 = nv(i,3)
78  DO k=1,kbm1
79  t(i,k) = one_third*( t1(j1,k)+ t1(j2,k)+ t1(j3,k))
80  s(i,k) = one_third*( s1(j1,k)+ s1(j2,k)+ s1(j3,k))
81  END DO
82  END DO
83 
84  IF (dbg_set(dbg_sbr)) WRITE(ipt,*) "End: conv_over"
85 
86  RETURN
real(sp), dimension(:,:), allocatable, target s
Definition: mod_main.f90:1288
logical function dbg_set(vrb)
Definition: mod_utils.f90:182
real(sp), dimension(:,:), allocatable, target rho1
Definition: mod_main.f90:1309
real(sp), dimension(:,:), allocatable, target t1
Definition: mod_main.f90:1307
integer m
Definition: mod_main.f90:56
real(sp), dimension(:,:), allocatable, target s1
Definition: mod_main.f90:1308
integer n
Definition: mod_main.f90:55
integer, dimension(:,:), allocatable, target nv
Definition: mod_main.f90:1018
real(dp), parameter one_third
Definition: mod_main.f90:883
real(sp), dimension(:,:), allocatable, target t
Definition: mod_main.f90:1286
integer ipt
Definition: mod_main.f90:922
integer, parameter dbg_sbr
Definition: mod_utils.f90:69
integer kbm1
Definition: mod_main.f90:65
Here is the call graph for this function:
Here is the caller graph for this function: