/[MITgcm]/MITgcm/pkg/ecco/cost_averagesgeneric.F
ViewVC logotype

Diff of /MITgcm/pkg/ecco/cost_averagesgeneric.F

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

revision 1.1 by heimbach, Thu Sep 1 05:32:56 2005 UTC revision 1.3 by jmc, Tue Oct 9 00:02:50 2007 UTC
# Line 1  Line 1 
1  C $Header$  C $Header$
2    C $Name$
3    
4  #include "COST_CPPOPTIONS.h"  #include "COST_CPPOPTIONS.h"
5    
6        subroutine cost_averagesgeneric(        subroutine cost_averagesgeneric(
7       &     localbarfile,       &     localbarfile,
8       &     localbar, localfld, xx_localbar_mean_dummy,       &     localbar, localfld, xx_localbar_mean_dummy,
9       &     first, last, startofloc, endofloc, inloc,       &     first, last, startofloc, endofloc, inloc,
10       &     sum1loc, locrec, nnz, mythid )       &     sum1loc, locrec, nnz, mythid )
# Line 25  c     == global variables == Line 26  c     == global variables ==
26  #include "EEPARAMS.h"  #include "EEPARAMS.h"
27  #include "SIZE.h"  #include "SIZE.h"
28  #include "PARAMS.h"  #include "PARAMS.h"
 #include "SEAICE.h"  
29    
30  #ifdef ALLOW_COST  #ifdef ALLOW_COST
31  # include "optim.h"  # include "optim.h"
# Line 102  c--     Add the last value and devide by Line 102  c--     Add the last value and devide by
102              do k = 1,nnz              do k = 1,nnz
103                do j = jmin,jmax                do j = jmin,jmax
104                  do i = imin,imax                  do i = imin,imax
105                    localbar(i,j,k,bi,bj) =                    localbar(i,j,k,bi,bj) =
106       &                  (localbar(i,j,k,bi,bj)       &                  (localbar(i,j,k,bi,bj)
107       &                  +localfld(i,j,k,bi,bj))/       &                  +localfld(i,j,k,bi,bj))/
108       &                  float(sum1loc)       &                  float(sum1loc)
109                  enddo                  enddo
# Line 114  c--     Add the last value and devide by Line 114  c--     Add the last value and devide by
114  c--     Save ...bar on file.  c--     Save ...bar on file.
115          write(fname(1:128),'(80a)') ' '          write(fname(1:128),'(80a)') ' '
116          il=ilnblnk( localbarfile )          il=ilnblnk( localbarfile )
117          write(fname,'(2a,i10.10)')          write(fname,'(2a,i10.10)')
118       &       localbarfile(1:il), '.', optimcycle       &       localbarfile(1:il), '.', optimcycle
119          if ( nnz .EQ. 1 ) then          if ( nnz .EQ. 1 ) then
120             call active_write_xy( fname, localbar, locrec, optimcycle,             call active_write_xy( fname, localbar, locrec, optimcycle,
# Line 132  c--     Accumulate the array holding the Line 132  c--     Accumulate the array holding the
132              do j = jmin,jmax              do j = jmin,jmax
133                do k = 1,nnz                do k = 1,nnz
134                  do i = imin,imax                  do i = imin,imax
135                    localbar(i,j,k,bi,bj) =                    localbar(i,j,k,bi,bj) =
136       &                  localbar(i,j,k,bi,bj) + localfld(i,j,k,bi,bj)       &                  localbar(i,j,k,bi,bj) + localfld(i,j,k,bi,bj)
137                  enddo                  enddo
138                enddo                enddo

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

  ViewVC Help
Powered by ViewVC 1.1.22