|
PG2PLplot
|
00001 00002 00003 !*********************************************************************************************************************************** 00005 00006 module PG2PLplot 00007 use plplot, only: plflt 00008 implicit none 00009 private plflt 00010 save 00011 00013 real(plflt), parameter :: ch_fac = 0.35_plflt 00014 00015 end module PG2PLplot 00016 !*********************************************************************************************************************************** 00017 00018 00019 !*********************************************************************************************************************************** 00023 00024 subroutine pgsls(ls) 00025 implicit none 00026 integer, intent(in) :: ls 00027 integer :: ls1,ls2, styles(5) 00028 00029 styles = (/1,4,5,2,6/) 00030 00031 ls1 = ls ! 1: solid, 2: dashes, 3: dash-dotted, 4: dotted, 5: dash-dot-dot-dot 00032 if (ls1.lt.1.or.ls1.gt.5) ls1 = 1 00033 00034 00035 ls2 = styles(ls1) ! 1: solid, 2: short dashes, 3: long dashes, 4: long dashes, short gaps, 5: long-short dashes, 00036 ! 6: long-short dashes, long-short gaps, 7: ?, 8: ? 00037 00038 call pllsty(ls2) 00039 00040 !print*,'pgsls: ',ls,ls1,ls2 00041 00042 end subroutine pgsls 00043 !*********************************************************************************************************************************** 00044 00045 !*********************************************************************************************************************************** 00049 00050 subroutine pgslw(lw) 00051 implicit none 00052 integer, intent(in) :: lw 00053 integer :: lw1,lw2 00054 00055 lw1 = max(min(lw,201),1) 00056 lw2 = lw1 - 1 00057 00058 call plwid(lw2) 00059 00060 !print*,'pgslw: ',lw,lw1,lw2 00061 00062 end subroutine pgslw 00063 !*********************************************************************************************************************************** 00064 00065 !*********************************************************************************************************************************** 00069 00070 subroutine pgqlw(lw) 00071 implicit none 00072 integer, intent(out) :: lw 00073 integer, save :: warn 00074 00075 if(warn.ne.123) write(0,'(/,A,/)') '*** PG2PLplot WARNING: no PLplot equivalent was found for the PGplot routine pgqlw() ***' 00076 warn = 123 00077 00078 lw = 1 00079 00080 end subroutine pgqlw 00081 !*********************************************************************************************************************************** 00082 00083 !*********************************************************************************************************************************** 00087 00088 subroutine pgscf(cf) 00089 implicit none 00090 integer, intent(in) :: cf 00091 00092 call plfont(cf) 00093 00094 end subroutine pgscf 00095 !*********************************************************************************************************************************** 00096 00097 !*********************************************************************************************************************************** 00101 00102 subroutine pgsci(ci1) 00103 implicit none 00104 integer, intent(in) :: ci1 00105 integer :: ci2,colours(0:15) 00106 00107 ci2 = 15 !White 00108 ci2 = ci1 00109 colours = (/0,15,1,3,9,7,13,2,8,12,4,11,10,5,7,7/) 00110 if(ci1.ge.0.and.ci1.le.15) ci2 = colours(ci1) 00111 00112 call plcol0(ci2) 00113 00114 !write(6,'(A,2I6)')' pgsci: ',ci1,ci2 00115 00116 end subroutine pgsci 00117 !*********************************************************************************************************************************** 00118 00119 !*********************************************************************************************************************************** 00126 00127 subroutine pgscr(ci1, r,g,b) 00128 implicit none 00129 integer, intent(in) :: ci1 00130 real, intent(in) :: r,g,b 00131 integer :: ci2,ri,gi,bi,colours(0:15) 00132 00133 ri = nint(r*255) 00134 gi = nint(g*255) 00135 bi = nint(b*255) 00136 00137 colours = (/0,15,1,3,9,7,13,2,8,12,4,11,10,5,7,7/) 00138 ci2 = ci1 00139 if(ci1.ge.0.and.ci1.le.15) ci2 = colours(ci1) 00140 if(ci2.gt.15) call plscmap0n(256) ! Allows indices 0-255 00141 00142 call plscol0(ci2, ri,gi,bi) 00143 00144 !write(6,'(A,2I6, 5x,3F10.3, 5x,3I6)')' pgscr: ',ci1,ci2, r,g,b, ri,gi,bi 00145 00146 end subroutine pgscr 00147 !*********************************************************************************************************************************** 00148 00149 !*********************************************************************************************************************************** 00156 00157 subroutine pgqcr(ci1,r,g,b) 00158 implicit none 00159 integer, intent(in) :: ci1 00160 real, intent(out) :: r,g,b 00161 integer :: ci2,ri,gi,bi,colours(0:15) 00162 00163 ci2 = ci1 00164 colours = (/0,15,1,3,9,7,13,2,8,12,4,11,10,5,7,7/) 00165 if(ci1.ge.0.and.ci1.le.15) ci2 = colours(ci1) 00166 00167 call plgcol0(ci2,ri,gi,bi) 00168 00169 r = real(ri)/255. 00170 g = real(gi)/255. 00171 b = real(bi)/255. 00172 00173 !write(6,'(A,2I6,5x,3I6,5x,3F10.3)')' pgqcr: ',ci1,ci2, ri,gi,bi, r,g,b 00174 00175 end subroutine pgqcr 00176 !*********************************************************************************************************************************** 00177 00178 !*********************************************************************************************************************************** 00183 00184 subroutine pgscir(ci1,ci2) 00185 implicit none 00186 integer, intent(in) :: ci1,ci2 00187 integer :: tmp 00188 integer, save :: warn 00189 00190 tmp = ci1 00191 tmp = ci2 00192 tmp = tmp ! Avoid 'variable is set but not used' warnings from compiler for dummy variable 00193 00194 if(warn.ne.123) write(0,'(/,A,/)') '*** PG2PLplot WARNING: no PLplot equivalent was found for the PGplot routine pgscir() ***' 00195 warn = 123 00196 00197 end subroutine pgscir 00198 !*********************************************************************************************************************************** 00199 00200 00201 !*********************************************************************************************************************************** 00206 00207 subroutine pgqcir(ci1,ci2) 00208 implicit none 00209 integer, intent(out) :: ci1,ci2 00210 integer, save :: warn 00211 00212 ci1 = 0 00213 ci2 = 255 00214 00215 if(warn.ne.123) write(0,'(/,A,/)') '*** PG2PLplot WARNING: no PLplot equivalent was found for the PGplot routine pgqcir() ***' 00216 warn = 123 00217 00218 end subroutine pgqcir 00219 !*********************************************************************************************************************************** 00220 00221 00222 00223 !*********************************************************************************************************************************** 00227 00228 subroutine pgsfs(fs) 00229 implicit none 00230 integer, intent(in) :: fs 00231 integer :: fs1,fs2, styles(4) 00232 00233 fs1 = fs 00234 if(fs.lt.1.or.fs.gt.4) fs1 = 1 00235 00236 ! fs1: 1: solid, 2: outline, 3-hatched, 4-cross-hatched 00237 ! fs2: 0: solid, 1: H lines, 2: V lines, 3: hatches 45d up, 4: hatches 45d down, 5: hatches 30d up, 6: hatches 30d down 00238 ! 7: upright cross-hatces, 8: 45d cross-hatces 00239 00240 styles = (/0,0,3,8/) 00241 00242 fs2 = styles(fs1) 00243 00244 call plpsty(fs2) 00245 00246 !print*,'pgsfs: ',fs1,fs2 00247 00248 end subroutine pgsfs 00249 !*********************************************************************************************************************************** 00250 00251 !*********************************************************************************************************************************** 00257 00258 subroutine pgshs(ang, sep, ph) 00259 implicit none 00260 real, intent(in) :: ang, sep, ph 00261 integer :: inc, del, tmp 00262 00263 inc = nint(ang*10.) ! Tenths of a degree 00264 del = nint(sep*1000) ! Spacing in micrometers(!) 00265 tmp = nint(ph) 00266 tmp = tmp ! Avoid 'variable is set but not used' warnings from compiler for dummy variable 00267 00268 call plpat(1, inc, del) 00269 00270 end subroutine pgshs 00271 !*********************************************************************************************************************************** 00272 00273 00274 !*********************************************************************************************************************************** 00278 00279 subroutine pgsch(ch) 00280 use plplot, only: plflt 00281 use PG2PLplot, only: ch_fac 00282 00283 implicit none 00284 real, intent(in) :: ch 00285 real(kind=plflt) :: ch1,ch2 00286 00287 ch1 = 0.0_plflt ! 0: don't change 00288 ch2 = ch * ch_fac 00289 00290 call plschr(ch1,ch2) 00291 00292 !print* 00293 !print*,'pgsch1: ',ch,ch1,ch2 00294 !call plgchr(ch1,ch2) 00295 !print*,'pgsch2: ',ch,ch1,ch2 00296 00297 end subroutine pgsch 00298 !*********************************************************************************************************************************** 00299 00300 00301 !*********************************************************************************************************************************** 00305 00306 subroutine pgqch(ch) 00307 use plplot, only: plflt 00308 use PG2PLplot, only: ch_fac 00309 00310 implicit none 00311 real, intent(out) :: ch 00312 real(kind=plflt) :: ch1,ch2 00313 00314 call plgchr(ch1,ch2) 00315 ch = real(ch2/(ch1*ch_fac)) 00316 00317 !print*,'pgqch: ',ch,ch1,ch2 00318 00319 end subroutine pgqch 00320 !*********************************************************************************************************************************** 00321 00322 00323 !*********************************************************************************************************************************** 00325 00326 subroutine pgsah(fs, angle, barb) 00327 implicit none 00328 integer, intent(in) :: fs 00329 real, intent(in) :: angle, barb 00330 integer :: tmp 00331 integer, save :: warn 00332 00333 tmp = fs 00334 tmp = nint(angle) 00335 tmp = nint(barb) 00336 tmp = tmp ! Avoid 'variable is set but not used' warnings from compiler for dummy variable 00337 00338 if(warn.ne.123) write(0,'(/,A,/)') '*** PG2PLplot WARNING: no PLplot equivalent was found for the PGplot routine pgsah() ***' 00339 warn = 123 00340 00341 end subroutine pgsah 00342 !*********************************************************************************************************************************** 00343 00344 00345 00346 00347 00348 00349 00350 !*********************************************************************************************************************************** 00356 00357 subroutine pgline(n,x1,y1) 00358 use plplot, only: plflt, plline 00359 00360 implicit none 00361 integer, intent(in) :: n 00362 real, intent(in) :: x1(n),y1(n) 00363 real(kind=plflt) :: x2(n),y2(n) 00364 00365 x2 = x1 00366 y2 = y1 00367 00368 call plline(x2,y2) 00369 00370 !write(6,'(A,99ES16.9)')' pgline1: ',x1(1:min(n,9)),y1(1:min(n,9)) 00371 !write(6,'(A,99ES16.9)')' pgline2: ',x2(1:min(n,9)),y2(1:min(n,9)) 00372 00373 end subroutine pgline 00374 !*********************************************************************************************************************************** 00375 00376 !*********************************************************************************************************************************** 00383 00384 subroutine pgarro(x1,y1, x2,y2) 00385 use plplot, only: plflt, plline, plpoin 00386 00387 implicit none 00388 real, intent(in) :: x1,x2, y1,y2 00389 real(kind=plflt) :: x(2),y(2) 00390 00391 x = (/x1,x2/) 00392 y = (/y1,y2/) 00393 00394 call plline(x,y) 00395 call plpoin((/x(2)/),(/y(2)/),2) 00396 00397 !print*,'pgarro: ',x1,x2,y1,y2,' ',x,y 00398 00399 end subroutine pgarro 00400 !*********************************************************************************************************************************** 00401 00402 00403 00404 !*********************************************************************************************************************************** 00411 00412 subroutine pgpoint(n,x1,y1,s) 00413 use plplot, only: plflt, plpoin 00414 00415 implicit none 00416 integer, intent(in) :: n,s 00417 real, intent(in) :: x1(n),y1(n) 00418 real(kind=plflt) :: x2(n),y2(n) 00419 00420 x2 = x1 00421 y2 = y1 00422 00423 call plpoin(x2,y2,s) 00424 !call plsym(x2,y2,s) ! Produces Hershey -> many letters, etc 00425 00426 end subroutine pgpoint 00427 !*********************************************************************************************************************************** 00428 00429 !*********************************************************************************************************************************** 00435 00436 subroutine pgpoly(n,x1,y1) 00437 use plplot, only: plflt, plfill 00438 00439 implicit none 00440 integer, intent(in) :: n 00441 real, intent(in) :: x1(n),y1(n) 00442 real(kind=plflt) :: x2(n),y2(n) 00443 00444 x2 = x1 00445 y2 = y1 00446 00447 call plfill(x2,y2) 00448 00449 !print*,'pgpoly: ',n,x1(1),x1(n),y1(1),y1(n) 00450 00451 end subroutine pgpoly 00452 !*********************************************************************************************************************************** 00453 00454 !*********************************************************************************************************************************** 00461 00462 subroutine pgrect(x1,x2,y1,y2) 00463 use plplot, only: plflt, plfill 00464 00465 implicit none 00466 real, intent(in) :: x1,x2,y1,y2 00467 real(kind=plflt) :: x(4),y(4) 00468 00469 x = (/x1,x1,x2,x2/) 00470 y = (/y1,y2,y2,y1/) 00471 00472 call plfill(x,y) 00473 00474 end subroutine pgrect 00475 !*********************************************************************************************************************************** 00476 00477 00478 !*********************************************************************************************************************************** 00484 00485 subroutine pgcirc(xc, yc, r) 00486 use plplot, only: plflt, plfill 00487 00488 implicit none 00489 real, intent(in) :: xc, yc, r 00490 00491 integer, parameter :: n=100 00492 integer :: i 00493 real(kind=plflt) :: x(n),y(n),twopi 00494 00495 twopi = 8.*atan(1.) 00496 00497 do i=1,n 00498 x(i) = xc + r * cos(twopi/real(n-1)) 00499 y(i) = yc + r * sin(twopi/real(n-1)) 00500 end do 00501 00502 call plfill(x,y) 00503 00504 end subroutine pgcirc 00505 !*********************************************************************************************************************************** 00506 00507 00508 00509 00510 !*********************************************************************************************************************************** 00523 00524 subroutine pgcont(arr, nx,ny, ix1,ix2, iy1,iy2, c, nc, tr) 00525 use plplot, only: plflt, plcont 00526 00527 implicit none 00528 integer, intent(in) :: nx,ny, ix1,ix2, iy1,iy2, nc 00529 real, intent(in) :: arr(nx,ny), c(*), tr(6) 00530 real(kind=plflt) :: arr1(nx,ny), clevel(nc), tr1(6) 00531 00532 arr1 = arr 00533 clevel = c(1:nc) 00534 tr1 = tr 00535 00536 call plcont(arr1, ix1,ix2, iy1,iy2, clevel, tr1) 00537 00538 end subroutine pgcont 00539 !*********************************************************************************************************************************** 00540 00541 00542 !*********************************************************************************************************************************** 00555 00556 subroutine pgconf(arr, nx,ny, ix1,ix2, iy1,iy2, c1, c2, tr) 00557 use plplot, only: plflt 00558 00559 implicit none 00560 integer, intent(in) :: nx,ny, ix1,ix2, iy1,iy2 00561 real, intent(in) :: arr(nx,ny), c1,c2, tr(6) 00562 !real(kind=plflt) :: arr1(nx,ny), clevel(nc), tr1(6) 00563 integer :: tmp 00564 integer, save :: warn 00565 00566 tmp = nint(arr(1,1)) 00567 tmp = nx 00568 tmp = ny 00569 tmp = ix1 00570 tmp = ix2 00571 tmp = iy1 00572 tmp = iy2 00573 tmp = nint(c1) 00574 tmp = nint(c2) 00575 tmp = nint(tr(1)) 00576 tmp = tmp ! Avoid 'variable is set but not used' warnings from compiler for dummy variable 00577 00578 00579 !arr1 = arr 00580 !clevel = c(1:nc) 00581 !tr1 = tr 00582 ! 00583 !call plshade1(arr1, ix1,ix2, iy1,iy2, clevel, tr1) 00584 00585 if(warn.ne.123) write(0,'(/,A,/)') '*** PG2PLplot WARNING: no PLplot equivalent was found for the PGplot routine pgconf() ***' 00586 warn = 123 00587 00588 end subroutine pgconf 00589 !*********************************************************************************************************************************** 00590 00591 00592 00593 00594 00595 00596 00597 00598 00599 00600 00601 00602 00603 !*********************************************************************************************************************************** 00613 00614 subroutine pgptxt(x1,y1,ang,just1,text) 00615 use plplot, only: plflt, plptex 00616 00617 implicit none 00618 real, intent(in) :: x1,y1,ang,just1 00619 character, intent(in) :: text*(*) 00620 real :: d2r 00621 real(kind=plflt) :: x2,y2,just2,dx,dy,xmin,xmax,ymin,ymax 00622 character :: text1*(len(text)) 00623 00624 d2r = atan(1.)/45. 00625 call plgvpw(xmin,xmax,ymin,ymax) 00626 00627 ! Convert angle -> dy/dx 00628 dx = (xmax-xmin)*0.1 00629 00630 !if(abs(ang).lt.1.e-5) then ! ang ~ 0 deg 00631 ! dx = -1.0 00632 ! dy = 0.0 00633 !else 00634 if(abs(mod(ang-90.,180.)).lt.1.e-5) then ! ang = +/-90deg 00635 dx = 0. 00636 dy = -1. ! ang = -90deg 00637 if(abs(mod(ang-90.,360.)).lt.1.e-5) dy = 1. ! ang = +90deg 00638 else 00639 !dy = dx*tan(ang*d2r) * (ymax-ymin) !/(xmax-xmin) 00640 dx = 1.0 00641 dy = dx*tan(ang*d2r) * (ymax-ymin)/(xmax-xmin) 00642 if(ang.gt.90. .and. ang.lt.270. .or. ang.lt.-90. .and. ang.gt.-270.) then 00643 dx = -dx 00644 dy = -dy 00645 end if 00646 end if 00647 00648 x2 = x1 00649 y2 = y1 00650 just2 = just1 00651 00652 text1 = text 00653 call pg2pltext(text1) 00654 00655 call plptex(x2,y2,dx,dy,just2,trim(text1)) 00656 00657 !write(6,'(A,4F10.3,A)')' pgptxt: ',x1,y1,ang,just1,trim(text) 00658 !write(6,'(A,5F10.3,A)')' pgptxt: ',x2,y2,dx,dy,just2,trim(text1) 00659 00660 end subroutine pgptxt 00661 !*********************************************************************************************************************************** 00662 00663 !*********************************************************************************************************************************** 00673 00674 subroutine pgptext(x,y,ang,just,text) 00675 implicit none 00676 real, intent(in) :: x,y,ang,just 00677 character, intent(in) :: text*(*) 00678 00679 call pgptxt(x,y,ang,just,text) 00680 00681 end subroutine pgptext 00682 !*********************************************************************************************************************************** 00683 00684 00685 !*********************************************************************************************************************************** 00691 00692 subroutine pgtext(x1,y1,text) 00693 use plplot, only: plflt, plptex 00694 00695 implicit none 00696 real, intent(in) :: x1,y1 00697 character, intent(in) :: text*(*) 00698 real(kind=plflt) :: x2,y2,just,dx,dy 00699 character :: text1*(len(text)) 00700 00701 !Convert angle=0deg -> dy/dx 00702 dx = 1. 00703 dy = 0. 00704 just = 0. !Left-adjusted 00705 00706 x2 = x1 00707 y2 = y1 00708 00709 text1 = text 00710 call pg2pltext(text1) 00711 call plptex(x2,y2,dx,dy,just,text1) 00712 00713 end subroutine pgtext 00714 !*********************************************************************************************************************************** 00715 00716 00717 !*********************************************************************************************************************************** 00725 00726 subroutine pgmtxt(side, disp1, pos1, just1, text) 00727 use plplot, only: plflt, plmtex 00728 00729 implicit none 00730 real, intent(in) :: disp1,pos1,just1 00731 real(kind=plflt) :: disp2,pos2,just2 00732 character, intent(in) :: side*(*) 00733 character, intent(in) :: text*(*) 00734 character :: text1*(len(text)) 00735 00736 disp2 = disp1 00737 pos2 = pos1 00738 just2 = just1 00739 00740 !write(6,'(2A,2(3F10.3,5x),A)')' pgmtxt: ',trim(side),disp1,pos1,just1,disp2,pos2,just2,trim(text) 00741 00742 text1 = text 00743 call pg2pltext(text1) 00744 call plmtex(side, disp2, pos2, just2, text1) 00745 00746 end subroutine pgmtxt 00747 !*********************************************************************************************************************************** 00748 00749 !*********************************************************************************************************************************** 00757 00758 subroutine pgmtext(side, disp, pos, just, text) 00759 implicit none 00760 real, intent(in) :: disp,pos,just 00761 character, intent(in) :: side*(*) 00762 character, intent(in) :: text*(*) 00763 character :: text1*(len(text)) 00764 00765 text1 = text 00766 call pg2pltext(text1) 00767 call pgmtxt(side, disp, pos, just, text1) 00768 00769 end subroutine pgmtext 00770 !*********************************************************************************************************************************** 00771 00772 00773 00774 00775 00776 !*********************************************************************************************************************************** 00782 00783 function pgopen(pgdev) 00784 use plplot, only: plflt, plspause, plstart, plsfnam 00785 00786 implicit none 00787 integer :: pgopen 00788 character, intent(in) :: pgdev*(*) 00789 !character :: pgdev1*(len_trim(pgdev)) 00790 character :: pldev*(99),filename*(99) 00791 00792 !pgdev1 = pgdev 00793 ! 00794 !!pldev = 'xwin' 00795 !!pldev = 'wxwidgets' 00796 !!pldev = 'xcairo' 00797 !!pldev = 'qtwidget' 00798 ! 00799 !pldev = 'png' !No anti-aliasing in lines 00800 !!pldev = 'wxpng' !No extended characters 00801 !!pldev = 'pngcairo' 00802 !!pldev = 'pngqt' 00803 ! 00804 !filename = 'plot_temp.png' 00805 00806 00807 call pg2pldev(pgdev, pldev,filename) 00808 00809 !write(0,'(A)')'pgopen: '//trim(pgdev)//' - '//trim(pldev)//' - '//trim(filename) 00810 00811 !call plsdev(trim(pldev)) 00812 !call plinit() 00813 00814 if(trim(pldev).ne.'xwin') call plsfnam(trim(filename)) ! Set output file name 00815 call plfontld(1) ! Load extended character set(?) 00816 call plspause(.true.) ! Pause at plend() 00817 !call plscolbg(255,255,255) ! Set background colour to white 00818 00819 call plstart(trim(pldev),1,1) ! Initialise plplot with pldev with 1x1 subpages 00820 call pladv(0) ! Advance to first (sub)page 00821 00822 pgopen = 1 00823 00824 end function pgopen 00825 !*********************************************************************************************************************************** 00826 00827 00828 !*********************************************************************************************************************************** 00835 00836 subroutine pgbegin(i,pgdev,nx,ny) 00837 use plplot, only: plflt, plspause, plstart, plsfnam 00838 00839 implicit none 00840 integer, intent(in) :: i,nx,ny 00841 character, intent(in) :: pgdev*(*) 00842 integer :: i1 00843 character :: pldev*(99),filename*(99) 00844 00845 i1=i !Is ignored by pgbegin, can't be self, since calling argument is likely a constant 00846 i1 = i1 00847 00848 !Need to convert pgdev -> pldev + filename as in pgbegin() 00849 !pldev = trim(pgdev) 00850 !!pldev = 'xwin' 00851 ! 00852 !!pldev = 'xwin' 00853 !!pldev = 'wxwidgets' 00854 !!pldev = 'xcairo' 00855 !!pldev = 'qtwidget' 00856 ! 00857 !pldev = 'png' ! No anti-aliasing in lines 00858 !!pldev = 'wxpng' ! No extended characters 00859 !!pldev = 'pngcairo' 00860 !!pldev = 'pngqt' 00861 00862 filename = 'plot_temp.png' 00863 00864 00865 00866 call pg2pldev(pgdev, pldev,filename) 00867 00868 !write(0,'(A)')'pgbegin: '//trim(pgdev)//' - '//trim(pldev)//' - '//trim(filename) 00869 00870 call plsfnam(trim(filename)) ! Set output file name 00871 call plfontld(1) ! Load extended character set(?) 00872 call plspause(.true.) ! Pause at pgend() 00873 !call plscolbg(255,255,255) ! Set background colour to white 00874 00875 call plstart(trim(pldev),nx,ny) 00876 call pladv(0) 00877 call plspause(.false.) 00878 00879 end subroutine pgbegin 00880 !*********************************************************************************************************************************** 00881 00882 00883 !*********************************************************************************************************************************** 00885 00886 subroutine pgend() 00887 implicit none 00888 00889 call plend() 00890 00891 end subroutine pgend 00892 !*********************************************************************************************************************************** 00893 00894 00895 !*********************************************************************************************************************************** 00900 00901 subroutine pgpap(width,ratio) 00902 use plplot, only: plflt 00903 00904 implicit none 00905 real, intent(in) :: width,ratio 00906 integer :: xlen,ylen,xoff,yoff 00907 real(kind=plflt) :: xp,yp 00908 00909 xp = 300. !DPI 00910 yp = 300. 00911 xlen = nint(width*xp) 00912 ylen = nint(width*xp*ratio) 00913 xoff = 0 !Offset 00914 yoff = 0 00915 00916 call plspage(xp,yp,xlen,ylen,xoff,yoff) ! Must be called before plinit()! 00917 00918 end subroutine pgpap 00919 !*********************************************************************************************************************************** 00920 00921 00922 !*********************************************************************************************************************************** 00929 00930 00931 subroutine pgsvp(xl1,xr1,yb1,yt1) 00932 use plplot, only: plflt 00933 00934 implicit none 00935 real, intent(in) :: xl1,xr1,yb1,yt1 00936 real(kind=plflt) :: xl2,xr2,yb2,yt2 00937 00938 xl2 = xl1 00939 xr2 = xr1 00940 yb2 = yb1 00941 yt2 = yt1 00942 !write(6,'(A,2(4F10.3,5x))')' pgsvp: ',xl1,xr1,yb1,yt1,xl2,xr2,yb2,yt2 00943 00944 call plvpor(xl2,xr2,yb2,yt2) 00945 00946 end subroutine pgsvp 00947 !*********************************************************************************************************************************** 00948 00949 00950 !*********************************************************************************************************************************** 00957 00958 subroutine pgswin(xmin1,xmax1,ymin1,ymax1) 00959 use plplot, only: plflt 00960 00961 implicit none 00962 real, intent(in) :: xmin1,xmax1,ymin1,ymax1 00963 real(kind=plflt) :: xmin2,xmax2,ymin2,ymax2 00964 00965 xmin2 = xmin1 00966 xmax2 = xmax1 00967 ymin2 = ymin1 00968 ymax2 = ymax1 00969 !write(6,'(A,2(4F10.3,5x))')' pgswin: ',xmin1,xmax1,ymin1,ymax1,xmin2,xmax2,ymin2,ymax2 00970 00971 call plwind(xmin2,xmax2,ymin2,ymax2) 00972 00973 end subroutine pgswin 00974 !*********************************************************************************************************************************** 00975 00976 00977 !*********************************************************************************************************************************** 00982 00983 subroutine pgsubp(nxsub, nysub) 00984 implicit none 00985 integer, intent(in) :: nxsub,nysub 00986 00987 call plssub(nxsub, nysub) 00988 00989 end subroutine pgsubp 00990 !*********************************************************************************************************************************** 00991 00992 00993 !*********************************************************************************************************************************** 00995 00996 subroutine pgpage() 00997 implicit none 00998 00999 call pladv(0) 01000 01001 end subroutine pgpage 01002 !*********************************************************************************************************************************** 01003 01004 !*********************************************************************************************************************************** 01006 01007 subroutine pgbbuf() 01008 implicit none 01009 01010 end subroutine pgbbuf 01011 !*********************************************************************************************************************************** 01012 01013 !*********************************************************************************************************************************** 01015 01016 subroutine pgebuf() 01017 implicit none 01018 01019 end subroutine pgebuf 01020 !*********************************************************************************************************************************** 01021 01022 01023 01024 01025 !*********************************************************************************************************************************** 01034 01035 subroutine pgbox(xopt, xtick1, nxsub, yopt, ytick1, nysub) 01036 use plplot, only: plflt, plbox 01037 01038 implicit none 01039 integer, intent(in) :: nxsub,nysub 01040 real, intent(in) :: xtick1,ytick1 01041 character, intent(in) :: xopt*(*),yopt*(*) 01042 real(kind=plflt) :: xtick2,ytick2 01043 01044 xtick2 = xtick1 01045 ytick2 = ytick1 01046 !write(6,'(A,2(2F10.3,5x))')' pgbox: ',xtick1,ytick1,xtick2,ytick2 01047 01048 call plbox(xopt, xtick2, nxsub, yopt, ytick2, nysub) 01049 01050 end subroutine pgbox 01051 !*********************************************************************************************************************************** 01052 01053 01054 01055 !*********************************************************************************************************************************** 01068 01069 subroutine pgtick(x1, y1, x2, y2, v, tikl, tikr, disp, orient, str) 01070 use plplot, only: plflt 01071 01072 implicit none 01073 real, intent(in) :: x1, y1, x2, y2, v, tikl, tikr, disp, orient 01074 character, intent(in) :: str*(*) 01075 01076 integer, save :: warn 01077 real :: x 01078 character :: str1*(len(str)) 01079 01080 x = x1 01081 x = x2 01082 x = y1 01083 x = y2 01084 x = v 01085 x = tikl 01086 x = tikr 01087 x = disp 01088 x = orient 01089 x = x ! Avoid 'variable is set but not used' warnings from compiler for dummy variable 01090 str1 = str 01091 str1 = str1 ! Avoid 'variable is set but not used' warnings from compiler for dummy variable 01092 01093 if(warn.ne.123) write(0,'(/,A,/)') '*** PG2PLplot WARNING: no PLplot equivalent was found for the PGplot routine pgtick() ***' 01094 warn = 123 01095 01096 end subroutine pgtick 01097 !*********************************************************************************************************************************** 01098 01099 01100 01101 !*********************************************************************************************************************************** 01105 01106 subroutine pgolin(maxpt, npt, x, y, symbol) 01107 use plplot, only: plflt 01108 01109 implicit none 01110 integer, intent(in) :: maxpt,symbol 01111 integer, intent(out) :: npt 01112 real, intent(out) :: x(maxpt),y(maxpt) 01113 01114 integer :: symbol1 01115 integer, save :: warn 01116 01117 npt = maxpt 01118 x = 0.d0 01119 y = 0.d0 01120 symbol1 = symbol 01121 symbol1 = symbol1 ! Avoid 'variable is set but not used' warnings from compiler for dummy variable 01122 01123 if(warn.ne.123) write(0,'(/,A,/)') '*** PG2PLplot WARNING: no PLplot equivalent was found for the PGplot routine pgolin() ***' 01124 warn = 123 01125 01126 end subroutine pgolin 01127 !*********************************************************************************************************************************** 01128 01129 01130 !*********************************************************************************************************************************** 01134 01135 subroutine pg2pltext(string) 01136 implicit none 01137 character, intent(inout) :: string*(*) 01138 01139 !print*,trim(string) 01140 01141 call replace_substring(string, '\', '#') ! Replace the PGPlot escape character \ with the PLplot escape character # ' 01142 call replace_substring(string, '#(0248)', '#(2246)') ! \approx -> \sim 01143 call replace_substring(string, '#(062', '#(212') ! alpha - gamma 01144 call replace_substring(string, '#(063', '#(213') ! delta - nu 01145 call replace_substring(string, '#(064', '#(214') ! xi - psi 01146 call replace_substring(string, '#(0650', '#(2150') ! omega 01147 call replace_substring(string, '#(0685)', '#(2185)') ! (var)theta 01148 01149 !print*,trim(string) 01150 01151 end subroutine pg2pltext 01152 !*********************************************************************************************************************************** 01153 01154 !*********************************************************************************************************************************** 01160 01161 subroutine pg2pldev(pgdev, pldev,filename) 01162 implicit none 01163 character, intent(in) :: pgdev*(*) 01164 character, intent(out) :: pldev*(*), filename*(*) 01165 integer :: i 01166 01167 01168 i = index(pgdev, '/', back=.true.) 01169 01170 filename = ' ' 01171 if(i.ne.1) filename = pgdev(1:i-1) 01172 01173 pldev = ' ' 01174 pldev = pgdev(i+1:) 01175 01176 ! Change PGplot ppm output tot png: 01177 call replace_substring(pldev,'ppm','png') 01178 call replace_substring(filename,'ppm','png') 01179 01180 !write(0,'(A)')trim(pgdev)//' - '//trim(pldev)//' - '//trim(filename) 01181 01182 !stop 01183 01184 end subroutine pg2pldev 01185 !*********************************************************************************************************************************** 01186 01187 01188 !*********************************************************************************************************************************** 01194 01195 subroutine replace_substring(string, str_in, str_out) 01196 character, intent(inout) :: string*(*) 01197 character, intent(in) :: str_in*(*),str_out*(*) 01198 integer :: is,l 01199 01200 l = len_trim(str_in) 01201 is = huge(is) 01202 do 01203 is = index(string, str_in, back=.false.) 01204 if(is.le.0) exit 01205 string = string(1:is-1)//trim(str_out)//trim(string(is+l:)) 01206 end do 01207 01208 end subroutine replace_substring 01209 !***********************************************************************************************************************************
1.7.3