Intel® Fortran Compiler 18.0 Developer Guide and Reference

HOSTNAM

Portability Function: Returns the current host computer name. This function can also be specified as HOSTNM.

Module

USE IFPORT

result = HOSTNAM (name)

name

(Output) Character*(*). Name of the current host. Should be at least as long as MAX_HOSTNAM_LENGTH + 1. MAX_HOSTNAM_LENGTH is defined in the IFPORT module.

Results

The result type is INTEGER(4). The result is zero if successful. If name is not long enough to contain all of the host name, the function truncates the host name and returns -1.

Example

use IFPORT
character(MAX_HOSTNAM_LENGTH + 1) hostnam
integer(4) istat
ISTAT = HOSTNAM (hostname)