[MITgcm-support] Floating point overflows in gad_os7mp_adv_r

Christopher L. Wolfe clwolfe at ucsd.edu
Tue May 20 18:02:17 EDT 2008


Well, replacing all the instances of division by abs(X + Eps) with  
division by abs(X) + Eps in gad_os7mp_adv_? caused the overflows to  
stop. However, since I don't know that much about the algorithm, I  
don't know if this change will have a detrimental effect on the  
algorithm. Anyone knowledgeable care to comment?

Thanks,
Christopher

-----------------------------------------------------------
Dr. Christopher L. Wolfe                   858-534-4560
Physical Oceanography Research Division    OAR 357
Scripps Institution of Oceanography, UCSD  clwolfe at ucsd.edu
-----------------------------------------------------------



On May 19, 2008, at 6:45 PM, Christopher L. Wolfe wrote:

>
> Hi all,
>
> I'm getting floating point overflows in gad_os7mp_adv_r. I haven't  
> pinned it down to the exact line that's causing it yet, but I've  
> found several places where there's division by arbitrarily small  
> quantities and I was wondering if someone familiar with the OS7MP  
> algorithm could comment on it (or point me to a detailed exposition  
> of the algorithm). Anyway, on lines 154, 157, and 182 there's  
> division by abs(DelIp + Eps), where DelIp = ( Qip - Qi ) * MskI.  
> DelIp does not appear to be guaranteed non-negative, so abs(DelIp +  
> Eps) can be made arbitrarily small. There's similar division by abs 
> (X + Eps) (where X is some possibly negative quantity on lines 181  
> and 183.
>
> My question is this: Would it be a good idea to replace the  
> instances of abs(X + Eps) with abs(X) + Eps, or would that totally  
> screw up the algorithm?
>
> Thanks,
> Christopher
>
> -----------------------------------------------------------
> Dr. Christopher L. Wolfe                   858-534-4560
> Physical Oceanography Research Division    OAR 357
> Scripps Institution of Oceanography, UCSD  clwolfe at ucsd.edu
> -----------------------------------------------------------
>
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-support




More information about the MITgcm-support mailing list