Editing
Library Reference
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Subroutines== Because subroutine names are preceded by a <tt>call</tt> statement, it is easy to find occurrences of them being used by typing: <bash>grep "call subroutine_name" {filt,user}/*/*.f90 user/*/*/*.f90</bash> in RSFSRC. Below, data types are indicated in ''italics'' and intent in '''''bold italics'''''. The type <i>multi</i> means that multiple data types can be used (subroutine is overloaded). In the '''Wrapper for''' column, procedure names with no other description belong to the C library. The '''G?''' heading means "Demo-ed in the [[Guide_to_madagascar_API#Fortran-90_interface|Guide to the F90 API]]?". {|class="wikitable" align="center" cellspacing="0" border="1" |- | '''Name''' || '''Arguments''' || '''What it does''' || '''Wrapper for''' || '''G?''' |- | <tt>from_either</tt> || ''file'' '''''in''''' <tt>tag</tt>, ''character'' '''''in''''' <tt>name</tt>, ''multi'' '''''out''''' <tt>value</tt>, optional ''multi'' '''''in''''' <tt>default</tt> || This subroutine looks for the real or integer variable <tt>name</tt> first in the history file, then in the parameter table. If it it is not found and <tt>default</tt> is present, it assigns it to <tt>value</tt>, otherwise it terminates the program. || <tt>sf_histint</tt>, <tt>sf_getint</tt> || N |- | <tt>from_par</tt> || optional ''file'' '''''in''''' <tt>tag</tt>, ''character'' '''''in''''' <tt>name</tt>, ''multi'' '''''out''''' <tt>value</tt>, optional ''multi'' '''''in''''' <tt>default</tt> || If already-opened file handle <tt>tag</tt> is supplied, then it reads into <tt>value</tt> a parameter designated by <tt>name</tt> from a history file. Else, it reads it from the parameter table. If the parameter is not found and a <tt>default</tt> is present, then that is used, else ends with failure. It can read from both history files and parameter tables the following types: integer, integer array, real. Strings can be read only from the history file, and not from the parameter table. Real arrays, logicals and logical arrays can be read only from the parameter table. || <tt>sf_histint</tt>, <tt>sf_getint</tt>, <tt>sf_histints</tt>, <tt>sf_getints</tt>, <tt>sf_histfloat</tt>, <tt>sf_getfloat</tt>, <tt>sf_histstring</tt>, <tt>sf_getfloats</tt>, <tt>sf_getbool</tt>, <tt>sf_getbools</tt> || Y |- | <tt>iaxa</tt> || ''file'' '''''in''''' <tt>tag</tt>, ''axa'' '''''out''''' <tt>axisname</tt>, ''integer'' '''''in''''' <tt>axisnr</tt> || Read axis with number <tt>axisnr</tt> as axis <tt>axisname</tt> from the already-open file header indicated by <tt>tag</tt> || Multiple calls to F90 API's <tt>from_par</tt> || N |- | <tt>oaxa</tt> || ''file'' '''''in''''' <tt>tag,</tt> ''axa'' '''''in''''' <tt>axisname,</tt> ''integer'' '''''in''''' <tt>axisnr</tt> || Write axis <tt>axisname</tt> (i.e. its n, o, d) as axis with number <tt>axisnr</tt> to the already-open file header indicated by <tt>tag</tt> || Multiple calls to F90 API's <tt>from_par</tt> || N |- | <tt>raxa</tt> || ''axa'' '''''in''''' <tt>axisname</tt> || unformatted write to I/O unit nr. 0 (usually stdout, but system-dependent) of the contents of the <tt>axisname</tt> structure (n, o, d) || F90 write statement || N |- | <tt>rsf_read</tt> || ''file'' '''''in''''' <tt>tag</tt>, ''multi'' '''''out''''' <tt>array</tt>, optional ''integer'' '''''in''''' <tt>n</tt> || If <tt>n</tt> is specified, the real or complex <tt>array</tt> must be 1-D and <tt>n</tt> elements will be read into it from an already-opened file specified by <tt>tag</tt>. If <tt>n</tt> is not specified, reads enough to fill the array, and the array can be 1-D, 2-D, 3-D, 4-D or 5-D. || <tt>sf_floatread</tt>, <tt>sf_complexread</tt> || Y |- | <tt>rsf_write</tt> || ''file'' '''''in''''' <tt>tag</tt>, ''multi'' '''''in''''' <tt>array</tt>, optional ''integer'' '''''in''''' <tt>n</tt> || If <tt>n</tt> is specified, real or complex <tt>array</tt> must be 1-D and <tt>n</tt> elements will be written to an already-opened file specified by <tt>tag</tt>. If <tt>n</tt> is not specified, writes to file the entire contents of the array, and the array can be 1-D, 2-D, 3-D, 4-D or 5-D || <tt>sf_floatwrite</tt>, <tt>sf_complexwrite</tt> || Y |- | <tt>settype</tt> || ''file'' '''''in''''' <tt>tag</tt>, ''integer'' '''''in''''' <tt>file_type</tt> || Write a type for the binary data to the already-open file header indicated by <tt>tag</tt>. Data type constants are also provided by the F90 API. || <tt>sf_settype</tt> || N |- | <tt>to_par</tt> || ''file'' '''''in''''' <tt>tag</tt>, ''character'' '''''in''''' <tt>name</tt>, ''multi'' '''''in''''' <tt>value</tt> || Writes <tt>name=value</tt> to already-opened file specified by <tt>tag</tt>. Value can be integer, integer array, real or character. || <tt>sf_putint</tt>, <tt>sf_putints</tt>, <tt>sf_putfloat</tt>, <tt>sf_putstring</tt> || N |}
Summary:
Please note that all contributions to Madagascar are considered to be released under the GNU Free Documentation License 1.3 or later (see
My wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
English
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Getting Madagascar
download
Installation
GitHub repository
SEGTeX
Introduction
Package overview
Tutorial
Hands-on tour
Reproducible documents
Hall of Fame
User Documentation
List of programs
Common programs
Popular programs
The RSF file format
Reproducibility with SCons
Developer documentation
Adding programs
Contributing programs
API demo: clipping data
API demo: explicit finite differences
Community
Conferences
User mailing list
Developer mailing list
GitHub organization
LinkedIn group
Development blog
Twitter
Slack
Tools
What links here
Related changes
Special pages
Page information