Computer Old Farts Forum
 help / color / mirror / Atom feed
* [COFF] Fortran Question for Unix System-V r3
@ 2023-03-26 14:00 KenUnix
  2023-03-26 15:04 ` [COFF] " Paul Winalski
  0 siblings, 1 reply; 2+ messages in thread
From: KenUnix @ 2023-03-26 14:00 UTC (permalink / raw)
  To: COFF

[-- Attachment #1: Type: text/plain, Size: 1976 bytes --]

Fortran question for Unix System-5 r3.

When executing fortran programs requiring input the screen will
show a blank screen. After entering input anyway the program completes
under Unix System V *r3*.

When the same program is compiled under Unix System V *r1* it
works as expected.

Sounds like on Unix System V *r3* the output buffer is not being flushed.
I tried re-compiling F77. No help.

Fortran code follows:
      PROGRAM EASTER
      INTEGER YEAR,METCYC,CENTRY,ERROR1,ERROR2,DAY
      INTEGER EPACT,LUNA
C A PROGRAM TO CALCULATE THE DATE OF EASTER
      PRINT '(A)',' INPUT THE YEAR FOR WHICH EASTER'
      PRINT '(A)',' IS TO BE CALCULATED'
      PRINT '(A)',' ENTER THE WHOLE YEAR, E.G. 1978 '
      READ '(A)',YEAR
C CALCULATING THE YEAR IN THE 19 YEAR METONIC CYCLE-METCYC
      METCYC = MOD(YEAR,19)+1
      IF(YEAR.LE.1582)THEN
        DAY = (5*YEAR)/4
        EPACT = MOD(11*METCYC-4,30)+1
      ELSE
C CALCULATING THE CENTURY-CENTRY
      CENTRY = (YEAR/100)+1
C ACCOUNTING FOR ARITHMETIC INACCURACIES
C IGNORES LEAP YEARS ETC.
        ERROR1 = (3*CENTRY/4)-12
        ERROR2 = ((8*CENTRY+5)/25)-5
C LOCATING SUNDAY
        DAY = (5*YEAR/4)-ERROR1-10
C LOCATING THE EPACT(FULL MOON)
        EPACT = MOD(11*METCYC+20+ERROR2-ERROR1,30)
        IF(EPACT.LT.0)EPACT=30+EPACT
        IF((EPACT.EQ.25.AND.METCYC.GT.11).OR.EPACT.EQ.24)THEN
          EPACT=EPACT+1
        ENDIF
      ENDIF
C FINDING THE FULL MOON
      LUNA=44-EPACT
      IF(LUNA.LT.21)THEN
        LUNA=LUNA+30
      ENDIF
C LOCATING EASTER SUNDAY
      LUNA=LUNA+7-(MOD(DAY+LUNA,7))
C LOCATING THE CORRECT MONTH
      IF(LUNA.GT.31)THEN
        LUNA = LUNA - 31
        PRINT '(A)',' FOR THE YEAR ',YEAR
        PRINT '(A)',' EASTER FALLS ON APRIL ',LUNA
      ELSE
        PRINT '(A)',' FOR THE YEAR ',YEAR
        PRINT '(A)',' EASTER FALLS ON MARCH ',LUNA
      ENDIF
      END

Any help would be appreciated,
Ken

-- 
WWL 📚

[-- Attachment #2: Type: text/html, Size: 2743 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [COFF] Re: Fortran Question for Unix System-V r3
  2023-03-26 14:00 [COFF] Fortran Question for Unix System-V r3 KenUnix
@ 2023-03-26 15:04 ` Paul Winalski
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Winalski @ 2023-03-26 15:04 UTC (permalink / raw)
  To: KenUnix; +Cc: COFF

On 3/26/23, KenUnix <ken.unix.guy@gmail.com> wrote:
> Fortran question for Unix System-5 r3.
>
> When executing fortran programs requiring input the screen will
> show a blank screen. After entering input anyway the program completes
> under Unix System V *r3*.
>
> When the same program is compiled under Unix System V *r1* it
> works as expected.
>
> Sounds like on Unix System V *r3* the output buffer is not being flushed.
> I tried re-compiling F77. No help.

Re-compiling F77 doesn't help because the bug is in the Fortran
run-time library (RTL), not in the compiler.  The routine that
implements the READ statement should be flushing the write buffer
before doing the actual read.  Clearly it isn't.

Their test system probably didn't have very many (if any) tests for
interactive behavior.  That sort of thing is difficult to automate.

-Paul W.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-26 15:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-26 14:00 [COFF] Fortran Question for Unix System-V r3 KenUnix
2023-03-26 15:04 ` [COFF] " Paul Winalski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).