|
NCEPLIBS-bacio
2.6.0
|
Contains subroutines to read/write binary files. More...
Go to the source code of this file.
Data Types | |
| interface | bacio_module::baciol |
Modules | |
| module | bacio_module |
| Contains subroutines to read/write binary files. | |
Functions/Subroutines | |
| subroutine | baclose (LU, IRET) |
| Close a byte-addressable file. More... | |
| subroutine | baopen (LU, CFN, IRET) |
| Open a byte-addressable file. More... | |
| subroutine | baopenr (LU, CFN, IRET) |
| Open a byte-addressable file for read only. More... | |
| subroutine | baopenw (LU, CFN, IRET) |
| Open a byte-addressable file for write only. More... | |
| subroutine | baopenwa (LU, CFN, IRET) |
| Open a byte-addressable file for write only with append. More... | |
| subroutine | baopenwt (LU, CFN, IRET) |
| Open a byte-addressable file for write only with truncation. More... | |
| subroutine | baread (LU, IB, NB, KA, A) |
| This subroutine calls bareadl() to read a given number of bytes from an unblocked file, skipping a given number of bytes. More... | |
| subroutine | bareadl (LU, IB, NB, KA, A) |
| This subrouytine is using updated baciol() I/O package to read a given number of bytes from an unblocked file, skipping a given number of bytes. More... | |
| subroutine | baseto (NOPT, VOPT) |
| Set options for byte-addressable I/O. More... | |
| subroutine | bawrite (LU, IB, NB, KA, A) |
| This program is calling bawritel() to write a given number of bytes to an unblocked file, skipping a given number of bytes. More... | |
| subroutine | bawritel (LU, IB, NB, KA, A) |
| This subrouytine writes a given number of bytes to an unblocked file, skipping a given number of bytes. More... | |
| subroutine | wryte (LU, NB, A) |
| This subroutine is calling wrytel() to write a given number of bytes to an unblocked file. More... | |
| subroutine | wrytel (LU, NB, A) |
| Write a given number of bytes to an unblocked file. More... | |
Variables | |
| integer, parameter | bacio_module::bacio_close = 8 |
| Close file. More... | |
| integer, parameter | bacio_module::bacio_noseek = 64 |
| Start I/O from previous spot. More... | |
| integer, parameter | bacio_module::bacio_openr = 1 |
| Open file for read only. More... | |
| integer, parameter | bacio_module::bacio_openrw = 4 |
| Open file for read or write. More... | |
| integer, parameter | bacio_module::bacio_openw = 2 |
| Open file for write only. More... | |
| integer, parameter | bacio_module::bacio_openwa = 256 |
| Open for write only with append. More... | |
| integer, parameter | bacio_module::bacio_openwt = 128 |
| Open for write only with truncation. More... | |
| integer, parameter | bacio_module::bacio_read = 16 |
| Read from the file. More... | |
| integer, parameter | bacio_module::bacio_write = 32 |
| Write to the file. More... | |
| integer, dimension(20), save | bacio_module::baopts = 0 |
| Array of option settings. More... | |
| integer, dimension(fddim), save | bacio_module::fd = FDDIM*0 |
| Array IDs of currently open files. More... | |
| integer, parameter | bacio_module::fddim = 9999 |
| Maximum number of open files in bacio library. More... | |
| subroutine baclose | ( | integer, intent(in) | LU, |
| integer, intent(out) | IRET | ||
| ) |
Close a byte-addressable file.
| lu | unit to close. |
| iret | return code.
|
Definition at line 316 of file baciof.F90.
References bacio_module::bacio_close, bacio_module::fd, and bacio_module::fddim.
| subroutine baopen | ( | integer, intent(in) | LU, |
| character, dimension(*), intent(in) | CFN, | ||
| integer, intent(out) | IRET | ||
| ) |
Open a byte-addressable file.
| lu | unit to open. |
| cfn | filename to open (consisting of nonblank printable characters). |
| iret | return code
|
Definition at line 108 of file baciof.F90.
References bacio_module::bacio_openrw, bacio_module::fd, and bacio_module::fddim.
| subroutine baopenr | ( | integer, intent(in) | LU, |
| character, dimension(*), intent(in) | CFN, | ||
| integer, intent(out) | IRET | ||
| ) |
Open a byte-addressable file for read only.
| lu | unit to open. |
| cfn | filename to open (consisting of nonblank printable characters). |
| iret | return code.
|
Definition at line 150 of file baciof.F90.
References bacio_module::bacio_openr, bacio_module::fd, and bacio_module::fddim.
| subroutine baopenw | ( | integer, intent(in) | LU, |
| character, dimension(*), intent(in) | CFN, | ||
| integer, intent(out) | IRET | ||
| ) |
Open a byte-addressable file for write only.
| lu | unit to open. |
| cfn | filename to open (consisting of nonblank printable characters). |
| iret | return code.
|
Definition at line 192 of file baciof.F90.
References bacio_module::bacio_openw, bacio_module::fd, and bacio_module::fddim.
| subroutine baopenwa | ( | integer, intent(in) | LU, |
| character, dimension(*), intent(in) | CFN, | ||
| integer, intent(out) | IRET | ||
| ) |
Open a byte-addressable file for write only with append.
| lu | unit to open. |
| cfn | filename to open (consisting of nonblank printable characters). |
| iret | return code.
|
Definition at line 276 of file baciof.F90.
References bacio_module::bacio_openwa, bacio_module::fd, and bacio_module::fddim.
| subroutine baopenwt | ( | integer, intent(in) | LU, |
| character, dimension(*), intent(in) | CFN, | ||
| integer, intent(out) | IRET | ||
| ) |
Open a byte-addressable file for write only with truncation.
| lu | unit to open. |
| cfn | filename to open (consisting of nonblank printable characters). |
| iret | return code.
|
Definition at line 234 of file baciof.F90.
References bacio_module::bacio_openwt, bacio_module::fd, and bacio_module::fddim.
| subroutine baread | ( | integer, intent(in) | LU, |
| integer, intent(in) | IB, | ||
| integer, intent(in) | NB, | ||
| integer, intent(out) | KA, | ||
| character, dimension(nb), intent(out) | A | ||
| ) |
This subroutine calls bareadl() to read a given number of bytes from an unblocked file, skipping a given number of bytes.
The physical I/O is blocked into four 4096-byte buffers if the byte-addressable option 1 has been set to 1 by baseto. This buffered reading is incompatible with no-seek reading.
| lu | unit to read. |
| ib | number of bytes to skip. (If ib<0, then the file is accessed with no seeking) |
| nb | number of bytes to read. |
| ka | number of bytes actually read. |
| a | Buffer where data are copied to from file. Must be of sufficient size to hold data. |
Definition at line 358 of file baciof.F90.
References bareadl().
| subroutine bareadl | ( | integer, intent(in) | LU, |
| integer(kind=8), intent(in) | IB, | ||
| integer(kind=8), intent(in) | NB, | ||
| integer(kind=8), intent(out) | KA, | ||
| character, dimension(nb), intent(out) | A | ||
| ) |
This subrouytine is using updated baciol() I/O package to read a given number of bytes from an unblocked file, skipping a given number of bytes.
The physical I/O is blocked into four 4096-byte buffers if the byte-addressable option 1 has been set to 1 by baseto. This buffered reading is incompatible with no-seek reading.
| [in] | lu | unit to read. |
| [in] | ib | number of bytes to skip (if ib<0, then the file is accessed with no seeking). |
| [in] | nb | number of bytes to read. |
| [out] | ka | number of bytes actually read. |
| [out] | a | Buffer where data are copied to from file. Must be of sufficient size to hold data. |
Definition at line 401 of file baciof.F90.
References bacio_module::bacio_noseek, bacio_module::bacio_read, bacio_module::baopts, bacio_module::fd, and bacio_module::fddim.
Referenced by bafrindexl(), bafrreadl(), and baread().
| subroutine baseto | ( | integer | NOPT, |
| integer | VOPT | ||
| ) |
Set options for byte-addressable I/O.
(There is currently only one valid option.)
All options default to 0.
Option 1: Blocked reading option:
If the option value is 1, then the reading is blocked into four 4096-byte buffers. This may be efficient if the reads will be requested in much smaller chunks. otherwise, each call to baread initiates a physical read.
| nopt | option number. |
| vopt | option value. |
Definition at line 79 of file baciof.F90.
References bacio_module::baopts.
| subroutine bawrite | ( | integer, intent(in) | LU, |
| integer, intent(in) | IB, | ||
| integer, intent(in) | NB, | ||
| integer, intent(out) | KA, | ||
| character, dimension(nb), intent(in) | A | ||
| ) |
This program is calling bawritel() to write a given number of bytes to an unblocked file, skipping a given number of bytes.
| [in] | lu | unit to write. |
| [in] | ib | number of bytes to skip. (If ib<0, then the file is accessed with no seeking.) |
| [in] | nb | number of bytes to write. |
| [out] | ka | integer number of bytes actually written. |
| [in] | a | data to write. |
Definition at line 506 of file baciof.F90.
References bawritel().
| subroutine bawritel | ( | integer, intent(in) | LU, |
| integer(kind = 8), intent(in) | IB, | ||
| integer(kind = 8), intent(in) | NB, | ||
| integer(kind = 8), intent(out) | KA, | ||
| character, dimension(nb), intent(in) | A | ||
| ) |
This subrouytine writes a given number of bytes to an unblocked file, skipping a given number of bytes.
| [in] | lu | unit to write. |
| [in] | ib | number of bytes to skip. (If ib < 0, then the file is accessed with no seeking). |
| [in] | nb | number of bytes to write. |
| [out] | ka | number of bytes actually written. |
| [in] | a | data to write. |
Definition at line 537 of file baciof.F90.
References bacio_module::bacio_noseek, bacio_module::bacio_write, bacio_module::fd, and bacio_module::fddim.
Referenced by bafrwritel(), and bawrite().
| subroutine wryte | ( | integer, intent(in) | LU, |
| integer, intent(in) | NB, | ||
| character, dimension(nb), intent(in) | A | ||
| ) |
This subroutine is calling wrytel() to write a given number of bytes to an unblocked file.
| [in] | lu | unit to which to write. |
| [in] | nb | number of bytes to write. |
| [in] | a | data to write. |
Definition at line 582 of file baciof.F90.
References wrytel().
| subroutine wrytel | ( | integer, intent(in) | LU, |
| integer(kind = 8), intent(in) | NB, | ||
| character, dimension(nb), intent(in) | A | ||
| ) |
Write a given number of bytes to an unblocked file.
| [in] | lu | unit to which to write. |
| [in] | nb | number of bytes to write. |
| [in] | a | data to write. |
Definition at line 608 of file baciof.F90.
References bacio_module::bacio_noseek, bacio_module::bacio_write, bacio_module::fd, and bacio_module::fddim.
Referenced by wryte().