home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / biology / gsrc208a.zip / GLOBVAR.C < prev    next >
C/C++ Source or Header  |  1993-08-26  |  8KB  |  169 lines

  1. #include "copyleft.h"
  2.  
  3. /*
  4.     GEPASI - a simulator of metabolic pathways and other dynamical systems
  5.     Copyright (C) 1989, 1992, 1993  Pedro Mendes
  6. */
  7.  
  8. /*************************************/
  9. /*                                   */
  10. /*          global variables         */
  11. /*                                   */
  12. /*        Zortech C/C++ 3.0 r4       */
  13. /*          MICROSOFT C 6.00         */
  14. /*          Visual C/C++ 1.0         */
  15. /*           QuickC/WIN 1.0          */
  16. /*             ULTRIX cc             */
  17. /*              GNU gcc              */
  18. /*                                   */
  19. /*   (include here compilers that    */
  20. /*   compiled GEPASI successfully)   */
  21. /*                                   */
  22. /*************************************/
  23.  
  24. #ifndef MSDOS
  25. #define COMMON
  26. #endif
  27.  
  28. #ifdef _WINDOWS
  29. #define COMMON
  30. #endif
  31.  
  32. #include <setjmp.h>
  33. #include "globals.h"                                /* global symbols        */
  34.  
  35.  double xss[MAX_MET];                     /* concentrations at the s.s.     */
  36.  double x[MAX_MET];                       /* concentrations at time t       */
  37.  double x0[MAX_MET];                      /* concentrations at time 0       */
  38.  double moiety[MAX_MET];                  /* total conserved moiety conc.   */
  39.  double rate[MAX_MET];                    /* rates at time t                */
  40.  double flux[MAX_STEP];                   /* fluxes at time t               */
  41.  double cum[MAX_MET];                      /* cumulative lyapunov exponents  */
  42.  double tt[MAX_MET];                      /* lifetimes                      */
  43.  double ttt;                              /* pathway lifetime               */
  44.  int totmet;                              /* number of total metabolites    */
  45.  int nmetab;                              /* number of internal metabolites */
  46.  int nextmet;                             /* number of external metabolites */
  47.  int indmet;                              /* number of int. indp. metabs.   */
  48.  int depmet;                              /* number of int. dep. metabs.    */
  49.  int nsteps;                              /* number of steps                */
  50.  double endtime;                          /* time value for last iteration  */
  51.  double actime;                           /* current time                   */
  52.  double step;                             /* initial step for integration   */
  53.  char metname[MAX_MET][NAME_L];           /* metabolite names               */
  54.  char stepname[MAX_STEP][NAME_L];         /* metabolite names               */
  55.  int intmet[MAX_MET];                     /* 1 if internal metabolite       */
  56.  int ur[MAX_MET];                         /* permut. on metabolites  u -> g */
  57.  int uc[MAX_MET];                         /* permutations on steps   u -> g */
  58.  extern float ml[MAX_MET][MAX_MET];       /* multipliers of gauss reduction */
  59.  extern float lm[MAX_MET][MAX_MET];       /* inverse of ml                  */
  60.  extern float ld[MAX_MET][MAX_MET];       /* metabolite linear dependencies */
  61.  extern float rstoi[MAX_MET][MAX_STEP];   /* reduced stoicheiometric matrix */
  62.  int stoiu[MAX_MET][MAX_STEP];            /* user stoicheiometric matrix    */
  63.  int stoi[MAX_MET][MAX_STEP];             /* stoicheiometric matrix         */
  64.  int kinetu[MAX_STEP];                    /* type of kinetics (user numb.)  */
  65.  int kinetype[MAX_STEP];                  /* type of kinetics of each step  */
  66.  unsigned char (*loop)[MAX_STEP][MAX_MET];/* def. of modification loops        */
  67.  int (*rstr)[MAX_STEP][MAX_MOL];          /* reaction structure                */
  68.  double jacob[MAX_MET][MAX_MET];          /* jacobian of rates at time t    */
  69.  extern double Dxv[MAX_STEP][MAX_MET];    /*  ---+                          */
  70.  extern double Duv[MAX_STEP][MAX_MET];    /*     |    defined in            */
  71.  extern double DuJ[MAX_STEP][MAX_MET];    /*     |    metcvars.c            */
  72.  extern double Gamma[MAX_MET][MAX_STEP];  /*     |    compiled              */
  73.  extern double C[MAX_STEP][MAX_STEP];     /*     |    separatly             */
  74.  extern double ttcc[MAX_MET];             /*  ---+                          */
  75.  double (*rateq[MAX_STEP])();             /* pointers to rate equations     */
  76.  double (*partder[MAX_STEP][MAX_MET])();  /* pointers to partial derivatives*/
  77.  
  78.  double intst, nfeval, njeval;            /* double vers. of nst, nfe & nje    */
  79. /*******************************************************/
  80. /*      Organization of metabolite based matrices      */
  81. /*                                                     */
  82. /*        0        ---+  +-                            */
  83. /*        .           |  |                             */
  84. /*        .           |  | indmet                      */
  85. /*        .           |  |                             */
  86. /*        indmet     -+  +-                            */
  87. /*        .           |  |                             */
  88. /*        .           |  | depmet                      */
  89. /*        .           |  |                             */
  90. /*        nmetab    --+  +-                            */
  91. /*        .           |  |                             */
  92. /*        .           |  | nextmet                     */
  93. /*        .           |  |                             */
  94. /*        totmetab ---+  +-                            */
  95. /*                                                     */
  96. /*******************************************************/
  97.  
  98. /**************************/
  99. /* FLOW CONTROL VARIABLES */
  100. /**************************/
  101.  float ver_no;                              /* .sim file version              */
  102.  unsigned long iter;                      /* number of current iteration    */
  103.  int fperr;                               /* fp error number                */
  104.  int cx, cy;                              /* ptrs for cursor position       */
  105.  int nrunfiles;                           /* number of files to run         */
  106.  int delete;                              /* 1 to delete list file at end    */
  107.  int newtlim=50;                          /* limit of iterations on Newton  */
  108.  char inputf[PWIDTH];                     /* list file name                 */
  109.  char filename[MAX_FIL][PWIDTH];          /* run filenames                  */
  110.  char repfile[PWIDTH];                      /* filename for report file        */
  111.  char dyname[PWIDTH];                     /* filename for dyn file            */
  112.  char TopFile[PWIDTH];                    /* topology filename              */
  113.  char listfile[PWIDTH];                      /* file with list of simulations    */
  114.  jmp_buf    mark;                          /* mark for longjmp (fp exceptions*/
  115.  int    jmpret;                              /* return value of setjmp            */
  116.  int    fperr;                              /* floting point error number        */
  117.  
  118. /********************/
  119. /* STRING VARIABLES */
  120. /********************/
  121.  
  122.  char fpstr[128] = "\0";
  123.  char topname[256] = "\0";                  /* pathway title                    */
  124.  char *errormsg[]=
  125.  {
  126.   " - ",
  127.   " - ",
  128.   "\nGEPASI aborted.\n",
  129.   " - ",
  130.   "  * Out of memory.",
  131.   " - ",
  132.   "  * Undefined error. Please report to developer!",
  133.   "Syntax error.",
  134.   "  * Error in file I/O: unable to save.",
  135.   "  * Error in file I/O: unable to load.",
  136.   "Unable to delete item.",
  137.   "  * Error in topology: step number out of bounds.",
  138.   "  * Error in topology: metabolite number out of bounds.",
  139.   "  * Error in topology: bad title.",
  140.   " - ",
  141.   "  * Error in topology: step number out of bounds.",
  142.   "  * Error in topology: possibly bad kinetic type.",
  143.   "  * Error in topology: metabolite number out of bounds.",
  144.   "  * Error in topology: bad stoicheiometry matrix.",
  145.   "  * Error in topology: bad interaction loop matrix.",
  146.   "  * Error in topology: bad metabolite status.",
  147.   "  * Error in parameters: invalid concentration.",
  148.   "  * Error in parameters: kinetic constant missing.",
  149.   " - ",
  150.   "  * Topology file incomplete.",
  151.   "  * Error in parameters: invalid units.",
  152.   "  * Error in parameters: invalid option.",
  153.   " - ",
  154.   " - ",
  155.   " - ",
  156.   " - ",
  157.   "No you don't!\nThis function is not yet working..."
  158.   };
  159. #ifndef COMMON
  160.  char *gepasi = "GEPASI 2.0 pc (C)1989/92/93 by Pedro Mendes";
  161. #endif
  162. #ifdef unix
  163.  char *gepasi = "GEPASI 2.0 unix (C)1989/92/93 by Pedro Mendes";
  164. #endif
  165. #ifdef _WINDOWS
  166.  char *gepasi = "GEPASI 2.0 win3 (C)1989/92/93 by Pedro Mendes";
  167. #endif
  168.  char *version_no = "release 2.08";
  169.