KTH framework for Nek5000 toolboxes; testing version  0.0.1

Input/Output simple tools. More...

+ Collaboration diagram for I/O 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

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...
 

Detailed Description

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.

Module interface:
Global interface list:
Interface provided:
  1. io_register (to Frame module)
  2. io_file_freeid
  3. io_file_close
  4. io_mfo_fname
  5. io_mbyte_open
  6. io_mbyte_close
  7. io_mfov
  8. io_mfos
  9. io_mfiv
  10. io_mfis

Function Documentation

◆ io_file_close()

subroutine io_file_close

Close all opened files up to sotred max unit numer.

See also
io_file_freeid

Definition at line 80 of file io_tools.f.

+ Here is the caller graph for this function:

◆ 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

Definition at line 46 of file io_tools.f.

+ Here is the caller graph for this function:

◆ 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

Definition at line 231 of file io_tools.f.

References byte_close, and byte_close_mpi().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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

Definition at line 181 of file io_tools.f.

References addfid(), byte_open, byte_open_mpi(), mntr_error(), and mntr_log().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ io_mfiv()

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.

Parameters
[in,out]offsoffset of global vector beginning
[out]uf,vf,wfvector field compinents
[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

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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

Definition at line 108 of file io_tools.f.

References mntr_error().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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.

Definition at line 374 of file io_tools.f.

References byte_set_view(), map2reg_2di_e(), map2reg_3di_e(), mfo_outs(), and mntr_warn().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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.

Definition at line 271 of file io_tools.f.

References byte_set_view(), map2reg_2di_e(), map2reg_3di_e(), mfo_outv(), and mntr_warn().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ io_register()

subroutine io_register

Register io tool module.

Note
This routine should be called in frame_usr_register

Definition at line 10 of file io_tools.f.

References mntr_abort(), mntr_mod_is_name_reg(), mntr_mod_reg(), and mntr_warn().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: