remove the lens with the label (if present)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(box), | intent(inout) | :: | me | |||
| character(len=*), | intent(in) | :: | label |
subroutine remove_lens(me,label) ! - !! remove the lens with the label (if present) class(box),intent(inout) :: me character(len=*),intent(in) :: label integer :: i type(lens),dimension(:),allocatable :: tmp if (allocated(me%lenses)) then allocate(tmp(0)) do i = 1, size(me%lenses) if (me%lenses(i)%label/=label) tmp = [tmp, me%lenses(i)] end do call move_alloc(tmp, me%lenses) end if end subroutine remove_lens