Silverfrost Forums

Welcome to our forums

Native %pl

7 Dec 2016 7:56 #18521

I can't see major changes in the new DLLs respect to the last ones (I mean about new controls)...yes, now we have circles and discs, but.....my problem with tick labels reported before (i.e. their dependence on the x data range) are still present. And as far as I understand, you still cannot change the dx or max values in the x and y axes each time you change the data set to plot......or am I wrong?.....in the meantime, I am replacing the old functions with the new ones, and will see what happens, but I just wanted to share my first thoughts....

Agustin

8 Dec 2016 7:38 #18522

Agustin

Here is a list of things that you can change after the %pl control has been formed...

'x_min', 'x_max','y_min','y_max','dx','dy','colour', 'pen_style','symbol','link','x_data','y_data'.

I have not attempted to provide major and minor tick marks.

Thank you for your help in giving a user's perspective for this development. We now have a native %pl that ports almost all of the existing ClearWin+ interface to SIMPLEPLOT as well as providing some useful additional features.

32 bit SIMPLEPLOT provides an extensive library of functions that can be accessed from 32 bit ClearWin+ via the [user_drawn] option. All of this lies outside of the scope of the present exercise.

8 Dec 2016 1:33 #18523

well, this is not what I find.....in my program I put

ans=CHANGE_PLOT_DBL@(0, 'dx', 1, 10.0)
ans=CHANGE_PLOT_DBL@(0, 'x_max', 1, xmax)
ans=CHANGE_PLOT_DBL@(0, 'x_min', 1, xmin)
ans=CHANGE_PLOT_DBL@(0, 'y_max', 1, ymax)
ans=CHANGE_PLOT_DBL@(0, 'x_data', 1, data_x1)
ans=CHANGE_PLOT_DBL@(0, 'y_data', 1, data_y1)
ans=CHANGE_PLOT_INT@(0, 'colour', 1, RGB@(0,0,255))
ans=CHANGE_PLOT_INT@(0, 'link', 1, 2)
ans=CHANGE_PLOT_INT@(0, 'symbol', 1, 0)
ans=CHANGE_PLOT_INT@(0, 'pen_style', 1, 0)
CALL simpleplot_redraw@()

and the program crashes....the debugger stops at the last statement saying 'invalid floating point operation'

This is why I said that I did not find major changes.....but as I also said...I should be wrong.....but I do not understand what I am doing wrong here...

Agustin

8 Dec 2016 2:20 #18524

Agustin

These functions return an integer value so is ans INTEGER*4?

Failing this, have you updated clrwin.mod etc.?

8 Dec 2016 2:49 #18525

yes, ans is integer*4 (the same I use in ans=winio@....in my program), and I have updated all the files you provided in the zip file......so I have no clue about where is the problem....

Agustin

8 Dec 2016 4:25 #18526

Agustin

Can you send me your code again.

8 Dec 2016 5:23 #18527

I have just sent a zip file to your email address.

Agustin

8 Dec 2016 7:00 #18528

Agustin

Have you tried using /checkmate? There seems to be a problem with the input data.

8 Dec 2016 7:03 #18529

Quoted from PaulLaidler Agustin

I have not attempted to provide major and minor tick marks.

This is actually a minor issue, so no problem

32 bit SIMPLEPLOT provides an extensive library of functions that can be accessed from 32 bit ClearWin+ via the [user_drawn] option. All of this lies outside of the scope of the present exercise.

At this stage of %pl, I would say that for 2D plots we have almos all we need. Simpleplot offers some additional features that are nice but not esential for plotting 2D data.

The only feature that still lacks Clearwin is the option of changing the axes captions during the run of a program. I do not know if you forgot this during the last development of %pl or you find that it is at this stage out of the scope and therefore, we don't have to expect anything about this in the near future.

Agustin

8 Dec 2016 7:08 #18530

Quoted from PaulLaidler Agustin

Have you tried using /checkmate? There seems to be a problem with the input data.

No, I didn't. But I think that you have also observed that there was no problem with the input data when we used the previous version of DLL.....anyway, I will check this....

Agustin

8 Dec 2016 7:25 #18531

yes!, something strange happens now.....when you are in the Function Select_Data in my program and calls the read_data subroutine, everything is fine. At the end of this subroutine, the input data is collected in the arrays exp_x and exp_y without problems...but....when you leave this subroutine and comes back to the Function, exp_x and exp_y are undefined!!!!, even the names of the files show strange symbols instead of the usual letters!....I do not understand what is going on......(see what happens between lines 27 and 29 in Modulo_funciones)

Agustin

8 Dec 2016 7:32 #18532

seems that the problem has been solved.....the initial statements of the module were

Module funciones
use datos
USE clrwin 

contains

integer function select_data()
use datos

I commented the first 'use datos' below 'Module' and now everything runs fine.....I do not understand why the repetition of this statemente introduced such problem

I am still checking the program....thanks Paul

Agustin[/code]

8 Dec 2016 7:42 #18533

Nop!.....the program runs fine......only if I avoid things like:

ans=CHANGE_PLOT_DBL@(0, 'dx', 1, 10.0)

see lines 170-180 in my code of Modulo_Funciones.....

Agustin

4 Jan 2017 11:57 #18658

