forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

invalid character, no implicit type, unclassifiable statemen

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
riogurky



Joined: 01 Jun 2017
Posts: 7

PostPosted: Thu Jun 01, 2017 6:19 pm    Post subject: invalid character, no implicit type, unclassifiable statemen Reply with quote

*------------------------------------------------------------------------------*
*
C Driver program
*
IMPLICIT NONE
*
C Declaration of variables:
*
INTEGER ITEST, CELLS, N, NFREQ, NTMAXI
*
REAL CFLCOE, DOMLEN, DT, TIME, TIMEOUT, TIMETO
*
COMMON / DATAIN/ CFLCOE, DOMLEN, ITEST, CELLS,
& NFREQ, NTMAXI, TIMEOUT
COMMON /DELTAT/ DT
*
DATA TIMETO /1.0E-07/
*
C Parameters of problem are read in form
C file "b1god.ini"
*
CALL READER
*
C initial conditions are set up
*
CALL INITIA(DOMLEN, ITEST, CELLS)
*
WRITE(6,*)'---------------------------------------------------------------'
WRITE(6,*)' Time step N TIME TIMEOUT'
WRITE(6,*)'---------------------------------------------------------------'
*
C Time marching procedure
*
TIME = 0.0
*
DO 10 N = 1, NTMAXI
*
C Boundary conditions are set
*
CALL BCONDI(CELLS)
*
C Courant-Friedrichs-Lewy (CFL) condition imposed
*
CALL CFLCON(CFLCOE, CELLS, TIME, TIMEOUT)
*
TIME = TIME + DT
*
C Intercell numerical fluxes are computed
*
CALL FLUXES(CELLS)
*
C Solution is updated according to
c conservative formula
*
CALL UPDATE(CELLS)
*
IF(MOD(N,NFREQ).EQ.0)WRITE(6,20)N, TIME
*
C Check output time
*
IF(ABS(TIME - TIMEOUT).LE.TIMETO)THEN
*
C Solution is written to "numer.out? at
C specified time TIMEOUT
*
CALL OUTPUT(CELLS)
*
WRITE(6,*)'---------------------------------------------------------'
WRITE(6,*)' Number of time steps = ',N
*
STOP
ENDIF
*
10 CONTINUE
*
20 FORMAT(I12,6X, F12.7)
*
END
*
*------------------------------------------------------------------------------*
*
SUBROUTINE READER
*
C Purpose: to read initial parameters of the problem
*
IMPLICIT NONE
*
C Declaration of variables
*
INTEGER ITEST, CELLS, NFREQ, NTMAXI
*
REAL CFLCOE, DOMLEN, TIMEOUT
*
COMMON /DATAIN/ CFLCOE, DOMLEN, ITEST, CELLS, NFREQ,
& NTMAXI, TIMEOUT
*
OPEN(UNIT = 1,FILE = 'b1god.ini',STATUS = 'UNKNOWN')
*
READ(1,*)CFLCOE ! Courant number coefficient
READ(1,*)DOMLEN ! Domain length
READ(1,*)ITEST ! Test problem
READ(1,*)CELLS ! Number of cells in domain
READ(1,*)NFREQ ! Output frequency to screen
READ(1,*)NTMAXI ! Maximum number of time steps
READ(1,*)TIMEOUT ! Output time
*
CLOSE(1)
*
WRITE(6,*)'--------------------------------'
WRITE(6,*)'Data read in is echoed to screen'
WRITE(6,*)'--------------------------------'
WRITE(6,*)'CFLCOE = ',CFLCOE
WRITE(6,*)'DOMLEN = ',DOMLEN
WRITE(6,*)'ITEST = ',ITEST
WRITE(6,*)'CELLS = ',CELLS
WRITE(6,*)'NFREQ = ',NFREQ
WRITE(6,*)'NTMAXI = ',NTMAXI
WRITE(6,*)'TIMEOUT = ',TIMEOUT
WRITE(6,*)'--------------------------------'
*
RETURN
END
*
*------------------------------------------------------------------------------*
*
SUBROUTINE INITI(DOMLEN, ITEST, CELLS)
*
C Purpose: to set initial conditions for solution U
C and initialise other variables. There are
C two choices of initial conditions,
C determined by ITEST
*
C Local variables:
*
C Name Description
* ==== ===========
*
C DX Spatial mesh size
C I Variable in do loop
C ITEST Defines test problem
C FLUX Array for intercell fluxes
C U Array for numerical solution
C XPOS Position along x-axis
C XLEFT Left diaphragm
C XMIDDL Middle diaphragm
C XRIGHT Right diaphragm
*
IMPLICIT NONE
*
C Declaration of variables
*
INTEGER I,
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 732

PostPosted: Thu Jun 01, 2017 7:33 pm    Post subject: Reply with quote

Posting long source codes in-line in this forum does not work.

There is a limit on the size of a post, which your code exceeded. As you can see, there is a missing portion of your code at the end.

If you post code without [code]...[/code] markers, leading blanks in the code get stripped, leaving the code in a state unfit to be compiled.

