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

Diff of /MITgcm/pkg/dic/dic_aver_init.F

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

revision 1.1 by stephd, Mon Oct 6 20:11:10 2003 UTC revision 1.11 by jmc, Tue Apr 28 18:10:47 2009 UTC
# Line 1  Line 1 
1  cswdcost -- add sunroutine ---  C $Header$
2  #include "CPP_OPTIONS.h"  C $Name$
 #include "GCHEM_OPTIONS.h"  
3    
4    #include "DIC_OPTIONS.h"
5    
6  CStartOfInterFace  CStartOfInterFace
7        SUBROUTINE DIC_AVER_INIT(        SUBROUTINE DIC_AVER_INIT(
# Line 18  C     == GLobal variables == Line 18  C     == GLobal variables ==
18  #include "EEPARAMS.h"  #include "EEPARAMS.h"
19  #include "PARAMS.h"  #include "PARAMS.h"
20  #include "GRID.h"  #include "GRID.h"
21  #include "PTRACERS.h"  #include "PTRACERS_SIZE.h"
22  #include "GCHEM.h"  #include "PTRACERS_FIELDS.h"
23  #include "DIC_ABIOTIC.h"  #include "DIC_VARS.h"
24  #ifdef DIC_BIOTIC  #ifdef DIC_BIOTIC
 #include "DIC_BIOTIC.h"  
25  #include "DIC_DIAGS.h"  #include "DIC_DIAGS.h"
26  #include "DIC_COST.h"  #include "DIC_COST.h"
27  #endif  #endif
 #ifdef ALLOW_SEAICE  
 #include "ICE.h"  
 #endif  
28    
29  C     == Routine arguments ==  C     == Routine arguments ==
30        INTEGER myThid        INTEGER myThid
# Line 36  C     == Routine arguments == Line 32  C     == Routine arguments ==
32  #ifdef ALLOW_DIC_COST  #ifdef ALLOW_DIC_COST
33    
34  C     == Local variables ==  C     == Local variables ==
       LOGICAL  DIFFERENT_MULTIPLE  
       EXTERNAL DIFFERENT_MULTIPLE  
35        INTEGER i, j, bi, bj, k, it        INTEGER i, j, bi, bj, k, it
36        _RL po4av(nR)        _RL po4av(Nr)
37        _RL o2av(nR)        _RL o2av(Nr)
38        _RL volvar(nR)        _RL volvar(Nr)
39  cswdmonth -add-  cswdmonth -add-
40        _RL po4avm(12,4)        _RL po4avm(12,4)
41        _RL o2avm(12,4)        _RL o2avm(12,4)
# Line 73  cswdmonth -end- Line 67  cswdmonth -end-
67              po4var(k)=0.d0              po4var(k)=0.d0
68              o2var(k)=0.d0              o2var(k)=0.d0
69              volvar(k)=0.d0              volvar(k)=0.d0
70            enddo            enddo
71  cswdmonth  cswdmonth
72            do k=1,3            do k=1,3
73             do it=1,12             do it=1,12
# Line 85  cswdmonth Line 79  cswdmonth
79             enddo             enddo
80            enddo            enddo
81           ENDDO           ENDDO
82          ENDDO          ENDDO
83          _BEGIN_MASTER( myThid )          CALL READ_FLD_XYZ_RL( 'input/po4obs.bin', ' ',
84          CALL READ_FLD_XYZ_RL( 'input/po4obs.bin', ' ',       &                          po4obs, 0, myThid )
85       &                          po4obs, 0, myThid )                  CALL READ_FLD_XYZ_RL( 'input/o2obs.bin', ' ',
         CALL READ_FLD_XYZ_RL( 'input/o2obs.bin', ' ',  
86       &                          o2obs, 0, myThid )       &                          o2obs, 0, myThid )
87  cswdmonth  cswdmonth
88          CALL READ_FLD_XYZ_RL( 'input/po4lev1.bin', ' ',          CALL READ_FLD_XYZ_RL( 'input/po4lev1.bin', ' ',
# Line 109  cQQ  &                          po4obsl4 Line 102  cQQ  &                          po4obsl4
102  cQQ     CALL READ_FLD_XYZ_RL( 'input/o2lev4.bin', ' ',  cQQ     CALL READ_FLD_XYZ_RL( 'input/o2lev4.bin', ' ',
103  cQQ  &                          o2obsl4, 0, myThid )  cQQ  &                          o2obsl4, 0, myThid )
104  cswdmonth -end-  cswdmonth -end-
105         _END_MASTER(myThid)         _EXCH_XYZ_RL(po4obs  , myThid )
106         _EXCH_XYZ_R8(po4obs  , myThid )         _EXCH_XYZ_RL(o2obs  , myThid )
        _EXCH_XYZ_R8(o2obs  , myThid )  
107  cswdmonth -add-  cswdmonth -add-
108         _EXCH_XYZ_R8(po4obsl1  , myThid )         _EXCH_XYZ_RL(po4obsl1  , myThid )
109         _EXCH_XYZ_R8(po4obsl2  , myThid )         _EXCH_XYZ_RL(po4obsl2  , myThid )
110         _EXCH_XYZ_R8(po4obsl3  , myThid )         _EXCH_XYZ_RL(po4obsl3  , myThid )
111  cQQ    _EXCH_XYZ_R8(po4obsl4  , myThid )  cQQ    _EXCH_XYZ_RL(po4obsl4  , myThid )
112         _EXCH_XYZ_R8(o2obsl1  , myThid )         _EXCH_XYZ_RL(o2obsl1  , myThid )
113         _EXCH_XYZ_R8(o2obsl2  , myThid )         _EXCH_XYZ_RL(o2obsl2  , myThid )
114         _EXCH_XYZ_R8(o2obsl3  , myThid )         _EXCH_XYZ_RL(o2obsl3  , myThid )
115  cQQ    _EXCH_XYZ_R8(o2obsl4  , myThid )  cQQ    _EXCH_XYZ_RL(o2obsl4  , myThid )
116  cswdmonth -end-  cswdmonth -end-
117    
         _BARRIER  
118  c calculate layer means  c calculate layer means
         _BEGIN_MASTER( mythid )  
119          do k=1,Nr          do k=1,Nr
120           call tracer_meanarea(myThid,po4obs, k,           call tracer_meanarea(po4obs, k,
121       &                    po4av(k))       &                    po4av(k),myThid)
122           call tracer_meanarea(myThid,o2obs, k,           call tracer_meanarea(o2obs, k,
123       &                    o2av(k))       &                    o2av(k),myThid)
124  c        print*,po4av(k), o2av(k)  c        print*,po4av(k), o2av(k)
125          enddo          enddo
126  cswdmonth -add-  cswdmonth -add-
127          do it=1,12          do it=1,MIN(12,Nr)
128           call tracer_meanarea(myThid,po4obsl1,it,           call tracer_meanarea(po4obsl1,it,
129       &                    po4avm(it,1))       &                    po4avm(it,1),myThid)
130           call tracer_meanarea(myThid,po4obsl2,it,           call tracer_meanarea(po4obsl2,it,
131       &                    po4avm(it,2))       &                    po4avm(it,2),myThid)
132           call tracer_meanarea(myThid,po4obsl3,it,           call tracer_meanarea(po4obsl3,it,
133       &                    po4avm(it,3))       &                    po4avm(it,3),myThid)
134  cQQ      call tracer_meanarea(myThid,po4obsl4,it,  cQQ      call tracer_meanarea(po4obsl4,it,
135  cQQ  &                    po4avm(it,4))  cQQ  &                    po4avm(it,4),myThid)
136           call tracer_meanarea(myThid,o2obsl1,it,           call tracer_meanarea(o2obsl1,it,
137       &                    o2avm(it,1))       &                    o2avm(it,1),myThid)
138           call tracer_meanarea(myThid,o2obsl2,it,           call tracer_meanarea(o2obsl2,it,
139       &                    o2avm(it,2))       &                    o2avm(it,2),myThid)
140           call tracer_meanarea(myThid,o2obsl3,it,           call tracer_meanarea(o2obsl3,it,
141       &                    o2avm(it,3))       &                    o2avm(it,3),myThid)
142  cQQ      call tracer_meanarea(myThid,o2obsl4,it,  cQQ      call tracer_meanarea(o2obsl4,it,
143  cQQ  &                    o2avm(it,4))  cQQ  &                    o2avm(it,4),myThid)
144    
145          enddo          enddo
         _END_MASTER(myThid)  
146  c calculate layer variance  c calculate layer variance
         _BEGIN_MASTER( mythid )  
147          DO bj = myByLo(myThid), myByHi(myThid)          DO bj = myByLo(myThid), myByHi(myThid)
148          DO bi = myBxLo(myThid), myBxHi(myThid)          DO bi = myBxLo(myThid), myBxHi(myThid)
149           DO j=1-OLy,sNy+OLy           DO j=1,sNy
150           DO i=1-OLx,sNx+OLx           DO i=1,sNx
151            DO k=1,Nr            DO k=1,Nr
152              volvar(k)=volvar(k)+              volvar(k)=volvar(k)+
153       &                rA(i,j,bi,bj)*drF(k)*maskC(i,j,k,bi,bj)       &                rA(i,j,bi,bj)*drF(k)*maskC(i,j,k,bi,bj)
# Line 213  cswdmonth- add- Line 201  cswdmonth- add-
201           ENDDO           ENDDO
202          ENDDO          ENDDO
203  cswdmonth -end-  cswdmonth -end-
         _END_MASTER(myThid)  
204  C  C
205  C Reset averages to zero  C Reset averages to zero
206         print*,'QQ dic_diags, set to zero, gchem_init'         print*,'QQ dic_aver_init, set to zero'
207         DO bj = myByLo(myThid), myByHi(myThid)         DO bj = myByLo(myThid), myByHi(myThid)
208          DO bi = myBxLo(myThid), myBxHi(myThid)          DO bi = myBxLo(myThid), myBxHi(myThid)
209           CALL TIMEAVE_RESET(PO4ann,Nr,bi,bj,myThid)           CALL TIMEAVE_RESET(PO4ann,Nr,bi,bj,myThid)
# Line 243  c Line 230  c
230  c  c
231        RETURN        RETURN
232        END        END
 cswd -- end added subroutine --  

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.11

  ViewVC Help
Powered by ViewVC 1.1.22