An update on this issue. I ran the PGDBG to gather more information. The error message was as follows:
Signalled SIGSEV at 0x8080c3b, function allocate_grid_cell, file, cell_routines.f90, line 342
The code for this subroutine is as follows (lines with !********** are the lines it fails at):
!------------------------------------------------------------------
! Subroutine to allocate memory for the GRID structure.
! also intializes the counts and mean data variables to 0
!------------------------------------------------------------------
!--- SEG TEMPORARY
subroutine ALLOCATE_GRID_CELL(icell, seg)
integer (kind=int4), intent(in) :: icell, seg
real(kind=real4) :: ilat, ilon, dummy_r4
integer :: astatus, status
integer :: i,j
status = 0
if (seg .ge. 50) print *, "ALLOCATE GOOBER 1", status, astatus
allocate(gridcell(icell)%d(1),stat=astatus) !**********
status = status +abs(astatus)
allocate(gridcell(icell)%d(1)%cnt(abichan,0:nmask-1),stat=astatus)
gridcell(icell)%d(1)%cnt = 0.0
status = status +abs(astatus)
allocate(gridcell(icell)%d(1)%cnt_type(0:ntype-1),stat=astatus)
gridcell(icell)%d(1)%cnt_type = 0.0
status = status +abs(astatus)
allocate(gridcell(icell)%d(1)%mean_data(abichan,0:nmask-1),stat=astatus)
gridcell(icell)%d(1)%mean_data = 0.0
status = status +abs(astatus)
if (seg .ge. 50) print *, "ALLOCATE GOOBER 2", status, astatus
allocate(gridcell(icell)%d(1)%std_data(abichan,0:nmask-1),stat=astatus)
gridcell(icell)%d(1)%std_data = 0.0
status = status +abs(astatus)
if (seg .ge. 50) print *, "ALLOCATE GOOBER 3", status, astatus
allocate(gridcell(icell)%d(1)%cld_test(24),stat=astatus)
status = status +abs(astatus)
if (seg .ge. 50) print *, "ALLOCATE GOOBER 4", status, astatus
allocate(gridcell(icell)%d(1)%cnt_test(24),stat=astatus)
status = status +abs(astatus)
if (seg .ge. 50) print *, "ALLOCATE GOOBER 5", status, astatus
allocate(gridcell(icell)%d(1)%insol_all(maxfpr, maxint),stat=astatus)
gridcell(icell)%d(1)%insol_all(:,:) = 0.0
status = status +abs(astatus)
if (seg .ge. 50) print *, "ALLOCATE GOOBER 6", status, astatus
allocate(gridcell(icell)%d(1)%insol_clr(maxfpr, maxint),stat=astatus) !**********
gridcell(icell)%d(1)%insol_clr(:,:) = 0.0
status = status +abs(astatus)
if (status /= 0) then
! print "(a,'Not enough memory to allocate grid_params structure.')",EXE_PROMPT
print "('Not enough memory to allocate grid_params structure.')"
stop
endif
gridcell(icell)%flag = 1
!--- get latitiude/longitude for the particular cell number and
!--- place them in the lat/lon vars in structure
call PLACE_EQUAL_ANGLE_CELL(icell, ilat, ilon, dummy_r4,dummy_r4)
gridcell(icell)%d(1)%lat = ilat
gridcell(icell)%d(1)%lon = ilon
num_cells_with_data = num_cells_with_data + 1
end subroutine ALLOCATE_GRID_CELL
As I mentioned, while this code compiles, it gives that same error. I did change the compile options, eliminating the -O4 option. Also, as mentioned above, the ifort compiler (which we also want to use, because some people have it rather than the pgf compiler), does not seg fault at all, and produces valid data.
Again, I appriciate your help.