Sets the sample type used in allocation of polymorphic variables.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(particle_set), | intent(inout) | :: | this |
Lagrangian array to dump |
pure subroutine particle_set_SetObjectType(this) !> Sets the sample type used in allocation of polymorphic variables. implicit none class(particle_set), intent(inout) :: this !! Lagrangian array to dump ! Work variables type(particle_obj) :: sample !! My sample type(particle_BH_obj) :: sample_BH !! My sample select case (this%part_type) case (PP_TYPE_DEFAULT) allocate(this%sample,source=sample ) case (PP_TYPE_BASSET ) allocate(this%sample,source=sample_BH) end select return end subroutine particle_set_SetObjectType