diff --git a/astronomy/astronomy.F90 b/astronomy/astronomy.F90 index 3809c98a8a..3386330b48 100644 --- a/astronomy/astronomy.F90 +++ b/astronomy/astronomy.F90 @@ -768,7 +768,7 @@ subroutine astronomy_end !---------------------------------------------------------------------- !> deallocate module variables. !---------------------------------------------------------------------- - deallocate (orb_angle) + if (allocated(orb_angle)) deallocate (orb_angle) if (allocated(cosz_ann) ) then deallocate (cosz_ann) deallocate (fracday_ann)