ECC-200: doxygen documentation

This commit is contained in:
Shahram Najm 2016-07-11 11:37:33 +01:00
parent 49e46033c0
commit 81b4cfb4c8
9 changed files with 395 additions and 58 deletions

195
doxygen/DoxygenLayout.xml Normal file
View File

@ -0,0 +1,195 @@
<doxygenlayout version="1.0">
<!-- Generated by doxygen 1.8.5 -->
<!-- Navigation index tabs for HTML output -->
<navindex>
<tab type="mainpage" visible="yes" title=""/>
<tab type="pages" visible="no" title="The Pages" intro=""/>
<tab type="modules" visible="yes" title="C Interface" intro=""/>
<tab type="namespaces" visible="yes" title="Python Interface">
<tab type="namespacelist" visible="yes" title="" intro=""/>
<tab type="namespacemembers" visible="yes" title="" intro=""/>
</tab>
<tab type="user" url="@ref eccodes" title="F90 Interface"/>
<tab type="classes" visible="no" title="Classes">
<tab type="classlist" visible="yes" title="" intro=""/>
<tab type="classindex" visible="$ALPHABETICAL_INDEX" title="xxindex"/>
<tab type="hierarchy" visible="yes" title="xxhier" intro=""/>
<tab type="classmembers" visible="yes" title="" intro=""/>
</tab>
<tab type="files" visible="no" title="">
<tab type="filelist" visible="yes" title="" intro=""/>
<tab type="globals" visible="yes" title="" intro=""/>
</tab>
<tab type="examples" visible="yes" title="" intro=""/>
</navindex>
<!-- Layout definition for a class page -->
<class>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<inheritancegraph visible="$CLASS_GRAPH"/>
<collaborationgraph visible="$COLLABORATION_GRAPH"/>
<memberdecl>
<nestedclasses visible="yes" title=""/>
<publictypes title=""/>
<services title=""/>
<interfaces title=""/>
<publicslots title=""/>
<signals title=""/>
<publicmethods title=""/>
<publicstaticmethods title=""/>
<publicattributes title=""/>
<publicstaticattributes title=""/>
<protectedtypes title=""/>
<protectedslots title=""/>
<protectedmethods title=""/>
<protectedstaticmethods title=""/>
<protectedattributes title=""/>
<protectedstaticattributes title=""/>
<packagetypes title=""/>
<packagemethods title=""/>
<packagestaticmethods title=""/>
<packageattributes title=""/>
<packagestaticattributes title=""/>
<properties title=""/>
<events title=""/>
<privatetypes title=""/>
<privateslots title=""/>
<privatemethods title=""/>
<privatestaticmethods title=""/>
<privateattributes title=""/>
<privatestaticattributes title=""/>
<friends title=""/>
<related title="" subtitle=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<services title=""/>
<interfaces title=""/>
<constructors title=""/>
<functions title=""/>
<related title=""/>
<variables title=""/>
<properties title=""/>
<events title=""/>
</memberdef>
<allmemberslink visible="yes"/>
<usedfiles visible="$SHOW_USED_FILES"/>
<authorsection visible="yes"/>
</class>
<!-- Layout definition for a namespace page -->
<namespace>
<briefdescription visible="yes"/>
<memberdecl>
<nestednamespaces visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<classes visible="yes" title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection visible="yes"/>
</namespace>
<!-- Layout definition for a file page -->
<file>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<includegraph visible="$INCLUDE_GRAPH"/>
<includedbygraph visible="$INCLUDED_BY_GRAPH"/>
<sourcelink visible="yes"/>
<memberdecl>
<classes visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection/>
</file>
<!-- Layout definition for a group page -->
<group>
<briefdescription visible="yes"/>
<groupgraph visible="$GROUP_GRAPHS"/>
<memberdecl>
<nestedgroups visible="yes" title=""/>
<dirs visible="yes" title=""/>
<files visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<pagedocs/>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
</memberdef>
<authorsection visible="yes"/>
</group>
<!-- Layout definition for a directory page -->
<directory>
<briefdescription visible="yes"/>
<directorygraph visible="yes"/>
<memberdecl>
<dirs visible="yes"/>
<files visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
</directory>
</doxygenlayout>

