Skip to content

Commit

Permalink
Merge pull request #8 from sakamoti/master
Browse files Browse the repository at this point in the history
Bugfix about issues #7 to address several kind parameters
  • Loading branch information
kookma authored Sep 8, 2020
2 parents 4c8b099 + 97dd16d commit 7e58a92
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion demo.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1474,7 +1474,7 @@ subroutine exmp108
call gp%options('unset tics') ! turn off axes values (tics)
call gp%options('set view map') ! set viewpoint top down
! plot using linespec
call gp%surf(x,y,z,lspec='w lp ps 2 pt 6 lc ""')
call gp%surf(x,y,z,lspec='w lp ps 2 pt 6 lc "#99aa33')

end subroutine exmp108

Expand Down
14 changes: 10 additions & 4 deletions ogpf.f90
Original file line number Diff line number Diff line change
Expand Up @@ -352,12 +352,13 @@ subroutine set_options(this,stropt)
class(gpf):: this
character(len=*), intent(in) :: stropt

if(.not.allocated(this%txtoptions))this%txtoptions=''
if (len_trim(this%txtoptions) == 0 ) then
this%txtoptions = '' ! initialize string
end if
if ( len_trim(stropt)>0 ) then
this%txtoptions = this%txtoptions // splitstr(stropt)
end if
end if

this%hasoptions=.true.

Expand Down Expand Up @@ -550,6 +551,10 @@ subroutine set_label(this, lblname, lbltext, lblcolor, font_size, font_name, rot

if (present(font_name)) then
label%lblfontname = font_name
else
if(.not.allocated(label%lblfontname))then
label%lblfontname = ''
endif
end if

if (present(font_size)) then
Expand Down Expand Up @@ -1598,6 +1603,7 @@ subroutine addscript(this,strcmd)
class(gpf) :: this
character(len=*), intent(in) :: strcmd

if (.not.allocated(this%txtscript)) this%txtscript=''
if (len_trim(this%txtscript) == 0 ) then
this%txtscript = '' ! initialize string
end if
Expand Down Expand Up @@ -2320,7 +2326,7 @@ function num2str_i4(number_in)
! num2str_int: converts integer number to string
!..............................................................................

integer(kind=4), intent(in) :: number_in
integer(kind=kind(1)), intent(in) :: number_in
character(len=:), allocatable :: num2str_i4

! local variable
Expand All @@ -2336,7 +2342,7 @@ function num2str_r4(number_in, strfmt)
! strfmt is the optional format string
!..............................................................................

real(kind=4), intent(in) :: number_in
real(kind=sp), intent(in) :: number_in
character(len=*), intent(in), optional :: strfmt
character(len=:), allocatable :: num2str_r4

Expand All @@ -2361,7 +2367,7 @@ function num2str_r8(number_in, strfmt)
! strfmt is the optional format string
!..............................................................................

real(kind=8), intent(in) :: number_in
real(kind=dp), intent(in) :: number_in
character(len=*), intent(in), optional :: strfmt
character(len=:), allocatable :: num2str_r8

Expand Down

1 comment on commit 7e58a92

@kookma
Copy link
Owner Author

@kookma kookma commented on 7e58a92 Sep 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @sakamoti

Please sign in to comment.