1 |
C $Header: /u/gcmpack/MITgcm/pkg/gchem/gchem_add_tendency.F,v 1.2 2004/11/29 03:34:55 mlosch Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "GCHEM_OPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
C !ROUTINE: GCHEM_ADD_TENDENCY |
8 |
|
9 |
C !INTERFACE: ========================================================== |
10 |
SUBROUTINE GCHEM_ADD_TENDENCY(bi,bj,iMin,iMax,jMin,jMax,k, |
11 |
& iTracer, myTime,myIter, myThid ) |
12 |
|
13 |
C !DESCRIPTION: |
14 |
C In the case of GCHEM_SEPARATE_FORCING undefined, GCHEM_ADD_TENDENCY |
15 |
C will update passive tracer tendencies gPtr with gchemTendency, |
16 |
C the latter having been computed in GCHEM_CALC_TENDENDY, so that |
17 |
C they will be incorporated into regular timestepping in |
18 |
C PTRACERS_INTERGRATE. |
19 |
C IF GCHEM_SEPARATE_FORCING is defined, this routine is empty. |
20 |
|
21 |
C !USES: =============================================================== |
22 |
IMPLICIT NONE |
23 |
#include "SIZE.h" |
24 |
#include "GRID.h" |
25 |
#include "DYNVARS.h" |
26 |
#include "EEPARAMS.h" |
27 |
#include "PARAMS.h" |
28 |
#include "PTRACERS_SIZE.h" |
29 |
c#include "PTRACERS_PARAMS.h" |
30 |
#include "PTRACERS_FIELDS.h" |
31 |
#include "GCHEM_FIELDS.h" |
32 |
|
33 |
C !INPUT PARAMETERS: =================================================== |
34 |
C myThid :: thread number |
35 |
C myIter :: current timestep |
36 |
C myTime :: current time |
37 |
C iTracer :: ptracer number |
38 |
C bi,bj :: tile indices |
39 |
C k :: vertical level |
40 |
INTEGER myThid, myIter |
41 |
_RL myTime |
42 |
INTEGER iTracer |
43 |
INTEGER bi,bj,imin,imax,jmin,jmax,k |
44 |
|
45 |
C !LOCAL VARIABLES: ==================================================== |
46 |
C i,j :: loop indices |
47 |
INTEGER i,j |
48 |
INTEGER niter |
49 |
CEOP |
50 |
|
51 |
#ifdef ALLOW_GCHEM |
52 |
# ifndef GCHEM_SEPARATE_FORCING |
53 |
C apply the tendencies computed in GCHEM_CALC_TENDENCY to the passive |
54 |
C tracers tendendy terms. The part of the code could also go into |
55 |
C ptracers_forcing and replace the call to gchem_add_tendency there, |
56 |
C but this way, no gchem-related header files and CPP-flags are required |
57 |
C within ptracers_forcing. |
58 |
DO j=jMin,jMax |
59 |
DO i=iMin,iMax |
60 |
gPtr(I,J,K,bi,bj,iTracer) = gPtr(I,J,K,bi,bj,iTracer) |
61 |
& + gchemTendency(I,J,K,bi,bj,iTracer) |
62 |
ENDDO |
63 |
ENDDO |
64 |
# endif /* GCHEM_SEPARATE_FORCING */ |
65 |
#endif /* ALLOW_GCHEM */ |
66 |
|
67 |
RETURN |
68 |
END |