1 |
C $Header: /u/gcmpack/MITgcm/pkg/ptracers/ptracers_convect.F,v 1.6 2011/01/18 19:37:41 heimbach Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "PTRACERS_OPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
C !ROUTINE: PTRACERS_CONVECT |
8 |
|
9 |
C !INTERFACE: ========================================================== |
10 |
SUBROUTINE PTRACERS_CONVECT( bi,bj,k,weightA,weightB,myThid ) |
11 |
|
12 |
C !DESCRIPTION: |
13 |
C do passive tracers convection |
14 |
|
15 |
C !USES: =============================================================== |
16 |
IMPLICIT NONE |
17 |
#include "SIZE.h" |
18 |
#include "EEPARAMS.h" |
19 |
#include "PTRACERS_SIZE.h" |
20 |
#include "PTRACERS_PARAMS.h" |
21 |
#include "PTRACERS_START.h" |
22 |
#include "PTRACERS_FIELDS.h" |
23 |
#ifdef ALLOW_AUTODIFF_TAMC |
24 |
# include "tamc.h" |
25 |
# include "tamc_keys.h" |
26 |
#endif |
27 |
|
28 |
C !INPUT PARAMETERS: =================================================== |
29 |
C bi,bj,k :: tile indices |
30 |
C weightA :: weight for level K-1 |
31 |
C weightB :: weight for level K |
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 |
INTEGER myThid |
37 |
|
38 |
C !OUTPUT PARAMETERS: ================================================== |
39 |
C none |
40 |
|
41 |
#ifdef ALLOW_PTRACERS |
42 |
|
43 |
C !LOCAL VARIABLES: ==================================================== |
44 |
C iTracer :: tracer index |
45 |
INTEGER iTracer |
46 |
CEOP |
47 |
|
48 |
C Loop over tracers |
49 |
DO iTracer=1,PTRACERS_numInUse |
50 |
IF ( PTRACERS_StepFwd(iTracer) ) THEN |
51 |
|
52 |
#ifdef ALLOW_AUTODIFF_TAMC |
53 |
act0 = iTracer - 1 |
54 |
max0 = PTRACERS_num |
55 |
act1 = bi - myBxLo(myThid) |
56 |
max1 = myBxHi(myThid) - myBxLo(myThid) + 1 |
57 |
act2 = bj - myByLo(myThid) |
58 |
max2 = myByHi(myThid) - myByLo(myThid) + 1 |
59 |
act3 = myThid - 1 |
60 |
max3 = nTx*nTy |
61 |
act4 = ikey_dynamics - 1 |
62 |
iptrkey = (act0 + 1) |
63 |
& + act1*max0 |
64 |
& + act2*max0*max1 |
65 |
& + act3*max0*max1*max2 |
66 |
& + act4*max0*max1*max2*max3 |
67 |
kkey = (iptrkey-1)*Nr + k |
68 |
CADJ STORE pTracer(:,:,k,bi,bj,iTracer) |
69 |
CADJ & = comlev1_bibj_k_ptracers, key=kkey, byte=isbyte |
70 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
71 |
|
72 |
CALL CONVECTIVELY_MIXTRACER( |
73 |
I bi,bj,k,weightA,weightB, |
74 |
U pTracer(1-OLx,1-OLy,1,1,1,iTracer), |
75 |
I myThid ) |
76 |
|
77 |
C End of tracer loop |
78 |
ENDIF |
79 |
ENDDO |
80 |
|
81 |
#endif /* ALLOW_PTRACERS */ |
82 |
|
83 |
RETURN |
84 |
END |