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

Contents of /MITgcm/pkg/generic_advdiff/gad_u3_adv_x.F

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


Revision 1.5 - (show annotations) (download)
Fri Feb 29 01:31:00 2008 UTC (16 years, 2 months ago) by mlosch
Branch: MAIN
CVS Tags: checkpoint62u, checkpoint62t, checkpoint62c, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint60, checkpoint61, checkpoint62, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59o, checkpoint62b, checkpoint61f, checkpoint61n, checkpoint61q, checkpoint61e, checkpoint61g, checkpoint61d, checkpoint61b, checkpoint61c, checkpoint61a, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61z, checkpoint61x, checkpoint61y
Changes since 1.4: +3 -1 lines
improve vectorizability by moving a few statements out of the main loop

1 C $Header: /u/gcmpack/MITgcm/pkg/generic_advdiff/gad_u3_adv_x.F,v 1.4 2002/01/08 21:43:23 jmc Exp $
2 C $Name: $
3
4 #include "GAD_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: GAD_U3_ADV_X
8
9 C !INTERFACE: ==========================================================
10 SUBROUTINE GAD_U3_ADV_X(
11 I bi,bj,k,
12 I uTrans,
13 I tracer,
14 O uT,
15 I myThid )
16
17 C !DESCRIPTION:
18 C Calculates the area integrated zonal 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^x_{adv} = U \overline{ \theta - \frac{1}{6} \delta_{ii} \theta }^i
22 C + \frac{1}{12} |U| \delta_{iii} \theta
23 C \end{equation*}
24 C Near boundaries, mask all the gradients ==> still 3rd O.
25
26 C !USES: ===============================================================
27 IMPLICIT NONE
28 #include "SIZE.h"
29 #include "GRID.h"
30 #include "GAD.h"
31
32 C !INPUT PARAMETERS: ===================================================
33 C bi,bj :: tile indices
34 C k :: vertical level
35 C uTrans :: zonal volume transport
36 C tracer :: tracer field
37 C myThid :: thread number
38 INTEGER bi,bj,k
39 _RL uTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
40 _RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
41 INTEGER myThid
42
43 C !OUTPUT PARAMETERS: ==================================================
44 C uT :: zonal advective flux
45 _RL uT (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
46
47 C !LOCAL VARIABLES: ====================================================
48 C i,j :: loop indices
49 C Rjm,Rj,Rjp :: differences at i-1,i,i+1
50 C Rjjm,Rjjp :: second differences at i-1,i
51 INTEGER i,j
52 _RL Rjm,Rj,Rjp,Rjjm,Rjjp
53 CEOP
54
55 DO j=1-Oly,sNy+Oly
56 uT(1-Olx,j)=0.
57 uT(2-Olx,j)=0.
58 uT(sNx+Olx,j)=0.
59 ENDDO
60 DO j=1-Oly,sNy+Oly
61 DO i=1-Olx+2,sNx+Olx-1
62 Rjp=(tracer(i+1,j)-tracer(i,j))*maskW(i+1,j,k,bi,bj)
63 Rj =(tracer(i,j)-tracer(i-1,j))*maskW(i,j,k,bi,bj)
64 Rjm=(tracer(i-1,j)-tracer(i-2,j))*maskW(i-1,j,k,bi,bj)
65 Rjjp=Rjp-Rj
66 Rjjm=Rj-Rjm
67 uT(i,j) =
68 & uTrans(i,j)*(
69 & Tracer(i,j)+Tracer(i-1,j)-oneSixth*( Rjjp+Rjjm )
70 & )*0.5 _d 0
71 & +ABS( uTrans(i,j) )*0.5 _d 0*oneSixth*( Rjjp-Rjjm )
72 ENDDO
73 ENDDO
74
75 RETURN
76 END

  ViewVC Help
Powered by ViewVC 1.1.22