Wow - I don't even know what "old-style ADAM/SSE routine prologues" are!
David
On 3 October 2014 03:41, Tim Jenness <[log in to unmask]> wrote:
> I wonder if PROCVT works for people? If I try it on one of the CMP files in
> the HDS directory:
>
> % procvt cmp_len.f
> ...
>
> !! FIO__INVRG, Invalid argument to FORTRAN Run-Time Library
>
> ! Error reading file cmp_len.f on Fortran unit 43 - Conflicting statement
>
> ! options [gfortran].
>
> ! PROCVT: Error converting "old-style" ADAM/SSE prologues to STARLSE
> format.
>
> ! Application exit status FIO__INVRG, Invalid argument to FORTRAN Run-Time
>
> ! Library
>
> ! cmp_len.f
>
>
> and it looks to me that the problem is caused by SST_RDAD2() reading off the
> end of the file but there being no way for SST_RDAD2 to tell procvt.f that
> the file has been completely read. Then at the top of the loop SST_RDAD1()
> has another go at reading from the file and gets random garbage errors.
>
> Something like the following fixes the problem but, Peter, is there
> something better?
>
> diff --git a/applications/sst/procvt.f b/applications/sst/procvt.f
>
> index d7782e3..929b27b 100644
>
> --- a/applications/sst/procvt.f
>
> +++ b/applications/sst/procvt.f
>
> @@ -188,6 +188,7 @@
>
> INTEGER SCRAT ! I/O unit for scratch file
>
> INTEGER TOTPRO ! Total prologues processed
>
> LOGICAL ATASK ! Whether processing ADAM A-tasks
>
> + LOGICAL ALLREAD ! All lines read from file
>
>
>
> *.
>
>
>
> @@ -365,10 +366,12 @@
>
>
>
> * Transfer the remaining part of the input program unit to the output
>
> * file.
>
> - CALL SST_RDAD2( STATUS )
>
> + CALL SST_RDAD2( ALLREAD, STATUS )
>
>
>
> * Return to process the next prologue.
>
> - GO TO 1
>
> + IF ( ( STATUS .EQ. SAI__OK ) .AND. ( .NOT. ALLREAD ) ) THEN
>
> + GO TO 1
>
> + END IF
>
> END IF
>
> IF ( STATUS .NE. SAI__OK ) GO TO 99
>
>
>
> diff --git a/applications/sst/sst_rdad2.f b/applications/sst/sst_rdad2.f
>
> index afdd2e1..b3f9c01 100644
>
> --- a/applications/sst/sst_rdad2.f
>
> +++ b/applications/sst/sst_rdad2.f
>
> @@ -1,4 +1,4 @@
>
> - SUBROUTINE SST_RDAD2( STATUS )
>
> + SUBROUTINE SST_RDAD2( ALLREAD, STATUS )
>
> *+
>
> * Name:
>
> * SST_RDAD2
>
> @@ -11,7 +11,7 @@
>
> * Starlink Fortran 77
>
>
>
> * Invocation:
>
> -* CALL SST_RDAD2( STATUS )
>
> +* CALL SST_RDAD2( ALLREAD, STATUS )
>
>
>
> * Description:
>
> * The routine reads lines from the current input file and transfers
>
> @@ -25,6 +25,8 @@
>
> * file is encountered.
>
>
>
> * Arguments:
>
> +* ALLREAD = _LOGICAL (Returned)
>
> +* True if all lines in the input file have been read.
>
> * STATUS = INTEGER (Given and Returned)
>
> * The global status.
>
>
>
> @@ -68,6 +70,8 @@
>
> * Check for ENDFL as well as EOF
>
> * 14-AUG-2014 (TIMJ):
>
> * Use comment character constant from SST_PAR
>
> +* 2-OCT-2014 (TIMJ):
>
> +* Add ALLREAD argument
>
> * {enter_further_changes_here}
>
>
>
> * Bugs:
>
> @@ -87,6 +91,9 @@
>
> * Global Variables:
>
> INCLUDE 'SST_SCB' ! SST Source Code Buffer
>
>
>
> +* Arguments Returned:
>
> + LOGICAL ALLREAD
>
> +
>
> * Status:
>
> INTEGER STATUS ! Global status
>
>
>
> @@ -113,6 +120,7 @@
>
> PROLOG = .TRUE.
>
> LRECOG = .FALSE.
>
> PREVBL = .TRUE.
>
> + ALLREAD = .FALSE.
>
>
>
> * Loop to read input lines, checking for errors.
>
> CALL ERR_MARK
>
> @@ -268,7 +276,10 @@
>
> * encountered. Annul end-of-file errors.
>
> 99 CONTINUE
>
> IF ( STATUS .EQ. FIO__EOF .OR.
>
> - : STATUS .EQ. FIO__ENDFL ) CALL ERR_ANNUL( STATUS )
>
> + : STATUS .EQ. FIO__ENDFL ) THEN
>
> + ALLREAD = .TRUE.
>
> + CALL ERR_ANNUL( STATUS )
>
> + END IF
>
> CALL ERR_RLSE
>
>
>
> END
>
>
>
> --
> Tim Jennes
>
|