MODULE equipments_PowerLimit IMPLICIT NONE PUBLIC real(8) :: Power_sigma, max_Power_sigma real(8) :: num_of_active_Jenerators, Jenerator_power real(8) :: power_num_of_Jenerators, drilling_num_of_Jenerators real(8), dimension(4) :: drilling_console_Jenerators !contains !------------------------------------------------------------ ! subroutine PowerLimits ! !subroutine PowerLimits(Power_sigma) ! ! USE Pumps_VARIABLES ! USE Drawworks_VARIABLES ! USE RTable_VARIABLES ! USE CPowerVariables ! USE CDrillingConsoleVariables ! !use equipments_PowerLimit !! !IMPLICIT NONE ! !integer :: ii ! ! ! Power_sigma=2.*(PUMP(1)%Vt*PUMP(1)%ia_new)+2.*(PUMP(2)%Vt*PUMP(2)%ia_new)+2.*(PUMP(3)%Vt*PUMP(3)%ia_new)+(RTable%Vt*RTable%ia_new)+2.*(Drawworks%Vt*Drawworks%ia_new) ! !write(*,*) 'Power_sigma=', Power_sigma ! ! ! power_num_of_Jenerators=sngl(NumberOfgenerators) ! Jenerator_power=GeneratorPowerRating ! drilling_console_Jenerators(1)=GEN1BTNLED ! drilling_console_Jenerators(2)=GEN2BTNLED ! drilling_console_Jenerators(3)=GEN3BTNLED ! drilling_console_Jenerators(4)=GEN4BTNLED ! ! drilling_num_of_Jenerators=0. ! !do ii=1,4 ! ! if (drilling_console_Jenerators(ii)=1) then ! ! drilling_num_of_Jenerators=drilling_num_of_Jenerators+1. ! ! end if ! !end do ! drilling_num_of_Jenerators=sngl(sum(drilling_console_Jenerators)) ! ! if (power_num_of_Jenerators>drilling_num_of_Jenerators) then ! num_of_active_Jenerators=drilling_num_of_Jenerators ! else if (power_num_of_Jenerators<=drilling_num_of_Jenerators) then ! num_of_active_Jenerators=power_num_of_Jenerators ! end if ! ! max_Power_sigma=num_of_active_Jenerators*Jenerator_power ! ! ! end subroutine PowerLimits !------------------------------------------------------------ End MODULE equipments_PowerLimit