From 9615be41559afa842e789d71af51232f528bb80e Mon Sep 17 00:00:00 2001 From: Bonnie Jonkman Date: Mon, 4 Jan 2021 11:10:49 -0700 Subject: [PATCH] Potential fix for openfast issue #620 the code uses size(Ary) on an Ary that is not necessarily allocated. Now it is allocated to size 0 if there are no continuous states, which should fix the issues with using the size() function. --- modules/aerodyn/src/AeroDyn.f90 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/aerodyn/src/AeroDyn.f90 b/modules/aerodyn/src/AeroDyn.f90 index 58a11dfbdd..8ca53c7fae 100644 --- a/modules/aerodyn/src/AeroDyn.f90 +++ b/modules/aerodyn/src/AeroDyn.f90 @@ -4710,10 +4710,12 @@ SUBROUTINE Init_Jacobian_x( p, InitOut, ErrStat, ErrMsg) nx = p%BEMT%DBEMT%lin_nx + p%BEMT%UA%lin_nx - if (nx==0) return ! allocate space for the row/column names and for perturbation sizes + ! always allocate this in case it is size zero ... (we use size(p%dx) for many calculations) CALL AllocAry(p%dx, nx, 'p%dx', ErrStat2, ErrMsg2); call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName) + if (nx==0) return + CALL AllocAry(InitOut%LinNames_x, nx, 'LinNames_x', ErrStat2, ErrMsg2); CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName) CALL AllocAry(InitOut%RotFrame_x, nx, 'RotFrame_x', ErrStat2, ErrMsg2); CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName) CALL AllocAry(InitOut%DerivOrder_x, nx, 'DerivOrder_x', ErrStat2, ErrMsg2); CALL SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)