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

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

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


Revision 1.3 - (show annotations) (download)
Thu Dec 1 14:14:44 2011 UTC (12 years, 5 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63g, checkpoint64, checkpoint65, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e
Changes since 1.2: +19 -17 lines
add argument recip_hFac to use in place of recip_hFacC

1 C $Header: /u/gcmpack/MITgcm/pkg/generic_advdiff/gad_dst2u1_impl_r.F,v 1.2 2006/06/07 01:55:14 heimbach Exp $
2 C $Name: $
3
4 #include "GAD_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: GAD_DST2U1_IMPL_R
8 C !INTERFACE:
9 SUBROUTINE GAD_DST2U1_IMPL_R(
10 I bi,bj,k, iMin,iMax,jMin,jMax,
11 I advectionScheme, deltaTarg, rTrans, recip_hFac,
12 O a3d, b3d, c3d,
13 I myThid )
14
15 C !DESCRIPTION:
16 C Compute matrix element to solve vertical advection implicitly
17 C using DST 2nd.Order (=Lax-Wendroff) or 1rst Order Upwind scheme.
18 C Method:
19 C contribution of vertical transport at interface k is added
20 C to matrix lines k and k-1.
21
22 C !USES:
23 IMPLICIT NONE
24
25 C == Global variables ===
26 #include "SIZE.h"
27 #include "GRID.h"
28 #include "GAD.h"
29
30 C !INPUT/OUTPUT PARAMETERS:
31 C == Routine Arguments ==
32 C bi,bj :: tile indices
33 C k :: vertical level
34 C advectionScheme :: advection scheme to use: either 2nd Order DST
35 C or 1rst Order Upwind
36 C iMin,iMax :: computation domain
37 C jMin,jMax :: computation domain
38 C deltaTarg :: time step
39 C rTrans :: vertical volume transport
40 C recip_hFac :: inverse of cell open-depth factor
41 C a3d :: lower diagonal of the tridiagonal matrix
42 C b3d :: main diagonal of the tridiagonal matrix
43 C c3d :: upper diagonal of the tridiagonal matrix
44 C myThid :: thread number
45 INTEGER bi,bj,k
46 INTEGER iMin,iMax,jMin,jMax
47 INTEGER advectionScheme
48 _RL deltaTarg(Nr)
49 _RL rTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
50 _RS recip_hFac(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
51 _RL a3d (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
52 _RL b3d (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
53 _RL c3d (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
54 INTEGER myThid
55
56 C == Local Variables ==
57 C i,j :: loop indices
58 C w_CFL :: Courant-Friedrich-Levy number
59 C rLimit :: centered (vs upwind) fraction
60 C rCenter :: centered contribution
61 C rUpwind :: upwind contribution
62 INTEGER i,j
63 _RL w_CFL, rLimit
64 _RL rCenter, rUpwind
65 _RL deltaTcfl
66
67 CEOP
68
69 rLimit = 0. _d 0
70 IF ( advectionScheme.EQ.ENUM_DST2 ) rLimit = 1. _d 0
71
72 C-- process interior interface only:
73 IF ( k.GT.1 .AND. k.LE.Nr ) THEN
74
75 C-- Add centered & upwind contributions
76 deltaTcfl = deltaTarg(k)
77 DO j=jMin,jMax
78 DO i=iMin,iMax
79 w_CFL = deltaTcfl*ABS(rTrans(i,j))
80 & *recip_rA(i,j,bi,bj)*recip_drC(k)
81 rCenter = 0.5 _d 0 *rTrans(i,j)*recip_rA(i,j,bi,bj)*rkSign
82 rUpwind = ABS(rCenter)
83 & * ( 1. _d 0 - rLimit )
84 c & * ( 1. _d 0 - rLimit*( 1. _d 0 + w_CFL ) )
85 a3d(i,j,k) = a3d(i,j,k)
86 & - (rCenter+rUpwind)*deltaTarg(k)
87 & *recip_hFac(i,j,k)*recip_drF(k)
88 b3d(i,j,k) = b3d(i,j,k)
89 & - (rCenter-rUpwind)*deltaTarg(k)
90 & *recip_hFac(i,j,k)*recip_drF(k)
91 b3d(i,j,k-1) = b3d(i,j,k-1)
92 & + (rCenter+rUpwind)*deltaTarg(k-1)
93 & *recip_hFac(i,j,k-1)*recip_drF(k-1)
94 c3d(i,j,k-1) = c3d(i,j,k-1)
95 & + (rCenter-rUpwind)*deltaTarg(k-1)
96 & *recip_hFac(i,j,k-1)*recip_drF(k-1)
97 ENDDO
98 ENDDO
99
100 C-- process interior interface only: end
101 ENDIF
102
103 RETURN
104 END

  ViewVC Help
Powered by ViewVC 1.1.22