Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions modules/nwtc-library/src/NWTC_IO.f90
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ SUBROUTINE AllIAry2 ( Ary, AryDim1, AryDim2, Descr, ErrStat, ErrMsg )
IF ( ALLOCATED(Ary) ) THEN ! or Sttus=151 on IVF
ErrMsg = 'Error allocating memory for the '//TRIM( Descr )//' array; array was already allocated.'
ELSE
ErrMsg = 'Error allocating '//TRIM(Num2LStr(AryDim1*AryDim2*BYTES_IN_INT))//' bytes of memory for the '//TRIM( Descr )//' array.'
ErrMsg = 'Error allocating '//TRIM(Num2LStr(int(AryDim1,B8Ki)*int(AryDim2,B8Ki)*BYTES_IN_INT))//' bytes of memory for the '//TRIM( Descr )//' array.'
END IF
ELSE
ErrStat = ErrID_None
Expand Down Expand Up @@ -521,7 +521,7 @@ SUBROUTINE AllIAry3 ( Ary, AryDim1, AryDim2, AryDim3, Descr, ErrStat, ErrMsg )
IF ( ALLOCATED(Ary) ) THEN ! or Sttus=151 on IVF
ErrMsg = 'Error allocating memory for the '//TRIM( Descr )//' array; array was already allocated.'
ELSE
ErrMsg = 'Error allocating '//TRIM(Num2LStr(AryDim1*AryDim2*AryDim3*BYTES_IN_INT))//' bytes of memory for the '//TRIM( Descr )//' array.'
ErrMsg = 'Error allocating '//TRIM(Num2LStr(int(AryDim1,B8Ki)*int(AryDim2,B8Ki)*int(AryDim3,B8Ki)*BYTES_IN_INT))//' bytes of memory for the '//TRIM( Descr )//' array.'
END IF
ELSE
ErrStat = ErrID_None
Expand Down Expand Up @@ -681,7 +681,7 @@ SUBROUTINE AllRPAry2 ( Ary, AryDim1, AryDim2, Descr, ErrStat, ErrMsg )
ALLOCATE ( Ary(AryDim1,AryDim2) , STAT=ErrStat )
IF ( ErrStat /= 0 ) THEN
ErrStat = ErrID_Fatal
ErrMsg = 'Error allocating '//TRIM(Num2LStr(AryDim1*AryDim2*BYTES_IN_REAL))//&
ErrMsg = 'Error allocating '//TRIM(Num2LStr(int(AryDim1,B8Ki)*int(AryDim2,B8Ki)*BYTES_IN_REAL))//&
' bytes of memory for the '//TRIM( Descr )//' array.'
ELSE
ErrStat = ErrID_None
Expand Down Expand Up @@ -714,7 +714,7 @@ SUBROUTINE AllR4PAry3 ( Ary, AryDim1, AryDim2, AryDim3, Descr, ErrStat, ErrMsg
ALLOCATE ( Ary(AryDim1,AryDim2,AryDim3) , STAT=ErrStat )
IF ( ErrStat /= 0 ) THEN
ErrStat = ErrID_Fatal
ErrMsg = 'Error allocating '//TRIM(Num2LStr(AryDim1*AryDim2*AryDim3*BYTES_IN_R4Ki))//&
ErrMsg = 'Error allocating '//TRIM(Num2LStr(int(AryDim1,B8Ki)*int(AryDim2,B8Ki)*int(AryDim3,B8Ki)*BYTES_IN_R4Ki))//&
' bytes of memory for the '//TRIM( Descr )//' array.'
ELSE
ErrStat = ErrID_None
Expand Down Expand Up @@ -747,7 +747,7 @@ SUBROUTINE AllR8PAry3 ( Ary, AryDim1, AryDim2, AryDim3, Descr, ErrStat, ErrMsg
ALLOCATE ( Ary(AryDim1,AryDim2,AryDim3) , STAT=ErrStat )
IF ( ErrStat /= 0 ) THEN
ErrStat = ErrID_Fatal
ErrMsg = 'Error allocating '//TRIM(Num2LStr(AryDim1*AryDim2*AryDim3*BYTES_IN_R8Ki))//&
ErrMsg = 'Error allocating '//TRIM(Num2LStr(int(AryDim1,B8Ki)*int(AryDim2,B8Ki)*int(AryDim3,B8Ki)*BYTES_IN_R8Ki))//&
' bytes of memory for the '//TRIM( Descr )//' array.'
ELSE
ErrStat = ErrID_None
Expand Down Expand Up @@ -926,7 +926,7 @@ SUBROUTINE AllR4Ary2 ( Ary, AryDim1, AryDim2, Descr, ErrStat, ErrMsg )
IF ( ALLOCATED(Ary) ) THEN
ErrMsg = 'Error allocating memory for the '//TRIM( Descr )//' array; array was already allocated.'
ELSE
ErrMsg = 'Error allocating '//TRIM(Num2LStr(AryDim1*AryDim2*BYTES_IN_R4Ki))//&
ErrMsg = 'Error allocating '//TRIM(Num2LStr(int(AryDim1,B8Ki)*int(AryDim2,B8Ki)*BYTES_IN_R4Ki))//&
' bytes of memory for the '//TRIM( Descr )//' array.'
END IF
ELSE
Expand Down Expand Up @@ -957,7 +957,7 @@ SUBROUTINE AllR8Ary2 ( Ary, AryDim1, AryDim2, Descr, ErrStat, ErrMsg )
IF ( ALLOCATED(Ary) ) THEN
ErrMsg = 'Error allocating memory for the '//TRIM( Descr )//' array; array was already allocated.'
ELSE
ErrMsg = 'Error allocating '//TRIM(Num2LStr(AryDim1*AryDim2*BYTES_IN_R8Ki))//&
ErrMsg = 'Error allocating '//TRIM(Num2LStr(int(AryDim1,B8Ki)*int(AryDim2,B8Ki)*BYTES_IN_R8Ki))//&
' bytes of memory for the '//TRIM( Descr )//' array.'
END IF
ELSE
Expand Down Expand Up @@ -989,7 +989,7 @@ SUBROUTINE AllR4Ary3 ( Ary, AryDim1, AryDim2, AryDim3, Descr, ErrStat, ErrMsg )
IF ( ALLOCATED(Ary) ) THEN ! or Sttus=151 on IVF
ErrMsg = 'Error allocating memory for the '//TRIM( Descr )//' array; array was already allocated.'
ELSE
ErrMsg = 'Error allocating '//TRIM(Num2LStr(AryDim1*AryDim2*AryDim3*BYTES_IN_R4Ki))//&
ErrMsg = 'Error allocating '//TRIM(Num2LStr(int(AryDim1,B8Ki)*int(AryDim2,B8Ki)*int(AryDim3,B8Ki)*BYTES_IN_R4Ki))//&
' bytes of memory for the '//TRIM( Descr )//' array.'
END IF
ELSE
Expand Down Expand Up @@ -1021,7 +1021,7 @@ SUBROUTINE AllR8Ary3 ( Ary, AryDim1, AryDim2, AryDim3, Descr, ErrStat, ErrMsg )
IF ( ALLOCATED(Ary) ) THEN ! or Sttus=151 on IVF
ErrMsg = 'Error allocating memory for the '//TRIM( Descr )//' array; array was already allocated.'
ELSE
ErrMsg = 'Error allocating '//TRIM(Num2LStr(AryDim1*AryDim2*AryDim3*BYTES_IN_R8Ki))//&
ErrMsg = 'Error allocating '//TRIM(Num2LStr(int(AryDim1,B8Ki)*int(AryDim2,B8Ki)*int(AryDim3,B8Ki)*BYTES_IN_R8Ki))//&
' bytes of memory for the '//TRIM( Descr )//' array.'
END IF
ELSE
Expand Down Expand Up @@ -1054,7 +1054,7 @@ SUBROUTINE AllR4Ary4 ( Ary, AryDim1, AryDim2, AryDim3, AryDim4, Descr, ErrStat,
IF ( ALLOCATED(Ary) ) THEN ! or Sttus=151 on IVF
ErrMsg = 'Error allocating memory for the '//TRIM( Descr )//' array; array was already allocated.'
ELSE
ErrMsg = 'Error allocating '//TRIM(Num2LStr(AryDim1*AryDim2*AryDim3*AryDim4*BYTES_IN_R4Ki))//&
ErrMsg = 'Error allocating '//TRIM(Num2LStr(int(AryDim1,B8Ki)*int(AryDim2,B8Ki)*int(AryDim3,B8Ki)*int(AryDim4,B8Ki)*BYTES_IN_R4Ki))//&
' bytes of memory for the '//TRIM( Descr )//' array.'
END IF
ELSE
Expand Down Expand Up @@ -1087,7 +1087,7 @@ SUBROUTINE AllR8Ary4 ( Ary, AryDim1, AryDim2, AryDim3, AryDim4, Descr, ErrStat,
IF ( ALLOCATED(Ary) ) THEN ! or Sttus=151 on IVF
ErrMsg = 'Error allocating memory for the '//TRIM( Descr )//' array; array was already allocated.'
ELSE
ErrMsg = 'Error allocating '//TRIM(Num2LStr(AryDim1*AryDim2*AryDim3*AryDim4*BYTES_IN_R8Ki))//&
ErrMsg = 'Error allocating '//TRIM(Num2LStr(int(AryDim1,B8Ki)*int(AryDim2,B8Ki)*int(AryDim3,B8Ki)*int(AryDim4,B8Ki)*BYTES_IN_R8Ki))//&
' bytes of memory for the '//TRIM( Descr )//' array.'
END IF
ELSE
Expand Down Expand Up @@ -1121,7 +1121,7 @@ SUBROUTINE AllR4Ary5 ( Ary, AryDim1, AryDim2, AryDim3, AryDim4, AryDim5, Descr,
IF ( ALLOCATED(Ary) ) THEN ! or Sttus=151 on IVF
ErrMsg = 'Error allocating memory for the '//TRIM( Descr )//' array; array was already allocated.'
ELSE
ErrMsg = 'Error allocating '//TRIM(Num2LStr(AryDim1*AryDim2*AryDim3*AryDim4*AryDim5*BYTES_IN_R4Ki))//&
ErrMsg = 'Error allocating '//TRIM(Num2LStr(int(AryDim1,B8Ki)*int(AryDim2,B8Ki)*int(AryDim3,B8Ki)*int(AryDim4,B8Ki)*int(AryDim5,B8Ki)*BYTES_IN_R4Ki))//&
' bytes of memory for the '//TRIM( Descr )//' array.'
END IF
ELSE
Expand Down Expand Up @@ -1155,7 +1155,7 @@ SUBROUTINE AllR8Ary5 ( Ary, AryDim1, AryDim2, AryDim3, AryDim4, AryDim5, Descr,
IF ( ALLOCATED(Ary) ) THEN ! or Sttus=151 on IVF
ErrMsg = 'Error allocating memory for the '//TRIM( Descr )//' array; array was already allocated.'
ELSE
ErrMsg = 'Error allocating '//TRIM(Num2LStr(AryDim1*AryDim2*AryDim3*AryDim4*AryDim5*BYTES_IN_R8Ki))//&
ErrMsg = 'Error allocating '//TRIM(Num2LStr(int(AryDim1,B8Ki)*int(AryDim2,B8Ki)*int(AryDim3,B8Ki)*int(AryDim4,B8Ki)*int(AryDim5,B8Ki)*BYTES_IN_R8Ki))//&
' bytes of memory for the '//TRIM( Descr )//' array.'
END IF
ELSE
Expand Down
13 changes: 13 additions & 0 deletions modules/openfast-library/src/FAST_Subs.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2208,6 +2208,7 @@ SUBROUTINE FAST_InitOutput( p_FAST, y_FAST, Init, ErrStat, ErrMsg )
INTEGER(IntKi) :: iRot ! Rotor index for DO loops.
INTEGER(IntKi) :: indxNext ! The index of the next value to be written to an array
INTEGER(IntKi) :: NumOuts ! number of channels to be written to the output file(s)
INTEGER(B8Ki) :: AllOutData_bytes ! total bytes required for AllOutData array
character(10) :: Prefix ! Output header prefix

!......................................................
Expand Down Expand Up @@ -2659,6 +2660,18 @@ SUBROUTINE FAST_InitOutput( p_FAST, y_FAST, Init, ErrStat, ErrMsg )
!IF (p_FAST%CompAeroMaps) y_FAST%NOutSteps = p_FAST%NumTSR * p_FAST%NumPitch
y_FAST%NOutSteps = CEILING ( (p_FAST%TMax - p_FAST%TStart) / p_FAST%DT_OUT ) + 1

! Check that the AllOutData array size will not exceed memory limits
AllOutData_bytes = int(NumOuts-1, B8Ki) * int(y_FAST%NOutSteps, B8Ki) * int(BYTES_IN_REAL, B8Ki)
IF ( AllOutData_bytes > 2147483647_B8Ki ) THEN ! 2 GB limit
ErrStat = ErrID_Fatal
ErrMsg = 'The AllOutData array would require '//TRIM(Num2LStr(AllOutData_bytes))// &
' bytes of memory ('//TRIM(Num2LStr(AllOutData_bytes/(1024_B8Ki*1024_B8Ki)))//' MB).'// &
' This exceeds the 2 GB limit for binary output stored in memory.'// &
' Reduce TMax, increase DT_Out, reduce output channels, or switch to text output (OutFileFmt=1).'// &
' (NumOutChans='//TRIM(Num2LStr(NumOuts-1))//', NOutSteps='//TRIM(Num2LStr(y_FAST%NOutSteps))//')'
RETURN
END IF

CALL AllocAry( y_FAST%AllOutData, NumOuts-1, y_FAST%NOutSteps, 'AllOutData', ErrStat, ErrMsg ) ! this does not include the time channel (or case number for steady-state solve)
IF ( ErrStat >= AbortErrLev ) RETURN
y_FAST%AllOutData = 0.0_ReKi
Expand Down
Loading