12.07.2015 Views

Intel® Fortran Libraries Reference

Intel® Fortran Libraries Reference

Intel® Fortran Libraries Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

2 Intel <strong>Fortran</strong> <strong>Libraries</strong> <strong>Reference</strong>character*40 libnameCALL GETENV ("LIB",libname)TYPE *, "The LIB variable points to ",libnameGETENVQQPortability Function: Returns the value of an environment variable.Module: USE IFPORTSyntaxresult = GETENVQQ (varname, value)varname(Input) Character*(*). Name of environment variable.value(Output) Character*(*). Value of the specified environment variable, in uppercase.Results:The result type is INTEGER(4). The result is the length of the string returned in value. Zero isreturned if the given variable is not defined.GETENVQQ searches the list of environment variables for an entry corresponding to varname.Environment variables define the environment in which a process executes. For example, the LIBenvironment variable defines the default search path for libraries to be linked with a program.Note that some environment variables may exist only on a per-process basis and may not bepresent at the command-line level.GETENVQQ uses the C runtime routine getenv and SETENVQQ uses the C runtime routine_putenv. From the C documentation:getenv and _putenv use the copy of the environment pointed to by the global variable_environ to access the environment. getenv operates only on the data structures accessible tothe run-time library and not on the environment segment created for the process by theoperating system.In a program that uses the main function, _environ is initialized at program startup to settingstaken from the operating system’s environment.Changes made outside the program by the console SET command, for example, SETMY_VAR=ABCDE, will be reflected by GETENVQQ.GETENVQQ and SETENVQQ will not work properly with the Windows* APIsGetEnvironmentVariable and SetEnvironmentVariable.2-116

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!