EIRAM
atomic and molecular data in form of polynomial fits
Functions/Subroutines
eiram_cgi.f90 File Reference

CGI (Common Gateway Interface) for EIRAM. More...

Go to the source code of this file.

Functions/Subroutines

program eiram_cgi
 
subroutine getpoints (fileName, reactionType, reactionIndex, arg1s_str, arg2s_str, xs, ys)
 Calculate the points for the given reaction and arguments. More...
 
character(150+2 *(14 *size(xs)+2)) function pointstojsonstring (fileName, reactionType, reactionIndex, xs, ys)
 Return a string which represents a JSON object suitable for plotting of the given reaction data. More...
 
subroutine getcsvparameter (dict, parameterName, errMsg, values, nValues)
 Parse values of a comma separated CGI parameter. More...
 
subroutine sendavailablereactions ()
 Send the list of all available reactions to the server. More...
 
subroutine initallfiles ()
 Initialize EIRAM with all available data. More...
 
character(dict_value_length *2) function getlastmessage ()
 Return two last lines printed into the temporary output unit. More...
 
subroutine split (string, c, array)
 Split one line into individual strings for each comma separated substring. More...
 
subroutine parsevector (strArr, realArr)
 Converts octave-like string vector representation into an array of reals. More...
 
character(1024 *n) function getreactionsasjson (REACTIONS, N, err)
 Transfer reactions stored in the arrays REACTIONS into a string which represents a JSON (JavaScript Object Notation) object - list of reactions. More...
 

Detailed Description

CGI (Common Gateway Interface) for EIRAM.

Authors
Markus Brenneis Marku.nosp@m.s.Br.nosp@m.ennei.nosp@m.s@un.nosp@m.i-due.nosp@m.ssel.nosp@m.dorf..nosp@m.de, Vladislav Kotov v.kot.nosp@m.ov@f.nosp@m.z-jue.nosp@m.lich.nosp@m..de (contact person)

CGI (Common Gateway Interface) for EIRAM

GET request parameters

files: comma separated list of file names

types: comma separated list of type names

reactions: comma separated list of reaction indices

arg1s: comma separated list of first arguments, may be single values or vectors in start[:delta]:end notation

arg2s: comma separated list of second arguments, may be "-", single values or vectors in start[:delta]:end notation; if arg2 is "-", tnen only one argument arg1 taken for this reaction

epsfilter: real number; tolerance parameter for the energy filter. The filter takes away nodes with values which are equal within relative accuracy defined by epsfilter. [default: epsfilter=0, ie. no filtering]

All lists must have the same length.

If the query string does not contain '=', then a JSON (JavaScript Object Notation) format list of available combinations is returned.

In case of an error 400 Bad Request is returned. The body of the response contains a rough description of the error.

examples for query strings:

Definition in file eiram_cgi.f90.

Function/Subroutine Documentation

program eiram_cgi ( )
subroutine eiram_cgi::getpoints ( character(*), intent(in)  fileName,
character(*), intent(in)  reactionType,
character(*), intent(in)  reactionIndex,
character(*), intent(in)  arg1s_str,
character(*), intent(in)  arg2s_str,
real(kind=eiram_dp), dimension(:), intent(out), allocatable  xs,
real(kind=eiram_dp), dimension(:), intent(out), allocatable  ys 
)

Calculate the points for the given reaction and arguments.

Parameters
[in]filenamefile name for the reaction
[in]reactiontypetype name for the reaction
[in]reactionindexindex of the reaction
[in]arg1s_strargument 1, single numeric value or min:delta:max string
[in]arg2s_strargument 2, "-", single numeric value or min:delta:max string if arg2 /= "-", then only the first value from arg1s is used
[out]xsthe x values for which the function is calculated
[out]ysthe y values
Todo:
the use of memory here could be further optimized

Definition at line 140 of file eiram_cgi.f90.

References cgi_protocol::cgi_error(), eiram_matlab_calc1(), eiram_matlab_calc2(), getlastmessage(), and parsevector().

Referenced by eiram_cgi().

Here is the call graph for this function:

Here is the caller graph for this function:

