Simulation Core
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

62 lines
2.5 KiB

  1. module CStringConfiguration
  2. use CStringConfigurationVariables
  3. implicit none
  4. public
  5. contains
  6. integer function SetStringConfigurations(count, array, bit)
  7. !DEC$ ATTRIBUTES DLLEXPORT::SetStringConfigurations
  8. !DEC$ ATTRIBUTES ALIAS: 'SetStringConfigurations' :: SetStringConfigurations
  9. use CManifolds
  10. implicit none
  11. integer, intent(in) :: count
  12. integer :: i, j
  13. type(CStringItem), intent(inout), target :: array(count)
  14. type(CBitInfo), intent(inout) :: bit
  15. type(CStringItem), pointer :: item
  16. BitDefinition%BitType = bit%BitType
  17. BitDefinition%BitSize = bit%BitSize
  18. BitDefinition%BitCodeHundreds = bit%BitCodeHundreds
  19. BitDefinition%BitCodeTens = bit%BitCodeTens
  20. BitDefinition%BitCodeOnes = bit%BitCodeOnes
  21. BitDefinition%BitNozzleSize = bit%BitNozzleSize
  22. BitDefinition%BitLength = bit%BitLength
  23. BitDefinition%BitWeightPerLength = bit%BitWeightPerLength
  24. BitDefinition%BitNozzleNo = bit%BitNozzleNo
  25. BitDefinition%FloatValve = bit%FloatValve
  26. StringConfigurationCount = count
  27. if(BitDefinition%FloatValve) then
  28. call InstallFloatValve()
  29. else
  30. call RemoveFloatValve()
  31. endif
  32. if(size(StringConfigurations) > 0) then
  33. deallocate(StringConfigurations)
  34. end if
  35. if(count > 0) then
  36. allocate(StringConfigurations(count))
  37. !j = count
  38. do i = 1, count
  39. item => array(i)
  40. StringConfigurations(i)%ComponentType = item%ComponentType
  41. StringConfigurations(i)%NumberOfJoint = item%NumberOfJoint
  42. StringConfigurations(i)%LengthPerJoint = item%LengthPerJoint
  43. StringConfigurations(i)%NominalOd = item%NominalOd
  44. StringConfigurations(i)%NominalId = item%NominalId
  45. StringConfigurations(i)%WeightPerLength = item%WeightPerLength
  46. StringConfigurations(i)%ComponentLength = item%ComponentLength
  47. StringConfigurations(i)%NominalToolJointOd = item%NominalToolJointOd
  48. StringConfigurations(i)%Grade = item%Grade
  49. !print*, 'type=', StringConfigurations(i)%ComponentType
  50. !print*, 'NumberOfJoint=', StringConfigurations(i)%NumberOfJoint
  51. !print*, '-----------------------------------------------------------'
  52. !j = j - 1
  53. end do
  54. end if
  55. SetStringConfigurations = 0
  56. end function SetStringConfigurations
  57. end module CStringConfiguration