/[MITgcm]/MITgcm/pkg/dic/dic_aver.F
ViewVC logotype

Annotation of /MITgcm/pkg/dic/dic_aver.F

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


Revision 1.5 - (hide annotations) (download)
Mon Nov 5 19:02:08 2007 UTC (16 years, 7 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint59j
Changes since 1.4: +4 -3 lines
split PTRACERS.h in 2 header files: PTRACERS_FIELDS.h & PTRACERS_PARAMS.h ;
comment out some #include PTRACERS_* that don't seem necessary.

1 jmc 1.5 C $Header: /u/gcmpack/MITgcm/pkg/dic/dic_aver.F,v 1.4 2005/08/18 18:24:29 stephd Exp $
2 jmc 1.2 C $Name: $
3    
4 stephd 1.1 cswdcost -- add sunroutine ---
5 stephd 1.4 #include "DIC_OPTIONS.h"
6 stephd 1.1 #include "GCHEM_OPTIONS.h"
7    
8    
9     CStartOfInterFace
10     SUBROUTINE DIC_AVER(
11     I myTime,myIter,myThid)
12    
13     C /==========================================================\
14 jmc 1.5 C | SUBROUTINE DIC_AVER
15 stephd 1.1 C |==========================================================|
16     IMPLICIT NONE
17    
18     C == GLobal variables ==
19     #include "SIZE.h"
20     #include "DYNVARS.h"
21     #include "EEPARAMS.h"
22     #include "PARAMS.h"
23     #include "GRID.h"
24 jmc 1.2 #include "PTRACERS_SIZE.h"
25 jmc 1.5 c#include "PTRACERS_PARAMS.h"
26     #include "PTRACERS_FIELDS.h"
27 stephd 1.1 #include "GCHEM.h"
28     #include "DIC_ABIOTIC.h"
29     #ifdef DIC_BIOTIC
30     #include "DIC_BIOTIC.h"
31     #include "DIC_DIAGS.h"
32     #include "DIC_COST.h"
33     #endif
34     #ifdef ALLOW_SEAICE
35     #include "ICE.h"
36     #endif
37    
38     C == Routine arguments ==
39     INTEGER myIter
40     _RL myTime
41     INTEGER myThid
42    
43     #ifdef ALLOW_DIC_COST
44    
45     C == Local variables ==
46     INTEGER i, j, bi, bj, k, it
47     _RL rdt
48     INTEGER nForcingPeriods,Imytm,Ifprd,Ifcyc,Iftm
49    
50     cswddmonth -- end-
51     c
52     c averages
53     DO bj = myByLo(myThid), myByHi(myThid)
54     DO bi = myBxLo(myThid), myBxHi(myThid)
55     DO k=1,Nr
56     OBS_timetave(bi,bj,k)=OBS_timetave(bi,bj,k)+
57     & deltaTclock
58     DO j=1-OLy,sNy+OLy
59     DO i=1-OLx,sNx+OLx
60     po4ann(i,j,k,bi,bj)=po4ann(i,j,k,bi,bj)+
61     & PTRACER(i,j,k,bi,bj,3)*deltaTclock
62     o2ann(i,j,k,bi,bj)=o2ann(i,j,k,bi,bj)+
63     & PTRACER(i,j,k,bi,bj,5)*deltaTclock
64     ENDDO
65     ENDDO
66     ENDDO
67     ENDDO
68     ENDDO
69     cswdmonth-add--
70     rdt=1. _d 0 / deltaTclock
71     nForcingPeriods=int(externForcingCycle/externForcingPeriod+0.5)
72     Imytm=int(myTime*rdt+0.5)
73     Ifprd=int(externForcingPeriod*rdt+0.5)
74     Ifcyc=int(externForcingCycle*rdt+0.5)
75     Iftm=mod( Imytm+Ifcyc ,Ifcyc)
76     it=int(Iftm/Ifprd)+1
77     c print*,'QQ timing check', mytime, myIter, it
78     DO bj = myByLo(myThid), myByHi(myThid)
79     DO bi = myBxLo(myThid), myBxHi(myThid)
80     OBSM_timetave(bi,bj,it)=OBSM_timetave(bi,bj,it)+
81     & deltaTclock
82     DO j=1-OLy,sNy+OLy
83     DO i=1-OLx,sNx+OLx
84     po4lev1(i,j,it,bi,bj)=po4lev1(i,j,it,bi,bj)+
85     & PTRACER(i,j,1,bi,bj,3)*deltaTclock
86     po4lev2(i,j,it,bi,bj)=po4lev2(i,j,it,bi,bj)+
87     & PTRACER(i,j,2,bi,bj,3)*deltaTclock
88     po4lev3(i,j,it,bi,bj)=po4lev3(i,j,it,bi,bj)+
89     & PTRACER(i,j,3,bi,bj,3)*deltaTclock
90     cQQ po4lev4(i,j,it,bi,bj)=po4lev4(i,j,it,bi,bj)+
91     cQQ & PTRACER(i,j,4,bi,bj,3)*deltaTclock
92     o2lev1(i,j,it,bi,bj)=o2lev1(i,j,it,bi,bj)+
93     & PTRACER(i,j,1,bi,bj,5)*deltaTclock
94     o2lev2(i,j,it,bi,bj)=o2lev2(i,j,it,bi,bj)+
95     & PTRACER(i,j,2,bi,bj,5)*deltaTclock
96     o2lev3(i,j,it,bi,bj)=o2lev3(i,j,it,bi,bj)+
97     & PTRACER(i,j,3,bi,bj,5)*deltaTclock
98     cQQ O2lev4(i,j,it,bi,bj)=O2lev4(i,j,it,bi,bj)+
99     cQQ & PTRACER(i,j,4,bi,bj,5)*deltaTclock
100     ENDDO
101     ENDDO
102     ENDDO
103     ENDDO
104    
105     cswdmonth-end--
106    
107    
108     #endif
109     c
110     RETURN
111     END
112     cswd -- end added subroutine --

  ViewVC Help
Powered by ViewVC 1.1.22