[MITgcm-devel] mom_calc_ke
Martin Losch
Martin.Losch at awi.de
Thu Jul 19 04:47:24 EDT 2012
Hi Jean-Michel,
why do you want to split it? To have different loop boundaries for the first part, like this:
DO j=1-Oly,sNy+Oly-1
DO i=1-Olx,sNx+Olx-1
or even
DO j=1-Oly,sNy+Oly
DO i=1-Olx,sNx+Olx
? I can do that along with my change.
Martin
On Jul 18, 2012, at 11:36 PM, Jean-Michel Campin wrote:
> 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
>
> _______________________________________________
> MITgcm-devel mailing list
> MITgcm-devel at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-devel
More information about the MITgcm-devel
mailing list