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