00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "snoopy.h"
00021
00022 #define CHECK_NAN(XIN) c_nan(XIN, __func__, __LINE__,__FILE__)
00023
00024
00025
00026 extern double *kx, *ky, *kz, *kxt, *k2t, *ik2t;
00027 extern double kxmax, kymax, kzmax, kmax;
00028
00029
00030
00031 extern double *mask;
00032
00033 extern double *wr1, *wr2, *wr3;
00034 extern double *wr4, *wr5, *wr6;
00035 extern double *wr7, *wr8, *wr9;
00036 extern double *wr10, *wr11, *wr12;
00037 extern double *wr13, *wr14, *wr15;
00038
00039 extern double complex *w1, *w2, *w3;
00040 extern double complex *w4, *w5, *w6;
00041 extern double complex *w7, *w8, *w9;
00042 extern double complex *w10, *w11, *w12;
00043 extern double complex *w13, *w14, *w15;
00044
00045
00046
00047 extern struct Parameters param;
00048
00049
00050 extern double nu;
00051
00052 #ifdef BOUSSINESQ
00053 extern double nu_th;
00054 #ifdef N2PROFILE
00055 extern double *N2_profile;
00056 #endif
00057 #endif
00058
00059 #ifdef MHD
00060 extern double eta;
00061 #endif
00062
00063
00064 #ifdef MPI_SUPPORT
00065 extern int NPROC;
00066 #endif
00067 extern int rank;
00068
00069
00070 extern int nthreads;
00071
00072
00073
00074 void init_common ( void );
00075 void finish_common ( void );
00076 void allocate_field(struct Field *fldi);
00077 void deallocate_field(struct Field *fldi);
00078 double get_c_time(void);
00079
00080
00081 void reduce(double *var, const int op);
00082
00083 float big_endian(float in_number);
00084
00085 double randm_normal(void);
00086 double randm (void);
00087
00088 void projector( double complex qx[],
00089 double complex qy[],
00090 double complex qz[]);
00091
00092 double energy(const double complex q[]);
00093
00094 #ifdef COMPRESSIBLE
00095 void check_positivity(double *wri);
00096 #endif
00097