1 |
C $Header: $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "CPP_OPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
C !ROUTINE: CONVECTIVELY_MIXTRACER |
8 |
C !INTERFACE: |
9 |
SUBROUTINE CONVECTIVELY_MIXTRACER( |
10 |
I bi,bj,k,weightA,weightB, |
11 |
U Tracer, |
12 |
I myThid) |
13 |
C !DESCRIPTION: |
14 |
C Mixes a tracer over two layers according to the weights pre-calculated |
15 |
C as a function of stability. |
16 |
C |
17 |
C Mixing is represented by: |
18 |
C T(k-1) = T(k-1) + B * ( T(k) - T(k-1) ) |
19 |
C T(k) = T(k) + A * ( T(k-1) - T(k) ) |
20 |
|
21 |
C !USES: |
22 |
IMPLICIT NONE |
23 |
C == Global data == |
24 |
#include "SIZE.h" |
25 |
#include "EEPARAMS.h" |
26 |
|
27 |
C !INPUT/OUTPUT PARAMETERS: |
28 |
C == Routine arguments == |
29 |
C bi,bj,k - indices |
30 |
C weightA - weight for level K |
31 |
C weightB - weight for level K+1 |
32 |
C myThid - thread number |
33 |
INTEGER bi,bj,k |
34 |
_RL weightA(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
35 |
_RL weightB(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
36 |
_RL Tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
37 |
INTEGER myThid |
38 |
|
39 |
#ifdef INCLUDE_CONVECT_CALL |
40 |
|
41 |
C !LOCAL VARIABLES: |
42 |
C == Local variables == |
43 |
C i,j :: Loop counter |
44 |
C delTrac :: Difference between tracer in each layer |
45 |
INTEGER i,j |
46 |
_RL delTrac |
47 |
CEOP |
48 |
|
49 |
DO j=1-Oly,sNy+Oly |
50 |
DO i=1-Olx,sNx+Olx |
51 |
|
52 |
delTrac=Tracer(i,j,k,bi,bj)-Tracer(i,j,k-1,bi,bj) |
53 |
Tracer(i,j,k-1,bi,bj)=Tracer(i,j,k-1,bi,bj) |
54 |
& +weightA(i,j)*delTrac |
55 |
Tracer(i,j,k,bi,bj)=Tracer(i,j,k,bi,bj) |
56 |
& -weightB(i,j)*delTrac |
57 |
|
58 |
ENDDO |
59 |
ENDDO |
60 |
|
61 |
#endif /* INCLUDE_CONVECT_CALL */ |
62 |
|
63 |
RETURN |
64 |
END |