Fortran Syntax Error In Write Statement
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business
Syntax Error In Argument List Fortran
Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation syntax error in data declaration at 1 fortran Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just
Unterminated Character Constant
like you, helping each other. Join them; it only takes a minute: Sign up Fortran Error Meanings up vote 2 down vote favorite I have been following books and PDFs on writing in FORTRAN to write an fortran unclassifiable statement integration program. I compile the code with gfortran and get several copies of the following errors. 1)Unexpected data declaration statement at (1) 2)Unterminated character constant beginning at (1) 3)Unclassifiable statement at (1) 4)Unexpected STATEMENT FUNCTION statement at (1) 5)Expecting END PROGRAM statement at (1) 6)Syntax error in data declaration at (1) 7)Statement function at (1) is recursive 8)Unexpected IMPLICIT NONE statement at (1) I do not know hat they truly mean or how to fix fortran unterminated character constant them, google search has proven null and the other topics on this site we about other errors. for Error 5) i put in Program main and end program main like i might in C++ but still got the same result. Error 7) makes no sense, i am trying for recursion in the program. Error 8) i read implicit none was to prevent unnecessary decelerations. Ill post the code itself but i am more interested in the compiling errors because i still need to fine tune the array data handling, but i cant do that until i get it working. Program main implicit none real, dimension(:,:), allocatable :: m, oldm real a integer io, nn character(30) :: filename real, dimension(:,:), allocatable :: alt, temp, nue, oxy integer locationa, locationt, locationn, locationo, i integer nend real dz, z, integral real alti, tempi, nuei, oxyi integer y, j allocate( m(0, 0) ) ! size zero to start with? nn = 0 j = 0 write(*,*) 'Enter input file name: ' read(*,*) filename open( 1, file = filename ) do !reading in data file read(1, *, iostat = io) a if (io < 0 ) exit nn = nn + 1 allocate( oldm( size(m), size(m) ) ) oldm = m deallocate( m ) allocate( m(nn, nn) ) m = oldm m(nn, nn) = a ! The
[x] User account creation filtered due to spam. Bug27613 - compile fails with "Unclassifiable statement" error message Summary: compile fails with "Unclassifiable statement" error
Unclassifiable Statement At (1)
message Status: RESOLVED FIXED Alias: None Product: gcc Classification: Unclassified Component: fortran fortran unexpected data declaration statement (show other bugs) Version: 4.1.0 Importance: P3 normal Target Milestone: --- Assignee: Paul Thomas URL: Keywords: rejects-valid Depends on:
Fortran Line Length
Blocks: Reported: 2006-05-15 01:09 UTC by Nicolas Bock Modified: 2009-05-26 09:38 UTC (History) CC List: 4 users (show) gcc-bugs paul.richard.thomas theresa.adelt tobi See Also: Host: Target: Build: Known to work: http://stackoverflow.com/questions/13354510/fortran-error-meanings Known to fail: 4.2.0 Last reconfirmed: 2006-05-15 16:09:05 Attachments Patch for the problem (448 bytes, patch) 2006-05-15 13:59 UTC, Paul Thomas Details | Diff View All Add an attachment (proposed patch, testcase, etc.) Note You need to log in before you can comment on or make changes to this bug. Description Nicolas Bock 2006-05-15 01:09:48 UTC The following code fails to compile with https://gcc.gnu.org/bugzilla/show_bug.cgi?id=27613 the error message: In file test.f90:14 stuff = stuff+stuff(n+1) 1 Error: Unclassifiable statement at (1) The program test.f90: program test integer :: stuff write(*, *) "called stuff ", stuff(1), " times" end program test recursive function stuff(n) integer :: stuff integer :: n stuff = 1 if(n < 5) then stuff = stuff+stuff(n+1) endif end function stuff Comment 1 Nicolas Bock 2006-05-15 01:14:39 UTC I would like to add the output of $ gfortran -v -save-temps test.f90 Driving: gfortran -v -save-temps test.f90 -lgfortranbegin -lgfortran -shared-libgcc Using built-in specs. Target: powerpc-apple-darwin8.6.0 Configured with: ../gcc-4.1.0/configure --prefix=/usr/local/gcc-4.1.0 --with-gmp=/sw --with-mpfr=/sw --enable-languages=c,fortran --disable-libssp : (reconfigured) ../gcc-4.1.0/configure --prefix=/usr/local/gcc-4.1.0 --with-gmp=/sw --with-mpfr=/sw --enable-languages=c,fortran --disable-multilib Thread model: posix gcc version 4.1.0 /usr/local/gcc-4.1.0/libexec/gcc/powerpc-apple-darwin8.6.0/4.1.0/f951 test.f90 -fPIC -quiet -dumpbase test.f90 -auxbase test -version -o test.s GNU F95 version 4.1.0 (powerpc-apple-darwin8.6.0) compiled by GNU C version 4.0.0 (Apple Computer, Inc. build 5026). GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 In file test.f90:14 stuff = stuff+stuff(n+1) 1 Error: Unclassifiable statement at (1) Comment 2 Paul Thomas 2006-05-15 06:42:19 UTC A temporary workaround is: program test integer :: stuff write(*, *) "called stuff ", stuff(1), " times" end program test recursive f
principle of programming You won't learn how to program without doing it. Take the time to not only do your homework, but also to type in examples http://www.personal.psu.edu/jhm/f90/lectures/5.html of all programming constructs to check your understanding of their behavior. The best way to learn a language construct is to: Read about it in these notes or your text; Form an idea of how the construct works;. Write a brief program that tests your idea; Check to see if the program results match your expectations; and If unexpected results occur, syntax error modify your understanding of the construct and try another test, or get help from another programmer. Creating and Modifying Programs My current (6/2013) recommendation is to create programs within Microsoft Visual Studio. The editor is very good and linkage to a compiler like Intel Fortran and use of the Visual Studio debugger makes this the best development environment that I've found. For syntax error in those looking for a free alternative jEdit is an excellent choice for an editor to develop source code and the Code::Blocks development environment is also worth at look. Compiling Your Program The CPU of a computer hasn't a clue what to do with Fortran instructions in a text file. You must convert the contents of the Fortran text file to an executable file containing machine instructions recognized by the CPU. Note that the content and range of machine instructions varies wildly from one brand of computer CPU to another. Instructions recognized by an Intel chip will not be recognized by a Sun SPARC chip. One of the beauties of languages like Fortran, is that they are largely independent of the computer on which they are applied. Each machine has its own special program, called a compiler, that translates the Fortran program into the appropriate set of its own machine instructions. If you can afford it, Intel Fortran is a good choice, as are Absoft, Lahey and Portland compilers. For those in need of something free take a look and GFortran or g