Skip to content

Commit a10efd5

Browse files
committed
Allow and set default for VS_ContPower_alpha
1 parent b3b646a commit a10efd5

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

rosco/controller/src/ReadSetParameters.f90

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,11 @@ SUBROUTINE ReadControlParameterFileSub(CntrPar, LocalVar, accINFILE, accINFILE_s
478478
CALL ParseInput(FileLines, 'VS_TSRopt', CntrPar%VS_TSRopt, accINFILE(1), ErrVar, CntrPar%VS_ControlMode < 2, UnEc)
479479
CALL ParseInput(FileLines, 'VS_ConstPower_n', CntrPar%VS_ConstPower_n, accINFILE(1), ErrVar, .TRUE., UnEc)
480480
IF (CntrPar%VS_ConstPower_n == 0) CntrPar%VS_ConstPower_n = 1 ! Default is 1
481-
CALL ParseAry(FileLines, 'VS_ConstPower_alpha', CntrPar%VS_ConstPower_alpha, CntrPar%VS_ConstPower_n, accINFILE(1), ErrVar, CntrPar%VS_ConstPower .NE. 1, UnEc)
481+
CALL ParseAry(FileLines, 'VS_ConstPower_alpha', CntrPar%VS_ConstPower_alpha, CntrPar%VS_ConstPower_n, accINFILE(1), ErrVar, .TRUE., UnEc)
482+
IF (SUM(ABS(CntrPar%VS_ConstPower_alpha)) == 0) THEN
483+
PRINT *, 'ROSCO Warning: Setting VS_ConstPower_alpha to default of 1.0 for all entries.'
484+
CntrPar%VS_ConstPower_alpha = 1.0
485+
ENDIF
482486
CALL ParseAry(FileLines, 'VS_ConstPower_U', CntrPar%VS_ConstPower_U, CntrPar%VS_ConstPower_n, accINFILE(1), ErrVar, CntrPar%VS_ConstPower_n == 1, UnEc) ! Allow default if only one parameter
483487
IF (ErrVar%aviFAIL < 0) RETURN
484488

@@ -1336,7 +1340,12 @@ SUBROUTINE CheckInputs(LocalVar, CntrPar, avrSWAP, ErrVar, size_avcMSG)
13361340
ErrVar%aviFAIL = -1
13371341
ErrVar%ErrMsg = 'VS_TSRopt must be greater than zero.'
13381342
ENDIF
1339-
1343+
1344+
IF ((MINVAL(CntrPar%VS_ConstPower_alpha) < 0.0) .OR. (MAXVAL(CntrPar%VS_ConstPower_alpha) > 1.0)) THEN
1345+
ErrVar%aviFAIL = -1
1346+
ErrVar%ErrMsg = 'VS_ConstPower_alpha must be between 0.0 and 1.0.'
1347+
ENDIF
1348+
13401349
!------- SETPOINT SMOOTHER ---------------------------------------------
13411350

13421351
! SS_VSGain

0 commit comments

Comments
 (0)