00001 //--- 00002 // 00003 // This file is part of sedflux. 00004 // 00005 // sedflux is free software; you can redistribute it and/or modify 00006 // it under the terms of the GNU General Public License as published by 00007 // the Free Software Foundation; either version 2 of the License, or 00008 // (at your option) any later version. 00009 // 00010 // sedflux is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 // GNU General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License 00016 // along with sedflux; if not, write to the Free Software 00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 // 00019 //--- 00020 00021 #ifndef __PLUMEVARS_IS_INCLUDED__ 00022 #define __PLUMEVARS_IS_INCLUDED__ 00023 /* 00024 * PlumeVars.h 00025 * 00026 * Author: M.D. Morehead 00027 * Original: April 1998 00028 * Modified: Sep 1998, MDM, Conversion for SEDFLUX3D 00029 */ 00030 00031 #include <stdio.h> 00032 #include <math.h> 00033 #include <ctype.h> 00034 #include <time.h> 00035 /* 00036 * Useful values 00037 */ 00038 00039 #define TMLEN 19 /* length of the time stamp */ 00040 //extern int strt; /* Straight plume flag, if straight (or Fjord) = 1, else = 0 */ 00041 00042 /* 00043 * Commonly used units and constants 00044 */ 00045 #define sq(a) ((a)*(a)) 00046 #define mn(a,b) (((a)<(b))?(a):(b)) 00047 #define mx(a,b) (((a)>(b))?(a):(b)) 00048 #define rnd(a) ((fmod(a,1.0)>(0.5)?((float)((int)(a)+1)):((float)((int)(a))))) 00049 #define PI 3.1415926535 00050 #define sqtwo 1.414213562 /* sqrt(2) */ 00051 #define dTOs 86400.0 /* 60.*60.*24. days to seconds or (s/day) */ 00052 #define grv 9.806194 /* acceleration due to gravity (m/s^2) */ 00053 #define rTOdeg 57.29577951 /* 360.0/(2.0*PI) convert radians to degrees */ 00054 #define degTOr 1.745329252e-2 /* 2.0*PI/360.0 convert degrees to radians */ 00055 #define sqpi 1.772453851 /* sqrt(PI) commonly used values */ 00056 #define omega 7.292123517e-5 /* 2.0*PI/86164.0 angular rotation rate of the earth */ 00057 /* 86164s/sidereal day, 86400s/solar day */ 00058 /* 00059 * Model Coefficients 00060 */ 00061 #define C1 0.109 /* Albertson Constant */ 00062 #define ucrit 0.0001 /* if(vo<ucrit*uo) assume vo==0 */ 00063 #define pcrit 0.01 /* if(ccnc<pcrit) assume ccnc=0 (kg/m^3) */ 00064 #define plg 5.17605 /* plg*bo = length of plug flow from river mouth */ 00065 #define npts 11 /* +/- number of points to search for plume centerline */ 00066 #define mberr 0.4 /* Maximum mass balance error: abs((tdeps-triver)/triver) < mberr */ 00067 #define sprd tan(14*degTOr) /* spread angle of the plume = 14 degrees */ 00068 /* 00069 * File id numbers 00070 */ 00071 extern FILE *fidlog; /* Log file */ 00072 /* 00073 * Numerical Recipes utilities (nrutil) array types 00074 */ 00075 void nrerror(char []); 00076 float **matrix( long, long, long, long); 00077 double **new_dmatrix( long, long); 00078 float ***f3tensor( long, long, long, long, long, long); 00079 double ***new_d3tensor( long, long, long); 00080 void free_matrix( float **, long, long, long, long); 00081 void free_dmatrix( double ** ); 00082 void free_f3tensor( float ***, long, long, long, long, long, long); 00083 void free_d3tensor( double *** ); 00084 00085 /* 00086 * Data arrays 00087 */ 00088 /* 00089 extern double ***ccnc, ***ncnc, ***deps, ***dist; 00090 extern double **ualb, **pcent, **sln; 00091 extern double *xval, *yval; 00092 extern int lc, lpc, lx, ly, zx, zy; 00093 */ 00094 00095 /* 00096 * Mass balance values 00097 * (Qsw[4] size must match xi[4] size and assignments in PlumeMass.c) 00098 */ 00099 //extern double Qsr, Qsw[4], Tsr, Tsd[2], merr; 00100 00101 #endif /* plumevars.h is included*/