FORCES
FORtran lib for Comp. Env. Sys.
|
Deal with namelist files. More...
Functions/Subroutines | |
subroutine, public | open_nml (file, unit, quiet) |
Open a namelist file. | |
subroutine, public | close_nml (unit) |
Close a namelist file. | |
subroutine, public | position_nml (name, unit, status, first) |
Position a namlist file. | |
Variables | |
integer(i4), parameter, public | positioned = 0 |
Information: file pointer set to namelist group. | |
integer(i4), parameter, public | missing = 1 |
Error: namelist group is missing. | |
integer(i4), parameter, public | length_error = 2 |
Error: namelist group name too long. | |
integer(i4), parameter, public | read_error = 3 |
Error occured during read of namelist file. | |
integer, save, public | nunitnml = -1 |
default namelist unit | |
Deal with namelist files.
This module provides routines to open, close and position namelist files.
COPYING
and COPYING.LESSER
provided with this software. The complete GNU license text can also be found at http://www.gnu.org/licenses/. subroutine, public mo_nml::close_nml | ( | integer, intent(in), optional | unit | ) |
Close a namelist file.
Close a namelist file.
Example
See also example in test directory
[in] | integer, optional :: unit | namelist unit |
Definition at line 130 of file mo_nml.f90.
References mo_message::error_message(), and nunitnml.
subroutine, public mo_nml::open_nml | ( | character(len = *), intent(in) | file, |
integer, intent(in) | unit, | ||
logical, intent(in), optional | quiet | ||
) |
Open a namelist file.
Open a namelist file.
Example
See also example in test directory
[in] | character(len=*) :: file | namelist filename |
[in] | integer :: unit | namelist unit |
[in] | logical, optional :: quiet | Be verbose or not (default: .true.) .true.: no messages .false.: write out messages |
Definition at line 81 of file mo_nml.f90.
References mo_message::error_message(), mo_message::message(), and nunitnml.
subroutine, public mo_nml::position_nml | ( | character(len = *), intent(in) | name, |
integer, intent(in), optional | unit, | ||
integer(i4), intent(out), optional | status, | ||
logical, intent(in), optional | first | ||
) |
Position a namlist file.
Position namelist file pointer for reading a new namelist next.
It positions the namelist file at the correct place for reading
namelist /name/ (case independent).
Example
[in] | character(len=*) :: name | namelist name (case independent) |
[in] | integer, optional :: unit | namelist unit (default: nunitnml) |
[in] | logical, optional :: first | start search at beginning, i.e. rewind the namelist first (default: .true.) .true.: rewind .false.: continue search from current file pointer |
[out] | integer(i4), optional :: status | Set on output to either of POSITIONED (0) - correct MISSING (1) - name not found LENGTH_ERROR (2) - namelist length longer then 256 characters READ_ERROR (3) - error while reading namelist file |
Definition at line 182 of file mo_nml.f90.
References mo_message::error_message(), length_error, missing, nunitnml, positioned, read_error, and mo_string_utils::tolower().
integer(i4), parameter, public mo_nml::length_error = 2 |
Error: namelist group name too long.
Definition at line 42 of file mo_nml.f90.
Referenced by position_nml().
integer(i4), parameter, public mo_nml::missing = 1 |
Error: namelist group is missing.
Definition at line 40 of file mo_nml.f90.
Referenced by position_nml().
integer, save, public mo_nml::nunitnml = -1 |
default namelist unit
Definition at line 47 of file mo_nml.f90.
Referenced by close_nml(), open_nml(), and position_nml().
integer(i4), parameter, public mo_nml::positioned = 0 |
Information: file pointer set to namelist group.
Definition at line 38 of file mo_nml.f90.
Referenced by position_nml().
integer(i4), parameter, public mo_nml::read_error = 3 |
Error occured during read of namelist file.
Definition at line 44 of file mo_nml.f90.
Referenced by position_nml().