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