eTurb
KTH Toolbox: io_tools

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/Subroutines

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_mfis (offs, uf, lnx, lny, lnz, lnel, ifskip)
 Read scalar filed from the file. More...
 

Detailed Description

Function/Subroutine Documentation

◆ io_file_close()

subroutine io_file_close ( )

Close all opened files up to sotred max unit numer.

See also
io_file_freeid

◆ io_file_freeid()

subroutine io_file_freeid ( integer  iunit,
integer  ierr 
)

Get free file unit number and store max unit value.

Parameters
[out]iunitfile unit
[out]ierrerror mark
See also
io_file_close

◆ io_mbyte_close()

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.

Parameters
[out]ierrerror mark

◆ io_mbyte_open()

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.

Parameters
[in]hnamefile name
[out]ierrerror mark

◆ io_mfis()

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.

Parameters
[in,out]offsoffset of global vector beginning
[out]ufscalar field
[in]lnx,lny,lnzelement size
[in]lnelnumber of elements
[in]ifskipreading flag (for non-mpi formats)
Remarks
This routine uses global scratch space VRTHOV and SCRNS

◆ io_mfo_fname()

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.

Parameters
[out]fnamefile name
[in]bnamebase name
[in]prefixprefix
[out]ierrerror mark

◆ io_mfos()

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.

Parameters
[in,out]offsoffset of global vector beginning
[in]lvsscalar to write
[in]lnx,lny,lnzelement dimensions
[in]lnellocal number of field elements
[in]lnelgglobal number of filed elements
[in]lndimwritten domain dimension
Remarks
This routine uses global scratch space SCRUZ.

◆ io_mfov()

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.

Parameters
[in,out]offsoffset of global vector beginning
[in]lvx,lvy,lvzvector to write
[in]lnx,lny,lnzelement dimensions
[in]lnellocal number of filed elements
[in]lnelgglobal number of filed elements
[in]lndimwritten domain dimension
Remarks
This routine uses global scratch space SCRUZ.

◆ io_register()

subroutine io_register ( )

Register io tool module.

Note
This routine should be called in frame_usr_register