[MITgcm-support] Trapping NaN in cg2d.F

Pochini, Enrico epochini at inogs.it
Mon Jul 20 09:26:57 EDT 2020


Dear community,

I thought it may be of interest to some, sharing this bit of code to trap
NaN generation without debug options (as these cause issues with other
routines at runtime)

Adding simply:

      IF ( ISNAN(sumRHS)) THEN
        ERROR STOP 'NaN generated! Stopping here.'
      END IF

at the end of *cg2d.F* seems to do the job nicely.
The modified routine is attached.

Best regards,

Enrico
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mitgcm.org/pipermail/mitgcm-support/attachments/20200720/58180001/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cg2d.F
Type: text/x-fortran
Size: 14105 bytes
Desc: not available
URL: <http://mailman.mitgcm.org/pipermail/mitgcm-support/attachments/20200720/58180001/attachment-0001.bin>


More information about the MITgcm-support mailing list