/[MITgcm]/MITgcm/pkg/gchem/gchem_add_tendency.F
ViewVC logotype

Annotation of /MITgcm/pkg/gchem/gchem_add_tendency.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Sun Nov 28 23:48:31 2004 UTC (19 years, 6 months ago) by mlosch
Branch: MAIN
CVS Tags: checkpoint56a_post
o GCHEM: finish reorganizating the package
  - forward_step calls GCHEM_CALC_TENDENDY, which computes gchemTendency
    (introduces another 3D-array for each passive tracer, but only if
    GCHEM_SEPARATE_FORCING is undefined. For GCHEM_SEPARATE_FORCING
    gchemTendency is not needed because the timestep is done separately)
  - gchemTendency is added to gPtr in GCHEM_FORCING_INT
  - GCHEM is now---more or less cleanly---separate from PTRACERS
  - to bo done: handling of surfaceForcingPtr that is needed for KPP not
    so clear to me how that should be done in a general way.

1 mlosch 1.1 C $Header: $
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.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     CML We will keep the old way of calling CFC??_FORCING for now, but eventually
64     CML this can be deleted.
65     CML# ifdef ALLOW_CFC
66     CMLccccccccccccccccccccccccc
67     CMLc chemical forcing c
68     CMLccccccccccccccccccccccccc
69     CMLccccccccccccccccccccccccccc CFC cccccccccccccccccccccccccccccccc
70     CMLc
71     CML IF (iTracer.EQ.1.AND.k.EQ.1) THEN
72     CML & call CFC11_Forcing( Ptracer(1-Olx,1-Oly,1,bi,bj,1),
73     CML & gPtr(1-Olx,1-Oly,1,bi,bj,1),
74     CML & bi,bj,imin,imax,jmin,jmax,
75     CML & myIter,myTime,myThid)
76     CML IF (iTracer.EQ.2.AND.k.EQ.1)
77     CML & call CFC12_Forcing( Ptracer(1-Olx,1-Oly,1,bi,bj,2),
78     CML & gPtr(1-Olx,1-Oly,1,bi,bj,2),
79     CML & bi,bj,imin,imax,jmin,jmax,
80     CML & myIter,myTime,myThid)
81     CMLcccccccccccccccccccccccccc END CFC cccccccccccccccccccccccccccccccccc
82     CMLc
83     CML# endif /* ALLOW_CFC */
84     # endif /* GCHEM_SEPARATE_FORCING */
85     #endif /* ALLOW_GCHEM */
86    
87     RETURN
88     END

  ViewVC Help
Powered by ViewVC 1.1.22