if else in fortran code example
Example 1: fortran if statement
if(condition)then
! do this if condition is true
endif
Example 2: fortran elseif statement
if(condition1)then
! do this if condition1 is true
else if(condition2)then
! else do this if condition2 is ture
endif
Example 3: fortrna if statement
if(conditional)then
! Do something
elseif(conditional)then
! Do something else
else
! Otherwise do this
endif