88
doxygen/eccodes.dox Normal file
View File

@ -0,0 +1,88 @@
/*! \mainpage ecCodes
\section overview Overview
\b ecCodes is a package developed by ECMWF which provides an application programming interface and a
set of tools for decoding and encoding messages in the following formats:
- WMO FM-92 GRIB edition 1 and edition 2 (<a href="http://www.wmo.int/pages/prog/www/WMOCodes/Guides/GRIB/Introduction_GRIB1-GRIB2.pdf">See WMO document</a>)
- WMO FM-94 BUFR edition 3 and edition 4 (<a href="http://www.wmo.int/pages/prog/www/WMOCodes/Guides/BUFRCREX/Layer1-2-English.pdf">See WMO document</a>)
- WMO GTS <a href="http://www.wmo.int/pages/prog/www/WIS/Publications/WMO_386/WMO_386_Vol_I_en.pdf">abbreviated header</a> (only decoding in this release).
A useful set of <a href="https://software.ecmwf.int/wiki/display/ECC/Command+line+tools">command line tools</a>
provide quick access to the messages. C, Fortran 90 and Python interfaces provide access to the main ecCodes functionality.
ecCodes is an evolution of <a href="https://software.ecmwf.int/wiki/display/GRIB/Home">GRIB-API</a>. It is designed to provide the user with a simple set of functions to access
data from several formats with a key/value approach.
For GRIB encoding and decoding, the GRIB-API functionality is provided fully in ecCodes with the same user interface and behaviour. Interfaces for C, Fortran 90 and Python are all maintained as in GRIB-API. However, the GRIB-API Fortran 77 interface is no longer available.
In addition, a new set of functions with the prefix "codes_" is provided to operate on all the supported message formats. These functions have the same interface and behaviour as the "grib_" functions.
A selection of GRIB-API tools has been included in ecCodes (ecCodes GRIB tools), while new tools are available for the BUFR (ecCodes BUFR tools) and GTS formats. The new tools have been developed to be as similar as possible to the existing GRIB-API tools maintaining, where possible, the same options and behaviour. A significant difference compared with GRIB-API tools is that bufr_dump produces output in json format which can be used in many web based applications.
Migration from GRIB-API to ecCodes is expected to be transparent for current GRIB-API users. The GRIB-API library is fully available in the ecCodes library. Users are encouraged to test their GRIB-API applications by linking with the ecCodes library and to provide feedback of any problems encountered.
##############
The ecCodes library is written entirely in C and some command line \ref tools "tools" are
provided to give a quick way to manipulate GRIB and BUFR data. Moreover a \ref eccodes "Fortran interface 90" is available
giving access to the main features of the C library.
The library is designed to access and modify messages in both editions with the same
\ref get_set "function calls" using a set of \ref keys to access the coded information
( examples: \ref grib_get_keys.f90 "grib_get_keys.f90" \ref set.f90 "set.f90", \ref grib_get_keys.c "grib_get_keys.c", \ref set.c "set.c", \ref grib_get_examples "grib_get", \ref grib_set_examples "grib_set" ).
The \ref keys "keys" available for a message are different depending not only on the edition
but also and mainly on the type of each message and the information it contains.
A list of all the available keys in a message can be obtained dynamically using the
library as shown in \ref keys_iterator.c "keys_iterator.c" or using the \ref tools
as shown in \ref grib_dump_examples "grib_dump" or \ref grib_keys_examples "grib_keys".
GRIB API will replace the GRIBEX function and a
<a href="/publications/manuals/grib_api/gribexkeys/callGribex.html">table of conversion</a> between the
numeric encoding of GRIBEX and the alphanumeric keys of GRIB API is provided to help
the migration.
To learn how to use the grib_api we recommend the user works through the \ref grib_examples.
Reference manuals are also provided for the C library (organized in \ref modules), for the
\ref eccodes "Fortran 90 interface" and for the \ref gribapi "Python interface".
\ref installation "Installation" instructions are also provided.
\section ecwf_users Compiling and linking on ECMWF platforms
ecCodes is installed on all systems at ECMWF with both its components: the library
and the tools.\n
The latest version of the tools is always available in the system PATH so that
users can begin using the tools immediately by typing directly the tool name (\ref tools "see tools reference").\n
The latest version of the library is also installed on any platform and it is available for linking through the
following two environment variables: $ECCODES_INCLUDE $ECCODES_LIB.\n\n
Here is a short summary on how to compile and link on ECMWF systems:\n
- ecgate, hpce, hpcf
\verbatim
> xlc -o foo foo.c $ECCODES_INCLUDE $ECCODES_LIB -lm
\endverbatim \n
\verbatim
> xlf90 -o foo foo.f90 $ECCODES_INCLUDE $ECCODES_LIB
\endverbatim\n
- linux cluster (C programs)
\verbatim
> gcc -m32 -o foo foo.c $ECCODES_INCLUDE $ECCODES_LIB
\endverbatim \n
- workstation (C programs)
\verbatim
> gcc -o foo foo.c $ECCODES_INCLUDE $ECCODES_LIB
\endverbatim \n
- linux cluster,workstation (Fortran programs)
\verbatim
> use pgf90
> pgf90 -o foo foo.f90 $ECCODES_INCLUDE $ECCODES_LIB
\endverbatim\n
*/

