Nodes of different colours represent the following:
Solid arrows point from a parent (sub)module to the submodule which is descended from it. Dashed arrows point from a module being used to the module or program unit using it.
Get the DECIMAL changeable connection mode for the given unit.
If the unit is connected to an internal file, then the default value of DECIMAL is always returned. This may not be the actual value in force at the time of the call to this procedure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | unit | Logical unit. |
||
| logical, | intent(out) | :: | decimal_point | True if the decimal mode is POINT, false otherwise. |
||
| integer, | intent(out) | :: | iostat | IO status code. |
||
| character(kind=CK,len=*), | intent(inout) | :: | iomsg | IO status message. |
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module.
subroutine get_decimal_mode(unit, decimal_point, iostat, iomsg)
!---------------------------------------------------------------------------------------------------------------------------------
!< Get the DECIMAL changeable connection mode for the given unit.
!<
!< If the unit is connected to an internal file, then the default value of DECIMAL is always returned. This may not be the
!< actual value in force at the time of the call to this procedure.
!---------------------------------------------------------------------------------------------------------------------------------
use, intrinsic :: iso_fortran_env, only : iostat_inquire_internal_unit
!---------------------------------------------------------------------------------------------------------------------------------
integer, intent(in) :: unit !< Logical unit.
logical, intent(out) :: decimal_point !< True if the decimal mode is POINT, false otherwise.
integer, intent(out) :: iostat !< IO status code.
character(kind=CK, len=*), intent(inout) :: iomsg !< IO status message.
character(5) :: decimal_buffer !< Buffer for INQUIRE about DECIMAL, sized for POINT or COMMA.
character(len(iomsg)) :: local_iomsg !< Local variant of iomsg, so it doesn't get inappropriately redefined.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
inquire(unit, decimal=decimal_buffer, iostat=iostat, iomsg=local_iomsg)
if (iostat == iostat_inquire_internal_unit) then
! no way of determining the decimal mode for an internal file
iostat = 0
decimal_point = .true.
return
else if (iostat /= 0) then
iomsg = local_iomsg
return
endif
decimal_point = decimal_buffer == 'POINT'
!---------------------------------------------------------------------------------------------------------------------------------
endsubroutine get_decimal_mode