-
Notifications
You must be signed in to change notification settings - Fork 12
/
plotting.f90
661 lines (641 loc) · 27.1 KB
/
plotting.f90
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
subroutine Plot(ng,file,lenght,title,title_pl, &
xaxis,yaxis,where,l3,iFlag, &
Smeared,SmearedPrev,Up_lim,Up_lim_E)
!......................................................................
! Plot curves eighter on the screen or on to a ps-file
!......................................................................
! title - the title of the plot (char*50)
! xaxis - the title of the x-axis (char*20)
! yaxis - the title of the y-axis (char*20)
! where - where to print: on the 'Screen' or on the 'Postsc' (char*6)
!......................................................................
! ng - number of data files to be used simultaneously
! file(i) - name of the data file for the GNUPLOT, i=1,...,ng;
! lenght(i) - lenght of the data files names;
! title_pl(i) - subtitle for each curve
! test.gnu - standart name of the file used by the GNUPLOT;
! file.ps - name of the postscript file prepared by GNUPLOT.
! l3 - reserved UNIT for the files used here.
!......................................................................
! When Smeared='S' and SmearedPrev=.true., we show column 3 for
! the DOS and column 5 for the LDOS (i.e. smeared densities); otherwise,
! i.e. if SmearedPrev=.false., we show columns 2 and 4, respectively.
! If Smeared='N', we show columns 2 and 3 respectively as there
! are no smeared results at all.
! If Smeared='F' and SmearedPrev=.true., we show column 2 for the
! smeared DOS and column 3 for the smeared LDOS in file//'_' ; otherwise,
! i.e. if SmearedPrev=.false., we show columns 2 and 3 in file.
!.....................................................................
!
implicit none
character title*50,xaxis*20,yaxis*20,where*6,Smeared
character file(ng)*12,f_gr*12,title_pl(ng)*7,cha1,cha2,cha*2
integer lenght(ng),ng,l3,iFlag,i
logical SmearedPrev
real*8 Up_lim,Up_lim_E
!.......... name of the file for the group (is used if ng.ne.1)
f_gr='dos.dat0'//file(1)(9:lenght(1))
!.......... common part for both regimes ............................
call system('rm test.gnu')
open (l3, file='test.gnu', status='new')
write (l3,300) xaxis,yaxis
300 format ('#set data style lines'/ &
'set format y "%.4f"'/ &
'set key'/ &
'set xlabel "',a,'" '/ &
'set ylabel "',a,'" ')
write (l3,305) title
305 format ('set title "', a, '"')
!.......... axes limits
if(Up_lim.ne.0.0) then
write(l3,306) Up_lim
306 format('set yrange [0:',f10.5,']')
end if
if(Up_lim_E.ne.0.0) then
write(l3,307) Up_lim_E
307 format('set xrange [:',f10.5,']')
end if
!.......... distinct part ...........................................
if(where.eq.'Screen') then
write (l3,*) 'set terminal x11'
write (l3,401)
401 format ('#set terminal post color "Times-Roman" 14')
if(ng.eq.1) then
write(l3,'(a)')'#set output "'//file(1)(1:lenght(1))//'.ps"'
else
write(l3,'(a)')'#set output "'//f_gr(1:lenght(1))//'.ps"'
end if
else
write (l3,301)
301 format ('set terminal post color "Times-Roman" 14')
if(ng.eq.1) then
write (l3,'(a)')'set output "'//file(1)(1:lenght(1))//'.ps"'
else
write (l3,'(a)')'set output "'//f_gr(1:lenght(1))//'.ps"'
end if
end if
!.......... common part: .........................................
!____ we show columns cha1 and cha2 for DOS and LDOS, respectively,
! depending on Smeared='N','F','S':
cha='" '
if(Smeared.eq.'F'.and.SmearedPrev) cha='_"'
if(Smeared.eq.'N' .or. Smeared.eq.'F') then
cha1='2'
cha2='3'
else if(Smeared.eq.'S') then
if(SmearedPrev) then
cha1='3'
cha2='5'
else
cha1='2'
cha2='4'
end if
end if
!_____ plot commands
if(iFlag.eq.1) then
write (l3,*) 'plot "'//file(1)(1:lenght(1))//cha// &
' u 1:'//cha1//' t "'//title_pl(1)//'" w l'//char(92)
write (l3,*)', "'//file(1)(1:lenght(1))//cha//' u 1:'// &
cha2//' t "'//title_pl(1)//'(loc)" w l'//char(92)
else
write (l3,*)'plot "'//file(1)(1:lenght(1))//cha//' u 1:'// &
cha1//' t "'//title_pl(1)//'" w l'//char(92)
end if
if(ng.eq.1) go to 10
do i=2,ng
if(iFlag.eq.1) then
write (l3,*)', "'//file(i)(1:lenght(i))//cha//' u 1:'// &
cha1//' t "'//title_pl(i)//'" w l'//char(92)
write (l3,*)', "'//file(i)(1:lenght(i))//cha//' u 1:'// &
cha2//' t "'//title_pl(i)//'(loc)" w l'//char(92)
else
write (l3,*)', "'//file(i)(1:lenght(i))//cha//' u 1:'// &
cha1//' t "'//title_pl(i)//'" w l'//char(92)
end if
end do
10 write(l3,*)' '
if(where.eq.'Screen') write (l3,*)'pause -1'
close (l3)
call system ('gnuplot test.gnu')
!.......... Check postscript file if it was specified ................
if(where.ne.'Screen') then
if(ng.ne.1) then
write(6,*)'The postscript file '// &
f_gr(1:lenght(1))//'.ps" has been created!'
else
write(6,*)'The postscript file '// &
file(1)(1:lenght(1))//'.ps" has been created!'
end if
end if
end subroutine Plot
subroutine Plot1(file,lenght,title,title_pl, &
xaxis,yaxis,where,l3,iFlag, &
Smeared,SmearedPrev,Up_lim,Up_lim_E)
!......................................................................
! Plot curves eighter on the screen or on to a ps-file
!......................................................................
! title - the title of the plot (char*50)
! xaxis - the title of the x-axis (char*20)
! yaxis - the title of the y-axis (char*20)
! where - where to print: on the 'Screen' or on the 'Postsc' (char*6)
!......................................................................
! file - name of the data file for the GNUPLOT
! lenght - lenght of the data files names;
! title_pl - subtitle for each curve
! test.gnu - standart name of the file used by the GNUPLOT;
! file.ps - name of the postscript file prepared by GNUPLOT.
! l3 - reserved UNIT for the files used here.
!......................................................................
! When Smeared='S' and SmearedPrev=.true., we show column 3 for
! the DOS and column 5 for the LDOS (i.e. smeared densities); otherwise,
! i.e. if SmearedPrev=.false., we show columns 2 and 4, respectively.
! If Smeared='N', we show columns 2 and 3 respectively as there
! are no smeared results at all.
! If Smeared='F' and SmearedPrev=.true., we show column 2 for the
! smeared DOS and column 3 for the smeared LDOS in file//'_' ; otherwise,
! i.e. if SmearedPrev=.false., we show columns 2 and 3 in file.
!.....................................................................
!
implicit none
character title*50,xaxis*20,yaxis*20,where*6,Smeared
character file*12,f_gr*12,title_pl*7,cha1,cha2,cha*2
integer lenght,iFlag,l3
logical SmearedPrev
real*8 Up_lim,Up_lim_E
!.......... name of the file for the group (is used if ng.ne.1)
f_gr='dos.dat0'//file(9:lenght)
!.......... common part for both regimes ............................
call system('rm test.gnu')
open (l3, file='test.gnu', status='new')
write (l3,300) xaxis,yaxis
300 format ('#set data style lines'/ &
'set format y "%.4f"'/ &
'set key'/ &
'set xlabel "',a,'" '/ &
'set ylabel "',a,'" ')
write (l3,305) title
305 format ('set title "', a, '" ')
!.......... exes limits
if(Up_lim.ne.0.0) then
write(l3,306) Up_lim
306 format('set yrange [0:',f10.5,']')
end if
if(Up_lim_E.ne.0.0) then
write(l3,307) Up_lim_E
307 format('set xrange [:',f10.5,']')
end if
!.......... distinct part ...........................................
if(where.eq.'Screen') then
write (l3,*) 'set terminal x11'
write (l3,401)
401 format ('#set terminal post color "Times-Roman" 14')
write(l3,'(a)')'#set output "'//file(1:lenght)//'.ps"'
else
write (l3,301)
301 format ('set terminal post color "Times-Roman" 14')
write (l3,'(a)')'set output "'//file(1:lenght)//'.ps"'
end if
!.......... common part: .........................................
!____ we show columns cha1 and cha2 for DOS and LDOS, respectively,
! depending on Smeared='N','F','S':
cha='" '
if(Smeared.eq.'F'.and.SmearedPrev) cha='_"'
if(Smeared.eq.'N' .or. Smeared.eq.'F') then
cha1='2'
cha2='3'
else if(Smeared.eq.'S') then
if(SmearedPrev) then
cha1='3'
cha2='5'
else
cha1='2'
cha2='4'
end if
end if
!_____ plot commands
if(iFlag.eq.1) then
write (l3,*) 'plot "'//file(1:lenght)//cha// &
' u 1:'//cha1//' t "'//title_pl//'" w l'//char(92)
write (l3,*)', "'//file(1:lenght)//cha//' u 1:'// &
cha2//' t "'//title_pl//'(loc)" w l'//char(92)
else
write (l3,*)'plot "'//file(1:lenght)//cha//' u 1:'// &
cha1//' t "'//title_pl//'" w l'//char(92)
end if
write(l3,*)' '
if(where.eq.'Screen') write (l3,*)'pause -1'
close (l3)
call system ('gnuplot test.gnu')
!.......... Check postscript file if it was specified ................
if(where.ne.'Screen') then
write(6,*)'The postscript file '// &
file(1:lenght)//'.ps" has been created!'
end if
end subroutine Plot1
subroutine Plot2(ng,file,lenght,title,title_pl, &
xaxis,yaxis,where,l3,Up_lim,Up_lim_E,ShowTotDos)
!......................................................................
! Plot curves eighter on the screen or on to a ps-file
!......................................................................
! title - the title of the plot (char*50)
! xaxis - the title of the x-axis (char*20)
! yaxis - the title of the y-axis (char*20)
! where - where to print: on the 'Screen' or on the 'Postsc' (char*6)
!......................................................................
! ng - number of data files to be used simultaneously
! file(i) - name of the data file for the GNUPLOT, i=1,...,ng;
! lenght(i) - lenght of the data files names;
! title_pl(i) - subtitle for each curve
! test.gnu - standart name of the file used by the GNUPLOT;
! file.ps - name of the postscript file prepared by GNUPLOT.
! l3 - reserved UNIT for the files used here.
!......................................................................
! ShowTotDos = 'O' - only total DOS
! ShowTotDos = 'Y' - total DOS shown alongside the PDOS
! ShowTotDos = 'N' - total not DOS shown alongside the PDOS
!......................................................................
!
implicit none
character title*50,xaxis*20,yaxis*20,where*6
character file(ng)*12,f_gr*12,title_pl(ng)*8,cha1,cha2,cha*2
integer lenght(ng),ng,l3,i
real*8 Up_lim,Up_lim_E
character ShowTotDos
!.......... name of the file for the group (is used if ng.ne.1)
f_gr='dos.dat0'//file(1)(9:lenght(1))
!.......... common part for both regimes ............................
call system('rm test.gnu')
open (l3, file='test.gnu', status='new')
write (l3,300) xaxis,yaxis
300 format ('#set data style lines'/ &
'set format y "%.4f"'/ &
'set key'/ &
'set xlabel "',a,'" '/ &
'set ylabel "',a,'" ')
write (l3,305) title
305 format ('set title "', a, '" ')
!.......... axes limits
if(Up_lim.ne.0.0) then
write(l3,306) Up_lim
306 format('set yrange [0:',f10.5,']')
end if
if(Up_lim_E.ne.0.0) then
write(l3,307) Up_lim_E
307 format('set xrange [:',f10.5,']')
end if
!.......... distinct part ...........................................
if(where.eq.'Screen') then
write (l3,*) 'set terminal x11'
write (l3,401)
401 format ('#set terminal post color "Times-Roman" 14')
if(ng.eq.1) then
write(l3,'(a)')'#set output "'//file(1)(1:lenght(1))//'.ps"'
else
write(l3,'(a)')'#set output "'//f_gr(1:lenght(1))//'.ps"'
end if
else
write (l3,301)
301 format ('set terminal post color "Times-Roman" 14')
if(ng.eq.1) then
write (l3,'(a)')'set output "'//file(1)(1:lenght(1))//'.ps"'
else
write (l3,'(a)')'set output "'//f_gr(1:lenght(1))//'.ps"'
end if
end if
!.......... common part: .........................................
!____ we show columns cha1 and cha2 for DOS and LDOS, respectively,
cha='" '
cha1='2'
cha2='3'
!_____ plot commands: show DOS only for the first file
if(ShowTotDos.eq.'O') then
write (l3,*) 'plot "'//file(1)(1:lenght(1))//cha// &
' u 1:'//cha1//' t "total" w l'//char(92)
else if(ShowTotDos.eq.'Y') then
write (l3,*) 'plot "'//file(1)(1:lenght(1))//cha// &
' u 1:'//cha1//' t "total" w l'//char(92)
write (l3,*)', "'//file(1)(1:lenght(1))//cha//' u 1:'// &
cha2//' t "'//title_pl(1)//'(loc)" w l'//char(92)
else if(ShowTotDos.eq.'N') then
write (l3,*)'plot "'//file(1)(1:lenght(1))//cha//' u 1:'// &
cha2//' t "'//title_pl(1)//'(loc)" w l'//char(92)
end if
if(ng.eq.1) go to 10
do i=2,ng
write (l3,*)', "'//file(i)(1:lenght(i))//cha//' u 1:'// &
cha2//' t "'//title_pl(i)//'(loc)" w l'//char(92)
end do
10 write(l3,*)' '
if(where.eq.'Screen') write (l3,*)'pause -1'
close (l3)
call system ('gnuplot test.gnu')
!.......... Check postscript file if it was specified ................
if(where.ne.'Screen') then
if(ng.ne.1) then
write(6,*)'The postscript file '// &
f_gr(1:lenght(1))//'.ps" has been created!'
else
write(6,*)'The postscript file '// &
file(1)(1:lenght(1))//'.ps" has been created!'
end if
end if
end subroutine Plot2
subroutine Plot_sm(ng,file1,lenght1,file,lenght,title,title_pl, &
xaxis,yaxis,where,l3,Smeared,Up_lim,Up_lim_E)
!......................................................................
! Plot curves eighter on the screen or on to a ps-file
!......................................................................
! title - the title of the plot (char*50)
! xaxis - the title of the x-axis (char*20)
! yaxis - the title of the y-axis (char*20)
! where - where to print: on the 'Screen' or on the 'Postsc' (char*6)
!......................................................................
! ng - number of data files to be used simultaneously
! file(i) - name of the data file for the GNUPLOT, i=1,...,ng;
! lenght(i) - lenght of the data files names;
! title_pl(i) - subtitle for each curve
! test.gnu - standart name of the file used by the GNUPLOT;
! file.ps - name of the postscript file prepared by GNUPLOT.
! l3 - reserved UNIT for the files used here.
!......................................................................
! If Smeared='F', we show columns 2 for the raw DOS from file and,
! at the same time, all smeared DOS from file//'_'.
! If Smeared='S', then we show columns 2 and 3 for the raw and smeared
! DOS, respectively.
!......................................................................
!
implicit none
character title*50,xaxis*20,yaxis*20,where*6,Smeared
character file(ng)*12,f_gr*12,title_pl(ng)*7,cha1,cha2,cha*2
character file1*12
integer lenght(ng),ng,lenght1,l3,i
real*8 Up_lim,Up_lim_E
!.......... name of the file for the group (is used if ng.ne.1)
f_gr='dos.dat0'//file(1)(9:lenght(1))
!.......... common part for both regimes ............................
call system('rm test.gnu')
open (l3, file='test.gnu', status='new')
write (l3,300) xaxis,yaxis
300 format ('#set data style lines'/ &
'set format y "%.4f"'/ &
'set key'/ &
'set xlabel "',a,'" '/ &
'set ylabel "',a,'" ')
write (l3,305) title
305 format ('set title "', a, '" ')
!.......... axes limits
if(Up_lim.ne.0.0) then
write(l3,306) Up_lim
306 format('set yrange [0:',f10.5,']')
end if
if(Up_lim_E.ne.0.0) then
write(l3,307) Up_lim_E
307 format('set xrange [:',f10.5,']')
end if
!.......... distinct part ...........................................
if(where.eq.'Screen') then
write (l3,*) 'set terminal x11'
else
write (l3,301)
301 format ('set terminal post "Times-Roman" 14')
! 301 format ('set terminal post portrait "Times-Roman" 14'/
! & 'set size 0.7,1.4')
if(ng.eq.1) then
write (l3,'(a)')'set output "'//file(1)(1:lenght(1))//'.ps"'
else
write (l3,'(a)')'set output "'//f_gr(1:lenght(1))//'.ps"'
end if
end if
!.......... common part: .........................................
!____ we show columns cha1 and cha2 depending on Smeared='F','S'
if(Smeared.eq.'F') then
cha='_"'
cha1='2'
cha2='2'
else
cha='" '
cha1='2'
cha2='3'
end if
!_____ plot commands
write (l3,*) 'plot "'//file1(1:lenght1)//'" u 1:'// &
cha1//' t "original" w l'//char(92)
write (l3,*)', "'//file(1)(1:lenght(1))//cha//' u 1:'// &
cha2//' t "'//title_pl(1)//'(smr)" w l'//char(92)
if(ng.eq.1) go to 10
do i=2,ng
write (l3,*)', "'//file(i)(1:lenght(i))//cha//' u 1:'// &
cha2//' t "'//title_pl(i)//'(smr)" w l'//char(92)
end do
10 write(l3,*)' '
if(where.eq.'Screen') write (l3,*)'pause -1'
close (l3)
call system ('gnuplot test.gnu')
!.......... Check postscript file if it was specified ................
if(where.ne.'Screen') then
if(ng.ne.1) then
write(6,*)'The postscript file '// &
f_gr(1:lenght(1))//'.ps" has been created!'
else
write(6,*)'The postscript file '// &
file(1)(1:lenght(1))//'.ps" has been created!'
end if
end if
! call system ('gs '//file(1:lenght)//'.ps')
return
end subroutine Plot_sm
subroutine Plot_Explr(file,lenght,title,xaxis,yaxis,where,l3)
!......................................................................
! Plot the DOS curves eighter on the screen or on to a ps-file
!......................................................................
! title - the title of the plot (char*50)
! xaxis - the title of the x-axis (char*20)
! yaxis - the title of the y-axis (char*20)
! where - where to print: on the 'Screen' or on the 'Postsc' (char*6)
!......................................................................
! file - name of the data file for the GNUPLOT;
! test.gnu - standart name of the file used by the GNUPLOT;
! file.ps - name of the postscript file prepared by GNUPLOT.
! l3 - reserved UNIT for the files used here.
!......................................................................
!
implicit none
integer lenght,l3
character title*50,xaxis*20,yaxis*20,where*6
character file*8
!.......... common part for both regimes ............................
call system('rm test.gnu')
open (l3, file='test.gnu', status='new')
write (l3,300) xaxis,yaxis
300 format ('#set data style lines'/ &
'set format y "%.4f"'/ &
'set key'/ &
'set xlabel "',a,'" '/ &
'set ylabel "',a,'" ')
write (l3,305) title
305 format ('set title "', a, '" ')
!.......... distinct part ...........................................
if(where.eq.'Screen') then
write (l3,*) 'set terminal x11'
write (l3,'(a)')'#set output "'//file(1:lenght)//'.eps"'
write(l3,*)'#set terminal post color "Times-Roman" 14'
else
write (l3,301)
301 format ('set terminal post color "Times-Roman" 14')
! 301 format ('set terminal post portrait "Times-Roman" 14'/
! & 'set size 0.7,1.4')
write (l3,'(a)')'set output "'//file(1:lenght)//'.eps"'
end if
!.......... common part: plot commands ..............................
write (l3,*)'plot "'//file(1:lenght)//'" u 1:2 t "A1" w l'//char(92)
write (l3,*)', "'//file(1:lenght)//'" u 3:4 t "A2" w l'//char(92)
write (l3,*)', "'//file(1:lenght)//'" u 5:6 t "A3" w l'
if(where.eq.'Screen') write (l3,*)'pause -1'
close (l3)
call system ('gnuplot test.gnu')
end subroutine Plot_Explr
subroutine Plot_bunch(ng,file,lenght,title,title_pl,xaxis,yaxis,where,l3)
!......................................................................
! Plot ng curves from a single file: on the screen or on to a ps-file
!......................................................................
! title - the title of the plot (char*50)
! xaxis - the title of the x-axis (char*20)
! yaxis - the title of the y-axis (char*20)
! where - where to print: on the 'Screen' or on the 'Postsc' (char*6)
!......................................................................
! ng - number of data columns in the file to be used simultaneously
! file - name of the data file for the GNUPLOT, i=1,...,ng;
! lenght - lenght of the data files names;
! title_pl(i) - subtitle for each curve
! test.gnu - standart name of the file used by the GNUPLOT;
! file.ps - name of the postscript file prepared by GNUPLOT.
! l3 - reserved UNIT for the files used here.
!......................................................................
!
implicit none
character title*50,xaxis*20,yaxis*20,where*6
character file*12,title_pl(ng)*7,cha1
integer lenght,ng,l3,i
!.......... common part for both regimes ............................
call system('rm test.gnu')
open (l3, file='test.gnu', status='new')
write (l3,300) xaxis,yaxis
300 format ('#set data style lines'/ &
'set format y "%.4f"'/ &
'set key'/ &
'set xlabel "',a,'" '/ &
'set ylabel "',a,'" ')
write (l3,305) title
305 format ('set title "', a, '"')
!.......... distinct part ...........................................
if(where.eq.'Screen') then
write (l3,*) 'set terminal x11'
write (l3,401)
401 format ('#set terminal post color "Times-Roman" 14')
write(l3,'(a)')'#set output "'//file(1:lenght)//'.ps"'
else
write (l3,301)
301 format ('set terminal post color "Times-Roman" 14')
write (l3,'(a)')'set output "'//file(1:lenght)//'.ps"'
end if
!.......... common part: .........................................
write (l3,*) 'plot "'//file(1:lenght)// &
'" u 1:2 t "'//title_pl(1)//'" w l'//char(92)
if(ng.eq.1) go to 10
do i=2,ng
write(cha1,'(i1)') i
write (l3,*)', "'//file(1:lenght)//'" u 1:'// &
cha1//' t "'//title_pl(i)//'" w l'//char(92)
end do
10 write(l3,*)' '
if(where.eq.'Screen') write (l3,*)'pause -1'
close (l3)
call system ('gnuplot test.gnu')
!.......... Check postscript file if it was specified ................
if(where.ne.'Screen') write(6,*)'The postscript file '// &
file(1:lenght)//'.ps" has been created!'
end subroutine Plot_bunch
subroutine Plot3d(file,lenght,title,xaxis,yaxis,zaxis,where,l3, &
nclasses,type_prv)
!......................................................................
! Plot the 3D density
!......................................................................
! title - the title of the plot (char*50)
! xaxis - the title of the x-axis (char*20)
! yaxis - the title of the y-axis (char*20)
! zaxis - the title of the z-axis (char*20)
! where - where to print: on the 'Screen' or on the 'Postsc' (char*6)
! type_prv = '2d-old-' - it makes a contour plot, old style
! = '2d-col-' - it makes a 2D plot, with colour
! = '2d-gray' - it makes a 2D plot, gray palette
! = '3d-old-' - it makes a 3D plot, single colour with grid
! = '3d-c-2d' - it makes a 3D plot, with colour 2D underneath;
! = '3d-g-2d' - it makes a 3D plot, with gray 2D underneath;
! = '3d-col-' - it makes a nice 3D plot, colour, without 2D underneath
!......................................................................
! file - name of the data file for the GNUPLOT;
! test.gnu - standart name of the file used by the GNUPLOT;
! file.ps - name of the postscript file prepared by GNUPLOT.
! l3 - reserved UNIT for the files used here.
!......................................................................
!
implicit none
integer lenght,l3,nclasses
character title*50,xaxis*20,yaxis*20,where*6,zaxis*20,type_prv*7
character file*8
!.......... common part for both regimes ............................
call system('rm test.gnu')
open (l3, file='test.gnu', status='new')
write (l3,300) xaxis,yaxis,zaxis
300 format ('#set data style lines'/ '#set nokey'/ 'set size ratio 1' /&
'set xlabel "',a,'" '/ 'set ylabel "',a,'" '/ 'set zlabel "',a,'" ')
write (l3,305) title
305 format ('set title "', a, '" ')
!
!.......... write specific parameters for different plot types
!
!_______________ contour, old style: 2D + grid lines
if(type_prv.eq.'2d-old-') then
write (l3,200) nclasses
200 format ('set view 0,0,1,1'/ 'set nosurface'/ 'set dgrid3d'/ &
'set contour'/ 'set cntrparam level ',i5 )
!_______________ contour, new style, colour: 2D + colours
else if(type_prv.eq.'2d-col-') then
write (l3,201)
201 format ('set view 0,0,1,1'/ 'set nosurface'/ 'set pm3d')
!_______________ contour, new style, gray: 2D + gray palette
else if(type_prv.eq.'2d-gray') then
write (l3,202)
202 format ('set view 0,0,1,1'/ 'set nosurface'/ 'set palette gray'/&
'set pm3d')
!_______________ 3D + nice colour + no 2D underneat
else if(type_prv.eq.'3d-col-') then
write (l3,203)
203 format ('set nosurface'/ 'set pm3d')
!_______________ 3D + colour 2D underneath
else if(type_prv.eq.'3d-c-2d') then
write (l3,204)
204 format ('set surface'/ 'set pm3d at b')
!_______________ 3D + gray 2D underneath
else if(type_prv.eq.'3d-g-2d') then
write (l3,205)
205 format ('set surface'/ 'set pm3d at b'/ 'set palette gray')
end if
!.......... distinct part ...........................................
if(where.eq.'Screen') then
write (l3,*) 'set terminal x11'
write (l3,302)
302 format ('#set terminal post color "Times-Roman" 14')
else
write (l3,301)
301 format ('set terminal post color "Times-Roman" 14')
write (l3,'(a)')'set output "'//file(1:lenght)//'.ps"'
end if
!.......... common part: plot commands ..............................
write (l3,*)'splot "'//file(1:lenght)//'" u 1:2:3 w l'
if(where.eq.'Screen') write (l3,*)'pause -1'
close (l3)
call system ('gnuplot test.gnu')
!.......... Check postscript file if it was specified ................
! if(where.ne.'Screen') call system ('gs '//file(1:lenght)//'.ps')
end subroutine Plot3d