View File

@ -12,14 +12,14 @@
\section overview Overview
The grib_api is the application program interface developed at ECMWF
ecCodes is the application program interface developed at ECMWF
to provide an easy and realiable way for encoding and
decoding WMO FM-92 GRIB
<a href="http://www.wmo.ch/pages/prog/www/WMOCodes/Manual/WMO306_vol-I-2-PartB-GRIB1.pdf">edition 1</a> and
<a href="http://www.wmo.ch/pages/prog/www/DPS/grib-2.html">edition 2</a> messages.
With the grib_api library, that is written entirely in C, some command line \ref tools "tools" are
provided to give a quick way to manipulate grib data. Moreover a \ref grib_api "Fortran interface 90" is available
The ecCodes library is written entirely in C and some command line \ref tools "tools" are
provided to give a quick way to manipulate GRIB and BUFR data. Moreover a \ref eccodes "Fortran interface 90" is available
giving access to the main features of the C library.
The library is designed to access and modify messages in both editions with the same
@ -39,8 +39,9 @@ the migration.
To learn how to use the grib_api we recommend the user works through the \ref grib_examples.
Reference manuals are also provided for the C library (organized in \ref modules) and for the
\ref grib_api "Fortran 90 interface".
Reference manuals are also provided for the C library (organized in \ref modules), for the
\ref eccodes "Fortran 90 interface" and for the \ref gribapi "Python interface".
\ref installation "Installation" instructions are also provided.

View File

