Skip to content

Commit 72cbf87

Browse files
committed
Fixed tempunstag allocation issue
Glide runs were segfaulting because the code was trying to initialize tempstag without allocating it. Easily fixed with 'if (associated)' logic.
1 parent 9c8388c commit 72cbf87

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

libglide/glide_types.F90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1947,9 +1947,10 @@ subroutine glide_allocarr(model)
19471947
! MJH - Set temp and flwa to physically unrealistic values so we can tell later if
19481948
! arrays were initialized correctly
19491949
model%temper%temp(:,:,:) = unphys_val ! large negative number
1950-
model%temper%tempunstag(:,:,:) = unphys_val
19511950
model%temper%flwa(:,:,:) = unphys_val
19521951
model%temper%dissip(:,:,:) = 0.d0
1952+
if (associated(model%temper%tempunstag)) &
1953+
model%temper%tempunstag(:,:,:) = unphys_val
19531954

19541955
call coordsystem_allocate(model%general%ice_grid, model%temper%bheatflx)
19551956
call coordsystem_allocate(model%general%ice_grid, model%temper%bwat)

libglissade/glissade_therm.F90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ subroutine glissade_init_therm (temp_init, is_restart, &
102102
artm, &
103103
acab, &
104104
bheatflx, &
105-
pmp_offset, temp, tempunstag)
105+
pmp_offset, &
106+
temp, tempunstag)
106107

107108
! initialization subroutine for higher-order dycores, where temperature is defined at
108109
! the midpoint of each layer plus the upper and lower surfaces

0 commit comments

Comments
 (0)