Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 6/24/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

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) hostname
integer(4) istat
ISTAT = HOSTNAM (hostname)