/[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.13 - (show annotations) (download)
Sat Sep 22 17:55:32 2007 UTC (16 years, 8 months ago) by dimitri
Branch: MAIN
CVS Tags: checkpoint59l, checkpoint59i, checkpoint59h, checkpoint59k, checkpoint59j
Changes since 1.12: +13 -3 lines
added the salt plume scheme (ALLOW_SALT_PLUME) to pkg/kpp
(code conttributed by An Nguyen)

1 C $Header: /u/gcmpack/MITgcm/pkg/kpp/kpp_transport_s.F,v 1.12 2007/05/03 21:33:42 jmc 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
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 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
48 _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)
54
55 C == Local variables ==
56 C I, J - Loop counters
57 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
68 DO i=iMin,iMax
69 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 & *( 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 ENDDO
79 ENDDO
80
81 #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 & *( 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 ENDDO
95 ENDDO
96
97 #endif /* ALLOW_GMREDI */
98
99
100 #endif /* ALLOW_KPP and KPP_GHAT */
101
102 RETURN
103 END

  ViewVC Help
Powered by ViewVC 1.1.22