1 |
C $Header: $ |
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: \bv |
16 |
C *==========================================================* |
17 |
C | S/R GAD_C2_IMPL_R |
18 |
C | o Compute matrix element to solve vertical advection |
19 |
C | implicitly using centered second-order scheme |
20 |
C *==========================================================* |
21 |
C | o contribution of vertical transport at interface k |
22 |
C | is added to matrix lines k & k-1 |
23 |
C *==========================================================* |
24 |
C \ev |
25 |
|
26 |
C !USES: |
27 |
IMPLICIT NONE |
28 |
|
29 |
C == Global variables === |
30 |
#include "SIZE.h" |
31 |
#include "GRID.h" |
32 |
#include "EEPARAMS.h" |
33 |
#include "PARAMS.h" |
34 |
|
35 |
C !INPUT/OUTPUT PARAMETERS: |
36 |
C == Routine Arguments == |
37 |
C bi,bj :: tile indices |
38 |
C k :: vertical level |
39 |
C iMin,iMax,jMin,jMax :: computation domain |
40 |
C deltaTarg :: time step |
41 |
C rTrans :: vertical volume transport |
42 |
C a3d :: lower diagonal of the tridiagonal matrix |
43 |
C b3d :: main diagonal of the tridiagonal matrix |
44 |
C c3d :: upper diagonal of the tridiagonal matrix |
45 |
C myThid :: thread number |
46 |
INTEGER bi,bj,k |
47 |
INTEGER iMin,iMax,jMin,jMax |
48 |
_RL deltaTarg |
49 |
_RL rTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
50 |
_RL a3d (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
51 |
_RL b3d (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
52 |
_RL c3d (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
53 |
INTEGER myThid |
54 |
|
55 |
C == Local Variables == |
56 |
C i,j :: loop indices |
57 |
C rCenter :: centered contribution |
58 |
INTEGER i,j |
59 |
_RL rCenter |
60 |
CEOP |
61 |
|
62 |
IF ( k.GT.Nr .OR. k.LT.2 ) RETURN |
63 |
|
64 |
C-- Add centered contribution |
65 |
DO j=jMin,jMax |
66 |
DO i=iMin,iMax |
67 |
rCenter = 0.5 _d 0 *deltaTarg*rTrans(i,j) |
68 |
& *recip_rA(i,j,bi,bj)*rkFac |
69 |
a3d(i,j,k) = a3d(i,j,k) |
70 |
& + rCenter |
71 |
& *recip_hFacC(i,j,k,bi,bj)*recip_drF(k) |
72 |
b3d(i,j,k) = b3d(i,j,k) |
73 |
& + rCenter |
74 |
& *recip_hFacC(i,j,k,bi,bj)*recip_drF(k) |
75 |
b3d(i,j,k-1) = b3d(i,j,k-1) |
76 |
& - rCenter |
77 |
& *recip_hFacC(i,j,k-1,bi,bj)*recip_drF(k-1) |
78 |
c3d(i,j,k-1) = c3d(i,j,k-1) |
79 |
& - rCenter |
80 |
& *recip_hFacC(i,j,k-1,bi,bj)*recip_drF(k-1) |
81 |
ENDDO |
82 |
ENDDO |
83 |
|
84 |
RETURN |
85 |
END |