diff --git a/glue-codes/fast-farm/src/FASTWrapper.f90 b/glue-codes/fast-farm/src/FASTWrapper.f90 index ad1c9dd67e..65b8e90f1a 100644 --- a/glue-codes/fast-farm/src/FASTWrapper.f90 +++ b/glue-codes/fast-farm/src/FASTWrapper.f90 @@ -229,12 +229,12 @@ end function Failed ! check for failed where /= 0 is fatal logical function Failed0(txt) character(*), intent(in) :: txt - if (errStat /= 0) then + if (ErrStat2 /= 0) then ErrStat2 = ErrID_Fatal ErrMsg2 = "Could not allocate memory for "//trim(txt) - call SetErrStat(errStat2, errMsg2, errStat, errMsg, RoutineName) + call SetErrStat(ErrStat2, ErrMsg2, errStat, errMsg, RoutineName) endif - Failed0 = errStat >= AbortErrLev + Failed0 = ErrStat >= AbortErrLev if(Failed0) call cleanUp() end function Failed0 END SUBROUTINE FWrap_Init diff --git a/glue-codes/fast-farm/src/FAST_Farm_Subs.f90 b/glue-codes/fast-farm/src/FAST_Farm_Subs.f90 index 1ea74acce7..851ca26de0 100644 --- a/glue-codes/fast-farm/src/FAST_Farm_Subs.f90 +++ b/glue-codes/fast-farm/src/FAST_Farm_Subs.f90 @@ -604,12 +604,12 @@ end subroutine cleanup ! check for failed where /= 0 is fatal logical function Failed0(txt) character(*), intent(in) :: txt - if (errStat /= 0) then + if (ErrStat2 /= 0) then ErrStat2 = ErrID_Fatal ErrMsg2 = "Could not allocate memory for "//trim(txt) - call SetErrStat(errStat2, errMsg2, errStat, errMsg, RoutineName) + call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName) endif - Failed0 = errStat >= AbortErrLev + Failed0 = ErrStat >= AbortErrLev if(Failed0) call cleanUp() end function Failed0 END SUBROUTINE Farm_InitWD @@ -716,12 +716,12 @@ end subroutine cleanup ! check for failed where /= 0 is fatal logical function Failed0(txt) character(*), intent(in) :: txt - if (errStat /= 0) then + if (ErrStat2 /= 0) then ErrStat2 = ErrID_Fatal ErrMsg2 = "Could not allocate memory for "//trim(txt) - call SetErrStat(errStat2, errMsg2, errStat, errMsg, RoutineName) + call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName) endif - Failed0 = errStat >= AbortErrLev + Failed0 = ErrStat >= AbortErrLev if(Failed0) call cleanUp() end function Failed0 END SUBROUTINE Farm_InitFAST @@ -873,12 +873,12 @@ end function Failed ! check for failed where /= 0 is fatal logical function Failed0(txt) character(*), intent(in) :: txt - if (errStat /= 0) then + if (ErrStat2 /= 0) then ErrStat2 = ErrID_Fatal ErrMsg2 = "Could not allocate memory for "//trim(txt) - call SetErrStat(errStat2, errMsg2, errStat, errMsg, RoutineName) + call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName) endif - Failed0 = errStat >= AbortErrLev + Failed0 = ErrStat >= AbortErrLev if(Failed0) call cleanUp() end function Failed0 END SUBROUTINE Farm_InitMD diff --git a/modules/aerodyn/src/AeroDyn_Driver_Subs.f90 b/modules/aerodyn/src/AeroDyn_Driver_Subs.f90 index 4b67bf1166..e692dc0af0 100644 --- a/modules/aerodyn/src/AeroDyn_Driver_Subs.f90 +++ b/modules/aerodyn/src/AeroDyn_Driver_Subs.f90 @@ -557,12 +557,12 @@ end function Failed ! check for failed where /= 0 is fatal logical function Failed0(txt) character(*), intent(in) :: txt - if (errStat /= 0) then + if (ErrStat2 /= 0) then ErrStat2 = ErrID_Fatal ErrMsg2 = "Could not allocate "//trim(txt) - call SetErrStat(errStat2, errMsg2, errStat, errMsg, 'Init_ADI_ForDriver') + call SetErrStat(ErrStat2, ErrMsg2, errStat, errMsg, 'Init_ADI_ForDriver') endif - Failed0 = errStat >= AbortErrLev + Failed0 = ErrStat >= AbortErrLev if(Failed0) call cleanUp() end function Failed0 diff --git a/modules/aerodyn/src/AeroDyn_Inflow_C_Binding.f90 b/modules/aerodyn/src/AeroDyn_Inflow_C_Binding.f90 index 4508cbafe7..9cda0d19c6 100644 --- a/modules/aerodyn/src/AeroDyn_Inflow_C_Binding.f90 +++ b/modules/aerodyn/src/AeroDyn_Inflow_C_Binding.f90 @@ -369,13 +369,16 @@ end function Failed ! check for failed where /= 0 is fatal logical function Failed0(txt) character(*), intent(in) :: txt - if (errStat /= 0) then + if (ErrStat2 /= 0) then ErrStat2 = ErrID_Fatal ErrMsg2 = "Could not allocate "//trim(txt) call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName) endif Failed0 = ErrStat >= AbortErrLev - if(Failed0) call ClearTmpStorage() + if(Failed0) then + call ClearTmpStorage() + call SetErr(ErrStat,ErrMsg,ErrStat_C,ErrMsg_C) + endif end function Failed0 !> This subroutine prints out all the variables that are passed in. Use this only @@ -787,7 +790,7 @@ end function Failed ! check for failed where /= 0 is fatal logical function Failed0(txt) character(*), intent(in) :: txt - if (errStat2 /= 0) then + if (ErrStat2 /= 0) then ErrStat2 = ErrID_Fatal ErrMsg2 = "Could not allocate "//trim(txt) call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName) @@ -1532,13 +1535,16 @@ end function Failed ! check for failed where /= 0 is fatal logical function Failed0(txt) character(*), intent(in) :: txt - if (errStat /= 0) then + if (ErrStat2 /= 0) then ErrStat2 = ErrID_Fatal ErrMsg2 = "Could not allocate "//trim(txt) call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName) endif Failed0 = ErrStat >= AbortErrLev - if(Failed0) call ClearTmpStorage() + if(Failed0) then + call ClearTmpStorage() + call SetErr(ErrStat,ErrMsg,ErrStat_C,ErrMsg_C) + endif end function Failed0 !> This subroutine prints out all the variables that are passed in. Use this only diff --git a/modules/awae/src/AWAE.f90 b/modules/awae/src/AWAE.f90 index fd80cd6b9a..aba69d29c6 100644 --- a/modules/awae/src/AWAE.f90 +++ b/modules/awae/src/AWAE.f90 @@ -1207,12 +1207,12 @@ end function Failed ! check for failed where /= 0 is fatal logical function Failed0(txt) character(*), intent(in) :: txt - if (errStat /= 0) then + if (ErrStat2 /= 0) then ErrStat2 = ErrID_Fatal ErrMsg2 = "Could not allocate memory for "//trim(txt) - call SetErrStat(errStat2, errMsg2, errStat, errMsg, RoutineName) + call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName) endif - Failed0 = errStat >= AbortErrLev + Failed0 = ErrStat >= AbortErrLev end function Failed0 end subroutine AWAE_Init diff --git a/modules/elastodyn/src/ElastoDyn.f90 b/modules/elastodyn/src/ElastoDyn.f90 index dc5d36ee2d..05ad19300c 100644 --- a/modules/elastodyn/src/ElastoDyn.f90 +++ b/modules/elastodyn/src/ElastoDyn.f90 @@ -2999,7 +2999,7 @@ end function Failed ! check for failed where /= 0 is fatal logical function Failed0(txt) character(*), intent(in) :: txt - if (errStat /= 0) then + if (ErrStat2 /= 0) then ErrStat2 = ErrID_Fatal ErrMsg2 = "Could not allocate "//trim(txt) call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg2, RoutineName) diff --git a/modules/moordyn/src/MoorDyn_Line.f90 b/modules/moordyn/src/MoorDyn_Line.f90 index f40d482a75..b6656e8373 100644 --- a/modules/moordyn/src/MoorDyn_Line.f90 +++ b/modules/moordyn/src/MoorDyn_Line.f90 @@ -2016,7 +2016,7 @@ end function Failed ! check for failed where /= 0 is fatal logical function Failed0(txt) character(*), intent(in) :: txt - if (errStat /= 0) then + if (ErrStat2 /= 0) then ErrStat2 = ErrID_Fatal ErrMsg2 = "Could not allocate "//trim(txt) call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName) diff --git a/modules/moordyn/src/MoorDyn_Rod.f90 b/modules/moordyn/src/MoorDyn_Rod.f90 index c01c5b6ae5..c2b22f6058 100644 --- a/modules/moordyn/src/MoorDyn_Rod.f90 +++ b/modules/moordyn/src/MoorDyn_Rod.f90 @@ -1298,7 +1298,7 @@ end function Failed ! check for failed where /= 0 is fatal logical function Failed0(txt) character(*), intent(in) :: txt - if (errStat /= 0) then + if (ErrStat2 /= 0) then ErrStat2 = ErrID_Fatal ErrMsg2 = "Could not allocate "//trim(txt) call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName) diff --git a/modules/openfast-library/src/FAST_Lin.f90 b/modules/openfast-library/src/FAST_Lin.f90 index 7f4a9bf929..7aba34117c 100644 --- a/modules/openfast-library/src/FAST_Lin.f90 +++ b/modules/openfast-library/src/FAST_Lin.f90 @@ -5258,7 +5258,7 @@ SUBROUTINE AllocateOP(p_FAST, y_FAST, ErrStat, ErrMsg ) ! check for failed where /= 0 is fatal logical function Failed0(txt) character(*), intent(in) :: txt - if (errStat /= 0) then + if (ErrStat2 /= 0) then ErrStat2 = ErrID_Fatal ErrMsg2 = "Could not allocate "//trim(txt) call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName) diff --git a/modules/wakedynamics/src/WakeDynamics.f90 b/modules/wakedynamics/src/WakeDynamics.f90 index d8819d3950..b20190669e 100644 --- a/modules/wakedynamics/src/WakeDynamics.f90 +++ b/modules/wakedynamics/src/WakeDynamics.f90 @@ -633,10 +633,10 @@ end function Failed ! check for failed where /= 0 is fatal logical function Failed0(txt) character(*), intent(in) :: txt - if (errStat /= 0) then + if (ErrStat2 /= 0) then ErrStat2 = ErrID_Fatal ErrMsg2 = "Could not allocate memory for "//trim(txt) - call SetErrStat(errStat2, errMsg2, errStat, errMsg, RoutineName) + call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName) endif Failed0 = errStat >= AbortErrLev end function Failed0