[MITgcm-devel] mom_calc_ke

Jean-Michel Campin jmc at ocean.mit.edu
Wed Jul 18 17:36:15 EDT 2012


Hi Martin,

I think it's better to have .GT.0. rather than .NE.0. anyway,
so if it helps with your compiler optimisation problem,
you should go and change it.

I also had in mind (for a long time) to split this bottom-drag
computation loop in (at least) 2 parts (linear & quadratic) but
no urgent need to do it now.

Cheers,
Jean-Michel

On Wed, Jul 18, 2012 at 09:14:33PM +0200, Martin Losch wrote:
> Hi there, I stumbled across a situation, where the optimization of ifort (-O3) destroys the code and leads to NaNs. The problem is (probably) due to the optimzed code not producing small negative numbers in S/R mom_calc_ke for KE (kinetic energy). In mom_?_bottomdrag, we have SQRT(KE) and this results in NaNs in some cases. The problem can be fixed, when the if-statement in mom_?_bottomdrag (line 91 for u and 97 for v) is changed from .NE. 0. to .GT. 0.
> 
> What do you think? is this worth it?
> 
> Martin
> 
> 
> _______________________________________________
> MITgcm-devel mailing list
> MITgcm-devel at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-devel



More information about the MITgcm-devel mailing list