It looks like you are getting an invalide floating point exception at line 4076 in the isofwd.f routine according to the following statements in your error message:
Looking at the github repository for version 5.2.1, it looks like this line of code contains a square root caculation. Perhaps ‘DD’ a negative value, and trying to take the square root of a negative value caused the invalid floating point error.
I am not familiar with the ISORROPIA code in CMAQv5.2.1 versus what is available in the current release CMAQv5.3.2. Is there a reason you are using this older version?
Floating-point arithmetic has inherent round-off error. So in the case of the quadratic formula for equations having a “double” root, you cannot expect that DD will be exactly zero; round off error may well force it to be negative in some (half) of the cases. The code should have had DD =MAX( 0.0d0, BB*BB-4.d0*CC )
and likewise at several other places…
Some compilers “hide” the floating-point exceptions, and let the code silently get into trouble later. IMNHO, code should not be accepted unless it passes testing with “check=all” compiler-flag error checking.
ISORROPIA was developed in 1998. It has been incorporated in several regional and global chemical transport models besides CMAQ and has been used in research and regulatory applications far too numerous to list.
I would certainly not claim that the code is bug free. However, if you are getting a floating point exception from it, I would look elsewhere first.