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