-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path@3dfdispC.f03
1609 lines (1606 loc) · 43.9 KB
/
@3dfdispC.f03
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
!**************************************************************
!* Post processing by Linux: pgf95/gfortran *
!* % gfortran @3dfdispC.f03 &> log *
!* *
!* 'call pplot2 (xg,yg,zg,vx,vy,vz,...)' makes sequential *
!* plots of velocity distributions of H,C,Au and electrons *
!* *
!* Make the ps to pdf conversin, and plot on the PC screen. *
!* They are quite useful when the simulation results are *
!* analyzed which is written in papers. *
!* *
!* cf: M.Tanaka, Comp.Physics Commun., vol.241, 56 (2019). *
!* Dr.Motohiko Tanaka, Professor, Chubu University, Japan. *
!* Jan. 9, 2016 *
!**************************************************************
!*-------------------------------------------------------------
!* Fortran 2003 handles such technique as continuity and
!* lower cases, They are used within each file::
!* :s%/^C/!/
!* :s%/^c/!/
!* and outside the file:
!* tr 'A-Z' 'a-z' <@mrg3.f >@mrg37.f03
!*
!* $ mpif90 -mcmodel=medium -fast @mrg37.f03 -I/opt/pgi/fftw3/include &
!* -L/opt/pgi/fftw3/lib -lfftw3
!* $ mpiexec -n 6 a.out &
!*-------------------------------------------------------------
!
program cntcmpCa
implicit none
!
integer*4 ns0,np0,nq0,npq0,knum_num
character sname*6,cname*6,numbr1*1,fig_label*32
!
! The number C+Au atoms, and H atoms. Electrons are equal iin number
! to C+Au+H. npq0 is the total number of particles.
parameter (ns0=110600,np0=10120,nq0=np0+5*ns0/2, & ! 'a,t' series
npq0=ns0+np0+nq0)
!
! Position x,y,z, velocity vx,vy,vz, mass am. ch charge, shape ag
! c1, c2: speed of light, and its square
real*8 xg(npq0),yg(npq0),zg(npq0),vx(npq0),vy(npq0),vz(npq0),&
am(npq0),ch(npq0),ag(npq0),massi,fchar,fchara, &
c1,c2,rd_cp,rd_hp,rd_el,ssg(npq0),tiwrt1
!
! Position in 1D xyz, momentum in 1D ppp, velocity in 1D vvv
! relativistic gamma factor
real*8 xyz(npq0,3),ppp(npq0,3),vvv(npq0,3),m_gamma
character(len=1) :: sg(npq0)
!
! Run name: sname, cnam, the run number like a,A,1,...
parameter (sname='cntemp',cname='cntemp',numbr1='C')
!
character praefixs*27,suffix*3,knum(20)*1
!
! t: time, tmin,tmax: minimum and maximum of physical run time
! ns,np,nq: number of C+Au, H and electrons, nCLp: total number of particles
! it: time steps, is: the number of sequential plots
integer*4 ns,np,nq,nCLp,it,is,itskp,nZ,nZa,nframe,knum1,i
real*4 t,time,tmin,tmax,xp_leng,hh
character*8 label(8),date_now*10,cnam1*8,commt*10,cdate*10,ctime*8
!
common/headr1/ label,date_now
common/headr2/ time,xp_leng
common/headr3/ cnam1,commt
namelist/inp1/ tmin,tmax,itskp
!
! Maximum plot (3d)
label(1)='cnt-em3q'
cnam1=cname//'.'//numbr1
call date_and_time_7 (date_now,ctime)
!
write(6,*) 'type &inp1 tmax, itskp...'
! read(5,inp1)
!--------------------------------------------------
! praefixs='/lv01/mtanaka/cntem3_para3/'
praefixs='/home/mtanaka/cntem3-para3/'
!
! % gfortran @3dfdispC.f03 &> log *
! Number of many plots in sequences
knum_num= 9 !+1 ! 12 +1 ! files to plots
itskp= 5 ! 2 ! 1
!
tmin= 0.0d-15
tmax= 40.1d-15
!
write(6,*) ' type cname(6) and numbr1(1)...'
! read(5,10) cname,numbr1
! 10 format(a6,a1)
!
knum(1)= 'a'
knum(2)= 'b'
knum(3)= 'c'
knum(4)= 'd'
knum(5)= 'e'
knum(6)= 'f'
knum(7)= 'g'
knum(8)= 'h'
knum(9)= 'i'
knum(10)= 'j'
knum(11)= 'k'
knum(12)= 'l'
!
knum1= 1
write(6,*) 'read: ',cname//'.23'//numbr1
open (unit=23,file=cname//'.23'//numbr1//'a', & ! 'a'
status='old',form='unformatted')
!
write(6,*) 'write: ',cname//'.77'//numbr1//'fb.ps'
open (unit=77,file=cname//'.77'//numbr1//'fb.ps', &
status='unknown')
!
nframe= 1 ! or 4 by page but small !
call gopen (nframe)
!
it= 0
is= 0
!
tiwrt1= 0.d0
!
3 write(6,*) '*initial ns,np,nq '
read(23) ns,np,nq
read(23) fchar,fchara,massi ! 1-80, 1836.
read(23) am,ch ! g, esu
!
! ag( )
nCLp= ns +np +nq
nZ= 1
nZa= 4
write(6,*) 'ns, np, nq=',ns,np,nq
write(6,*) 'nZ, nZa=',nZ,nZa
!
rd_cp = 0.92d-8 ! c(+z)
rd_hp = 0.50d-8 ! h(+)
rd_el = 0.50d-8
do i= 1,ns
ag(i)= rd_cp
end do
do i= ns+1,ns+np
ag(i)= rd_hp
end do
do i= ns+np+1,nCLp
ag(i)= rd_el
end do
!
c1= 2.9979d+10
c2= 2.9979d+10**2
!
! sec, cm, cm/sec
100 read(23,end=700) t,xyz,vvv
write(6,*) 'time=',t
!
it= it +1
!
if(t.lt.tmin) go to 100
if(t.gt.tmax) go to 700
!
! if(itskp.eq.1 .or. mod(it,itskp).eq.1) then
if(itskp.eq.1 .or. t.ge.tiwrt1) then
tiwrt1= tiwrt1 +0.50d-15
write(6,*) 't,tiwrt1=',t,tiwrt1
!
is= is +1
time= t
!
do i= 1,npq0
ssg(i)= (vx(i)**2 +vy(i)**2 +vz(i)**2)/c2
sg(i)= ' '
if(ssg(i).gt.0.9) sg(i)= '*'
end do
!
do i= 1,npq0
xg(i)= xyz(i,1)
yg(i)= xyz(i,2)
zg(i)= xyz(i,3)
!
vx(i)= vvv(i,1)
vy(i)= vvv(i,2)
vz(i)= vvv(i,3)
end do
!
write(6,*) 'pplot2 t=',t
call pplot2 (xg,yg,zg,vx,vy,vz,am,ch,ag,fchar,fchara, &
nZ,nZa,npq0,ns,np,nq,nCLp,is)
!
write(6,*) 't,it=',t,it
write(6,400) (i,xg(i),yg(i),zg(i),vx(i),vy(i),vz(i), &
ssg(i),sg(i),i=1,nCLp,50000)
400 format(i6,1p6e11.3,2x,e11.3,a1)
!
write(32,*) 't,it=',t,it
write(32,410) (i,xg(i),yg(i),zg(i),vx(i),vy(i),vz(i), &
ssg(i),sg(i),i=1,nCLp)
410 format(i6,1p6e11.3,2x,e11.3,a1)
end if
go to 100
!
700 if(knum1.eq.knum_num) go to 800
knum1= knum1 +1
!
write(6,*) 'read: ',cname//'.23'//numbr1
open (unit=23,file=cname//'.23'//numbr1//knum(knum1), & ! 'a'
status='old',form='unformatted',err=800)
go to 3
!
800 continue
hh= 0.80 ! End plot at the right corner must be !
call symbol (15.5,0.1,hh,'right: t=',0.,9)
call number (19.7,0.1,hh,time,0.,5)
!
close (23)
call plote
!
close (77)
write(06,*) 'write: ',cname//'.77'//numbr1//'fb.ps'
write(06,*) ' gfortran @3dfdispC.f03, ps->pdf by pspdf ...77Cfb'
!
stop
end program cntcmpCa
!
!
! Parallel and perpendicular velocity distrubations
! for H,C,Au and electrons
!-------------------------------------------------------------
subroutine pplot2 (x,y,z,vx,vy,vz,am,ch,ag,fchar,fchara, &
nZ,nZa,npq0,ns,np,nq,nCLp,is)
!-------------------------------------------------------------
implicit none
!
integer*4 ns,np,nq,npq0,nCLp,nZ,nZa,npt1,npt2,npt3,npt4, &
is,iplot,i
real*8 x(npq0),y(npq0),z(npq0),vx(npq0),vy(npq0),vz(npq0),&
am(npq0),ch(npq0),ag(npq0),fchar,fchara
real*8 c
real*8 r1,r2,z1,z2
real*4 t,dd,hal0,hal1,hal2,hal(10),val0,val,val2,ps,yy,zz
common/abspos/ r1,r2,z1,z2,hal1,hal2,hal,val,val2
logical ifabs
data ifabs/.true./
!
real*4 time,xp_leng,hh
character*8 label(8),date_now*10,cnam1*8,commt*10
common/headr1/ label,date_now
common/headr2/ time,xp_leng
common/headr3/ cnam1,commt
!
!-------------------------
!* Radial distributions
!-------------------------
! % gfortran @3dfdispC.f03 &> log *
!
call newcolor (0,1.,0.,0.)
iplot= mod(is,6)
if(mod(is,6).eq.0) iplot= 6
! +++++++++
!
hh= 0.80
!
if(iplot.eq.6) then ! .or. iplot.eq.4) then
! ++++++++++++++++
!
label(1)= 'Pplot2 '
call symbol (0.1,17.0,hh,label(1),0.,8)
call symbol (5.1,17.0,hh,date_now, 0.,10)
!
! call symbol (10.1,17.0,hh,' ',0.,8) ! inam1
call symbol (15.5,0.1,hh,'right: t=',0.,9)
call number (19.7,0.1,hh,time,0.,5)
!
call symbol ( 2.0,15.0,hh,'vy-vz plot',0.,10)
end if
!
if(ifabs) then
! ifabs= .false. ! enlarge at the first glance
!
r1= 0
z1= 0
!
do i= 1,ns+np ! cm/sec
r1= dmax1(r1, sqrt(vx(i)**2 +vy(i)**2)) ! horizontal
z1= dmax1(z1, abs(vz(i)))
end do
!
r2= 0
z2= 0
do i= ns+np+1,nCLp
r2= dmax1(r2, sqrt(vx(i)**2 +vy(i)**2)) ! horizontal
z2= dmax1(z2, abs(vz(i)))
end do
!
write(6,*) 'vx1,vz1 (cm/sec)=',r1,z1
write(6,*) 'vx2,vz2 (cm/sec)=',r2,z2
end if
!*
! hal1= 200. ! 100. ! 40.0 ! 30.0
hal1= 100.
val= 12.0 !11.0
!
hal0= 100. ! 40.0
val0= 7.5
!
hal2= 1.5 ! 1.0
val2= 3.0
!
hal(1)= 3.0
hal(2)= 7.0
hal(3)= 11.0
hal(4)= 15.0
hal(5)= 19.0
hal(6)= 23.0
!
hh= 0.7
call newcolor (0,1.,0.,0.)
call plot (hal(iplot)-1.5, val, 3)
call plot (hal(iplot)+1.5, val, 2)
call plot (hal(iplot), val-1.5, 3)
call plot (hal(iplot), val+1.5, 2)
call plot (hal(iplot), val+1.5, 3)
!
call plot (hal(iplot)-1.5, val0, 3)
call plot (hal(iplot)+1.5, val0, 2)
call plot (hal(iplot), val0-1.5, 3)
call plot (hal(iplot), val0+1.5, 2)
call plot (hal(iplot), val0+1.5, 3)
!
call plot (hal(iplot)-1.5, val2, 3)
call plot (hal(iplot)+1.5, val2, 2)
call plot (hal(iplot), val2-1.5, 3)
call plot (hal(iplot), val2+1.5, 2)
call plot (hal(iplot), val2+1.5, 3)
call newcolor (0,1.,0.,0.)
!
! % gfortran @3dfdispC.f03 &> log *
if(iplot.eq.6 .or. iplot.eq.4) then
call symbol ( 2.0,14.0,hh,' ',0.,3) ! 'vx='
!
! call number (999.0,999.0,hh,hal1,0.,9) ! 5 digit
call number ( 5.0,14.0,hh,hal1,0.,9) ! 5 digit
call symbol ( 8.8,14.0,hh,'*protons',0.,8)
!
call symbol ( 6.0, 9.5,hh,'C & Au',0.,6)
!
! call symbol ( 2.0, 5.0,hh,'vx=',0.,3)
! call number (999.0,999.0,hh,hal2,0.,9) ! 5 digit
call number ( 5.0,5.0,hh,hal2,0.,9) ! 5 digit
call symbol ( 8.0,5.0,hh,'*electrons',0.,10)
end if
!
! --------------------------
c= 2.998d+10 ! speed of light in CGS unit
ps= 0.5*13.*10 *1.d+4 !! ??
! --------------------------
!
!* Specified plotted particles: C,Au,H and electrons
!
npt1= (ns/2)/1000
npt2= (ns/2)/1000
npt3= np/1000
npt4= (nZ+nZa)*(ns/2)/1000
!*
do i= ns+1,ns+np,npt3
dd= 7*ps*ag(i) ! cm, 0.08 ! r g b
call newcolor (3,0.,0.,1.) ! blue
!
yy= hal1*vy(i)/c +hal(iplot) ! cm/sec
zz= hal1*vz(i)/c +val
!
if(yy.lt.0. .or. yy.gt.29.) go to 100
if(zz.lt.0. .or. zz.gt.20.) go to 100
call circle (yy-0.02,zz-0.02,dd,2)
100 continue
end do
!*
do i= 1,ns/2,npt1
dd= 7*ps*ag(i) ! 0.08 ! r g b
call newcolor (3,0.,1.,0.) ! green
!
yy= hal0*vy(i)/c +hal(iplot)
zz= hal0*vz(i)/c +val0
!
if(yy.lt.0. .or. yy.gt.29.) go to 150
if(zz.lt.0. .or. zz.gt.20.) go to 150
call circle (yy-0.02,zz-0.02,dd,2)
150 continue
end do
!*
do i= ns/2+1,ns,npt2
dd= 7*ps*ag(i) ! 0.08 ! r g b
call newcolor (3,1.,1.,0.) ! gold
!
yy= hal0*vy(i)/c +hal(iplot)
zz= hal0*vz(i)/c +val0
!
if(yy.lt.0. .or. yy.gt.29.) go to 170
if(zz.lt.0. .or. zz.gt.20.) go to 170
call circle (yy-0.02,zz-0.02,dd,2)
170 continue
end do
!*
!
do i= ns+np,nCLp,npt4
dd= 7*ps*ag(i) ! 0.08 ! r g b
call newcolor (3,1.,0.,0.) ! red
!
yy= hal2*vy(i)/c +hal(iplot) ! cm/sec
zz= hal2*vz(i)/c +val2
!
if(yy.lt.0. .or. yy.gt.29.) go to 200
if(zz.lt.0. .or. zz.gt.20.) go to 200
call circle (yy-0.02,zz-0.02,dd,2)
200 continue
end do
!*
call newcolor (0,1.,0.,0.) ! black
!
if(mod(iplot,6).eq.0) then
call chart
end if
return
end subroutine pplot2
!
!
!------------------------------------------------------------------------
subroutine date_and_time_7 (date_now,time_now)
!------------------------------------------------------------------------
integer, dimension(8) :: ipresent_time
character(len=8) :: time_now
character(len=10) :: date_now
call date_and_time(values=ipresent_time)
write(time_now,'(i2,":",i2,":",i2)') ipresent_time(5:7)
write(date_now,'(i4,"/",i2,"/",i2)') &
ipresent_time(1),ipresent_time(2),ipresent_time(3)
!
return
end
!
!
!------------------------------------------------------
subroutine averg1 (q,qav,is)
!------------------------------------------------------
dimension q(5000)
!
qav= 0.
!
do 100 i= is-9,is
qav= qav +q(i)
100 continue
!
qav= qav/10.
!
return
end
!
!
!------------------------------------------------------
subroutine lplmax (f,fmax,fmin,is)
!------------------------------------------------------
dimension f(7000)
!
fmax= -1.e10
fmin= 1.e10
!
do 100 i= 1,is
fmax= amax1(fmax,f(i))
fmin= amin1(fmin,f(i))
100 continue
!
return
end
!
!
!---------------------------------------
subroutine newcolor (ic,r,g,b)
!---------------------------------------
! ic= 3 tri-color
! ic= 0 gray scale, r= 0. for black
!
write(77,*) 'stroke'
!
if(ic.eq.0) then
write(77,10) 1.-r ! 0. for black
10 format(f4.1,' setgray')
end if
!
if(ic.eq.3) then
write(77,30) r,g,b
30 format(3f4.1,' setrgbcolor')
end if
!
return
end
!
!
!-------------------------------------------------
subroutine circle (x,y,d,ic)
!-------------------------------------------------
!* open circle centered at (x,y) /or outer edge.
!
write(77,*) " 3.0 setlinewidth"
!
pi= 3.1415927
nc= 13
dth= 2.*pi/nc
a= d/2.
!
x0= x +a
y0= y
call plot (x0,y0,3)
!
do 100 j= 1,nc
th= dth*j
!
x1= x +a*cos(th)
y1= y +a*sin(th)
!
call plot (x1,y1,2)
100 continue
!
call plot (x1,y1,3)
write(77,*) " 1.0 setlinewidth"
!
if(ic.eq.1) return
!------------------------------------
!* filled circle centered at (x,y).
!------------------------------------
!
write(77,*) " 3.0 setlinewidth"
!
nc= 5
dth= pi/(2*nc +1)
!
do 300 j= -nc,nc
th= 0.5*pi +dth*j
!
x1= x +a*cos(th)
y1= y +a*sin(th)
!
x2= x1
y2= 2.*y -y1
!
call plot (x1,y1,3)
call plot (x2,y2,2)
300 continue
!
call plot (x2,y2,3)
write(77,*) " 1.0 setlinewidth"
!
return
end
!
!
!------------------------------------------------
block data
!------------------------------------------------
common/ranfff/ ir,iq
data ir/3021/,iq/7331/ ! original
! data ir/17331/,iq/37711/
end
!
!
!------------------------------------------------
function ranff (x)
!------------------------------------------------
!* ranf= (0,1)
!
common/ranfff/ ir,iq
!
real*8 ranff,invm
parameter (mask=2**30+(2**30-1),invm= 0.5d0**31)
parameter (lambda=48828125)
!
ir= iand( lambda*ir, mask)
ranff= ir*invm
!
! ask= 371597.
! ambda= sqrt(ask)
! qq= 0.3713*ask
!
! ir= amod( ambda*ir +qq, ask)
! ranff= ir/ask
!
return
end
!
!
!-----------------------------------------------------------------------
subroutine lplot1 (ix,iy,npt1,x,y,ymax,ymin,il,lab1,n1,lab2,n2, &
lab3,n3)
!-----------------------------------------------------------------------
! <<warning>> order and number of arguments /lplot/ have been changed.
! also, x (time) is defined for all range.
! date: 5/18/96 at mit.
!***********************************************************************
! il=1................ linear plot of (x,y)
! il=2................ log10 plot of (x,log y)
!***********************************************************************
!
dimension x(7000),y(7000),u(7000),v(7000)
dimension xcm(6),ycm(6),pl(6),pr(6),ql(6),qr(6)
!
character*8 lab1,lab2,lab3
character*8 label(8),date_now*10,cax*1
!
common/headr1/ label,date_now
common/headr2/ time,xp_leng
common/pplcom/ nfine,pl1(10),pr1(10),ql1(10),qr1(10), &
xmin1(10),xmax1(10),ymin1(10),ymax1(10)
!
! for fujitsu.
! data xcm/18.46,2*9.867,3*6.18/,
! * ycm/16.85,2*7.435,3*4.381/,
! * pl/2*2.00,15.132,2.00,8.00,18.20/,
! * ql/1.95,10.885,1.95,13.832,7.891,1.95/
!
! for nec.
data xcm/21.0, 2*10.00, 3*7.00/, &
ycm/15.0, 2*6.80, 3*3.90/, &
pl/2.0, 2.0,14.0, 1.0,9.0,17.0/, &
ql/2.3, 10.5,2.3, 12.9,7.6,2.3/
logical lab_skip
!
iplot=1
go to 1
!
!-----------------------------------------------------------------------
entry hplot1 (ix,iy,npt1,x,y,ymax,ymin,il,lab1,n1,lab2,n2,lab3,n3)
!-----------------------------------------------------------------------
iplot=2
!
1 npt= npt1
isc= 1
!
do 5 i=1,6
5 pr(i)= pl(i) +xcm(i)
!
do 6 j=1,6
6 qr(j)= ql(j) +ycm(j)
!
lab_skip= .false.
if(il.eq.7) lab_skip= .true.
!
! ******************************************************
!* ** make a copy before the top-left frame is drawn. **
! ******************************************************
hh = 0.70
hhs= 0.60
!
i1= iabs(ix)
j1= iabs(iy)
if(i1.ge.3) go to 10
if(j1.eq.3.or.j1.ge.5) go to 10
! ************************
! ** label of the page. **
! ************************
call symbol (0.1,18.0,hh,label(1),0.,8)
call symbol (3.1,18.0,hh,date_now, 0.,10)
call symbol (15.9,0.1,hh,'t =',0.,3)
call number (999.0,999.0,hh,time,0.,5)
!
10 continue
!
do 23 i=1,npt
23 u(i)= x(i)
xmax= u(npt)
xmin= u(1)
! ************************************
! ** three-point average if il > 0 **
! ************************************
if(il.gt.0) then
v(1)= y(1)
v(npt)= y(npt)
do 37 i=2,npt-1
v(i)= y(i)
! v(i)= 0.33333*(y(i-1)+y(i)+y(i+1))
37 continue
else
do 38 i=1,npt
38 v(i)= y(i)
end if
! *****************
! ** log. scale **
! *****************
if(iabs(il).eq.2) then
do 40 i=1,npt
if(v(i).gt.0.) then
v(i)= alog10(v(i))
else
v(i)= -10.
end if
40 continue
end if
! **************************************
! ** set a new scale and draw a frame.**
! **************************************
if(iplot.eq.2) then
ymax= -1.e10
ymin= 1.e10
!
do 50 i= 1,npt
ymax= amax1(ymax,v(i))
ymin= amin1(ymin,v(i))
50 continue
!
if(ymin.ge.0.) then
ymax= 1.1*ymax
ymin= 0.
else
ymax= amax1(0.,ymax)
ymin= 1.1*ymin
end if
end if
!
if(ymax.le.ymin) ymax= ymin+1.0
if(iabs(il).eq.2) then
if(ymax.gt.0.0) ymax= ymax+1.0
end if
!
dx= (xmax-xmin)/xcm(i1)
dy= (ymax-ymin)/ycm(j1)
x0= xmin
y0= ymin
!
call scalex (pl(i1),ql(j1),x0,y0,dx,dy,isc)
!
pl1(isc)= pl(i1)
pr1(isc)= pr(i1)
ql1(isc)= ql(j1)
qr1(isc)= qr(j1)
xmin1(isc)= xmin
xmax1(isc)= xmax
ymax1(isc)= ymax
ymin1(isc)= ymin
! *************
! ** frame. **
! *************
call plot (pl(i1),ql(j1),3)
call plot (pl(i1),qr(j1),2)
call plot (pr(i1),qr(j1),2)
call plot (pr(i1),ql(j1),2)
call plot (pl(i1),ql(j1),2)
! ******************
! ** tick marks. **
! ******************
scx= xcm(i1)/5.0
scy= ycm(j1)/4.0
!
x0= pl(i1)
y1= ql(j1)
y4= qr(j1)
y2= y1 +0.25
y3= y4 -0.25
!
do 62 k=1,4
x0= x0 +scx
call plot (x0,y1,3)
call plot (x0,y2,2)
call plot (x0,y3,3)
call plot (x0,y4,2)
62 continue
!
y0= ql(j1)
x1= pl(i1)
x4= pr(i1)
x2= x1 +0.25
x3= x4 -0.25
!
do 63 k=1,3
y0= y0 +scy
call plot (x1,y0,3)
call plot (x2,y0,2)
call plot (x3,y0,3)
call plot (x4,y0,2)
63 continue
! **************
! ** numbers. **
! **************
!
if(.not.lab_skip) then
call number (pl(i1)-0.5,ql(j1)-0.45,hhs,xmin,0.,101)
call number (pr(i1)-1.5,ql(j1)-0.45,hhs,xmax,0.,101)
!
call number (pl(i1)-2.0,ql(j1) ,hhs,ymin,0.,101)
call number (pl(i1)-2.0,qr(j1)-0.30,hhs,ymax,0.,101)
end if
!
! **************
! ** labels. **
! **************
xc= 0.5*(pl(i1)+pr(i1))
xu= xc -1.60
xd= xc -0.20*n2/2
!
yr= qr(j1)+0.15
yl= ql(j1)-0.70
!
call symbol (xu,yr,hh,lab1,0.,n1)
call symbol (xd,yl,hh,lab2,0.,n2)
!
xl= pl(i1)-1.50
yc= 0.5*(ql(j1)+qr(j1))
call symbol (xl,yc,hh,lab3,0.,n3)
! **********************************
! ** no plot is made if npt1 < 0 **
! **********************************
70 if(npt1.lt.0) return
!
call plotl (u(1),v(1),isc,3)
!**
if(iplot.eq.1) then
do 100 i=1,npt
call plotl (u(i),v(i),isc,2)
100 continue
else
do 120 i=1,npt-1
call plotl (u(i+1),v(i) ,isc,2)
call plotl (u(i+1),v(i+1),isc,2)
120 continue
end if
!**
call plotl (u(npt),v(npt),isc,3)
!
return
end
!
!
!-----------------------------------------------------------------------
subroutine scalex (xcm,ycm,x00,y00,dx,dy,isc)
!-----------------------------------------------------------------------
common/gscale/ x0(10),y0(10),xl(10),yl(10),dxi(10),dyi(10)
!
x0(isc)= x00
y0(isc)= y00
dxi(isc)= 1./dx
dyi(isc)= 1./dy
!
xl(isc)= xcm
yl(isc)= ycm
!
return
end
!
!
!-----------------------------------------------------------------------
subroutine plotl (x,y,isc,ipl)
!-----------------------------------------------------------------------
common/gscale/ x0(10),y0(10),xl(10),yl(10),dxi(10),dyi(10)
!
xcm= xl(isc) +dxi(isc)*(x -x0(isc))
ycm= yl(isc) +dyi(isc)*(y -y0(isc))
!
call plot (xcm,ycm,ipl)
!
return
end
!
!
!-----------------------------------------------------------------------
subroutine values (x,y,height,val,theta,ifmat)
!-----------------------------------------------------------------------
! << values >>
! 1. function
! (1) to draw variable
! 2. arguments (size) (i/o) (meaning)
! (1) x,y (i) absolute coordinate value
! (2) height (i) draw out size on paper
! (3) val (i) variable
! (4) theta (i) angle
! (5) ifmat (i) format type
! 3. called by
! (** nothing **)
! 4. calls
! (** number **)
! (** symbol **)
!-----------------------------------------------------------------------
!* ifmat = (n100)*100 + keta
!* n100 = 0 : integer format
!* n100 = 1 : f format :: number(x,y,height,val,theta,keta)
!* n100 = 2 : e format ::
!* n100 = 3 : power of ten format
!* n100 = othewise : not write out
!*-----------------------------------------------------------------------
!*
real*4 val
character chr13*13,chr12*12,chr3*3
character*1 minus,zero,blank
parameter(ratio = 6./7. )
data minus/'-'/,zero/'0'/,blank/' '/
!* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if (ifmat.lt.0) return
!* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
n100 = ifmat/100
keta = ifmat - n100*100
!*
if (n100.eq.0) then
call number(x,y,height,val,theta,ifmat)
! call number(x,y,height,val,theta,-1)
else if (n100.eq.1) then
call number(x,y,height,val,theta,ifmat)
! call number(x,y,height,val,theta,keta)
else if (n100.eq.2) then
chr13 = ' '
chr12 = ' '
if (keta.eq.0) then
write(chr13,'(1pe13.6)') val
chr12(1:4) = chr13(1:3)//'e'
numsym = 4
else
keta = keta + 1
if (val.lt.0.) then
chrval = val - 5.*10**float(-keta)
write(chr13,'(1pe13.6)') chrval
chr12(1:keta+3) = chr13(1:keta+2)//'e'
numsym = keta + 3
else if (val.eq.0) then
chrval = val
write(chr13,'(1pe13.6)') chrval
chr12(1:keta+3) = chr13(1:keta+2)//'e'
numsym = keta + 3
else
chrval = val + 5.*10**float(-keta)
write(chr13,'(1pe13.6)') chrval
chr12(1:keta+2) = chr13(2:keta+2)//'e'
numsym = keta + 2
end if
end if
chr3 = ' '
!*
if (chr13(11:11) .eq. minus) then
if (chr13(12:12) .eq. zero .or. &
chr13(12:12) .eq. blank) then
chr3(1:2) = '-'//chr13(13:13)
else
chr3(1:3) = '-'//chr13(12:13)
end if
numsy1 = 3
else
if (chr13(12:12) .eq. zero .or. &
chr13(12:12) .eq. blank) then
chr3(1:1) = chr13(13:13)
numsy1 = 1
else
chr3(1:2) = chr13(12:13)
numsy1 = 2
end if
end if
akaku = 2. * 3.1415927 / 360.
cost = cos(theta*akaku)
call symbol(x,y,height,chr12,theta,numsym)
call symbol(999.,999.,height,chr3,theta,numsy1)
else if (n100.eq.3) then
chr13 = ' '
chr12 = ' '
if (keta.eq.0) then
write(chr13,'(1pe13.6)') val
chr12(1:6) = chr13(1:3)//'x10'
numsym = 6
else
keta = keta + 1
if (val.lt.0.) then
chrval = val - 5.*10**float(-keta)
write(chr13,'(1pe13.6)') chrval
chr12(1:keta+5) = chr13(1:keta+2)//'x10'
numsym = keta + 5
else
chrval = val + 5.*10**float(-keta)
write(chr13,'(1pe13.6)') chrval
chr12(1:keta+4) = chr13(2:keta+2)//'x10'
numsym = keta + 4
end if
end if
chr3 = ' '
!*
if (chr13(11:11) .eq. minus) then
if (chr13(12:12) .eq. zero .or. &
chr13(12:12) .eq. blank) then
chr3(1:2) = '-'//chr13(13:13)
else
chr3(1:3) = '-'//chr13(12:13)
end if
numsy1 = 3
else
if (chr13(12:12) .eq. zero .or. &
chr13(12:12) .eq. blank) then
chr3(1:1) = chr13(13:13)
numsy1 = 1
else
chr3(1:2) = chr13(12:13)
numsy1 = 2
end if
end if
akaku = 2. * 3.1415927 / 360.
cost = cos(theta*akaku)
sint = sin(theta*akaku)
call symbol(x,y,height,chr12,theta,numsym)
!*
!* *******************
!* ** exponent part **