/[MITgcm]/MITgcm/pkg/autodiff/adread_adwrite.F
ViewVC logotype

Diff of /MITgcm/pkg/autodiff/adread_adwrite.F

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

revision 1.2 by heimbach, Fri Jul 13 13:33:49 2001 UTC revision 1.3 by heimbach, Fri Sep 28 04:19:27 2001 UTC
# Line 57  c Line 57  c
57  c     ==================================================================  c     ==================================================================
58    
59    
60    CBOP
61    C     !ROUTINE: adread
62    C     !INTERFACE:
63        subroutine adread(        subroutine adread(
64       I                   mythid,       I                   mythid,
65       I                   name,       I                   name,
# Line 69  c     ================================== Line 72  c     ==================================
72       I                   irec       I                   irec
73       &                 )       &                 )
74    
75    C     !DESCRIPTION: \bv
76  c     ==================================================================  c     ==================================================================
77  c     SUBROUTINE adread  c     SUBROUTINE adread
78  c     ==================================================================  c     ==================================================================
 c  
79  c     o Read direct access file.  c     o Read direct access file.
 c  
80  c     A call to this routine implies an open-read-close sequence  c     A call to this routine implies an open-read-close sequence
81  c     since it uses the MITgcmUV i/o routine MDSREADVECTOR. Only  c     since it uses the MITgcmUV i/o routine MDSREADVECTOR. Only
82  c     the master thread reads the data. Otherwise each thread would  c     the master thread reads the data. Otherwise each thread would
83  c     read from file.  c     read from file.
 c  
84  c     started: Christian Eckert eckert@mit.edu 30-Jun-1999  c     started: Christian Eckert eckert@mit.edu 30-Jun-1999
 c  
 c     changed: Christian Eckert eckert@mit.edu 15-Feb-2000  
 c  
 c              - Restructured the code in order to create a package  
 c                for the MITgcmUV.  
 c  
 c     changed: Patrick Heimbach heimbach@mit.edu 27-May-2000  
 c  
 c              - changed subroutine parameter list: skipped myiter  
 c  
85  c     ==================================================================  c     ==================================================================
86  c     SUBROUTINE adread  c     SUBROUTINE adread
87  c     ==================================================================  c     ==================================================================
88    C     \ev
89    
90    C     !USES:
91        implicit none        implicit none
92    
93  c     == global variables ==  c     == global variables ==
   
94  #include "EEPARAMS.h"  #include "EEPARAMS.h"
95  #include "SIZE.h"  #include "SIZE.h"
96  #include "ctrl.h"  #include "ctrl.h"
97  #include "optim.h"  #include "optim.h"
98    
99    C     !INPUT/OUTPUT PARAMETERS:
100  c     == routine arguments ==  c     == routine arguments ==
101    c     name   -  extended tape name.
102    c     len    -  number of characters in name.
103    c     tid    -  tape identifier.
104    c     vid    -  identifies the variable to be stored on tape.
105    c     var    -  values to be stored.
106    c     size   -  size in bytes of the type of variable var.
107    c     length -  dimension of the variable stored on the tape.
108    c     mythid -  number of the thread or instance of the program.
109    c     irec   -  record number to be written.
110    
111        integer mythid        integer mythid
112        character*(*) name        character*(*) name
# Line 116  c     == routine arguments == Line 118  c     == routine arguments ==
118        integer irec        integer irec
119        _RL     var(length)        _RL     var(length)
120    
121    C     !LOCAL VARIABLES:
122  c     == local variables ==  c     == local variables ==
   
123        character*(7) itername        character*(7) itername
124        character*(80) fname        character*(80) fname
125        integer il        integer il
126        integer bx,by        integer bx,by
127    
128  c     == functions ==  c     == functions ==
   
