Building GEMPAK with GCC/gfortran 4.6+

Some systems with GCC 4.6+ experience decoder runtime errors due to an update to gfortran in GCC.

The error message

dcwarn -v 4 -d - YYYYMMDDHH_warn.gem
[17367] 120927/1740[DC 3]  Starting up. Version 6.7.0
[17367] 120927/1740[DC 2]  read 1627/102399 bytes strt 0 newstrt 1627

At line 74 of file wnout.f (unit = 11, file = '2012092800_warn.gem')
Fortran runtime error: Sequential READ or WRITE not allowed after EOF
marker, possibly use REWIND or BACKSPACE

indicates that a new default optimization flag in gfortran -fwhole-file is enabled. To deactivate it, use the counter-flag -fno-whole-file in $NAWIPS/condig/Makeinc.linux64_gfortran:

Change

FOPT = -fno-second-underscore -fno-range-check -fd-lines-as-comments $(GEMINC) -g #-O # -g

to

FOPT = -fno-whole-file -fno-second-underscore -fno-range-check -fd-lines-as-comments $(GEMINC) -g #-O # -g

Then run make all and make install as usual.

The flag -fno-whole-file has been added to FOPT as a default for all future releases of GEMPAK.

See the updated source gode at github.