/[MITgcm]/MITgcm/pkg/gmredi/gmredi_calc_diff.F
ViewVC logotype

Contents of /MITgcm/pkg/gmredi/gmredi_calc_diff.F

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


Revision 1.11 - (show annotations) (download)
Mon Dec 12 15:34:08 2011 UTC (12 years, 6 months ago) by mlosch
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, checkpoint63g, checkpoint64, checkpoint65, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint65o, 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, HEAD
Changes since 1.10: +5 -1 lines
mask all horizontal advection and diffusion contributions on open
boundary points in preparation for modified/improved Stevens OBCs

1 C $Header: /u/gcmpack/MITgcm/pkg/gmredi/gmredi_calc_diff.F,v 1.10 2009/06/26 23:10:09 jahn Exp $
2 C $Name: $
3
4 #include "GMREDI_OPTIONS.h"
5
6 SUBROUTINE GMREDI_CALC_DIFF(
7 I bi,bj,iMin,iMax,jMin,jMax,kArg,kSize,
8 U KappaRx,
9 I tracerIdentity,myThid)
10
11 C /==========================================================\
12 C | SUBROUTINE GMREDI_CALC_DIFF |
13 C | o Add contribution to net diffusivity from GM/Redi |
14 C \==========================================================/
15 IMPLICIT NONE
16
17 C == GLobal variables ==
18 #include "SIZE.h"
19 #include "EEPARAMS.h"
20 #include "PARAMS.h"
21 #include "GRID.h"
22 #include "GAD.h"
23 #ifdef ALLOW_LONGSTEP
24 #include "LONGSTEP.h"
25 #endif
26 #ifdef ALLOW_GMREDI
27 #include "GMREDI.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 KappaRx
37 C KappaRx :: vertical diffusivity array
38 C myThid :: Instance number for this innvocation of GMREDI_CALC_DIFF
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 tracerIdentity
43 INTEGER myThid
44
45 #ifdef ALLOW_GMREDI
46
47 C == Local variables ==
48 C i,j,k :: Loop counters
49 INTEGER i,j,k
50
51 C-- Add Vertical diffusivity contribution from GM/Redi
52 IF ( kArg .EQ. 0 ) THEN
53 C- do all levels :
54 DO k=1,MIN(Nr,kSize)
55 DO j=jMin,jMax
56 DO i=iMin,iMax
57 IF (tracerIdentity .LT. GAD_TR1) THEN
58 KappaRx(i,j,k) = KappaRx(i,j,k)+Kwz(i,j,k,bi,bj)
59 & *maskInC(i,j,bi,bj)
60 ELSE
61 #ifdef ALLOW_LONGSTEP
62 KappaRx(i,j,k) = KappaRx(i,j,k)+LS_Kwz(i,j,k,bi,bj)
63 #else
64 KappaRx(i,j,k) = KappaRx(i,j,k)+Kwz(i,j,k,bi,bj)
65 #endif
66 & *maskInC(i,j,bi,bj)
67 ENDIF
68 ENDDO
69 ENDDO
70 ENDDO
71 ELSE
72 C- do level k=kArg only :
73 k = MIN(kArg,kSize)
74 DO j=jMin,jMax
75 DO i=iMin,iMax
76 IF (tracerIdentity .LT. GAD_TR1) THEN
77 KappaRx(i,j,k) = KappaRx(i,j,k)+Kwz(i,j,kArg,bi,bj)
78 & *maskInC(i,j,bi,bj)
79 ELSE
80 #ifdef ALLOW_LONGSTEP
81 KappaRx(i,j,k) = KappaRx(i,j,k)+LS_Kwz(i,j,kArg,bi,bj)
82 #else
83 KappaRx(i,j,k) = KappaRx(i,j,k)+Kwz(i,j,kArg,bi,bj)
84 #endif
85 & *maskInC(i,j,bi,bj)
86 ENDIF
87 ENDDO
88 ENDDO
89 ENDIF
90
91 #endif /* ALLOW_GMREDI */
92
93 RETURN
94 END

  ViewVC Help
Powered by ViewVC 1.1.22