Skip to content

Commit 03443ce

Browse files
authored
Merge pull request #2770 from rafmudaf/dev
Bug fix for Failed0 error checking functions
2 parents b0c12e6 + 14c9117 commit 03443ce

File tree

10 files changed

+35
-29
lines changed

10 files changed

+35
-29
lines changed

glue-codes/fast-farm/src/FASTWrapper.f90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,12 @@ end function Failed
229229
! check for failed where /= 0 is fatal
230230
logical function Failed0(txt)
231231
character(*), intent(in) :: txt
232-
if (errStat /= 0) then
232+
if (ErrStat2 /= 0) then
233233
ErrStat2 = ErrID_Fatal
234234
ErrMsg2 = "Could not allocate memory for "//trim(txt)
235-
call SetErrStat(errStat2, errMsg2, errStat, errMsg, RoutineName)
235+
call SetErrStat(ErrStat2, ErrMsg2, errStat, errMsg, RoutineName)
236236
endif
237-
Failed0 = errStat >= AbortErrLev
237+
Failed0 = ErrStat >= AbortErrLev
238238
if(Failed0) call cleanUp()
239239
end function Failed0
240240
END SUBROUTINE FWrap_Init

glue-codes/fast-farm/src/FAST_Farm_Subs.f90

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -604,12 +604,12 @@ end subroutine cleanup
604604
! check for failed where /= 0 is fatal
605605
logical function Failed0(txt)
606606
character(*), intent(in) :: txt
607-
if (errStat /= 0) then
607+
if (ErrStat2 /= 0) then
608608
ErrStat2 = ErrID_Fatal
609609
ErrMsg2 = "Could not allocate memory for "//trim(txt)
610-
call SetErrStat(errStat2, errMsg2, errStat, errMsg, RoutineName)
610+
call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
611611
endif
612-
Failed0 = errStat >= AbortErrLev
612+
Failed0 = ErrStat >= AbortErrLev
613613
if(Failed0) call cleanUp()
614614
end function Failed0
615615
END SUBROUTINE Farm_InitWD
@@ -716,12 +716,12 @@ end subroutine cleanup
716716
! check for failed where /= 0 is fatal
717717
logical function Failed0(txt)
718718
character(*), intent(in) :: txt
719-
if (errStat /= 0) then
719+
if (ErrStat2 /= 0) then
720720
ErrStat2 = ErrID_Fatal
721721
ErrMsg2 = "Could not allocate memory for "//trim(txt)
722-
call SetErrStat(errStat2, errMsg2, errStat, errMsg, RoutineName)
722+
call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
723723
endif
724-
Failed0 = errStat >= AbortErrLev
724+
Failed0 = ErrStat >= AbortErrLev
725725
if(Failed0) call cleanUp()
726726
end function Failed0
727727
END SUBROUTINE Farm_InitFAST
@@ -873,12 +873,12 @@ end function Failed
873873
! check for failed where /= 0 is fatal
874874
logical function Failed0(txt)
875875
character(*), intent(in) :: txt
876-
if (errStat /= 0) then
876+
if (ErrStat2 /= 0) then
877877
ErrStat2 = ErrID_Fatal
878878
ErrMsg2 = "Could not allocate memory for "//trim(txt)
879-
call SetErrStat(errStat2, errMsg2, errStat, errMsg, RoutineName)
879+
call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
880880
endif
881-
Failed0 = errStat >= AbortErrLev
881+
Failed0 = ErrStat >= AbortErrLev
882882
if(Failed0) call cleanUp()
883883
end function Failed0
884884
END SUBROUTINE Farm_InitMD

modules/aerodyn/src/AeroDyn_Driver_Subs.f90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -557,12 +557,12 @@ end function Failed
557557
! check for failed where /= 0 is fatal
558558
logical function Failed0(txt)
559559
character(*), intent(in) :: txt
560-
if (errStat /= 0) then
560+
if (ErrStat2 /= 0) then
561561
ErrStat2 = ErrID_Fatal
562562
ErrMsg2 = "Could not allocate "//trim(txt)
563-
call SetErrStat(errStat2, errMsg2, errStat, errMsg, 'Init_ADI_ForDriver')
563+
call SetErrStat(ErrStat2, ErrMsg2, errStat, errMsg, 'Init_ADI_ForDriver')
564564
endif
565-
Failed0 = errStat >= AbortErrLev
565+
Failed0 = ErrStat >= AbortErrLev
566566
if(Failed0) call cleanUp()
567567
end function Failed0
568568

modules/aerodyn/src/AeroDyn_Inflow_C_Binding.f90

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -369,13 +369,16 @@ end function Failed
369369
! check for failed where /= 0 is fatal
370370
logical function Failed0(txt)
371371
character(*), intent(in) :: txt
372-
if (errStat /= 0) then
372+
if (ErrStat2 /= 0) then
373373
ErrStat2 = ErrID_Fatal
374374
ErrMsg2 = "Could not allocate "//trim(txt)
375375
call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
376376
endif
377377
Failed0 = ErrStat >= AbortErrLev
378-
if(Failed0) call ClearTmpStorage()
378+
if(Failed0) then
379+
call ClearTmpStorage()
380+
call SetErr(ErrStat,ErrMsg,ErrStat_C,ErrMsg_C)
381+
endif
379382
end function Failed0
380383

