1 |
jmc |
1.11 |
C $Header: /u/gcmpack/MITgcm/pkg/kpp/kpp_transport_s.F,v 1.10 2004/07/18 01:19:36 jmc Exp $ |
2 |
adcroft |
1.7 |
C $Name: $ |
3 |
adcroft |
1.1 |
|
4 |
|
|
#include "KPP_OPTIONS.h" |
5 |
jmc |
1.11 |
#ifdef ALLOW_GMREDI |
6 |
|
|
#include "GMREDI_OPTIONS.h" |
7 |
|
|
#endif |
8 |
adcroft |
1.1 |
|
9 |
|
|
subroutine KPP_TRANSPORT_S ( |
10 |
|
|
I iMin,iMax,jMin,jMax,bi,bj,k,km1, |
11 |
jmc |
1.11 |
O df ) |
12 |
adcroft |
1.1 |
C /==========================================================\ |
13 |
|
|
C | o SUBROUTINE KPP_TRANSPORT_S | |
14 |
|
|
C | Add non local KPP transport term (ghat) to diffusive | |
15 |
|
|
C | salinity flux. | |
16 |
|
|
C |==========================================================| |
17 |
|
|
C | The nonlocal transport term is nonzero only for scalars | |
18 |
|
|
C | in unstable (convective) forcing conditions. | |
19 |
jmc |
1.11 |
C | Note: KPPdiffKzS(-,k) is defined at the top of grid cell | |
20 |
adcroft |
1.1 |
C | k while KPPghat(i,j,k,bi,bj) is defined at the | |
21 |
|
|
C | bottom of grid cell k. | |
22 |
jmc |
1.11 |
C | For K=1, KPPdiffKzS(-,k) = 0 which insures no flux | |
23 |
adcroft |
1.1 |
C | through the surface. | |
24 |
|
|
C \==========================================================/ |
25 |
|
|
IMPLICIT NONE |
26 |
|
|
|
27 |
|
|
C == GLobal variables == |
28 |
|
|
#include "SIZE.h" |
29 |
|
|
#include "EEPARAMS.h" |
30 |
|
|
#include "PARAMS.h" |
31 |
|
|
#include "GRID.h" |
32 |
|
|
#include "FFIELDS.h" |
33 |
|
|
#include "KPP.h" |
34 |
|
|
#include "KPP_PARAMS.h" |
35 |
jmc |
1.11 |
#ifdef ALLOW_GMREDI |
36 |
|
|
#include "GMREDI.h" |
37 |
|
|
#endif |
38 |
adcroft |
1.1 |
|
39 |
|
|
C == Routine arguments == |
40 |
|
|
C iMin,iMax,jMin, - Range of points for which calculation |
41 |
|
|
C jMax,bi,bj,k,km1 results will be set. |
42 |
|
|
C df - Diffusive flux component work array. |
43 |
|
|
INTEGER iMin,iMax,jMin,jMax,bi,bj,k,km1 |
44 |
|
|
_RL df (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
45 |
|
|
|
46 |
heimbach |
1.2 |
#if defined(ALLOW_KPP) && defined(KPP_GHAT) |
47 |
adcroft |
1.1 |
|
48 |
|
|
C == Local variables == |
49 |
|
|
C I, J - Loop counters |
50 |
|
|
INTEGER I, J |
51 |
jmc |
1.11 |
_RL tmpFac |
52 |
adcroft |
1.1 |
|
53 |
jmc |
1.11 |
#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 |
heimbach |
1.2 |
DO j=jMin,jMax |
61 |
|
|
DO i=iMin,iMax |
62 |
jmc |
1.11 |
df(i,j) = - _rA(i,j,bi,bj) |
63 |
|
|
& *( KPPdiffKzS(i,j,k,bi,bj) + tmpFac*Kwz(i,j,k,bi,bj) ) |
64 |
|
|
& *KPPghat(i,j,km1,bi,bj) |
65 |
|
|
& *surfaceForcingS(i,j,bi,bj) |
66 |
adcroft |
1.1 |
ENDDO |
67 |
heimbach |
1.2 |
ENDDO |
68 |
adcroft |
1.1 |
|
69 |
jmc |
1.11 |
#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 |
heimbach |
1.2 |
#endif /* ALLOW_KPP and KPP_GHAT */ |
84 |
adcroft |
1.1 |
|
85 |
|
|
RETURN |
86 |
|
|
END |