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

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

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


Revision 1.2 - (hide annotations) (download)
Mon Nov 29 03:34:55 2004 UTC (19 years, 6 months ago) by mlosch
Branch: MAIN
CVS Tags: checkpoint58l_post, checkpoint57t_post, checkpoint57o_post, checkpoint58e_post, checkpoint57v_post, checkpoint58u_post, checkpoint58w_post, checkpoint57m_post, checkpoint57s_post, checkpoint57k_post, checkpoint57d_post, checkpoint57g_post, checkpoint57b_post, checkpoint57c_pre, checkpoint58r_post, checkpoint56b_post, checkpoint57i_post, checkpoint57y_post, checkpoint57e_post, checkpoint58n_post, checkpoint58x_post, checkpoint57g_pre, checkpoint58t_post, checkpoint58h_post, checkpoint56c_post, checkpoint57y_pre, checkpoint57f_pre, checkpoint57a_post, checkpoint58q_post, checkpoint58j_post, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint59c, checkpoint59b, checkpoint59i, checkpoint59h, checkpoint57r_post, checkpoint59, checkpoint58, checkpoint57a_pre, checkpoint57, eckpoint57e_pre, checkpoint57h_done, checkpoint58f_post, checkpoint57x_post, checkpoint57n_post, checkpoint58d_post, checkpoint58c_post, checkpoint57w_post, checkpoint57p_post, checkpint57u_post, checkpoint57f_post, checkpoint58a_post, checkpoint58i_post, checkpoint57q_post, checkpoint58g_post, checkpoint58o_post, checkpoint57z_post, checkpoint57c_post, checkpoint58y_post, checkpoint58k_post, checkpoint58v_post, checkpoint58s_post, checkpoint58p_post, checkpoint57j_post, checkpoint58b_post, checkpoint57h_pre, checkpoint58m_post, checkpoint57l_post, checkpoint57h_post
Changes since 1.1: +8 -53 lines
o remove obsolete files
o remove unnecessary comments

1 mlosch 1.2 C $Header: /u/gcmpack/MITgcm/pkg/gchem/gchem_calc_tendency.F,v 1.1 2004/11/28 23:48:30 mlosch Exp $
2 mlosch 1.1 C $Name: $
3    
4     #include "GCHEM_OPTIONS.h"
5    
6     CBOP
7     C !ROUTINE: GCHEM_CALC_TENDENCY
8    
9     C !INTERFACE: ==========================================================
10     SUBROUTINE GCHEM_CALC_TENDENCY(
11     I myTime, myIter, myThid )
12    
13     C !DESCRIPTION:
14     C In the case of GCHEM_SEPARATE_FORCING not defined,
15     C this subroutine computes the tracer tendencies due to a
16     C bio-geogchemistry or ecosystem model and stores them on an array
17     C gchemTendency, that will be incorporated into regular timestepping in
18     C in ptracers_intergrate.F
19     C The current example uses the CFC package, but his is meant to
20     C be replaced by anything that the user provides.
21    
22     C !USES: ===============================================================
23     IMPLICIT NONE
24     #include "SIZE.h"
25     #include "GRID.h"
26     #include "DYNVARS.h"
27     #include "EEPARAMS.h"
28     #include "PARAMS.h"
29     #include "PTRACERS_SIZE.h"
30     #include "PTRACERS.h"
31     #include "GCHEM.h"
32     #include "GCHEM_FIELDS.h"
33    
34     C !INPUT PARAMETERS: ===================================================
35     C myThid :: thread number
36     C myIter :: current timestep
37     C myTime :: current time
38     INTEGER myThid, myIter
39     _RL myTime
40    
41     #ifdef ALLOW_GCHEM
42     # ifndef GCHEM_SEPARATE_FORCING
43     C !LOCAL VARIABLES: ====================================================
44     C i,j :: loop indices
45     C iTracer :: ptracer number
46     C bi,bj :: tile indices
47     C k :: vertical level
48     INTEGER i,j
49     INTEGER niter
50     INTEGER iTracer
51     INTEGER bi,bj,imin,imax,jmin,jmax,k
52     #ifdef ALLOW_CFC
53     INTEGER kLoc
54     _RL PtrLoc(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr)
55     _RL gPtrLoc(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr)
56     #endif /* ALLOW_CFC */
57     CEOP
58    
59     C gchemTendency is re-initialized here
60     DO iTracer = 1, PTRACERS_numInUse
61     DO bj=myByLo(myThid),myByHi(myThid)
62     DO bi=myBxLo(myThid),myBxHi(myThid)
63     DO K = 1, Nr
64     DO J = 1-Oly, sNy+Oly
65     DO I = 1-Olx, sNx+Olx
66     gchemTendency(I,J,K,bi,bj,iTracer) = 0. _d 0
67     ENDDO
68     ENDDO
69     ENDDO
70     ENDDO
71     ENDDO
72     ENDDO
73     C
74     C Here is the place for code to compute bio-geochemical
75     C tendency terms (sometimes referred to as source-minus-sink
76     C terms). The tendencies are stored on gchemTendency, as show
77     C in the CFC-example.
78     C
79     C loop over tiles
80     DO bj=myByLo(myThid),myByHi(myThid)
81     DO bi=myBxLo(myThid),myBxHi(myThid)
82     C define horizontal loop ranges
83     iMin = 1
84     iMax = sNx
85     jMin = 1
86     jMax = sNy
87     C DO iTracer = 1, PTRACER_NumInUse
88     C DO K = 1, Nr
89     C DO J = 1-Oly, sNy+Oly
90     C DO I = 1-Olx, sNx+Olx
91     C gchemTendency(I,J,K,bi,bj,iTracer) = your specific model
92     C ENDDO
93     C ENDDO
94     C ENDDO
95     C ENDDO
96    
97     #ifdef ALLOW_CFC
98     ccccccccccccccccccccccccc
99     c chemical forcing c
100     ccccccccccccccccccccccccc
101     ccccccccccccccccccccccccccc CFC cccccccccccccccccccccccccccccccc
102     c
103     K = 1
104 mlosch 1.2 CALL CFC11_FORCING( Ptracer (1-Olx,1-Oly,1,bi,bj,1),
105     & gchemTendency(1-Olx,1-Oly,1,bi,bj,1),
106     & bi, bj, imin, imax, jmin, jmax,
107     & myIter, myTime, myThid )
108 mlosch 1.1 CALL CFC12_FORCING( Ptracer (1-Olx,1-Oly,1,bi,bj,2),
109 mlosch 1.2 & gchemTendency(1-Olx,1-Oly,1,bi,bj,2),
110     & bi, bj, imin, imax, jmin, jmax,
111     & myIter, myTime, myThid )
112 mlosch 1.1
113     cccccccccccccccccccccccccc END CFC cccccccccccccccccccccccccccccccccc
114     #endif /* ALLOW_CFC */
115     C end of tile-loops
116     ENDDO
117     ENDDO
118     # endif /* GCHEM_SEPARATE_FORCING */
119     #endif /* ALLOW_GCHEM */
120    
121     RETURN
122     END

  ViewVC Help
Powered by ViewVC 1.1.22