1 |
dimitri |
1.13 |
C $Header: /u/gcmpack/MITgcm/pkg/kpp/kpp_transport_s.F,v 1.12 2007/05/03 21:33:42 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.12 |
O df, |
12 |
|
|
I myTime, myIter, myThid ) |
13 |
adcroft |
1.1 |
C /==========================================================\ |
14 |
|
|
C | o SUBROUTINE KPP_TRANSPORT_S | |
15 |
|
|
C | Add non local KPP transport term (ghat) to diffusive | |
16 |
|
|
C | salinity flux. | |
17 |
|
|
C |==========================================================| |
18 |
|
|
C | The nonlocal transport term is nonzero only for scalars | |
19 |
|
|
C | in unstable (convective) forcing conditions. | |
20 |
jmc |
1.11 |
C | Note: KPPdiffKzS(-,k) is defined at the top of grid cell | |
21 |
adcroft |
1.1 |
C | k while KPPghat(i,j,k,bi,bj) is defined at the | |
22 |
|
|
C | bottom of grid cell k. | |
23 |
jmc |
1.11 |
C | For K=1, KPPdiffKzS(-,k) = 0 which insures no flux | |
24 |
adcroft |
1.1 |
C | through the surface. | |
25 |
|
|
C \==========================================================/ |
26 |
|
|
IMPLICIT NONE |
27 |
|
|
|
28 |
|
|
C == GLobal variables == |
29 |
|
|
#include "SIZE.h" |
30 |
|
|
#include "EEPARAMS.h" |
31 |
|
|
#include "PARAMS.h" |
32 |
|
|
#include "GRID.h" |
33 |
|
|
#include "FFIELDS.h" |
34 |
|
|
#include "KPP.h" |
35 |
|
|
#include "KPP_PARAMS.h" |
36 |
jmc |
1.11 |
#ifdef ALLOW_GMREDI |
37 |
|
|
#include "GMREDI.h" |
38 |
|
|
#endif |
39 |
adcroft |
1.1 |
|
40 |
|
|
C == Routine arguments == |
41 |
|
|
C iMin,iMax,jMin, - Range of points for which calculation |
42 |
|
|
C jMax,bi,bj,k,km1 results will be set. |
43 |
|
|
C df - Diffusive flux component work array. |
44 |
jmc |
1.12 |
C myTime :: Current time in simulation |
45 |
|
|
C myIter :: Current iteration number in simulation |
46 |
|
|
C myThid :: My Thread Id. number |
47 |
adcroft |
1.1 |
INTEGER iMin,iMax,jMin,jMax,bi,bj,k,km1 |
48 |
|
|
_RL df (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
49 |
jmc |
1.12 |
_RL myTime |
50 |
|
|
INTEGER myIter |
51 |
|
|
INTEGER myThid |
52 |
adcroft |
1.1 |
|
53 |
heimbach |
1.2 |
#if defined(ALLOW_KPP) && defined(KPP_GHAT) |
54 |
adcroft |
1.1 |
|
55 |
|
|
C == Local variables == |
56 |
|
|
C I, J - Loop counters |
57 |
|
|
INTEGER I, J |
58 |
jmc |
1.11 |
_RL tmpFac |
59 |
adcroft |
1.1 |
|
60 |
jmc |
1.11 |
#ifdef ALLOW_GMREDI |
61 |
|
|
|
62 |
|
|
IF ( useGMRedi .AND. KPP_ghatUseTotalDiffus ) THEN |
63 |
|
|
tmpFac = 1. _d 0 |
64 |
|
|
ELSE |
65 |
|
|
tmpFac = 0. _d 0 |
66 |
|
|
ENDIF |
67 |
heimbach |
1.2 |
DO j=jMin,jMax |
68 |
|
|
DO i=iMin,iMax |
69 |
jmc |
1.11 |
df(i,j) = - _rA(i,j,bi,bj) |
70 |
|
|
& *( KPPdiffKzS(i,j,k,bi,bj) + tmpFac*Kwz(i,j,k,bi,bj) ) |
71 |
|
|
& *KPPghat(i,j,km1,bi,bj) |
72 |
dimitri |
1.13 |
& *( surfaceForcingS(i,j,bi,bj) |
73 |
|
|
#ifdef ALLOW_SALT_PLUME |
74 |
|
|
& + saltPlumeFlux(i,j,bi,bj)*recip_rhoConst |
75 |
|
|
& *(1.-KPPplumefrac(i,j,bi,bj)) |
76 |
|
|
#endif /* ALLOW_SALT_PLUME */ |
77 |
|
|
& ) |
78 |
adcroft |
1.1 |
ENDDO |
79 |
heimbach |
1.2 |
ENDDO |
80 |
adcroft |
1.1 |
|
81 |
jmc |
1.11 |
#else /* ALLOW_GMREDI */ |
82 |
|
|
|
83 |
|
|
DO j=jMin,jMax |
84 |
|
|
DO i=iMin,iMax |
85 |
|
|
df(i,j) = - _rA(i,j,bi,bj) |
86 |
|
|
& *KPPdiffKzS(i,j,k,bi,bj) |
87 |
|
|
& *KPPghat(i,j,km1,bi,bj) |
88 |
dimitri |
1.13 |
& *( surfaceForcingS(i,j,bi,bj) |
89 |
|
|
#ifdef ALLOW_SALT_PLUME |
90 |
|
|
& + saltPlumeFlux(i,j,bi,bj)*recip_rhoConst |
91 |
|
|
& *(1.-KPPplumefrac(i,j,bi,bj)) |
92 |
|
|
#endif /* ALLOW_SALT_PLUME */ |
93 |
|
|
& ) |
94 |
jmc |
1.11 |
ENDDO |
95 |
|
|
ENDDO |
96 |
|
|
|
97 |
|
|
#endif /* ALLOW_GMREDI */ |
98 |
|
|
|
99 |
|
|
|
100 |
heimbach |
1.2 |
#endif /* ALLOW_KPP and KPP_GHAT */ |
101 |
adcroft |
1.1 |
|
102 |
|
|
RETURN |
103 |
|
|
END |