Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fixed a bug in array initiation, but now it segfaults when writing
  • Loading branch information
Austin Blevins committed Dec 1, 2022
1 parent f48a832 commit 7f2a478
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/util/util_init_array.f90
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,15 @@ subroutine util_init_array(regolayer,initstat)
! regolayer%regodata%porosity = 0.0_DP
! regolayer%regodata%age(:) = 0.0_SP
if (allocated(regolayer)) deallocate(regolayer)
allocate(regolayer(1))
regolayer(1)%thickness = sqrt(VBIG) ! This generates a buffer layer that the model should never reach if the run is structured properly
regolayer(1)%comp = 0.0_DP
regolayer(1)%meltfrac = 0.0_DP
regolayer(1)%porosity = 0.0_DP
regolayer(1)%age(:) = 0.0_SP
allocate(regolayer(1),stat=allocstat)
if (allocstat == 0) then
initstat = .true.
regolayer(1)%thickness = sqrt(VBIG) ! This generates a buffer layer that the model should never reach if the run is structured properly
regolayer(1)%comp = 0.0_DP
regolayer(1)%meltfrac = 0.0_DP
regolayer(1)%porosity = 0.0_DP
regolayer(1)%age(:) = 0.0_SP
end if
! else
! write(*,*) 'util_init_list: Initialization failed. Exhausted memory.'
! end if
Expand Down

0 comments on commit 7f2a478

Please sign in to comment.