1 |
C $Header: /u/gcmpack/MITgcm/pkg/ptracers/ptracers_forcing.F,v 1.9 2005/12/08 00:14:26 stephd 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 tendancy 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 tendancy array |
37 |
C myIter :: time-step number |
38 |
C myTime :: model time |
39 |
C myThid :: thread number |
40 |
INTEGER bi,bj,iMin,iMax,jMin,jMax,k,iTracer |
41 |
_RL gPtracer(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr,nSx,nSy) |
42 |
_RL surfPtracer(1-Olx:sNx+Olx,1-Oly:sNy+Oly,nSx,nSy) |
43 |
INTEGER myIter |
44 |
_RL myTime |
45 |
INTEGER myThid |
46 |
|
47 |
C !OUTPUT PARAMETERS: ================================================== |
48 |
C gPtracer :: updates tendancy array |
49 |
|
50 |
#ifdef ALLOW_PTRACERS |
51 |
|
52 |
C !LOCAL VARIABLES: ==================================================== |
53 |
C i,j :: loop indices |
54 |
INTEGER i,j |
55 |
C number of surface interface layer |
56 |
INTEGER kSurface |
57 |
CEOP |
58 |
|
59 |
if ( buoyancyRelation .eq. 'OCEANICP' ) then |
60 |
kSurface = Nr |
61 |
else |
62 |
kSurface = 1 |
63 |
endif |
64 |
|
65 |
C-- Surface forcing term is surfaceForcingPtr, previously computed |
66 |
C by PTRACERS_FORCING because it is needed by KPP_TRANSPORT_PTR. |
67 |
|
68 |
#ifdef ALLOW_GCHEM |
69 |
IF ( useGCHEM ) |
70 |
& CALL GCHEM_ADD_TENDENCY( |
71 |
I bi,bj,iMin,iMax,jMin,jMax,k, |
72 |
I iTracer, |
73 |
I myTime,myIter, myThid) |
74 |
#else /* ALLOW_GCHEM */ |
75 |
IF ( .NOT. useGCHEM .AND. k .EQ. kSurface ) THEN |
76 |
DO j=jMin,jMax |
77 |
DO i=iMin,iMax |
78 |
gPtracer(i,j,k,bi,bj) = gPtracer(i,j,k,bi,bj) |
79 |
& + surfPtracer(i,j,bi,bj) |
80 |
& *recip_drF(k)*recip_hFacC(i,j,k,bi,bj) |
81 |
ENDDO |
82 |
ENDDO |
83 |
ENDIF |
84 |
#endif /* ALLOW_GCHEM */ |
85 |
|
86 |
#ifdef ALLOW_RBCS |
87 |
if (useRBCptracers) then |
88 |
CALL RBCS_ADD_TENDENCY(bi,bj,k,iTracer+2, |
89 |
I myTime, myThid) |
90 |
endif |
91 |
#endif |
92 |
|
93 |
|
94 |
#endif /* ALLOW_PTRACERS */ |
95 |
|
96 |
RETURN |
97 |
END |