View previous topic :: View next topic |
Author |
Message |
pierre
Joined: 04 Feb 2007 Posts: 24
|
Posted: Tue Feb 06, 2007 2:44 pm Post subject: Simpleplot |
|
|
I am new in using FTN95 and I would like to know how to "call" simpleplot (isn't it: use spmodule ?).
I have downladed the documentation and copy/paste some of the example given.
Plato 3 tells me: C:\Documents and Settings\collinet\Bureau\FreeFormat1.F95(2) : error 404 -
Cannot find definition for MODULE SPMODULE
How do I do ? (I am conscious it is perhaps a stupid question) (I am under windows XP)
Thank you in advance ! |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8211 Location: Salford, UK
|
Posted: Tue Feb 06, 2007 6:40 pm Post subject: |
|
|
There is an example in "Direct calls to SIMPLEPLOT" in ftn95.chm.
Which documentation and sample are you using? |
|
Back to top |
|
 |
pierre
Joined: 04 Feb 2007 Posts: 24
|
Posted: Wed Feb 07, 2007 12:08 am Post subject: |
|
|
I was looking in Fsimpleplot.chm
Now I am using this documentation, and find what you are talking about (thank you ).
Just one question:
What is that for (Direct calls to SIMPLEPLOT program):
c--The start-up callback
INTEGER FUNCTION StartCB()
INCLUDE 'CLEARWIN.INS'
And again thanks (FTN95 is the only fortran compiler with IDE I manage to make working on my computer ) |
|
Back to top |
|
 |
pierre
Joined: 04 Feb 2007 Posts: 24
|
Posted: Wed Feb 07, 2007 5:16 am Post subject: |
|
|
I do not manage to plot curve.
Here is the beginning of my program:
PROGRAM HW2
WINAPP
IMPLICIT NONE
INTEGER N,K,winio@,l
PARAMETER (N=145)
Then I create my data X,Y1,Y2,Y3
and I write:
l=winio@('%pl[X_AXIS=pouet,Y_AXIS=error,SCALE=LINEAR_LOG,TITLE="Sample",
& N_GRAPHS=3,COLOUR=red,COLOUR=blue,COLOUR=blue,X_ARRAY]',300,300,N,X,Y1,Y2,Y3)
The & is here because the line is too long.
I get the answer:
"error 70 - Unterminated character constant" for the ligne l=winio@('%pl......
(I just want to plot three Y1 Y2 Y3 curves with logarithmic scale for x ) |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8211 Location: Salford, UK
|
Posted: Wed Feb 07, 2007 10:57 am Post subject: |
|
|
Are you using free format Fortran? It is better if you do.
In free format your line can be quite long.
I you want to break the line you must follow the rules which probably means putting an ampersand at the end of the first line as well in this context.
When breaking character variables it is safer to use concatenation...
string = 'abcd' &
& //'efgh'
The double quoted "Sample" within a single quote is a potential problem but should be OK here. |
|
Back to top |
|
 |
pierre
Joined: 04 Feb 2007 Posts: 24
|
Posted: Wed Feb 07, 2007 3:51 pm Post subject: |
|
|
Thank you.
I have a another (last I hope) problem:
My program is on simple/double precision. But winio@ does not accept single precision array.
How do I make it plot my single precision array. I try to use DBLE but it doesn't seem to have any effect. Should I:
Declare DX, DY, DZ as double array X,Y,Z as simple array and then do
DX=DBLE(X)
or declare X as a simple arry and then do:
X=DBLE(X) ?
thanks a lot in advance |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8211 Location: Salford, UK
|
Posted: Wed Feb 07, 2007 5:45 pm Post subject: |
|
|
I would try DX=DBLE(X) but test it to make sure that all the elements are copied across. |
|
Back to top |
|
 |
pierre
Joined: 04 Feb 2007 Posts: 24
|
Posted: Wed Feb 07, 2007 6:19 pm Post subject: |
|
|
It works but when I do it
1.000000*10^-16 becomes 1.000000012345678*10^-16
But since it is at the end and just for plotting ...... |
|
Back to top |
|
 |
johannes
Joined: 21 Jan 2011 Posts: 65 Location: Leimen, Germany
|
Posted: Wed Apr 13, 2011 6:00 pm Post subject: CLWIN_SP |
|
|
I tried to compile the clearwin-Simpleplot testprogram CLWIN_SP, found in Ftn95UserGuide.doc ("Using SimplePlot with FTN95") from BUSS 2001.
Compilation brought some error messages, which are bit too exotic for me. Did that example work somewhen at all? What could I do to get it work? I used just ftn95 without any special options.
These is the compiler output:
PROCESSING MODULE [<SPWIN> FTN95/Win32 v5.50.0]
NO ERRORS [<SPWIN> FTN95/Win32 v5.50.0]
NO ERRORS [<CLWIN_SP> FTN95/Win32 v5.50.0]
0061) TYPE(SIMPLE_WINDOWS_DATA_STRUCT_T), DIMENSION(2) :: OpCodes
*** Derived type SIMPLE_WINDOWS_DATA_STRUCT_T has not been declared
*** SIMPLE_WINDOWS_DATA_STRUCT_T is not a derived-TYPE name
0064) OpCodes(1)%iOpc = SIMPLE_WINDOWS_SET_HDC_DIM ! hDC + dimensions
*** The '%' operator can only be applied to objects which are a derived type
*** The '%' operator can only be applied to objects which are a derived type
0065) OpCodes(1)%iPtr = LOC(HDC_DIM) ! See definition of SPWIN above
*** The '%' operator can only be applied to objects which are a derived type
*** The '%' operator can only be applied to objects which are a derived type
0066) OpCodes(2)%iOpc = SIMPLE_WINDOWS_END_LIST! End of list
*** The '%' operator can only be applied to objects which are a derived type
*** The '%' operator can only be applied to objects which are a derived type
8 ERRORS [<SP_SUPPLYBITMAP> FTN95/Win32 v5.50.0]
NO ERRORS [<TSTFUN> FTN95/Win32 v5.50.0]
NO ERRORS [<DRAWCONTL> FTN95/Win32 v5.50.0]
NO ERRORS [<DRAWCONTS> FTN95/Win32 v5.50.0]
NO ERRORS [<DRAWSURFL> FTN95/Win32 v5.50.0]
NO ERRORS [<DRAWSURFS> FTN95/Win32 v5.50.0]
NO ERRORS [<UPDATEWIN> FTN95/Win32 v5.50.0]
NO ERRORS [<SETATTRIBUTES> FTN95/Win32 v5.50.0]
*** Compilation failed |
|
Back to top |
|
 |
