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

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

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

revision 1.8 by gforget, Wed Jun 20 19:37:35 2007 UTC revision 1.10 by jmc, Tue Apr 28 18:13:28 2009 UTC
# Line 1  Line 1 
1  C $Header$  C $Header$
2    C $Name$
3    
4  #include "COST_CPPOPTIONS.h"  #include "COST_CPPOPTIONS.h"
5    
# Line 89  c     == end of interface == Line 90  c     == end of interface ==
90  c--   Read state record from global file.  c--   Read state record from global file.
91        doglobalread = .false.        doglobalread = .false.
92        ladinit      = .false.        ladinit      = .false.
93          
94        irec = 1        irec = 1
95    
96  #ifdef ALLOW_THETA0_COST_CONTRIBUTION  #ifdef ALLOW_THETA0_COST_CONTRIBUTION
97    
98        if (optimcycle .ge. 0) then        if (optimcycle .ge. 0) then
99          ilfld = ilnblnk( xx_theta_file )          ilfld = ilnblnk( xx_theta_file )
100          write(fnamefld(1:80),'(2a,i10.10)')          write(fnamefld(1:80),'(2a,i10.10)')
101       &       xx_theta_file(1:ilfld),'.',optimcycle       &       xx_theta_file(1:ilfld),'.',optimcycle
102        endif        endif
103    
104        call active_read_xyz(        call active_read_xyz(
105       &     fnamefld, tmpfld3d, irec, doglobalread,       &     fnamefld, tmpfld3d, irec, doglobalread,
106       &     ladinit, optimcycle, mythid, xx_theta_dummy )       &     ladinit, optimcycle, mythid, xx_theta_dummy )
107    
# Line 109  c--     Loop over this thread's tiles. Line 110  c--     Loop over this thread's tiles.
110            do bi = itlo,ithi            do bi = itlo,ithi
111    
112  c--         Determine the weights to be used.  c--         Determine the weights to be used.
113              
114              fctile = 0. _d 0              fctile = 0. _d 0
115              do k = 1,nr              do k = 1,nr
116               do j = jmin,jmax               do j = jmin,jmax
# Line 140  c--         Determine the weights to be Line 141  c--         Determine the weights to be
141  #ifndef ALLOW_SMOOTH_CORREL3D  #ifndef ALLOW_SMOOTH_CORREL3D
142  #ifdef ALLOW_SMOOTH_IC_COST_CONTRIBUTION  #ifdef ALLOW_SMOOTH_IC_COST_CONTRIBUTION
143    
144        call active_read_xyz(        call active_read_xyz(
145       &     fnamefld, tmpfld3d, irec, doglobalread,       &     fnamefld, tmpfld3d, irec, doglobalread,
146       &     ladinit, optimcycle, mythid, xx_theta_dummy )       &     ladinit, optimcycle, mythid, xx_theta_dummy )
147    
148          _EXCH_XYZ_R8(tmpfld3d, mythid)          _EXCH_XYZ_RL(tmpfld3d, mythid)
149    
150  c--     Loop over this thread's tiles.  c--     Loop over this thread's tiles.
151          do bj = jtlo,jthi          do bj = jtlo,jthi
# Line 155  c--     Loop over this thread's tiles. Line 156  c--     Loop over this thread's tiles.
156               do j = jmin,jmax               do j = jmin,jmax
157                do i = imin,imax                do i = imin,imax
158                  if (_hFacC(i,j,k,bi,bj) .ne. 0.) then                  if (_hFacC(i,j,k,bi,bj) .ne. 0.) then
159                    tmpx =                    tmpx =
160       &              ( tmpfld3d(i+2,j,k,bi,bj)-tmpfld3d(i+1,j,k,bi,bj) )       &              ( tmpfld3d(i+2,j,k,bi,bj)-tmpfld3d(i+1,j,k,bi,bj) )
161       &                *maskW(i+1,j,k,bi,bj)*maskW(i+2,j,k,bi,bj)       &                *maskW(i+1,j,k,bi,bj)*maskW(i+2,j,k,bi,bj)
162       &            + ( tmpfld3d(i+1,j,k,bi,bj)-tmpfld3d(i,j,k,bi,bj) )       &            + ( tmpfld3d(i+1,j,k,bi,bj)-tmpfld3d(i,j,k,bi,bj) )
# Line 186  c--     Loop over this thread's tiles. Line 187  c--     Loop over this thread's tiles.
187    
188        return        return
189        end        end
190          
191          

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.22