|
12345678910111213141516171819202122232425262728293031323334353637 |
- module CFormation
- use CFormationVariables
- implicit none
- public
- contains
- integer function SetFormations(count, array)
- !DEC$ ATTRIBUTES DLLEXPORT::SetFormations
- !DEC$ ATTRIBUTES ALIAS: 'SetFormations' :: SetFormations
- implicit none
- integer, intent(in) :: count
- integer :: i
- type(CFormationItem), intent(inout), target :: array(count)
- type(CFormationItem), pointer :: item
- Formation%Count = count
- if(size(Formation%Formations) > 0) then
- deallocate(Formation%Formations)
- end if
- if(count > 0) then
- allocate(Formation%Formations(count))
- do i = 1, count
- item => array(i)
- Formation%Formations(i)%Top = item%Top
- Formation%Formations(i)%Thickness = item%Thickness
- Formation%Formations(i)%Drillablity = item%Drillablity
- Formation%Formations(i)%Abrasiveness = item%Abrasiveness
- Formation%Formations(i)%ThresholdWeight = item%ThresholdWeight
- Formation%Formations(i)%PorePressureGradient = item%PorePressureGradient
- !print*, "==========================="
- !print*, "Formations(", i, ")%Top=", Formations(i)%Top
- !print*, "Formations(",i,")%Thickness", Formations(i)%Thickness
- !print*, "Formations(",i,")%Drillablity", Formations(i)%Drillablity
- end do
- end if
-
- SetFormations = 0
- end function SetFormations
- end module CFormation
|