1 |
C $Header: /u/gcmpack/MITgcm/pkg/ptracers/ptracers_impldiff.F,v 1.1 2002/03/04 19:01:29 adcroft Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "PTRACERS_OPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
C !ROUTINE: PTRACERS_IMPLDIFF |
8 |
|
9 |
C !INTERFACE: ========================================================== |
10 |
SUBROUTINE PTRACERS_IMPLDIFF( bi,bj,KappaR,myThid ) |
11 |
|
12 |
C !DESCRIPTION: |
13 |
C Calls the implicit vertical diffusion routine for each passive |
14 |
C tracer. |
15 |
|
16 |
C !USES: =============================================================== |
17 |
IMPLICIT NONE |
18 |
#include "SIZE.h" |
19 |
#include "EEPARAMS.h" |
20 |
#include "PTRACERS.h" |
21 |
#include "PARAMS.h" |
22 |
#include "GRID.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 :: tile indices |
30 |
C KappaR :: vertical diffusion coefficient |
31 |
C myThid :: thread number |
32 |
INTEGER bi,bj |
33 |
_RL KappaR(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
34 |
INTEGER myThid |
35 |
|
36 |
C !OUTPUT PARAMETERS: ================================================== |
37 |
C none |
38 |
|
39 |
#ifdef ALLOW_PTRACERS |
40 |
|
41 |
C !LOCAL VARIABLES: ==================================================== |
42 |
C iTracer :: tracer index |
43 |
INTEGER iTracer |
44 |
INTEGER iMin,iMax,jMin,jMax |
45 |
CEOP |
46 |
|
47 |
iMin=0 |
48 |
iMax=sNx+1 |
49 |
jMin=0 |
50 |
jMax=sNy+1 |
51 |
|
52 |
C Loop over tracers |
53 |
DO iTracer=1,PTRACERS_numInUse |
54 |
|
55 |
#ifdef ALLOW_AUTODIFF_TAMC |
56 |
act0 = iTracer - 1 |
57 |
max0 = NUMBER_OF_PTRACERS |
58 |
act1 = bi - myBxLo(myThid) |
59 |
max1 = myBxHi(myThid) - myBxLo(myThid) + 1 |
60 |
act2 = bj - myByLo(myThid) |
61 |
max2 = myByHi(myThid) - myByLo(myThid) + 1 |
62 |
act3 = myThid - 1 |
63 |
max3 = nTx*nTy |
64 |
act4 = ikey_dynamics - 1 |
65 |
iptrkey = (act0 + 1) |
66 |
& + act1*max0 |
67 |
& + act2*max0*max1 |
68 |
& + act3*max0*max1*max2 |
69 |
& + act4*max0*max1*max2*max3 |
70 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
71 |
|
72 |
#ifdef ALLOW_AUTODIFF_TAMC |
73 |
CADJ STORE gPtr(:,:,:,bi,bj,iTracer) = comlev1_bibj_ptracers, |
74 |
CADJ & key=iptrkey, byte=isbyte |
75 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
76 |
|
77 |
CALL IMPLDIFF( |
78 |
I bi, bj, iMin, iMax, jMin, jMax, |
79 |
I deltaTtracer, KappaR, recip_HFacC, |
80 |
U gPtr(1-Olx,1-Oly,1,bi,bj,iTracer), |
81 |
I myThid ) |
82 |
|
83 |
C End of tracer loop |
84 |
ENDDO |
85 |
|
86 |
#endif /* ALLOW_PTRACERS */ |
87 |
|
88 |
RETURN |
89 |
END |