aebolzan
Joined: 06 Jul 2007 Posts: 229 Location: La Plata, Argentina
|
Posted: Mon Apr 18, 2011 4:00 pm Post subject: |
|
|
I guess you need this module:
Code: |
MODULE SPWIN ! Contains definition of values to pass to DDDATA
INTEGER,PARAMETER :: SIMPLE_WINDOWS_WINDOW=1,SIMPLE_WINDOWS_PRINTER=2, &
&SIMPLE_WINDOWS_DIB=4,SIMPLE_WINDOWS_METAFILE=8,SIMPLE_PERCENT=0,SIMPLE_PIXELS=1,SIMPLE_MM=2
TYPE SIMPLE_WINDOWS_DATA_STRUCT_T
INTEGER :: iOpc ! Corresponds to C++ long int
INTEGER :: iPtr ! Address of OpCode specific data
END TYPE SIMPLE_WINDOWS_DATA_STRUCT_T
TYPE SIMPLE_WINDOWS_HDC_DATA_T
INTEGER :: hDC ! device context handle
INTEGER :: iWidth, iHeight ! plotting area
END TYPE SIMPLE_WINDOWS_HDC_DATA_T
TYPE SIMPLE_WINDOWS_SIZE_T
INTEGER :: iUnits ! SIMPLE_PERCENT, ..._PIXELS, ..._MM
INTEGER :: iWidth, iHeight, iDepth
END TYPE SIMPLE_WINDOWS_SIZE_T
TYPE SIMPLE_WINDOWS_ORIGIN_T
INTEGER :: iUnits ! SIMPLE_PERCENT, ..._PIXELS, ..._MM
INTEGER :: iX, iY
END TYPE SIMPLE_WINDOWS_ORIGIN_T
TYPE HDC_DIM_TYPE
INTEGER*4 iBitmapDC, iWidth, iHeight
END TYPE HDC_DIM_TYPE
TYPE (HDC_DIM_TYPE) :: HDC_DIM
INTEGER, PARAMETER :: SIMPLE_WINDOWS_END_LIST = 0
INTEGER, PARAMETER :: SIMPLE_WINDOWS_SET_WINDOWNAME = 6
INTEGER, PARAMETER :: SIMPLE_WINDOWS_SET_HDC_DIM = 7
! Useful definition of data structure to hold BitmapDC to pass to SIMPLEPLOT
Contains
SUBROUTINE SP_SupplyBitmap ! Pass Bitmap to SIMPLEPLOT
! Set up a Static (SAVEd) array of OpCodes. Each OpCode consists of an
! OpCode ID followed by an optional address of a data structure.
! The parameter block address is passed to SIMPLEPLOT by SUBROUTINE DDDATA.
!
! In this example:
! SIMPLE_WINDOWS_SET_HDC_DIM specifies that the next integer is the address
! of a data structure consisting of a Bitmap DC followed by its dimensions
! SIMPLE_WINDOWS_END_LIST is the mandatory end of list item which does not
! require the address of a structure
TYPE(SIMPLE_WINDOWS_DATA_STRUCT_T), DIMENSION(2) :: OpCodes
SAVE OpCodes
OpCodes(1)%iOpc = SIMPLE_WINDOWS_SET_HDC_DIM ! hDC + dimensions
OpCodes(1)%iPtr = LOC(HDC_DIM) ! See definition of SPWIN above
OpCodes(2)%iOpc = SIMPLE_WINDOWS_END_LIST! End of list
CALL DDDATA(LOC(OpCodes))! Notify SIMPLEPLOT
CALL DEVNAM('WINDOW') ! Select Window
CALL OWNNEW(.TRUE.) ! Inhibit 'Continue' button
END subroutine SP_SupplyBitmap
SUBROUTINE UpdateWin
CALL OUTBUF ! Flush buffers
CALL WINDOW_UPDATE@(HDC_DIM%iBitmapDC) ! Copy Bitmap to window
END subroutine UpdateWin
END MODULE SPWIN
|
you need this when you call Simpleplot routines to plot something in a %dw window like:
Code: | ans = winio@('%dw&',HDC_DIM%iBitmapDC) ! Pass bitmapDC to ClearWin |
Agustin |
|
Back to top |
|
 |
|