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

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

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

revision 1.3 by heimbach, Mon Sep 16 18:11:58 2002 UTC revision 1.5 by edhill, Thu Oct 23 04:41:40 2003 UTC
# Line 1  Line 1 
1    C
2    C $Header$
3    C $Name$
4    
5    #include "AD_CONFIG.h"
6  #include "CTRL_CPPOPTIONS.h"  #include "CTRL_CPPOPTIONS.h"
7    
8    
# Line 12  c     o initialise field Line 17  c     o initialise field
17  c  c
18  c     started: heimbach@mit.edu, 16-Aug-2001  c     started: heimbach@mit.edu, 16-Aug-2001
19  c  c
20    c     changed: heimbach@mit.edu 17-Jun-2003
21    c              merged Armin's changes to replace write of
22    c              nr * globfld2d by 1 * globfld3d
23    c              (ad hoc fix to speed up global I/O)
24    c
25  c     ==================================================================  c     ==================================================================
26    
27        implicit none        implicit none
# Line 44  c     == local variables == Line 54  c     == local variables ==
54    
55        integer bi,bj        integer bi,bj
56        integer ip,jp        integer ip,jp
57        integer i,j        integer i,j,k
58        integer itlo,ithi        integer itlo,ithi
59        integer jtlo,jthi        integer jtlo,jthi
60        integer jmin,jmax        integer jmin,jmax
61        integer imin,imax        integer imin,imax
62        integer irec        integer irec,nrec_nl
63    
64        _RL     globfld2d( snx,nsx,npx,sny,nsy,npy )        _RL     globfld2d( snx,nsx,npx,sny,nsy,npy )
65          _RL     globfld3d( snx,nsx,npx,sny,nsy,npy,nr )
66    
67  c     == external ==  c     == external ==
68    
# Line 73  c     Initialise temporary file Line 84  c     Initialise temporary file
84                 do ip = 1,nPx                 do ip = 1,nPx
85                    do bi = itlo,ithi                    do bi = itlo,ithi
86                       do i = imin,imax                       do i = imin,imax
 #ifdef ALLOW_TANGENTLINEAR_RUN  
87                          globfld2d(i,bi,ip,j,bj,jp) = 0. _d 0                          globfld2d(i,bi,ip,j,bj,jp) = 0. _d 0
88  #else                       enddo
89                          globfld2d(i,bi,ip,j,bj,jp) = 0. _d 0                    enddo
90  #endif                 enddo
91                enddo
92             enddo
93          enddo
94    c     Initialise temporary file
95          do k = 1,nr
96             do jp = 1,nPy
97                do bj = jtlo,jthi
98                   do j = jmin,jmax
99                      do ip = 1,nPx
100                         do bi = itlo,ithi
101                            do i = imin,imax
102                               globfld3d(i,bi,ip,j,bj,jp,k) = 0. _d 0
103                            enddo
104                       enddo                       enddo
105                    enddo                    enddo
106                 enddo                 enddo
# Line 92  c     Initialise temporary file Line 115  c     Initialise temporary file
115  c--   Only the master thread will do I/O.  c--   Only the master thread will do I/O.
116        _BEGIN_MASTER( mythid )        _BEGIN_MASTER( mythid )
117    
118        do irec = 1, ncvarrecs(ivartype)        nrec_nl=int(ncvarrecs(ivartype)/Nr)
119          do irec = 1,  nrec_nl
120             call MDSWRITEFIELD_3D_GL( fname, ctrlprec, 'RL',
121         &        Nr, globfld3d,
122         &        irec,   optimcycle,  mythid)
123          enddo
124    
125          do irec = nrec_nl*Nr+1, ncvarrecs(ivartype)
126           call MDSWRITEFIELD_2D_GL( fname, ctrlprec, 'RL',           call MDSWRITEFIELD_2D_GL( fname, ctrlprec, 'RL',
127       &        1, globfld2d,       &        1, globfld2d,
128       &        irec,   optimcycle,  mythid)       &        irec,   optimcycle,  mythid)

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

  ViewVC Help
Powered by ViewVC 1.1.22