1 |
C $Header: /u/gcmpack/MITgcm/pkg/ptracers/ptracers_forcing.F,v 1.12 2007/05/14 19:08:22 dfer Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "PTRACERS_OPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
C !ROUTINE: PTRACERS_FORCING |
8 |
|
9 |
C !INTERFACE: ========================================================== |
10 |
SUBROUTINE PTRACERS_FORCING( |
11 |
I bi,bj,iMin,iMax,jMin,jMax,k,iTracer, |
12 |
U gPtracer,surfPtracer, |
13 |
I myIter,myTime,myThid ) |
14 |
|
15 |
C !DESCRIPTION: |
16 |
C Adds sources and sinks of passive tracers to the tendency arrays |
17 |
|
18 |
C !USES: =============================================================== |
19 |
IMPLICIT NONE |
20 |
#include "SIZE.h" |
21 |
#include "EEPARAMS.h" |
22 |
#include "PARAMS.h" |
23 |
c #include "FFIELDS.h" |
24 |
c #include "DYNVARS.h" |
25 |
#include "GRID.h" |
26 |
#ifdef ALLOW_RBCS |
27 |
#include "PTRACERS_SIZE.h" |
28 |
#include "RBCS.h" |
29 |
#endif |
30 |
|
31 |
C !INPUT PARAMETERS: =================================================== |
32 |
C bi,bj :: tile indices |
33 |
C iMin iMax jMin jMax :: working range of tile for applying forcing |
34 |
C k :: vertical level number |
35 |
C iTracer :: tracer number |
36 |
C gPtracer :: the tendency array |
37 |
C surfPtracer :: surface forcing term |
38 |
C myIter :: time-step number |
39 |
C myTime :: model time |
40 |
C myThid :: thread number |
41 |
INTEGER bi,bj,iMin,iMax,jMin,jMax,k,iTracer |
42 |
_RL gPtracer(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr,nSx,nSy) |
43 |
_RL surfPtracer(1-Olx:sNx+Olx,1-Oly:sNy+Oly,nSx,nSy) |
44 |
INTEGER myIter |
45 |
_RL myTime |
46 |
INTEGER myThid |
47 |
|
48 |
C !OUTPUT PARAMETERS: ================================================== |
49 |
C gPtracer :: updates tendency array |
50 |
|
51 |
#ifdef ALLOW_PTRACERS |
52 |
|
53 |
C !LOCAL VARIABLES: ==================================================== |
54 |
C i,j :: loop indices |
55 |
INTEGER i,j |
56 |
C number of surface interface layer |
57 |
INTEGER kSurface |
58 |
CEOP |
59 |
|
60 |
IF ( usingPCoords ) THEN |
61 |
kSurface = Nr |
62 |
ELSE |
63 |
kSurface = 1 |
64 |
ENDIF |
65 |
|
66 |
C-- Surface forcing term surfPtracer is previously computed by |
67 |
C PTRACERS_FORCING_SURF (and stored as surfaceForcingPtr) |
68 |
C because it is needed by KPP_TRANSPORT_PTR. |
69 |
|
70 |
#ifdef ALLOW_GCHEM |
71 |
IF ( useGCHEM ) |
72 |
& CALL GCHEM_ADD_TENDENCY( |
73 |
I bi,bj,iMin,iMax,jMin,jMax,k, |
74 |
I iTracer, |
75 |
I myTime,myIter, myThid) |
76 |
#endif /* ALLOW_GCHEM */ |
77 |
|
78 |
IF ( k .EQ. kSurface ) THEN |
79 |
DO j=jMin,jMax |
80 |
DO i=iMin,iMax |
81 |
gPtracer(i,j,k,bi,bj) = gPtracer(i,j,k,bi,bj) |
82 |
& + surfPtracer(i,j,bi,bj) |
83 |
& *recip_drF(k)*recip_hFacC(i,j,k,bi,bj) |
84 |
ENDDO |
85 |
ENDDO |
86 |
ENDIF |
87 |
|
88 |
#ifdef ALLOW_RBCS |
89 |
if (useRBCptracers) then |
90 |
CALL RBCS_ADD_TENDENCY(bi,bj,k,iTracer+2, |
91 |
I myTime, myThid) |
92 |
endif |
93 |
#endif |
94 |
|
95 |
|
96 |
#endif /* ALLOW_PTRACERS */ |
97 |
|
98 |
RETURN |
99 |
END |