Initalise the model type.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(sdf), | intent(in) | :: | array(:) |
Array of SDFs |
||
procedure(op) | :: | func |
Operator to apply to SDF. |
|||
real(kind=wp), | intent(in), | optional | :: | kopt |
Parameter used in modifier |
function model_init(array, func, kopt) result(out) !! Initalise the model type. type(model) :: out !> Operator to apply to SDF. procedure(op) :: func !> Array of SDFs type(sdf), intent(IN) :: array(:) !> Parameter used in modifier real(kind=wp), optional, intent(IN) :: kopt integer :: i out%array = array out%func => func if(present(kopt))then out%k = kopt else out%k = 0._wp end if do i = 2, size(array) if(array(1)%value%optProps%value%mus /= array(i)%value%optProps%value%mus)then print*,"Error mismatch in model mus in object: ",i end if if(array(1)%value%optProps%value%mua /= array(i)%value%optProps%value%mua)then print*,"Error mismatch in model mua in object: ",i end if if(array(1)%value%optProps%value%hgg /= array(i)%value%optProps%value%hgg)then print*,"Error mismatch in model hgg in object: ",i end if if(array(1)%value%optProps%value%n /= array(i)%value%optProps%value%n)then print*,"Error mismatch in model n in object: ",i end if if(array(1)%value%layer /= array(i)%value%layer)then print*,"Error mismatch in model layer in object: ",i end if end do out%optProps = array(1)%value%optProps out%layer = array(1)%value%layer end function model_init