/[MITgcm]/MITgcm/pkg/ctrl/ctrl_set_pack_yz.F
ViewVC logotype

Diff of /MITgcm/pkg/ctrl/ctrl_set_pack_yz.F

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

revision 1.14 by jmc, Mon Mar 22 02:16:43 2010 UTC revision 1.15 by mlosch, Tue Jul 19 12:44:36 2011 UTC
# Line 54  c     == local variables == Line 54  c     == local variables ==
54        integer ip,jp        integer ip,jp
55        integer i,j,k        integer i,j,k
56        integer ii,jj,kk        integer ii,jj,kk
       integer il  
57        integer irec,iobcs,nrec_nl        integer irec,iobcs,nrec_nl
58        integer itlo,ithi        integer itlo,ithi
59        integer jtlo,jthi        integer jtlo,jthi
# Line 62  c     == local variables == Line 61  c     == local variables ==
61        integer imin,imax        integer imin,imax
62    
63        integer cbuffindex        integer cbuffindex
 cgg(  
       integer igg  
64        integer reclen, irectrue        integer reclen, irectrue
65        integer cunit2, cunit3        integer cunit2, cunit3
       _RL     gg  
       character*(80) weightname  
66        character*(80) cfile2, cfile3        character*(80) cfile2, cfile3
67  cgg)  
68        real*4  cbuff      ( nsx*npx*sny*nsy*npy )        real*4  cbuff      ( nsx*npx*sny*nsy*npy )
69        real*4  globfldtmp2( nsx,npx,sny,nsy,npy )        real*4  globfldtmp2( nsx,npx,sny,nsy,npy )
70        real*4  globfldtmp3( nsx,npx,sny,nsy,npy )        real*4  globfldtmp3( nsx,npx,sny,nsy,npy )
# Line 77  cgg) Line 72  cgg)
72        _RL     globfld3d  ( snx,nsx,npx,sny,nsy,npy,nr )        _RL     globfld3d  ( snx,nsx,npx,sny,nsy,npy,nr )
73        _RL     globmskyz  ( nsx,npx,sny,nsy,npy,nr,nobcs )        _RL     globmskyz  ( nsx,npx,sny,nsy,npy,nr,nobcs )
74  #ifdef CTRL_PACK_PRECISE  #ifdef CTRL_PACK_PRECISE
75          integer il
76          character*(80) weightname
77        _RL     weightfldyz( nsx,npx,sny,nsy,npy,nr,nobcs )        _RL     weightfldyz( nsx,npx,sny,nsy,npy,nr,nobcs )
 #endif  
78    
79  c     == external ==  c     == external ==
80    
81        integer  ilnblnk        integer  ilnblnk
82        external ilnblnk        external ilnblnk
83    #endif
84    
85  c     == end of interface ==  c     == end of interface ==
86    
# Line 174  c--   Only the master thread will do I/O Line 171  c--   Only the master thread will do I/O
171           call MDSREADFIELD_YZ_GL(           call MDSREADFIELD_YZ_GL(
172       &       weightname, ctrlprec, 'RL',       &       weightname, ctrlprec, 'RL',
173       &       Nr, weightfldyz(1,1,1,1,1,1,iobcs), iobcs, mythid)       &       Nr, weightfldyz(1,1,1,1,1,1,iobcs), iobcs, mythid)
 CGG   One special exception: barotropic velocity should be nondimensionalized  
 cgg   differently. Probably introduce new variable.  
          if (iobcs .eq. 3 .or. iobcs .eq. 4) then  
             k = 1  
             do jp = 1,nPy  
                do bj = jtlo,jthi  
                   do j = jmin,jmax  
                      do ip = 1,nPx  
                         do bi = itlo,ithi  
 cph                           weightfldyz(bi,ip,j,bj,jp,k,iobcs) = wbaro  
                         enddo  
                      enddo  
                   enddo  
                enddo  
             enddo  
          endif  
174  #endif  #endif
175        enddo        enddo
176    
# Line 201  C     method that works for .not.useSing Line 182  C     method that works for .not.useSing
182         nrec_nl = int(ncvarrecs(ivartype)/Nx)         nrec_nl = int(ncvarrecs(ivartype)/Nx)
183        endif        endif
184        do irec = 1, nrec_nl        do irec = 1, nrec_nl
185  cgg       do iobcs = 1, nobcs  c     Need to solve for what iobcs would have been.
 cgg    Need to solve for what iobcs would have been.  
