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

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

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


Revision 1.2 - (hide annotations) (download)
Wed Jun 21 22:58:31 2006 UTC (17 years, 11 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint58l_post, checkpoint58u_post, checkpoint58w_post, checkpoint58r_post, checkpoint58n_post, checkpoint58x_post, checkpoint58t_post, checkpoint58q_post, checkpoint59, checkpoint58o_post, checkpoint58y_post, checkpoint58k_post, checkpoint58v_post, checkpoint58s_post, checkpoint58p_post, checkpoint58m_post
Changes since 1.1: +2 -2 lines
fix bug: use KPPdiffKzS instead of KPPdiffKzT

1 jmc 1.2 C $Header: /u/gcmpack/MITgcm/pkg/kpp/kpp_calc_diff_s.F,v 1.1 2004/10/22 01:39:58 jmc Exp $
2 jmc 1.1 C $Name: $
3    
4     #include "KPP_OPTIONS.h"
5    
6     SUBROUTINE KPP_CALC_DIFF_S(
7     I bi,bj,iMin,iMax,jMin,jMax,kArg,kSize,
8     U KappaRS,
9     I myThid)
10    
11     C /==========================================================\
12     C | SUBROUTINE KPP_CALC_DIFF_S |
13     C | o Add contrubution 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_KPP
24     #include "KPP.h"
25     #endif
26    
27     C == Routine arguments ==
28     C bi, bj, :: tile indices
29     C iMin,iMax :: Range of points for which calculation is done
30     C jMin,jMax :: Range of points for which calculation is done
31     C kArg :: = 0 -> do the k-loop here and treat all levels
32     C > 0 -> k-loop is done outside and treat only level k=kArg
33     C kSize :: 3rd Dimension of the vertical diffusivity array KappaRS
34     C KappaRS :: vertical diffusivity array
35     C myThid :: Instance number for this innvocation of KPP_CALC_DIFF_S
36     C
37     INTEGER bi,bj,iMin,iMax,jMin,jMax,kArg,kSize
38     _RL KappaRS(1-Olx:sNx+Olx,1-Oly:sNy+Oly,kSize)
39     INTEGER myThid
40    
41     #ifdef ALLOW_KPP
42    
43     C == Local variables ==
44     C i,j,k :: Loop counters
45     INTEGER i,j,k
46    
47     C-- Add Vertical diffusivity contribution from KPP
48     IF ( kArg .EQ. 0 ) THEN
49     C- do all levels :
50     DO k=1,MIN(Nr,kSize)
51     DO j=jMin,jMax
52     DO i=iMin,iMax
53     KappaRS(i,j,k) = KappaRS(i,j,k)
54     & + ( KPPdiffKzS(i,j,k,bi,bj)
55     #if (defined (ALLOW_AUTODIFF_TAMC) && defined (ALLOW_DIFFKR_CONTROL))
56     & - diffKr(i,j,k,bi,bj) )
57     #else
58     & - diffKrNrS(k) )
59     #endif
60     ENDDO
61     ENDDO
62     ENDDO
63     ELSE
64     C- do level k=kArg only :
65     k = MIN(kArg,kSize)
66     DO j=jMin,jMax
67     DO i=iMin,iMax
68     KappaRS(i,j,k) = KappaRS(i,j,k)
69 jmc 1.2 & + ( KPPdiffKzS(i,j,kArg,bi,bj)
70 jmc 1.1 #if (defined (ALLOW_AUTODIFF_TAMC) && defined (ALLOW_DIFFKR_CONTROL))
71     & - diffKr(i,j,kArg,bi,bj) )
72     #else
73     & - diffKrNrS(kArg) )
74     #endif
75     ENDDO
76     ENDDO
77     ENDIF
78    
79     #endif /* ALLOW_KPP */
80    
81     RETURN
82     END

  ViewVC Help
Powered by ViewVC 1.1.22