Problem with User Breakpoint in Fortran
Hello everyone,
I have a small problem with this program. The compiler gives me zero errors and zero warning but when I go to run the .exe from my mistake.
I am not an expert in programming but for these small programs I do, but still can not resolve till this time.
Thanks to whoever can help me!
Re: Problem with User Breakpoint in Fortran
Hello, some advice if you want to increase your chances to be answered:
1) instead of, post code directly, using the appropriate tag "CODE" to do the same.
2) explains in detail what goes wrong and where you think may be the error.
who knows fortran pass and give you a hand, unfortunately I do not know the language.
Re: Problem with User Breakpoint in Fortran
thanks for the advice!
The problem for me is in the functions WRITE, READ and FORMAT because when I open the exe not ask me to enter the values as it should.
This is the code
Code:
REAL RAPX21, LREALE, ANCONT, DANCON, OFFSET, LCALC, DIFFL, DIFFLL, PRODL
REAL EPSIL
LOGICAL Maxter
WRITE (5.1000)
1000 FORMAT ( 'DAMMI RAPX21 E LREALE Report to RADIUS OF WIRE')
READ (5 *) RAPX21, LREALE
WRITE (5.1001)
1001 FORMAT ( 'DEFINE EPSIL')
READ (5 *) EPSIL
OFFSET = 0.00001
Maxter =. FALSE.
ANCONT = ACOS (0.)
DANCON = ANCONT/25
CALL LUNCAL (EPSIL, RAPX21, ANCONT, LCALC, Maxter)
IF (Maxter) GOTO 80
DIFFL = LREALE-LCALC
WRITE (5.1004) LCALC
1004 FORMAT ( 'LCALC =', G10.5)
DIFFLL = DIFFL
IF ((DIFFL ** 2). LT.SCARTO) GOTO 90
10 CONTINUE
ANCONT = ANCONT-DANCON
CALL LUNCAL (EPSIL, RAPX21, ANCONT, LCALC, Maxter)
IF (Maxter) GOTO 80
DIFFL = LREALE-LCALC
WRITE (5.1004) LCALC
IF ((DIFFL ** 2). LT.SCARTO) GOTO 90
PRODL = DIFFL * DIFFLL
IF (PRODL.GT.0) GOTO 10
ANCONT = ANCONT + DANCON
WRITE (5.1003) ANCONT
DANCON = DANCON / 2
GOTO 10
80 CONTINUE
WRITE (5.1002)
1002 FORMAT ( 'EXCEEDED MAX NUMBER OF TERMS')
90 CONTINUE
WRITE (5.1003) ANCONT
1003 FORMAT ( 'CONTACT ANGLE (RAD) =', G10.5)
ACONGR = (90 .* ANCONT) / ACOS (0.)
WRITE (5.1005) ACONGR
1005 FORMAT ( 'CONTACT ANGLE (DEGREES) =', G10.5)
STOP
END
SUBROUTINE LUNCAL (EPSIL, X2SUX1, ANGCON, LUNG, MAXNUM)
REAL X2SUX1, ANGCON, LUNG, LUNG1, LUNG2, ALPHA, SERBS, EPSIL
REAL LLUNG, A, K2, ANGX1, INTEGR, DL
LOGICAL MAXNUM
M = 500
A = ((X2SUX1 * COS (ANGCON)) -1) / (X2SUX1-COS (ANGCON))
K2 = ((X2SUX1 ** 2) - (A ** 2)) / (X2SUX1 ** 2)
ASIN ANGX1 = ((((X2SUX1 ** 2) -1) / (K2 * (X2SUX1 ** 2 )))** 0.5)
LUNG = 2 * ((A + X2SUX1) * ANGX1)
LLUNG = 0.
DO 20 I = 1, M
ALPHA = 0.-0.5
CALL SERBIN (I, ALPHA, SERBS)
LUNG1 = A * SERBS
ALPHA = 0.5
CALL SERBIN (I, ALPHA, SERBS)
LUNG2 * = X2SUX1 SERBS
CALL INT (ANGX1, I INTEGR)
LUNG LUNG = + (2 * ((LUNG1 + LUNG2 )*((- 1) ** I) * (K2 ** I) * INTEGR))
DL = (LLUNG-LUNG) ** 2
IF (DL.LT.EPSIL) GOTO 30
LUNG LLUNG =
20 CONTINUE
MAXNUM =. TRUE.
30 CONTINUE
RETURN
END
SUBROUTINE INT (FIX1, N1, INTE)
REAL INTE, INTO, INT1, FIX1
INTO = FIX1
DO 40 K = 1, N1
INT1 =- ((COS (FIX1) * ((SIN (FIX1 ))**(( 2 * K) -1 )))/( 2 * k)) +
1 ((((2 * K) -1) * INTO) / (2 * K))
INTO = INT1
40 CONTINUE
INTE = INT1
RETURN
END
SUBROUTINE SERBIN (N2, ALFA, Serbia)
REAL ALFA, SERBIA
Serbia = 1
DO 50 L = 1, N2
Serbia * Serbia = ((ALFA-L +1) / L)
50 CONTINUE
RETURN
END
Re: Problem with User Breakpoint in Fortran
the units' 5 does not correspond to any file for what it stops.
you should use something like
open (unit = 5, file = "filename.txt", form = 'formatted', status = 'replace')
You have to learn a little 'I \ O with Fortran, began replacing the 5 with *.
so to me seems to work
> prog.exe
DAMMI RAPX21 E LREALE Report to RADIUS OF THE WIRE
.5
.9
DEFINE EPSIL
.01
EXCEEDED MAX NUMBER OF TERMS
CONTACT ANGLE (RAD) = 1.5708
CONTACT ANGLE (DEGREES) = 90000