1 |
mlosch |
1.8 |
C $Header: /u/gcmpack/MITgcm/pkg/ptracers/ptracers_forcing.F,v 1.7 2004/11/23 20:21:14 mlosch Exp $ |
2 |
heimbach |
1.2 |
C $Name: $ |
3 |
adcroft |
1.1 |
|
4 |
|
|
#include "PTRACERS_OPTIONS.h" |
5 |
|
|
|
6 |
|
|
CBOP |
7 |
|
|
C !ROUTINE: PTRACERS_FORCING |
8 |
|
|
|
9 |
|
|
C !INTERFACE: ========================================================== |
10 |
|
|
SUBROUTINE PTRACERS_FORCING( |
11 |
mlosch |
1.7 |
I bi,bj,iMin,iMax,jMin,jMax,k,iTracer, |
12 |
heimbach |
1.5 |
U gPtracer,surfPtracer, |
13 |
adcroft |
1.1 |
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 |
jmc |
1.6 |
c #include "FFIELDS.h" |
24 |
|
|
c #include "DYNVARS.h" |
25 |
adcroft |
1.1 |
#include "GRID.h" |
26 |
|
|
|
27 |
|
|
C !INPUT PARAMETERS: =================================================== |
28 |
|
|
C bi,bj :: tile indices |
29 |
dimitri |
1.4 |
C iMin iMax jMin jMax :: working range of tile for applying forcing |
30 |
adcroft |
1.1 |
C k :: vertical level number |
31 |
mlosch |
1.7 |
C iTracer :: tracer number |
32 |
adcroft |
1.1 |
C gPtracer :: the tendancy array |
33 |
|
|
C myIter :: time-step number |
34 |
|
|
C myTime :: model time |
35 |
|
|
C myThid :: thread number |
36 |
mlosch |
1.7 |
INTEGER bi,bj,iMin,iMax,jMin,jMax,k,iTracer |
37 |
adcroft |
1.1 |
_RL gPtracer(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr,nSx,nSy) |
38 |
heimbach |
1.5 |
_RL surfPtracer(1-Olx:sNx+Olx,1-Oly:sNy+Oly,nSx,nSy) |
39 |
adcroft |
1.1 |
INTEGER myIter |
40 |
|
|
_RL myTime |
41 |
|
|
INTEGER myThid |
42 |
|
|
|
43 |
|
|
C !OUTPUT PARAMETERS: ================================================== |
44 |
|
|
C gPtracer :: updates tendancy array |
45 |
|
|
|
46 |
|
|
#ifdef ALLOW_PTRACERS |
47 |
|
|
|
48 |
|
|
C !LOCAL VARIABLES: ==================================================== |
49 |
|
|
C i,j :: loop indices |
50 |
|
|
INTEGER i,j |
51 |
dimitri |
1.4 |
C number of surface interface layer |
52 |
|
|
INTEGER kSurface |
53 |
adcroft |
1.1 |
CEOP |
54 |
|
|
|
55 |
dimitri |
1.4 |
if ( buoyancyRelation .eq. 'OCEANICP' ) then |
56 |
|
|
kSurface = Nr |
57 |
|
|
else |
58 |
|
|
kSurface = 1 |
59 |
|
|
endif |
60 |
|
|
|
61 |
jmc |
1.6 |
C-- Surface forcing term is surfaceForcingPtr, previously computed |
62 |
dimitri |
1.4 |
C by PTRACERS_FORCING because it is needed by KPP_TRANSPORT_PTR. |
63 |
|
|
|
64 |
mlosch |
1.7 |
#ifdef ALLOW_GCHEM |
65 |
|
|
IF ( useGCHEM ) |
66 |
mlosch |
1.8 |
& CALL GCHEM_ADD_TENDENCY( |
67 |
mlosch |
1.7 |
I bi,bj,iMin,iMax,jMin,jMax,k, |
68 |
|
|
I iTracer, |
69 |
|
|
I myTime,myIter, myThid) |
70 |
|
|
#else /* ALLOW_GCHEM */ |
71 |
mlosch |
1.8 |
IF ( .NOT. useGCHEM .AND. k .EQ. kSurface ) THEN |
72 |
dimitri |
1.4 |
DO j=jMin,jMax |
73 |
|
|
DO i=iMin,iMax |
74 |
jmc |
1.6 |
gPtracer(i,j,k,bi,bj) = gPtracer(i,j,k,bi,bj) |
75 |
|
|
& + surfPtracer(i,j,bi,bj) |
76 |
|
|
& *recip_drF(k)*recip_hFacC(i,j,k,bi,bj) |
77 |
adcroft |
1.1 |
ENDDO |
78 |
|
|
ENDDO |
79 |
|
|
ENDIF |
80 |
mlosch |
1.7 |
#endif /* ALLOW_GCHEM */ |
81 |
adcroft |
1.1 |
|
82 |
|
|
#endif /* ALLOW_PTRACERS */ |
83 |
|
|
|
84 |
|
|
RETURN |
85 |
|
|
END |