Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Syntax error : else if ... then

changks888
Beginner
924 Views
Hi,
This is a simple example, but it has the Syntax errors:
error #5082: Syntax error, found IDENTIFIER 'THEN' when expecting one of: * ) :: , ; + . - (/ [ : ] /) ' ** / // > .LT. ...
else if ((doys.gt.131.0 .and. gdd(i).le.120) then

What is wrong in this code? Thank you.

if (doys.le.131.0) then
PhenStage = 1
else if ((doys.gt.131.0 .and. gdd(i).le.120) then
PhenStage = 2
else if ((gdd(i).le.520) then
PhenStage = 3
else if ((gdd(i).le.1670) then
PhenStage = 4
else if ((gdd(i).le.1980) then
PhenStage = 5
else if ((doys.le.301) then
PhenStage = 6
else
PhenStage = 7
endif


0 Kudos
1 Reply
changks888
Beginner
924 Views
solved. one more "(" in the left. sorry, my bad.
0 Kudos
Reply