PLplot
5.10.0
|
00001 ! Copyright (C) 2004-2014 Alan W. Irwin 00002 ! 00003 ! This file is part of PLplot. 00004 ! 00005 ! PLplot is free software; you can redistribute it and/or modify 00006 ! it under the terms of the GNU Library General Public License as published 00007 ! by the Free Software Foundation; either version 2 of the License, or 00008 ! (at your option) any later version. 00009 ! 00010 ! PLplot is distributed in the hope that it will be useful, 00011 ! but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 ! GNU Library General Public License for more details. 00014 ! 00015 ! You should have received a copy of the GNU Library General Public License 00016 ! along with PLplot; if not, write to the Free Software 00017 ! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00018 00019 module plplot_strutils 00020 00021 implicit none 00022 00023 contains 00024 00025 !-------------------------------------------------------------------------- 00026 ! plstrf2c() 00027 ! 00028 ! Converts Fortran string to C format 00029 !-------------------------------------------------------------------------- 00030 00031 subroutine plstrf2c(string1, string2) 00032 00033 character(len=*) :: string1, string2 00034 00035 integer :: limit 00036 00037 string2 = string1 00038 ! limit = min(len(string2), len(string1)) 00039 limit = len_trim(string2) 00040 string2(limit+1:limit+1) = char(0) 00041 end subroutine plstrf2c 00042 00043 00044 !-------------------------------------------------------------------------- 00045 ! plstrc2f() 00046 ! 00047 ! Converts C string to Fortran conventions 00048 !-------------------------------------------------------------------------- 00049 00050 subroutine plstrc2f(string1, string2) 00051 00052 character(len=*) :: string1, string2 00053 00054 integer :: limit 00055 00056 string2 = string1 00057 00058 limit = index( string2, achar(0) ) 00059 if ( limit > 0 ) then 00060 string2(limit:) = ' ' 00061 endif 00062 00063 end subroutine plstrc2f 00064 00065 end module plplot_strutils