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

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

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


Revision 1.4 - (show annotations) (download)
Wed Jun 22 00:27:47 2005 UTC (18 years, 10 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint57t_post, checkpoint57o_post, checkpoint58e_post, checkpoint57m_post, checkpoint57s_post, checkpoint57k_post, checkpoint57y_post, checkpoint57y_pre, checkpoint57v_post, checkpoint57r_post, checkpoint58, checkpoint58f_post, checkpoint57x_post, checkpoint57n_post, checkpoint58d_post, checkpoint58c_post, checkpoint57w_post, checkpoint57p_post, checkpint57u_post, checkpoint58a_post, checkpoint57q_post, checkpoint58g_post, checkpoint57z_post, checkpoint57j_post, checkpoint58b_post, checkpoint57l_post
Changes since 1.3: +6 -6 lines
"rkSign" replaces "-rkFac" (<- removed)

1 C $Header: /u/gcmpack/MITgcm/pkg/generic_advdiff/gad_c2_impl_r.F,v 1.3 2004/12/04 18:50:34 jmc Exp $
2 C $Name: $
3
4 #include "GAD_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: GAD_C2_IMPL_R
8 C !INTERFACE:
9 SUBROUTINE GAD_C2_IMPL_R(
10 I bi,bj,k, iMin,iMax,jMin,jMax,
11 I 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 centered second-order scheme The contribution of vertical
18 C transport at interface k is added to matrix lines k and k-1.
19
20 C !USES:
21 IMPLICIT NONE
22
23 C == Global variables ===
24 #include "SIZE.h"
25 #include "GRID.h"
26 #include "EEPARAMS.h"
27 #include "PARAMS.h"
28
29 C !INPUT/OUTPUT PARAMETERS:
30 C == Routine Arguments ==
31 C bi,bj :: tile indices
32 C k :: vertical level
33 C iMin,iMax :: computation domain
34 C jMin,jMax :: computation domain
35 C deltaTarg :: time step
36 C rTrans :: vertical volume transport
37 C a3d :: lower diagonal of the tridiagonal matrix
38 C b3d :: main diagonal of the tridiagonal matrix
39 C c3d :: upper diagonal of the tridiagonal matrix
40 C myThid :: thread number
41 INTEGER bi,bj,k
42 INTEGER iMin,iMax,jMin,jMax
43 _RL deltaTarg(Nr)
44 _RL rTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
45 _RL a3d (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
46 _RL b3d (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
47 _RL c3d (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
48 INTEGER myThid
49
50 C == Local Variables ==
51 C i,j :: loop indices
52 C rCenter :: centered contribution
53 INTEGER i,j
54 _RL rCenter
55 CEOP
56
57 C-- process interior interface only:
58 IF ( k.GT.1 .AND. k.LE.Nr ) THEN
59
60 C-- Add centered contribution
61 DO j=jMin,jMax
62 DO i=iMin,iMax
63 rCenter = 0.5 _d 0 *rTrans(i,j)*recip_rA(i,j,bi,bj)*rkSign
64 a3d(i,j,k) = a3d(i,j,k)
65 & - rCenter*deltaTarg(k)
66 & *recip_hFacC(i,j,k,bi,bj)*recip_drF(k)
67 b3d(i,j,k) = b3d(i,j,k)
68 & - rCenter*deltaTarg(k)
69 & *recip_hFacC(i,j,k,bi,bj)*recip_drF(k)
70 b3d(i,j,k-1) = b3d(i,j,k-1)
71 & + rCenter*deltaTarg(k-1)
72 & *recip_hFacC(i,j,k-1,bi,bj)*recip_drF(k-1)
73 c3d(i,j,k-1) = c3d(i,j,k-1)
74 & + rCenter*deltaTarg(k-1)
75 & *recip_hFacC(i,j,k-1,bi,bj)*recip_drF(k-1)
76 ENDDO
77 ENDDO
78
79 C-- process interior interface only: end
80 ENDIF
81
82 RETURN
83 END

  ViewVC Help
Powered by ViewVC 1.1.22