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

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

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


Revision 1.2 - (hide annotations) (download)
Tue Sep 20 22:28:13 2011 UTC (12 years, 9 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63c, checkpoint64, checkpoint65, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, HEAD
Changes since 1.1: +26 -14 lines
move here ptracer/salt correction (initially in calc_3d_diffusivity.F)
and add tracer-index to argument list

1 jmc 1.2 C $Header: /u/gcmpack/MITgcm/pkg/kpp/kpp_calc_diff_ptr.F,v 1.1 2009/06/26 23:10:09 jahn Exp $
2     C $Name: $
3 jahn 1.1
4     #include "KPP_OPTIONS.h"
5    
6     SUBROUTINE KPP_CALC_DIFF_PTR(
7     I bi,bj,iMin,iMax,jMin,jMax,kArg,kSize,
8     O KappaRx,
9 jmc 1.2 I iTr, myThid )
10 jahn 1.1
11 jmc 1.2 C *==========================================================*
12     C | SUBROUTINE KPP_CALC_DIFF_PTR
13     C | o Return contribution to net diffusivity from KPP mixing
14     C *==========================================================*
15 jahn 1.1 IMPLICIT NONE
16    
17     C == GLobal variables ==
18     #include "SIZE.h"
19     #include "EEPARAMS.h"
20     #include "PARAMS.h"
21 jmc 1.2 c#include "DYNVARS.h"
22     c#include "GRID.h"
23     #include "KPP.h"
24     #ifdef ALLOW_PTRACERS
25     #include "PTRACERS_SIZE.h"
26     #include "PTRACERS_PARAMS.h"
27     #endif
28 jahn 1.1 #ifdef ALLOW_LONGSTEP
29     #include "LONGSTEP.h"
30     #endif
31    
32     C == Routine arguments ==
33     C bi, bj, :: tile indices
34     C iMin,iMax :: Range of points for which calculation is done
35     C jMin,jMax :: Range of points for which calculation is done
36     C kArg :: = 0 -> do the k-loop here and treat all levels
37     C > 0 -> k-loop is done outside and treat only level k=kArg
38     C kSize :: 3rd Dimension of the vertical diffusivity array KappaRS
39     C KappaRx :: vertical diffusivity array
40 jmc 1.2 C iTr :: tracer index
41 jahn 1.1 C myThid :: Instance number for this innvocation of KPP_CALC_DIFF_S
42     C
43     INTEGER bi,bj,iMin,iMax,jMin,jMax,kArg,kSize
44     _RL KappaRx(1-Olx:sNx+Olx,1-Oly:sNy+Oly,kSize)
45 jmc 1.2 INTEGER iTr
46 jahn 1.1 INTEGER myThid
47    
48 jmc 1.2 #ifdef ALLOW_PTRACERS
49 jahn 1.1
50     C == Local variables ==
51     C i,j,k :: Loop counters
52     INTEGER i,j,k
53    
54     C-- Set vertical diffusivity contribution from KPP
55     IF ( kArg .EQ. 0 ) THEN
56     C- do all levels :
57     DO k=1,MIN(Nr,kSize)
58     DO j=jMin,jMax
59     DO i=iMin,iMax
60     #ifdef ALLOW_LONGSTEP
61     KappaRx(i,j,k) = LS_KPPdiffKzS(i,j,k,bi,bj)
62     #else
63     KappaRx(i,j,k) = KPPdiffKzS(i,j,k,bi,bj)
64     #endif
65 jmc 1.2 #ifndef ALLOW_3D_DIFFKR
66     KappaRx(i,j,k) = KappaRx(i,j,k)
67     & - diffKrNrS(k) + PTRACERS_diffKrNr(k,iTr)
68     #endif
69 jahn 1.1 ENDDO
70     ENDDO
71     ENDDO
72     ELSE
73     C- do level k=kArg only :
74     k = MIN(kArg,kSize)
75     DO j=jMin,jMax
76     DO i=iMin,iMax
77     #ifdef ALLOW_LONGSTEP
78     KappaRx(i,j,k) = LS_KPPdiffKzS(i,j,kArg,bi,bj)
79     #else
80     KappaRx(i,j,k) = KPPdiffKzS(i,j,kArg,bi,bj)
81     #endif
82 jmc 1.2 #ifndef ALLOW_3D_DIFFKR
83     KappaRx(i,j,k) = KappaRx(i,j,k)
84     & - diffKrNrS(kArg) + PTRACERS_diffKrNr(kArg,iTr)
85     #endif
86 jahn 1.1 ENDDO
87     ENDDO
88     ENDIF
89    
90 jmc 1.2 #endif /* ALLOW_PTRACERS */
91 jahn 1.1
92     RETURN
93     END

  ViewVC Help
Powered by ViewVC 1.1.22