1 |
C $Header$ |
C $Header$ |
2 |
|
C $Name$ |
3 |
|
|
4 |
#include "KPP_OPTIONS.h" |
#include "KPP_OPTIONS.h" |
5 |
|
#ifdef ALLOW_GMREDI |
6 |
|
#include "GMREDI_OPTIONS.h" |
7 |
|
#endif |
8 |
|
|
9 |
subroutine KPP_TRANSPORT_S ( |
subroutine KPP_TRANSPORT_S ( |
10 |
I iMin,iMax,jMin,jMax,bi,bj,k,km1, |
I iMin,iMax,jMin,jMax,bi,bj,k,km1, |
11 |
I maskC,KappaRS, |
O df ) |
|
U df ) |
|
12 |
C /==========================================================\ |
C /==========================================================\ |
13 |
C | o SUBROUTINE KPP_TRANSPORT_S | |
C | o SUBROUTINE KPP_TRANSPORT_S | |
14 |
C | Add non local KPP transport term (ghat) to diffusive | |
C | Add non local KPP transport term (ghat) to diffusive | |
16 |
C |==========================================================| |
C |==========================================================| |
17 |
C | The nonlocal transport term is nonzero only for scalars | |
C | The nonlocal transport term is nonzero only for scalars | |
18 |
C | in unstable (convective) forcing conditions. | |
C | in unstable (convective) forcing conditions. | |
19 |
C | Note: KappaRS(i,j,k) is defined at the top of grid cell | |
C | Note: KPPdiffKzS(-,k) is defined at the top of grid cell | |
20 |
C | k while KPPghat(i,j,k,bi,bj) is defined at the | |
C | k while KPPghat(i,j,k,bi,bj) is defined at the | |
21 |
C | bottom of grid cell k. | |
C | bottom of grid cell k. | |
22 |
C | For K=1, KappaRS(i,j,k) = 0 which insures no flux | |
C | For K=1, KPPdiffKzS(-,k) = 0 which insures no flux | |
23 |
C | through the surface. | |
C | through the surface. | |
24 |
C \==========================================================/ |
C \==========================================================/ |
25 |
IMPLICIT NONE |
IMPLICIT NONE |
26 |
|
|
27 |
C == GLobal variables == |
C == GLobal variables == |
28 |
#include "SIZE.h" |
#include "SIZE.h" |
|
#include "DYNVARS.h" |
|
29 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
30 |
#include "PARAMS.h" |
#include "PARAMS.h" |
31 |
#include "GRID.h" |
#include "GRID.h" |
32 |
#include "FFIELDS.h" |
#include "FFIELDS.h" |
33 |
#include "KPP.h" |
#include "KPP.h" |
34 |
#include "KPP_PARAMS.h" |
#include "KPP_PARAMS.h" |
35 |
|
#ifdef ALLOW_GMREDI |
36 |
|
#include "GMREDI.h" |
37 |
|
#endif |
38 |
|
|
39 |
C == Routine arguments == |
C == Routine arguments == |
40 |
C iMin,iMax,jMin, - Range of points for which calculation |
C iMin,iMax,jMin, - Range of points for which calculation |
41 |
C jMax,bi,bj,k,km1 results will be set. |
C jMax,bi,bj,k,km1 results will be set. |
|
C maskC - Land mask for salt cells. |
|
|
C KappaRS - Total diffusion in vertical for S. |
|
42 |
C df - Diffusive flux component work array. |
C df - Diffusive flux component work array. |
43 |
INTEGER iMin,iMax,jMin,jMax,bi,bj,k,km1 |
INTEGER iMin,iMax,jMin,jMax,bi,bj,k,km1 |
|
_RS maskC (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
|
|
_RL KappaRS(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
|
44 |
_RL df (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL df (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
45 |
|
|
46 |
#if defined(ALLOW_KPP) && defined(KPP_GHAT) |
#if defined(ALLOW_KPP) && defined(KPP_GHAT) |
48 |
C == Local variables == |
C == Local variables == |
49 |
C I, J - Loop counters |
C I, J - Loop counters |
50 |
INTEGER I, J |
INTEGER I, J |
51 |
|
_RL tmpFac |
52 |
|
|
53 |
|
#ifdef ALLOW_GMREDI |
54 |
|
|
55 |
|
IF ( useGMRedi .AND. KPP_ghatUseTotalDiffus ) THEN |
56 |
|
tmpFac = 1. _d 0 |
57 |
|
ELSE |
58 |
|
tmpFac = 0. _d 0 |
59 |
|
ENDIF |
60 |
DO j=jMin,jMax |
DO j=jMin,jMax |
61 |
DO i=iMin,iMax |
DO i=iMin,iMax |
62 |
df(i,j) = df(i,j) - _rA(i,j,bi,bj) * maskC(i,j) * |
df(i,j) = - _rA(i,j,bi,bj) |
63 |
& KappaRS(i,j,k) * KPPghat(i,j,km1,bi,bj) * delZ(1) * |
& *( KPPdiffKzS(i,j,k,bi,bj) + tmpFac*Kwz(i,j,k,bi,bj) ) |
64 |
& SurfaceTendencyS(i,j,bi,bj) |
& *KPPghat(i,j,km1,bi,bj) |
65 |
|
& *surfaceForcingS(i,j,bi,bj) |
66 |
ENDDO |
ENDDO |
67 |
ENDDO |
ENDDO |
68 |
|
|
69 |
|
#else /* ALLOW_GMREDI */ |
70 |
|
|
71 |
|
DO j=jMin,jMax |
72 |
|
DO i=iMin,iMax |
73 |
|
df(i,j) = - _rA(i,j,bi,bj) |
74 |
|
& *KPPdiffKzS(i,j,k,bi,bj) |
75 |
|
& *KPPghat(i,j,km1,bi,bj) |
76 |
|
& *surfaceForcingS(i,j,bi,bj) |
77 |
|
ENDDO |
78 |
|
ENDDO |
79 |
|
|
80 |
|
#endif /* ALLOW_GMREDI */ |
81 |
|
|
82 |
|
|
83 |
#endif /* ALLOW_KPP and KPP_GHAT */ |
#endif /* ALLOW_KPP and KPP_GHAT */ |
84 |
|
|
85 |
RETURN |
RETURN |