[MITgcm-support] Floating point overflows in gad_os7mp_adv_r

Christopher L. Wolfe clwolfe at ucsd.edu
Mon May 19 21:45:45 EDT 2008


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
-----------------------------------------------------------




More information about the MITgcm-support mailing list