1 |
C $Header$ |
C $Header$ |
2 |
|
C $Name$ |
3 |
|
|
4 |
#include "CPP_EEOPTIONS.h" |
#include "CPP_OPTIONS.h" |
5 |
|
|
6 |
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 |
7 |
C-- implementation. |
C-- implementation. |
8 |
C-- Contents |
C-- Contents |
9 |
C-- o plot_field_xyr4 - Writes a XY Real*4 field |
C-- o plot_field_xyrs - Writes a XY _RS field |
10 |
C-- o plot_field_xyr8 - Writes a XY Real*8 field |
C-- o plot_field_xyrl - Writes a XY _RL field |
11 |
C-- o plot_field_xyzr4 - Writes a XYZ Real*4 field |
C-- o plot_field_xyzrs - Writes a XYZ _RS field |
12 |
C-- o plot_field_xyzr8 - Writes a XYZ Real*8 field |
C-- o plot_field_xyzrl - Writes a XYZ _RL field |
13 |
SUBROUTINE PLOT_FIELD_XYR4( |
SUBROUTINE PLOT_FIELD_XYRS( |
14 |
I fld, fldNam , myIter, myThid ) |
I fld, fldNam , myIter, myThid ) |
15 |
|
|
16 |
C /==========================================================\ |
C /==========================================================\ |
17 |
C | SUBROUTINE PLOT_FIELD_XYR4 | |
C | SUBROUTINE PLOT_FIELD_XYRS | |
18 |
C | Print out an XY Real 4 field using text map. | |
C | Print out an XY _RS field using text map. | |
19 |
C |==========================================================| |
C |==========================================================| |
20 |
C | This routine references "numerical model" parameters like| |
C | This routine references "numerical model" parameters like| |
21 |
C | like the integration time. It uses these to create a | |
C | like the integration time. It uses these to create a | |
25 |
C | of a field to be printed by default, or every other | |
C | of a field to be printed by default, or every other | |
26 |
C | point etc.. | |
C | point etc.. | |
27 |
C | Other plot formats can also be substituted here. | |
C | Other plot formats can also be substituted here. | |
28 |
|
C | _RS is usually REAL*4 | |
29 |
C \==========================================================/ |
C \==========================================================/ |
30 |
|
IMPLICIT NONE |
31 |
|
|
32 |
#include "SIZE.h" |
#include "SIZE.h" |
33 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
34 |
#include "PARAMS.h" |
#include "PARAMS.h" |
39 |
C fldNam - Name of field |
C fldNam - Name of field |
40 |
C myIter - Iteration number for plot |
C myIter - Iteration number for plot |
41 |
C myThid - Thread id of thread instance calling plot_field |
C myThid - Thread id of thread instance calling plot_field |
42 |
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) |
43 |
CHARACTER*(*) fldNam |
CHARACTER*(*) fldNam |
44 |
INTEGER myThid |
INTEGER myThid |
45 |
INTEGER myIter |
INTEGER myIter |
54 |
|
|
55 |
C-- To get around synchronisation and multi-threaded I/O issues |
C-- To get around synchronisation and multi-threaded I/O issues |
56 |
C-- thread 1 will do all the writes. |
C-- thread 1 will do all the writes. |
57 |
|
_BARRIER |
58 |
IF ( myThid .EQ. 1 ) THEN |
IF ( myThid .EQ. 1 ) THEN |
59 |
C-- Form name for identifying "plot" |
C-- Form name for identifying "plot" |
60 |
IF ( myIter .GE. 0 ) THEN |
IF ( myIter .GE. 0 ) THEN |
61 |
WRITE(fldTitle,'(A,A,A,I10)') '// Field ', fldNam, ' at iteration ', |
WRITE(fldTitle,'(A,A,A,I10)') |
62 |
|
& '// Field ', fldNam, ' at iteration ', |
63 |
& myIter |
& myIter |
64 |
ELSE |
ELSE |
65 |
WRITE(fldTitle,'(A,A)') '// Field ', fldNam |
WRITE(fldTitle,'(A,A)') '// Field ', fldNam |
81 |
bjStart = nSy |
bjStart = nSy |
82 |
bjEnd = 1 |
bjEnd = 1 |
83 |
bjStride = -1 |
bjStride = -1 |
84 |
CALL PRINT_MAPR4( |
CALL PRINT_MAPRS( |
85 |
I fld, fldTitle, PRINT_MAP_XY, |
I fld, fldTitle, PRINT_MAP_XY, |
86 |
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, |
87 |
I iStart, iEnd, iStride, |
I iStart, iEnd, iStride, |
90 |
I biStart, biEnd, biStride, |
I biStart, biEnd, biStride, |
91 |
I bjStart, bjEnd, bjStride ) |
I bjStart, bjEnd, bjStride ) |
92 |
ENDIF |
ENDIF |
93 |
|
_BARRIER |
94 |
|
|
95 |
RETURN |
RETURN |
96 |
END |
END |
97 |
SUBROUTINE PLOT_FIELD_XYR8( |
SUBROUTINE PLOT_FIELD_XYRL( |
98 |
I fld, fldNam , myIter, myThid ) |
I fld, fldNam , myIter, myThid ) |
99 |
|
|
100 |
C /==========================================================\ |
C /==========================================================\ |
101 |
C | SUBROUTINE PLOT_FIELD_XYR8 | |
C | SUBROUTINE PLOT_FIELD_XYRL | |
102 |
C | Print out an XY Real 8 field using text map. | |
C | Print out an XY _RL field using text map. | |
103 |
C |==========================================================| |
C |==========================================================| |
104 |
C | This routine references "numerical model" parameters like| |
C | This routine references "numerical model" parameters like| |
105 |
C | like the integration time. It uses these to create a | |
C | like the integration time. It uses these to create a | |
109 |
C | of a field to be printed by default, or every other | |
C | of a field to be printed by default, or every other | |
110 |
C | point etc.. | |
C | point etc.. | |
111 |
C | Other plot formats can also be substituted here. | |
C | Other plot formats can also be substituted here. | |
112 |
|
C | _RL is usually REAL*8 | |
113 |
C \==========================================================/ |
C \==========================================================/ |
114 |
|
IMPLICIT NONE |
115 |
|
|
116 |
#include "SIZE.h" |
#include "SIZE.h" |
117 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
118 |
#include "PARAMS.h" |
#include "PARAMS.h" |
123 |
C fldNam - Name of field |
C fldNam - Name of field |
124 |
C myIter - Iteration number for plot |
C myIter - Iteration number for plot |
125 |
C myThid - Thread id of thread instance calling plot_field |
C myThid - Thread id of thread instance calling plot_field |
126 |
REAL fld(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RL fld(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
127 |
CHARACTER*(*) fldNam |
CHARACTER*(*) fldNam |
128 |
INTEGER myThid |
INTEGER myThid |
129 |
INTEGER myIter |
INTEGER myIter |
138 |
|
|
139 |
C-- To get around synchronisation and multi-threaded I/O issues |
C-- To get around synchronisation and multi-threaded I/O issues |
140 |
C-- thread 1 will do all the writes. |
C-- thread 1 will do all the writes. |
141 |
|
_BARRIER |
142 |
IF ( myThid .EQ. 1 ) THEN |
IF ( myThid .EQ. 1 ) THEN |
143 |
C-- Form name for identifying "plot" |
C-- Form name for identifying "plot" |
144 |
IF ( myIter .GE. 0 ) THEN |
IF ( myIter .GE. 0 ) THEN |
145 |
WRITE(fldTitle,'(A,A,A,I10)') '// Field ', fldNam, ' at iteration ', |
WRITE(fldTitle,'(A,A,A,I10)') |
146 |
|
& '// Field ', fldNam, ' at iteration ', |
147 |
& myIter |
& myIter |
148 |
ELSE |
ELSE |
149 |
WRITE(fldTitle,'(A,A)') '// Field ', fldNam |
WRITE(fldTitle,'(A,A)') '// Field ', fldNam |
165 |
bjStart = nSy |
bjStart = nSy |
166 |
bjEnd = 1 |
bjEnd = 1 |
167 |
bjStride = -1 |
bjStride = -1 |
168 |
CALL PRINT_MAPR8( |
CALL PRINT_MAPRL( |
169 |
I fld, fldTitle, PRINT_MAP_XY, |
I fld, fldTitle, PRINT_MAP_XY, |
170 |
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, |
171 |
I iStart, iEnd, iStride, |
I iStart, iEnd, iStride, |
174 |
I biStart, biEnd, biStride, |
I biStart, biEnd, biStride, |
175 |
I bjStart, bjEnd, bjStride ) |
I bjStart, bjEnd, bjStride ) |
176 |
ENDIF |
ENDIF |
177 |
|
_BARRIER |
178 |
|
|
179 |
RETURN |
RETURN |
180 |
END |
END |
181 |
SUBROUTINE PLOT_FIELD_XYZR4( |
SUBROUTINE PLOT_FIELD_XYZRS( |
182 |
I fld, fldNam , fldNz, myIter, myThid ) |
I fld, fldNam , fldNz, myIter, myThid ) |
183 |
|
|
184 |
C /==========================================================\ |
C /==========================================================\ |
185 |
C | SUBROUTINE PLOT_FIELD_XYZR4 | |
C | SUBROUTINE PLOT_FIELD_XYZR4 | |
186 |
C | Print out an XYZ Real 4 field using text map. | |
C | Print out an XYZ _RS field using text map. | |
187 |
C |==========================================================| |
C |==========================================================| |
188 |
C | This routine references "numerical model" parameters like| |
C | This routine references "numerical model" parameters like| |
189 |
C | like the integration time. It uses these to create a | |
C | like the integration time. It uses these to create a | |
193 |
C | of a field to be printed by default, or every other | |
C | of a field to be printed by default, or every other | |
194 |
C | point etc.. | |
C | point etc.. | |
195 |
C | Other plot formats can also be substituted here. | |
C | Other plot formats can also be substituted here. | |
196 |
|
C | _RS is usually a REAL*4 field | |
197 |
C \==========================================================/ |
C \==========================================================/ |
198 |
|
IMPLICIT NONE |
199 |
|
|
200 |
#include "SIZE.h" |
#include "SIZE.h" |
201 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
202 |
#include "PARAMS.h" |
#include "PARAMS.h" |
212 |
C myIter - Iteration number for plot |
C myIter - Iteration number for plot |
213 |
C myThid - Thread id of thread instance calling plot_field |
C myThid - Thread id of thread instance calling plot_field |
214 |
INTEGER fldNz |
INTEGER fldNz |
215 |
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) |
216 |
CHARACTER*(*) fldNam |
CHARACTER*(*) fldNam |
217 |
INTEGER myThid |
INTEGER myThid |
218 |
INTEGER myIter |
INTEGER myIter |
227 |
|
|
228 |
C-- To get around synchronisation and multi-threaded I/O issues |
C-- To get around synchronisation and multi-threaded I/O issues |
229 |
C-- thread 1 will do all the writes. |
C-- thread 1 will do all the writes. |
230 |
|
_BARRIER |
231 |
IF ( myThid .EQ. 1 ) THEN |
IF ( myThid .EQ. 1 ) THEN |
232 |
C-- Form name for identifying "plot" |
C-- Form name for identifying "plot" |
233 |
IF ( myIter .GE. 0 ) THEN |
IF ( myIter .GE. 0 ) THEN |
234 |
WRITE(fldTitle,'(A,A,A,I10)') '// Field ', fldNam, ' at iteration ', |
WRITE(fldTitle,'(A,A,A,I10)') |
235 |
|
& '// Field ', fldNam, ' at iteration ', |
236 |
& myIter |
& myIter |
237 |
ELSE |
ELSE |
238 |
WRITE(fldTitle,'(A,A)') '// Field ', fldNam |
WRITE(fldTitle,'(A,A)') '// Field ', fldNam |
250 |
C jEnd = 1 |
C jEnd = 1 |
251 |
jStride = -1 |
jStride = -1 |
252 |
kStart = 1 |
kStart = 1 |
253 |
kEnd = fldNz |
C kEnd = fldNz |
254 |
C kEnd = 1 |
kEnd = 1 |
255 |
kStride = 1 |
kStride = 1 |
256 |
biStart = 1 |
biStart = 1 |
257 |
biEnd = nSx |
biEnd = nSx |
259 |
bjStart = nSy |
bjStart = nSy |
260 |
bjEnd = 1 |
bjEnd = 1 |
261 |
bjStride = -1 |
bjStride = -1 |
262 |
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( |
|
263 |
I fld, fldTitle, PRINT_MAP_XY, |
I fld, fldTitle, PRINT_MAP_XY, |
264 |
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, |
265 |
I iStart, iEnd, iStride, |
I iStart, iEnd, iStride, |
268 |
I biStart, biEnd, biStride, |
I biStart, biEnd, biStride, |
269 |
I bjStart, bjEnd, bjStride ) |
I bjStart, bjEnd, bjStride ) |
270 |
ENDIF |
ENDIF |
271 |
|
_BARRIER |
272 |
|
|
273 |
RETURN |
RETURN |
274 |
END |
END |
275 |
SUBROUTINE PLOT_FIELD_XYZR8( |
SUBROUTINE PLOT_FIELD_XYZRL( |
276 |
I fld, fldNam , fldNz, myIter, myThid ) |
I fld, fldNam , fldNz, myIter, myThid ) |
277 |
|
|
278 |
C /==========================================================\ |
C /==========================================================\ |
279 |
C | SUBROUTINE PLOT_FIELD_XYZR8 | |
C | SUBROUTINE PLOT_FIELD_XYZRL | |
280 |
C | Print out an XYZ Real 8 field using text map. | |
C | Print out an XYZ _RL field using text map. | |
281 |
C |==========================================================| |
C |==========================================================| |
282 |
C | This routine references "numerical model" parameters like| |
C | This routine references "numerical model" parameters like| |
283 |
C | like the integration time. It uses these to create a | |
C | like the integration time. It uses these to create a | |
287 |
C | of a field to be printed by default, or every other | |
C | of a field to be printed by default, or every other | |
288 |
C | point etc.. | |
C | point etc.. | |
289 |
C | Other plot formats can also be substituted here. | |
C | Other plot formats can also be substituted here. | |
290 |
|
C | _RL is usually a REAL*8 field | |
291 |
C \==========================================================/ |
C \==========================================================/ |
292 |
|
IMPLICIT NONE |
293 |
|
|
294 |
#include "SIZE.h" |
#include "SIZE.h" |
295 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
296 |
#include "PARAMS.h" |
#include "PARAMS.h" |
306 |
C myIter - Iteration number for plot |
C myIter - Iteration number for plot |
307 |
C myThid - Thread id of thread instance calling plot_field |
C myThid - Thread id of thread instance calling plot_field |
308 |
INTEGER fldNz |
INTEGER fldNz |
309 |
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) |
310 |
CHARACTER*(*) fldNam |
CHARACTER*(*) fldNam |
311 |
INTEGER myThid |
INTEGER myThid |
312 |
INTEGER myIter |
INTEGER myIter |
321 |
|
|
322 |
C-- To get around synchronisation and multi-threaded I/O issues |
C-- To get around synchronisation and multi-threaded I/O issues |
323 |
C-- thread 1 will do all the writes. |
C-- thread 1 will do all the writes. |
324 |
|
_BARRIER |
325 |
IF ( myThid .EQ. 1 ) THEN |
IF ( myThid .EQ. 1 ) THEN |
326 |
C-- Form name for identifying "plot" |
C-- Form name for identifying "plot" |
327 |
IF ( myIter .GE. 0 ) THEN |
IF ( myIter .GE. 0 ) THEN |
328 |
WRITE(fldTitle,'(A,A,A,I10)') '// Field ', fldNam, ' at iteration ', |
WRITE(fldTitle,'(A,A,A,I10)') |
329 |
|
& '// Field ', fldNam, ' at iteration ', |
330 |
& myIter |
& myIter |
331 |
ELSE |
ELSE |
332 |
WRITE(fldTitle,'(A,A)') '// Field ', fldNam |
WRITE(fldTitle,'(A,A)') '// Field ', fldNam |
353 |
bjStart = nSy |
bjStart = nSy |
354 |
bjEnd = 1 |
bjEnd = 1 |
355 |
bjStride = -1 |
bjStride = -1 |
356 |
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( |
|
357 |
I fld, fldTitle, PRINT_MAP_XY, |
I fld, fldTitle, PRINT_MAP_XY, |
358 |
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, |
359 |
I iStart, iEnd, iStride, |
I iStart, iEnd, iStride, |
362 |
I biStart, biEnd, biStride, |
I biStart, biEnd, biStride, |
363 |
I bjStart, bjEnd, bjStride ) |
I bjStart, bjEnd, bjStride ) |
364 |
ENDIF |
ENDIF |
365 |
|
_BARRIER |
366 |
|
|
367 |
RETURN |
RETURN |
368 |
END |
END |