KTH framework for Nek5000 toolboxes; testing version
0.0.1
|
Input/Output simple tools. More...
Files | |
file | io_tools.f |
Set of I/O related tools for KTH modules. | |
file | io_tools_block.f |
Block data to initialise common block for I/O routines. | |
Functions | |
subroutine | io_register () |
Register io tool module. More... | |
subroutine | io_file_freeid (iunit, ierr) |
Get free file unit number and store max unit value. More... | |
subroutine | io_file_close () |
Close all opened files up to sotred max unit numer. More... | |
subroutine | io_mfo_fname (fname, bname, prefix, ierr) |
Generate file name according to nek rulles without opening the file. More... | |
subroutine | io_mbyte_open (hname, ierr) |
Open field file. More... | |
subroutine | io_mbyte_close (ierr) |
Close field file. More... | |
subroutine | io_mfov (offs, lvx, lvy, lvz, lnx, lny, lnz, lnel, lnelg, lndim) |
Write single vector to the file. More... | |
subroutine | io_mfos (offs, lvs, lnx, lny, lnz, lnel, lnelg, lndim) |
Write single scalar to the file. More... | |
subroutine | io_mfiv (offs, uf, vf, wf, lnx, lny, lnz, lnel, ifskip) |
Read vector filed from the file. More... | |
subroutine | io_mfis (offs, uf, lnx, lny, lnz, lnel, ifskip) |
Read scalar filed from the file. More... | |
Input/Output simple tools.
Set of I/O speciffic routines for toolbox.
This module is automatically registered by Frame module and should not be registered inside frame_usr_register.
subroutine io_file_close |
Close all opened files up to sotred max unit numer.
Definition at line 80 of file io_tools.f.
subroutine io_file_freeid | ( | integer | iunit, |
integer | ierr | ||
) |
Get free file unit number and store max unit value.
[out] | iunit | file unit |
[out] | ierr | error mark |
Definition at line 46 of file io_tools.f.
subroutine io_mbyte_close | ( | integer | ierr | ) |
Close field file.
This routine closes the file (serial or parallel depending on parmeter set by io_init) using Nek5000 C routines.
[out] | ierr | error mark |
Definition at line 231 of file io_tools.f.
References byte_close, and byte_close_mpi().
subroutine io_mbyte_open | ( | character*132 | hname, |
integer | ierr | ||
) |
Open field file.
This routine opens the file (serial or parallel depending on parmeter set by io_init) using Nek5000 C routines. I need it for a number of tools writing restart files that do not directly stick to the numbering scheme used in mfo_open_files.
[in] | hname | file name |
[out] | ierr | error mark |
Definition at line 181 of file io_tools.f.
References addfid(), byte_open, byte_open_mpi(), mntr_error(), and mntr_log().
subroutine io_mfis | ( | integer*8 | offs, |
real, dimension(lnx*lny*lnz,lnel) | uf, | ||
integer | lnx, | ||
integer | lny, | ||
integer | lnz, | ||
integer | lnel, | ||
logical | ifskip | ||
) |
Read scalar filed from the file.
This is version of mfi_gets that does not perform interpolation and allows to specify element size.
[in,out] | offs | offset of global vector beginning |
[out] | uf | scalar field |
[in] | lnx,lny,lnz | element size |
[in] | lnel | number of elements |
[in] | ifskip | reading flag (for non-mpi formats) |
Definition at line 666 of file io_tools.f.
References bcast(), byte_read, byte_read_mpi(), byte_reverse, byte_reverse8, byte_set_view(), copy(), copy4r(), csend(), err_chk(), gllel(), gllnid(), lim_chk(), mntr_abort(), msgwait(), nekgsync(), and rzero().
subroutine io_mfiv | ( | integer*8 | offs, |
real, dimension(lnx*lny*lnz,lnel) | uf, | ||
real, dimension(lnx*lny*lnz,lnel) | vf, | ||
real, dimension(lnx*lny*lnz,lnel) | wf, | ||
integer | lnx, | ||
integer | lny, | ||
integer | lnz, | ||
integer | lnel, | ||
logical | ifskip | ||
) |
Read vector filed from the file.
This is version of mfi_getv that does not perform interpolation and allows to specify element size.
[in,out] | offs | offset of global vector beginning |
[out] | uf,vf,wf | vector field compinents |
[in] | lnx,lny,lnz | element size |
[in] | lnel | number of elements |
[in] | ifskip | reading flag (for non-mpi formats) |
Definition at line 457 of file io_tools.f.
References bcast(), byte_read, byte_read_mpi(), byte_reverse, byte_reverse8, byte_set_view(), copy(), copy4r(), csend(), err_chk(), gllel(), gllnid(), lim_chk(), mntr_abort(), msgwait(), nekgsync(), and rzero().
subroutine io_mfo_fname | ( | character*132 | fname, |
character*132 | bname, | ||
character*3 | prefix, | ||
integer | ierr | ||
) |
Generate file name according to nek rulles without opening the file.
It is a modified version of mfo_open_files from prepost.f but without equivalence and file opening part. I split file name generation and file opening as different tools can require this.
[out] | fname | file name |
[in] | bname | base name |
[in] | prefix | prefix |
[out] | ierr | error mark |
Definition at line 108 of file io_tools.f.
References mntr_error().
subroutine io_mfos | ( | integer*8 | offs, |
real, dimension(lnx,lny,lnz,lnel) | lvs, | ||
integer | lnx, | ||
integer | lny, | ||
integer | lnz, | ||
integer | lnel, | ||
integer | lnelg, | ||
integer | lndim | ||
) |
Write single scalar to the file.
This routine is based on mfo_outfld but can be used for writing 2D sections of 3D simulation.
[in,out] | offs | offset of global vector beginning |
[in] | lvs | scalar to write |
[in] | lnx,lny,lnz | element dimensions |
[in] | lnel | local number of field elements |
[in] | lnelg | global number of filed elements |
[in] | lndim | written domain dimension |
Definition at line 374 of file io_tools.f.
References byte_set_view(), map2reg_2di_e(), map2reg_3di_e(), mfo_outs(), and mntr_warn().
subroutine io_mfov | ( | integer*8 | offs, |
real, dimension(lnx,lny,lnz,lnel) | lvx, | ||
real, dimension(lnx,lny,lnz,lnel) | lvy, | ||
real, dimension(lnx,lny,lnz,lnel) | lvz, | ||
integer | lnx, | ||
integer | lny, | ||
integer | lnz, | ||
integer | lnel, | ||
integer | lnelg, | ||
integer | lndim | ||
) |
Write single vector to the file.
This routine is based on mfo_outfld but can be used for writing 2D sections of 3D simulation.
[in,out] | offs | offset of global vector beginning |
[in] | lvx,lvy,lvz | vector to write |
[in] | lnx,lny,lnz | element dimensions |
[in] | lnel | local number of filed elements |
[in] | lnelg | global number of filed elements |
[in] | lndim | written domain dimension |
Definition at line 271 of file io_tools.f.
References byte_set_view(), map2reg_2di_e(), map2reg_3di_e(), mfo_outv(), and mntr_warn().
subroutine io_register |
Register io tool module.
Definition at line 10 of file io_tools.f.
References mntr_abort(), mntr_mod_is_name_reg(), mntr_mod_reg(), and mntr_warn().