Skip to content

Commit

Permalink
Fix AD Driver unallocated variable error with GCC 11 (#834)
Browse files Browse the repository at this point in the history
  • Loading branch information
ebranlard authored Sep 21, 2021
1 parent 15a2eb3 commit 0543df2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/aerodyn/src/AeroDyn_Driver_Subs.f90
Original file line number Diff line number Diff line change
Expand Up @@ -569,15 +569,17 @@ subroutine concatOutputHeaders(dvr, WriteOutputHdr, WriteOutputUnt, errStat, err
errStat = ErrID_None
errMsg = ''


if (.not.allocated(dvr%out%WriteOutputHdr)) then
call move_alloc(WriteOutputHdr, dvr%out%WriteOutputHdr)
call move_alloc(WriteOutputUnt, dvr%out%WriteOutputUnt)
else
nOld = size(dvr%out%WriteOutputHdr)
nAdd = size(WriteOutputHdr)

call move_alloc(dvr%out%WriteOutputHdr, TmpHdr)
call move_alloc(dvr%out%WriteOutputUnt, TmpUnt)

nOld = size(dvr%out%WriteOutputHdr)
nAdd = size(WriteOutputHdr)
allocate(dvr%out%WriteOutputHdr(nOld+nAdd))
allocate(dvr%out%WriteOutputUnt(nOld+nAdd))
dvr%out%WriteOutputHdr(1:nOld) = TmpHdr
Expand Down

0 comments on commit 0543df2

Please sign in to comment.