/[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.1 - (hide annotations) (download)
Wed Apr 13 18:56:26 2011 UTC (14 years, 3 months ago) by jahn
Branch: MAIN
CVS Tags: ctrb_darwin2_ckpt63l_20120405, ctrb_darwin2_ckpt64h_20130528, ctrb_darwin2_ckpt62v_20110413, ctrb_darwin2_ckpt64f_20130405, ctrb_darwin2_ckpt63f_20111201, ctrb_darwin2_ckpt64a_20121116, ctrb_darwin2_ckpt62y_20110526, ctrb_darwin2_ckpt62x_20110513, ctrb_darwin2_ckpt62w_20110426, ctrb_darwin2_ckpt63o_20120629, ctrb_darwin2_ckpt64e_20130305, ctrb_darwin2_ckpt63c_20111011, ctrb_darwin2_ckpt63i_20120124, ctrb_darwin2_ckpt63m_20120506, ctrb_darwin2_ckpt63s_20120908, ctrb_darwin2_ckpt63e_20111107, ctrb_darwin2_ckpt63b_20110830, ctrb_darwin2_ckpt63j_20120217, ctrb_darwin2_ckpt63r_20120817, ctrb_darwin2_ckpt64g_20130503, ctrb_darwin2_ckpt63g_20111220, ctrb_darwin2_ckpt64c_20130120, ctrb_darwin2_ckpt63a_20110804, ctrb_darwin2_ckpt63h_20111230, ctrb_darwin2_ckpt63p_20120707, ctrb_darwin2_ckpt63d_20111107, ctrb_darwin2_ckpt63q_20120731, ctrb_darwin2_ckpt63_20110728, ctrb_darwin2_ckpt64b_20121224, ctrb_darwin2_ckpt64d_20130219, ctrb_darwin2_ckpt64_20121012, ctrb_darwin2_baseline, ctrb_darwin2_ckpt63n_20120604, ctrb_darwin2_ckpt63k_20120317, ctrb_darwin2_ckpt62z_20110622
darwin2 initial checkin

1 jahn 1.1 C $Header: /u/gcmpack/MITgcm_contrib/darwin/pkg/darwin/darwin_cons.F,v 1.7 2009/04/30 18:14:24 jahn 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_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     write(DAR_cons_unit1,*), myIter, tmptotC, tmptotC/voltot
150     _GLOBAL_SUM_RL(tmptotN,myThid)
151     print*,'tmptotN',tmptotN
152     write(DAR_cons_unit2,*), myIter, tmptotN, tmptotN/voltot
153     #ifdef PQUOTA
154     _GLOBAL_SUM_RL(tmptotP,myThid)
155     print*,'tmptotP',tmptotP
156     write(DAR_cons_unit2,*), myIter, tmptotP, tmptotP/voltot
157     #endif
158     #ifdef FQUOTA
159     _GLOBAL_SUM_RL(tmptotF,myThid)
160     print*,'tmptotF',tmptotF
161     write(DAR_cons_unit2,*), myIter, tmptotF, tmptotF/voltot
162     #endif
163     #ifdef SQUOTA
164     _GLOBAL_SUM_RL(tmptotS,myThid)
165     print*,'tmptotS',tmptotS
166     write(DAR_cons_unit2,*), myIter, tmptotS, tmptotS/voltot
167     #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