[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20000404: awaplt.f



Scott & Steve,

I installed patch Z which has updates for awaplt.f
and awachr.f to check for the ispch = 0.

I have run in to an infinite loop again in awaplt.f
and found that several of the bulletins from KWNM
such as the significant wave height product (PKQC01
and others PKQH01, PKQH03, PKQD01, PKQF01) have
a character which leads to ispch = 2. I don't
have documentation to tell if this is a valid
plotter control character or not- but there is no
else_if block to handle that character. 

This leads to an infinite loop similar to what I
reported before, where the "DO WHILE" loop is not
entered, and the ibeg counter is decremented before
incrementing, so ibeg always stays the same.

I can prevent this infinite loop with the single line shown in the
second to last line in the code segment below to ensure that
ibeg gets incremented, but probably need to know if "2" is
a valid terminal control that needs to be processed above.


                IF ( ispch .ne. 0 ) THEN
                    DO WHILE ( ( ( ispch .ge. 32) .and.
     +                             ( ispch .le. 127 ) ) .and.
     +                             ( ibeg .le. itotln ) )
                        stchar ( i:i ) = char ( b ( ibeg ) )
                        i = i + 1
                        ibeg = ibeg + 1
                        ispch = ibits( ibte (ibeg), 0, 8)
                        textfl = .true.
                    END DO
C
                    ibeg = ibeg - 1
                    i = i - 1
                    IF ( ( dbug .eq. 'D' ) .or. (dbug .eq. 'd' ) ) THEN
                        write(14,*)'CHARACTER STRING:'
                        write(14,68) stchar(1:i)
 68                     format(2x,a)
                    END IF
                 END IF
              END IF
              ibeg = ibeg + 1
              if(i.eq.0) ibeg = ibeg + 1      <<-- sanity check
        END DO



I have uploaded the file PKQC01_KWNM_040000.200004040457.48 to
the upc account on AS2. (The file has a 33 byte offset for the
FOS header instead of the 46 byte ofset that awread.f looks for-
I can strip that out if you need me to. As is, the file encounters the
infinite loop with "ibeg = 3511" in awaplt.f. Let me know if you
need more information.

Steve Chiswell
Unidata User Support