libgpl

Links

Fortran modules‎ > ‎

gpl

use gpl

Base


call assign_un(int un)
    Output: un
    Assign an unassigned unit number to 'un'.

call assert_true(logical logic, character msg)
    Input: logic, msg
    If not 'logic', print the message and stop.

call errexit(character msg)
    Input: msg
    Print the message and stop.


Command line

    
call from_param(character pname, param)
call from_param(character pname, param, character msg)
call from_param(character pname, param, logical rflag, character msg)
    *param: int, real, character
    Input: pname, msg
    Output: param, rflag
    Read 'param' from the command line argument "pname=param"
    'msg' is a parameter description and will be added to the help message.
    If the routine find the command line argument "pname=param", rflag is true.
    If the routine could not fine the argument, the program will print the help message and stop.
    
call from_param_opt(character pname, param, character msg)
call from_param_opt(character pname, param, logical rflag, character msg)
    *param: int, real, character
    Input: pname, msg
    Output: param, rflag
    Similar to 'from_param', however, the argument is optional and the program does not stop even it cannot find the argument.

call help(character msg)
    Input: msg
    Add 'msg' to the help message.

call print_help()
    Print the help message.

call report_param(character pname, character value)
    Input: pname, value
    Add 'pname: value' to the report.

call print_report()
    Print the command-line-input report.

call get_n2(character fin, integer n1, integer n2)
call get_n2(character fin, integer n1, integer n2, integer esize)
    Input: fin, n1, esize
    Output: n2
    Get slow dimension 'n2' when you know fast dimension 'n1' of a binary file.
    
to_str(value)
    *value: integer, real
    Write the value to a string(len=16) and return it.


Ascii file


call from_asc(character filename, arr(n), integer n)
    *arr: real, complex
    Input: filename, n
    Output: arr(n)
    Read the second column from an ascii file(values in the first column are dummy indexes).

call from_asc_ampphase(character filename, complex arr(n), integer n)
    Input: filename, n
    Output: arr(n)
    Read amplitude(2nd column) and phase(3rd column) from an ascii file and change them to complex.

call to_asc(character filename, arr(n), integer n, idx)
    *arr: real, complex
    *idx: real, real(n) - increment or index
    Write real array values to the 2nd column with index in the 1st column.
    Write complex array values to the 2nd(real) and 3rd(imaginary) columns with index in the 1st column.

call to_asc_ampphase(character filename, complex arr(n), integer n, idx)
    *idx: real, real(n) - increment or index
    Write complex array values to the 2nd(amplitude) and 3rd(phase) columns with index in the 1st column.


Binary file


call from_bin(character filename, real arr(n), integer n)
call from_bin(character filename, arr(n1,n2), integer n1, integer n2)
    *arr(n1,n2): real, double, complex, double complex
    Input: filename, n, n1, n2
    Output: arr(n) or arr(n1,n2)
    Read 'arr' from a binary file.

call from_bin_tr(character filename, arr(n2,n1), integer n2, integer n1)
    *arr(n1,n2): real, double, complex, double complex
    Input: filename, n2(nx, slow dimension), n1(nz, fast dimension)
    Output: arr(nx,nz)
    Transposed version of 'from_bin'

call to_bin(character filename, real arr(n), integer n)
call to_bin(character filename, arr(n1,n2), integer n1, integer n2)
    *arr(n1,n2): real, double, complex, double complex
    Input: filename, n, n1, n2, arr(n) or arr(n1,n2)
    Write 'arr' to a binary file.

call to_bin_tr(character filename, arr(n2,n1), integer n2, integer n1)
    *arr(n1,n2): real, double, complex, double complex
    Input: filename, n2(nx, slow dimension), n1(nz, fast dimension), arr(nx,nz)
    Transposed version of 'to_bin'