diff --git a/src/flap_servo/flap_servo.f90 b/src/flap_servo/flap_servo.f90 index 4b4051f..36c419d 100644 --- a/src/flap_servo/flap_servo.f90 +++ b/src/flap_servo/flap_servo.f90 @@ -13,10 +13,12 @@ module flap_servo_mod integer :: stepno = 0 contains !************************************************************************************************** - subroutine init_flap_servo(array1, array2) + subroutine init_flap_servo(array1, array2) bind(c,name="init_flap_servo") ! Initialize Cyclic Flap Controller implicit none + !DEC$ IF .NOT. DEFINED(__LINUX__) !DEC$ ATTRIBUTES DLLEXPORT, C, ALIAS:'init_flap_servo'::init_flap_servo + !DEC$ END IF real(mk) array1(3), array2(1) ! Input parameters ! 1: constant 1 ; Low-pass filter time constant [s] @@ -36,9 +38,11 @@ subroutine init_flap_servo(array1, array2) return end subroutine init_flap_servo !************************************************************************************************** - subroutine update_flap_servo(array1, array2) + subroutine update_flap_servo(array1, array2) bind(c,name="update_flap_servo") implicit none + !DEC$ IF .NOT. DEFINED(__LINUX__) !DEC$ ATTRIBUTES DLLEXPORT, C, ALIAS:'update_flap_servo'::update_flap_servo + !DEC$ END IF real(mk) array1(4), array2(3) ! Input array1 must contains ! diff --git a/src/generator_servo/generator_servo.f90 b/src/generator_servo/generator_servo.f90 index 5bc18bd..dc42d17 100644 --- a/src/generator_servo/generator_servo.f90 +++ b/src/generator_servo/generator_servo.f90 @@ -3,7 +3,7 @@ module generator_servo_mod implicit none contains !************************************************************************************************** - subroutine init_generator_servo(array1,array2) + subroutine init_generator_servo(array1,array2) bind(c,name="init_generator_servo") implicit none !DEC$ IF .NOT. DEFINED(__LINUX__) !DEC$ ATTRIBUTES DLLEXPORT, C, ALIAS:'init_generator_servo'::init_generator_servo @@ -39,7 +39,7 @@ subroutine init_generator_servo(array1,array2) array2 = 0.0_mk end subroutine init_generator_servo !************************************************************************************************** - subroutine init_generator_servo_var_eta(array1,array2) + subroutine init_generator_servo_var_eta(array1,array2) bind(c,name="init_generator_servo_var_eta") implicit none !DEC$ IF .NOT. DEFINED(__LINUX__) !DEC$ ATTRIBUTES DLLEXPORT, C, ALIAS:'init_generator_servo_var_eta'::init_generator_servo_var_eta @@ -147,7 +147,11 @@ subroutine update_generator_servo(array1, array2) Qshaft = array1(4) omegagen = array1(3) ! Reference mech. torque - mech_Qgref = min(Qgref/generatorvar%eta, generatorvar%max_lss_torque) + if(generatorvar%eta==0.0) then + mech_Qgref = generatorvar%max_lss_torque + else + mech_Qgref = min(Qgref/generatorvar%eta, generatorvar%max_lss_torque) + endif ! Low-pass filter generator speed (LSS) Qgdummy = lowpass2orderfilt(generatorvar%deltat, generatorvar%stepno, lowpass2ordergen, mech_Qgref) mech_Qg = Qgdummy(1) diff --git a/src/mech_brake/mech_brake.f90 b/src/mech_brake/mech_brake.f90 index b5a9945..3191280 100644 --- a/src/mech_brake/mech_brake.f90 +++ b/src/mech_brake/mech_brake.f90 @@ -1,4 +1,4 @@ - subroutine init_mech_brake(array1,array2) + subroutine init_mech_brake(array1,array2) bind(c,name="init_mech_brake") use mech_brake_fcns implicit none !DEC$ IF .NOT. DEFINED(__LINUX__) @@ -25,7 +25,7 @@ subroutine init_mech_brake(array1,array2) return end subroutine init_mech_brake !*********************************************************************** - subroutine update_mech_brake(array1,array2) + subroutine update_mech_brake(array1,array2) bind(c,name="update_mech_brake") use mech_brake_fcns ! use imsl implicit none diff --git a/src/servo_with_limits/servo_with_limits.f90 b/src/servo_with_limits/servo_with_limits.f90 index c38c1cd..b964f14 100644 --- a/src/servo_with_limits/servo_with_limits.f90 +++ b/src/servo_with_limits/servo_with_limits.f90 @@ -1,4 +1,4 @@ - subroutine init_servo_with_limits(array1,array2) + subroutine init_servo_with_limits(array1,array2) bind(c,name="init_servo_with_limits") use servo_with_limits_data implicit none !DEC$ IF .NOT. DEFINED(__LINUX__) @@ -42,7 +42,7 @@ subroutine init_servo_with_limits(array1,array2) return end subroutine init_servo_with_limits !*********************************************************************** - subroutine update_servo_with_limits(array1,array2) + subroutine update_servo_with_limits(array1,array2) bind(c,name="update_servo_with_limits") use servo_with_limits_data ! use imsl implicit none