24 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
25 |
#include "PARAMS.h" |
#include "PARAMS.h" |
26 |
#include "GRID.h" |
#include "GRID.h" |
|
#include "SURFACE.h" |
|
27 |
#include "DYNVARS.h" |
#include "DYNVARS.h" |
28 |
#ifdef ALLOW_GMREDI |
#ifdef ALLOW_GMREDI |
29 |
# include "GMREDI.h" |
# include "GMREDI.h" |
56 |
INTEGER i,j,k |
INTEGER i,j,k |
57 |
LOGICAL calcMixLayerDepth |
LOGICAL calcMixLayerDepth |
58 |
INTEGER method |
INTEGER method |
59 |
_RL dRhoSmall, rhoBigNb |
_RL rhoBigNb |
60 |
_RL rhoMxL(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL rhoMxL(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
61 |
_RL rhoKm1(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL rhoKm1(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
62 |
_RL rhoLoc(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL rhoLoc(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
65 |
|
|
66 |
calcMixLayerDepth = .FALSE. |
calcMixLayerDepth = .FALSE. |
67 |
#ifdef ALLOW_GMREDI |
#ifdef ALLOW_GMREDI |
68 |
IF ( useGMRedi ) calcMixLayerDepth = GM_taper_scheme.EQ.'fm07' |
IF ( useGMRedi ) THEN |
69 |
|
IF ( .NOT.useKPP ) calcMixLayerDepth = GM_taper_scheme.EQ.'fm07' |
70 |
|
ENDIF |
71 |
#endif |
#endif |
72 |
#ifdef ALLOW_DIAGNOSTICS |
#ifdef ALLOW_DIAGNOSTICS |
73 |
IF ( useDiagnostics.AND. .NOT.calcMixLayerDepth ) THEN |
IF ( useDiagnostics.AND. .NOT.calcMixLayerDepth ) THEN |
89 |
C = density of water which is -hMixCriteria colder than surface water |
C = density of water which is -hMixCriteria colder than surface water |
90 |
|
|
91 |
c hMixCriteria = -0.8 _d 0 |
c hMixCriteria = -0.8 _d 0 |
92 |
dRhoSmall = 1. _d -6 |
c dRhoSmall = 1. _d -6 |
93 |
rhoBigNb = rhoConst*1. _d 10 |
rhoBigNb = rhoConst*1. _d 10 |
94 |
CALL FIND_ALPHA( |
CALL FIND_ALPHA( |
95 |
I bi, bj, 1-OLx, sNx+OLx, 1-OLy, sNy+OLy, 1, 1, |
I bi, bj, 1-OLx, sNx+OLx, 1-OLy, sNy+OLy, 1, 1, |
100 |
rhoKm1(i,j) = rhoSurf(i,j) |
rhoKm1(i,j) = rhoSurf(i,j) |
101 |
rhoMxL(i,j) = rhoSurf(i,j) |
rhoMxL(i,j) = rhoSurf(i,j) |
102 |
& + MAX( rhoMxL(i,j)*hMixCriteria, dRhoSmall ) |
& + MAX( rhoMxL(i,j)*hMixCriteria, dRhoSmall ) |
103 |
hMixLayer(i,j,bi,bj) = rF(1)-R_low(I,J,bi,bj) |
hMixLayer(i,j,bi,bj) = rF(1)-R_low(i,j,bi,bj) |
104 |
ENDDO |
ENDDO |
105 |
ENDDO |
ENDDO |
106 |
DO k = 2,Nr |
DO k = 2,Nr |
107 |
C- potential density (reference level = surface level) |
C- potential density (reference level = surface level) |
108 |
CALL FIND_RHO( |
CALL FIND_RHO_2D( |
109 |
I bi, bj, 1-OLx, sNx+OLx, 1-OLy, sNy+OLy, K, 1, |
I 1-OLx, sNx+OLx, 1-OLy, sNy+OLy, 1, |
110 |
I theta, salt, |
I theta(1-OLx,1-OLy,k,bi,bj), salt(1-OLx,1-OLy,k,bi,bj), |
111 |
O rhoLoc, myThid ) |
O rhoLoc, |
112 |
|
I k, bi, bj, myThid ) |
113 |
|
|
114 |
DO j=1-Oly,sNy+Oly |
DO j=1-Oly,sNy+Oly |
115 |
DO i=1-Olx,sNx+Olx |
DO i=1-Olx,sNx+Olx |
136 |
C where the local stratification exceed the mean stratification above |
C where the local stratification exceed the mean stratification above |
137 |
C (from surface down to here) by factor hMixCriteria |
C (from surface down to here) by factor hMixCriteria |
138 |
|
|
139 |
c hMixCriteria = 2. _d 0 |
c hMixCriteria = 1.5 _d 0 |
140 |
C-Note: dRhoSmall is hard coded for now but should become run-time parameter |
c dRhoSmall = 1. _d -2 |
|
dRhoSmall = 1. _d -2 |
|
141 |
DO j=1-Oly,sNy+Oly |
DO j=1-Oly,sNy+Oly |
142 |
DO i=1-Olx,sNx+Olx |
DO i=1-Olx,sNx+Olx |
143 |
IF ( klowC(i,j,bi,bj) .GT. 0 ) THEN |
IF ( klowC(i,j,bi,bj) .GT. 0 ) THEN |
151 |
ENDDO |
ENDDO |
152 |
DO k = 2,Nr-1 |
DO k = 2,Nr-1 |
153 |
C- potential density (reference level = surface level) |
C- potential density (reference level = surface level) |
154 |
CALL FIND_RHO( |
CALL FIND_RHO_2D( |
155 |
I bi, bj, 1-OLx, sNx+OLx, 1-OLy, sNy+OLy, K, 1, |
I 1-OLx, sNx+OLx, 1-OLy, sNy+OLy, 1, |
156 |
I theta, salt, |
I theta(1-OLx,1-OLy,k,bi,bj), salt(1-OLx,1-OLy,k,bi,bj), |
157 |
O rhoLoc, myThid ) |
O rhoLoc, |
158 |
|
I k, bi, bj, myThid ) |
159 |
|
|
160 |
DO j=1-Oly,sNy+Oly |
DO j=1-Oly,sNy+Oly |
161 |
DO i=1-Olx,sNx+Olx |
DO i=1-Olx,sNx+Olx |