-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathquaplot.f
More file actions
executable file
·2413 lines (2390 loc) · 63.6 KB
/
quaplot.f
File metadata and controls
executable file
·2413 lines (2390 loc) · 63.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
c (c) Vladimir Rokhlin
c
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c
c This is the end of the testing code, and the
c beginning of the plotting code proper.
c
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c
c
c
subroutine quaplot(iw,x,y,n,itype1,title)
implicit real *8 (a-h,o-z)
save
dimension x(1),y(1),x2(1),y2(1),x3(1),y3(1),x4(1),y4(1),
1 x5(1),y5(1)
character *1 title(1)
c
inumgr=1
c
call quaplo0(iw,x,y,x2,y2,x3,y3,x4,y4,x5,y5,n,n2,n3,n4,
1 n5,title,inumgr,itype1,itype2,itype3,itype4,itype5)
c
return
end
c
c
c
c
c
subroutine quaplot2(iw,x,y,n,itype1,x2,y2,n2,itype2,title)
implicit real *8 (a-h,o-z)
save
dimension x(1),y(1),x2(1),y2(1),x3(1),y3(1),x4(1),y4(1),
1 x5(1),y5(1)
character *1 title(1)
c
inumgr=2
c
call quaplo0(iw,x,y,x2,y2,x3,y3,x4,y4,x5,y5,n,n2,n3,n4,
1 n5,title,inumgr,itype1,itype2,itype3,itype4,itype5)
c
return
end
c
c
c
c
c
subroutine quaplot3(iw,x,y,n,itype1,x2,y2,n2,itype2,
1 x3,y3,n3,itype3,title)
implicit real *8 (a-h,o-z)
save
dimension x(1),y(1),x2(1),y2(1),x3(1),y3(1),x4(1),y4(1),
1 x5(1),y5(1)
character *1 title(1)
c
inumgr=3
c
call quaplo0(iw,x,y,x2,y2,x3,y3,x4,y4,x5,y5,n,n2,n3,n4,
1 n5,title,inumgr,itype1,itype2,itype3,itype4,itype5)
c
return
end
c
c
c
c
c
subroutine quaplot4(iw,x,y,n,itype1,x2,y2,n2,itype2,
1 x3,y3,n3,itype3,x4,y4,n4,itype4,title)
implicit real *8 (a-h,o-z)
save
dimension x(1),y(1),x2(1),y2(1),x3(1),y3(1),x4(1),y4(1),
1 x5(1),y5(1)
character *1 title(1)
c
inumgr=4
c
call quaplo0(iw,x,y,x2,y2,x3,y3,x4,y4,x5,y5,n,n2,n3,n4,
1 n5,title,inumgr,itype1,itype2,itype3,itype4,itype5)
c
return
end
c
c
c
c
c
subroutine quaplot5(iw,x,y,n,itype1,x2,y2,n2,itype2,x3,
1 y3,n3,itype3,x4,y4,n4,itype4,x5,y5,n5,itype5,title)
implicit real *8 (a-h,o-z)
save
dimension x(1),y(1),x2(1),y2(1),x3(1),y3(1),x4(1),y4(1),
1 x5(1),y5(1)
character *1 title(1)
c
inumgr=5
c
call quaplo0(iw,x,y,x2,y2,x3,y3,x4,y4,x5,y5,n,n2,n3,n4,
1 n5,title,inumgr,itype1,itype2,itype3,itype4,itype5)
c
return
end
c
c
c
c
c
subroutine quaplo0(iw,x,y,x2,y2,x3,y3,x4,y4,x5,y5,n,n2,n3,
1 n4,n5,title,inumgr,itype1,itype2,itype3,itype4,itype5)
implicit real *8 (a-h,o-z)
save
dimension x(1),y(1),x2(1),y2(1),x3(1),y3(1),x4(1),y4(1),
1 x5(1),y5(1)
character *1 title(1),gn(2),file1(8),anum1(8),line(82),
1 blank,quo,backslash,anum1c(8),ccc,file1c(8)
character *8 dummy,anum8,file8,anum8c,file8c
c
equivalence (file1,file8),(anum1,anum8),(anum1c,anum8c)
equivalence (file1c,file8c)
data gn/'g','n'/,blank/' '/,quo/'"'/,backslash/'\\'/,ccc/'c'/
c
c convert the user-specified Fortran unit number to
c character format
c
if( (iw .ge. 0) .and. (iw .le. 9) ) write(dummy,1100) iw
1100 format(i1)
c
if( (iw .ge. 10) .and. (iw .le. 99) ) write(dummy,1200) iw
1200 format(i2)
c
if( (iw .ge. 100) .and. (iw .le. 999) ) write(dummy,1300) iw
1300 format(i3)
c
if( (iw .ge. 1000) .and. (iw .le. 9999) ) write(dummy,1400) iw
1400 format(i4)
c
2000 format(1a8)
read(dummy,2000) anum8
anum8c=anum8
c
if( (iw .ge. 0) .and. (iw .le. 9) ) anum1c(2)=ccc
if( (iw .ge. 10) .and. (iw .le. 99) ) anum1c(3)=ccc
if( (iw .ge. 100) .and. (iw .le. 999) ) anum1c(4)=ccc
if( (iw .ge. 1000) .and. (iw .le. 9999) ) anum1c(5)=ccc
c
c construct the file name on which the Gnuplot instructions
c are to be written
c
file1(1)=gn(1)
file1(2)=gn(2)
file1c(1)=gn(1)
file1c(2)=gn(2)
do 2200 i=1,6
file1(i+2)=anum1(i)
file1c(i+2)=anum1c(i)
2200 continue
c
c open the fortran file with the unit 87 and name file8
c
iun=87
open(unit=iun,file=file8)
c
iunc=97
open(unit=iunc,file=file8c)
c
cc 2250 format(' # set terminal postscript',/,
cc 1 ' # set output "plot.ps"')
cc
2250 format(' # set terminal postscript',/,
1 ' # set output "plot.ps"', /,
2 ' # set size 0.76, 1.0 ')
c
write(iun,2250)
c
c generate the title for the plot
c
2255 format(' set terminal postscript',/,
1 ' set output "plot.ps"')
c
write(iunc,2255)
line(1)=blank
line(2)=blank
line(3)=quo
c
call quamesslen(title,nchar,line(4))
c
line(nchar+4)=quo
2270 format(' set title ',80a1)
c
write(iun,2270) (line(i),i=1,nchar+4)
write(iunc,2270) (line(i),i=1,nchar+4)
c
2280 format(' show title')
write(iun,2280)
write(iunc,2280)
c
c find the limits for both x and y
c
xmin=1.0d30
ymin=1.0d30
xmax=-1.0d20
ymax=-1.0d20
c
do 2300 i=1,n
if(x(i) .lt. xmin) xmin=x(i)
if(y(i) .lt. ymin) ymin=y(i)
if(x(i) .gt. xmax) xmax=x(i)
if(y(i) .gt. ymax) ymax=y(i)
2300 continue
c
if(inumgr .eq. 1) goto 2345
c
do 2310 i=1,n2
if(x2(i) .lt. xmin) xmin=x2(i)
if(y2(i) .lt. ymin) ymin=y2(i)
if(x2(i) .gt. xmax) xmax=x2(i)
if(y2(i) .gt. ymax) ymax=y2(i)
2310 continue
c
if(inumgr .eq. 2) goto 2345
c
do 2320 i=1,n3
if(x3(i) .lt. xmin) xmin=x3(i)
if(y3(i) .lt. ymin) ymin=y3(i)
if(x3(i) .gt. xmax) xmax=x3(i)
if(y3(i) .gt. ymax) ymax=y3(i)
2320 continue
c
if(inumgr .eq. 3) goto 2345
c
do 2330 i=1,n4
if(x4(i) .lt. xmin) xmin=x4(i)
if(y4(i) .lt. ymin) ymin=y4(i)
if(x4(i) .gt. xmax) xmax=x4(i)
if(y4(i) .gt. ymax) ymax=y4(i)
2330 continue
c
if(inumgr .eq. 4) goto 2345
c
do 2340 i=1,n5
if(x5(i) .lt. xmin) xmin=x5(i)
if(y5(i) .lt. ymin) ymin=y5(i)
if(x5(i) .gt. xmax) xmax=x5(i)
if(y5(i) .gt. ymax) ymax=y5(i)
2340 continue
c
2345 continue
c
xcenter=(xmin+xmax)/2
ycenter=(ymax+ymin)/2
c
xsize=(xmax-xmin)
ysize=(ymax-ymin)
size=xsize
if(ysize .gt. size) size=ysize
size=size*1.2
c
xmin=xcenter-size/2
xmax=xcenter+size/2
ymin=ycenter-size/2
ymax=ycenter+size/2
c
c set the size of the stupid thing
c
cccc 2350 format(2x,' set size 0.75,1.0')
2350 format(2x,' set size 0.76, 1.0')
write(iunc,2350)
c
c write the instructions
c
2400 format(i6)
iun2=iw+100000
write (dummy,2400) iun2
read(dummy,2000) anum8
c
do 2600 i=1,6
file1(i+2)=anum1(i)
2600 continue
c
2800 format('plot ', '[', e8.2, ':', e8.2,'] ',
1 '[', e8.2, ':', e8.2,'] ',
2 '"',1a8,'" ','notitle with dots')
2803 format('plot ', '[', e8.2, ':', e8.2,'] ',
1 '[', e8.2, ':', e8.2,'] ',
2 '"',1a8,'" ','notitle with points')
2805 format('plot ', '[', e8.2, ':', e8.2,'] ',
1 '[', e8.2, ':', e8.2,'] ',
2 '"',1a8,'" ','notitle with lines')
c
if( (inumgr .eq. 1) .and. (itype1 .eq. 1) )
1 write(iun,2800) xmin,xmax,ymin,ymax,file8
c
if( (inumgr .eq. 1) .and. (itype1 .eq. 2) )
1 write(iun,2803) xmin,xmax,ymin,ymax,file8
c
if( (inumgr .eq. 1) .and. (itype1 .eq. 3) )
1 write(iun,2805) xmin,xmax,ymin,ymax,file8
c
c
if( (inumgr .eq. 1) .and. (itype1 .eq. 1) )
1 write(iunc,2800) xmin,xmax,ymin,ymax,file8
c
if( (inumgr .eq. 1) .and. (itype1 .eq. 2) )
1 write(iunc,2803) xmin,xmax,ymin,ymax,file8
c
if( (inumgr .eq. 1) .and. (itype1 .eq. 3) )
1 write(iunc,2805) xmin,xmax,ymin,ymax,file8
c
2830 format('plot ', '[', e8.2, ':', e8.2,'] ',
1 '[', e8.2, ':', e8.2,'] ',
2 '"',1a8,'" ','notitle with dots, ',1a1)
c
2833 format('plot ', '[', e8.2, ':', e8.2,'] ',
1 '[', e8.2, ':', e8.2,'] ',
2 '"',1a8,'" ','notitle with points, ',1a1)
c
2835 format('plot ', '[', e8.2, ':', e8.2,'] ',
1 '[', e8.2, ':', e8.2,'] ',
2 '"',1a8,'" ','notitle with lines, ',1a1)
c
if( (inumgr .ne. 1) .and. (itype1 .eq. 1) )
1 write(iun,2830) xmin,xmax,ymin,ymax,file8,backslash
c
if( (inumgr .ne. 1) .and. (itype1 .eq. 2) )
1 write(iun,2833) xmin,xmax,ymin,ymax,file8,backslash
c
if( (inumgr .ne. 1) .and. (itype1 .eq. 3) )
1 write(iun,2835) xmin,xmax,ymin,ymax,file8,backslash
if( (inumgr .ne. 1) .and. (itype1 .eq. 1) )
1 write(iunc,2830) xmin,xmax,ymin,ymax,file8,backslash
c
if( (inumgr .ne. 1) .and. (itype1 .eq. 2) )
1 write(iunc,2833) xmin,xmax,ymin,ymax,file8,backslash
c
if( (inumgr .ne. 1) .and. (itype1 .eq. 3) )
1 write(iunc,2835) xmin,xmax,ymin,ymax,file8,backslash
c
c write the first data file to be plotted
c
iun22=88
open(unit=iun22,file=file8)
c
write(iun22,3000) (x(i),y(i),i=1,n)
c
close(iun22)
c
c if the user so requested - write the instructions for the
c plotting the second data file
c
if(inumgr .eq. 1) close(iun)
if(inumgr .eq. 1) close(iunc)
if(inumgr .eq. 1) return
c
iun2=iw+200000
write (dummy,2400) iun2
read(dummy,2000) anum8
c
do 2840 i=1,6
file1(i+2)=anum1(i)
2840 continue
c
2850 format(' ', '"',1a8,'" ','notitle with dots')
2851 format(' ', '"',1a8,'" ','notitle with points')
2852 format(' ', '"',1a8,'" ','notitle with lines')
c
if( (inumgr .eq. 2) .and. (itype2 .eq. 1) )
1 write(iun,2850) file8
c
if( (inumgr .eq. 2) .and. (itype2 .eq. 2) )
1 write(iun,2851) file8
c
if( (inumgr .eq. 2) .and. (itype2 .eq. 3) )
1 write(iun,2852) file8
c
c
if( (inumgr .eq. 2) .and. (itype2 .eq. 1) )
1 write(iunc,2850) file8
c
if( (inumgr .eq. 2) .and. (itype2 .eq. 2) )
1 write(iunc,2851) file8
c
if( (inumgr .eq. 2) .and. (itype2 .eq. 3) )
1 write(iunc,2852) file8
c
2855 format(' ', '"',1a8,'" ','notitle with dots, ',1a1)
2856 format(' ', '"',1a8,'" ','notitle with points, ',1a1)
2857 format(' ', '"',1a8,'" ','notitle with lines, ',1a1)
c
if( (inumgr .ne. 2) .and. (itype2 .eq. 1) )
1 write(iun,2855) file8,backslash
c
if( (inumgr .ne. 2) .and. (itype2 .eq. 2) )
1 write(iun,2856) file8,backslash
c
if( (inumgr .ne. 2) .and. (itype2 .eq. 3) )
1 write(iun,2857) file8,backslash
c
c
if( (inumgr .ne. 2) .and. (itype2 .eq. 1) )
1 write(iunc,2855) file8,backslash
c
if( (inumgr .ne. 2) .and. (itype2 .eq. 2) )
1 write(iunc,2856) file8,backslash
c
if( (inumgr .ne. 2) .and. (itype2 .eq. 3) )
1 write(iunc,2857) file8,backslash
c
c write the second data file to be plotted
c
iun22=88
open(unit=iun22,file=file8)
c
write(iun22,3000) (x2(i),y2(i),i=1,n2)
c
close(iun22)
c
c if the user so requested - write the instructions for the
c plotting the third data file
c
if(inumgr .eq. 2) close(iun)
if(inumgr .eq. 2) close(iunc)
if(inumgr .eq. 2) return
c
iun2=iw+300000
write (dummy,2400) iun2
read(dummy,2000) anum8
c
do 2860 i=1,6
file1(i+2)=anum1(i)
2860 continue
c
2870 format(' ', '"',1a8,'" ','notitle with dots')
2871 format(' ', '"',1a8,'" ','notitle with points')
2872 format(' ', '"',1a8,'" ','notitle with lines')
c
if( (inumgr .eq. 3) .and. (itype3 .eq. 1) )
1 write(iun,2870) file8
c
if( (inumgr .eq. 3) .and. (itype3 .eq. 2) )
1 write(iun,2871) file8
c
if( (inumgr .eq. 3) .and. (itype3 .eq. 3) )
1 write(iun,2872) file8
c
c
if( (inumgr .eq. 3) .and. (itype3 .eq. 1) )
1 write(iunc,2870) file8
c
if( (inumgr .eq. 3) .and. (itype3 .eq. 2) )
1 write(iunc,2871) file8
c
if( (inumgr .eq. 3) .and. (itype3 .eq. 3) )
1 write(iunc,2872) file8
c
2875 format(' ', '"',1a8,'" ','notitle with dots, ',1a1)
2876 format(' ', '"',1a8,'" ','notitle with points, ',1a1)
2877 format(' ', '"',1a8,'" ','notitle with lines, ',1a1)
c
if( (inumgr .ne. 3) .and. (itype3 .eq. 1) )
1 write(iun,2875) file8,backslash
c
if( (inumgr .ne. 3) .and. (itype3 .eq. 2) )
1 write(iun,2876) file8,backslash
c
if( (inumgr .ne. 3) .and. (itype3 .eq. 3) )
1 write(iun,2877) file8,backslash
c
c
if( (inumgr .ne. 3) .and. (itype3 .eq. 1) )
1 write(iunc,2875) file8,backslash
c
if( (inumgr .ne. 3) .and. (itype3 .eq. 2) )
1 write(iunc,2876) file8,backslash
c
if( (inumgr .ne. 3) .and. (itype3 .eq. 3) )
1 write(iunc,2877) file8,backslash
c
c write the third data file to be plotted
c
iun22=88
open(unit=iun22,file=file8)
c
write(iun22,3000) (x3(i),y3(i),i=1,n3)
c
close(iun22)
c
c if the user so requested - write the instructions for the
c plotting the forth data file
c
if(inumgr .eq. 3) close(iun)
if(inumgr .eq. 3) close(iunc)
if(inumgr .eq. 3) return
c
iun2=iw+400000
write (dummy,2400) iun2
read(dummy,2000) anum8
c
do 2880 i=1,6
file1(i+2)=anum1(i)
2880 continue
c
2890 format(' ', '"',1a8,'" ','notitle with dots')
2891 format(' ', '"',1a8,'" ','notitle with points')
2892 format(' ', '"',1a8,'" ','notitle with lines')
c
if( (inumgr .eq. 4) .and. (itype4 .eq. 1) )
1 write(iun,2890) file8
c
if( (inumgr .eq. 4) .and. (itype4 .eq. 2) )
1 write(iun,2891) file8
c
if( (inumgr .eq. 4) .and. (itype4 .eq. 3) )
1 write(iun,2892) file8
c
c
if( (inumgr .eq. 4) .and. (itype4 .eq. 1) )
1 write(iunc,2890) file8
c
if( (inumgr .eq. 4) .and. (itype4 .eq. 2) )
1 write(iunc,2891) file8
c
if( (inumgr .eq. 4) .and. (itype4 .eq. 3) )
1 write(iunc,2892) file8
c
2895 format(' ', '"',1a8,'" ','notitle with dots, ',1a1)
2896 format(' ', '"',1a8,'" ','notitle with points, ',1a1)
2897 format(' ', '"',1a8,'" ','notitle with lines, ',1a1)
c
if( (inumgr .ne. 4) .and. (itype4 .eq. 1) )
1 write(iun,2895) file8,backslash
c
if( (inumgr .ne. 4) .and. (itype4 .eq. 2) )
1 write(iun,2896) file8,backslash
c
if( (inumgr .ne. 4) .and. (itype4 .eq. 3) )
1 write(iun,2897) file8,backslash
c
c
if( (inumgr .ne. 4) .and. (itype4 .eq. 1) )
1 write(iunc,2895) file8,backslash
c
if( (inumgr .ne. 4) .and. (itype4 .eq. 2) )
1 write(iunc,2896) file8,backslash
c
if( (inumgr .ne. 4) .and. (itype4 .eq. 3) )
1 write(iunc,2897) file8,backslash
c
c write the forth data file to be plotted
c
iun22=88
open(unit=iun22,file=file8)
c
write(iun22,3000) (x4(i),y4(i),i=1,n4)
c
close(iun22)
c
c if the user so requested - write the instructions for the
c plotting the fifth data file
c
if(inumgr .eq. 4) close(iun)
if(inumgr .eq. 4) close(iunc)
if(inumgr .eq. 4) return
c
iun2=iw+500000
write (dummy,2400) iun2
read(dummy,2000) anum8
c
do 2900 i=1,6
file1(i+2)=anum1(i)
2900 continue
c
2910 format(' ','"',1a8,'"','notitle with dots')
2911 format(' ','"',1a8,'"','notitle with points')
2912 format(' ','"',1a8,'"','notitle with lines')
c
if(itype5 .eq. 1) write(iun,2910) file8
if(itype5 .eq. 2) write(iun,2911) file8
if(itype5 .eq. 3) write(iun,2912) file8
c
if(itype5 .eq. 1) write(iunc,2910) file8
if(itype5 .eq. 2) write(iunc,2911) file8
if(itype5 .eq. 3) write(iunc,2912) file8
c
c write the fifth data file to be plotted
c
iun22=88
open(unit=iun22,file=file8)
c
3000 format(2x,e11.5,2x,e11.5)
c
write(iun22,3000) (x5(i),y5(i),i=1,n5)
c
close(iun22)
close(iun)
close(iunc)
c
return
end
c
c
c
c
c
subroutine quagraph(iw,x,y,n,itype1,title)
implicit real *8 (a-h,o-z)
save
dimension x(1),y(1),x2(1),y2(1),x3(1),y3(1),x4(1),y4(1),
1 x5(1),y5(1)
character *1 title(1)
c
inumgr=1
c
call quagrap0(iw,x,y,x2,y2,x3,y3,x4,y4,x5,y5,n,n2,n3,n4,
1 n5,title,inumgr,itype1,itype2,itype3,itype4,itype5)
c
return
end
c
c
c
c
c
subroutine quagraph2(iw,x,y,n,itype1,x2,y2,n2,itype2,title)
implicit real *8 (a-h,o-z)
save
dimension x(1),y(1),x2(1),y2(1),x3(1),y3(1),x4(1),y4(1),
1 x5(1),y5(1)
character *1 title(1)
c
inumgr=2
c
call quagrap0(iw,x,y,x2,y2,x3,y3,x4,y4,x5,y5,n,n2,n3,n4,
1 n5,title,inumgr,itype1,itype2,itype3,itype4,itype5)
c
return
end
c
c
c
c
c
subroutine quagraph3(iw,x,y,n,itype1,x2,y2,n2,itype2,
1 x3,y3,n3,itype3,title)
implicit real *8 (a-h,o-z)
save
dimension x(1),y(1),x2(1),y2(1),x3(1),y3(1),x4(1),y4(1),
1 x5(1),y5(1)
character *1 title(1)
c
inumgr=3
c
call quagrap0(iw,x,y,x2,y2,x3,y3,x4,y4,x5,y5,n,n2,n3,n4,
1 n5,title,inumgr,itype1,itype2,itype3,itype4,itype5)
c
return
end
c
c
c
c
c
subroutine quagraph4(iw,x,y,n,itype1,x2,y2,n2,itype2,
1 x3,y3,n3,itype3,x4,y4,n4,itype4,title)
implicit real *8 (a-h,o-z)
save
dimension x(1),y(1),x2(1),y2(1),x3(1),y3(1),x4(1),y4(1),
1 x5(1),y5(1)
character *1 title(1)
c
inumgr=4
c
call quagrap0(iw,x,y,x2,y2,x3,y3,x4,y4,x5,y5,n,n2,n3,n4,
1 n5,title,inumgr,itype1,itype2,itype3,itype4,itype5)
c
return
end
c
c
c
c
c
subroutine quagraph5(iw,x,y,n,itype1,x2,y2,n2,itype2,x3,
1 y3,n3,itype3,x4,y4,n4,itype4,x5,y5,n5,itype5,title)
implicit real *8 (a-h,o-z)
save
dimension x(1),y(1),x2(1),y2(1),x3(1),y3(1),x4(1),y4(1),
1 x5(1),y5(1)
character *1 title(1)
c
inumgr=5
c
call quagrap0(iw,x,y,x2,y2,x3,y3,x4,y4,x5,y5,n,n2,n3,n4,
1 n5,title,inumgr,itype1,itype2,itype3,itype4,itype5)
c
return
end
c
c
c
c
c
subroutine quagrap0(iw,x,y,x2,y2,x3,y3,x4,y4,x5,y5,n,n2,n3,
1 n4,n5,title,inumgr,itype1,itype2,itype3,itype4,itype5)
implicit real *8 (a-h,o-z)
save
dimension x(1),y(1),x2(1),y2(1),x3(1),y3(1),x4(1),y4(1),
1 x5(1),y5(1)
character *1 title(1),gn(2),file1(8),anum1(8),line(82),
1 blank,quo,backslash,anum1c(8),ccc,file1c(8)
character *8 dummy,anum8,file8,anum8c,file8c
c
equivalence (file1,file8),(anum1,anum8),(anum1c,anum8c)
equivalence (file1c,file8c)
data gn/'g','n'/,blank/' '/,quo/'"'/,backslash/'\\'/,ccc/'c'/
c
c convert the user-specified Fortran unit number to
c character format
c
if( (iw .ge. 0) .and. (iw .le. 9) ) write(dummy,1100) iw
1100 format(i1)
c
if( (iw .ge. 10) .and. (iw .le. 99) ) write(dummy,1200) iw
1200 format(i2)
c
if( (iw .ge. 100) .and. (iw .le. 999) ) write(dummy,1300) iw
1300 format(i3)
c
if( (iw .ge. 1000) .and. (iw .le. 9999) ) write(dummy,1400) iw
1400 format(i4)
c
2000 format(1a8)
read(dummy,2000) anum8
anum8c=anum8
c
if( (iw .ge. 0) .and. (iw .le. 9) ) anum1c(2)=ccc
if( (iw .ge. 10) .and. (iw .le. 99) ) anum1c(3)=ccc
if( (iw .ge. 100) .and. (iw .le. 999) ) anum1c(4)=ccc
if( (iw .ge. 1000) .and. (iw .le. 9999) ) anum1c(5)=ccc
c
c construct the file name on which the Gnuplot instructions
c are to be written
c
file1(1)=gn(1)
file1(2)=gn(2)
file1c(1)=gn(1)
file1c(2)=gn(2)
do 2200 i=1,6
file1(i+2)=anum1(i)
file1c(i+2)=anum1c(i)
2200 continue
c
c open the fortran file with the unit 87 and name file8
c
iun=87
open(unit=iun,file=file8)
c
iunc=97
open(unit=iunc,file=file8c)
c
2250 format(' # set terminal postscript',/,
1 ' # set output "plot.ps"', /,
2 ' # set size 0.76, 1.0 ')
c
2255 format(' set terminal postscript',/,
1 ' set output "plot.ps"')
c
write(iun,2250)
write(iunc,2255)
c
c generate the title for the plot
c
line(1)=blank
line(2)=blank
line(3)=quo
c
call quamesslen(title,nchar,line(4))
c
line(nchar+4)=quo
2300 format(' set title ',80a1)
write(iun,2300) (line(i),i=1,nchar+4)
write(iunc,2300) (line(i),i=1,nchar+4)
c
2350 format(' show title')
write(iun,2350)
write(iunc,2350)
c
c write the instructions
c
2400 format(i6)
iun2=iw+100000
write (dummy,2400) iun2
read(dummy,2000) anum8
c
do 2600 i=1,6
file1(i+2)=anum1(i)
2600 continue
c
2800 format('plot ','"',1a8,'" ','notitle with dots')
2803 format('plot ','"',1a8,'" ','notitle with points')
2805 format('plot ','"',1a8,'" ','notitle with lines')
c
if( (inumgr .eq. 1) .and. (itype1 .eq. 1) )
1 write(iun,2800) file8
if( (inumgr .eq. 1) .and. (itype1 .eq. 1) )
1 write(iunc,2800) file8
c
if( (inumgr .eq. 1) .and. (itype1 .eq. 2) )
1 write(iun,2803) file8
if( (inumgr .eq. 1) .and. (itype1 .eq. 2) )
1 write(iunc,2803) file8
c
if( (inumgr .eq. 1) .and. (itype1 .eq. 3) )
1 write(iun,2805) file8
if( (inumgr .eq. 1) .and. (itype1 .eq. 3) )
1 write(iunc,2805) file8
c
2830 format('plot ','"',1a8,'" ','notitle with dots, ',1a1)
2831 format('plot ','"',1a8,'" ','notitle with points, ',1a1)
2832 format('plot ','"',1a8,'" ','notitle with lines, ',1a1)
c
if( (inumgr .ne. 1) .and. (itype1 .eq. 1) )
1 write(iun,2830) file8,backslash
if( (inumgr .ne. 1) .and. (itype1 .eq. 1) )
1 write(iunc,2830) file8,backslash
c
if( (inumgr .ne. 1) .and. (itype1 .eq. 2) )
1 write(iun,2831) file8,backslash
if( (inumgr .ne. 1) .and. (itype1 .eq. 2) )
1 write(iunc,2831) file8,backslash
c
if( (inumgr .ne. 1) .and. (itype1 .eq. 3) )
1 write(iun,2832) file8,backslash
if( (inumgr .ne. 1) .and. (itype1 .eq. 3) )
1 write(iunc,2832) file8,backslash
c
c write the first data file to be plotted
c
iun22=88
open(unit=iun22,file=file8)
c
write(iun22,3000) (x(i),y(i),i=1,n)
c
close(iun22)
c
c if the user so requested - write the instructions for the
c plotting the second data file
c
if(inumgr .eq. 1) close(iun)
if(inumgr .eq. 1) close(iunc)
if(inumgr .eq. 1) return
c
iun2=iw+200000
write (dummy,2400) iun2
read(dummy,2000) anum8
c
do 2840 i=1,6
file1(i+2)=anum1(i)
2840 continue
c
2850 format(' ','"',1a8,'" ','notitle with dots')
2851 format(' ','"',1a8,'" ','notitle with points')
2852 format(' ','"',1a8,'" ','notitle with lines')
c
if( (inumgr .eq. 2) .and. (itype2 .eq. 1) )
1 write(iun,2850) file8
if( (inumgr .eq. 2) .and. (itype2 .eq. 1) )
1 write(iunc,2850) file8
c
if( (inumgr .eq. 2) .and. (itype2 .eq. 2) )
1 write(iun,2851) file8
if( (inumgr .eq. 2) .and. (itype2 .eq. 2) )
1 write(iunc,2851) file8
c
if( (inumgr .eq. 2) .and. (itype2 .eq. 3) )
1 write(iun,2852) file8
if( (inumgr .eq. 2) .and. (itype2 .eq. 3) )
1 write(iunc,2852) file8
c
c
if( (inumgr .ne. 2) .and. (itype2 .eq. 1) )
1 write(iun,2855) file8,backslash
if( (inumgr .ne. 2) .and. (itype2 .eq. 1) )
1 write(iunc,2855) file8,backslash
c
if( (inumgr .ne. 2) .and. (itype2 .eq. 2) )
1 write(iun,2856) file8,backslash
if( (inumgr .ne. 2) .and. (itype2 .eq. 2) )
1 write(iunc,2856) file8,backslash
c
if( (inumgr .ne. 2) .and. (itype2 .eq. 3) )
1 write(iun,2857) file8,backslash
if( (inumgr .ne. 2) .and. (itype2 .eq. 3) )
1 write(iunc,2857) file8,backslash
c
2855 format(' ','"',1a8,'" ','notitle with dots, ',1a1)
2856 format(' ','"',1a8,'" ','notitle with points, ',1a1)
2857 format(' ','"',1a8,'" ','notitle with lines, ',1a1)
c
c write the second data file to be plotted
c
iun22=88
open(unit=iun22,file=file8)
c
write(iun22,3000) (x2(i),y2(i),i=1,n2)
c
close(iun22)
c
c if the user so requested - write the instructions for the
c plotting the third data file
c
if(inumgr .eq. 2) close(iun)
if(inumgr .eq. 2) close(iunc)
if(inumgr .eq. 2) return
c
iun2=iw+300000
write (dummy,2400) iun2
read(dummy,2000) anum8
c
do 2860 i=1,6
file1(i+2)=anum1(i)
2860 continue
c
2870 format(' ','"',1a8,'" ','notitle with dots')
2871 format(' ','"',1a8,'" ','notitle with points')
2872 format(' ','"',1a8,'" ','notitle with lines')
c
if( (inumgr .eq. 3) .and. (itype3 .eq. 1) )
1 write(iun,2870) file8
if( (inumgr .eq. 3) .and. (itype3 .eq. 1) )
1 write(iunc,2870) file8
c
if( (inumgr .eq. 3) .and. (itype3 .eq. 2) )
1 write(iun,2871) file8
if( (inumgr .eq. 3) .and. (itype3 .eq. 2) )
1 write(iunc,2871) file8
c
if( (inumgr .eq. 3) .and. (itype3 .eq. 3) )
1 write(iun,2872) file8
if( (inumgr .eq. 3) .and. (itype3 .eq. 3) )
1 write(iunc,2872) file8
c
c
if( (inumgr .ne. 3) .and. (itype3 .eq. 1) )
1 write(iun,2875) file8,backslash
if( (inumgr .ne. 3) .and. (itype3 .eq. 1) )
1 write(iunc,2875) file8,backslash
c
if( (inumgr .ne. 3) .and. (itype3 .eq. 2) )
1 write(iun,2876) file8,backslash
if( (inumgr .ne. 3) .and. (itype3 .eq. 2) )
1 write(iunc,2876) file8,backslash
c
if( (inumgr .ne. 3) .and. (itype3 .eq. 3) )
1 write(iun,2877) file8,backslash
if( (inumgr .ne. 3) .and. (itype3 .eq. 3) )
1 write(iunc,2877) file8,backslash
c
2875 format(' ','"',1a8,'" ','notitle with dots, ',1a1)
2876 format(' ','"',1a8,'" ','notitle with points, ',1a1)
2877 format(' ','"',1a8,'" ','notitle with lines, ',1a1)
c
c write the third data file to be plotted
c
iun22=88
open(unit=iun22,file=file8)
c
write(iun22,3000) (x3(i),y3(i),i=1,n3)
c
close(iun22)
c
c if the user so requested - write the instructions for the
c plotting the forth data file
c
if(inumgr .eq. 3) close(iun)
if(inumgr .eq. 3) close(iunc)
if(inumgr .eq. 3) return
c
iun2=iw+400000
write (dummy,2400) iun2
read(dummy,2000) anum8
c
do 2880 i=1,6
file1(i+2)=anum1(i)
2880 continue
c
2890 format(' ','"',1a8,'" ','notitle with dots')
2891 format(' ','"',1a8,'" ','notitle with points')
2892 format(' ','"',1a8,'" ','notitle with lines')
c
if( (inumgr .eq. 4) .and. (itype4 .eq. 1) )
1 write(iun,2890) file8
if( (inumgr .eq. 4) .and. (itype4 .eq. 1) )
1 write(iunc,2890) file8
c