Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mimc linux port #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
8 changes: 6 additions & 2 deletions src/flap_servo/flap_servo.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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
!
Expand Down
10 changes: 7 additions & 3 deletions src/generator_servo/generator_servo.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pilotmm: Numbers in memory are seldom exact zero. Please change to abs().lt.1.d-3. Please also use the original Fortran notations for logical statements, so use .lt. instead of <

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)
Expand Down
4 changes: 2 additions & 2 deletions src/mech_brake/mech_brake.f90
Original file line number Diff line number Diff line change
@@ -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__)
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/servo_with_limits/servo_with_limits.f90
Original file line number Diff line number Diff line change
@@ -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__)
Expand Down Expand Up @@ -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
Expand Down