soa_check_alloc Subroutine

public subroutine soa_check_alloc(stat, context, err)

Turn a non-zero stat= from an allocate into ERROR_ALLOC.

Arguments

Type IntentOptional Attributes Name
integer(kind=default_int), intent(in) :: stat

Value returned by allocate(..., stat=stat).

character(len=*), intent(in) :: context

What was being allocated, for the message.

type(error_t), intent(inout) :: err

Error state, written only when stat is non-zero.


Calls

proc~~soa_check_alloc~~CallsGraph proc~soa_check_alloc soa_check_alloc interface~to_char to_char proc~soa_check_alloc->interface~to_char proc~error_set error_t%error_set proc~soa_check_alloc->proc~error_set proc~to_char_char to_char_char interface~to_char->proc~to_char_char proc~to_char_dp to_char_dp interface~to_char->proc~to_char_dp proc~to_char_int32 to_char_int32 interface~to_char->proc~to_char_int32 proc~to_char_int64 to_char_int64 interface~to_char->proc~to_char_int64 proc~to_char_logical to_char_logical interface~to_char->proc~to_char_logical proc~to_char_matrix_dp to_char_matrix_dp interface~to_char->proc~to_char_matrix_dp proc~to_char_matrix_int32 to_char_matrix_int32 interface~to_char->proc~to_char_matrix_int32 proc~to_char_matrix_int64 to_char_matrix_int64 interface~to_char->proc~to_char_matrix_int64 proc~to_char_matrix_sp to_char_matrix_sp interface~to_char->proc~to_char_matrix_sp proc~to_char_sp to_char_sp interface~to_char->proc~to_char_sp proc~to_char_vector_dp to_char_vector_dp interface~to_char->proc~to_char_vector_dp proc~to_char_vector_int32 to_char_vector_int32 interface~to_char->proc~to_char_vector_int32 proc~to_char_vector_int64 to_char_vector_int64 interface~to_char->proc~to_char_vector_int64 proc~to_char_vector_sp to_char_vector_sp interface~to_char->proc~to_char_vector_sp

Called by

proc~~soa_check_alloc~~CalledByGraph proc~soa_check_alloc soa_check_alloc proc~soa_read_logical_field soa_read_logical_field proc~soa_read_logical_field->proc~soa_check_alloc proc~soa_resize_int32_field soa_resize_int32_field proc~soa_resize_int32_field->proc~soa_check_alloc proc~soa_resize_int64_field soa_resize_int64_field proc~soa_resize_int64_field->proc~soa_check_alloc proc~soa_resize_logical_field soa_resize_logical_field proc~soa_resize_logical_field->proc~soa_check_alloc proc~soa_resize_real_dp_field soa_resize_real_dp_field proc~soa_resize_real_dp_field->proc~soa_check_alloc proc~soa_resize_real_sp_field soa_resize_real_sp_field proc~soa_resize_real_sp_field->proc~soa_check_alloc proc~soa_write_logical_field soa_write_logical_field proc~soa_write_logical_field->proc~soa_check_alloc interface~soa_read_field soa_read_field interface~soa_read_field->proc~soa_read_logical_field interface~soa_resize_field soa_resize_field interface~soa_resize_field->proc~soa_resize_int32_field interface~soa_resize_field->proc~soa_resize_int64_field interface~soa_resize_field->proc~soa_resize_logical_field interface~soa_resize_field->proc~soa_resize_real_dp_field interface~soa_resize_field->proc~soa_resize_real_sp_field interface~soa_write_field soa_write_field interface~soa_write_field->proc~soa_write_logical_field proc~particle_soa_deserialize particle_soa_t%particle_soa_deserialize proc~particle_soa_deserialize->interface~soa_read_field proc~particle_soa_resize particle_soa_t%particle_soa_resize proc~particle_soa_resize->interface~soa_resize_field proc~particle_soa_serialize particle_soa_t%particle_soa_serialize proc~particle_soa_serialize->interface~soa_write_field proc~particle_soa_allocate particle_soa_t%particle_soa_allocate proc~particle_soa_allocate->proc~particle_soa_resize

Source Code

   subroutine soa_check_alloc(stat, context, err)
      !! Turn a non-zero `stat=` from an `allocate` into `ERROR_ALLOC`.
      integer(default_int), intent(in) :: stat
         !! Value returned by `allocate(..., stat=stat)`.
      character(len=*), intent(in) :: context
         !! What was being allocated, for the message.
      type(error_t), intent(inout) :: err
         !! Error state, written only when `stat` is non-zero.

      if (stat /= 0) then
         call err%set(ERROR_ALLOC, "soa: "//context//" failed, stat "//to_char(int(stat, int64)))
      end if
   end subroutine soa_check_alloc