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.

CStringConfiguration.f90 3.0 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. StringConfiguration%BitDefinition%BitType = bit%BitType
  17. StringConfiguration%BitDefinition%BitSize = bit%BitSize
  18. StringConfiguration%BitDefinition%BitCodeHundreds = bit%BitCodeHundreds
  19. StringConfiguration%BitDefinition%BitCodeTens = bit%BitCodeTens
  20. StringConfiguration%BitDefinition%BitCodeOnes = bit%BitCodeOnes
  21. StringConfiguration%BitDefinition%BitNozzleSize = bit%BitNozzleSize
  22. StringConfiguration%BitDefinition%BitLength = bit%BitLength
  23. StringConfiguration%BitDefinition%BitWeightPerLength = bit%BitWeightPerLength
  24. StringConfiguration%BitDefinition%BitNozzleNo = bit%BitNozzleNo
  25. StringConfiguration%BitDefinition%FloatValve = bit%FloatValve
  26. StringConfiguration%StringConfigurationCount = count
  27. if(StringConfiguration%BitDefinition%FloatValve) then
  28. call InstallFloatValve()
  29. else
  30. call RemoveFloatValve()
  31. endif
  32. if(size(StringConfiguration%StringConfigurations) > 0) then
  33. deallocate(StringConfiguration%StringConfigurations)
  34. end if
  35. if(count > 0) then
  36. allocate(StringConfiguration%StringConfigurations(count))
  37. !j = count
  38. do i = 1, count
  39. item => array(i)
  40. StringConfiguration%StringConfigurations(i)%ComponentType = item%ComponentType
  41. StringConfiguration%StringConfigurations(i)%NumberOfJoint = item%NumberOfJoint
  42. StringConfiguration%StringConfigurations(i)%LengthPerJoint = item%LengthPerJoint
  43. StringConfiguration%StringConfigurations(i)%NominalOd = item%NominalOd
  44. StringConfiguration%StringConfigurations(i)%NominalId = item%NominalId
  45. StringConfiguration%StringConfigurations(i)%WeightPerLength = item%WeightPerLength
  46. StringConfiguration%StringConfigurations(i)%ComponentLength = item%ComponentLength
  47. StringConfiguration%StringConfigurations(i)%NominalToolJointOd = item%NominalToolJointOd
  48. StringConfiguration%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