/[MITgcm]/MITgcm_contrib/darwin2/pkg/quota/quota_cons.F
ViewVC logotype

Annotation of /MITgcm_contrib/darwin2/pkg/quota/quota_cons.F

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


Revision 1.2 - (hide annotations) (download)
Thu Jun 20 21:47:20 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.1: +6 -6 lines
quota: fix io units for CHECK_CONS and pick more descriptive names

1 jahn 1.2 C $Header: /u/gcmpack/MITgcm_contrib/darwin2/pkg/quota/quota_cons.F,v 1.1 2011/04/13 18:56:26 jahn Exp $
2 jahn 1.1 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_DARWIN
10     #ifdef ALLOW_QUOTA
11    
12     c=============================================================
13     c subroutine DARWIN_cons
14     c check conservation in the model
15     C==============================================================
16     SUBROUTINE QUOTA_Cons(
17     & myTime,myIter,myThid)
18     #include "SIZE.h"
19     #include "EEPARAMS.h"
20     #include "PARAMS.h"
21     #include "GRID.h"
22     #include "PTRACERS_SIZE.h"
23     #include "PTRACERS_PARAMS.h"
24     #include "PTRACERS_FIELDS.h"
25     #include "GCHEM.h"
26    
27     #include "QUOTA_SIZE.h"
28     #include "QUOTA.h"
29     #include "DARWIN_IO.h"
30    
31     #include "DYNVARS.h"
32    
33     C === Global variables ===
34     _RL myTime
35     INTEGER myIter
36     INTEGER myThid
37    
38     #ifdef CHECK_CONS
39     C============== Local variables ============================================
40     _RL tmptotC
41     _RL tmptotN
42     _RL tmptotP
43     _RL tmptotF
44     _RL tmptotS
45     _RL vol, voltot
46    
47     INTEGER i,j,k,bi,bj
48     INTEGER ii, jp, ko, npnum
49    
50     _BEGIN_MASTER(myThid)
51     c
52     tmptotC=0. _d 0
53     tmptotN=0. _d 0
54     #ifdef PQUOTA
55     tmptotP=0. _d 0
56     #endif
57     #ifdef FQUOTA
58     tmptotF=0. _d 0
59     #endif
60     #ifdef SQUOTA
61     tmptotS=0. _d 0
62     #endif
63    
64     voltot =0. _d 0
65    
66     DO bj=myByLo(myThid),myByHi(myThid)
67     DO bi=myBxLo(myThid),myBxHi(myThid)
68    
69     DO i=1,sNx
70     DO j=1,sNy
71     do k= 1, NR
72     c-----------------------------------------------------------------
73     vol=rA(i,j,bi,bj)*drF(k)
74     voltot=voltot+vol
75     c.................................................................
76     c Carbon budget
77     tmptotC=tmptotC+Ptracer(i,j,k,bi,bj,iDIC)*vol !DIC
78     do jp=1,npmax ! loop Plankton
79     npnum=ibiomass-1 + (iCarb-1)*npmax + jp
80     tmptotC=tmptotC+Ptracer(i,j,k,bi,bj,npnum)*vol !C biomass
81     enddo
82     do ko=1,komax ! loop OM
83     npnum=iorgmat-1 + (iCarb-1)*komax + ko
84     tmptotC=tmptotC+Ptracer(i,j,k,bi,bj,npnum)*vol !DOC/POC
85     enddo
86     c.................................................................
87     c Nitrogen budget
88     tmptotN=tmptotN+Ptracer(i,j,k,bi,bj,iNO3)*vol !NO3
89     #ifdef AMMON
90     tmptotN=tmptotN+Ptracer(i,j,k,bi,bj,iNH4)*vol !NH4
91     #endif
92     #ifdef NITRITE
93     tmptotN=tmptotN+Ptracer(i,j,k,bi,bj,iNO2)*vol !NO2
94     #endif
95     do jp=1,npmax ! loop Plankton
96     npnum=ibiomass-1 + (iNitr-1)*npmax + jp
97     tmptotN=tmptotN+Ptracer(i,j,k,bi,bj,npnum)*vol !N biomass
98     enddo
99     do ko=1,komax ! loop OM
100     npnum=iorgmat-1 + (iNitr-1)*komax + ko
101     tmptotN=tmptotN+Ptracer(i,j,k,bi,bj,npnum)*vol !DON/PON
102     enddo
103     c.................................................................
104     #ifdef PQUOTA
105     c Phosphorous budget
106     tmptotP=tmptotP+Ptracer(i,j,k,bi,bj,iPO4)*vol !PO4
107     do jp=1,npmax ! loop Plankton
108     npnum=ibiomass-1 + (iPhos-1)*npmax + jp
109     tmptotP=tmptotP+Ptracer(i,j,k,bi,bj,npnum)*vol !P biomass
110     enddo
111     do ko=1,komax ! loop OM
112     npnum=iorgmat-1 + (iPhos-1)*komax + ko
113     tmptotP=tmptotP+Ptracer(i,j,k,bi,bj,npnum)*vol !DOP/POP
114     enddo
115     #endif
116     c.................................................................
117     #ifdef FQUOTA
118     c Iron budget
119     tmptotF=tmptotF+Ptracer(i,j,k,bi,bj,iFeT)*vol !Fe
120     do jp=1,npmax ! loop Plankton
121     npnum=ibiomass-1 + (iIron-1)*npmax + jp
122     tmptotF=tmptotF+Ptracer(i,j,k,bi,bj,npnum)*vol !Fe biomass
123     enddo
124     do ko=1,komax ! loop OM
125     npnum=iorgmat-1 + (iIron-1)*komax + ko
126     tmptotF=tmptotF+Ptracer(i,j,k,bi,bj,npnum)*vol !DOFe/POFe
127     enddo
128     #endif
129     c.................................................................
130     #ifdef SQUOTA
131     c Silica budget
132     tmptotS=tmptotS+Ptracer(i,j,k,bi,bj,iSi)*vol !Si
133     do jp=1,npmax ! loop Plankton
134     npnum=ibiomass-1 + (iSili-1)*npmax + jp
135     tmptotF=tmptotF+Ptracer(i,j,k,bi,bj,npnum)*vol !Si biomass
136     enddo
137     npnum=iorgmat-1 + (iSili-1)*komax + 2
138     tmptotS=tmptotS+Ptracer(i,j,k,bi,bj,npnum)*vol !POSi
139     #endif
140     c------------------------------------------------------------
141     enddo
142     ENDDO
143     ENDDO
144     ENDDO
145     ENDDO
146    
147     _GLOBAL_SUM_RL(tmptotC,myThid)
148     print*,'tmptotC',tmptotC
149 jahn 1.2 write(DAR_cons_unitC,*), myIter, tmptotC, tmptotC/voltot
150 jahn 1.1 _GLOBAL_SUM_RL(tmptotN,myThid)
151     print*,'tmptotN',tmptotN
152 jahn 1.2 write(DAR_cons_unitN,*), myIter, tmptotN, tmptotN/voltot
153 jahn 1.1 #ifdef PQUOTA
154     _GLOBAL_SUM_RL(tmptotP,myThid)
155     print*,'tmptotP',tmptotP
156 jahn 1.2 write(DAR_cons_unitP,*), myIter, tmptotP, tmptotP/voltot
157 jahn 1.1 #endif
158     #ifdef FQUOTA
159     _GLOBAL_SUM_RL(tmptotF,myThid)
160     print*,'tmptotF',tmptotF
161 jahn 1.2 write(DAR_cons_unitF,*), myIter, tmptotF, tmptotF/voltot
162 jahn 1.1 #endif
163     #ifdef SQUOTA
164     _GLOBAL_SUM_RL(tmptotS,myThid)
165     print*,'tmptotS',tmptotS
166 jahn 1.2 write(DAR_cons_unitS,*), myIter, tmptotS, tmptotS/voltot
167 jahn 1.1 #endif
168     print*,'-----------------------------------'
169     _END_MASTER(myThid)
170    
171     C-- Everyone else must wait
172     _BARRIER
173     #endif
174     c
175     c -----------------------------------------------------
176     RETURN
177     END
178     #endif /*ALLOW_QUOTA*/
179     #endif /*DARWIN*/
180     #endif /*ALLOW_PTRACERS*/
181    
182     C============================================================================

  ViewVC Help
Powered by ViewVC 1.1.22