From 0543df2871fde151a848be40a94222e3870490a2 Mon Sep 17 00:00:00 2001 From: "E. Branlard" <1318316+ebranlard@users.noreply.github.com> Date: Mon, 20 Sep 2021 19:00:52 -0600 Subject: [PATCH] Fix AD Driver unallocated variable error with GCC 11 (#834) --- modules/aerodyn/src/AeroDyn_Driver_Subs.f90 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/aerodyn/src/AeroDyn_Driver_Subs.f90 b/modules/aerodyn/src/AeroDyn_Driver_Subs.f90 index 7f6b2867f..9c67fdb7f 100644 --- a/modules/aerodyn/src/AeroDyn_Driver_Subs.f90 +++ b/modules/aerodyn/src/AeroDyn_Driver_Subs.f90 @@ -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