129        integer  ilnblnk        integer  ilnblnk
130        external ilnblnk        external ilnblnk
131    
132  c     == end of interface ==  c     == end of interface ==
133    CEOP
134    
135        write(fname(1:80),'(a)') ' '        write(fname(1:80),'(a)') ' '
136        write(itername,'(a,i4.4)') '.it',optimcycle        write(itername,'(a,i4.4)') '.it',optimcycle
# Line 151  c     Everyone must wait for the read op Line 153  c     Everyone must wait for the read op
153        end        end
154    
155    
156    CBOP
157    C     !ROUTINE: adwrite
158    C     !INTERFACE:
159        subroutine adwrite(        subroutine adwrite(
160       I                    mythid,       I                    mythid,
161       I                    name,       I                    name,
# Line 163  c     Everyone must wait for the read op Line 168  c     Everyone must wait for the read op
168       I                    irec       I                    irec
169       &                  )       &                  )
170    
171    C     !DESCRIPTION: \bv
172  c     ==================================================================  c     ==================================================================
173  c     SUBROUTINE adwrite  c     SUBROUTINE adwrite
174  c     ==================================================================  c     ==================================================================
 c  
175  c     o Write to direct access file.  c     o Write to direct access file.
 c  
176  c     A call to this routine implies an open-read-close sequence  c     A call to this routine implies an open-read-close sequence
177  c     since it uses the MITgcmUV i/o routine MDSREADVECTOR. Only  c     since it uses the MITgcmUV i/o routine MDSREADVECTOR. Only
178  c     the master thread writes the data. Otherwise each thread would  c     the master thread writes the data. Otherwise each thread would
179  c     write to file. This would result in an excessive waste of  c     write to file. This would result in an excessive waste of
180  c     disk space.  c     disk space.
 c  
181  c     started: Christian Eckert eckert@mit.edu 30-Jun-1999  c     started: Christian Eckert eckert@mit.edu 30-Jun-1999
 c  
 c     changed: Christian Eckert eckert@mit.edu 15-Feb-2000  
 c  
 c              - Restructured the code in order to create a package  
 c                for the MITgcmUV.  
 c  
 c     changed: Patrick Heimbach heimbach@mit.edu 27-May-2000  
 c  
 c              - changed subroutine parameter list: skipped myiter  
 c  
182  c     ==================================================================  c     ==================================================================
183  c     SUBROUTINE adwrite  c     SUBROUTINE adwrite
184  c     ==================================================================  c     ==================================================================
185    C     \ev
186    
187    C     !USES:
188        implicit none        implicit none
189    
190  c     == global variables ==  c     == global variables ==
   
191  #include "EEPARAMS.h"  #include "EEPARAMS.h"
192  #include "SIZE.h"  #include "SIZE.h"
193  #include "ctrl.h"  #include "ctrl.h"
194  #include "optim.h"  #include "optim.h"
195    
196    C     !INPUT/OUTPUT PARAMETERS:
197  c     == routine arguments ==  c     == routine arguments ==
198    c     name   -  extended tape name.
199    c     len    -  number of characters in name.
200    c     tid    -  tape identifier.
201    c     vid    -  identifies the variable to be stored on tape.
202    c     var    -  values to be stored.
203    c     size   -  size in bytes of the type of variable var.
204    c     length -  dimension of the variable stored on the tape.
205    c     mythid -  number of the thread or instance of the program.
206    c     irec   -  record number to be written.
207    
208        integer mythid        integer mythid
209        character*(*) name        character*(*) name
# Line 211  c     == routine arguments == Line 215  c     == routine arguments ==
215        integer irec        integer irec
216        _RL     var(length)        _RL     var(length)
217    
218    C     !LOCAL VARIABLES:
219  c     == local variables ==  c     == local variables ==
   
220        character*(7) itername        character*(7) itername
221        character*(80) fname        character*(80) fname
222        integer il        integer il
# Line 220  c     == local variables == Line 224  c     == local variables ==
224        logical globalfile        logical globalfile
225    
226  c     == functions ==  c     == functions ==
   
227        integer ilnblnk        integer ilnblnk
228        external ilnblnk        external ilnblnk
229    
230  c     == end of interface ==  c     == end of interface ==
231    CEOP
232    
233        globalfile = .false.        globalfile = .false.
234        il         = ilnblnk( name )        il         = ilnblnk( name )

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

  ViewVC Help
Powered by ViewVC 1.1.22