Remember the name of the star just read (self%n_stars), if it has one.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(SkySphere), | intent(inout) | :: | self | |||
| character(len=*), | intent(in) | :: | name |
its name ('' for none) |
||
| real(kind=wp), | intent(in) | :: | mag |
its apparent magnitude |
subroutine add_name(self, name, mag) type(SkySphere), intent(inout) :: self character(len=*), intent(in) :: name !! its name ('' for none) real(wp), intent(in) :: mag !! its apparent magnitude type(StarName), allocatable :: tmp(:) if (len(name) == 0) return if (.not. allocated(self%names)) allocate(self%names(64)) if (self%n_names == size(self%names)) then allocate(tmp(2 * self%n_names)) tmp(1:self%n_names) = self%names(1:self%n_names) call move_alloc(tmp, self%names) end if self%n_names = self%n_names + 1 self%names(self%n_names) = StarName(name, self%n_stars, mag) end subroutine add_name