Open metdyn opened 1 year ago
The minval for lons becomes -8.4280581075531867E+305.
That is one massive, negative number...though not the smallest which would be E+308. How odd.
I'm going to mention @tclune as he knows more about NAG than any of us.
Still looks a lot like something uninitialized ...
The NAG correlation would possibly be either something that NAG does by copy-in copy-out and therefore does not "keep" the intended value and/or a stale pointer. Not that this helps a lot. The trick is to track down where that value is appearing and then it will probably be obvious. I doubt that this is a compiler defect.
I have been with this problem for a few days. I am keeping a record for what I find and I plan to move on to the main project. This problem occurs with NAG compiler only (no issues for gcc or intel, thanks to @bena-nasa).
I used historyGC to output 2D and 3D field on CS grid. All the output variables in netCDF show correct value range, except the lat-lon grid coordinates. The minval for lons becomes -8.4280581075531867E+305. (I have changed real, allocatable :: lons to real(REAL64), allocatable :: lons. There is no difference changing this single vs. double precision variable. This problem is narrowed down to subroutine stage2DLatLon inside GriddedIO.F90.
I am running a test using griddedIO with a few print statement.