What is iRIClib?

iRIClib is a library for interfacing a river simulation solver with iRIC.

iRIC uses a CGNS file for input/output to/from solvers and grid generating programs. Input-output subroutines for CGNS files are published as an open-source library called cgnslib (see Information on CGNS file and CGNS library ). However, describing the necessary input-output directly using cgnslib would require complicated processing description.

Therefore, the iRIC project offers iRIClib as a library of wrapper subroutines that makes possible the abbreviated description of input-output processing which is frequently used by solvers that work together with iRIC. With these subroutines, input-output processing of a solver that performs calculation using a single structured grid can be described easily.

Note that iRIClib does not offer subroutines necessary for a solver that uses multiple grids or an unstructured grid. In case of such solvers, it is necessary to use cgnslib subroutines directly.

This chapter describes the groups of subroutines included in iRIClib, and examples of using them, along with compilation procedures.

Languages supported by iRIClib

iRIClib is supported for the following languages:

  • FORTRAN
  • C/C++
  • Python

In this manual examples are described with FORTRAN mainly.

In this section, how to use iRIClib from FORTRAN, C/C++, and Python are briefly explained.

Please note that arguments and returned values depends on the language. Please refer to the subsections for each functions in Reference about the format to use the functions from each languages.

FORTRAN

Call iRIClib functions after including the header, like shown in List 90.

List 90 Example of using iRIClib from FORTRAN
1
2
3
include 'iriclib_f.h'

call cg_iric_init_f(fid, ier)

C/C++

Call iRIClib functions after including the header, like shown in List 91.

List 91 Example of using iRIClib from C/C++
1
2
3
4
#include "iriclib.h"

// (abbr.)
ier = cg_iric_init(fid);

Python

Call iRIClib functions after importing iric module, like shown in List 92.

List 92 Example of using iRIClib from Python
1
2
3
from iric import *

cg_iric_init(fid)

How to read this chapter

In this chapter, first Overview explains what kinds of information input/output iRIC assumes a solver to perform, and what subroutines are available for each kind of processing. First, read Section to understand the general concept of iRIClib.

Since Overview gives only an outline of subroutines, see Reference for detailed information, such as lists of arguments for those subroutines.