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

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

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


Revision 1.6 - (show annotations) (download)
Fri Feb 29 01:30:59 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.5: +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_c4_adv_x.F,v 1.5 2003/05/01 16:12:36 jmc Exp $
2 C $Name: $
3
4 #include "GAD_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: GAD_C4_ADV_X
8
9 C !INTERFACE: ==========================================================
10 SUBROUTINE GAD_C4_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 centered fourth-order interpolation:
20 C \begin{equation*}
21 C F^x_{adv} = U \overline{ \theta - \frac{1}{6} \delta_{ii} \theta }^i
22 C \end{equation*}
23 C Near boundaries, the scheme reduces to a second if the flow is away
24 C from the boundary and to third order if the flow is towards
25 C the boundary.
26
27 C !USES: ===============================================================
28 IMPLICIT NONE
29 #include "SIZE.h"
30 #include "GRID.h"
31 #include "GAD.h"
32
33 C !INPUT PARAMETERS: ===================================================
34 C bi,bj :: tile indices
35 C k :: vertical level
36 C uTrans :: zonal volume transport
37 C tracer :: tracer field
38 C myThid :: thread number
39 INTEGER bi,bj,k
40 _RL uTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
41 _RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
42 INTEGER myThid
43
44 C !OUTPUT PARAMETERS: ==================================================
45 C uT :: zonal advective flux
46 _RL uT (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
47
48 C !LOCAL VARIABLES: ====================================================
49 C i,j :: loop indices
50 C Rjm,Rj,Rjp :: differences at i-1,i,i+1
51 C Rjjm,Rjjp :: second differences at i-1,i
52 INTEGER i,j
53 _RL Rjm,Rj,Rjp,Rjjm,Rjjp
54 CEOP
55
56 DO j=1-Oly,sNy+Oly
57 uT(1-Olx,j)=0.
58 uT(2-Olx,j)=0.
59 uT(sNx+Olx,j)=0.
60 ENDDO
61 DO j=1-Oly,sNy+Oly
62 DO i=1-Olx+2,sNx+Olx-1
63 Rjp=(tracer(i+1,j)-tracer(i,j))
64 & *maskW(i+1,j,k,bi,bj)
65 Rj =(tracer(i,j)-tracer(i-1,j))
66 & *maskW(i,j,k,bi,bj)
67 Rjm=(tracer(i-1,j)-tracer(i-2,j))
68 & *maskW(i-1,j,k,bi,bj)
69 Rjjp=(Rjp-Rj)
70 Rjjm=(Rj-Rjm)
71 uT(i,j) =
72 & uTrans(i,j)*(
73 & Tracer(i,j)+Tracer(i-1,j)-oneSixth*( Rjjp+Rjjm )
74 & )*0.5 _d 0
75 & +ABS( uTrans(i,j) )*0.5 _d 0*oneSixth*( Rjjp-Rjjm )
76 & *( 1. _d 0 - maskW(i-1,j,k,bi,bj)*maskW(i+1,j,k,bi,bj) )
77 ENDDO
78 ENDDO
79
80 RETURN
81 END

  ViewVC Help
Powered by ViewVC 1.1.22