| 1 |
C $Header: /u/gcmpack/MITgcm_contrib/darwin/pkg/gchem/gchem_add_tendency.F,v 1.3 2008/06/02 16:18:06 jahn 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 |
#include "PTRACERS_FIELDS.h" |
| 30 |
#include "GCHEM_FIELDS.h" |
| 31 |
|
| 32 |
C !INPUT PARAMETERS: =================================================== |
| 33 |
C myThid :: thread number |
| 34 |
C myIter :: current timestep |
| 35 |
C myTime :: current time |
| 36 |
C iTracer :: ptracer number |
| 37 |
C bi,bj :: tile indices |
| 38 |
C k :: vertical level |
| 39 |
INTEGER myThid, myIter |
| 40 |
_RL myTime |
| 41 |
INTEGER iTracer |
| 42 |
INTEGER bi,bj,imin,imax,jmin,jmax,k |
| 43 |
|
| 44 |
C !LOCAL VARIABLES: ==================================================== |
| 45 |
C i,j :: loop indices |
| 46 |
INTEGER i,j |
| 47 |
INTEGER niter |
| 48 |
CEOP |
| 49 |
|
| 50 |
#ifdef ALLOW_GCHEM |
| 51 |
# ifndef GCHEM_SEPARATE_FORCING |
| 52 |
C apply the tendencies computed in GCHEM_CALC_TENDENCY to the passive |
| 53 |
C tracers tendendy terms. The part of the code could also go into |
| 54 |
C ptracers_forcing and replace the call to gchem_add_tendency there, |
| 55 |
C but this way, no gchem-related header files and CPP-flags are required |
| 56 |
C within ptracers_forcing. |
| 57 |
DO j=jMin,jMax |
| 58 |
DO i=iMin,iMax |
| 59 |
gPtr(I,J,K,bi,bj,iTracer) = gPtr(I,J,K,bi,bj,iTracer) |
| 60 |
& + gchemTendency(I,J,K,bi,bj,iTracer) |
| 61 |
ENDDO |
| 62 |
ENDDO |
| 63 |
# endif /* GCHEM_SEPARATE_FORCING */ |
| 64 |
#endif /* ALLOW_GCHEM */ |
| 65 |
|
| 66 |
RETURN |
| 67 |
END |