/[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.5 - (hide annotations) (download)
Wed Jun 22 00:27:47 2005 UTC (18 years, 10 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint57m_post, checkpoint57s_post, checkpoint58b_post, checkpoint57y_post, checkpoint57r_post, checkpoint58, checkpoint58f_post, checkpoint57n_post, checkpoint58d_post, checkpoint58a_post, checkpoint57z_post, checkpoint58m_post, checkpoint57l_post, checkpoint57t_post, checkpoint57v_post, checkpoint57y_pre, checkpoint58o_post, checkpoint58p_post, checkpoint58q_post, checkpoint58e_post, checkpoint58r_post, checkpoint58n_post, checkpoint57p_post, checkpint57u_post, checkpoint57q_post, checkpoint58k_post, checkpoint58l_post, checkpoint57j_post, checkpoint58g_post, checkpoint58h_post, checkpoint58j_post, checkpoint57o_post, checkpoint57k_post, checkpoint57w_post, checkpoint58i_post, checkpoint57x_post, checkpoint58c_post
Changes since 1.4: +2 -2 lines
"rkSign" replaces "-rkFac" (<- removed)

1 jmc 1.5 C $Header: /u/gcmpack/MITgcm/pkg/generic_advdiff/gad_diff_r.F,v 1.4 2004/10/21 21:26:10 jmc 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 jmc 1.5 & *(Tracer(i,j,k,bi,bj)-Tracer(i,j,km1,bi,bj))*rkSign
67 adcroft 1.1 ENDDO
68     ENDDO
69     ENDIF
70    
71     RETURN
72     END

  ViewVC Help
Powered by ViewVC 1.1.22