2 |
C $Name$ |
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 KappaRS, |
O df, |
12 |
U df ) |
I myTime, myIter, myThid ) |
13 |
C /==========================================================\ |
C /==========================================================\ |
14 |
C | o SUBROUTINE KPP_TRANSPORT_S | |
C | o SUBROUTINE KPP_TRANSPORT_S | |
15 |
C | Add non local KPP transport term (ghat) to diffusive | |
C | Add non local KPP transport term (ghat) to diffusive | |
17 |
C |==========================================================| |
C |==========================================================| |
18 |
C | The nonlocal transport term is nonzero only for scalars | |
C | The nonlocal transport term is nonzero only for scalars | |
19 |
C | in unstable (convective) forcing conditions. | |
C | in unstable (convective) forcing conditions. | |
20 |
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 | |
21 |
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 | |
22 |
C | bottom of grid cell k. | |
C | bottom of grid cell k. | |
23 |
C | For K=1, KappaRS(i,j,k) = 0 which insures no flux | |
C | For K=1, KPPdiffKzS(-,k) = 0 which insures no flux | |
24 |
C | through the surface. | |
C | through the surface. | |
25 |
C \==========================================================/ |
C \==========================================================/ |
26 |
IMPLICIT NONE |
IMPLICIT NONE |
27 |
|
|
28 |
C == GLobal variables == |
C == GLobal variables == |
29 |
#include "SIZE.h" |
#include "SIZE.h" |
|
#include "DYNVARS.h" |
|
30 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
31 |
#include "PARAMS.h" |
#include "PARAMS.h" |
32 |
#include "GRID.h" |
#include "GRID.h" |
33 |
#include "FFIELDS.h" |
#include "FFIELDS.h" |
34 |
#include "KPP.h" |
#include "KPP.h" |
35 |
#include "KPP_PARAMS.h" |
#include "KPP_PARAMS.h" |
36 |
|
#ifdef ALLOW_GMREDI |
37 |
|
#include "GMREDI.h" |
38 |
|
#endif |
39 |
|
|
40 |
C == Routine arguments == |
C == Routine arguments == |
41 |
C iMin,iMax,jMin, - Range of points for which calculation |
C iMin,iMax,jMin, - Range of points for which calculation |
42 |
C jMax,bi,bj,k,km1 results will be set. |
C jMax,bi,bj,k,km1 results will be set. |
|
C KappaRS - Total diffusion in vertical for S. |
|
43 |
C df - Diffusive flux component work array. |
C df - Diffusive flux component work array. |
44 |
|
C myTime :: Current time in simulation |
45 |
|
C myIter :: Current iteration number in simulation |
46 |
|
C myThid :: My Thread Id. number |
47 |
INTEGER iMin,iMax,jMin,jMax,bi,bj,k,km1 |
INTEGER iMin,iMax,jMin,jMax,bi,bj,k,km1 |
|
_RL KappaRS(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
|
48 |
_RL df (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL df (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
49 |
|
_RL myTime |
50 |
|
INTEGER myIter |
51 |
|
INTEGER myThid |
52 |
|
|
53 |
#if defined(ALLOW_KPP) && defined(KPP_GHAT) |
#if defined(ALLOW_KPP) && defined(KPP_GHAT) |
54 |
|
|
55 |
C == Local variables == |
C == Local variables == |
56 |
C I, J - Loop counters |
C I, J - Loop counters |
57 |
INTEGER I, J |
INTEGER I, J |
58 |
|
_RL tmpFac |
59 |
|
|
60 |
|
#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 |
DO j=jMin,jMax |
DO j=jMin,jMax |
68 |
DO i=iMin,iMax |
DO i=iMin,iMax |
69 |
df(i,j) = df(i,j) - _rA(i,j,bi,bj) * |
df(i,j) = - _rA(i,j,bi,bj) |
70 |
& KappaRS(i,j,k) * KPPghat(i,j,km1,bi,bj) * drF(1) * |
& *( KPPdiffKzS(i,j,k,bi,bj) + tmpFac*Kwz(i,j,k,bi,bj) ) |
71 |
& SurfaceTendencyS(i,j,bi,bj) |
& *KPPghat(i,j,km1,bi,bj) |
72 |
|
& *surfaceForcingS(i,j,bi,bj) |
73 |
ENDDO |
ENDDO |
74 |
ENDDO |
ENDDO |
75 |
|
|
76 |
|
#else /* ALLOW_GMREDI */ |
77 |
|
|
78 |
|
DO j=jMin,jMax |
79 |
|
DO i=iMin,iMax |
80 |
|
df(i,j) = - _rA(i,j,bi,bj) |
81 |
|
& *KPPdiffKzS(i,j,k,bi,bj) |
82 |
|
& *KPPghat(i,j,km1,bi,bj) |
83 |
|
& *surfaceForcingS(i,j,bi,bj) |
84 |
|
ENDDO |
85 |
|
ENDDO |
86 |
|
|
87 |
|
#endif /* ALLOW_GMREDI */ |
88 |
|
|
89 |
|
|
90 |
#endif /* ALLOW_KPP and KPP_GHAT */ |
#endif /* ALLOW_KPP and KPP_GHAT */ |
91 |
|
|
92 |
RETURN |
RETURN |