to_string_2_i_int64 Module Function

pure module function to_string_2_i_int64(value, format) result(string)

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(in) :: value
character(len=*), intent(in) :: format

Return Value character(len=:), allocatable


Variables

Type Visibility Attributes Name Initial
character(len=:), private, allocatable :: adjusted_format
character(len=buffer_len), private :: buffer
integer, private :: stat

Source Code

   pure module function to_string_2_i_int64(value, format) result(string)
      integer(int64), intent(in) :: value
      character(len=*), intent(in) :: format
      character(len=:), allocatable :: string
      character(len=:), allocatable :: adjusted_format

      character(len=buffer_len) :: buffer
      integer :: stat

#ifdef __NVCOMPILER_LLVM__
      adjusted_format = fix_nvhpc_octal_format(format)
#else
      adjusted_format = format
#endif
      write (buffer, "("//adjusted_format//")", iostat=stat) value
      if (stat == 0) then
         string = trim(buffer)
      else
         string = err_sym
      end if

   end function to_string_2_i_int64