mesh group authoring 配列容量を確保する。
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(app_config_authoring), | intent(inout) | :: | authoring | |||
| integer, | intent(in) | :: | required_size |
subroutine ensure_authoring_group_capacity(authoring, required_size) type(app_config_authoring), intent(inout) :: authoring integer, intent(in) :: required_size type(mesh_group_authoring_spec), allocatable :: grown(:) integer :: old_capacity, new_capacity if (required_size <= 0) return if (allocated(authoring%groups)) then old_capacity = size(authoring%groups) else old_capacity = 0 end if if (old_capacity >= required_size) return new_capacity = max(required_size, max(default_group_capacity, max(1, 2*old_capacity))) allocate (grown(new_capacity)) grown = mesh_group_authoring_spec() if (old_capacity > 0) grown(1:old_capacity) = authoring%groups(1:old_capacity) call move_alloc(grown, authoring%groups) end subroutine ensure_authoring_group_capacity