/[MITgcm]/MITgcm_contrib/darwin2/pkg/monod/monod_cons.F
ViewVC logotype

Contents of /MITgcm_contrib/darwin2/pkg/monod/monod_cons.F

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


Revision 1.6 - (show annotations) (download)
Fri Jun 21 12:49:47 2013 UTC (12 years, 1 month ago) by jahn
Branch: MAIN
CVS Tags: ctrb_darwin2_ckpt64k_20130723, ctrb_darwin2_ckpt65w_20160512, ctrb_darwin2_ckpt65j_20150225, ctrb_darwin2_ckpt66g_20170424, ctrb_darwin2_ckpt66k_20171025, ctrb_darwin2_ckpt66n_20180118, ctrb_darwin2_ckpt65v_20160409, ctrb_darwin2_ckpt65s_20160114, ctrb_darwin2_ckpt65_20140718, ctrb_darwin2_ckpt64m_20130820, ctrb_darwin2_ckpt66d_20170214, ctrb_darwin2_ckpt64r_20131210, ctrb_darwin2_ckpt65m_20150615, ctrb_darwin2_ckpt65q_20151118, ctrb_darwin2_ckpt65o_20150914, ctrb_darwin2_ckpt65p_20151023, ctrb_darwin2_ckpt64n_20130826, ctrb_darwin2_ckpt65e_20140929, ctrb_darwin2_ckpt64o_20131024, ctrb_darwin2_ckpt64v_20140411, ctrb_darwin2_ckpt64z_20140711, ctrb_darwin2_ckpt65l_20150504, ctrb_darwin2_ckpt65z_20160929, ctrb_darwin2_ckpt65n_20150729, ctrb_darwin2_ckpt64y_20140622, ctrb_darwin2_ckpt65d_20140915, ctrb_darwin2_ckpt64t_20140202, ctrb_darwin2_ckpt66h_20170602, ctrb_darwin2_ckpt64i_20130622, ctrb_darwin2_ckpt64s_20140105, ctrb_darwin2_ckpt64x_20140524, ctrb_darwin2_ckpt65x_20160612, ctrb_darwin2_ckpt66f_20170407, ctrb_darwin2_ckpt65g_20141120, ctrb_darwin2_ckpt65k_20150402, ctrb_darwin2_ckpt64w_20140502, ctrb_darwin2_ckpt66a_20161020, ctrb_darwin2_ckpt64l_20130806, ctrb_darwin2_ckpt65f_20141014, ctrb_darwin2_ckpt66b_20161219, ctrb_darwin2_ckpt64u_20140308, ctrb_darwin2_ckpt64j_20130704, ctrb_darwin2_ckpt65i_20150123, ctrb_darwin2_ckpt66j_20170815, ctrb_darwin2_ckpt65y_20160801, ctrb_darwin2_ckpt66c_20170121, ctrb_darwin2_ckpt65a_20140728, ctrb_darwin2_ckpt65b_20140812, ctrb_darwin2_ckpt65t_20160221, ctrb_darwin2_ckpt64p_20131118, ctrb_darwin2_ckpt66o_20180209, ctrb_darwin2_ckpt66e_20170314, ctrb_darwin2_ckpt64q_20131118, ctrb_darwin2_ckpt64p_20131024, ctrb_darwin2_ckpt65u_20160315, ctrb_darwin2_ckpt65r_20151221, ctrb_darwin2_ckpt66i_20170718, ctrb_darwin2_ckpt65c_20140830, ctrb_darwin2_ckpt66l_20171025, ctrb_darwin2_ckpt65h_20141217, ctrb_darwin2_ckpt66m_20171213, HEAD
Changes since 1.5: +9 -9 lines
fix CHECK_CONS io units

