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

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

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


Revision 1.5 - (hide annotations) (download)
Mon Aug 18 12:22:46 2014 UTC (9 years, 8 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65l, checkpoint65m, checkpoint65c, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65o, HEAD
Changes since 1.4: +16 -19 lines
- change Tracer argument (drop bi,bj indices) in S/R GAD_CALC_RHS,
  GAD_C2_ADV_R, GAD_U3_ADV_R, GAD_C4_ADV_R, GAD_DIFF_R, GAD_BIHARM_R
  + also in GMREDI_X/Y/RTRANSPORT ; and update corresponding calls in
  S/R temp/salt/ptracers_integrate.F

1 jmc 1.5 C $Header: /u/gcmpack/MITgcm/pkg/generic_advdiff/gad_u3_adv_r.F,v 1.4 2002/01/08 21:43:24 jmc Exp $
2 jmc 1.1 C $Name: $
3    
4     #include "GAD_OPTIONS.h"
5    
6 adcroft 1.3 CBOP
7     C !ROUTINE: GAD_U3_ADV_R
8    
9     C !INTERFACE: ==========================================================
10 jmc 1.5 SUBROUTINE GAD_U3_ADV_R(
11     I bi, bj, k,
12 jmc 1.1 I rTrans,
13     I tracer,
14     O wT,
15     I myThid )
16 adcroft 1.3
17     C !DESCRIPTION:
18     C Calculates the area integrated vertical flux due to advection of a tracer
19     C using upwind biased third-order interpolation (or the $\kappa=1/3$ scheme):
20     C \begin{equation*}
21     C F^r_{adv} = W \overline{ \theta - \frac{1}{6} \delta_{kk} \theta }^k
22     C + \frac{1}{12} |W| \delta_{kkk} \theta
23     C \end{equation*}
24 jmc 1.4 C Near boundaries, mask all the gradients ==> still 3rd O.
25 adcroft 1.3
26     C !USES: ===============================================================
27 jmc 1.1 IMPLICIT NONE
28     #include "SIZE.h"
29     #include "GRID.h"
30     #include "GAD.h"
31    
32 adcroft 1.3 C !INPUT PARAMETERS: ===================================================
33     C bi,bj :: tile indices
34     C k :: vertical level
35     C rTrans :: vertical volume transport
36     C tracer :: tracer field
37     C myThid :: thread number
38 jmc 1.1 INTEGER bi,bj,k
39     _RL rTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
40 jmc 1.5 _RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
41 adcroft 1.3 INTEGER myThid
42    
43     C !OUTPUT PARAMETERS: ==================================================
44     C wT :: vertical advective flux
45 jmc 1.1 _RL wT (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
46    
47 adcroft 1.3 C !LOCAL VARIABLES: ====================================================
48     C i,j :: loop indices
49     C kp1 :: =min( k+1 , Nr )
50     C km1 :: =max( k-1 , 1 )
51     C km2 :: =max( k-2 , 1 )
52     C Rjm,Rj,Rjp :: differences at i-1,i,i+1
53     C Rjjm,Rjjp :: second differences at i-1,i
54 jmc 1.1 INTEGER i,j,kp1,km1,km2
55 jmc 1.2 _RL Rjm,Rj,Rjp,Rjjm,Rjjp
56 adcroft 1.3 CEOP
57 jmc 1.1
58     km2=MAX(1,k-2)
59     km1=MAX(1,k-1)
60     kp1=MIN(Nr,k+1)
61    
62     IF ( k.EQ.1 .OR. k.GT.Nr ) THEN
63 jmc 1.5 DO j=1-OLy,sNy+OLy
64     DO i=1-OLx,sNx+OLx
65 jmc 1.1 wT(i,j) = 0.
66     ENDDO
67     ENDDO
68     ELSE
69 jmc 1.5 DO j=1-OLy,sNy+OLy
70     DO i=1-OLx,sNx+OLx
71     Rjp = (tracer(i,j,kp1)-tracer(i,j, k ))*maskC(i,j,kp1,bi,bj)
72     Rj = (tracer(i,j, k )-tracer(i,j,km1))
73     Rjm = (tracer(i,j,km1)-tracer(i,j,km2))*maskC(i,j,km2,bi,bj)
74     Rjjp = Rjp-Rj
75     Rjjm = Rj-Rjm
76 jmc 1.1 wT(i,j) = maskC(i,j,km1,bi,bj)*(
77 jmc 1.5 & rTrans(i,j)*( (tracer(i,j,k)+tracer(i,j,km1))*0.5 _d 0
78     & -oneSixth*(Rjjm+Rjjp)*0.5 _d 0 )
79 jmc 1.1 & +ABS(rTrans(i,j))*
80 jmc 1.5 & oneSixth*(Rjjm-Rjjp)*0.5 _d 0
81 jmc 1.1 & )
82     ENDDO
83     ENDDO
84     ENDIF
85    
86     RETURN
87     END

  ViewVC Help
Powered by ViewVC 1.1.22