Good day,(adsbygoogle = window.adsbygoogle || []).push({});

I'm working with a FORTRAN program that has the line:

EDEN=EDEN+(STVS**2)/(N(J)-1)

I would like to check if N(J)-1 is equal to zero. If so make N(J)-1=1.0

The following doesn't work:

IF ((N(J)-1).EQ.0.0) THEN

N(J)-1=1.0

END IF

I'm using gfortran and am getting unclassified statement at 1. The 1 is pointing to the beginning of the line N(J)-1=1.0

**Physics Forums - The Fusion of Science and Community**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Arithmetic Issue in FORTRAN

Loading...

Similar Threads - Arithmetic Issue FORTRAN | Date |
---|---|

C/++/# Is my code suffering from an arithmetic error? | Feb 25, 2017 |

Insights Why Can't My Computer Do Simple Arithmetic? - Comments | Jan 29, 2016 |

Arithmetic Issue in FORTRAN | Oct 17, 2015 |

Which is faster? reading from memory or arithmetic? | Apr 10, 2015 |

The advantage of modular arithmetic, e.g. cyclic groups? | Nov 17, 2014 |

**Physics Forums - The Fusion of Science and Community**