381384
!> This subroutine prints out all the variables that are passed in. Use this only
@@ -787,7 +790,7 @@ end function Failed
787790
! check for failed where /= 0 is fatal
788791
logical function Failed0(txt)
789792
character(*), intent(in) :: txt
790-
if (errStat2 /= 0) then
793+
if (ErrStat2 /= 0) then
791794
ErrStat2 = ErrID_Fatal
792795
ErrMsg2 = "Could not allocate "//trim(txt)
793796
call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
@@ -1532,13 +1535,16 @@ end function Failed
15321535
! check for failed where /= 0 is fatal
15331536
logical function Failed0(txt)
15341537
character(*), intent(in) :: txt
1535-
if (errStat /= 0) then
1538+
if (ErrStat2 /= 0) then
15361539
ErrStat2 = ErrID_Fatal
15371540
ErrMsg2 = "Could not allocate "//trim(txt)
15381541
call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
15391542
endif
15401543
Failed0 = ErrStat >= AbortErrLev
1541-
if(Failed0) call ClearTmpStorage()
1544+
if(Failed0) then
1545+
call ClearTmpStorage()
1546+
call SetErr(ErrStat,ErrMsg,ErrStat_C,ErrMsg_C)
1547+
endif
15421548
end function Failed0
15431549

15441550
!> This subroutine prints out all the variables that are passed in. Use this only

modules/awae/src/AWAE.f90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,12 +1207,12 @@ end function Failed
12071207
! check for failed where /= 0 is fatal
12081208
logical function Failed0(txt)
12091209
character(*), intent(in) :: txt
1210-
if (errStat /= 0) then
1210+
if (ErrStat2 /= 0) then
12111211
ErrStat2 = ErrID_Fatal
12121212
ErrMsg2 = "Could not allocate memory for "//trim(txt)
1213-
call SetErrStat(errStat2, errMsg2, errStat, errMsg, RoutineName)
1213+
call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
12141214
endif
1215-
Failed0 = errStat >= AbortErrLev
1215+
Failed0 = ErrStat >= AbortErrLev
12161216
end function Failed0
12171217
end subroutine AWAE_Init
12181218

modules/elastodyn/src/ElastoDyn.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2999,7 +2999,7 @@ end function Failed
29992999
! check for failed where /= 0 is fatal
30003000
logical function Failed0(txt)
30013001
character(*), intent(in) :: txt
3002-
if (errStat /= 0) then
3002+
if (ErrStat2 /= 0) then
30033003
ErrStat2 = ErrID_Fatal
30043004
ErrMsg2 = "Could not allocate "//trim(txt)
30053005
call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg2, RoutineName)

modules/moordyn/src/MoorDyn_Line.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2016,7 +2016,7 @@ end function Failed
20162016
! check for failed where /= 0 is fatal
20172017
logical function Failed0(txt)
20182018
character(*), intent(in) :: txt
2019-
if (errStat /= 0) then
2019+
if (ErrStat2 /= 0) then
20202020
ErrStat2 = ErrID_Fatal
20212021
ErrMsg2 = "Could not allocate "//trim(txt)
20222022
call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)

modules/moordyn/src/MoorDyn_Rod.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1298,7 +1298,7 @@ end function Failed
12981298
! check for failed where /= 0 is fatal
12991299
logical function Failed0(txt)
13001300
character(*), intent(in) :: txt
1301-
if (errStat /= 0) then
1301+
if (ErrStat2 /= 0) then
13021302
ErrStat2 = ErrID_Fatal
13031303
ErrMsg2 = "Could not allocate "//trim(txt)
13041304
call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)

modules/openfast-library/src/FAST_Lin.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5258,7 +5258,7 @@ SUBROUTINE AllocateOP(p_FAST, y_FAST, ErrStat, ErrMsg )
52585258
! check for failed where /= 0 is fatal
52595259
logical function Failed0(txt)
52605260
character(*), intent(in) :: txt
5261-
if (errStat /= 0) then
5261+
if (ErrStat2 /= 0) then
52625262
ErrStat2 = ErrID_Fatal
52635263
ErrMsg2 = "Could not allocate "//trim(txt)
52645264
call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)

modules/wakedynamics/src/WakeDynamics.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -633,10 +633,10 @@ end function Failed
633633
! check for failed where /= 0 is fatal
634634
logical function Failed0(txt)
635635
character(*), intent(in) :: txt
636-
if (errStat /= 0) then
636+
if (ErrStat2 /= 0) then
637637
ErrStat2 = ErrID_Fatal
638638
ErrMsg2 = "Could not allocate memory for "//trim(txt)
639-
call SetErrStat(errStat2, errMsg2, errStat, errMsg, RoutineName)
639+
call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
640640
endif
641641
Failed0 = errStat >= AbortErrLev
642642
end function Failed0

0 commit comments

Comments
 (0)