1 C $Header: /u/gcmpack/MITgcm_contrib/darwin2/pkg/monod/monod_cons.F,v 1.5 2012/07/24 18:27:28 stephd Exp $
2 C $Name: $
3
4 #include "CPP_OPTIONS.h"
5 #include "PTRACERS_OPTIONS.h"
6 #include "DARWIN_OPTIONS.h"
7
8 #ifdef ALLOW_PTRACERS
9 #ifdef ALLOW_MONOD
10
11 c=============================================================
12 c subroutine MONOD_cons
13 c check conservation in the model
14 C==============================================================
15 SUBROUTINE MONOD_CONS(
16 & myTime,myIter,myThid)
17 #include "SIZE.h"
18 #include "EEPARAMS.h"
19 #include "PARAMS.h"
20 #include "GRID.h"
21 #include "PTRACERS_SIZE.h"
22 #include "PTRACERS_PARAMS.h"
23 #include "PTRACERS_FIELDS.h"
24 #include "GCHEM.h"
25 #include "MONOD_SIZE.h"
26 #include "MONOD.h"
27 #include "DARWIN_IO.h"
28 #include "DYNVARS.h"
29
30 C === Global variables ===
31 INTEGER myIter
32 _RL myTime
33 INTEGER myThid
34
35 #ifdef CHECK_CONS
36 C============== Local variables ============================================
37 _RL tmptotP
38 _RL tmptotN
39 _RL tmptotSi
40 _RL tmptotFe
41 #ifdef ALLOW_CARBON
42 _RL tmptotC
43 _RL tmptotA
44 _RL tmptotO
45 #endif
46 _RL vol, voltot
47
48 INTEGER i,j,k,bi,bj
49 INTEGER np, nz, npnum
50
51
52 c
53 tmptotP=0. _d 0
54 tmptotN=0. _d 0
55 tmptotFe=0. _d 0
56 tmptotSi=0. _d 0
57 #ifdef ALLOW_CARBON
58 tmptotC=0. _d 0
59 tmptotA=0. _d 0
60 tmptotO=0. _d 0
61 #endif
62 voltot=0. _d 0
63
64 DO bj=myByLo(myThid),myByHi(myThid)
65 DO bi=myBxLo(myThid),myBxHi(myThid)
66
67 DO i=1,sNx
68 DO j=1,sNy
69 do k= 1, NR
70 c-----------------------------------------------------------------
71 vol=rA(i,j,bi,bj)*drF(k)
72 voltot=voltot+vol
73 c Phosphorus budget
74 tmptotP=tmptotP+Ptracer(i,j,k,bi,bj,iPO4)*vol !PO4
75 tmptotP=tmptotP+Ptracer(i,j,k,bi,bj,iDOP)*vol !DOP
76 tmptotP=tmptotP+Ptracer(i,j,k,bi,bj,iPOP)*vol !POP
77 do nz=1,nzmax
78 tmptotP=tmptotP+Ptracer(i,j,k,bi,bj,iZooP(nz))*vol !ZOO1P
79 enddo
80 do np=1,npmax
81 npnum=iPhy+np-1
82 tmptotP=tmptotP+Ptracer(i,j,k,bi,bj,npnum)*vol !Phy
83 enddo
84 #ifdef ALLOW_CDOM
85 tmptotP=tmptotP+Ptracer(i,j,k,bi,bj,iCDOM)*vol !CDOM
86 #endif
87 c Nitrogen budget
88 tmptotN=tmptotN+Ptracer(i,j,k,bi,bj,iNO3)*vol !NO3
89 tmptotN=tmptotN+Ptracer(i,j,k,bi,bj,iNH4)*vol !NH4
90 tmptotN=tmptotN+Ptracer(i,j,k,bi,bj,iNO2)*vol !NO2
91 tmptotN=tmptotN+Ptracer(i,j,k,bi,bj,iDON)*vol !DON
92 tmptotN=tmptotN+Ptracer(i,j,k,bi,bj,iPON)*vol !PON
93 do nz=1,nzmax
94 tmptotN=tmptotN+Ptracer(i,j,k,bi,bj,iZooN(nz))*vol !ZOO1N
95 enddo
96 do np=1,npmax
97 npnum=iPhy+np-1
98 tmptotN=tmptotN+Ptracer(i,j,k,bi,bj,npnum)*R_NP(np)*vol !Phy
99 enddo
100 #ifdef ALLOW_CDOM
101 tmptotN=tmptotN+Ptracer(i,j,k,bi,bj,iCDOM)*rnp_cdom*vol !CDOM
102 #endif
103 c Iron budget
104 tmptotFe=tmptotFe+Ptracer(i,j,k,bi,bj,iFeT)*vol !Fet
105 tmptotFe=tmptotFe+Ptracer(i,j,k,bi,bj,iDOFe)*vol !DOFe
106 tmptotFe=tmptotFe+Ptracer(i,j,k,bi,bj,iPOFe)*vol !POFe
107 do nz=1,nzmax
108 tmptotFe=tmptotFe+Ptracer(i,j,k,bi,bj,iZooFe(nz))*vol !ZOO1Fe
109 enddo
110 do np=1,npmax
111 npnum=iPhy+np-1
112 tmptotFe=tmptotFe+Ptracer(i,j,k,bi,bj,npnum)*R_FeP(np)*vol !Phy
113 enddo
114 #ifdef ALLOW_CDOM
115 tmptotFe=tmptotFe+Ptracer(i,j,k,bi,bj,iCDOM)*rfep_cdom*vol !CDOM
116 #endif
117 c Silica budget
118 tmptotSi=tmptotSi+Ptracer(i,j,k,bi,bj,iSi)*vol !Si
119 tmptotSi=tmptotSi+Ptracer(i,j,k,bi,bj,iPOSi)*vol !POSi
120 do nz=1,nzmax
121 tmptotSi=tmptotSi+Ptracer(i,j,k,bi,bj,iZooSi(nz))*vol !ZOO1Si
122 enddo
123 do np=1,npmax
124 npnum=iPhy+np-1
125 tmptotSi=tmptotSi+Ptracer(i,j,k,bi,bj,npnum)*R_SiP(np)*vol !Phy
126 enddo
127 c------------------------------------------------------------
128 #ifdef ALLOW_CARBON
129 c carbon budget
130 tmptotC=tmptotC+Ptracer(i,j,k,bi,bj,iDIC)*vol !DIC
131 tmptotC=tmptotC+Ptracer(i,j,k,bi,bj,iDOC)*vol !DOC
132 tmptotC=tmptotC+Ptracer(i,j,k,bi,bj,iPOC)*vol !POC
133 tmptotC=tmptotC+Ptracer(i,j,k,bi,bj,iPIC)*vol !PIC
134 do nz=1,nzmax
135 tmptotC=tmptotC+Ptracer(i,j,k,bi,bj,iZooC(nz))*vol !ZOOC
136 enddo
137 do np=1,npmax
138 npnum=iPhy+np-1
139 tmptotC=tmptotC+Ptracer(i,j,k,bi,bj,npnum)*R_PC(np)*vol !Phy
140 enddo
141 #ifdef ALLOW_CDOM
142 tmptotC=tmptotC+Ptracer(i,j,k,bi,bj,iCDOM)*rcp_cdom*vol !CDOM
143 #endif
144 c alkalinity budget !!!!! NOT FULL BUDGET!!!!!
145 tmptotA=tmptotA+Ptracer(i,j,k,bi,bj,iALK)*vol !ALK
146 c oxygem budget !!!!!!!! NOT FULL BUDGET !!!!!!!!!!!
147 tmptotO=tmptotO+Ptracer(i,j,k,bi,bj,iO2)*vol !O2
148 #endif
149 enddo
150 ENDDO
151 ENDDO
152 ENDDO
153 ENDDO
154
155 _GLOBAL_SUM_RL(tmptotP,myThid)
156 _GLOBAL_SUM_RL(tmptotN,myThid)
157 _GLOBAL_SUM_RL(tmptotFe,myThid)
158 _GLOBAL_SUM_RL(tmptotSi,myThid)
159 _GLOBAL_SUM_RL(voltot,myThid)
160 #ifdef ALLOW_CARBON
161 _GLOBAL_SUM_RL(tmptotC,myThid)
162 _GLOBAL_SUM_RL(tmptotA,myThid)
163 _GLOBAL_SUM_RL(tmptotO,myThid)
164 #endif
165
166
167 c print*,'tmptotP',tmptotP
168 c print*,'tmptotN',tmptotN
169 c print*,'tmptotFe',tmptotFe
170 c print*,'tmptotSi',tmptotSi
171 #ifdef ALLOW_CARBON
172 c print*,'tmptotC',tmptotC
173 c print*,'tmptotA',tmptotA
174 c print*,'tmptotO',tmptotO
175 #endif
176
177 IF ( myProcId.EQ.0 .AND. myThid.EQ.1 ) THEN
178 write(DAR_cons_unitP,*), myIter, tmptotP, tmptotP/voltot
179 write(DAR_cons_unitN,*), myIter, tmptotN, tmptotN/voltot
180 write(DAR_cons_unitF,*), myIter, tmptotFe, tmptotFe/voltot
181 write(DAR_cons_unitS,*), myIter, tmptotSi, tmptotSi/voltot
182 #ifdef ALLOW_CARBON
183 write(DAR_cons_unitC,*), myIter, tmptotC, tmptotC/voltot
184 write(DAR_cons_unitA,*), myIter, tmptotA, tmptotA/voltot
185 write(DAR_cons_unitO,*), myIter, tmptotO, tmptotO/voltot
186 #endif
187 ENDIF
188
189 C-- Everyone else must wait
190 _BARRIER
191 #endif
192 c
193 c -----------------------------------------------------
194 RETURN
195 END
196 #endif /*MONOD*/
197 #endif /*ALLOW_PTRACERS*/
198
199 C============================================================================

  ViewVC Help
Powered by ViewVC 1.1.22