M3_system.h

00001 /*******************************************************************************
00002 *   M3:  M3_system.h                                                           *
00003 *                                                                              *
00004 *   Version 1.0 May 2004                                                       *
00005 *                                                                              *
00006 *   Copyright (C) 2004  J. Borrill                                             *
00007 *                                                                              *
00008 *   This program is free software; you can redistribute it and/or modify       *
00009 *   it under the terms of the GNU General Public License as published by       *
00010 *   the Free Software Foundation; either version 2 of the License, or          *
00011 *   (at your option) any later version.                                        *
00012 *                                                                              *
00013 *   This program is distributed in the hope that it will be useful,            *
00014 *   but WITHOUT ANY WARRANTY; without even the implied warranty of             *
00015 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *
00016 *   GNU General Public License for more details.                               *
00017 *                                                                              *
00018 *   You should have received a copy of the GNU General Public License          *
00019 *   along with this program; if not, write to the Free Software                *
00020 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  *
00021 *                                                                              *
00022 *******************************************************************************/
00023 
00024 
00025 #ifndef _H_M3_system
00026 #define _H_M3_system
00027 
00028 #include <stdint.h>
00029 #include <math.h>
00030 
00031 #ifdef MACH_LONG4
00032 #  define f90strlen int32_t
00033 #else
00034 #  define f90strlen int64_t
00035 #endif
00036 
00037 #ifndef MACH_FILE64
00038 #  include <sys/types.h>
00039 #  include <sys/stat.h>
00040 #  define stat64 stat
00041 #  define fseeko64 fseek
00042 #endif
00043 
00044 #ifdef MACH_T3E
00045 #  define malloc shmalloc
00046 #  include <fortran.h>
00047 #  define MACH_F77_UPPERCASE
00048 #  define charArg(c) _cptofcd(c, 1)
00049 #else
00050 #  define charArg(c) c
00051 #endif
00052 
00053 #ifndef M3_DISK_BUFFER_SIZE
00054 #define M3_DISK_BUFFER_SIZE 8388608
00055 #endif
00056 
00057 #ifndef M3_MPI_BUFFER_SIZE
00058 #define M3_MPI_BUFFER_SIZE 8388608
00059 #endif
00060 
00061 /* If we are compiling with the C99 standard, some math */
00062 /* constants are no longer defined.  Define them here,  */
00063 /* using the values in math.h                           */
00064 
00065 #ifdef __STRICT_ANSI__
00066 
00067 # define M_E            2.7182818284590452354   /* e */
00068 # define M_LOG2E        1.4426950408889634074   /* log_2 e */
00069 # define M_LOG10E       0.43429448190325182765  /* log_10 e */
00070 # define M_LN2          0.69314718055994530942  /* log_e 2 */
00071 # define M_LN10         2.30258509299404568402  /* log_e 10 */
00072 # define M_PI           3.14159265358979323846  /* pi */
00073 # define M_PI_2         1.57079632679489661923  /* pi/2 */
00074 # define M_PI_4         0.78539816339744830962  /* pi/4 */
00075 # define M_1_PI         0.31830988618379067154  /* 1/pi */
00076 # define M_2_PI         0.63661977236758134308  /* 2/pi */
00077 # define M_2_SQRTPI     1.12837916709551257390  /* 2/sqrt(pi) */
00078 # define M_SQRT2        1.41421356237309504880  /* sqrt(2) */
00079 # define M_SQRT1_2      0.70710678118654752440  /* 1/sqrt(2) */
00080 
00081 typedef char* caddr_t;
00082 
00083 struct timezone {
00084   int  tz_minuteswest; /* minutes W of Greenwich */
00085   int  tz_dsttime;     /* type of dst correction */
00086 };
00087 
00088 #endif
00089 
00090 #include "M3_fortran.h"
00091 
00092 #endif
00093 

Generated on Mon Nov 24 10:05:12 2008 for M3 by  doxygen 1.5.3-20071008