off_file_object Module

module~~off_file_object~~UsesGraph module~off_file_object off_file_object iso_fortran_env iso_fortran_env iso_fortran_env->module~off_file_object module~off_error_object off_error_object iso_fortran_env->module~off_error_object finer finer finer->module~off_file_object penf penf penf->module~off_file_object penf->module~off_error_object module~off_error_object->module~off_file_object
Help

OFF file object definition and implementation.

Used By

module~~off_file_object~~UsedByGraph module~off_file_object off_file_object module~off_files_collection_object off_files_collection_object module~off_file_object->module~off_files_collection_object module~off_file_grid_object off_file_grid_object module~off_file_object->module~off_file_grid_object module~off_objects off_objects module~off_file_object->module~off_objects module~off_files_collection_object->module~off_objects module~off_file_grid_object->module~off_objects module~off_simulation_object off_simulation_object module~off_file_grid_object->module~off_simulation_object program~off_test_save_load_file_parameters off_test_save_load_file_parameters module~off_objects->program~off_test_save_load_file_parameters program~off_test_load_file_parameters off_test_load_file_parameters module~off_objects->program~off_test_load_file_parameters program~off_test_save_load_file_grid off_test_save_load_file_grid module~off_objects->program~off_test_save_load_file_grid module~off_simulation_object->module~off_objects
Help


Variables

TypeVisibility AttributesNameInitial
integer(kind=I4P), public, parameter:: ERROR_ALREADY_CONNECTED =1

Already connected error code.

integer(kind=I4P), public, parameter:: ERROR_NOT_CONNECTED =2

Not connected error code.

integer(kind=I4P), public, parameter:: ERROR_NOT_INITIALIZED =3

Not initialized error code.

character(len=5), private, parameter:: UNSET_FILE_NAME ='unset'

Default, unset file name.


Derived Types

type, public :: file_object

File object class.

Components

TypeVisibility AttributesNameInitial
type(error_object), public :: error

Errors handler.

character(len=:), public, allocatable:: file_name

File name.

integer(kind=I4P), public :: file_unit =0

File unit.

logical, public :: is_connected =.false.

Sentinel to check if file is connected.

logical, public :: is_initialized =.false.

Sentinel to check if file is initialized.

Type-Bound Procedures

generic, public :: assignment(=) => file_assign_file

Overload =.

procedure, public, pass(self) :: close

Close file.

procedure, public, pass(self) :: description

Return a pretty-formatted description of the file.

procedure, public, pass(self) :: destroy

Destroy file.

procedure, public, pass(lhs) :: file_assign_file

Operator =.

procedure, public, pass(self) :: initialize

Initialize file.

procedure, public, pass(self) :: load_file_name_from_file

Load file name from file.

procedure, public, pass(self) :: open

Open file.

procedure, public, pass(self) :: save_file_name_into_file

Save file name into file.


Functions

private pure function description(self, prefix) result(desc)

Return a pretty-formatted description of the file.

Arguments

Type IntentOptional AttributesName
class(file_object), intent(in) :: self

Files collection.

character(len=*), intent(in), optional :: prefix

Prefixing string.

Return Value character(len=:), allocatable

Description.


Subroutines

private subroutine close(self)

Close file.

Arguments

Type IntentOptional AttributesName
class(file_object), intent(inout) :: self

File object.

private elemental subroutine destroy(self)

Destroy file.

Arguments

Type IntentOptional AttributesName
class(file_object), intent(inout) :: self

File object.

private pure subroutine file_assign_file(lhs, rhs)

Operator =.

Arguments

Type IntentOptional AttributesName
class(file_object), intent(inout) :: lhs

Left hand side.

type(file_object), intent(in) :: rhs

Right hand side.

private elemental subroutine initialize(self, file_name)

Initialize File.

Arguments

Type IntentOptional AttributesName
class(file_object), intent(inout) :: self

File object.

character(len=*), intent(in), optional :: file_name

File name.

private subroutine load_file_name_from_file(self, fini, section_name, option_name, go_on_fail)

Load file name from file.

Arguments

Type IntentOptional AttributesName
class(file_object), intent(inout) :: self

File object.

type(file_ini), intent(in) :: fini

Simulation parameters ini file handler.

character(len=*), intent(in) :: section_name

Option name into the ini file.

character(len=*), intent(in) :: option_name

Option name into the ini file.

logical, intent(in), optional :: go_on_fail

Go on if load fails.

private subroutine open(self, file_name, format, action, access)

Open file.

Arguments

Type IntentOptional AttributesName
class(file_object), intent(inout) :: self

File object.

character(len=*), intent(in), optional :: file_name

File name.

character(len=*), intent(in), optional :: format

File format.

character(len=*), intent(in), optional :: action

File action.

character(len=*), intent(in), optional :: access

File access.

private subroutine save_file_name_into_file(self, fini, section_name, option_name)

Save file name into file.

Arguments

Type IntentOptional AttributesName
class(file_object), intent(inout) :: self

File object.

type(file_ini), intent(inout) :: fini

Simulation parameters ini file handler.

character(len=*), intent(in) :: section_name

Option name into the ini file.

character(len=*), intent(in) :: option_name

Option name into the ini file.