1
!***********************************************************************
2
! $Id: sfstubsf95.f90,v 1.6 2006/05/19 17:15:15 airwin Exp $
5
! Copyright (C) 2005, 2006 Arjen Markus
6
! Copyright (C) 2006 Alan W. Irwin
8
! This file is part of PLplot.
10
! PLplot is free software; you can redistribute it and/or modify
11
! it under the terms of the GNU General Library Public License as published
12
! by the Free Software Foundation; either version 2 of the License, or
13
! (at your option) any later version.
15
! PLplot is distributed in the hope that it will be useful,
16
! but WITHOUT ANY WARRANTY; without even the implied warranty of
17
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
! GNU Library General Public License for more details.
20
! You should have received a copy of the GNU Library General Public License
21
! along with PLplot; if not, write to the Free Software
22
! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25
! This file contains the interfaces for Fortran 95:
26
! - it includes the actual FORTRAN routines from the FORTRAN 77 bindings
27
! - it includes interfaces to the C routines from these bindings
28
! - it defines a few Fortran 95 specific items and interfaces
31
! This module is written in fixed form, because that way we can reuse
32
! the FORTRAN 77 bindings (including the original file is not possible:
33
! the "end" statement has to be replaced by the "end subroutine"
35
! To enable a redefinition of certain interfaces, we actually have
39
! The INTENT attribute is not currently used. This is a matter to
43
! It is assumed in the current implementation that all arrays are
44
! passed with correct dimensions. It would be wiser, perhaps, to
45
! use the minimum dimension instead of just the dimension of the
49
! Some of the C routines will have to be renamed (via macros)
51
!***********************************************************************
54
! Parameters for identifying the kind of PLplot's real
55
! numbers (a configuration parameter)
56
! Use whatever name suits you better.
67
module procedure plcontour_0
68
module procedure plcontour_1
69
module procedure plcontour_2
70
module procedure plcontour_tr
71
module procedure plcontour_0_all
72
module procedure plcontour_1_all
73
module procedure plcontour_2_all
74
module procedure plcontour_tr_all
76
private :: plcontour_0, plcontour_1, plcontour_2, plcontour_tr
77
private :: plcontour_0_all, plcontour_1_all, plcontour_2_all, plcontour_tr_all
80
module procedure plvectors_0
81
module procedure plvectors_1
82
module procedure plvectors_2
83
module procedure plvectors_tr
85
private :: plvectors_0, plvectors_1, plvectors_2, plvectors_tr
88
module procedure plshade_single_0
89
module procedure plshade_single_1
90
module procedure plshade_single_2
91
module procedure plshade_single_tr
93
private :: plshade_single_0, plshade_single_1, plshade_single_2, plshade_single_tr
96
module procedure plshades_multiple_0
97
module procedure plshades_multiple_1
98
module procedure plshades_multiple_2
99
module procedure plshades_multiple_tr
101
private :: plshades_multiple_0, plshades_multiple_1, &
102
plshades_multiple_2, plshades_multiple_tr
104
include 'sfstubs.f90'
111
! To be added: renaming list
117
! Parameters connecting a mnemonic name to the
118
! constants used by various routines
120
integer, parameter :: PL_PARSE_FULL = 1
122
integer, parameter :: PL_GRID_CSA = 1
123
integer, parameter :: PL_GRID_DTLI = 2
124
integer, parameter :: PL_GRID_NNI = 3
125
integer, parameter :: PL_GRID_NNIDW = 4
126
integer, parameter :: PL_GRID_NNLI = 5
127
integer, parameter :: PL_GRID_NNAIDW = 6
129
integer, parameter :: PL_JUST_NONE = -1
130
integer, parameter :: PL_JUST_OPTIMAL = 0
131
integer, parameter :: PL_JUST_SAME = 1
132
integer, parameter :: PL_JUST_ISOMETRIC = 2
134
integer, parameter :: PL_AXIS_NOTHING = -2
135
integer, parameter :: PL_AXIS_BOX_ONLY = -1
136
integer, parameter :: PL_AXIS_NORMAL = 0
137
integer, parameter :: PL_AXIS_ATZERO = 1
138
integer, parameter :: PL_AXIS_MAJORGRID = 2
139
integer, parameter :: PL_AXIS_MINORGRID = 3
140
integer, parameter :: PL_AXIS_LOGX = 10
141
integer, parameter :: PL_AXIS_LOGY = 20
142
integer, parameter :: PL_AXIS_LOGXY = 30
144
integer, parameter :: PL_FONT_STANDARD = 0
145
integer, parameter :: PL_FONT_EXTENDED = 1
149
! Parameters for fill patterns and symbols
152
real(kind=plflt), parameter :: PL_PI = 3.1415926535897932384_plflt
155
! To be added: alternative interfaces
158
subroutine pladv( sub )
164
module procedure plbin
173
subroutine plcalc_world( rx, ry, wx, wy, window )
175
real(kind=plflt) :: rx, ry, wx, wy
177
end subroutine plcalc_world
182
end subroutine plclear
186
subroutine plcol0( icol )
188
end subroutine plcol0
192
subroutine plcol( icol )
198
subroutine plcol1( col )
200
real(kind=plflt) :: col
201
end subroutine plcol1
205
module procedure plcpstrm
215
end subroutine plend1
219
subroutine plenv( xmin, xmax, ymin, ymax, just, axis )
221
real(kind=plflt) :: xmin, xmax, ymin, ymax
222
integer :: just, axis
232
module procedure plerrx
236
module procedure plerry
241
end subroutine plfamadv
245
module procedure plfill
249
module procedure plfill3
254
end subroutine plflush
258
subroutine plfont( font )
260
end subroutine plfont
264
subroutine plfontld( charset )
266
end subroutine plfontld
270
subroutine plgchr( chrdef, chrht )
272
real(kind=plflt) :: chrdef, chrht
273
end subroutine plgchr
277
subroutine plgcol0( icol, r, g, b )
278
integer :: icol, r, g, b
279
end subroutine plgcol0
283
subroutine plgcolbg( r, g, b )
285
end subroutine plgcolbg
289
subroutine plgcompression( compression )
290
integer :: compression
291
end subroutine plgcompression
295
subroutine plgdidev( mar, aspect, jx, jy )
297
real(kind=plflt) :: mar, aspect, jx, jy
298
end subroutine plgdidev
302
subroutine plgdiori( rot )
304
real(kind=plflt) :: rot
305
end subroutine plgdiori
309
subroutine plgdiplt( xmin, xmax, ymin, ymax )
311
real(kind=plflt) :: xmin, xmax, ymin, ymax
312
end subroutine plgdiplt
316
subroutine plgfam( fam, num, bmax )
317
integer :: fam, num, bmax
318
end subroutine plgfam
322
subroutine plglevel( level )
324
end subroutine plglevel
328
subroutine plgpage( xpmm, ypmm, xwid, ywid, xoff, yoff )
330
real(kind=plflt) :: xpmm, ypmm
331
integer :: xwid, ywid, xoff, yoff
332
end subroutine plgpage
341
module procedure plgriddata
345
subroutine plgspa( xmin, xmax, ymin, ymax )
347
real(kind=plflt) :: xmin, xmax, ymin, ymax
348
end subroutine plgspa
352
subroutine plgstrm( strm )
354
end subroutine plgstrm
358
subroutine plgvpd( xmin, xmax, ymin, ymax )
360
real(kind=plflt) :: xmin, xmax, ymin, ymax
361
end subroutine plgvpd
365
subroutine plgvpw( xmin, xmax, ymin, ymax )
367
real(kind=plflt) :: xmin, xmax, ymin, ymax
368
end subroutine plgvpw
372
subroutine plgxax( digmax, digits )
373
integer :: digmax, digits
374
end subroutine plgxax
378
subroutine plgyax( digmax, digits )
379
integer :: digmax, digits
380
end subroutine plgyax
384
subroutine plgzax( digmax, digits )
385
integer :: digmax, digits
386
end subroutine plgzax
390
module procedure plhist
394
subroutine plhls( h, l, s )
396
real(kind=plflt) :: h, l, s
401
subroutine plhlsrgb( h, l, s, r, g, b )
403
real(kind=plflt) :: h, l, s, r, g, b
404
end subroutine plhlsrgb
409
end subroutine plinit
413
subroutine pljoin( x1, y1, x2, y2 )
415
real(kind=plflt) :: x1, y1, x2, y2
416
end subroutine pljoin
420
subroutine pllightsource( x, y, z )
422
real(kind=plflt) :: x, y, z
423
end subroutine pllightsource
427
module procedure plline
431
module procedure plline3
435
subroutine pllsty( lin )
437
end subroutine pllsty
441
module procedure plmesh
445
module procedure plmeshc
449
subroutine plmkstrm( strm )
451
end subroutine plmkstrm
455
subroutine plpat( nlin, inc, del )
456
integer :: nlin, inc, del
461
module procedure plot3d
465
module procedure plot3dc
469
module procedure plpoin
473
module procedure plpoin3
477
module procedure plpoly3
481
subroutine plprec( setp, prec )
482
integer :: setp, prec
483
end subroutine plprec
487
subroutine plpsty( patt )
489
end subroutine plpsty
494
end subroutine plreplot
498
! Note: plrgb and plrgb1 can be merged
501
subroutine plrgb( r, g, b )
503
real(kind=plflt) :: r, g, b
508
subroutine plrgb1( r, g, b )
510
end subroutine plrgb1
514
subroutine plrgbhls( r, g, b, h, l, s )
516
real(kind=plflt) :: r, g, b, h, l, s
517
end subroutine plrgbhls
521
subroutine plschr( chrdef, chrht )
523
real(kind=plflt) :: chrdef, chrht
524
end subroutine plschr
528
module procedure plscmap0
532
subroutine plscmap0n( n )
534
end subroutine plscmap0n
538
module procedure plscmap1
542
module procedure plscmap1l
546
subroutine plscmap1n( n )
548
end subroutine plscmap1n
552
subroutine plscol0( icol, r, g, b )
553
integer :: icol, r, g, b
554
end subroutine plscol0
558
subroutine plscolbg( r, g, b )
560
end subroutine plscolbg
564
subroutine plscolor( color )
566
end subroutine plscolor
570
subroutine plscompression( compression )
571
integer :: compression
572
end subroutine plscompression
576
subroutine plsdidev( mar, aspect, jx, jy )
578
real(kind=plflt) :: mar, aspect, jx, jy
579
end subroutine plsdidev
583
subroutine plsdimap( dimxmi, dimxmax, diymin, dimymax, dimxpmm, diypmm )
585
real(kind=plflt) :: dimxmi, dimxmax, diymin, dimymax, dimxpmm, diypmm
586
end subroutine plsdimap
590
subroutine plsdiori( rot )
592
real(kind=plflt) :: rot
593
end subroutine plsdiori
597
subroutine plsdiplt( xmin, xmax, ymin, ymax )
599
real(kind=plflt) :: xmin, xmax, ymin, ymax
600
end subroutine plsdiplt
604
subroutine plsdiplz( xmin, xmax, ymin, ymax )
606
real(kind=plflt) :: xmin, xmax, ymin, ymax
607
end subroutine plsdiplz
610
! TODO: character-version
612
subroutine plsesc( esc )
614
end subroutine plsesc
618
! TODO: F95-specific form for these routines
620
interface plsetmapformc
621
subroutine plsetmapformc( mapform )
624
subroutine mapform( n, x, y )
627
real(kind=plflt), dimension(*) :: x, y
628
end subroutine mapform
630
end subroutine plsetmapformc
634
subroutine plsfam( fam, num, bmax )
635
integer :: fam, num, bmax
636
end subroutine plsfam
640
subroutine plsmaj( def, scale )
642
real(kind=plflt) :: def, scale
643
end subroutine plsmaj
646
! plsmem: void * argument tricky - TODO
649
subroutine plsmin( def, scale )
651
real(kind=plflt) :: def, scale
652
end subroutine plsmin
656
subroutine plsori( rot )
658
real(kind=plflt) :: rot
659
end subroutine plsori
663
subroutine plspage( xpmm, ypmm, xwid, ywid, xoff, yoff )
665
real(kind=plflt) :: xpmm, ypmm
666
integer :: xwid, ywid, xoff, yoff
667
end subroutine plspage
671
module procedure plspause
675
subroutine plsstrm( strm )
677
end subroutine plsstrm
681
subroutine plssub( nx, ny )
683
end subroutine plssub
687
subroutine plssym( def, scale )
689
real(kind=plflt) :: def, scale
690
end subroutine plssym
694
subroutine plstar( x, y )
696
real(kind=plflt) :: x, y
697
end subroutine plstar
701
subroutine plstripa( id, pen, x, y )
704
real(kind=plflt) :: x, y
705
end subroutine plstripa
709
subroutine plstripd( id )
711
end subroutine plstripd
715
subroutine plstyl( n, mark, space )
716
integer :: n, mark, space
717
end subroutine plstyl
721
module procedure plsurf3d
725
module procedure plstripc
729
module procedure plsvect
733
subroutine plsvpa( xmin, xmax, ymin, ymax )
735
real(kind=plflt) :: xmin, xmax, ymin, ymax
736
end subroutine plsvpa
740
subroutine plsxax( digmax, digits )
741
integer :: digmax, digits
742
end subroutine plsxax
746
subroutine plsyax( digmax, digits )
747
integer :: digmax, digits
748
end subroutine plsyax
752
module procedure plsym
756
subroutine plszax( digmax, digits )
757
integer :: digmax, digits
758
end subroutine plszax
763
end subroutine pltext
767
subroutine plvasp( aspect )
769
real(kind=plflt) :: aspect
770
end subroutine plvasp
774
subroutine plvpas( xmin, xmax, ymin, ymax, aspect )
776
real(kind=plflt) :: xmin, xmax, ymin, ymax, aspect
777
end subroutine plvpas
781
subroutine plvpor( xmin, xmax, ymin, ymax )
783
real(kind=plflt) :: xmin, xmax, ymin, ymax
784
end subroutine plvpor
789
end subroutine plvsta
793
subroutine plw3d( basex, basey, height, xmin, xmax, ymin, ymax, zmin, zmax, alt, az )
795
real(kind=plflt) :: basex, basey, height, xmin, xmax, ymin, ymax, zmin, zmax, alt, az
800
subroutine plwid( width )
806
subroutine plwind( xmin, xmax, ymin, ymax )
808
real(kind=plflt) :: xmin, xmax, ymin, ymax
809
end subroutine plwind
813
module procedure plxormod
817
private :: convert_to_int
818
private :: convert_to_log
820
! -------------------------------------------------------------------
822
! -------------------------------------------------------------------
823
integer function convert_to_int( logvalue )
830
end function convert_to_int
832
logical function convert_to_log( intvalue )
834
convert_to_log = intvalue.ne.0
835
end function convert_to_log
837
subroutine plbin( x, y, center )
838
real(kind=plflt), dimension(:) :: x, y
841
call plbinf77( size(x), x, y, center )
844
subroutine plcpstrm( iplsr, flags )
850
iflags = convert_to_int( flags )
851
call plcpstrmf77( iplsr, iflags )
852
end subroutine plcpstrm
854
subroutine plerrx( xmin, xmax, y )
855
real(kind=plflt), dimension(:) :: xmin, xmax, y
857
call plerrxf77( size(xmin), xmin, xmax, y )
858
end subroutine plerrx
860
subroutine plerry( x, ymin, ymax )
861
real(kind=plflt), dimension(:) :: x, ymin, ymax
863
call plerryf77( size(x), x, ymin, ymax )
864
end subroutine plerry
866
subroutine plfill( x, y )
867
real(kind=plflt), dimension(:) :: x, y
869
call plfillf77( size(x), x, y )
870
end subroutine plfill
872
subroutine plfill3( x, y, z )
873
real(kind=plflt), dimension(:) :: x, y, z
875
call plfill3f77( size(x), x, y, z )
876
end subroutine plfill3
878
subroutine plgriddata( x, y, z, xg, yg, zg, type, data )
879
real(kind=plflt), dimension(:) :: x, y, z, xg, yg, data
880
real(kind=plflt), dimension(:,:) :: zg
883
call plgriddataf77( x, y, z, size(x), xg, size(xg), yg, size(yg), zg, &
887
end subroutine plgriddata
889
subroutine plhist( data, datmin, datmax, nbin, oldwin )
890
real(kind=plflt), dimension(:) :: data
891
real(kind=plflt) :: datmin, datmax
892
integer :: nbin, oldwin
894
call plhistf77( size(data), data, datmin, datmax, nbin, oldwin )
895
end subroutine plhist
897
subroutine plline( x, y )
898
real(kind=plflt), dimension(:) :: x, y
900
call pllinef77( size(x), x, y )
901
end subroutine plline
903
subroutine plline3( x, y, z )
904
real(kind=plflt), dimension(:) :: x, y, z
906
call plline3f77( size(x), x, y, z )
907
end subroutine plline3
909
subroutine plmesh( x, y, z, opt )
911
real(kind=plflt), dimension(:) :: x, y
912
real(kind=plflt), dimension(:,:) :: z
914
call plmeshf77( x, y, z, size(x), size(y), opt, size(x))
916
end subroutine plmesh
918
subroutine plmeshc( x, y, z, opt, clevel )
920
real(kind=plflt), dimension(:) :: x, y, clevel
921
real(kind=plflt), dimension(:,:) :: z
923
call plmeshcf77( x, y, z, size(x), size(y), opt, &
924
clevel, size(clevel), size(x))
926
end subroutine plmeshc
928
subroutine plot3d( x, y, z, opt, side )
931
real(kind=plflt), dimension(:) :: x, y
932
real(kind=plflt), dimension(:,:) :: z
935
iside = convert_to_int(side)
936
call plot3df77( x, y, z, size(x), size(y), opt, iside, size(x))
938
end subroutine plot3d
940
subroutine plot3dc( x, y, z, opt, clevel )
942
real(kind=plflt), dimension(:) :: x, y, clevel
943
real(kind=plflt), dimension(:,:) :: z
945
call plot3dcf77( x, y, z, size(x), size(y), opt, clevel, &
946
size(clevel), size(x))
948
end subroutine plot3dc
950
subroutine plspause( lpause )
955
ipause = convert_to_int( lpause )
956
call plspausef77( ipause )
957
end subroutine plspause
959
subroutine plsurf3d( x, y, z, opt, clevel )
961
real(kind=plflt), dimension(:) :: x, y, clevel
962
real(kind=plflt), dimension(:,:) :: z
964
call plsurf3df77( x, y, z, size(x), size(y), opt, clevel, &
965
size(clevel), size(x))
967
end subroutine plsurf3d
969
subroutine plpoin( x, y, code )
971
real(kind=plflt), dimension(:) :: x, y
973
call plpoinf77( size(x), x, y, code )
974
end subroutine plpoin
976
subroutine plpoin3( x, y, z, code )
978
real(kind=plflt), dimension(:) :: x, y, z
980
call plpoin3f77( size(x), x, y, z, code )
981
end subroutine plpoin3
983
subroutine plpoly3( x, y, z, draw, ifcc )
985
logical, dimension(:) :: draw
986
real(kind=plflt), dimension(:) :: x, y, z
988
integer, dimension(size(draw)) :: idraw
992
iifcc = convert_to_int( ifcc )
994
idraw(i) = convert_to_int( draw(i) )
996
call plpoly3f77( size(x), x, y, z, idraw, iifcc )
997
end subroutine plpoly3
999
subroutine plscmap0( r, g, b )
1000
integer, dimension(:) :: r, g, b
1002
call plscmap0f77( r, g, b, size(r) )
1003
end subroutine plscmap0
1005
subroutine plscmap1( r, g, b )
1006
integer, dimension(:) :: r, g, b
1008
call plscmap1f77( r, g, b, size(r) )
1009
end subroutine plscmap1
1011
subroutine plscmap1l( rgbtype, intensity, coord1, coord2, coord3, rev)
1013
real(kind=plflt), dimension(:) :: intensity, coord1, coord2, coord3
1014
logical, dimension(:) :: rev
1016
integer, dimension(size(rev)) :: irev
1020
type = convert_to_int( rgbtype )
1022
irev(i) = convert_to_int( rev(i) )
1024
call plscmap1lf77( type, size(intensity), intensity, coord1, coord2, coord3, irev )
1025
end subroutine plscmap1l
1027
subroutine plstripc(id, xspec, yspec, xmin, xmax, xjump, &
1028
ymin, ymax, xlpos, ylpos, y_ascl, acc, &
1029
colbox, collab, colline, styline, legline, &
1033
integer id, colbox, collab, colline(4), styline(4)
1034
character*(*) xspec, yspec, legline(4), labx, laby, labtop
1035
real(kind=plflt) xmin, xmax, xjump, ymin, ymax, xlpos, ylpos
1038
integer iy_ascl, iacc
1042
call plstrf2c(xspec, string1, maxlen)
1043
call plstrf2c(yspec, string2, maxlen)
1044
call plstrf2c(legline(1), string3, maxlen)
1045
call plstrf2c(legline(2), string4, maxlen)
1046
call plstrf2c(legline(3), string5, maxlen)
1047
call plstrf2c(legline(4), string6, maxlen)
1048
call plstrf2c(labx, string7, maxlen)
1049
call plstrf2c(laby, string8, maxlen)
1050
call plstrf2c(labtop, string9, maxlen)
1052
iy_ascl = convert_to_int( y_ascl )
1053
iacc = convert_to_int( acc )
1055
call plstripcf77(id, s1, s2, xmin, xmax, xjump, &
1056
ymin, ymax, xlpos, ylpos, iy_ascl, iacc, &
1057
colbox, collab, colline, styline, &
1061
end subroutine plstripc
1063
subroutine plsvect( arrowx, arrowy, fill )
1065
real(kind=plflt), dimension(:) :: arrowx, arrowy
1067
ifill = convert_to_int(fill)
1069
call plsvectf77( arrowx, arrowy, size(arrowx), ifill )
1070
end subroutine plsvect
1072
subroutine plsym( x, y, code )
1074
real(kind=plflt), dimension(:) :: x, y
1076
call plsymf77( size(x), x, y, code )
1077
end subroutine plsym
1079
subroutine plxormod( mode, status )
1080
logical :: mode, status
1081
integer :: imode, istatus
1082
imode = convert_to_int(mode)
1083
call plxormodf77( imode, istatus)
1084
status = convert_to_log(istatus)
1085
end subroutine plxormod