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

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

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


Revision 1.18 - (hide 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 heimbach 1.18 C $Header: /u/gcmpack/MITgcm/pkg/kpp/kpp_transport_s.F,v 1.17 2014/05/21 10:45:33 heimbach 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 heimbach 1.17 #ifdef ALLOW_SALT_PLUME
9     #include "SALT_PLUME_OPTIONS.h"
10     #endif
11 adcroft 1.1
12 jmc 1.16 SUBROUTINE KPP_TRANSPORT_S (
13 adcroft 1.1 I iMin,iMax,jMin,jMax,bi,bj,k,km1,
14 jmc 1.12 O df,
15     I myTime, myIter, myThid )
16 jmc 1.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 adcroft 1.1 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 jmc 1.11 #ifdef ALLOW_GMREDI
40 dimitri 1.14 # include "GMREDI.h"
41     #endif
42     #ifdef ALLOW_SALT_PLUME
43     # include "SALT_PLUME.h"
44 jmc 1.11 #endif
45 adcroft 1.1
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 jmc 1.12 C myTime :: Current time in simulation
51     C myIter :: Current iteration number in simulation
52     C myThid :: My Thread Id. number
53 adcroft 1.1 INTEGER iMin,iMax,jMin,jMax,bi,bj,k,km1
54     _RL df (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
55 jmc 1.12 _RL myTime
56     INTEGER myIter
57     INTEGER myThid
58 adcroft 1.1
59 heimbach 1.2 #if defined(ALLOW_KPP) && defined(KPP_GHAT)
60 adcroft 1.1
61     C == Local variables ==
62     C I, J - Loop counters
63     INTEGER I, J
64 jmc 1.16 #ifdef ALLOW_GMREDI
65     _RL tmpFac
66     #endif
67     #ifdef ALLOW_SALT_PLUME
68     _RL tmpFac1
69     #endif
70 atn 1.15
71 jmc 1.16 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
72 atn 1.15
73 heimbach 1.17 catn: will not apply if use SALT_PLUME_VOLUME because volumes
74     c will be exchanged
75 atn 1.15 #ifdef ALLOW_SALT_PLUME
76     IF ( useSALT_PLUME ) THEN
77 heimbach 1.18 # ifndef SALT_PLUME_VOLUME
78 atn 1.15 tmpFac1 = 1. _d 0
79 heimbach 1.18 # else
80 heimbach 1.17 tmpFac1 = 0. _d 0
81 heimbach 1.18 # endif /* ndef SALT_PLUME_VOLUME */
82 atn 1.15 ELSE
83     tmpFac1 = 0. _d 0
84     ENDIF
85     #endif /* ALLOW_SALT_PLUME */
86 adcroft 1.1
87 jmc 1.11 #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 heimbach 1.2 DO j=jMin,jMax
95     DO i=iMin,iMax
96 jmc 1.11 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 dimitri 1.13 & *( surfaceForcingS(i,j,bi,bj)
100     #ifdef ALLOW_SALT_PLUME
101 atn 1.15 & + tmpFac1*saltPlumeFlux(i,j,bi,bj)*recip_rhoConst
102 dimitri 1.13 & *(1.-KPPplumefrac(i,j,bi,bj))
103     #endif /* ALLOW_SALT_PLUME */
104     & )
105 adcroft 1.1 ENDDO
106 heimbach 1.2 ENDDO
107 adcroft 1.1
108 jmc 1.11 #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 dimitri 1.13 & *( surfaceForcingS(i,j,bi,bj)
116     #ifdef ALLOW_SALT_PLUME
117 atn 1.15 & + tmpFac1*saltPlumeFlux(i,j,bi,bj)*recip_rhoConst
118 dimitri 1.13 & *(1.-KPPplumefrac(i,j,bi,bj))
119     #endif /* ALLOW_SALT_PLUME */
120     & )
121 jmc 1.11 ENDDO
122     ENDDO
123    
124     #endif /* ALLOW_GMREDI */
125    
126 heimbach 1.2 #endif /* ALLOW_KPP and KPP_GHAT */
127 adcroft 1.1
128     RETURN
129     END

  ViewVC Help
Powered by ViewVC 1.1.22