Home > Archive > Fortran > September 2006 > problem with fweb
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| slava.petrov 2006-09-23, 4:00 am |
| Dear collegues!
I am new in Fortran and literate programming. I try to use fweb and
have problems with this tool. Please tell me, what I do wrong.
There are the files and error messages (file test.web is from the
manual).
================[cat test.web ]==========================
@n/
\Title{example.web}
@* INTRODUCTION
This code is intrnded to illustrate the use of the |write| statement.
@m A_CONSTANT 1.2345
@a
program main
call compute
end
@ The computational routine
@a
subroutine compute
write(*,*) 'Macro value = ', A_CONSTANT
end
@* \INDEX
==================[ ftangle test.web ]======================
This is FTANGLE [UNIX version 1.62 (September 23, 1998)].
(No test.aux file.)
Reading test.web... *1 *3
Writing the output file(s): (test.f)
Done.
[FTANGLE: No errors were found.]
=====================[ cat test.f ]========================
C FTANGLE v1.61,
C created with UNIX on "Friday, September 25, 1998 at 8:02."
C COMMAND LINE: "ftangle test.web"
C RUN TIME: "Saturday, September 23, 2006 at 10:10."
C WEB FILE: "test.web"
C CHANGE FILE: (none)
C* 1: *
*line 12 "test.web"
program main
call compute
end
C* :1 *
C* 2: *
*line 19 "test.web"
subroutine compute
write(*,*)'Macro value = ',1.2345
end
C* :2 *
====================[ g77 test.f ]============================
test.f:8:
C* 1: *
12
Unrecognized statement name at (1) and invalid form for assignment
or statement-function definition at (2)
========================================
==================
WBR, Slava Petrov
| |
| Dr Ivan D. Reid 2006-09-23, 8:01 am |
| On 23 Sep 2006 00:21:25 -0700, slava.petrov <slava.petrov@gmail.com>
wrote in <1158996085.283600.113590@k70g2000cwa.googlegroups.com>:
> Dear collegues!
>
> I am new in Fortran and literate programming. I try to use fweb and
> have problems with this tool. Please tell me, what I do wrong.
> There are the files and error messages (file test.web is from the
> manual).
>=====================[ cat test.f ]========================
> C FTANGLE v1.61,
> C created with UNIX on "Friday, September 25, 1998 at 8:02."
> C COMMAND LINE: "ftangle test.web"
> C RUN TIME: "Saturday, September 23, 2006 at 10:10."
> C WEB FILE: "test.web"
> C CHANGE FILE: (none)
> C* 1: *
^^^^^^^^
>====================[ g77 test.f ]============================
> test.f:8:
> C* 1: *
> 12
> Unrecognized statement name at (1) and invalid form for assignment
> or statement-function definition at (2)
> ========================================
==================
The problem is that what should have been a comment starting in
column 1 has been shifted to column 6 so the compiler is trying to
interpret it as an executable statement. Unfortunately I have zero
experience with fweb, so I have no idea how the comment became malformed.
Possibly check your source for unintended white-space (blanks or tabs)
on an otherwise blank line?
--
Ivan Reid, Electronic & Computer Engineering, ___ CMS Collaboration,
Brunel University. Ivan.Reid@[brunel.ac.uk|cern.ch] Room 40-1-B12, CERN
KotPT -- "for stupidity above and beyond the call of duty".
| |
| George N. White III 2006-09-23, 8:01 am |
| On Sat, 23 Sep 2006, slava.petrov wrote:
> Dear collegues!
>
> I am new in Fortran and literate programming. I try to use fweb and
> have problems with this tool. Please tell me, what I do wrong.
>
> There are the files and error messages (file test.web is from the
> manual).
> [...]
> ====================[ g77 test.f ]============================
> test.f:8:
> C* 1: *
> 12
> Unrecognized statement name at (1) and invalid form for assignment
> or statement-function definition at (2)
> ========================================
==================
My version has the same bug. There should be a patch floating around
in some usenet or mail archive, but I didn't find it. As a workaround you
can use '-#::' to remove the line number comments or write a small (sed)
script to fix the .f files.
--
George N. White III <aa056@chebucto.ns.ca>
| |
| slava.petrov 2006-09-26, 4:01 am |
| George N. White III wrote:
>
> My version has the same bug. There should be a patch floating around
> in some usenet or mail archive, but I didn't find it. As a workaround you
> can use '-#::' to remove the line number comments or write a small (sed)
> script to fix the .f files.
Thanks George. I'm not alone with my trouble :-) I will try sed to
correct this.
WBR, Slava Petrov.
| |
| George N. White III 2006-09-28, 7:00 pm |
| On Tue, 25 Sep 2006, slava.petrov wrote:
> Thanks George. I'm not alone with my trouble :-) I will try sed to
> correct this.
It doesn't trouble me, as I use f90 free-format for new code, and don't
need line numbers for working code. After responding to your post I found
the following in the READ_ME-1.6x file on the ftp site:
* In Fortran codes, ftangle incorrectly indents the first module comment.
Temporary fix: Use either of `-Tv' or `-#'.
--
George N. White III <aa056@chebucto.ns.ca>
|
|
|
|
|