/[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.2 - (show annotations) (download)
Wed Jun 7 01:55:14 2006 UTC (18 years ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint58l_post, mitgcm_mapl_00, checkpoint58u_post, checkpoint58w_post, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint60, checkpoint61, checkpoint62, checkpoint63, checkpoint58r_post, checkpoint58n_post, checkpoint58x_post, checkpoint58t_post, checkpoint58h_post, checkpoint58q_post, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint58j_post, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint59c, checkpoint59b, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59h, checkpoint59k, checkpoint59j, checkpoint59, checkpoint58i_post, checkpoint58o_post, checkpoint62c, checkpoint62b, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint58y_post, checkpoint58k_post, checkpoint58v_post, checkpoint58s_post, checkpoint61f, checkpoint61g, checkpoint61d, checkpoint61e, checkpoint61b, checkpoint61c, checkpoint58p_post, checkpoint61a, checkpoint61n, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61q, checkpoint61z, checkpoint61x, checkpoint61y, checkpoint58m_post
Changes since 1.1: +5 -5 lines
Modifications for bottom topography control
o replace hFacC by _hFacC at various places
o replace ALLOW_HFACC_CONTROL by ALLOW_DEPTH_CONTROL
o add non-self-adjoint cg2d_nsa
o update autodiff support routines
o re-initialise hfac after ctrl_depth_ini
o works for 5x5 box, doesnt work for global_ocean.90x40x15

1 C $Header: /u/gcmpack/MITgcm/pkg/generic_advdiff/gad_dst2u1_impl_r.F,v 1.1 2005/10/22 20:17:44 jmc 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,
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 a3d :: lower diagonal of the tridiagonal matrix
41 C b3d :: main diagonal of the tridiagonal matrix
42 C c3d :: upper diagonal of the tridiagonal matrix
43 C myThid :: thread number
44 INTEGER bi,bj,k
45 INTEGER iMin,iMax,jMin,jMax
46 INTEGER advectionScheme
47 _RL deltaTarg(Nr)
48 _RL rTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
49 _RL a3d (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
50 _RL b3d (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
51 _RL c3d (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
52 INTEGER myThid
53
54 C == Local Variables ==
55 C i,j :: loop indices
56 C w_CFL :: Courant-Friedrich-Levy number
57 C rLimit :: centered (vs upwind) fraction
58 C rCenter :: centered contribution
59 C rUpwind :: upwind contribution
60 INTEGER i,j
61 _RL w_CFL, rLimit
62 _RL rCenter, rUpwind
63 _RL deltaTcfl
64
65 CEOP
66
67 rLimit = 0. _d 0
68 IF ( advectionScheme.EQ.ENUM_DST2 ) rLimit = 1. _d 0
69
70 C-- process interior interface only:
71 IF ( k.GT.1 .AND. k.LE.Nr ) THEN
72
73 C-- Add centered & upwind contributions
74 deltaTcfl = deltaTarg(k)
75 DO j=jMin,jMax
76 DO i=iMin,iMax
77 w_CFL = deltaTcfl*ABS(rTrans(i,j))
78 & *recip_rA(i,j,bi,bj)*recip_drC(k)
79 rCenter = 0.5 _d 0 *rTrans(i,j)*recip_rA(i,j,bi,bj)*rkSign
80 rUpwind = ABS(rCenter)
81 & * ( 1. _d 0 - rLimit )
82 c & * ( 1. _d 0 - rLimit*( 1. _d 0 + w_CFL ) )
83 a3d(i,j,k) = a3d(i,j,k)
84 & - (rCenter+rUpwind)*deltaTarg(k)
85 & *_recip_hFacC(i,j,k,bi,bj)*recip_drF(k)
86 b3d(i,j,k) = b3d(i,j,k)
87 & - (rCenter-rUpwind)*deltaTarg(k)
88 & *_recip_hFacC(i,j,k,bi,bj)*recip_drF(k)
89 b3d(i,j,k-1) = b3d(i,j,k-1)
90 & + (rCenter+rUpwind)*deltaTarg(k-1)
91 & *_recip_hFacC(i,j,k-1,bi,bj)*recip_drF(k-1)
92 c3d(i,j,k-1) = c3d(i,j,k-1)
93 & + (rCenter-rUpwind)*deltaTarg(k-1)
94 & *_recip_hFacC(i,j,k-1,bi,bj)*recip_drF(k-1)
95 ENDDO
96 ENDDO
97
98 C-- process interior interface only: end
99 ENDIF
100
101 RETURN
102 END

  ViewVC Help
Powered by ViewVC 1.1.22