character(150+2*(14*size(xs)+2)) function eiram_cgi::pointstojsonstring ( character(*), intent(in)  fileName,
character(*), intent(in)  reactionType,
character(*), intent(in)  reactionIndex,
real(kind=eiram_dp), dimension(:), intent(in)  xs,
real(kind=eiram_dp), dimension(:), intent(in)  ys 
)

Return a string which represents a JSON object suitable for plotting of the given reaction data.

Parameters
[in]filenamefile name for the reaction
[in]reactiontypetype name for the reaction
[in]reactionindexindex of the reaction
[in]xsx values
[in]ysy values

Definition at line 214 of file eiram_cgi.f90.

References json::eiram_json_getarrayasjson(), and json::eiram_json_writejsonstringproperty().

Referenced by eiram_cgi().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine eiram_cgi::getcsvparameter ( type(dict_struct), intent(in), pointer  dict,
character(*), intent(in)  parameterName,
character(*), intent(in)  errMsg,
character(max_param_length), dimension(:), intent(inout), allocatable  values,
integer, intent(out)  nValues 
)

Parse values of a comma separated CGI parameter.

Parameters
[in]dictthe CGI dictionary
[in]parameternamethe name of the parameter
[in]errmsgthe cgi error message returned in case the parameter does not exist
[in,out]valuesthe array which will hold the parsed values
[out]nvaluesnumber of obtained values

Definition at line 250 of file eiram_cgi.f90.

References cgi_protocol::cgi_error(), and split().

Referenced by eiram_cgi().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine eiram_cgi::sendavailablereactions ( )

Send the list of all available reactions to the server.

Definition at line 269 of file eiram_cgi.f90.

References cgi_protocol::cgi_end(), cgi_protocol::cgi_error(), eiram::eiram_create_image(), eiram::eiram_deallocate(), getlastmessage(), getreactionsasjson(), and initallfiles().

Referenced by eiram_cgi().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine eiram_cgi::initallfiles ( )

Initialize EIRAM with all available data.

Definition at line 300 of file eiram_cgi.f90.

References cgi_protocol::cgi_error(), eiram::eiram_load(), and getlastmessage().

Referenced by eiram_cgi(), and sendavailablereactions().

Here is the call graph for this function:

Here is the caller graph for this function:

character(dict_value_length*2) function eiram_cgi::getlastmessage ( )

Return two last lines printed into the temporary output unit.

Definition at line 312 of file eiram_cgi.f90.

References cgi_protocol::dict_value_length.

Referenced by getpoints(), initallfiles(), and sendavailablereactions().

Here is the caller graph for this function:

subroutine eiram_cgi::split ( character(*), intent(in)  string,
character(1), intent(in)  c,
character(max_param_length), dimension(:), intent(out), allocatable  array 
)

Split one line into individual strings for each comma separated substring.

Parameters
[in]stringc-separated string; must not contain commas (unless c is a comma) or whitespaces
[in]ccharacter at which the input string is split

Definition at line 321 of file eiram_cgi.f90.

References cgi_protocol::dict_value_length.

Referenced by getcsvparameter(), and parsevector().

Here is the caller graph for this function:

subroutine eiram_cgi::parsevector ( character(*), intent(in)  strArr,
real(kind=eiram_dp), dimension(:), intent(out), allocatable  realArr 
)

Converts octave-like string vector representation into an array of reals.

Parameters
[in]strarrstring in the form "<real>", "<real>:<real>", "<real>:<real>:<real>", or "-" "-" will be converted to NEG_INF

Definition at line 343 of file eiram_cgi.f90.

References cgi_protocol::cgi_error(), and split().

Referenced by getpoints().

Here is the call graph for this function:

Here is the caller graph for this function:

character(1024*n) function eiram_cgi::getreactionsasjson ( type(eiram_data), dimension(n), intent(in)  REACTIONS,
integer, intent(in)  N,
integer, intent(out)  err 
)

Transfer reactions stored in the arrays REACTIONS into a string which represents a JSON (JavaScript Object Notation) object - list of reactions.

Definition at line 394 of file eiram_cgi.f90.

References json::eiram_json_getarrayasjson(), and json::eiram_json_writejsonstringproperty().

Referenced by sendavailablereactions().

Here is the call graph for this function:

Here is the caller graph for this function: