GEOS-ESM / FVdycoreCubed_GridComp

MAPL/ESMF wrapper for the cubed-sphere finite volume dynamical core
Apache License 2.0
3 stars 10 forks source link

Fixes for GNU runs #188

Closed mathomp4 closed 1 year ago

mathomp4 commented 1 year ago

This PR has changes to allow the GNU compiler to run the feature/sdrabenh/merge_v10.25.0_MSTRF code from @sdrabenh and @wmputman

The issue is that, for some reason, getting vort and divg from:

      call getAllWinds(vars%u, vars%v, UA=ua, VA=va, UC=uc, VC=vc, UR=ur, VR=vr, vort=vort, divg=divg)

seems to cause a runtime failure of a double free or corruption:

*** Error in `/discover/nobackup/mathomp4/Experiments/scottbranch-2023Feb06-1day-c24-GNUGCMFixes-GNU-DEBUG/scratch/GEOSgcm.x': double free or corruption (!prev): 0x0000000026f69870 ***

and even this took some hunting. In the call above, vort and divg are optional, but so are UA,VA`, etc.

This PR has a workaround that is ugly, but seems to work. If building with GNU, it does not pass in vort and divg but rather uses the old external GetVorticity and GetDivergence codes that @wmputman moved into getAllWinds to be more efficient (less communications which is important at high-res).

I'll be looking at this with @tclune and @aoloso but as far as I can tell, the current Intel path is legal Fortran, so I don't know why GNU has an issue. Maybe there is bug elsewhere?

mathomp4 commented 1 year ago

Closing as these PRs are in the latest branch from @sdrabenh