PLplot 5.15.0
Loading...
Searching...
No Matches
plplot.f90
Go to the documentation of this file.
1!***********************************************************************
2! plplot_binding.f90
3!
4! Copyright (C) 2005-2016 Arjen Markus
5! Copyright (C) 2006-2018 Alan W. Irwin
6!
7! This file is part of PLplot.
8!
9! PLplot is free software; you can redistribute it and/or modify
10! it under the terms of the GNU Library General Public License as published
11! by the Free Software Foundation; either version 2 of the License, or
12! (at your option) any later version.
13!
14! PLplot is distributed in the hope that it will be useful,
15! but WITHOUT ANY WARRANTY; without even the implied warranty of
16! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17! GNU Library General Public License for more details.
18!
19! You should have received a copy of the GNU Library General Public License
20! along with PLplot; if not, write to the Free Software
21! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22!
23!
24!***********************************************************************
25
26module plplot
31 use iso_c_binding, only: c_ptr, c_char, c_loc, c_funloc, c_funptr, c_null_char, c_null_ptr, c_null_funptr
32 use iso_fortran_env, only: error_unit
34 implicit none
35 ! We will continue to define plflt for those of our users who are
36 ! content to simply follow in their own Fortran code the
37 ! floating-point precision of our C libraries, but our users no
38 ! longer need to use of this parameter. Instead, kind(1.0) or
39 ! kind(1.0d0) floating-point precision should work for users so
40 ! long as the precision of the floating-point arguments of a given
41 ! call to a PLplot routine are identical.
42 integer, parameter :: plflt = private_plflt
43 ! The following parameter is provided as a convenience to PLplot
44 ! developers to allow them to test any combination of
45 ! floating-point precision of our C libraries and the
46 ! floating-point precision (pl_test_flt) of our Fortran examples.
47 integer, parameter :: pl_test_flt = private_plflt
48 integer(kind=private_plint), parameter :: maxlen = 320
49 character(len=1), parameter :: pl_end_of_string = achar(0)
50 include 'included_plplot_parameters.f90'
52 private :: c_ptr, c_char, c_loc, c_funloc, c_funptr, c_null_char, c_null_ptr, c_null_funptr
53 private :: copystring2f, maxlen
54 private :: max_cstring_length
55 private :: error_unit
56 private :: character_array_to_c
57 private :: c_to_character_array
58
59 ! Normally interface blocks describing the C routines that are
60 ! called by this Fortran binding are embedded as part of module
61 ! procedures, but when more than one module procedure uses such
62 ! interface blocks there is a requirement (enforced at least by
63 ! the nagfor compiler) that those interface blocks be consistent.
64 ! We could comply with that requirement by embedding such multiply
65 ! used interface blocks as part of module procedures using
66 ! duplicated code, but that is inefficient (in terms of the number
67 ! of lines of code to be compiled) and implies a maintenance issue
68 ! (to keep that code duplicated whenever there are changes on the
69 ! C side). To deal with those two potential issues we collect
70 ! here in alphabetical order all interface blocks describing C
71 ! routines that are called directly by more than one module
72 ! procedure below.
73
74 interface
75 function interface_plparseopts( argc, argv, mode ) bind(c,name='c_plparseopts')
76 import :: c_ptr
77 import :: private_plint
78 implicit none
79 integer(kind=private_plint) :: interface_plparseopts !function type
80 integer(kind=private_plint), value, intent(in) :: mode
81 ! The C routine changes both argc and argv
82 integer(kind=private_plint), intent(inout) :: argc
83 type(c_ptr), dimension(*), intent(inout) :: argv
84 end function interface_plparseopts
85 end interface
86 private :: interface_plparseopts
87
88 !
89 ! Interfaces that do not depend on the real kind.
90 !
92 module procedure pl_setcontlabelformat_impl
93 end interface pl_setcontlabelformat
95
96 interface pladv
97 module procedure pladv_impl
98 end interface pladv
99 private :: pladv_impl
100
101 interface plbop
102 module procedure plbop_impl
103 end interface plbop
104 private :: plbop_impl
105
106 interface plclear
107 module procedure plclear_impl
108 end interface plclear
109 private :: plclear_impl
110
111 interface plcol0
112 module procedure plcol0_impl
113 end interface plcol0
114 private :: plcol0_impl
115
116 interface plcpstrm
117 module procedure plcpstrm_impl
118 end interface plcpstrm
119 private :: plcpstrm_impl
120
121 interface plend1
122 module procedure plend1_impl
123 end interface plend1
124 private :: plend1_impl
125
126 interface plend
127 module procedure plend_impl
128 end interface plend
129 private :: plend_impl
130
131 interface pleop
132 module procedure pleop_impl
133 end interface pleop
134 private :: pleop_impl
135
136 interface plfamadv
137 module procedure plfamadv_impl
138 end interface plfamadv
139 private :: plfamadv_impl
140
141 interface plflush
142 module procedure plflush_impl
143 end interface plflush
144 private :: plflush_impl
145
146 interface plfont
147 module procedure plfont_impl
148 end interface plfont
149 private :: plfont_impl
150
151 interface plfontld
152 module procedure plfontld_impl
153 end interface plfontld
154 private :: plfontld_impl
155
156 interface plgcol0
157 module procedure plgcol0_impl
158 end interface plgcol0
159 private :: plgcol0_impl
160
161 interface plgcolbg
162 module procedure plgcolbg_impl
163 end interface plgcolbg
164 private :: plgcolbg_impl
165
167 module procedure plgcompression_impl
168 end interface plgcompression
169 private :: plgcompression_impl
170
171 interface plgdev
172 module procedure plgdev_impl
173 end interface plgdev
174 private :: plgdev_impl
175
176 interface plgdrawmode
177 module procedure plgdrawmode_impl
178 end interface plgdrawmode
179 private :: plgdrawmode_impl
180
182 module procedure plget_arguments_dynamic
183 module procedure plget_arguments_static_length
184 module procedure plget_arguments_static
185 end interface plget_arguments
187
188 interface plgfam
189 module procedure plgfam_impl
190 end interface plgfam
191 private :: plgfam_impl
192
193 interface plgfci
194 module procedure plgfci_impl
195 end interface plgfci
196 private :: plgfci_impl
197
198 interface plgfnam
199 module procedure plgfnam_impl
200 end interface plgfnam
201 private :: plgfnam_impl
202
203 interface plgfont
204 module procedure plgfont_impl
205 end interface plgfont
206 private :: plgfont_impl
207
208 interface plglevel
209 module procedure plglevel_impl
210 end interface plglevel
211 private :: plglevel_impl
212
213 interface plgra
214 module procedure plgra_impl
215 end interface plgra
216 private :: plgra_impl
217
218 interface plgstrm
219 module procedure plgstrm_impl
220 end interface plgstrm
221 private :: plgstrm_impl
222
223 interface plgver
224 module procedure plgver_impl
225 end interface plgver
226 private :: plgver_impl
227
228 interface plgxax
229 module procedure plgxax_impl
230 end interface plgxax
231 private :: plgxax_impl
232
233 interface plgyax
234 module procedure plgyax_impl
235 end interface plgyax
236 private :: plgyax_impl
237
238 interface plgzax
239 module procedure plgzax_impl
240 end interface plgzax
241 private :: plgzax_impl
242
243 interface plinit
244 module procedure plinit_impl
245 end interface plinit
246 private :: plinit_impl
247
248 interface pllab
249 module procedure pllab_impl
250 end interface pllab
251 private :: pllab_impl
252
253 interface pllsty
254 module procedure pllsty_impl
255 end interface pllsty
256 private :: pllsty_impl
257
258 interface plmkstrm
259 module procedure plmkstrm_impl
260 end interface plmkstrm
261 private :: plmkstrm_impl
262
263 interface plparseopts
264 module procedure plparseopts_dynamic
265 module procedure plparseopts_static_length
266 module procedure plparseopts_static
267 module procedure plparseopts_brief
268 end interface plparseopts
270
271 interface plpat
272 module procedure plpat_impl
273 end interface plpat
274 private :: plpat_impl
275
276 interface plprec
277 module procedure plprec_impl
278 end interface plprec
279 private :: plprec_impl
280
281 interface plpsty
282 module procedure plpsty_impl
283 end interface plpsty
284 private :: plpsty_impl
285
286 interface plreplot
287 module procedure plreplot_impl
288 end interface plreplot
289 private :: plreplot_impl
290
291 interface plscmap0
292 module procedure plscmap0_impl
293 end interface plscmap0
294 private :: plscmap0_impl
295
296 interface plscmap0n
297 module procedure plscmap0n_impl
298 end interface plscmap0n
299 private :: plscmap0n_impl
300
301 interface plscmap1
302 module procedure plscmap1_impl
303 end interface plscmap1
304 private :: plscmap1_impl
305
306 interface plscmap1n
307 module procedure plscmap1n_impl
308 end interface plscmap1n
309 private :: plscmap1n_impl
310
311 interface plscol0
312 module procedure plscol0_impl
313 end interface plscol0
314 private :: plscol0_impl
315
316 interface plscolbg
317 module procedure plscolbg_impl
318 end interface plscolbg
319 private :: plscolbg_impl
320
321 interface plscolor
322 module procedure plscolor_impl
323 end interface plscolor
324 private :: plscolor_impl
325
327 module procedure plscompression_impl
328 end interface plscompression
329 private :: plscompression_impl
330
331 interface plsdev
332 module procedure plsdev_impl
333 end interface plsdev
334 private :: plsdev_impl
335
336 interface plsdrawmode
337 module procedure plsdrawmode_impl
338 end interface plsdrawmode
339 private :: plsdrawmode_impl
340
341 interface plseed
342 module procedure plseed_impl
343 end interface plseed
344 private :: plseed_impl
345
346 interface plsesc
347 module procedure plsesc_impl
348 end interface plsesc
349 private :: plsesc_impl
350
351 interface plsetopt
352 module procedure plsetopt_impl
353 end interface plsetopt
354 private :: plsetopt_impl
355
356 interface plsfam
357 module procedure plsfam_impl
358 end interface plsfam
359 private :: plsfam_impl
360
361 interface plsfci
362 module procedure plsfci_impl
363 end interface plsfci
364 private :: plsfci_impl
365
366 interface plsfnam
367 module procedure plsfnam_impl
368 end interface plsfnam
369 private :: plsfnam_impl
370
371 interface plsfont
372 module procedure plsfont_impl
373 end interface plsfont
374 private :: plsfont_impl
375
376 interface plsmem
377 module procedure plsmem_impl
378 end interface plsmem
379 private :: plsmem_impl
380
381 interface plsmema
382 module procedure plsmema_impl
383 end interface plsmema
384 private :: plsmema_impl
385
386 interface plsori
387 module procedure plsori_impl
388 end interface plsori
389 private :: plsori_impl
390
391 interface plspal0
392 module procedure plspal0_impl
393 end interface plspal0
394 private :: plspal0_impl
395
396 interface plspal1
397 module procedure plspal1_impl
398 end interface plspal1
399 private :: plspal1_impl
400
401 interface plspause
402 module procedure plspause_impl
403 end interface plspause
404 private :: plspause_impl
405
406 interface plsstrm
407 module procedure plsstrm_impl
408 end interface plsstrm
409 private :: plsstrm_impl
410
411 interface plssub
412 module procedure plssub_impl
413 end interface plssub
414 private :: plssub_impl
415
416 interface plstar
417 module procedure plstar_impl
418 end interface plstar
419 private :: plstar_impl
420
421 interface plstart
422 module procedure plstart_impl
423 end interface plstart
424 private :: plstart_impl
425
426 interface plstripd
427 module procedure plstripd_impl
428 end interface plstripd
429 private :: plstripd_impl
430
431 interface plstyl
432 module procedure plstyl_impl
433 end interface plstyl
434 private :: plstyl_impl
435
436 ! double- and single-precision variants defined in the plplot_double and plplot_single modules.
437 interface plsvect
438 module procedure plsvect_none
439 end interface plsvect
440 private :: plsvect_none
441
442 interface plsxax
443 module procedure plsxax_impl
444 end interface plsxax
445 private :: plsxax_impl
446
447 interface plsyax
448 module procedure plsyax_impl
449 end interface plsyax
450 private :: plsyax_impl
451
452 interface plszax
453 module procedure plszax_impl
454 end interface plszax
455 private :: plszax_impl
456
457 interface pltext
458 module procedure pltext_impl
459 end interface pltext
460 private :: pltext_impl
461
462 interface pltimefmt
463 module procedure pltimefmt_impl
464 end interface pltimefmt
465 private :: pltimefmt_impl
466
467 interface plvsta
468 module procedure plvsta_impl
469 end interface plvsta
470 private :: plvsta_impl
471
472 interface plxormod
473 module procedure plxormod_impl
474 end interface plxormod
475 private :: plxormod_impl
476
477contains
478
479 !
480 ! Interface routines
481 !
482 subroutine pl_setcontlabelformat_impl( lexp, sigdig )
483 integer, intent(in) :: lexp, sigdig
484
485 interface
486 subroutine interface_pl_setcontlabelformat( lexp, sigdig ) bind(c,name='c_pl_setcontlabelformat')
487 import :: private_plint
488 implicit none
489 integer(kind=private_plint), value, intent(in) :: lexp, sigdig
490 end subroutine interface_pl_setcontlabelformat
491 end interface
492
493 call interface_pl_setcontlabelformat( int(lexp,kind=private_plint), int(sigdig,kind=private_plint) )
494 end subroutine pl_setcontlabelformat_impl
495
496 subroutine pladv_impl( sub )
497 integer, intent(in) :: sub
498 interface
499 subroutine interface_pladv( sub ) bind( c, name = 'c_pladv' )
500 import :: private_plint
501 implicit none
502 integer(kind=private_plint), value, intent(in) :: sub
503 end subroutine interface_pladv
504 end interface
505
506 call interface_pladv( int(sub,kind=private_plint) )
507 end subroutine pladv_impl
508
509 subroutine plbop_impl()
510 interface
511 subroutine interface_plbop() bind(c,name='c_plbop')
512 end subroutine interface_plbop
513 end interface
514 call interface_plbop()
515 end subroutine plbop_impl
516
517 subroutine plclear_impl()
518 interface
519 subroutine interface_plclear() bind(c,name='c_plclear')
520 end subroutine interface_plclear
521 end interface
522 call interface_plclear()
523 end subroutine plclear_impl
524
525 subroutine plcol0_impl( icol )
526 integer, intent(in) :: icol
527 interface
528 subroutine interface_plcol0( icol ) bind(c, name = 'c_plcol0' )
529 import :: private_plint
530 implicit none
531 integer(kind=private_plint), value, intent(in) :: icol
532 end subroutine interface_plcol0
533 end interface
534
535 call interface_plcol0( int(icol,kind=private_plint) )
536 end subroutine plcol0_impl
537
538 subroutine plcpstrm_impl( iplsr, flags )
539 integer, intent(in) :: iplsr
540 logical, intent(in) :: flags
541 interface
542 subroutine interface_plcpstrm( iplsr, flags ) bind(c, name = 'c_plcpstrm' )
544 implicit none
545 integer(kind=private_plint), value, intent(in) :: iplsr
546 integer(kind=private_plbool), value, intent(in) :: flags
547 end subroutine interface_plcpstrm
548 end interface
549
550 call interface_plcpstrm( int(iplsr,kind=private_plint), int(merge(1,0,flags),kind=private_plbool) )
551 end subroutine plcpstrm_impl
552
553 subroutine plend1_impl()
554 interface
555 subroutine interface_plend1() bind( c, name = 'c_plend1' )
556 end subroutine interface_plend1
557 end interface
558 call interface_plend1()
559 end subroutine plend1_impl
560
561 subroutine plend_impl()
562 interface
563 subroutine interface_plend() bind( c, name = 'c_plend' )
564 end subroutine interface_plend
565 end interface
566 call interface_plend()
567 end subroutine plend_impl
568
569 subroutine pleop_impl()
570 interface
571 subroutine interface_pleop() bind( c, name = 'c_pleop' )
572 end subroutine interface_pleop
573 end interface
574 call interface_pleop()
575 end subroutine pleop_impl
576
577 subroutine plfamadv_impl()
578 interface
579 subroutine interface_plfamadv() bind( c, name = 'c_plfamadv' )
580 end subroutine interface_plfamadv
581 end interface
582 call interface_plfamadv()
583 end subroutine plfamadv_impl
584
585 subroutine plflush_impl()
586 interface
587 subroutine interface_plflush() bind( c, name = 'c_plflush' )
588 end subroutine interface_plflush
589 end interface
590 call interface_plflush()
591 end subroutine plflush_impl
592
593 subroutine plfont_impl( font )
594 integer, intent(in) :: font
595 interface
596 subroutine interface_plfont( font ) bind( c, name = 'c_plfont' )
597 import :: private_plint
598 implicit none
599 integer(kind=private_plint), value, intent(in) :: font
600 end subroutine interface_plfont
601 end interface
602
603 call interface_plfont( int(font,kind=private_plint) )
604 end subroutine plfont_impl
605
606 subroutine plfontld_impl( charset )
607 integer, intent(in) :: charset
608 interface
609 subroutine interface_plfontld( charset ) bind( c, name = 'c_plfontld' )
610 import :: private_plint
611 implicit none
612 integer(kind=private_plint), value, intent(in) :: charset
613 end subroutine interface_plfontld
614 end interface
615
616 call interface_plfontld( int(charset,kind=private_plint) )
617 end subroutine plfontld_impl
618
619 subroutine plgcol0_impl( icol, r, g, b )
620 integer, intent(in) :: icol
621 integer, intent(out) :: r, g, b
622
623 integer(kind=private_plint) :: r_out, g_out, b_out
624
625 interface
626 subroutine interface_plgcol0( icol, r, g, b ) bind( c, name = 'c_plgcol0' )
627 import :: private_plint
628 implicit none
629 integer(kind=private_plint), value, intent(in) :: icol
630 integer(kind=private_plint), intent(out) :: r, g, b
631 end subroutine interface_plgcol0
632 end interface
633
634 call interface_plgcol0( int(icol,kind=private_plint), r_out, g_out, b_out )
635 r = int(r_out)
636 g = int(g_out)
637 b = int(b_out)
638 end subroutine plgcol0_impl
639
640 subroutine plgcolbg_impl( r, g, b )
641 integer, intent(out) :: r, g, b
642
643 integer(kind=private_plint) :: r_out, g_out, b_out
644
645 interface
646 subroutine interface_plgcolbg( r, g, b ) bind( c, name = 'c_plgcolbg' )
647 import :: private_plint
648 implicit none
649 integer(kind=private_plint), intent(out) :: r, g, b
650 end subroutine interface_plgcolbg
651 end interface
652
653 call interface_plgcolbg( r_out, g_out, b_out )
654 r = int(r_out)
655 g = int(g_out)
656 b = int(b_out)
657 end subroutine plgcolbg_impl
658
659 subroutine plgcompression_impl( compression )
660 integer, intent(out) :: compression
661
662 integer(kind=private_plint) :: compression_out
663
664 interface
665 subroutine interface_plgcompression( compression ) bind( c, name = 'c_plgcompression' )
666 import :: private_plint
667 implicit none
668 integer(kind=private_plint), intent(out) :: compression
669 end subroutine interface_plgcompression
670 end interface
671
672 call interface_plgcompression( compression_out )
673 compression = int(compression_out)
674 end subroutine plgcompression_impl
675
676 subroutine plgdev_impl(dev)
677 character*(*), intent(out) :: dev
678
679 character(len=1), dimension(100) :: dev_out
680
681 interface
682 subroutine interface_plgdev( dev ) bind(c,name='c_plgdev')
683 implicit none
684 character(len=1), dimension(*), intent(out) :: dev
685 end subroutine interface_plgdev
686 end interface
687
688 call interface_plgdev( dev_out )
689 call copystring2f( dev, dev_out )
690 end subroutine plgdev_impl
691
693
694 integer :: plgdrawmode_impl !function type
695
696 interface
697 function interface_plgdrawmode() bind(c,name='c_plgdrawmode')
698 import :: private_plint
699 implicit none
700 integer(kind=private_plint) :: interface_plgdrawmode !function type
701 end function interface_plgdrawmode
702 end interface
703
704 plgdrawmode_impl = int(interface_plgdrawmode())
705 end function plgdrawmode_impl
706
707 function plget_arguments_dynamic( argv )
708 integer :: plget_arguments_dynamic !function type
709 character(len=:), dimension(:), allocatable, intent(out) :: argv
710
711 integer :: nargv_local
712 character(len=1) :: test_argv_local
713 integer :: length_argv_local, length_local, iargs_local
714
715 nargv_local = command_argument_count()
716 if (nargv_local < 0) then
717! This actually happened historically on a buggy Cygwin platform.
718 write(error_unit,'(a)') 'Plplot Fortran Severe Warning: plget_arguments: negative number of arguments'
720 return
721 endif
722
723! Determine maximum length of arguments
724 length_argv_local = 0
725 do iargs_local = 0, nargv_local
726 call get_command_argument(iargs_local, test_argv_local, length_local)
727 length_argv_local = max(length_argv_local, length_local)
728 enddo
729
730 ! Allocate argv of correct size (but static length) to hold the command-line arguments.
731 allocate(character(len=length_argv_local) :: argv(0:nargv_local))
732 do iargs_local = 0, nargv_local
733 call get_command_argument(iargs_local, argv(iargs_local))
734 enddo
736 end function plget_arguments_dynamic
737
738 function plget_arguments_static_length( argv, disambiguate )
739 integer :: plget_arguments_static_length !function type
740 character(len=*), dimension(:), allocatable, intent(out) :: argv
741 integer, intent(in) :: disambiguate
742
743 integer :: nargv_local
744 character(len=1) :: test_argv_local
745 integer :: length_argv_local, length_local, iargs_local
746
747 nargv_local = command_argument_count()
748 if (nargv_local < 0) then
749! This actually happened historically on a buggy Cygwin platform.
750 write(error_unit,'(a)') 'Plplot Fortran Severe Warning: plget_arguments: negative number of arguments'
752 return
753 endif
754
755! Determine maximum length of arguments
756 length_argv_local = 0
757 do iargs_local = 0, nargv_local
758 call get_command_argument(iargs_local, test_argv_local, length_local)
759 length_argv_local = max(length_argv_local, length_local)
760 enddo
761
762 if(length_argv_local > len(argv) ) then
763 write(error_unit,*) 'Plplot Fortran Severe Warning: plget_arguments: at least one argument is too long to process'
765 return
766 endif
767
768 ! Allocate argv of correct size (but static length) to hold the command-line arguments.
769 allocate(argv(0:nargv_local))
770 do iargs_local = 0, nargv_local
771 call get_command_argument(iargs_local, argv(iargs_local))
772 enddo
775
776 function plget_arguments_static( nargv, argv )
777 integer :: plget_arguments_static !function type
778 integer, intent(out) :: nargv
779 character(len=*), dimension(0:), intent(out) :: argv
780
781 character(len=1) :: test_argv_local
782 integer :: length_argv_local, length_local, iargs_local
783
784 nargv = command_argument_count()
785 if (nargv < 0) then
786! This actually happened historically on a buggy Cygwin platform.
787 write(error_unit,'(a)') 'Plplot Fortran Severe Warning: plget_arguments: negative number of arguments'
789 return
790 endif
791
792 if(nargv + 1 > size(argv)) then
793 write(error_unit,'(a)') 'Plplot Fortran Severe Warning: plget_arguments: too many arguments to process'
795 return
796 endif
797
798! Determine maximum length of arguments
799 length_argv_local = 0
800 do iargs_local = 0, nargv
801 call get_command_argument(iargs_local, test_argv_local, length_local)
802 length_argv_local = max(length_argv_local, length_local)
803 enddo
804 if(length_argv_local > len(argv) ) then
805 write(error_unit,*) 'Plplot Fortran Severe Warning: plget_arguments: at least one argument is too long to process'
807 return
808 endif
809
810 do iargs_local = 0, nargv
811 call get_command_argument(iargs_local, argv(iargs_local))
812 enddo
814 end function plget_arguments_static
815
816 subroutine plgfam_impl( fam, num, bmax )
817 integer, intent(out) :: fam, num, bmax
818
819 integer(kind=private_plint) :: fam_out, num_out, bmax_out
820
821 interface
822 subroutine interface_plgfam( fam, num, bmax ) bind( c, name = 'c_plgfam' )
823 import :: private_plint
824 implicit none
825 integer(kind=private_plint), intent(out) :: fam, num, bmax
826 end subroutine interface_plgfam
827 end interface
828
829 call interface_plgfam( fam_out, num_out, bmax_out )
830 fam = int(fam_out)
831 num = int(num_out)
832 bmax = int(bmax_out)
833 end subroutine plgfam_impl
834
835 subroutine plgfci_impl( fci )
836 integer, intent(out) :: fci
837
838 integer(kind=private_plunicode) :: fci_out
839
840 interface
841 subroutine interface_plgfci( fci ) bind( c, name = 'c_plgfci' )
842 import :: private_plunicode
843 implicit none
844 integer(kind=private_plunicode), intent(out) :: fci
845 end subroutine interface_plgfci
846 end interface
847
848 call interface_plgfci( fci_out )
849 fci = int(fci_out)
850 end subroutine plgfci_impl
851
852 subroutine plgfnam_impl( fnam )
853 character*(*), intent(out) :: fnam
854
855 character(len=1), dimension(100) :: fnam_out
856
857 interface
858 subroutine interface_plgfnam( fnam ) bind(c,name='c_plgfnam')
859 implicit none
860 character(len=1), dimension(*), intent(out) :: fnam
861 end subroutine interface_plgfnam
862 end interface
863
864 call interface_plgfnam( fnam_out )
865 call copystring2f( fnam, fnam_out )
866 end subroutine plgfnam_impl
867
868 subroutine plgfont_impl( family, style, weight )
869 integer, intent(out) :: family, style, weight
870
871 integer(kind=private_plint) :: family_out, style_out, weight_out
872
873 interface
874 subroutine interface_plgfont( family, style, weight ) bind( c, name = 'c_plgfont' )
875 import :: private_plint
876 implicit none
877 integer(kind=private_plint), intent(out) :: family, style, weight
878 end subroutine interface_plgfont
879 end interface
880
881 call interface_plgfont( family_out, style_out, weight_out )
882 family = int(family_out)
883 style = int(style_out)
884 weight = int(weight_out)
885 end subroutine plgfont_impl
886
887 subroutine plglevel_impl( level )
888 integer, intent(out) :: level
889
890 integer(kind=private_plint) :: level_out
891
892 interface
893 subroutine interface_plglevel( level ) bind( c, name = 'c_plglevel' )
894 import :: private_plint
895 implicit none
896 integer(kind=private_plint), intent(out) :: level
897 end subroutine interface_plglevel
898 end interface
899
900 call interface_plglevel( level_out )
901 level = int(level_out)
902 end subroutine plglevel_impl
903
904 subroutine plgra_impl()
905 interface
906 subroutine interface_plgra() bind( c, name = 'c_plgra' )
907 end subroutine interface_plgra
908 end interface
909 call interface_plgra()
910 end subroutine plgra_impl
911
912 subroutine plgstrm_impl( strm )
913 integer, intent(out) :: strm
914
915 integer(kind=private_plint) :: strm_out
916
917 interface
918 subroutine interface_plgstrm( strm ) bind( c, name = 'c_plgstrm' )
919 import :: private_plint
920 implicit none
921 integer(kind=private_plint), intent(out) :: strm
922 end subroutine interface_plgstrm
923 end interface
924
925 call interface_plgstrm( strm_out )
926 strm = int(strm_out)
927 end subroutine plgstrm_impl
928
929 subroutine plgver_impl(ver)
930 character*(*), intent(out) :: ver
931
932 character(len=1), dimension(100) :: ver_out
933
934 interface
935 subroutine interface_plgver( ver ) bind(c,name='c_plgver')
936 implicit none
937 character(len=1), dimension(*), intent(out) :: ver
938 end subroutine interface_plgver
939 end interface
940
941 call interface_plgver( ver_out )
942 call copystring2f( ver, ver_out )
943 end subroutine plgver_impl
944
945 subroutine plgxax_impl( digmax, digits )
946 integer, intent(out) :: digmax, digits
947
948 integer(kind=private_plint) :: digmax_out, digits_out
949
950 interface
951 subroutine interface_plgxax( digmax, digits ) bind( c, name = 'c_plgxax' )
952 import :: private_plint
953 implicit none
954 integer(kind=private_plint), intent(out) :: digmax, digits
955 end subroutine interface_plgxax
956 end interface
957
958 call interface_plgxax( digmax_out, digits_out )
959 digmax = int(digmax_out)
960 digits = int(digits_out)
961 end subroutine plgxax_impl
962
963 subroutine plgyax_impl( digmax, digits )
964 integer, intent(out) :: digmax, digits
965
966 integer(kind=private_plint) :: digmax_out, digits_out
967
968 interface
969 subroutine interface_plgyax( digmax, digits ) bind( c, name = 'c_plgyax' )
970 import :: private_plint
971 implicit none
972 integer(kind=private_plint), intent(out) :: digmax, digits
973 end subroutine interface_plgyax
974 end interface
975
976 call interface_plgyax( digmax_out, digits_out )
977 digmax = int(digmax_out)
978 digits = int(digits_out)
979 end subroutine plgyax_impl
980
981 subroutine plgzax_impl( digmax, digits )
982 integer, intent(out) :: digmax, digits
983
984 integer(kind=private_plint) :: digmax_out, digits_out
985
986 interface
987 subroutine interface_plgzax( digmax, digits ) bind( c, name = 'c_plgzax' )
988 import :: private_plint
989 implicit none
990 integer(kind=private_plint), intent(out) :: digmax, digits
991 end subroutine interface_plgzax
992 end interface
993
994 call interface_plgzax( digmax_out, digits_out )
995 digmax = int(digmax_out)
996 digits = int(digits_out)
997 end subroutine plgzax_impl
998
999 subroutine plinit_impl()
1000 interface
1001 subroutine interface_plinit() bind( c, name = 'c_plinit' )
1002 end subroutine interface_plinit
1003 end interface
1004 call interface_plinit()
1005 end subroutine plinit_impl
1006
1007 subroutine pllab_impl( xlab, ylab, title )
1008 character(len=*), intent(in) :: xlab, ylab, title
1009
1010 interface
1011 subroutine interface_pllab( xlab, ylab, title ) bind(c,name='c_pllab')
1012 implicit none
1013 character(len=1), dimension(*), intent(in) :: xlab, ylab, title
1014 end subroutine interface_pllab
1015 end interface
1016
1017 call interface_pllab( trim(xlab)//c_null_char, trim(ylab)//c_null_char, trim(title)//c_null_char )
1018
1019 end subroutine pllab_impl
1020
1021 subroutine pllsty_impl( lin )
1022 integer, intent(in) :: lin
1023 interface
1024 subroutine interface_pllsty( lin ) bind( c, name = 'c_pllsty' )
1025 import :: private_plint
1026 implicit none
1027 integer(kind=private_plint), value, intent(in) :: lin
1028 end subroutine interface_pllsty
1029 end interface
1030
1031 call interface_pllsty( int(lin,kind=private_plint) )
1032 end subroutine pllsty_impl
1033
1034 subroutine plmkstrm_impl( strm )
1035 integer, intent(in) :: strm
1036 interface
1037 subroutine interface_plmkstrm( strm ) bind( c, name = 'c_plmkstrm' )
1038 import :: private_plint
1039 implicit none
1040 integer(kind=private_plint), value, intent(in) :: strm
1041 end subroutine interface_plmkstrm
1042 end interface
1043
1044 call interface_plmkstrm( int(strm,kind=private_plint) )
1045 end subroutine plmkstrm_impl
1046
1047 function plparseopts_dynamic(argv, mode)
1048 integer :: plparseopts_dynamic !function type
1049 character(len=:), intent(inout), dimension(:), allocatable :: argv
1050 integer, intent(in) :: mode
1051
1052 integer(kind=private_plint) :: size_local
1053 integer :: max_length_local
1054
1055 character(len=1), dimension(:,:), allocatable :: cstring_arg_local
1056 type(c_ptr), dimension(:), allocatable :: cstring_address_arg_inout
1057
1058 call character_array_to_c( cstring_arg_local, cstring_address_arg_inout, argv )
1059
1060 ! Note that the C routine interface_plparseopts changes this value.
1061 size_local = size(argv, kind=private_plint)
1062 plparseopts_dynamic = int(interface_plparseopts( size_local, &
1063 cstring_address_arg_inout, int(mode, kind=private_plint)))
1064 if(plparseopts_dynamic /= 0) return
1065 deallocate(argv)
1066 max_length_local = max_cstring_length(cstring_address_arg_inout(1:size_local))
1067 allocate(character(len=max_length_local) :: argv(0:size_local - 1))
1068 plparseopts_dynamic = c_to_character_array(argv, cstring_address_arg_inout(1:size_local))
1069 end function plparseopts_dynamic
1070
1071 function plparseopts_static_length(argv, mode, disambiguate)
1072 integer :: plparseopts_static_length !function type
1073 character(len=*), intent(inout), dimension(:), allocatable :: argv
1074 integer, intent(in) :: mode, disambiguate
1075
1076 integer(kind=private_plint) :: size_local
1077
1078 character(len=1), dimension(:,:), allocatable :: cstring_arg_local
1079 type(c_ptr), dimension(:), allocatable :: cstring_address_arg_inout
1080
1081 call character_array_to_c( cstring_arg_local, cstring_address_arg_inout, argv )
1082
1083 ! Note that the C routine interface_plparseopts changes this value.
1084 size_local = size(argv, kind=private_plint)
1086 cstring_address_arg_inout, int(mode, kind=private_plint)))
1087 if(plparseopts_static_length /= 0) return
1088
1089 if(len(argv) < max_cstring_length(cstring_address_arg_inout(1:size_local))) then
1090 write(error_unit,*) 'Plplot Fortran Severe Warning: plparseopts: at least one argument is too long to process'
1092 return
1093 endif
1094 deallocate(argv)
1095 allocate(argv(0:size_local - 1))
1096 plparseopts_static_length = c_to_character_array(argv, cstring_address_arg_inout(1:size_local))
1097 end function plparseopts_static_length
1098
1099 function plparseopts_static(nargv, argv, mode)
1100 integer :: plparseopts_static !function type
1101 integer, intent(out) :: nargv
1102 character(len=*), intent(inout), dimension(0:) :: argv
1103 integer, intent(in) :: mode
1104
1105 integer(kind=private_plint) :: size_local
1106
1107 character(len=1), dimension(:,:), allocatable :: cstring_arg_local
1108 type(c_ptr), dimension(:), allocatable :: cstring_address_arg_inout
1109
1110 call character_array_to_c( cstring_arg_local, cstring_address_arg_inout, argv )
1111
1112 ! Note that the C routine interface_plparseopts changes this value.
1113 size_local = size(argv, kind=private_plint)
1114 plparseopts_static = int(interface_plparseopts( size_local, &
1115 cstring_address_arg_inout, int(mode, kind=private_plint)))
1116 if(plparseopts_static /= 0) return
1117 if(len(argv) < max_cstring_length(cstring_address_arg_inout(1:size_local))) then
1118 write(error_unit,*) 'Plplot Fortran Severe Warning: plparseopts: at least one argument is too long to process'
1120 return
1121 endif
1122 plparseopts_static = c_to_character_array(argv, cstring_address_arg_inout(1:size_local))
1123 nargv = int(size_local - 1)
1124 end function plparseopts_static
1125
1126 function plparseopts_brief(mode)
1127 integer :: plparseopts_brief !function type
1128 integer, intent(in) :: mode
1129
1130 integer :: numargs_local, plget_arguments_rc
1131 integer(kind=private_plint) :: size_local
1132
1133 integer, parameter :: maxargs_local = 1000
1134 character (len=maxlen), dimension(0:maxargs_local) :: arg_local
1135 character(len=1), dimension(:,:), allocatable :: cstring_arg_local
1136 type(c_ptr), dimension(:), allocatable :: cstring_address_arg_inout
1137
1138 plget_arguments_rc = plget_arguments(numargs_local, arg_local)
1139 if(plget_arguments_rc /= 0) then
1141 return
1142 endif
1143 call character_array_to_c( cstring_arg_local, cstring_address_arg_inout, arg_local(0:numargs_local) )
1144
1145 ! Note that the C routine interface_plparseopts changes this value.
1146 size_local = int(numargs_local + 1, kind=private_plint)
1147 plparseopts_brief = int(interface_plparseopts( size_local, &
1148 cstring_address_arg_inout, int(mode, kind=private_plint)))
1149 end function plparseopts_brief
1150
1151 subroutine plpat_impl( inc, del )
1152 integer, dimension(:), intent(in) :: inc, del
1153
1154 integer(kind=private_plint) :: nlin_local
1155
1156 interface
1157 subroutine interface_plpat( nlin, inc, del ) bind( c, name = 'c_plpat' )
1158 import :: private_plint
1159 implicit none
1160 integer(kind=private_plint), value, intent(in) :: nlin
1161 integer(kind=private_plint), dimension(*), intent(in) :: inc, del
1162 end subroutine interface_plpat
1163 end interface
1164
1165 nlin_local = size(inc, kind=private_plint)
1166 if(nlin_local /= size(del, kind=private_plint) ) then
1167 write(error_unit, "(a)") "Plplot Fortran Warning: plpat: sizes of inc and del are not consistent"
1168 endif
1169
1170 call interface_plpat( nlin_local, int(inc,kind=private_plint), int(del,kind=private_plint) )
1171
1172 end subroutine plpat_impl
1173
1174 subroutine plprec_impl( setp, prec )
1175 integer, intent(in) :: setp, prec
1176 interface
1177 subroutine interface_plprec( setp, prec ) bind( c, name = 'c_plprec' )
1178 import :: private_plint
1179 implicit none
1180 integer(kind=private_plint), value, intent(in) :: setp, prec
1181 end subroutine interface_plprec
1182 end interface
1183
1184 call interface_plprec( int(setp,kind=private_plint), int(prec,kind=private_plint) )
1185 end subroutine plprec_impl
1186
1187 subroutine plpsty_impl( patt )
1188 integer, intent(in) :: patt
1189 interface
1190 subroutine interface_plpsty( patt ) bind( c, name = 'c_plpsty' )
1191 import :: private_plint
1192 implicit none
1193 integer(kind=private_plint), value, intent(in) :: patt
1194 end subroutine interface_plpsty
1195 end interface
1196
1197 call interface_plpsty( int(patt,kind=private_plint) )
1198 end subroutine plpsty_impl
1199
1200 subroutine plreplot_impl()
1201 interface
1202 subroutine interface_plreplot() bind(c,name='c_plreplot')
1203 end subroutine interface_plreplot
1204 end interface
1205 call interface_plreplot()
1206 end subroutine plreplot_impl
1207
1208 subroutine plscmap0_impl( r, g, b )
1209 integer, dimension(:), intent(in) :: r, g, b
1210
1211 integer(kind=private_plint) :: n_local
1212
1213 interface
1214 subroutine interface_plscmap0( r, g, b, n ) bind(c,name='c_plscmap0')
1215 import :: private_plint
1216 implicit none
1217 integer(kind=private_plint), dimension(*), intent(in) :: r, g, b
1218 integer(kind=private_plint), value, intent(in) :: n
1219 end subroutine interface_plscmap0
1220 end interface
1221
1222 n_local = size(r,kind=private_plint)
1223 if( n_local /= size(g, kind=private_plint) .or. n_local /= size(b, kind=private_plint) ) then
1224 write(error_unit, "(a)") "Plplot Fortran Warning: plscmap0: inconsistent sizes for r, g, and/or b"
1225 end if
1226
1227 call interface_plscmap0( int(r,kind=private_plint), int(g,kind=private_plint), int(b,kind=private_plint), &
1228 n_local )
1229 end subroutine plscmap0_impl
1230
1231 subroutine plscmap0n_impl( n )
1232 integer, intent(in) :: n
1233 interface
1234 subroutine interface_plscmap0n( n ) bind( c, name = 'c_plscmap0n' )
1235 import :: private_plint
1236 implicit none
1237 integer(kind=private_plint), value, intent(in) :: n
1238 end subroutine interface_plscmap0n
1239 end interface
1240
1241 call interface_plscmap0n( int(n,kind=private_plint) )
1242 end subroutine plscmap0n_impl
1243
1244 subroutine plscmap1_impl( r, g, b )
1245 integer, dimension(:), intent(in) :: r, g, b
1246
1247 integer(kind=private_plint) :: n_local
1248
1249 interface
1250 subroutine interface_plscmap1( r, g, b, n ) bind(c,name='c_plscmap1')
1251 import :: private_plint
1252 implicit none
1253 integer(kind=private_plint), dimension(*), intent(in) :: r, g, b
1254 integer(kind=private_plint), value, intent(in) :: n
1255 end subroutine interface_plscmap1
1256 end interface
1257
1258 n_local = size(r,kind=private_plint)
1259 if( n_local /= size(g, kind=private_plint) .or. n_local /= size(b, kind=private_plint) ) then
1260 write(error_unit, "(a)") "Plplot Fortran Warning: plscmap1: inconsistent sizes for r, g, and/or b"
1261 end if
1262
1263 call interface_plscmap1( int(r,kind=private_plint), int(g,kind=private_plint), int(b,kind=private_plint), &
1264 n_local )
1265 end subroutine plscmap1_impl
1266
1267 subroutine plscmap1n_impl( n )
1268 integer, intent(in) :: n
1269 interface
1270 subroutine interface_plscmap1n( n ) bind( c, name = 'c_plscmap1n' )
1271 import :: private_plint
1272 implicit none
1273 integer(kind=private_plint), value, intent(in) :: n
1274 end subroutine interface_plscmap1n
1275 end interface
1276
1277 call interface_plscmap1n( int(n,kind=private_plint) )
1278 end subroutine plscmap1n_impl
1279
1280 subroutine plscol0_impl( icol, r, g, b )
1281 integer, intent(in) :: icol, r, g, b
1282 interface
1283 subroutine interface_plscol0( icol, r, g, b ) bind( c, name = 'c_plscol0' )
1284 import :: private_plint
1285 implicit none
1286 integer(kind=private_plint), value, intent(in) :: icol, r, g, b
1287 end subroutine interface_plscol0
1288 end interface
1289
1290 call interface_plscol0( int(icol,kind=private_plint), &
1291 int(r,kind=private_plint), int(g,kind=private_plint), int(b,kind=private_plint) )
1292 end subroutine plscol0_impl
1293
1294 subroutine plscolbg_impl( r, g, b )
1295 integer, intent(in) :: r, g, b
1296 interface
1297 subroutine interface_plscolbg( r, g, b ) bind( c, name = 'c_plscolbg' )
1298 import :: private_plint
1299 implicit none
1300 integer(kind=private_plint), value, intent(in) :: r, g, b
1301 end subroutine interface_plscolbg
1302 end interface
1303
1304 call interface_plscolbg( int(r,kind=private_plint), int(g,kind=private_plint), int(b,kind=private_plint) )
1305 end subroutine plscolbg_impl
1306
1307
1308 subroutine plscolor_impl( color )
1309 integer, intent(in) :: color
1310 interface
1311 subroutine interface_plscolor( color ) bind( c, name = 'c_plscolor' )
1312 import :: private_plint
1313 implicit none
1314 integer(kind=private_plint), value, intent(in) :: color
1315 end subroutine interface_plscolor
1316 end interface
1317
1318 call interface_plscolor( int(color,kind=private_plint) )
1319 end subroutine plscolor_impl
1320
1321 subroutine plscompression_impl( compression )
1322 integer, intent(in) :: compression
1323 interface
1324 subroutine interface_plscompression( compression ) bind( c, name = 'c_plscompression' )
1325 import :: private_plint
1326 implicit none
1327 integer(kind=private_plint), value, intent(in) :: compression
1328 end subroutine interface_plscompression
1329 end interface
1330
1331 call interface_plscompression( int(compression,kind=private_plint) )
1332 end subroutine plscompression_impl
1333
1334 subroutine plsdev_impl( devname )
1335 character(len=*), intent(in) :: devname
1336
1337 interface
1338 subroutine interface_plsdev( devname ) bind(c,name='c_plsdev')
1339 implicit none
1340 character(len=1), dimension(*), intent(in) :: devname
1341 end subroutine interface_plsdev
1342 end interface
1343
1344 call interface_plsdev( trim(devname)//c_null_char )
1345
1346 end subroutine plsdev_impl
1347
1348 subroutine plsdrawmode_impl( mode )
1349 integer, intent(in) :: mode
1350 interface
1351 subroutine interface_plsdrawmode( mode ) bind( c, name = 'c_plsdrawmode' )
1352 import :: private_plint
1353 implicit none
1354 integer(kind=private_plint), value, intent(in) :: mode
1355 end subroutine interface_plsdrawmode
1356 end interface
1357
1358 call interface_plsdrawmode( int(mode,kind=private_plint) )
1359 end subroutine plsdrawmode_impl
1360
1361 subroutine plseed_impl( s )
1362 integer, intent(in) :: s
1363 interface
1364 subroutine interface_plseed( s ) bind( c, name = 'c_plseed' )
1365 import :: private_plint
1366 implicit none
1367 integer(kind=private_plint), value, intent(in) :: s
1368 end subroutine interface_plseed
1369 end interface
1370
1371 call interface_plseed( int(s,kind=private_plint) )
1372 end subroutine plseed_impl
1373
1374 ! TODO: character-version
1375 subroutine plsesc_impl( esc )
1376 integer, intent(in) :: esc
1377 interface
1378 subroutine interface_plsesc( esc ) bind( c, name = 'c_plsesc' )
1379 import :: private_plint
1380 implicit none
1381 integer(kind=private_plint), value, intent(in) :: esc
1382 end subroutine interface_plsesc
1383 end interface
1384
1385 call interface_plsesc( int(esc,kind=private_plint) )
1386 end subroutine plsesc_impl
1387
1388 function plsetopt_impl( opt, optarg )
1389 integer :: plsetopt_impl !function type
1390 character(len=*), intent(in) :: opt, optarg
1391
1392
1393 interface
1394 function interface_plsetopt( opt, optarg ) bind(c,name='c_plsetopt')
1395 import :: private_plint
1396 implicit none
1397 integer(kind=private_plint) :: interface_plsetopt !function type
1398 character(len=1), dimension(*), intent(in) :: opt, optarg
1399 end function interface_plsetopt
1400 end interface
1401
1402 plsetopt_impl = int(interface_plsetopt( trim(opt)//c_null_char, trim(optarg)//c_null_char ))
1403
1404 end function plsetopt_impl
1405
1406 subroutine plsfam_impl( fam, num, bmax )
1407 integer, intent(in) :: fam, num, bmax
1408 interface
1409 subroutine interface_plsfam( fam, num, bmax ) bind( c, name = 'c_plsfam' )
1410 import :: private_plint
1411 implicit none
1412 integer(kind=private_plint), value, intent(in) :: fam, num, bmax
1413 end subroutine interface_plsfam
1414 end interface
1415
1416 call interface_plsfam( int(fam,kind=private_plint), int(num,kind=private_plint), int(bmax,kind=private_plint) )
1417 end subroutine plsfam_impl
1418
1419 subroutine plsfci_impl( fci )
1420 integer, intent(in) :: fci
1421
1422 interface
1423 subroutine interface_plsfci( fci ) bind( c, name = 'c_plsfci' )
1424 import :: private_plunicode
1425 implicit none
1426 integer(kind=private_plunicode), value, intent(in) :: fci
1427 end subroutine interface_plsfci
1428 end interface
1429
1430 call interface_plsfci( int(fci,kind=private_plunicode) )
1431
1432 end subroutine plsfci_impl
1433
1434 subroutine plsfnam_impl( fnam )
1435 character(len=*), intent(in) :: fnam
1436
1437 interface
1438 subroutine interface_plsfnam( fnam ) bind(c,name='c_plsfnam')
1439 implicit none
1440 character(len=1), dimension(*), intent(in) :: fnam
1441 end subroutine interface_plsfnam
1442 end interface
1443
1444 call interface_plsfnam( trim(fnam)//c_null_char )
1445
1446 end subroutine plsfnam_impl
1447
1448 subroutine plsfont_impl( family, style, weight )
1449 integer, intent(in) :: family, style, weight
1450 interface
1451 subroutine interface_plsfont( family, style, weight ) bind( c, name = 'c_plsfont' )
1452 import :: private_plint
1453 implicit none
1454 integer(kind=private_plint), value, intent(in) :: family, style, weight
1455 end subroutine interface_plsfont
1456 end interface
1457
1458 call interface_plsfont( int(family,kind=private_plint), int(style,kind=private_plint), int(weight,kind=private_plint) )
1459 end subroutine plsfont_impl
1460
1461 ! Probably would be better to define this in redacted form, but it is not documented that
1462 ! way, and the python interface also does not use redacted form. So leave it for now.
1463 ! I (AWI) followed advice in <http://stackoverflow.com/questions/10755896/fortran-how-to-store-value-255-into-one-byte>
1464 ! for the type statement for plotmem
1465 subroutine plsmem_impl( maxx, maxy, plotmem )
1466 integer, intent(in) :: maxx, maxy
1467 character(kind=c_char), dimension(:, :, :), target, intent(in) :: plotmem
1468 interface
1469 subroutine interface_plsmem( maxx, maxy, plotmem ) bind( c, name = 'c_plsmem' )
1470 import :: c_ptr
1471 import :: private_plint
1472 implicit none
1473 integer(kind=private_plint), value, intent(in) :: maxx, maxy
1474 type(c_ptr), value, intent(in) :: plotmem
1475 end subroutine interface_plsmem
1476 end interface
1477
1478 ! We need a first dimension of 3 to have space for RGB
1479 if( 3 /= size(plotmem,1) ) then
1480 write(error_unit, "(a)") "Plplot Fortran Warning: plsmem: first dimension of plotmem is not 3"
1481 endif
1482
1483 ! Since not defined in redacted form, we at least check that
1484 ! maxx, and maxy are consistent with the second and third dimensions of plotmem.
1485 if( maxx /= size(plotmem,2) .or. maxy /= size(plotmem,3) ) then
1486 write(error_unit, "(a)") "Plplot Fortran Warning: plsmem: maxx and/or maxy not &
1487 &consistent with second and third plotmem dimensions"
1488 endif
1489 call interface_plsmem( int(maxx,kind=private_plint), int(maxy,kind=private_plint), c_loc(plotmem))
1490 end subroutine plsmem_impl
1491
1492 ! Probably would be better to define this in redacted form, but it is not documented that
1493 ! way, and the python interface also does not use redacted form. So leave it for now.
1494 ! I (AWI) followed advice in <http://stackoverflow.com/questions/10755896/fortran-how-to-store-value-255-into-one-byte>
1495 ! for the type statement for plotmem
1496 subroutine plsmema_impl( maxx, maxy, plotmem )
1497 integer, intent(in) :: maxx, maxy
1498 character(kind=c_char), dimension(:, :, :), target, intent(in) :: plotmem
1499 interface
1500 subroutine interface_plsmema( maxx, maxy, plotmem ) bind( c, name = 'c_plsmema' )
1501 import :: c_ptr
1502 import :: private_plint
1503 implicit none
1504 integer(kind=private_plint), value, intent(in) :: maxx, maxy
1505 type(c_ptr), value, intent(in) :: plotmem
1506 end subroutine interface_plsmema
1507 end interface
1508
1509 ! We need a first dimension of 4 to have space for RGBa
1510 if( 4 /= size(plotmem,1) ) then
1511 write(error_unit, "(a)") "Plplot Fortran Warning: plsmema: first dimension of plotmem is not 4"
1512 endif
1513
1514 ! Since not defined in redacted form, we at least check that
1515 ! maxx, and maxy are consistent with the second and third dimensions of plotmem.
1516 if( maxx /= size(plotmem,2) .or. maxy /= size(plotmem,3) ) then
1517 write(error_unit, "(a)") "Plplot Fortran Warning: plsmema: maxx and/or maxy not &
1518 &consistent with second and third plotmem dimensions"
1519 endif
1520 call interface_plsmema( int(maxx,kind=private_plint), int(maxy,kind=private_plint), c_loc(plotmem))
1521 end subroutine plsmema_impl
1522
1523 subroutine plsori_impl( rot )
1524 integer, intent(in) :: rot
1525 interface
1526 subroutine interface_plsori( rot ) bind( c, name = 'c_plsori' )
1527 import :: private_plint
1528 implicit none
1529 integer(kind=private_plint), value, intent(in) :: rot
1530 end subroutine interface_plsori
1531 end interface
1532
1533 call interface_plsori( int(rot,kind=private_plint) )
1534 end subroutine plsori_impl
1535
1536 subroutine plspal0_impl( filename )
1537 character(len=*), intent(in) :: filename
1538
1539 interface
1540 subroutine interface_plspal0( filename ) bind(c,name='c_plspal0')
1541 implicit none
1542 character(len=1), dimension(*), intent(in) :: filename
1543 end subroutine interface_plspal0
1544 end interface
1545
1546 call interface_plspal0( trim(filename)//c_null_char )
1547
1548 end subroutine plspal0_impl
1549
1550 subroutine plspal1_impl( filename, interpolate )
1551 character(len=*), intent(in) :: filename
1552 logical, intent(in) :: interpolate
1553
1554 interface
1555 subroutine interface_plspal1( filename, interpolate ) bind(c,name='c_plspal1')
1556 import :: private_plbool
1557 implicit none
1558 integer(kind=private_plbool), value, intent(in) :: interpolate
1559 character(len=1), dimension(*), intent(in) :: filename
1560 end subroutine interface_plspal1
1561 end interface
1562
1563 call interface_plspal1( trim(filename)//c_null_char, int( merge(1,0,interpolate),kind=private_plbool) )
1564
1565 end subroutine plspal1_impl
1566
1567 subroutine plspause_impl( pause )
1568 logical, intent(in) :: pause
1569
1570 interface
1571 subroutine interface_plspause( pause ) bind(c,name='c_plspause')
1572 import :: private_plbool
1573 implicit none
1574 integer(kind=private_plbool), value, intent(in) :: pause
1575 end subroutine interface_plspause
1576 end interface
1577
1578 call interface_plspause( int( merge(1,0,pause),kind=private_plbool) )
1579 end subroutine plspause_impl
1580
1581 subroutine plsstrm_impl( strm )
1582 integer, intent(in) :: strm
1583 interface
1584 subroutine interface_plsstrm( strm ) bind( c, name = 'c_plsstrm' )
1585 import :: private_plint
1586 implicit none
1587 integer(kind=private_plint), value, intent(in) :: strm
1588 end subroutine interface_plsstrm
1589 end interface
1590
1591 call interface_plsstrm( int(strm,kind=private_plint) )
1592 end subroutine plsstrm_impl
1593
1594 subroutine plssub_impl( nx, ny )
1595 integer, intent(in) :: nx, ny
1596 interface
1597 subroutine interface_plssub( nx, ny ) bind( c, name = 'c_plssub' )
1598 import :: private_plint
1599 implicit none
1600 integer(kind=private_plint), value, intent(in) :: nx, ny
1601 end subroutine interface_plssub
1602 end interface
1603
1604 call interface_plssub( int(nx,kind=private_plint), int(ny,kind=private_plint) )
1605 end subroutine plssub_impl
1606
1607 subroutine plstar_impl( nx, ny )
1608 integer, intent(in) :: nx, ny
1609 interface
1610 subroutine interface_plstar( nx, ny ) bind( c, name = 'c_plstar' )
1611 import :: private_plint
1612 implicit none
1613 integer(kind=private_plint), value, intent(in) :: nx, ny
1614 end subroutine interface_plstar
1615 end interface
1616
1617 call interface_plstar( int(nx,kind=private_plint), int(ny,kind=private_plint) )
1618 end subroutine plstar_impl
1619
1620 subroutine plstart_impl( devname, nx, ny )
1621 integer, intent(in) :: nx, ny
1622 character(len=*), intent(in) :: devname
1623 interface
1624 subroutine interface_plstart( devname, nx, ny ) bind( c, name = 'c_plstart' )
1625 import :: private_plint
1626 implicit none
1627 integer(kind=private_plint), value, intent(in) :: nx, ny
1628 character(len=1), dimension(*), intent(in) :: devname
1629 end subroutine interface_plstart
1630 end interface
1631
1632 call interface_plstart( trim(devname)//c_null_char, int(nx,kind=private_plint), int(ny,kind=private_plint) )
1633 end subroutine plstart_impl
1634
1635 subroutine plstripd_impl( id )
1636 integer, intent(in) :: id
1637 interface
1638 subroutine interface_plstripd( id ) bind( c, name = 'c_plstripd' )
1639 import :: private_plint
1640 implicit none
1641 integer(kind=private_plint), value, intent(in) :: id
1642 end subroutine interface_plstripd
1643 end interface
1644
1645 call interface_plstripd( int(id,kind=private_plint) )
1646 end subroutine plstripd_impl
1647
1648 subroutine plstyl_impl( mark, space )
1649 integer, dimension(:), intent(in) :: mark, space
1650
1651 integer(kind=private_plint) :: n_local
1652
1653 interface
1654 subroutine interface_plstyl( n, mark, space ) bind( c, name = 'c_plstyl' )
1655 import :: private_plint
1656 implicit none
1657 integer(kind=private_plint), value, intent(in) :: n
1658 integer(kind=private_plint), dimension(*), intent(in) :: mark, space
1659 end subroutine interface_plstyl
1660 end interface
1661
1662 n_local = size(mark,kind=private_plint)
1663 if( n_local /= size(space, kind=private_plint) ) then
1664 write(error_unit, "(a)") "Plplot Fortran Warning: plstyl: inconsistent sizes for mark and space"
1665 end if
1666
1667 call interface_plstyl( n_local, int(mark,kind=private_plint), int(space,kind=private_plint) )
1668 end subroutine plstyl_impl
1669
1670 ! double- and single-precision variants defined in the plplot_double and plplot_single modules.
1671 subroutine plsvect_none( fill )
1672 logical, optional, intent(in) :: fill
1673
1674 interface
1675 subroutine interface_plsvect_null() bind(c,name='plsvect_null')
1676 end subroutine interface_plsvect_null
1677 end interface
1678
1679 ! Note: simple construct to avoid compiler message about unused argument
1680 if ( present(fill) ) then
1681 call interface_plsvect_null
1682 else
1683 call interface_plsvect_null
1684 endif
1685 end subroutine plsvect_none
1686
1687 subroutine plsxax_impl( digmax, digits )
1688 integer, intent(in) :: digmax, digits
1689 interface
1690 subroutine interface_plsxax( digmax, digits ) bind( c, name = 'c_plsxax' )
1691 import :: private_plint
1692 implicit none
1693 integer(kind=private_plint), value, intent(in) :: digmax, digits
1694 end subroutine interface_plsxax
1695 end interface
1696
1697 call interface_plsxax( int(digmax,kind=private_plint), int(digits,kind=private_plint) )
1698 end subroutine plsxax_impl
1699
1700 subroutine plsyax_impl( digmax, digits )
1701 integer, intent(in) :: digmax, digits
1702 interface
1703 subroutine interface_plsyax( digmax, digits ) bind( c, name = 'c_plsyax' )
1704 import :: private_plint
1705 implicit none
1706 integer(kind=private_plint), value, intent(in) :: digmax, digits
1707 end subroutine interface_plsyax
1708 end interface
1709
1710 call interface_plsyax( int(digmax,kind=private_plint), int(digits,kind=private_plint) )
1711 end subroutine plsyax_impl
1712
1713 subroutine plszax_impl( digmax, digits )
1714 integer, intent(in) :: digmax, digits
1715 interface
1716 subroutine interface_plszax( digmax, digits ) bind( c, name = 'c_plszax' )
1717 import :: private_plint
1718 implicit none
1719 integer(kind=private_plint), value, intent(in) :: digmax, digits
1720 end subroutine interface_plszax
1721 end interface
1722
1723 call interface_plszax( int(digmax,kind=private_plint), int(digits,kind=private_plint) )
1724 end subroutine plszax_impl
1725
1726 subroutine pltext_impl()
1727 interface
1728 subroutine interface_pltext() bind(c,name='c_pltext')
1729 end subroutine interface_pltext
1730 end interface
1731 call interface_pltext()
1732 end subroutine pltext_impl
1733
1734 subroutine pltimefmt_impl( fmt )
1735 character(len=*), intent(in) :: fmt
1736
1737 interface
1738 subroutine interface_pltimefmt( fmt ) bind(c,name='c_pltimefmt')
1739 implicit none
1740 character(len=1), dimension(*), intent(in) :: fmt
1741 end subroutine interface_pltimefmt
1742 end interface
1743
1744 call interface_pltimefmt( trim(fmt)//c_null_char )
1745
1746 end subroutine pltimefmt_impl
1747
1748 subroutine plvsta_impl()
1749 interface
1750 subroutine interface_plvsta() bind(c,name='c_plvsta')
1751 end subroutine interface_plvsta
1752 end interface
1753 call interface_plvsta()
1754 end subroutine plvsta_impl
1755
1756 subroutine plxormod_impl( mode, status )
1757 logical, intent(in) :: mode
1758 logical, intent(out) :: status
1759
1760 integer(kind=private_plbool) :: status_out
1761
1762 interface
1763 subroutine interface_plxormod( mode, status ) bind(c,name='c_plxormod')
1764 import :: private_plbool
1765 implicit none
1766 integer(kind=private_plbool), value, intent(in) :: mode
1767 integer(kind=private_plbool), intent(out) :: status
1768 end subroutine interface_plxormod
1769 end interface
1770
1771 call interface_plxormod( int( merge(1,0,mode),kind=private_plbool), status_out )
1772 status = status_out /= 0_private_plbool
1773
1774 end subroutine plxormod_impl
1775
1776end module plplot
subroutine character_array_to_c(cstring_array, cstring_address, character_array)
integer function max_cstring_length(cstring_address_array)
subroutine copystring2f(fstring, cstring)
integer function c_to_character_array(character_array, cstring_address_array)
integer, parameter private_plunicode
integer, parameter private_double
integer, parameter private_plbool
integer, parameter private_plint
integer, parameter private_single
Definition plplot.d:2
subroutine, private plmkstrm_impl(strm)
Definition plplot.f90:1035
integer(kind=private_plint), parameter, private maxlen
Definition plplot.f90:48
subroutine, private plsfam_impl(fam, num, bmax)
Definition plplot.f90:1407
subroutine, private plgxax_impl(digmax, digits)
Definition plplot.f90:946
subroutine, private plclear_impl()
Definition plplot.f90:518
subroutine, private plgfam_impl(fam, num, bmax)
Definition plplot.f90:817
integer function, private plget_arguments_dynamic(argv)
Definition plplot.f90:708
subroutine, private plspause_impl(pause)
Definition plplot.f90:1568
subroutine, private plsdev_impl(devname)
Definition plplot.f90:1335
subroutine, private plfont_impl(font)
Definition plplot.f90:594
subroutine, private plgfont_impl(family, style, weight)
Definition plplot.f90:869
subroutine, private plprec_impl(setp, prec)
Definition plplot.f90:1175
subroutine, private plsvect_none(fill)
Definition plplot.f90:1672
subroutine, private plspal0_impl(filename)
Definition plplot.f90:1537
subroutine, private plssub_impl(nx, ny)
Definition plplot.f90:1595
subroutine, private pltext_impl()
Definition plplot.f90:1727
subroutine, private plgver_impl(ver)
Definition plplot.f90:930
subroutine, private plstar_impl(nx, ny)
Definition plplot.f90:1608
subroutine, private plscolor_impl(color)
Definition plplot.f90:1309
subroutine, private plszax_impl(digmax, digits)
Definition plplot.f90:1714
subroutine, private plgstrm_impl(strm)
Definition plplot.f90:913
subroutine, private plgra_impl()
Definition plplot.f90:905
subroutine, private plgcolbg_impl(r, g, b)
Definition plplot.f90:641
subroutine, private plsmema_impl(maxx, maxy, plotmem)
Definition plplot.f90:1497
subroutine, private pladv_impl(sub)
Definition plplot.f90:497
subroutine, private plinit_impl()
Definition plplot.f90:1000
subroutine, private plscmap0n_impl(n)
Definition plplot.f90:1232
subroutine, private plglevel_impl(level)
Definition plplot.f90:888
subroutine, private plend_impl()
Definition plplot.f90:562
subroutine, private plpsty_impl(patt)
Definition plplot.f90:1188
subroutine, private pllab_impl(xlab, ylab, title)
Definition plplot.f90:1008
subroutine, private plseed_impl(s)
Definition plplot.f90:1362
subroutine, private plflush_impl()
Definition plplot.f90:586
subroutine, private plend1_impl()
Definition plplot.f90:554
subroutine, private plsfci_impl(fci)
Definition plplot.f90:1420
subroutine, private plsyax_impl(digmax, digits)
Definition plplot.f90:1701
subroutine, private plscol0_impl(icol, r, g, b)
Definition plplot.f90:1281
subroutine, private plgyax_impl(digmax, digits)
Definition plplot.f90:964
subroutine, private plscolbg_impl(r, g, b)
Definition plplot.f90:1295
subroutine, private plstart_impl(devname, nx, ny)
Definition plplot.f90:1621
subroutine, private plstripd_impl(id)
Definition plplot.f90:1636
subroutine, private plgfnam_impl(fnam)
Definition plplot.f90:853
subroutine, private plgdev_impl(dev)
Definition plplot.f90:677
subroutine, private plpat_impl(inc, del)
Definition plplot.f90:1152
subroutine, private plxormod_impl(mode, status)
Definition plplot.f90:1757
subroutine, private plsstrm_impl(strm)
Definition plplot.f90:1582
subroutine, private pltimefmt_impl(fmt)
Definition plplot.f90:1735
subroutine, private plscmap0_impl(r, g, b)
Definition plplot.f90:1209
subroutine, private plcpstrm_impl(iplsr, flags)
Definition plplot.f90:539
subroutine, private plreplot_impl()
Definition plplot.f90:1201
subroutine, private plsfnam_impl(fnam)
Definition plplot.f90:1435
subroutine, private plsesc_impl(esc)
Definition plplot.f90:1376
subroutine, private plsxax_impl(digmax, digits)
Definition plplot.f90:1688
subroutine, private plsdrawmode_impl(mode)
Definition plplot.f90:1349
integer, parameter pl_test_flt
Definition plplot.f90:47
integer function, private plgdrawmode_impl()
Definition plplot.f90:693
subroutine, private plscmap1_impl(r, g, b)
Definition plplot.f90:1245
subroutine, private plgzax_impl(digmax, digits)
Definition plplot.f90:982
subroutine, private plgcol0_impl(icol, r, g, b)
Definition plplot.f90:620
subroutine, private plvsta_impl()
Definition plplot.f90:1749
integer function, private plparseopts_dynamic(argv, mode)
Definition plplot.f90:1048
subroutine, private pllsty_impl(lin)
Definition plplot.f90:1022
subroutine, private plsori_impl(rot)
Definition plplot.f90:1524
subroutine, private plspal1_impl(filename, interpolate)
Definition plplot.f90:1551
character(len=1), parameter pl_end_of_string
Definition plplot.f90:49
integer function, private plget_arguments_static_length(argv, disambiguate)
Definition plplot.f90:739
subroutine, private plscmap1n_impl(n)
Definition plplot.f90:1268
subroutine, private pl_setcontlabelformat_impl(lexp, sigdig)
Definition plplot.f90:483
subroutine, private plbop_impl()
Definition plplot.f90:510
subroutine, private plcol0_impl(icol)
Definition plplot.f90:526
subroutine, private plfamadv_impl()
Definition plplot.f90:578
subroutine, private plgfci_impl(fci)
Definition plplot.f90:836
subroutine, private plsmem_impl(maxx, maxy, plotmem)
Definition plplot.f90:1466
integer function, private plget_arguments_static(nargv, argv)
Definition plplot.f90:777
subroutine, private plfontld_impl(charset)
Definition plplot.f90:607
integer function, private plsetopt_impl(opt, optarg)
Definition plplot.f90:1389
subroutine, private pleop_impl()
Definition plplot.f90:570
subroutine, private plsfont_impl(family, style, weight)
Definition plplot.f90:1449
integer function, private plparseopts_static(nargv, argv, mode)
Definition plplot.f90:1100
integer function, private plparseopts_static_length(argv, mode, disambiguate)
Definition plplot.f90:1072
integer function, private plparseopts_brief(mode)
Definition plplot.f90:1127
subroutine, private plscompression_impl(compression)
Definition plplot.f90:1322
integer, parameter plflt
Definition plplot.f90:42
subroutine, private plgcompression_impl(compression)
Definition plplot.f90:660
subroutine, private plstyl_impl(mark, space)
Definition plplot.f90:1649
#define max(x, y)
Definition nnpi.c:88