/[MITgcm]/MITgcm/pkg/generic_advdiff/gad_diff_r.F
ViewVC logotype

Annotation of /MITgcm/pkg/generic_advdiff/gad_diff_r.F

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


Revision 1.4 - (hide annotations) (download)
Thu Oct 21 21:26:10 2004 UTC (19 years, 7 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint57g_pre, checkpoint57b_post, checkpoint57g_post, checkpoint56b_post, checkpoint57d_post, checkpoint57i_post, checkpoint57, checkpoint56, checkpoint55i_post, checkpoint57f_post, checkpoint57a_post, checkpoint57h_pre, checkpoint57h_post, checkpoint57c_post, checkpoint57c_pre, checkpoint55j_post, checkpoint57e_post, eckpoint57e_pre, checkpoint56a_post, checkpoint57h_done, checkpoint57f_pre, checkpoint56c_post, checkpoint57a_pre
Changes since 1.3: +3 -3 lines
Explicit vertical diffusivity: use a 2.D vertical diffusivity array

1 jmc 1.4 C $Header: /u/gcmpack/MITgcm/pkg/generic_advdiff/gad_diff_r.F,v 1.3 2001/09/21 13:11:43 adcroft Exp $
2 adcroft 1.2 C $Name: $
3 adcroft 1.1
4     #include "GAD_OPTIONS.h"
5    
6 adcroft 1.2 CBOP
7     C !ROUTINE: GAD_DIFF_R
8    
9     C !INTERFACE: ==========================================================
10 adcroft 1.1 SUBROUTINE GAD_DIFF_R(
11     I bi,bj,k,
12     I KappaR,
13     I tracer,
14     O dfr,
15     I myThid )
16 adcroft 1.2
17     C !DESCRIPTION:
18 adcroft 1.3 C Calculates the area integrated vertical flux due to down-gradient
19     C diffusion of a tracer:
20 adcroft 1.2 C \begin{equation*}
21 adcroft 1.3 C F^r_{diff} = - A^r \kappa_r \frac{1}{\Delta r_c} \delta_k \theta
22 adcroft 1.2 C \end{equation*}
23    
24     C !USES: ===============================================================
25 adcroft 1.1 IMPLICIT NONE
26     #include "SIZE.h"
27     #include "GRID.h"
28     #include "EEPARAMS.h"
29     #include "PARAMS.h"
30    
31 adcroft 1.2 C !INPUT PARAMETERS: ===================================================
32     C bi,bj :: tile indices
33     C k :: vertical level
34     C KappaR :: vertical diffusivity
35     C tracer :: tracer field
36     C myThid :: thread number
37 adcroft 1.1 INTEGER bi,bj,k
38 jmc 1.4 _RL KappaR(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
39 adcroft 1.1 _RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
40 adcroft 1.2 INTEGER myThid
41    
42     C !OUTPUT PARAMETERS: ==================================================
43     C dfr :: vertical diffusive flux
44 adcroft 1.1 _RL dfr (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
45    
46 adcroft 1.2 C !LOCAL VARIABLES: ====================================================
47     C i,j :: loop indices
48     C km1 :: =k+1 for k<Nr, =Nr for k>-Nr
49 adcroft 1.1 INTEGER i,j,km1
50 adcroft 1.3 CEOP
51 adcroft 1.1
52     km1=max(1,k-1)
53    
54     IF (k.eq.1 .OR. k.gt.Nr) THEN
55     DO j=1-Oly,sNy+Oly
56     DO i=1-Olx,sNx+Olx
57     dfr(i,j) = 0.
58     ENDDO
59     ENDDO
60     ELSE
61     DO j=1-Oly,sNy+Oly
62     DO i=1-Olx,sNx+Olx
63     dfr(i,j) =
64     & -_rA(i,j,bi,bj)
65 jmc 1.4 & *KappaR(i,j)*recip_drC(k)
66 adcroft 1.1 & *(Tracer(i,j,km1,bi,bj)-Tracer(i,j,k,bi,bj))*rkFac
67     ENDDO
68     ENDDO
69     ENDIF
70    
71     RETURN
72     END

  ViewVC Help
Powered by ViewVC 1.1.22