@ -8,7 +8,7 @@ PROJECT_NUMBER =
OUTPUT_DIRECTORY =
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
USE_WINDOWS_ENCODING = NO
#USE_WINDOWS_ENCODING = NO
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ABBREVIATE_BRIEF = "The $name class" \
@ -30,7 +30,7 @@ STRIP_FROM_INC_PATH =
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = YES
MULTILINE_CPP_IS_BRIEF = NO
DETAILS_AT_TOP = NO
#DETAILS_AT_TOP = NO
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 8
@ -65,14 +65,15 @@ GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
LAYOUT_FILE = DoxygenLayout.xml
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
SHOW_DIRECTORIES = NO
#SHOW_DIRECTORIES = NO
FILE_VERSION_FILTER =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = NO
QUIET = YES
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
@ -82,30 +83,16 @@ WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = grib_api.dox \
keys.dox \
examples.dox \
grib_examples.dox \
INPUT = eccodes.dox \
modules.dox \
installation.dox \
../src/grib_api.h \
../src/eccodes.h \
../fortran/grib_f90.f90 \
eccodes.h \
../fortran/eccodes_f90.f90 \
../examples/C \
../examples/F90 \
../examples/python \
../tools/tools.dox \
../tools/grib_ls.dox \
../tools/grib_get.dox \
../tools/grib_get_data.dox \
../tools/grib_set.dox \
../tools/grib_dump.dox \
../tools/grib_filter.dox \
../tools/grib_compare.dox \
../tools/grib_keys.dox \
../tools/grib_copy.dox \
../tools/grib_index_build.dox \
gribapi.py
../python/gribapi.py \
environment.dox
FILE_PATTERNS = *.c \
*.cc \
*.cxx \
@ -184,7 +171,7 @@ HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
#HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
CHM_FILE =
HHC_LOCATION =
@ -198,7 +185,7 @@ TREEVIEW_WIDTH = 250
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = YES
GENERATE_LATEX = NO
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
@ -285,8 +272,8 @@ DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
MAX_DOT_GRAPH_WIDTH = 1024
MAX_DOT_GRAPH_HEIGHT = 1024
#MAX_DOT_GRAPH_WIDTH = 1024
#MAX_DOT_GRAPH_HEIGHT = 1024
MAX_DOT_GRAPH_DEPTH = 1000
DOT_TRANSPARENT = NO
DOT_MULTI_TARGETS = NO
@ -295,4 +282,5 @@ DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::additions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = NO
SEARCHENGINE = YES
SERVER_BASED_SEARCH = NO

View File

