Community
cancel
Showing results for 
Search instead for 
Did you mean: 
benandstep
Beginner
101 Views

discrepancies for same subroutine and input in fortran program

Hello, new to the forum.  

I have a hopefully forum-appropriate question about two fortran programs I'm running, let's call them A and B.  These are big numerical models, but they share identical fortran code for a number of complex subroutines.  I've noticed that for one of these subroutines, models A and B give slightly different results even when the input to the subroutine is identical in A and B [as far as I can tell from write(*,*) statements placed before the subroutine in question].  The overall programs A and B are quite different in many ways, but the subroutine code is exactly identical, and the input to the subroutine seems identical.  If there are subtle differences in the output from this subroutine, could this be caused by slight differences in the way the two programs are compiled?  

Apologies for not posting actual code, the subroutines are too big and complex to make it worth posting here, but if anyone who understands Fortran and compilers better than me can help me to understand this, I'd be grateful.

Thanks!

0 Kudos
1 Reply
Steve_Lionel
Black Belt Retired Employee
92 Views

There are many things that could cause minor differences, including optimization level, alignment of input arrays and sequence of operations. Maybe the common code is the same but if the routines have other differences that can affect results. For further reading see http://sc13.supercomputing.org/sites/default/files/WorkshopsArchive/pdfs/wp129s1.pdf