43 #include "Moocho_Config.h"
46 #ifdef HAVE_MOOCHO_FORTRAN
49 #include "FortranTypes_f_open_file.hpp"
50 #include "FortranTypes_CppFortranStrings.hpp"
51 #include "Teuchos_Assert.hpp"
54 typedef FortranTypes::f_int f_int;
60 FORTRAN_FUNC_DECL_UL_(f_int,FOR_OPEN_FILE,for_open_file) (
const f_int& iunit
61 ,
const f_int i_file[],
const f_int& i_file_len,
const f_int& istatus
62 ,
const f_int& iform,
const f_int& iblank,
const f_int& iaccess
63 ,
const f_int& irecl );
66 FORTRAN_FUNC_DECL_UL_(
void,FOR_CLOSE_FILE,for_close_file) (
67 const f_int& iunit,
const f_int& keep );
73 void FortranTypes::f_open_file(
const f_int iunit,
const char file[]
74 , EOpenStatus status, EOpenForm form, EOpenBlank blank
75 , EOpenAccess access, f_int recl )
79 FortranTypes::f_int int_file[100], int_file_len;
80 result = convert_to_f_int_string( file, int_file, &int_file_len );
82 result, InvalidFileNameException
83 ,
"f_open_file(...) : Error, the "
84 << -result <<
" Character of the file name \""
85 << file <<
"\" is not a valid ASCII character." );
89 result = FORTRAN_FUNC_CALL_UL_(FOR_OPEN_FILE,for_open_file)(
90 iunit, int_file, int_file_len, status, form, blank, access, recl
95 result < 0, InvalidFileNameException
96 ,
"f_open_file(...) : Error, the "
97 << -result <<
" Character of the file name \""
98 << file <<
"\" is not a valid ASCII character." );
100 result > 0, OpenException
101 ,
"f_open_file(...) : Error, the file named \""
102 << file <<
"\" could not be opened and OPEN(...) "
103 <<
"returned and IOSTAT = " << result );
108 void FortranTypes::f_close_file(
const f_int iunit,
bool keep )
110 FORTRAN_FUNC_CALL_UL_(FOR_CLOSE_FILE,for_close_file)( iunit, keep ? 1 : 0 );
114 #endif // HAVE_MOOCHO_FORTRAN
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)