/[MITgcm]/MITgcm/verification/OpenAD/code/gad_fluxlimit_adv_y.F
ViewVC logotype

Contents of /MITgcm/verification/OpenAD/code/gad_fluxlimit_adv_y.F

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


Revision 1.1 - (show annotations) (download)
Fri Aug 19 21:48:51 2005 UTC (18 years, 9 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint57t_post, checkpoint58l_post, checkpoint58e_post, checkpoint57v_post, checkpoint57s_post, checkpoint58b_post, checkpoint58m_post, checkpoint60, checkpoint61, checkpoint62, checkpoint58r_post, checkpoint57y_post, checkpoint58g_post, checkpoint57x_post, checkpoint58n_post, checkpoint58x_post, checkpoint61l, checkpoint58h_post, checkpoint58w_post, checkpoint58j_post, checkpoint57y_pre, checkpoint58q_post, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint59c, checkpoint59b, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59h, checkpoint59k, checkpoint59j, checkpoint57r_post, checkpoint59, checkpoint58, checkpoint58f_post, checkpoint58d_post, checkpoint58c_post, checkpoint57w_post, checkpint57u_post, checkpoint58a_post, checkpoint58i_post, checkpoint57q_post, checkpoint58o_post, checkpoint57z_post, checkpoint62c, checkpoint62b, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62q, checkpoint62p, checkpoint58k_post, checkpoint58u_post, checkpoint58y_post, checkpoint58v_post, checkpoint58s_post, checkpoint61f, checkpoint61g, checkpoint61d, checkpoint61e, checkpoint61b, checkpoint61c, checkpoint58p_post, checkpoint61a, checkpoint61n, checkpoint61o, checkpoint58t_post, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61q, checkpoint61z, checkpoint61x, checkpoint61y
Starting OpenAD setup; includes some scripts.

1 C $Header: /u/gcmpack/MITgcm/verification/global_ocean.90x40x15/input/code/gad_fluxlimit_adv_y.F,v 1.1 2005/08/19 21:23:31 utke Exp $
2 C $Name: $
3
4 #include "GAD_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: GAD_FLUXLIMIT_ADV_Y
8
9 C !INTERFACE: ==========================================================
10 SUBROUTINE GAD_FLUXLIMIT_ADV_Y(
11 I bi,bj,k,deltaTloc,
12 I vTrans, vVel,
13 I maskLocS, tracer,
14 O vT,
15 I myThid )
16
17 C !DESCRIPTION:
18 C Calculates the area integrated meridional flux due to advection of a tracer
19 C using second-order interpolation with a flux limiter:
20 C \begin{equation*}
21 C F^y_{adv} = V \overline{ \theta }^j
22 C - \frac{1}{2} \left(
23 C [ 1 - \psi(C_r) ] |V|
24 C + V \frac{v \Delta t}{\Delta y_c} \psi(C_r)
25 C \right) \delta_j \theta
26 C \end{equation*}
27 C where the $\psi(C_r)$ is the limiter function and $C_r$ is
28 C the slope ratio.
29
30 C !USES: ===============================================================
31 IMPLICIT NONE
32 #include "SIZE.h"
33 #include "GRID.h"
34
35 C !INPUT PARAMETERS: ===================================================
36 C bi,bj :: tile indices
37 C k :: vertical level
38 C vTrans :: meridional volume transport
39 C vVel :: meridional flow
40 C tracer :: tracer field
41 C myThid :: thread number
42 INTEGER bi,bj,k
43 _RL deltaTloc
44 _RL vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
45 _RL vVel (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
46 _RS maskLocS(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
47 _RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
48 INTEGER myThid
49
50 C !OUTPUT PARAMETERS: ==================================================
51 C vT :: meridional advective flux
52 _RL vT (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
53
54 C !LOCAL VARIABLES: ====================================================
55 C i,j :: loop indices
56 C Cr :: slope ratio
57 C Rjm,Rj,Rjp :: differences at j-1,j,j+1
58 C vFld :: velocity [m/s], meridional component
59 INTEGER i,j
60 _RL Cr,Rjm,Rj,Rjp
61 _RL vFld
62 C Statement function provides Limiter(Cr)
63 #include "GAD_FLUX_LIMITER.h"
64 CEOP
65
66 DO i=1-Olx,sNx+Olx
67 vT(i,1-Oly)=0.
68 vT(i,2-Oly)=0.
69 vT(i,sNy+Oly)=0.
70 ENDDO
71 DO j=1-Oly+2,sNy+Oly-1
72 DO i=1-Olx,sNx+Olx
73
74 c vFld = vVel(i,j,k,bi,bj)
75 vFld = vTrans(i,j)*recip_dxG(i,j,bi,bj)
76 & *recip_drF(k)*recip_hFacS(i,j,k,bi,bj)
77 Rjp=(tracer(i,j+1)-tracer(i, j ))*maskLocS(i,j+1)
78 Rj =(tracer(i, j )-tracer(i,j-1))*maskLocS(i, j )
79 Rjm=(tracer(i,j-1)-tracer(i,j-2))*maskLocS(i,j-1)
80
81 IF (Rj.NE.0.) THEN
82 IF (vTrans(i,j).GT.0) THEN
83 Cr=Rjm/Rj
84 ELSE
85 Cr=Rjp/Rj
86 ENDIF
87 ELSE
88 IF (vTrans(i,j).GT.0) THEN
89 Cr=Rjm*1.E20
90 ELSE
91 Cr=Rjp*1.E20
92 ENDIF
93 ENDIF
94 Cr=max(0.D0,max(min(1.D0,2.D0*Cr),min(2.D0,Cr)))
95 cph Cr=Limiter(Cr)
96 vT(i,j) =
97 & vTrans(i,j)*(Tracer(i,j)+Tracer(i,j-1))*0.5 _d 0
98 & -0.5*(
99 & (1-Cr)*ABS(vTrans(i,j))
100 & +vTrans(i,j)*vFld*deltaTloc
101 & *recip_dyC(i,j,bi,bj)*Cr
102 & )*Rj
103 ENDDO
104 ENDDO
105
106 RETURN
107 END

  ViewVC Help
Powered by ViewVC 1.1.22