system_gethostname(3f) - [M_system:QUERY] get name of current host (LICENSE:PD)
Synopsis
Description
Options
Examples
Author
License
subroutine system_gethostname(string,ierr)
character(len=:),allocatable,intent(out) :: NAME integer,intent(out) :: IERR
The system_gethostname(3f) procedure returns the standard host name for the current machine.
string returns the hostname. Must be an allocatable CHARACTER variable. ierr Upon successful completion, 0 shall be returned; otherwise, -1 shall be returned.
Sample program:
program demo_system_gethostname use M_system, only : system_gethostname implicit none character(len=:),allocatable :: name integer :: ierr call system_gethostname(name,ierr) if(ierr.eq.0)then write(*,("hostname[",a,"]"))name else write(*,(a))ERROR: could not get hostname endif end program demo_system_gethostname
John S. Urban
Public Domain
Nemo Release 3.1 | system_gethostname (3m_system) | March 07, 2025 |