Skip to content

Commit 6fbf94c

Browse files
authored
Check that self%perturbation is allocated before trying to apply perturbations (#29)
This prevents 'invalid memory reference.' errors when using GCC
1 parent 23f82af commit 6fbf94c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

libforcing/src/forcing_field.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ subroutine forcing_field_apply_perturbations(self, forcing_date, experiment_date
131131
integer :: num_separable_perturbations
132132
logical :: found
133133

134-
if (size(self%perturbations) == 0) then
134+
if (.not. allocated(self%perturbations) .or. size(self%perturbations) == 0) then
135135
return
136136
endif
137137

0 commit comments

Comments
 (0)