186    
187           call MDSREADFIELD_3D_GL( fname, ctrlprec, 'RL',           call MDSREADFIELD_3D_GL( fname, ctrlprec, 'RL',
188       &        nr, globfld3D, irec, mythid)       &        nr, globfld3D, irec, mythid)
# Line 210  cgg    Need to solve for what iobcs woul Line 190  cgg    Need to solve for what iobcs woul
190           do i=1,snx           do i=1,snx
191              iobcs= mod((irec-1)*snx+i-1,nobcs)+1              iobcs= mod((irec-1)*snx+i-1,nobcs)+1
192    
 CGG   One special exception: barotropic velocity should be nondimensionalized  
 cgg   differently. Probably introduce new variable.  
             if (iobcs .eq. 3 .or. iobcs .eq. 4) then  
                k = 1  
                do jp = 1,nPy  
                   do bj = jtlo,jthi  
                      do j = jmin,jmax  
                         do ip = 1,nPx  
                            do bi = itlo,ithi  
 #ifdef NO_CONTROL_BAROTROPIC_VELOCITY  
                               if (.not. lxxadxx) then  
 cgg    Get rid of any sensitivity to barotropic velocity.  
                                  globfld3d(i,bi,ip,j,bj,jp,k) = 0.  
                               endif  
 #endif  
                            enddo  
                         enddo  
                      enddo  
                   enddo  
                enddo  
             endif  
   
193              write(cunit) ncvarindex(ivartype)              write(cunit) ncvarindex(ivartype)
194              write(cunit) 1              write(cunit) 1
195              write(cunit) 1              write(cunit) 1
# Line 296  c Line 254  c
254  c  c
255  c     -- end of k loop --  c     -- end of k loop --
256              enddo              enddo
 c     -- end of iobcs loop --  
 cgg       enddo  
257  c     -- end of i loop --  c     -- end of i loop --
258           enddo           enddo
259  c     -- end of irec loop --  c     -- end of irec loop --
260        enddo        enddo
261    
262        do irec = nrec_nl*nx+1, ncvarrecs(ivartype)        do irec = nrec_nl*nx+1, ncvarrecs(ivartype)
263  cgg       do iobcs = 1, nobcs  c     Need to solve for what iobcs would have been.
 cgg    Need to solve for what iobcs would have been.  
264           iobcs= mod(irec-1,nobcs)+1           iobcs= mod(irec-1,nobcs)+1
265    
266           call MDSREADFIELD_YZ_GL( fname, ctrlprec, 'RL',           call MDSREADFIELD_YZ_GL( fname, ctrlprec, 'RL',
267       &        nr, globfldyz, irec, mythid)       &        nr, globfldyz, irec, mythid)
268    
 CGG   One special exception: barotropic velocity should be nondimensionalized  
 cgg   differently. Probably introduce new variable.  
          if (iobcs .eq. 3 .or. iobcs .eq. 4) then  
             k = 1  
             do jp = 1,nPy  
                do bj = jtlo,jthi  
                   do j = jmin,jmax  
                      do ip = 1,nPx  
                         do bi = itlo,ithi  
 #ifdef NO_CONTROL_BAROTROPIC_VELOCITY  
                            if (.not. lxxadxx) then  
 cgg    Get rid of any sensitivity to barotropic velocity.  
                               globfldyz(bi,ip,j,bj,jp,k) = 0.  
                            endif  
 #endif  
                         enddo  
                      enddo  
                   enddo  
                enddo  
             enddo  
          endif  
   
269           write(cunit) ncvarindex(ivartype)           write(cunit) ncvarindex(ivartype)
270           write(cunit) 1           write(cunit) 1
271           write(cunit) 1           write(cunit) 1
# Line 394  c Line 327  c
327  c  c
328  c     -- end of k loop --  c     -- end of k loop --
329           enddo           enddo
 c     -- end of iobcs loop --  
 cgg       enddo  
330  c     -- end of irec loop --  c     -- end of irec loop --
331        enddo        enddo
332    

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

  ViewVC Help
Powered by ViewVC 1.1.22