/[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.6 - (show annotations) (download)
Thu Dec 1 14:14:43 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.5: +27 -25 lines
add argument recip_hFac to use in place of recip_hFacC

1 C $Header: /u/gcmpack/MITgcm/pkg/generic_advdiff/gad_c2_impl_r.F,v 1.5 2006/06/07 01:55:14 heimbach 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, 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 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 recip_hFac :: inverse of cell open-depth factor
38 C a3d :: lower diagonal of the tridiagonal matrix
39 C b3d :: main diagonal of the tridiagonal matrix
40 C c3d :: upper diagonal of the tridiagonal matrix
41 C myThid :: thread number
42 INTEGER bi,bj,k
43 INTEGER iMin,iMax,jMin,jMax
44 _RL deltaTarg(Nr)
45 _RL rTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
46 _RS recip_hFac(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
47 _RL a3d (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
48 _RL b3d (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
49 _RL c3d (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
50 INTEGER myThid
51
52 C == Local Variables ==
53 C i,j :: loop indices
54 C rCenter :: centered contribution
55 INTEGER i,j
56 _RL rCenter
57 CEOP
58
59 C-- process interior interface only:
60 IF ( k.GT.1 .AND. k.LE.Nr ) THEN
61
62 C-- Add centered contribution
63 DO j=jMin,jMax
64 DO i=iMin,iMax
65 rCenter = 0.5 _d 0 *rTrans(i,j)*recip_rA(i,j,bi,bj)*rkSign
66 a3d(i,j,k) = a3d(i,j,k)
67 & - rCenter*deltaTarg(k)
68 & *recip_hFac(i,j,k)*recip_drF(k)
69 b3d(i,j,k) = b3d(i,j,k)
70 & - rCenter*deltaTarg(k)
71 & *recip_hFac(i,j,k)*recip_drF(k)
72 b3d(i,j,k-1) = b3d(i,j,k-1)
73 & + rCenter*deltaTarg(k-1)
74 & *recip_hFac(i,j,k-1)*recip_drF(k-1)
75 c3d(i,j,k-1) = c3d(i,j,k-1)
76 & + rCenter*deltaTarg(k-1)
77 & *recip_hFac(i,j,k-1)*recip_drF(k-1)
78 ENDDO
79 ENDDO
80
81 C-- process interior interface only: end
82 ENDIF
83
84 RETURN
85 END

  ViewVC Help
Powered by ViewVC 1.1.22