gempak icon indicating copy to clipboard operation
gempak copied to clipboard

dcuair fails to compile

Open mzuranski opened this issue 3 months ago • 2 comments

Gempak 7.19.0.1, Ubuntu 24.04 LTS, gfortran 13

Thinking an install of the latest release was working well, turns out dcuair wasn't compiled... possibly others. After some digging I found two problems with gempak/source/programs/dc/dcuair/dcudcd.f that were breaking:

make
gfortran -fallow-invalid-boz -fallow-argument-mismatch -fno-stack-protector -fno-second-underscore -fno-range-check -fd-lines-as-comments -I/home/gempak/NAWIPS/gempak/include -I/home/gempak/NAWIPS/os/linux64/include -g -O -c -o dcudcd.o dcudcd.f
dcudcd.f:245:72:

  245 |                                 ipres =  INDEX ( bultin ( 1: lenbul ), '21212' )
      |                                                                        1
Error: Unterminated character constant beginning at (1)
dcudcd.f:248:60:

  248 |                                        IF ( .not.  zwind ) good  = .true.
      |                                                            1
Error: Syntax error in IF-clause after (1)
make: *** [<builtin>: dcudcd.o] Error 1

Both exist in this code block:

C*                              If there are the 21212 group winds in 
C*                              the TTBB message, still decode the following
C*                              PPBB winds.
C
								ipres =  INDEX ( bultin ( 1: lenbul ), '21212' )
								IF  ( ipres .ne. 0 )  THEN
									IF ( part .eq.  'PPBB' )  THEN
                                                                           IF ( .not.  zwind ) good  = .true.
                                                                        END IF
								END IF

The problem is those two lines exceed 72 characters and that's when the interpreter cuts off, leaving it to read invalid syntax. I'm sure there's some compiler flag that could/should be set, but reducing the white space within those two lines was able to resolve this for me:

C*                              If there are the 21212 group winds in 
C*                              the TTBB message, still decode the following
C*                              PPBB winds.
C
                                ipres = INDEX(bultin(1:lenbul),'21212')
                                IF  ( ipres .ne. 0 )  THEN
                                    IF ( part .eq.  'PPBB' )  THEN
                                       IF (.not.  zwind ) good  = .true.
                                    END IF
                                END IF

If feel like if there is a compiler flag that could address this that'd be better, just in case it's more than this one program. I'm also afraid to start tugging on the thread of actually curating this code, because.... oh man....

mzuranski avatar Oct 17 '25 21:10 mzuranski

I believe this was fixed in this commit.

sgdecker avatar Oct 19 '25 19:10 sgdecker

This behavior was seen in both the latest release (7.19.0.1) as well as a git clone of this repo. Maybe that commit was negated by this one? https://github.com/Unidata/gempak/commit/c028efd1047dcec86ca147629151940deb6dbfdb

mzuranski avatar Oct 21 '25 16:10 mzuranski