SURFEX v8.1
General documentation of Surfex
|
Go to the source code of this file.
Functions | |
void | c_bytes_io_open_ (int *unit, char *name, char *mode, int *iret, int l1, int l2) |
void | c_bytes_io_open__ (int *unit, char *name, char *mode, int *iret, int l1, int l2) |
void | c_bytes_io_open (int *unit, char *name, char *mode, int *iret, int l1, int l2) |
void | c_bytes_io_seek_ (int *unit, int *offset, int *whence, int *iret) |
void | c_bytes_io_seek (int *unit, int *offset, int *whence, int *iret) |
void | c_bytes_io_tell_ (int *unit, int *iret) |
void | c_bytes_io_tell__ (int *unit, int *iret) |
void | c_bytes_io_tell (int *unit, int *iret) |
void | c_bytes_io_read_ (int *unit, char *buffer, int *nbytes, int *iret) |
void | c_bytes_io_read__ (int *unit, char *buffer, int *nbytes, int *iret) |
void | c_bytes_io_read (int *unit, char *buffer, int *nbytes, int *iret) |
void | c_bytes_io_write_ (int *unit, char *buffer, int *nbytes, int *iret) |
void | c_bytes_io_write__ (int *unit, char *buffer, int *nbytes, int *iret) |
void | c_bytes_io_write (int *unit, char *buffer, int *nbytes, int *iret) |
void | c_bytes_io_close_ (int *unit, int *iret) |
void | c_bytes_io_close__ (int *unit, int *iret) |
void | c_bytes_io_close (int *unit, int *iret) |
void | c_bytes_io_flush_ (int *unit) |
void | c_bytes_io_flush__ (int *unit) |
void | c_bytes_io_flush (int *unit) |
Variables | |
static FILE ** | fptable = NULL |
static int | fptableSize = 0 |
static pthread_mutex_t | fpTableBusy = PTHREAD_MUTEX_INITIALIZER |
static long | size = SIZE |
static int | sizeSet = 0 |
static char * | envSize |
static char ** | fileBuffer = NULL |
static char * | debugLevel |
static int | debugSet = 0 |
void c_bytes_io_close | ( | int * | unit, |
int * | iret | ||
) |
Definition at line 801 of file bytes_io.c.
void c_bytes_io_close_ | ( | int * | unit, |
int * | iret | ||
) |
void c_bytes_io_close__ | ( | int * | unit, |
int * | iret | ||
) |
void c_bytes_io_flush | ( | int * | unit | ) |
void c_bytes_io_flush_ | ( | int * | unit | ) |
void c_bytes_io_flush__ | ( | int * | unit | ) |
void c_bytes_io_open | ( | int * | unit, |
char * | name, | ||
char * | mode, | ||
int * | iret, | ||
int | l1, | ||
int | l2 | ||
) |
Definition at line 530 of file bytes_io.c.
void c_bytes_io_open_ | ( | int * | unit, |
char * | name, | ||
char * | mode, | ||
int * | iret, | ||
int | l1, | ||
int | l2 | ||
) |
void c_bytes_io_open__ | ( | int * | unit, |
char * | name, | ||
char * | mode, | ||
int * | iret, | ||
int | l1, | ||
int | l2 | ||
) |
void c_bytes_io_read | ( | int * | unit, |
char * | buffer, | ||
int * | nbytes, | ||
int * | iret | ||
) |
Definition at line 718 of file bytes_io.c.
void c_bytes_io_read_ | ( | int * | unit, |
char * | buffer, | ||
int * | nbytes, | ||
int * | iret | ||
) |
void c_bytes_io_read__ | ( | int * | unit, |
char * | buffer, | ||
int * | nbytes, | ||
int * | iret | ||
) |
void c_bytes_io_seek | ( | int * | unit, |
int * | offset, | ||
int * | whence, | ||
int * | iret | ||
) |
Definition at line 608 of file bytes_io.c.
void c_bytes_io_seek_ | ( | int * | unit, |
int * | offset, | ||
int * | whence, | ||
int * | iret | ||
) |
void c_bytes_io_tell | ( | int * | unit, |
int * | iret | ||
) |
Definition at line 661 of file bytes_io.c.
void c_bytes_io_tell_ | ( | int * | unit, |
int * | iret | ||
) |
void c_bytes_io_tell__ | ( | int * | unit, |
int * | iret | ||
) |
void c_bytes_io_write | ( | int * | unit, |
char * | buffer, | ||
int * | nbytes, | ||
int * | iret | ||
) |
Definition at line 766 of file bytes_io.c.
void c_bytes_io_write_ | ( | int * | unit, |
char * | buffer, | ||
int * | nbytes, | ||
int * | iret | ||
) |
void c_bytes_io_write__ | ( | int * | unit, |
char * | buffer, | ||
int * | nbytes, | ||
int * | iret | ||
) |
|
static |
Definition at line 272 of file bytes_io.c.
|
static |
Definition at line 273 of file bytes_io.c.
|
static |
Definition at line 264 of file bytes_io.c.
|
static |
Definition at line 265 of file bytes_io.c.
|
static |
Copyright 1981-2016 ECMWF.
This software is licensed under the terms of the Apache Licence Version 2.0 which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
In applying this licence, ECMWF does not waive the privileges and immunities granted to it by virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
This file describes a number of subroutines which can be called from FORTRAN to handle an unblocked binary file:
BYTES_IO_OPEN to open the file BYTES_IO_CLOSE to close the file BYTES_IO_TELL to give position in the file (optional) BYTES_IO_SEEK to position the file (optional) BYTES_IO_READ to read from the file BYTES_IO_WRITE to write to the file BYTES_IO_FLUSH to flush the file
The subroutines are written in C and use standard library functions for file handling (fopen, fclose, fseek, ftell, fread and fwrite).
These routines are a direct replacement for:
A subroutine which can be called from FORTRAN to open an unblocked binary file and return a suitable unit number for use in calls to BYTES_IO_READ, and BYTES_IO_WRITE, BYTES_IO_SEEK, BYTES_IO_TELL.
The format and arguments for the subroutine are as follows:
SUBROUTINE BYTES_IO_OPEN(KUNIT,FILENAME,MODE,KRET)
where:
FILENAME = a character string describing the file
MODE = a character string describing the mode of access to the file: r for read w for write a for append
KUNIT = unit number for the file - it is a C FILE pointer and not a FORTRAN unit number.
KRET = -1 = Could not open file. -2 = Invalid file name. -3 = Invalid open mode specified 0 = OK.
A subroutine which can be called from FORTRAN to close an unblocked binary file previously opened with BYTES_IO_OPEN.
The format and arguments for the subroutine are as follows:
SUBROUTINE BYTES_IO_CLOSE(KUNIT,KRET)
where:
KUNIT = unit number for the file; this must have been obtained by calling BYTES_IO_OPEN (see below) - it is a C FILE pointer and not a FORTRAN unit number.
KRET = -1 error in handling the file. 0 = OK.
A subroutine which can be called from FORTRAN to position an unblocked binary file at any desired byte position.
The format and arguments for the subroutine are as follows:
SUBROUTINE BYTES_IO_SEEK(KUNIT,KOFFSET,KSTART,KRET)
where:
KUNIT = unit number for the file; this must have been obtained by calling BYTES_IO_OPEN (see below) - it is a C FILE pointer and not a FORTRAN unit number.
KOFFSET = number of bytes to offset the file; this is used as either an absolute or relative offset depending on the value of KSTART.
KSTART = 0 if KOFFSET is an absolute count from the beginning of the file,
1 if KOFFSET is a relative offset from the current byte position in the file,
2 if KOFFSET is an absolute offset from the end of file.
KRET = -2 if there is an error in handling the file
-1 if end-of-file is encountered (Note that EOF does not cause a program fail, so this value must be explicitly caught by the caller to avoid looping at the EOF) >= 0 byte offset from the start of file after positioning.
A subroutine which can be called from FORTRAN to read a block of bytes from an unblocked binary file. ( Note that this routine behaves differently from BYTES_IO_READ2 on hitting end-of-file. )
The format and arguments for the subroutine are as follows:
SUBROUTINE BYTES_IO_READ(KUNIT,KARRAY,KOUNT,KRET)
where:
KUNIT = unit number for the file; this must have been obtained by calling BYTES_IO_OPEN (see below) - it is a C FILE pointer and not a FORTRAN unit number.
KOUNT = number of BYTES to read from the file.
KARRAY = an INTEGER array to accept the bytes from the read.
KRET = -2 if there is an error in handling the file
-1 if end-of-file is encountered (Note that EOF does not cause a program fail, so this value must be explicitly caught by the caller to avoid looping at the EOF) >= 0 number of BYTES read from the file.
A subroutine which can be called from FORTRAN to write a block of bytes to an unblocked binary file.
The format and arguments for the subroutine are as follows:
SUBROUTINE BYTES_IO_WRITE(KUNIT,KARRAY,KOUNT,KRET)
where:
KUNIT = unit number for the file; this must have been obtained by calling BYTES_IO_OPEN (see below) - it is a C FILE pointer and not a FORTRAN unit number.
KARRAY = an INTEGER array holding the bytes for the write.
KOUNT = number of BYTES to write to the file.
KRET = -1 if there is an error in writing to the file
>= 0 number of BYTES written to the file.
Definition at line 250 of file bytes_io.c.
|
static |
Definition at line 254 of file bytes_io.c.
|
static |
Definition at line 251 of file bytes_io.c.
|
static |
Definition at line 262 of file bytes_io.c.
|
static |
Definition at line 263 of file bytes_io.c.