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~27~~CallsGraph proc~initialize~27 initialize interface~mapl_assert MAPL_Assert proc~initialize~27->interface~mapl_assert interface~ut_set_ignore_error_message_handler ut_set_ignore_error_message_handler proc~initialize~27->interface~ut_set_ignore_error_message_handler none~is_free CptrWrapper%is_free proc~initialize~27->none~is_free proc~finalize~18 finalize proc~initialize~27->proc~finalize~18 proc~mapl_return MAPL_Return proc~initialize~27->proc~mapl_return proc~finalize~18->none~is_free at at proc~mapl_return->at insert insert proc~mapl_return->insert proc~mapl_throw_exception MAPL_throw_exception proc~mapl_return->proc~mapl_throw_exception

Called by

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

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

      ! System must be initialized once and only once.
      _ASSERT_RC(instance_is_uninitialized(), 'UDSystem is initialized already.', UTF_INITIALIZATION_FAILURE)

      ! Disable error messages from udunits2
      call disable_ut_error_message_handler()

      call initialize_system(SYSTEM_INSTANCE, path, encoding, rc=status)
      if(.not. is_ut_success(status)) then
         ! On failure, free memory
         call finalize()
         _RETURN(_FAILURE)
      end if
      _ASSERT_RC(.not. SYSTEM_INSTANCE%is_free(), 'Failed to initialize UDSystem', UTF_NOT_INITIALIZED)
      _RETURN(_SUCCESS)

   end subroutine initialize