It is best to upload the code in a Zip file to a cloud storage site such as Dropbox, make the file accessible to the public, and post a link to the file here.

I suspect that the problem with your code is that it has some lines that exceed 72 in length, but let's hold off the diagnosis until we see an uncorrupted file.
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 1772
Location: Sydney

PostPosted: Fri Jun 02, 2017 2:16 am    Post subject: Reply with quote

I'd recommend that you don't use unit 1 to open a file as this can conflict with the screen input/output. I'd suggest you use unit 11.
Also unit 6 is not the file unit for the screen with FTN95 (it is with some other compilers)

With FTN95, either use the following to a file opened on unit 6
WRITE(6,*)'---------------------------------------------------------'
WRITE(6,*)' Number of time steps = ',N

or use the following if you want to write to the screen
WRITE(*,*)'---------------------------------------------------------'
WRITE(*,*)' Number of time steps = ',N

As a general rule, I only open a file with a unit number > 10

It is difficult to tell if you are using free or fixed format code layout, as you appear to be mixing both.
Free format can be preferable for new code, so either change:
*
C Time marching procedure
*

to

!*
!C Time marching procedure
!*

or use the fixed format code layout restrictions for
* comments starting with C or * in column 1 only
* statement numbers are in columns 1 to 5
* continuation in column 6 and
* code in columns 7 to 72

free format is much easier !!
Back to top
View user's profile Send private message
riogurky



Joined: 01 Jun 2017
Posts: 7

PostPosted: Fri Jun 02, 2017 3:36 am    Post subject: link complete file Reply with quote

I attach link for this complete file

https://www.dropbox.com/s/5v8m0qo29kcxzts/Dropbox.zip?dl=0

I hope someone can fix it, i have tried so much time but always error
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 732

PostPosted: Fri Jun 02, 2017 4:09 am    Post subject: Reply with quote

There are many lines in the source file (which is contained in the Zip file) that do not obey the rules of fixed format Fortran source. Specifically, many lines begin before column 7. A few lines contains Format strings that continue beyond column 72. Either shorten these or use the /WI compiler option.

Line 395 in Subroutine FLUXES appears to be corrupted:
Code:
DO 10 I =@0, CELLS

Replacing this line by
Code:
DO 10 I=1,CELLS

and reformatting the source code to make statements conform to fixed format rules allowed the file to be compiled and linked.
Back to top
View user's profile Send private message
riogurky



Joined: 01 Jun 2017
Posts: 7

PostPosted: Fri Jun 02, 2017 4:57 am    Post subject: There is manual reference but still error Reply with quote

Actually I have follow this program from reference book but also so many error.

If any one can fix it I will appreciate

This the link for book reference and program file
https://www.dropbox.com/s/v0xtavw3wdde493/Dropbox%20%281%29.zip?dl=0
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 4913
Location: Salford, UK

PostPosted: Fri Jun 02, 2017 6:55 am    Post subject: Reply with quote

If it is fixed format (old) Fortran code then you should save it in a file with the extension .for or use /FIXED on the FTN95 command line.
Back to top
View user's profile Send private message
riogurky



Joined: 01 Jun 2017
Posts: 7

PostPosted: Fri Jun 02, 2017 6:59 am    Post subject: Error while compiling Reply with quote

Can you give an example?

I typed this program online in this link
https://www.tutorialspoint.com/compile_fortran_online.php
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 1772
Location: Sydney

PostPosted: Fri Jun 02, 2017 10:04 am    Post subject: Reply with quote

sorry,

there is no way I will look at a .php file That I don't know about
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 732

PostPosted: Fri Jun 02, 2017 1:52 pm    Post subject: Reply with quote

Riogurky:

I think that you are attempting to do something that is beyond the reach of your capabilities. CFD is an application area that requires a high level of education, mathematical ability and experience. I recognize that you are attempting to learn by running some codes from a textbook, but you are unlikely to succeed at this point in time.

The second Zip file that you linked to contains (i) a copy of the buggy source code and (ii) a PDF document on how to use Dropbox!

The link to Tutorialspoint takes one to the entry page of a Cloud site for compiling and running short programs using Gfortran, and is irrelevant to what you are trying to do if you have a Windows PC and have FTN95 installed on it.

Please spend some time educating yourself regarding Fortran and Fortran programming on Windows. It is far wiser to do that instead of lurching about in the dark and asking others to fix the buggy code for you.
Back to top
View user's profile Send private message
riogurky



Joined: 01 Jun 2017
Posts: 7

PostPosted: Fri Jun 02, 2017 2:10 pm    Post subject: Reply with quote

I am sorry mecej4, actually the reference link is:
https://www.dropbox.com/s/vheugh95762qp3g/Fortran%20program%20for%20Gudunov%20Method.pdf?dl=0

I learn and curious about that, thank you so much.
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 558

PostPosted: Sun Jun 04, 2017 3:08 am    Post subject: Reply with quote

all this Gudunv sounds a bit dodgy .... but if it's Gudunov for you, it's good enough for me like this Wink
https://www.youtube.com/watch?v=kt3vZYkMB5I
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group