[MITgcm-support] Trapping NaN by fpe0 clashes with KPP
Pochini, Enrico
epochini at inogs.it
Mon Jul 6 07:14:12 EDT 2020
Dear community,
I'm facing the problem of Nans generation not stopping model execution.
I've tried adding the -fpe0 option (on ifortran) which does the job;
however it signals a
forrtl: error (73): floating divide by zero
>
from kpp_routines.f right at zero timestep (after monitor printing to
STDOUT).
The incriminated lines are in FIND_BETA subroutine:
DBLOC(I,J,K-1) = gravity * (RHOK(I,J) - RHOKM1(I,J))/
& (RHOK(I,J) + rhoConst )
DBSFC(I,J,K) = gravity * (RHOK(I,J) - RHO1K (I,J)) /
& (RHOK(I,J) + rhoConst )
adding a small constant to the denominators solved the signalling issue.
But is there a better way to solve it? Are those variables RHOK rhoConst
initialized correctly? I have rhoConst set in data file.
Following
http://mailman.mitgcm.org/pipermail/mitgcm-support/2006-April/003931.html
I also tried the -Ktrap=fp option, that didn't stop execution on NaN, and
-fpeX X>0 with same result.
P.S. Unrelated to the present mail, but may be of interest to other users
since I didn't find a solution on the forum: on some cluster with jobs
queue handling, jobs are not killed on errors like MOM_IMPLICIT_R and
similar; the model continues "not running" but consuming CPU-hours. The
solution to this is to substitute STOP statements with ERROR STOP in error
calls.
Cheers,
Enrico
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mitgcm.org/pipermail/mitgcm-support/attachments/20200706/e8318c0d/attachment.html>
More information about the MITgcm-support
mailing list