/[MITgcm]/MITgcm/pkg/kpp/kpp_transport_s.F
ViewVC logotype

Contents of /MITgcm/pkg/kpp/kpp_transport_s.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.14 - (show annotations) (download)
Tue Dec 18 09:05:59 2007 UTC (16 years, 6 months ago) by dimitri
Branch: MAIN
Changes since 1.13: +5 -2 lines
making pkg/kpp ALLOW_SALT_PLUME code compatible with pkg/plume

1 C $Header: /u/gcmpack/MITgcm/pkg/kpp/kpp_transport_s.F,v 1.13 2007/09/22 17:55:32 dimitri Exp $
2 C $Name: $
3
4 #include "KPP_OPTIONS.h"
5 #ifdef ALLOW_GMREDI
6 #include "GMREDI_OPTIONS.h"
7 #endif
8
9 subroutine KPP_TRANSPORT_S (
10 I iMin,iMax,jMin,jMax,bi,bj,k,km1,
11 O df,
12 I myTime, myIter, myThid )
13 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 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 |
22 C | bottom of grid cell k. |
23 C | For K=1, KPPdiffKzS(-,k) = 0 which insures no flux |
24 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 #ifdef ALLOW_GMREDI
37 # include "GMREDI.h"
38 #endif
39 #ifdef ALLOW_SALT_PLUME
40 # include "SALT_PLUME.h"
41 #endif
42
43 C == Routine arguments ==
44 C iMin,iMax,jMin, - Range of points for which calculation
45 C jMax,bi,bj,k,km1 results will be set.
46 C df - Diffusive flux component work array.
47 C myTime :: Current time in simulation
48 C myIter :: Current iteration number in simulation
49 C myThid :: My Thread Id. number
50 INTEGER iMin,iMax,jMin,jMax,bi,bj,k,km1
51 _RL df (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
52 _RL myTime
53 INTEGER myIter
54 INTEGER myThid
55
56 #if defined(ALLOW_KPP) && defined(KPP_GHAT)
57
58 C == Local variables ==
59 C I, J - Loop counters
60 INTEGER I, J
61 _RL tmpFac
62
63 #ifdef ALLOW_GMREDI
64
65 IF ( useGMRedi .AND. KPP_ghatUseTotalDiffus ) THEN
66 tmpFac = 1. _d 0
67 ELSE
68 tmpFac = 0. _d 0
69 ENDIF
70 DO j=jMin,jMax
71 DO i=iMin,iMax
72 df(i,j) = - _rA(i,j,bi,bj)
73 & *( KPPdiffKzS(i,j,k,bi,bj) + tmpFac*Kwz(i,j,k,bi,bj) )
74 & *KPPghat(i,j,km1,bi,bj)
75 & *( surfaceForcingS(i,j,bi,bj)
76 #ifdef ALLOW_SALT_PLUME
77 & + saltPlumeFlux(i,j,bi,bj)*recip_rhoConst
78 & *(1.-KPPplumefrac(i,j,bi,bj))
79 #endif /* ALLOW_SALT_PLUME */
80 & )
81 ENDDO
82 ENDDO
83
84 #else /* ALLOW_GMREDI */
85
86 DO j=jMin,jMax
87 DO i=iMin,iMax
88 df(i,j) = - _rA(i,j,bi,bj)
89 & *KPPdiffKzS(i,j,k,bi,bj)
90 & *KPPghat(i,j,km1,bi,bj)
91 & *( surfaceForcingS(i,j,bi,bj)
92 #ifdef ALLOW_SALT_PLUME
93 & + saltPlumeFlux(i,j,bi,bj)*recip_rhoConst
94 & *(1.-KPPplumefrac(i,j,bi,bj))
95 #endif /* ALLOW_SALT_PLUME */
96 & )
97 ENDDO
98 ENDDO
99
100 #endif /* ALLOW_GMREDI */
101
102
103 #endif /* ALLOW_KPP and KPP_GHAT */
104
105 RETURN
106 END

  ViewVC Help
Powered by ViewVC 1.1.22