/[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.18 - (show annotations) (download)
Thu May 22 13:11:14 2014 UTC (9 years, 11 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint65, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65o, checkpoint64y, checkpoint64x, checkpoint64z, HEAD
Changes since 1.17: +4 -4 lines
Fix/undo one more recip_Cp replacement

1 C $Header: /u/gcmpack/MITgcm/pkg/kpp/kpp_transport_s.F,v 1.17 2014/05/21 10:45:33 heimbach Exp $
2 C $Name: $
3
4 #include "KPP_OPTIONS.h"
5 #ifdef ALLOW_GMREDI
6 #include "GMREDI_OPTIONS.h"
7 #endif
8 #ifdef ALLOW_SALT_PLUME
9 #include "SALT_PLUME_OPTIONS.h"
10 #endif
11
12 SUBROUTINE KPP_TRANSPORT_S (
13 I iMin,iMax,jMin,jMax,bi,bj,k,km1,
14 O df,
15 I myTime, myIter, myThid )
16 C *==========================================================*
17 C | o SUBROUTINE KPP_TRANSPORT_S
18 C | Add non local KPP transport term (ghat) to diffusive
19 C | salinity flux.
20 C *==========================================================*
21 C | The nonlocal transport term is nonzero only for scalars
22 C | in unstable (convective) forcing conditions.
23 C | Note: KPPdiffKzS(-,k) is defined at the top of grid cell
24 C | k while KPPghat(i,j,k,bi,bj) is defined at the
25 C | bottom of grid cell k.
26 C | For K=1, KPPdiffKzS(-,k) = 0 which insures no flux
27 C | through the surface.
28 C *==========================================================*
29 IMPLICIT NONE
30
31 C == GLobal variables ==
32 #include "SIZE.h"
33 #include "EEPARAMS.h"
34 #include "PARAMS.h"
35 #include "GRID.h"
36 #include "FFIELDS.h"
37 #include "KPP.h"
38 #include "KPP_PARAMS.h"
39 #ifdef ALLOW_GMREDI
40 # include "GMREDI.h"
41 #endif
42 #ifdef ALLOW_SALT_PLUME
43 # include "SALT_PLUME.h"
44 #endif
45
46 C == Routine arguments ==
47 C iMin,iMax,jMin, - Range of points for which calculation
48 C jMax,bi,bj,k,km1 results will be set.
49 C df - Diffusive flux component work array.
50 C myTime :: Current time in simulation
51 C myIter :: Current iteration number in simulation
52 C myThid :: My Thread Id. number
53 INTEGER iMin,iMax,jMin,jMax,bi,bj,k,km1
54 _RL df (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
55 _RL myTime
56 INTEGER myIter
57 INTEGER myThid
58
59 #if defined(ALLOW_KPP) && defined(KPP_GHAT)
60
61 C == Local variables ==
62 C I, J - Loop counters
63 INTEGER I, J
64 #ifdef ALLOW_GMREDI
65 _RL tmpFac
66 #endif
67 #ifdef ALLOW_SALT_PLUME
68 _RL tmpFac1
69 #endif
70
71 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
72
73 catn: will not apply if use SALT_PLUME_VOLUME because volumes
74 c will be exchanged
75 #ifdef ALLOW_SALT_PLUME
76 IF ( useSALT_PLUME ) THEN
77 # ifndef SALT_PLUME_VOLUME
78 tmpFac1 = 1. _d 0
79 # else
80 tmpFac1 = 0. _d 0
81 # endif /* ndef SALT_PLUME_VOLUME */
82 ELSE
83 tmpFac1 = 0. _d 0
84 ENDIF
85 #endif /* ALLOW_SALT_PLUME */
86
87 #ifdef ALLOW_GMREDI
88
89 IF ( useGMRedi .AND. KPP_ghatUseTotalDiffus ) THEN
90 tmpFac = 1. _d 0
91 ELSE
92 tmpFac = 0. _d 0
93 ENDIF
94 DO j=jMin,jMax
95 DO i=iMin,iMax
96 df(i,j) = - _rA(i,j,bi,bj)
97 & *( KPPdiffKzS(i,j,k,bi,bj) + tmpFac*Kwz(i,j,k,bi,bj) )
98 & *KPPghat(i,j,km1,bi,bj)
99 & *( surfaceForcingS(i,j,bi,bj)
100 #ifdef ALLOW_SALT_PLUME
101 & + tmpFac1*saltPlumeFlux(i,j,bi,bj)*recip_rhoConst
102 & *(1.-KPPplumefrac(i,j,bi,bj))
103 #endif /* ALLOW_SALT_PLUME */
104 & )
105 ENDDO
106 ENDDO
107
108 #else /* ALLOW_GMREDI */
109
110 DO j=jMin,jMax
111 DO i=iMin,iMax
112 df(i,j) = - _rA(i,j,bi,bj)
113 & *KPPdiffKzS(i,j,k,bi,bj)
114 & *KPPghat(i,j,km1,bi,bj)
115 & *( surfaceForcingS(i,j,bi,bj)
116 #ifdef ALLOW_SALT_PLUME
117 & + tmpFac1*saltPlumeFlux(i,j,bi,bj)*recip_rhoConst
118 & *(1.-KPPplumefrac(i,j,bi,bj))
119 #endif /* ALLOW_SALT_PLUME */
120 & )
121 ENDDO
122 ENDDO
123
124 #endif /* ALLOW_GMREDI */
125
126 #endif /* ALLOW_KPP and KPP_GHAT */
127
128 RETURN
129 END

  ViewVC Help
Powered by ViewVC 1.1.22