I am trying to compile these programs with pgroup compilers:
First of all, the pgf90 4.0-2 I have licensed does not understand all constructs used in g2lib code, so I tried 5.2 compilers with the evaluation license. This compiles but segfaults when I try to run it.
pgdbg> run -g21 012.grib2 012.grib1
./cnvgrib loaded by ld-linux.so.2.
libz.so.1 loaded by ld-linux.so.2.
libc.so.6 loaded by ld-linux.so.2.
libpgc.so loaded by ld-linux.so.2.
libm.so.6 loaded by ld-linux.so.2.
ld-linux.so.2 loaded by ld-linux.so.2.
Signalled SIGSEGV at 0x80c3ba7, function __hpf_bcopysl
80c3ba7: 8b 14 98 movl (%eax,%ebx,4),%edx
#6 __libc_start_main address: 0x40072177
#5 main address: 0x804a969
#4 cnvgrib line: “cnvgrib.f”@143 address: 0x804dcc4
#3 cnv21 line: “cnv21.f”@87 address: 0x805193c
ifl1 = 10 , ifl2 = 50
#2 pgf90_copy_f77_argl address: 0x80b516a
#1 local_copy file: rdst.c address: 0x80b348f
=> #0 __hpf_bcopysl address: 0x80c3c17
Call level:1 local_copy file: rdst.c address: 0x80b348f
Call level:2 pgf90_copy_f77_argl address: 0x80b516a
ERROR: No current source file.
Call level:3 cnv21 line: “cnv21.f”@87 address: 0x805193c
#87: call gdt2gds(igds,gfld%igdtmpl,gfld%num_opt,gfld%list_opt,
#87:==>> call gdt2gds(igds,gfld%igdtmpl,gfld%num_opt,gfld%list_opt,
#88: & kgds,igrid,iret)
#89: if (iret.ne.0) then
#90: print *,‘cnv21: could not create gds’
This looks like some bug in passing arguments to a subroutine.
I cannot be sure that there are no bugs in NCEP code there, but it seems to work for other people with other compilers. As I am currently using pgroup compilers, I thought to first try these.