FORTRAN: Invalid form for an assignment
- by Sam Goodness
I can't get this code to compile uding either the g77 minGW compiler or the g95 compiler. Does anyone know why?
I get these errors with the g77:
diff5z10.for: In subroutine `diffract':
diff5z10.for:579:
Tropo100 = 20.34 - .077 * Dist
^
Invalid form for assignment statement at (^)
diff5z10.for:581:
IF (Freq .GT. 1000) FreqAdj = 24.5 - 7200/(Freq+3000)
^
Invalid form for assignment statement at (^)
and i get these errors when compiling with g95:
In file diff5z10.for:574
CLUTTER = steep*CLUTTER
1
Error: Unclassifiable statement at (1)
In file diff5z10.for:580
FreqAdj = 23.978 - 58026.76 / (Freq + 2320)
1
Error: Unclassifiable statement at (1)
here is the code from this section of the program:
(starting with line 362)
Span = .28 - .144 * (Round - 1.2)
Para = C / Span**2
IF (Ratio .GT. .4) Para = 6.25 * (C - 1)
CLUTTER = Para * (RATIO - .4)**2 - C
IF (CLUTTER .GT. 0.) CLUTTER = 0.
CSlope = SQRT(freq)/350
steep = 1 + CSlope * (dist - Horizon)
IF (steep .LT. 0) steep = 0
IF (steep .GT. 1) steep = 1
CLUTTER = steep*CLUTTER
Tropo100 = 20.34 - .077 * Dist
FreqAdj = 23.978 - 58026.76 / (Freq + 2320)
IF (Freq .GT. 1000) FreqAdj = 24.5 - 7200/(Freq+3000)
TropoFd = Tropo100 - FreqAdj
FS_field = 106.9 - 20 * LOG10(Dist)
Scatter = TropoFd - FS_field !loss ref to free space
DiffL = Scatter - DLOSS
Combine = 150/(20 - DiffL) - 5
IF (DiffL .LT. -10) Combine = 0
IF (DiffL .GT. 10) Combine = DiffL
DLOSS = DLOSS + Combine
RETURN
END