diff --git a/src/dtu_we_controller/dtu_we_controller.f90 b/src/dtu_we_controller/dtu_we_controller.f90 index 8b2bc72c1f7e03e83e36eeb6bf77752c30064853..8968ad58df515798837b67f57ac4175e529fbf14 100644 --- a/src/dtu_we_controller/dtu_we_controller.f90 +++ b/src/dtu_we_controller/dtu_we_controller.f90 @@ -25,9 +25,10 @@ module dtu_we_controller ! Remember to test this implementation on Linux ! Define external function/subroutine abstract interface interface - subroutine WTController(GenRot,YawBrTAyp,time,ShutDown, U) bind(c,name='WTController') + subroutine WTController(ctrl_input_name, GenRot,YawBrTAyp,time,ShutDown, U) bind(c,name='WTController') use, intrinsic :: iso_c_binding implicit none + character(kind=c_char),dimension(*) :: ctrl_input_name real(c_float) , value :: GenRot,YawBrTAyp,time integer(c_int), value :: ShutDown real(c_float) , intent(inout) :: U(*) @@ -633,7 +634,8 @@ subroutine initstring(istring) bind(c,name='initstring') n_idx = index(tmp1,':') if (n_idx /= 0) then name = tmp1(1:n_idx-1) ! dll name - external_dll%func_name = tmp1(n_idx+1:len_trim(tmp1)) ! function name + ! external_dll%func_name = tmp1(n_idx+1:len_trim(tmp1)) ! function name + external_dll%par_filename = tmp1(n_idx+1:len_trim(tmp1)) ! function name else name = tmp1 end if @@ -956,6 +958,7 @@ subroutine update_external_ctrl_dll(array1, array2) bind(c, name='update_externa logical, save :: is_verbose = .false. real(4), save :: ctrl_output(50) real(mk) time + character(len=256), save :: ctrl_cfg_file !-------------------------------------------------------------------------------------------- !Required inputs from hawc2 to controller in array1: @@ -1019,7 +1022,8 @@ subroutine update_external_ctrl_dll(array1, array2) bind(c, name='update_externa write(6,'(8a20)') 'Time [s]','RotorSpeed [rad/s]','PitchAngle [deg]','GenTorq [Nm]','Pe[W]','RegionSwitch [-]','AdditionPitch [deg]','TwrTopVel [m/s]' endif ! Run the external 3rd part controller - call fp_WTController(external_dll%avrSWAP(1),external_dll%avrSWAP(2), & + ctrl_cfg_file = trim(adjustl(external_dll%par_filename))//C_NULL_CHAR + call fp_WTController(ctrl_cfg_file, external_dll%avrSWAP(1),external_dll%avrSWAP(2), & external_dll%avrSWAP(3),external_dll%is_shutdown, & ctrl_output) external_dll%aero_power = external_dll%avrSWAP(1)*ctrl_output(2) diff --git a/src/modules/user_defined_types.f90 b/src/modules/user_defined_types.f90 index 401edde201dc984c055d71c38d9eb61d2bdbe2cd..9530b1d1ec12a04cc1afb4800888928ab08d3cf5 100644 --- a/src/modules/user_defined_types.f90 +++ b/src/modules/user_defined_types.f90 @@ -207,6 +207,7 @@ module user_defined_types character*256 :: infile ='' character*256 :: outfile='' character*256 :: func_name='' + character*256 :: par_filename='' real(4),dimension(32) :: avrSWAP=0.0 ! The swap array, used to pass data to, and receive data from, the DLL controller. integer(c_int) :: is_shutdown integer(c_int) :: hawc2_status