Changeset 83 for trunk/include/fortran


Ignore:
Timestamp:
Oct 5, 2005 8:17:26 AM (17 years ago)
Author:
dkearney
Message:
  1. More cleaning of RpUnits and RpLibrary? code
  2. added rp_result code to c++/fortran/c code
  3. added rp_children, rp_lib_node[comp,type,id] for fortran code (need to test)
  4. adjusted convert function to recognize statements as follows:

convert("5J","neV")
convert("3.12075e+28neV","J")

  1. made joules a metric unit in RpUnits.cc
  2. tested examples/app-fermi/fortran/fermi.f with new rappture library.

added units conversion.

Location:
trunk/include/fortran
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/fortran/RpFortranCommon.h

    r77 r83  
     1/*
     2 * ----------------------------------------------------------------------
     3 *  INTERFACE: Fortran Rappture Common Functions
     4 *
     5 *    Fortran functions common to all interfaces.
     6 *
     7 * ======================================================================
     8 *  AUTHOR:  Derrick Kearney, Purdue University
     9 *  Copyright (c) 2005
     10 *  Purdue Research Foundation, West Lafayette, IN
     11 * ======================================================================
     12 */
    113
    214#include <stdlib.h>
     
    921
    1022
    11 #ifdef __cplusplus 
     23#ifdef __cplusplus
    1224extern "C" {
    1325#endif
     
    1729void fortranify(const char* inBuff, char* retText, int retTextLen);
    1830
    19 #ifdef __cplusplus 
     31#ifdef __cplusplus
    2032}
    2133#endif
  • trunk/include/fortran/RpLibraryFInterface.h

    r77 r83  
     1/*
     2 * ----------------------------------------------------------------------
     3 *  INTERFACE: Fortran Rappture Library Header
     4 *
     5 * ======================================================================
     6 *  AUTHOR:  Derrick Kearney, Purdue University
     7 *  Copyright (c) 2005
     8 *  Purdue Research Foundation, West Lafayette, IN
     9 * ======================================================================
     10 */
    111
    212#include "RpLibrary.h"
     
    3646#   define rp_lib_write_xml        rp_lib_write_xml_
    3747#   define rp_lib_xml              rp_lib_xml_
     48#   define rp_lib_node_comp        rp_lib_node_comp_
     49#   define rp_lib_node_type        rp_lib_node_type_
     50#   define rp_lib_node_id          rp_lib_node_id_
     51#   define rp_result               rp_result_
    3852#   define rp_quit                 rp_quit_
    3953#elif defined(COMPNAME_ADD2UNDERSCORE)
     
    5973#   define rp_lib_write_xml        rp_lib_write_xml__
    6074#   define rp_lib_xml              rp_lib_xml__
     75#   define rp_lib_node_comp        rp_lib_node_comp__
     76#   define rp_lib_node_type        rp_lib_node_type__
     77#   define rp_lib_node_id          rp_lib_node_id__
     78#   define rp_result               rp_result__
    6179#   define rp_quit                 rp_quit__
    6280#elif defined(COMPNAME_NOCHANGE)
     
    82100#   define rp_lib_write_xml        rp_lib_write_xml
    83101#   define rp_lib_xml              rp_lib_xml
     102#   define rp_lib_node_comp        rp_lib_node_comp
     103#   define rp_lib_node_type        rp_lib_node_type
     104#   define rp_lib_node_id          rp_lib_node_id
     105#   define rp_result               rp_result
    84106#   define rp_quit                 rp_quit
    85107#elif defined(COMPNAME_UPPERCASE)
     
    105127#   define rp_lib_write_xml        RP_LIB_WRITE_XML
    106128#   define rp_lib_xml              RP_LIB_XML
     129#   define rp_lib_node_comp        RP_LIB_NODE_COMP
     130#   define rp_lib_node_type        RP_LIB_NODE_TYPE
     131#   define rp_lib_node_id          RP_LIB_NODE_ID
     132#   define rp_result               RP_RESULT
    107133#   define rp_quit                 RP_QUIT
    108134#endif
     
    111137void rp_init();
    112138
    113 int rp_lib(const char* filePath, int filePath_len);
    114 
    115 void rp_lib_element_comp( int* handle,
    116                             char* path,
    117                             char* retText,
    118                             int path_len,
    119                             int retText_len );
    120 
    121 void rp_lib_element_id(   int* handle,
    122                             char* path,
    123                             char* retText,
    124                             int path_len,
    125                             int retText_len );
    126 
    127 void rp_lib_element_type( int* handle,
    128                             char* path,
    129                             char* retText,
    130                             int path_len,
    131                             int retText_len );
    132 
    133 int rp_lib_element_obj(   int* handle,
     139int rp_lib ( const char* filePath, int filePath_len );
     140
     141void rp_lib_element_comp (  int* handle,
     142                            char* path,
     143                            char* retText,
     144                            int path_len,
     145                            int retText_len );
     146
     147void rp_lib_element_id (    int* handle,
     148                            char* path,
     149                            char* retText,
     150                            int path_len,
     151                            int retText_len );
     152
     153void rp_lib_element_type ( int* handle,
     154                            char* path,
     155                            char* retText,
     156                            int path_len,
     157                            int retText_len );
     158
     159int rp_lib_element_obj (    int* handle,
    134160                            char* path,
    135161                            int path_len );
    136162
    137 int rp_lib_child_num(    int* handle,
    138                             char* path,
     163int rp_lib_child_num (      int* handle,
     164                            char* path,
     165                            int* childHandle,
    139166                            int path_len);
    140167
    141 int rp_lib_child_comp(   int* handle,    /* integer handle of library */
    142                             char* path,     /* DOM path of requested object */
    143                             char* type,     /* specific name of element */
    144                             int* childNum,  /* child number for iteration */
    145                             char* retText,  /* buffer to store return text */
    146                             int path_len,   /* length of path */
    147                             int type_len,   /* length of type */
    148                             int retText_len /* length of return text buffer */
    149                        );
    150 
    151 int rp_lib_child_id(     int* handle,    /* integer handle of library */
    152                             char* path,     /* DOM path of requested object */
    153                             char* type,     /* specific name of element */
    154                             int* childNum,  /* child number for iteration */
    155                             char* retText,  /* buffer to store return text */
    156                             int path_len,   /* length of path */
    157                             int type_len,   /* length of type */
    158                             int retText_len /* length of return text buffer */
    159                        );
    160 
    161 int rp_lib_child_type(   int* handle,    /* integer handle of library */
    162                             char* path,     /* DOM path of requested object */
    163                             char* type,     /* specific name of element */
    164                             int* childNum,  /* child number for iteration */
    165                             char* retText,  /* buffer to store return text */
    166                             int path_len,   /* length of path */
    167                             int type_len,   /* length of type */
    168                             int retText_len /* length of return text buffer */
    169                        );
    170 
    171 int rp_lib_child_obj(    int* handle,
    172                             char* path,
    173                             char* type,
    174                             int path_len,
    175                             int type_len
    176                           );
    177 
    178 void rp_lib_get(          int* handle,
    179                             char* path,
    180                             char* retText,
    181                             int path_len,
    182                             int retText_len );
    183 
    184 double rp_lib_get_double( int* handle,
     168int rp_lib_children (       int* handle, /* integer handle of library */
     169                            char* path, /* search path of the xml */
     170                            int* childHandle, /*int handle of last returned child*/
     171                            int path_len  /*length of the search path buffer*/
     172                    );
     173
     174
     175void rp_lib_get (           int* handle,
     176                            char* path,
     177                            char* retText,
     178                            int path_len,
     179                            int retText_len );
     180
     181double rp_lib_get_double (  int* handle,
    185182                            char* path,
    186183                            int path_len);
    187184
    188 void rp_lib_put_str(     int* handle,
     185void rp_lib_put_str (       int* handle,
    189186                            char* path,
    190187                            char* value,
     
    193190                            int value_len );
    194191
    195 void rp_lib_put_id_str(  int* handle,
     192void rp_lib_put_id_str (    int* handle,
    196193                            char* path,
    197194                            char* value,
     
    202199                            int id_len );
    203200
    204 void rp_lib_put_obj(     int* handle,
     201void rp_lib_put_obj (       int* handle,
    205202                            char* path,
    206203                            int* valHandle,
     
    208205                            int path_len );
    209206
    210 void rp_lib_put_id_obj(  int* handle,
     207void rp_lib_put_id_obj (    int* handle,
    211208                            char* path,
    212209                            int* valHandle,
     
    216213                            int id_len );
    217214
    218 int rp_lib_remove(       int* handle,
    219                             char* path, 
     215int rp_lib_remove (         int* handle,
     216                            char* path,
    220217                            int path_len);
    221218
    222 int rp_lib_xml_len(      int* handle);
    223 
    224 void rp_lib_xml(         int* handle,
    225                             char* retText, 
    226                             int retText_len);
    227 
    228 int rp_lib_write_xml(     int* handle,
    229                             char* outFile, 
     219int rp_lib_xml_len(         int* handle);
     220
     221void rp_lib_xml(            int* handle,
     222                            char* retText,
     223                            int retText_len);
     224
     225int rp_lib_write_xml(       int* handle,
     226                            char* outFile,
    230227                            int outFile_len);
     228
     229void rp_lib_node_comp (     int* handle,
     230                            char* retText,
     231                            int retText_len);
     232
     233void rp_lib_node_type (     int* handle,
     234                            char* retText,
     235                            int retText_len);
     236
     237void rp_lib_node_id (       int* handle,
     238                            char* retText,
     239                            int retText_len);
     240
     241void rp_result(             int* handle );
     242
    231243void rp_quit();
    232244
  • trunk/include/fortran/RpUnitsFInterface.h

    r76 r83  
     1/*
     2 * ----------------------------------------------------------------------
     3 *  INTERFACE: Fortran Rappture Units Source
     4 *
     5 * ======================================================================
     6 *  AUTHOR:  Derrick Kearney, Purdue University
     7 *  Copyright (c) 2005
     8 *  Purdue Research Foundation, West Lafayette, IN
     9 * ======================================================================
     10 */
     11
    112#include "RpFortranCommon.h"
    213
Note: See TracChangeset for help on using the changeset viewer.