/[MITgcm]/MITgcm/model/src/plot_field.F
ViewVC logotype

Diff of /MITgcm/model/src/plot_field.F

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

revision 1.1 by cnh, Wed Apr 22 19:15:30 1998 UTC revision 1.6 by cnh, Tue Sep 29 18:50:57 1998 UTC
# Line 1  Line 1 
1  C $Id$  C $Header$
2    
3  #include "CPP_EEOPTIONS.h"  #include "CPP_EEOPTIONS.h"
4    
5  C--   File plot_field.F: Routines for "formatted" I/O in the MITgcm UV  C--   File plot_field.F: Routines for "formatted" I/O in the MITgcm UV
6  C--                      implementation.  C--                      implementation.
7  C--    Contents  C--    Contents
8  C--    o plot_field_xyr4  - Writes a XY  Real*4 field  C--    o plot_field_xyrs  - Writes a XY  _RS field
9  C--    o plot_field_xyr8  - Writes a XY  Real*8 field  C--    o plot_field_xyrl  - Writes a XY  _RL field
10  C--    o plot_field_xyzr4 - Writes a XYZ Real*4 field  C--    o plot_field_xyzrs - Writes a XYZ _RS field
11  C--    o plot_field_xyzr8 - Writes a XYZ Real*8 field  C--    o plot_field_xyzrl - Writes a XYZ _RL field
12        SUBROUTINE PLOT_FIELD_XYR4(        SUBROUTINE PLOT_FIELD_XYRS(
13       I                            fld, fldNam , myIter, myThid )       I                            fld, fldNam , myIter, myThid )
14    
15  C     /==========================================================\  C     /==========================================================\
16  C     | SUBROUTINE PLOT_FIELD_XYR4                               |  C     | SUBROUTINE PLOT_FIELD_XYRS                               |
17  C     | Print out an XY Real 4 field using text map.             |  C     | Print out an XY _RS field using text map.                |
18  C     |==========================================================|  C     |==========================================================|
19  C     | This routine references "numerical model" parameters like|  C     | This routine references "numerical model" parameters like|
20  C     | like the integration time. It uses these to create a     |  C     | like the integration time. It uses these to create a     |
# Line 24  C     | This routine can also be edited Line 24  C     | This routine can also be edited
24  C     | of a field to be printed by default, or every other      |  C     | of a field to be printed by default, or every other      |
25  C     | point etc..                                              |  C     | point etc..                                              |
26  C     | Other plot formats can also be substituted here.         |  C     | Other plot formats can also be substituted here.         |
27    C     | _RS is usually REAL*4                                    |
28  C     \==========================================================/  C     \==========================================================/
29  #include "SIZE.h"  #include "SIZE.h"
30  #include "EEPARAMS.h"  #include "EEPARAMS.h"
# Line 35  C     fld - Field to plot Line 36  C     fld - Field to plot
36  C     fldNam - Name of field  C     fldNam - Name of field
37  C     myIter - Iteration number for plot  C     myIter - Iteration number for plot
38  C     myThid - Thread id of thread instance calling plot_field  C     myThid - Thread id of thread instance calling plot_field
39        Real*4 fld(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)        _RS fld(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
40        CHARACTER*(*) fldNam        CHARACTER*(*) fldNam
41        INTEGER myThid        INTEGER myThid
42        INTEGER myIter        INTEGER myIter
# Line 50  C     == Local variables == Line 51  C     == Local variables ==
51    
52  C--   To get around synchronisation and multi-threaded I/O issues  C--   To get around synchronisation and multi-threaded I/O issues
53  C--   thread 1 will do all the writes.  C--   thread 1 will do all the writes.
54          _BARRIER
55        IF ( myThid .EQ. 1 ) THEN        IF ( myThid .EQ. 1 ) THEN
56  C--    Form name for identifying "plot"  C--    Form name for identifying "plot"
57         IF ( myIter .GE. 0 ) THEN         IF ( myIter .GE. 0 ) THEN
58          WRITE(fldTitle,'(A,A,A,I4)') '// Field ', fldNam, ' at iteration ',          WRITE(fldTitle,'(A,A,A,I10)') '// Field ', fldNam, ' at iteration ',
59       &  myIter       &  myIter
60         ELSE         ELSE
61          WRITE(fldTitle,'(A,A)') '// Field ', fldNam          WRITE(fldTitle,'(A,A)') '// Field ', fldNam
# Line 75  C      Substitute other plotting utiliti Line 77  C      Substitute other plotting utiliti
77         bjStart  =  nSy         bjStart  =  nSy
78         bjEnd    =  1             bjEnd    =  1    
79         bjStride = -1         bjStride = -1
80         CALL PRINT_MAPR4(         CALL PRINT_MAPRS(
81       I        fld, fldTitle, PRINT_MAP_XY,       I        fld, fldTitle, PRINT_MAP_XY,
82       I         1-OLx,sNx+OLx,1-OLy,sNy+OLy,1,1,  nSx,  nSy,       I         1-OLx,sNx+OLx,1-OLy,sNy+OLy,1,1,  nSx,  nSy,
83       I         iStart,   iEnd,  iStride,       I         iStart,   iEnd,  iStride,
# Line 84  C      Substitute other plotting utiliti Line 86  C      Substitute other plotting utiliti
86       I        biStart,  biEnd, biStride,       I        biStart,  biEnd, biStride,
87       I        bjStart,  bjEnd, bjStride )       I        bjStart,  bjEnd, bjStride )
88        ENDIF        ENDIF
89          _BARRIER
90    
91        RETURN        RETURN
92        END        END
93        SUBROUTINE PLOT_FIELD_XYR8(        SUBROUTINE PLOT_FIELD_XYRL(
94       I                            fld, fldNam , myIter, myThid )       I                            fld, fldNam , myIter, myThid )
95    
96  C     /==========================================================\  C     /==========================================================\
97  C     | SUBROUTINE PLOT_FIELD_XYR8                               |  C     | SUBROUTINE PLOT_FIELD_XYRL                               |
98  C     | Print out an XY Real 8 field using text map.             |  C     | Print out an XY _RL field using text map.                |
99  C     |==========================================================|  C     |==========================================================|
100  C     | This routine references "numerical model" parameters like|  C     | This routine references "numerical model" parameters like|
101  C     | like the integration time. It uses these to create a     |  C     | like the integration time. It uses these to create a     |
# Line 102  C     | This routine can also be edited Line 105  C     | This routine can also be edited
105  C     | of a field to be printed by default, or every other      |  C     | of a field to be printed by default, or every other      |
106  C     | point etc..                                              |  C     | point etc..                                              |
107  C     | Other plot formats can also be substituted here.         |  C     | Other plot formats can also be substituted here.         |
108    C     | _RL is usually REAL*8                                    |
109  C     \==========================================================/  C     \==========================================================/
110  #include "SIZE.h"  #include "SIZE.h"
111  #include "EEPARAMS.h"  #include "EEPARAMS.h"
# Line 113  C     fld - Field to plot Line 117  C     fld - Field to plot
117  C     fldNam - Name of field  C     fldNam - Name of field
118  C     myIter - Iteration number for plot  C     myIter - Iteration number for plot
119  C     myThid - Thread id of thread instance calling plot_field  C     myThid - Thread id of thread instance calling plot_field
120        REAL fld(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)        _RL fld(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
121        CHARACTER*(*) fldNam        CHARACTER*(*) fldNam
122        INTEGER myThid        INTEGER myThid
123        INTEGER myIter        INTEGER myIter
# Line 128  C     == Local variables == Line 132  C     == Local variables ==
132    
133  C--   To get around synchronisation and multi-threaded I/O issues  C--   To get around synchronisation and multi-threaded I/O issues
134  C--   thread 1 will do all the writes.  C--   thread 1 will do all the writes.
135          _BARRIER
136        IF ( myThid .EQ. 1 ) THEN        IF ( myThid .EQ. 1 ) THEN
137  C--    Form name for identifying "plot"  C--    Form name for identifying "plot"
138         IF ( myIter .GE. 0 ) THEN         IF ( myIter .GE. 0 ) THEN
139          WRITE(fldTitle,'(A,A,A,I4)') '// Field ', fldNam, ' at iteration ',          WRITE(fldTitle,'(A,A,A,I10)') '// Field ', fldNam, ' at iteration ',
140       &  myIter       &  myIter
141         ELSE         ELSE
142          WRITE(fldTitle,'(A,A)') '// Field ', fldNam          WRITE(fldTitle,'(A,A)') '// Field ', fldNam
# Line 153  C      Substitute other plotting utiliti Line 158  C      Substitute other plotting utiliti
158         bjStart  =  nSy         bjStart  =  nSy
159         bjEnd    =  1             bjEnd    =  1    
160         bjStride = -1         bjStride = -1
161         CALL PRINT_MAPR8(         CALL PRINT_MAPRL(
162       I        fld, fldTitle, PRINT_MAP_XY,       I        fld, fldTitle, PRINT_MAP_XY,
163       I         1-OLx,sNx+OLx,1-OLy,sNy+OLy,1,1,  nSx,  nSy,       I         1-OLx,sNx+OLx,1-OLy,sNy+OLy,1,1,  nSx,  nSy,
164       I         iStart,   iEnd,  iStride,       I         iStart,   iEnd,  iStride,
# Line 162  C      Substitute other plotting utiliti Line 167  C      Substitute other plotting utiliti
167       I        biStart,  biEnd, biStride,       I        biStart,  biEnd, biStride,
168       I        bjStart,  bjEnd, bjStride )       I        bjStart,  bjEnd, bjStride )
169        ENDIF        ENDIF
170          _BARRIER
171    
172        RETURN        RETURN
173        END        END
174        SUBROUTINE PLOT_FIELD_XYZR4(        SUBROUTINE PLOT_FIELD_XYZRS(
175       I                            fld, fldNam , fldNz, myIter, myThid )       I                            fld, fldNam , fldNz, myIter, myThid )
176    
177  C     /==========================================================\  C     /==========================================================\
178  C     | SUBROUTINE PLOT_FIELD_XYZR4                              |  C     | SUBROUTINE PLOT_FIELD_XYZR4                              |
179  C     | Print out an XYZ Real 4 field using text map.            |  C     | Print out an XYZ _RS field using text map.               |
180  C     |==========================================================|  C     |==========================================================|
181  C     | This routine references "numerical model" parameters like|  C     | This routine references "numerical model" parameters like|
182  C     | like the integration time. It uses these to create a     |  C     | like the integration time. It uses these to create a     |
# Line 180  C     | This routine can also be edited Line 186  C     | This routine can also be edited
186  C     | of a field to be printed by default, or every other      |  C     | of a field to be printed by default, or every other      |
187  C     | point etc..                                              |  C     | point etc..                                              |
188  C     | Other plot formats can also be substituted here.         |  C     | Other plot formats can also be substituted here.         |
189    C     | _RS is usually a REAL*4 field                            |
190  C     \==========================================================/  C     \==========================================================/
191  #include "SIZE.h"  #include "SIZE.h"
192  #include "EEPARAMS.h"  #include "EEPARAMS.h"
# Line 196  C              (same lateral extents. Line 203  C              (same lateral extents.
203  C     myIter - Iteration number for plot  C     myIter - Iteration number for plot
204  C     myThid - Thread id of thread instance calling plot_field  C     myThid - Thread id of thread instance calling plot_field
205        INTEGER fldNz        INTEGER fldNz
206        Real*4 fld(1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:fldNz,nSx,nSy)        _RS fld(1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:fldNz,nSx,nSy)
207        CHARACTER*(*) fldNam        CHARACTER*(*) fldNam
208        INTEGER myThid        INTEGER myThid
209        INTEGER myIter        INTEGER myIter
# Line 211  C     == Local variables == Line 218  C     == Local variables ==
218    
219  C--   To get around synchronisation and multi-threaded I/O issues  C--   To get around synchronisation and multi-threaded I/O issues
220  C--   thread 1 will do all the writes.  C--   thread 1 will do all the writes.
221          _BARRIER
222        IF ( myThid .EQ. 1 ) THEN        IF ( myThid .EQ. 1 ) THEN
223  C--    Form name for identifying "plot"  C--    Form name for identifying "plot"
224         IF ( myIter .GE. 0 ) THEN         IF ( myIter .GE. 0 ) THEN
225          WRITE(fldTitle,'(A,A,A,I4)') '// Field ', fldNam, ' at iteration ',          WRITE(fldTitle,'(A,A,A,I10)') '// Field ', fldNam, ' at iteration ',
226       &  myIter       &  myIter
227         ELSE         ELSE
228          WRITE(fldTitle,'(A,A)') '// Field ', fldNam          WRITE(fldTitle,'(A,A)') '// Field ', fldNam
# Line 233  C      jEnd     =  1 Line 241  C      jEnd     =  1
241         jStride  = -1         jStride  = -1
242         kStart   =  1         kStart   =  1
243         kEnd     =  fldNz         kEnd     =  fldNz
244  C      kEnd     =  1         kEnd     =  1
245         kStride  =  1         kStride  =  1
246         biStart  =  1         biStart  =  1
247         biEnd    =  nSx         biEnd    =  nSx
# Line 241  C      kEnd     =  1 Line 249  C      kEnd     =  1
249         bjStart  =  nSy         bjStart  =  nSy
250         bjEnd    =  1             bjEnd    =  1    
251         bjStride = -1         bjStride = -1
252  C      CALL PRINT_MAPR8(         CALL PRINT_MAPRS(
 C    I        fld, fldTitle, PRINT_MAP_YZ,  
 C    I         1-OLx,sNx+OLx,1-OLy,sNy+OLy,1,fldNz,  nSx,  nSy,  
 C    I         iStart,   iEnd,  iStride,  
 C    I         jStart,   jEnd,  jStride,  
 C    I         kStart,   kEnd,  kStride,  
 C    I        biStart,  biEnd, biStride,  
 C    I        bjStart,  bjEnd, bjStride )  
        CALL PRINT_MAPR4(  
253       I        fld, fldTitle, PRINT_MAP_XY,       I        fld, fldTitle, PRINT_MAP_XY,
254       I         1-OLx,sNx+OLx,1-OLy,sNy+OLy,1,fldNz,  nSx,  nSy,       I         1-OLx,sNx+OLx,1-OLy,sNy+OLy,1,fldNz,  nSx,  nSy,
255       I         iStart,   iEnd,  iStride,       I         iStart,   iEnd,  iStride,
# Line 258  C    I        bjStart,  bjEnd, bjStride Line 258  C    I        bjStart,  bjEnd, bjStride
258       I        biStart,  biEnd, biStride,       I        biStart,  biEnd, biStride,
259       I        bjStart,  bjEnd, bjStride )       I        bjStart,  bjEnd, bjStride )
260        ENDIF        ENDIF
261          _BARRIER
262    
263        RETURN        RETURN
264        END        END
265        SUBROUTINE PLOT_FIELD_XYZR8(        SUBROUTINE PLOT_FIELD_XYZRL(
266       I                            fld, fldNam , fldNz, myIter, myThid )       I                            fld, fldNam , fldNz, myIter, myThid )
267    
268  C     /==========================================================\  C     /==========================================================\
269  C     | SUBROUTINE PLOT_FIELD_XYZR8                              |  C     | SUBROUTINE PLOT_FIELD_XYZRL                              |
270  C     | Print out an XYZ Real 8 field using text map.            |  C     | Print out an XYZ _RL field using text map.               |
271  C     |==========================================================|  C     |==========================================================|
272  C     | This routine references "numerical model" parameters like|  C     | This routine references "numerical model" parameters like|
273  C     | like the integration time. It uses these to create a     |  C     | like the integration time. It uses these to create a     |
# Line 276  C     | This routine can also be edited Line 277  C     | This routine can also be edited
277  C     | of a field to be printed by default, or every other      |  C     | of a field to be printed by default, or every other      |
278  C     | point etc..                                              |  C     | point etc..                                              |
279  C     | Other plot formats can also be substituted here.         |  C     | Other plot formats can also be substituted here.         |
280    C     | _RL is usually a REAL*8 field                            |
281  C     \==========================================================/  C     \==========================================================/
282  #include "SIZE.h"  #include "SIZE.h"
283  #include "EEPARAMS.h"  #include "EEPARAMS.h"
# Line 292  C              (same lateral extents. Line 294  C              (same lateral extents.
294  C     myIter - Iteration number for plot  C     myIter - Iteration number for plot
295  C     myThid - Thread id of thread instance calling plot_field  C     myThid - Thread id of thread instance calling plot_field
296        INTEGER fldNz        INTEGER fldNz
297        REAL fld(1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:fldNz,nSx,nSy)        _RL fld(1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:fldNz,nSx,nSy)
298        CHARACTER*(*) fldNam        CHARACTER*(*) fldNam
299        INTEGER myThid        INTEGER myThid
300        INTEGER myIter        INTEGER myIter
# Line 307  C     == Local variables == Line 309  C     == Local variables ==
309    
310  C--   To get around synchronisation and multi-threaded I/O issues  C--   To get around synchronisation and multi-threaded I/O issues
311  C--   thread 1 will do all the writes.  C--   thread 1 will do all the writes.
312          _BARRIER
313        IF ( myThid .EQ. 1 ) THEN        IF ( myThid .EQ. 1 ) THEN
314  C--    Form name for identifying "plot"  C--    Form name for identifying "plot"
315         IF ( myIter .GE. 0 ) THEN         IF ( myIter .GE. 0 ) THEN
316          WRITE(fldTitle,'(A,A,A,I4)') '// Field ', fldNam, ' at iteration ',          WRITE(fldTitle,'(A,A,A,I10)') '// Field ', fldNam, ' at iteration ',
317       &  myIter       &  myIter
318         ELSE         ELSE
319          WRITE(fldTitle,'(A,A)') '// Field ', fldNam          WRITE(fldTitle,'(A,A)') '// Field ', fldNam
# Line 319  C--    Do "plot" using textual contour m Line 322  C--    Do "plot" using textual contour m
322  C      Substitute other plotting utilities here!  C      Substitute other plotting utilities here!
323         iStart   =  1-OLx         iStart   =  1-OLx
324         iEnd     =  sNx+OLx         iEnd     =  sNx+OLx
325  C      iStart   =  1         iStart   =  1
326  C      iEnd     =  sNx         iEnd     =  sNx
327         iStride  =  1         iStride  =  1
328         jStart   =  sNy+OLy         jStart   =  sNy+OLy
329         jEnd     =  1-OLy         jEnd     =  1-OLy
330  C      jStart   =  sNy         jStart   =  sNy
331  C      jEnd     =  1         jEnd     =  1
332         jStride  = -1         jStride  = -1
333         kStart   =  1         kStart   =  1
334         kEnd     =  fldNz         kEnd     =  fldNz
# Line 337  C      jEnd     =  1 Line 340  C      jEnd     =  1
340         bjStart  =  nSy         bjStart  =  nSy
341         bjEnd    =  1             bjEnd    =  1    
342         bjStride = -1         bjStride = -1
343  C      CALL PRINT_MAPR8(         CALL PRINT_MAPRL(
 C    I        fld, fldTitle, PRINT_MAP_YZ,  
 C    I         1-OLx,sNx+OLx,1-OLy,sNy+OLy,1,fldNz,  nSx,  nSy,  
 C    I         iStart,   iEnd,  iStride,  
 C    I         jStart,   jEnd,  jStride,  
 C    I         kStart,   kEnd,  kStride,  
 C    I        biStart,  biEnd, biStride,  
 C    I        bjStart,  bjEnd, bjStride )  
        CALL PRINT_MAPR8(  
344       I        fld, fldTitle, PRINT_MAP_XY,       I        fld, fldTitle, PRINT_MAP_XY,
345       I         1-OLx,sNx+OLx,1-OLy,sNy+OLy,1,fldNz,  nSx,  nSy,       I         1-OLx,sNx+OLx,1-OLy,sNy+OLy,1,fldNz,  nSx,  nSy,
346       I         iStart,   iEnd,  iStride,       I         iStart,   iEnd,  iStride,
# Line 354  C    I        bjStart,  bjEnd, bjStride Line 349  C    I        bjStart,  bjEnd, bjStride
349       I        biStart,  biEnd, biStride,       I        biStart,  biEnd, biStride,
350       I        bjStart,  bjEnd, bjStride )       I        bjStart,  bjEnd, bjStride )
351        ENDIF        ENDIF
352          _BARRIER
353    
354        RETURN        RETURN
355        END        END

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

  ViewVC Help
Powered by ViewVC 1.1.22