Skip to content

Commit

Permalink
Fix for when restart files have zero bergs
Browse files Browse the repository at this point in the history
- When the restart file exists but has zero length data in then
  the model was correctly NOT allocating but was then proceeding to
  try and read into the non-allocated array. This avoids that condition.
- I thought this was fixed before but apparently not.
  • Loading branch information
adcroft committed Jun 16, 2017
1 parent 7aece18 commit 04dfea1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion icebergs_io.F90
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ subroutine read_restart_bergs(bergs,Time)
allocate(iceberg_num(nbergs_in_file))
endif

if (found_restart) then
if (found_restart .and. nbergs_in_file > 0) then
call read_unlimited_axis(filename,'lon',lon,domain=grd%domain)
call read_unlimited_axis(filename,'lat',lat,domain=grd%domain)
call read_unlimited_axis(filename,'uvel',uvel,domain=grd%domain)
Expand Down

0 comments on commit 04dfea1

Please sign in to comment.