• INQUIRE on logical unit from NEWUNIT?

    From Loup Blanc@21:1/5 to All on Fri Jan 14 07:00:50 2022
    Hi,

    Is it possible to use INQUIRE function on negative logical unit create with NEWUNIT ?

    I use gfortran 11.2.

    regards.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Loup Blanc@21:1/5 to All on Fri Jan 14 07:31:49 2022
    Le vendredi 14 janvier 2022 à 16:18:32 UTC+1, arjen.m...@gmail.com a écrit :
    On Friday, January 14, 2022 at 4:00:53 PM UTC+1, Loup Blanc wrote:
    Hi,

    Is it possible to use INQUIRE function on negative logical unit create with NEWUNIT ?

    I use gfortran 11.2.

    regards.
    That should be no problem - the fact that the unit number from NEWUNIT is negative merely means that you cannot specify such a number yourself in an OPEN statement. But otherwise I see no reason for it to behave in any other way than unit numbers that
    you specify explicitly.

    Regards,

    Arjen
    OK. I gonna check my code.
    Thanks for your answer.

    (Got your book at home...very precious to me. All my respect for your work!)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Arjen Markus@21:1/5 to Loup Blanc on Fri Jan 14 07:18:30 2022
    On Friday, January 14, 2022 at 4:00:53 PM UTC+1, Loup Blanc wrote:
    Hi,

    Is it possible to use INQUIRE function on negative logical unit create with NEWUNIT ?

    I use gfortran 11.2.

    regards.

    That should be no problem - the fact that the unit number from NEWUNIT is negative merely means that you cannot specify such a number yourself in an OPEN statement. But otherwise I see no reason for it to behave in any other way than unit numbers that
    you specify explicitly.

    Regards,

    Arjen

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gary Scott@21:1/5 to Loup Blanc on Fri Jan 14 09:32:07 2022
    On 1/14/2022 9:00 AM, Loup Blanc wrote:
    Hi,

    Is it possible to use INQUIRE function on negative logical unit create with NEWUNIT ?

    I use gfortran 11.2.

    regards.
    Should be:

    Unit Specifier (UNIT=)
    The unit specifier identifies the I/O unit to be accessed. It takes the following form:
    [UNIT=]io-unit
    io-unit

    For external files, it identifies a logical unit and is one of the
    following:

    A scalar integer expression that refers to a specific file, I/O device,
    or pipe. If necessary, the value is converted to integer data type
    before use. The integer is in the range 0 through 2,147,483,643, equal
    to the value of one of the constants INPUT_UNIT, OUTPUT_UNIT or
    ERROR_UNIT from intrinsic module ISO_FORTRAN_ENV, or a value returned by
    a NEWUNIT= specifier from an OPEN statement.

    Intel Extension(): (Units 5, 6, and 0 are associated with preconnected
    units.)

    An asterisk (*). This is the default (or implicit) external unit, which
    is preconnected for formatted sequential access. (You can also
    preconnect files by using an environment variable.)

    For internal files, it identifies a scalar or array character variable
    that is an internal file. An internal file is designated internal
    storage space (a variable buffer) that is used with formatted (including list-directed) sequential READ and WRITE statements.

    The io-unit must be specified in a control list. If the keyword UNIT is omitted, the io-unit must be first in the control list.

    A unit number is assigned either explicitly through an OPEN statement or implicitly by the system. If a READ statement implicitly opens a file,
    the file's status is STATUS='OLD'. If a WRITE statement implicitly opens
    a file, the file's status is STATUS='UNKNOWN'.

    If the internal file is a scalar character variable, the file has only
    one record; its length is equal to that of the variable.
    If the internal file is an array character variable, the file has a
    record for each element in the array; each record's length is equal to
    one array element.

    An internal file can be read only if the variable has been defined and a
    value assigned to each record in the file. If the variable representing
    the internal file is a pointer, it must be associated; if the variable
    is an allocatable array, it must be currently allocated.

    Before data transfer, an internal file is always positioned at the
    beginning of the first character of the first record.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gary Scott@21:1/5 to Gary Scott on Fri Jan 14 09:33:36 2022
    On 1/14/2022 9:32 AM, Gary Scott wrote:
    On 1/14/2022 9:00 AM, Loup Blanc wrote:
    Hi,

    Is it possible to use INQUIRE function on negative logical unit create
    with NEWUNIT ?

    I use gfortran 11.2.

    regards.
    Should be:

    Unit Specifier (UNIT=)
    The unit specifier identifies the I/O unit to be accessed. It takes the following form:
    [UNIT=]io-unit
    io-unit

    For external files, it identifies a logical unit and is one of the
    following:

    A scalar integer expression that refers to a specific file, I/O device,
    or pipe.

    Edit Intel Extension

    (If necessary, the value is converted to integer data type
    before use.)


    The integer is in the range 0 through 2,147,483,643, equal
    to the value of one of the constants INPUT_UNIT, OUTPUT_UNIT or
    ERROR_UNIT from intrinsic module ISO_FORTRAN_ENV, or a value returned by
    a NEWUNIT= specifier from an OPEN statement.

    Intel Extension(): (Units 5, 6, and 0 are associated with preconnected units.)

    An asterisk (*). This is the default (or implicit) external unit, which
    is preconnected for formatted sequential access. (You can also
    preconnect files by using an environment variable.)

    For internal files, it identifies a scalar or array character variable
    that is an internal file. An internal file is designated internal
    storage space (a variable buffer) that is used with formatted (including list-directed) sequential READ and WRITE statements.

    The io-unit must be specified in a control list. If the keyword UNIT is omitted, the io-unit must be first in the control list.

    A unit number is assigned either explicitly through an OPEN statement or implicitly by the system. If a READ statement implicitly opens a file,
    the file's status is STATUS='OLD'. If a WRITE statement implicitly opens
    a file, the file's status is STATUS='UNKNOWN'.

    If the internal file is a scalar character variable, the file has only
    one record; its length is equal to that of the variable.
    If the internal file is an array character variable, the file has a
    record for each element in the array; each record's length is equal to
    one array element.

    An internal file can be read only if the variable has been defined and a value assigned to each record in the file. If the variable representing
    the internal file is a pointer, it must be associated; if the variable
    is an allocatable array, it must be currently allocated.

    Before data transfer, an internal file is always positioned at the
    beginning of the first character of the first record.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Loup Blanc@21:1/5 to All on Fri Jan 14 08:46:58 2022
    Le vendredi 14 janvier 2022 à 16:33:39 UTC+1, Gary Scott a écrit :
    On 1/14/2022 9:32 AM, Gary Scott wrote:
    On 1/14/2022 9:00 AM, Loup Blanc wrote:
    Hi,


    Is it possible to use INQUIRE function on negative logical unit create
    with NEWUNIT ?

    I use gfortran 11.2.

    regards.
    Should be:

    Unit Specifier (UNIT=)
    The unit specifier identifies the I/O unit to be accessed. It takes the following form:
    [UNIT=]io-unit
    io-unit

    For external files, it identifies a logical unit and is one of the following:

    A scalar integer expression that refers to a specific file, I/O device,
    or pipe.
    Edit Intel Extension

    (If necessary, the value is converted to integer data type
    before use.)
    The integer is in the range 0 through 2,147,483,643, equal
    to the value of one of the constants INPUT_UNIT, OUTPUT_UNIT or
    ERROR_UNIT from intrinsic module ISO_FORTRAN_ENV, or a value returned by
    a NEWUNIT= specifier from an OPEN statement.

    Intel Extension(): (Units 5, 6, and 0 are associated with preconnected units.)

    An asterisk (*). This is the default (or implicit) external unit, which
    is preconnected for formatted sequential access. (You can also
    preconnect files by using an environment variable.)

    For internal files, it identifies a scalar or array character variable that is an internal file. An internal file is designated internal
    storage space (a variable buffer) that is used with formatted (including list-directed) sequential READ and WRITE statements.

    The io-unit must be specified in a control list. If the keyword UNIT is omitted, the io-unit must be first in the control list.

    A unit number is assigned either explicitly through an OPEN statement or implicitly by the system. If a READ statement implicitly opens a file,
    the file's status is STATUS='OLD'. If a WRITE statement implicitly opens
    a file, the file's status is STATUS='UNKNOWN'.

    If the internal file is a scalar character variable, the file has only
    one record; its length is equal to that of the variable.
    If the internal file is an array character variable, the file has a
    record for each element in the array; each record's length is equal to
    one array element.

    An internal file can be read only if the variable has been defined and a value assigned to each record in the file. If the variable representing the internal file is a pointer, it must be associated; if the variable
    is an allocatable array, it must be currently allocated.

    Before data transfer, an internal file is always positioned at the beginning of the first character of the first record.

    Hi Gary!
    Tx for this complete explanation.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)