So the last statement which calls %pl must be i=winio@('%pl...) or call winop@('%pl...') ? If first one then what specifically doing winop@ and why it was created? Was it not possible to do all that with winio@ ?

5 Jan 2017 12:38 #18659

should be winio@('%pl......') as this creates the graphics window, the other ones just insert 'options' that define previously some properties or characteristics of the final window.

Agustin

5 Jan 2017 5:13 (Edited: 5 Jan 2017 7:52) #18661

Seems to me both work...But work differently then in 32bits. winop@ can not be imbedded into existing window. Plus I can not port older %pl code, permanently get problems of wrong scale, not enough arguments to satisfy format, floating point overflow at address ffffffc900011101110101010ffff in KERNELBASE.DLL etc. Only one case so far was working... out of 100 😦

By the way, do simplest example (supplied with the built 17) work if you change style from LINEAR to LOG or LOG_LINEAR, LINEAR_LOG?

      WINAPP
      INCLUDE <clearwin.ins>
      INTEGER N,i
      PARAMETER(N=10)
      REAL*8 x(N),y(N)
      DO i=1,N
        x(i)=0.1d0*(i)
        y(i)=x(i)*x(i)
      ENDDO
      i=winio@('%ca[Quadratic]%pv&')
      i=winio@('%`bg[white]&')        !background colour
      CALL winop@('%pl[title=Graph]') !graph title
      CALL winop@('%pl[width=2]')     !pen width
      CALL winop@('%pl[y_max=0.9]')   !maximum y value on axis
      CALL winop@('%pl[x_array]')     !x data is provided as an array
      CALL winop@('%pl[scale=LOG_LOG]') 
!     CALL winop@('%pl[scale=LINEAR]') 
      CALL winop@('%pl[link=curves]') !join data points with curves
      CALL winop@('%pl[symbol=9]')    !mark data points with filled rhombuses
      CALL winop@('%pl[colour=red]')  !pen colour
      CALL winop@('%pl[pen_style=2]') !2=PS_DOT
      i=winio@('%pl&',400,250,N,x,y)
      i=winio@('%sf%ff%nl%cn%tt[OK]')
      END
5 Jan 2017 7:49 #18662

[scale=linear] is the default so if you want linear then just comment out the line that sets the scale.

5 Jan 2017 7:53 #18663

Actually I need much more all other combinations. Do they work ?

5 Jan 2017 8:07 #18665

At the moment everything works for me. Which bit is not working for you?

5 Jan 2017 6:00 #18666

Does this code above work? It complains about scale and does not work.

Other users' respond appreciated as Paul's version of compiler could be further advanced and I suspect that here is no syntax error. My DLLs are dated Dec 7

UPDATE OK, I found the bug. The 64bit version seems does not understand upper case STYLE=LOG_LOG or STYLE=LOG_LINEAR and needs them in lower case.

Paul will mark this while we made one more small step forward.

It is absurd amount of time to lose if you are early adopter. But if Silverfrost had large base of Examples which I'm advocating to extend for two decades (I learned this compiler on existing examples mostly done for FTN77) and automatic compiler validation on these examples this bug would be found in no time...

Now new problems. Please run this code which will read this data file A.DAT. X range in the data is between 12 and 22. Y from 0.13 to 26

Run it with scale=log_log, scale=linear_log and scale=linear.

Is everything OK?

file A.DAT

 1.20408E+01, 8.00000E+00
 1.21958E+01, 8.55172E+00
 1.23589E+01, 1.11724E+01
 1.52626E+01, 1.44828E+01
 1.59070E+01, 1.29655E+01
 1.62659E+01, 1.22759E+01
 1.63719E+01, 1.16414E+01
 1.94388E+01, 2.62069E+01
 1.94470E+01, 2.16782E+01
 2.19592E+01, 1.37931E-01
 2.19674E+01, 3.67816E-01

Fortran source: 

USE clrwin 
integer, parameter :: n_dim = 1153
real*8 xstart, X(n_dim), Y(n_dim) 

OPEN (UNIT=275,FILE='A.dat',STATUS='old',err=990)
do i=1,10000
  if(i.gt.n_dim) goto 100
  read(275,*,err=995,end=100) X(i), Y(i) 
enddo
100 close(275) 
n_points=i-1
xstart=0 ! X(1)
	
      i=winio@('%ww[no_border]%es%ca[Default Plot]%pv&') 
      i=winio@('%fn[Tahoma]&') 
      i=winio@('%ts&', 3.1d0) 
      i=winio@('%tc&',rgb@(0,0,0)) 
      i=winio@('%bf&') 
      i=winio@('%`bg&',rgb@(250,255,255)) 
      CALL winop@('%pl[SCALE=log_log]')  
      CALL winop@('%pl[x_array]')  
      CALL winop@('%pl[n_graphs=1]')   
      CALL winop@('%pl[title='Sample plot']') 
      CALL winop@('%pl[x_axis=Wavelength A]') 
      CALL winop@('%pl[y_axis=Intensity@(4.0)]') 
      CALL winop@('%pl[width=3]') 
      CALL winop@('%pl[Y_max=200.]') 
      CALL winop@('%pl[smoothing=4]') ! anti-aliasing 
      CALL winop@('%pl[colour=black]')    
      CALL winop@('%pl[style=0,pen_style=0]')    

      i=winio@('%pl',1502,880,n_points,x,y) 


goto 10000

!................. errors ......................
990 Print*, 'Error opening file A.dat for read'
goto 10000
995 Print*, 'Error reading file A.dat'
goto 10000
 
10000 continue
end
Please login to reply.