initialize Subroutine

public subroutine initialize(path, encoding, rc)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in), optional :: path
integer(kind=ut_encoding), intent(in), optional :: encoding
integer, intent(out), optional :: rc

Calls

proc~~initialize~29~~CallsGraph proc~initialize~29 initialize interface~ut_set_ignore_error_message_handler ut_set_ignore_error_message_handler proc~initialize~29->interface~ut_set_ignore_error_message_handler none~is_free CptrWrapper%is_free proc~initialize~29->none~is_free proc~finalize~20 finalize proc~initialize~29->proc~finalize~20 proc~finalize~20->none~is_free

Called by

proc~~initialize~29~~CalledByGraph proc~initialize~29 initialize proc~initialize~2 Initialize proc~initialize~2->proc~initialize~29

Source Code

   subroutine initialize(path, encoding, rc)
      character(len=*), optional, intent(in) :: path
      integer(ut_encoding), optional, intent(in) :: encoding
      integer, optional, intent(out) :: rc
      integer :: status

      _RETURN_UNLESS(instance_is_uninitialized())
      ! System must be once and only once.
      _ASSERT(instance_is_uninitialized(), UTF_DUPLICATE_INITIALIZATION)

      ! Disable error messages from udunits2
      call disable_ut_error_message_handler()

      call initialize_system(SYSTEM_INSTANCE, path, encoding, rc=status)
      if(status /= UT_SUCCESS) then
         ! On failure, free memory
         call finalize()
         _RETURN(UTF_INITIALIZATION_FAILURE)
      end if
      _ASSERT(.not. SYSTEM_INSTANCE%is_free(), UTF_NOT_INITIALIZED)
      _RETURN(UT_SUCCESS)

   end subroutine initialize