Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use real(x, kind=wp) instead of dble(x) #45

Open
Beliavsky opened this issue Jul 20, 2023 · 1 comment
Open

use real(x, kind=wp) instead of dble(x) #45

Beliavsky opened this issue Jul 20, 2023 · 1 comment

Comments

@Beliavsky
Copy link

In the subroutine below it is better to write

x=real([-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8], kind=wp)

instead of

x=dble([-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8])

for flexibility.

    subroutine exmp01

        type(gpf):: gp
        integer, parameter:: n=17
        real(wp):: x(n)
        real(wp):: y(n)
        ! Input data
  !      x=dble([-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8])
        x=dble([-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8])

        x= abs(x) + 5

        y=dble([66,51,38,27,18,11,6,3,2,3,6,11,18,27,38,51,66])

        ! Annotation: set title, xlabel, ylabel
        call gp%title('Example 1. A simple xy plot','#990011')
        call gp%xlabel('my x axis ...','#99aa33',font_name="Tahoma")
       ! call gp%ylabel('my y axis ...')
        call gp%options('set border lc "#99aa33"; set ylabel "my label..." tc "#99aa33"')

        call gp%options('set logscale y2')
        call gp%plot(x, y)

    end subroutine exmp01

The program does not compile if wp = sp in ogpf.f90.

@kookma
Copy link
Owner

kookma commented Jul 22, 2023

much appreciated. Do you have time to submit a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants