penf Module

module~~penf~~UsesGraph module~penf penf module~penf_global_parameters_variables penf_global_parameters_variables module~penf_global_parameters_variables->module~penf module~penf_b_size penf_b_size module~penf_global_parameters_variables->module~penf_b_size module~penf_stringify penf_stringify module~penf_global_parameters_variables->module~penf_stringify module~penf_b_size->module~penf module~penf_b_size->module~penf_stringify module~penf_stringify->module~penf iso_fortran_env iso_fortran_env iso_fortran_env->module~penf_stringify
Help

Portability Environment for Fortran poor people.

PENF GitHub tag

License License License License

Status Build Status Coverage Status

PENF, Portability Environment for Fortran poor people

A KISS library for exploiting codes portability for modern (2003+) Fortran projects.

  • PENF is a pure Fortran (KISS) library for achieving portable codes for modern Fortran projects;
  • PENF provides many number-to-string and viceversa facilities;
  • PENF is Fortran 2003+ standard compliant;
  • PENF is a Free, Open Source Project.

Table of Contents

Issues

GitHub issues Ready in backlog In Progress Open bugs

Compiler Support

Compiler Compiler Compiler Compiler Compiler Compiler

What is PENF?

Fortran is the most popular programming language for scientific computing. With Fortran it is quite simple obtain fast code and manage large multidimensional array. Because Fortran permits the achievement of high performance it is also used on great range of different computer-architectures, and often on the fastest supercomputer in the world. Therefore Fortran programs must be portable: portability means that the code will give the same results on every different computer-architectures. One of the most important goal of the numeric code is to control the numeric error due to finite precision of numerical operations. Fortran uses the IEEE representations. Integers and reals (floating point) are represented with a finite precision. So when the code computes an operation it has a truncation error due to the truncation of the numerical finite representations. For numerical and more in general scientific applications this source of errors must be controlled. The programmer must know which is the precision associated to the code variables. Before the standard Fortran 90/95 there are not any way to select the precision of the numerical variables in a portable fashion.

Modern Fortran standards (2003+) have introduced better support for codes portability. With the possibility to specify a kind parameter for variables, the standard Fortran 90+ makes available useful functions to select the kind precision in a portable parametric way. Using these functions the programmer can accurately control the precision of its own variables in a portable manner.

PENF module provides an effective KISS library to achieve portability and concurrently it provides many tools to handles parametrized numbers.

Go to Top

Main features

The library provides portable kind-parameters and many useful procedures to deal with them:

  • integer and reals parameters for 1,2,4,8,16 bytes-like representations;
  • integer and real formats definitions for all parameters;
  • integer and real minimum maximum representable numbers;
  • number-to-string and string-to-number casting procedures;
  • endianism procedures checking.

Any feature request is welcome.

Go to Top

Copyrights

PENF is an open source project, it is distributed under a multi-licensing system:

Anyone is interest to use, to develop or to contribute to PENF is welcome, feel free to select the license that best matches your soul!

More details can be found on wiki.

Go to Top

Documentation

Besides this README file the PENF documentation is contained into its own wiki. Detailed documentation of the API is contained into the GitHub Pages that can also be created locally by means of ford tool.

A Taste of PENF

To be written.

Go to Top

Used By

module~~penf~~UsedByGraph module~penf penf module~foxy_xml_tag foxy_xml_tag module~penf->module~foxy_xml_tag module~befor64 befor64 module~penf->module~befor64 module~stringifor stringifor module~penf->module~stringifor module~foxy foxy module~penf->module~foxy module~foxy_xml_file foxy_xml_file module~penf->module~foxy_xml_file module~stringifor_string_t stringifor_string_t module~penf->module~stringifor_string_t module~befor64_pack_data_m befor64_pack_data_m module~penf->module~befor64_pack_data_m module~foxy_xml_tag->module~foxy module~foxy_xml_tag->module~foxy_xml_file module~befor64->module~stringifor_string_t module~stringifor->module~foxy_xml_tag program~parse_file_simple parse_file_simple module~foxy->program~parse_file_simple program~create_tag create_tag module~foxy->program~create_tag program~add_attributes add_attributes module~foxy->program~add_attributes program~delete_attributes delete_attributes module~foxy->program~delete_attributes program~parse_string_simple parse_string_simple module~foxy->program~parse_string_simple program~indent_tag indent_tag module~foxy->program~indent_tag program~delete_content delete_content module~foxy->program~delete_content program~add_tag add_tag module~foxy->program~add_tag program~delete_tag delete_tag module~foxy->program~delete_tag program~write_tag write_tag module~foxy->program~write_tag module~foxy_xml_file->module~foxy module~stringifor_string_t->module~stringifor module~befor64_pack_data_m->module~befor64
Help

Interfaces

public interface bit_size

Overloading of the intrinsic bit_size function for computing the number of bits of (also) real and character variables.

public interface digit

Compute the number of digits in decimal base of the input integer.

  • private elemental function digit_I8(n) result(digit)

    Arguments

    Type IntentOptional AttributesName
    integer(kind=I8P), intent(in) :: n

    Input integer.

    Return Value integer(kind=I4P)

    Number of digits.

    Description

    Compute the number of digits in decimal base of the input integer.

  • private elemental function digit_I4(n) result(digit)

    Arguments

    Type IntentOptional AttributesName
    integer(kind=I4P), intent(in) :: n

    Input integer.

    Return Value integer(kind=I4P)

    Number of digits.

    Description

    Compute the number of digits in decimal base of the input integer.

  • private elemental function digit_I2(n) result(digit)

    Arguments

    Type IntentOptional AttributesName
    integer(kind=I2P), intent(in) :: n

    Input integer.

    Return Value integer(kind=I4P)

    Number of digits.

    Description

    Compute the number of digits in decimal base of the input integer.

  • private elemental function digit_I1(n) result(digit)

    Arguments

    Type IntentOptional AttributesName
    integer(kind=I1P), intent(in) :: n

    Input integer.

    Return Value integer(kind=I4P)

    Number of digits.

    Description

    Compute the number of digits in decimal base of the input integer.


Functions

private elemental function digit_I8(n) result(digit)

Arguments

Type IntentOptional AttributesName
integer(kind=I8P), intent(in) :: n

Input integer.

Return Value integer(kind=I4P)

Number of digits.

Description

Compute the number of digits in decimal base of the input integer.

private elemental function digit_I4(n) result(digit)

Arguments

Type IntentOptional AttributesName
integer(kind=I4P), intent(in) :: n

Input integer.

Return Value integer(kind=I4P)

Number of digits.

Description

Compute the number of digits in decimal base of the input integer.

private elemental function digit_I2(n) result(digit)

Arguments

Type IntentOptional AttributesName
integer(kind=I2P), intent(in) :: n

Input integer.

Return Value integer(kind=I4P)

Number of digits.

Description

Compute the number of digits in decimal base of the input integer.

private elemental function digit_I1(n) result(digit)

Arguments

Type IntentOptional AttributesName
integer(kind=I1P), intent(in) :: n

Input integer.

Return Value integer(kind=I4P)

Number of digits.

Description

Compute the number of digits in decimal base of the input integer.


Subroutines

public subroutine check_endian()

Arguments

None

Description

Check the type of bit ordering (big or little endian) of the running architecture.

public subroutine penf_init()

Arguments

None

Description

Initialize PENF's variables that are not initialized into the definition specification.

public subroutine penf_print(unit, pref, iostat, iomsg)

Arguments

Type IntentOptional AttributesName
integer(kind=I4P), intent(in) :: unit

Logic unit.

character(len=*), intent(in), optional :: pref

Prefixing string.

integer(kind=I4P), intent(out), optional :: iostat

IO error.

character(len=*), intent(out), optional :: iomsg

IO error message.

Description

Print to the specified unit the PENF's environment data.