@ -1,4 +1,4 @@
/*! \page keys Grib API keys
/*! \page keys ecCodes keys
The GRIBEX routine used at ECMWF to encode and decode GRIB messages works
on a number based table to retrive all the information from the message.
This approach forces the user either to learn a code table
@ -22,7 +22,7 @@ The names are always easily releated to the meaning of their value.\n
A different set of keys is available for each message because the content
is different. It is easy to find the keys available in a message by using
the GRIB tools (\ref grib_dump "grib_dump)
or the library (\ref keys_iterator.c "keys_iterator.c").\n
or the library (\ref grib_keys_iterator.c "grib_keys_iterator.c").\n
\section coded_computed Coded and Computed keys

View File

@ -73,9 +73,6 @@
\include{grib_get_data}
\include{grib_set}
\include{grib_dump}
\include{grib_dump_examples}
\include{grib_debug}
\include{grib_convert}
\include{grib_filter}
\include{grib_compare}
\include{grib_copy}

View File

@ -1,10 +1,21 @@
#!/bin/sh
cd ../tools
./make_dox.ksh
cd ../doxygen
# No need to do tools. We use another mechanism. See top-level
# confluence directory
#cd ../tools
#./make_dox.ksh
#cd ../doxygen
rm -f ../html/*
set -e
./process_C_header.pl ../src/grib_api.h ../src/eccodes.h > eccodes.h
rm -fr ../html/*
touch ../html/Makefile.am
doxygen grib_api_wiz.cfg
cp doxygen.css ../html/
# Do not copy this. Use default generated doxygen.css
# cp doxygen.css ../html/
# Remove temp files
rm -f eccodes.h

56
doxygen/process_C_header.pl Executable file
View File

@ -0,0 +1,56 @@
#!/usr/bin/env perl
use Data::Dumper;
$|=1;
my $debug = 0;
if (scalar @ARGV < 2) {
&usage;
}
# Open grib_api.h and extract all macros of the form
# #define GRIB.* number
#
my $grib_header_file = $ARGV[0];
my $ecco_header_file = $ARGV[1];
open GRIB_HEADER_FILE, $grib_header_file or die $!;
my @grib_lines = <GRIB_HEADER_FILE>;
close GRIB_HEADER_FILE;
# Store each GRIB_ macro and its value
foreach (@grib_lines) {
if (/^\s*#define\s+(GRIB[_A-z0-9]+)\s+(.+)/) {
my $grib_macro = $1;
my $grib_value = $2;
#print "m=|$grib_macro| \t\t v=|$grib_value|\n";
$macro_map{$grib_macro} = $grib_value;
}
}
#print Data::Dumper->Dump([\%macro_map], ["macro_map"]), $/ if ($debug);
open ECCO_HEADER_FILE, $ecco_header_file or die $!;
my @ecco_lines = <ECCO_HEADER_FILE>;
close ECCO_HEADER_FILE;
# Apply the value from our map to the equivalent CODES_ macros
foreach (@ecco_lines) {
if (/^\s*#define\s+(CODES[_A-z0-9]+)\s+(GRIB.+)/) {
my $ecco_macro = $1;
my $grib_macro = $2;
print "#define $ecco_macro $macro_map{$grib_macro}\n";
}
#elsif (/^\s*typedef\s+struct\s+(grib_.*)\s+(codes_.*) *;/) {
# my $grib_struct = $1;
# my $ecco_struct = $2;
# print "typedef struct $ecco_struct $ecco_struct;\n";
#}
else {
print;
}
}
###################################################
sub usage {
print "$0 grib_api.h eccodes.h\n";
exit 1
}

View File

@ -1,22 +1,20 @@
"""
@package gribapi
@brief This package is a low level Python interface to ecCodes. It offers almost one to one bindings to the C API functions.
@brief This package is the \b Python interface to ecCodes. It offers almost one to one bindings to the C API functions.
The Python interface to GRIB API uses the <a href="http://numpy.scipy.org/"><b>NumPy</b></a> package
The Python interface to ecCodes uses the <a href="http://numpy.scipy.org/"><b>NumPy</b></a> package
as the container of choice for the possible arrays of values that can be encoded/decoded in and from a grib message.
Numpy is a package used for scientific computing in Python and an efficient container for generic data.
The Python interface and its support for NumPy can be enabled/disabled from the configure by using the following configure flags:\n
@code
--enable-python
--disable-numpy
The Python interface can be enabled/disabled from cmake by using the following flag:\n
@code{.unparsed}
-DENABLE_PYTHON=ON
or
-DENABLE_PYTHON=OFF
@endcode
When the '--enable-python' flag is used, then the system Python will be used to build the interface.
NumPy support can be disabled by using the '--disable-numpy' flag.
When this is enabed, then the system Python will be used to build the interface.
@em Requirements:
@ -105,7 +103,7 @@ class GribInternalError(Exception):
def __str__(self):
return self.msg
# @cond
class Bunch(dict):
"""
The collector of a bunch of named stuff :).
@ -135,8 +133,9 @@ class Bunch(dict):
for (attribute, value)
in self.__dict__.items()]
return '\n'.join(state)
# @endcond
# @cond
def with_numpy():
"""
@brief Is numpy enabled?
@ -150,8 +149,9 @@ def with_numpy():
pass
return numpy
# @endcond
# @cond
@require(errid=int)
def GRIB_CHECK(errid):
"""
@ -163,6 +163,7 @@ def GRIB_CHECK(errid):
"""
if errid:
raise GribInternalError(errid)
# @endcond
@require(fileobj=file)
@ -247,7 +248,7 @@ def any_new_from_file(fileobj, headers_only = False):
@brief Load in memory a message from a file.
The message can be accessed through its id and it will be available\n
until @ref codes_release is called.\n
until @ref grib_release is called.\n
\b Examples: \ref grib_get_keys.py "grib_get_keys.py"