applu.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. #ifdef _OPENMP
  2. #include <omp.h>
  3. #endif
  4. #include "RCCE.h"
  5. #include "npbparams.h"
  6. #include "applu_protos.h"
  7. //c---------------------------------------------------------------------
  8. //c npbparams.h defines parameters that depend on the class and
  9. //c number of nodes
  10. //c---------------------------------------------------------------------
  11. int ipr_default = 1;
  12. double omega_default = 1.2;
  13. double tolrsd1_def=1.0e-08,
  14. tolrsd2_def=1.0e-08, tolrsd3_def=1.0e-08,
  15. tolrsd4_def=1.0e-08, tolrsd5_def=1.0e-08;
  16. double c1 = 1.4, c2 = 0.40, c3 = 0.1, c4 = 1.0, c5 = 1.4;
  17. //c---------------------------------------------------------------------
  18. //c grid
  19. //c---------------------------------------------------------------------
  20. int nx, ny, nz;
  21. int nx0, ny0, nz0;
  22. int ipt, ist, iend;
  23. int jpt, jst, jend;
  24. int ii1, ii2;
  25. int ji1, ji2;
  26. int ki1, ki2;
  27. double dxi, deta, dzeta;
  28. double tx1, tx2, tx3;
  29. double ty1, ty2, ty3;
  30. double tz1, tz2, tz3;
  31. //c---------------------------------------------------------------------
  32. //c dissipation
  33. //c---------------------------------------------------------------------
  34. double dx1, dx2, dx3, dx4, dx5;
  35. double dy1, dy2, dy3, dy4, dy5;
  36. double dz1, dz2, dz3, dz4, dz5;
  37. double dssp;
  38. //c---------------------------------------------------------------------
  39. //c field variables and residuals
  40. //c---------------------------------------------------------------------
  41. double u[5*(isiz1+4)*(isiz2+4)*isiz3],
  42. rsd[5*(isiz1+4)*(isiz2+4)*isiz3],
  43. frct[5*(isiz1+4)*(isiz2+4)*isiz3],
  44. flux[5*(isiz1+2)*(isiz2+2)*isiz3];
  45. //c---------------------------------------------------------------------
  46. //c output control parameters
  47. //c---------------------------------------------------------------------
  48. int ipr, inorm;
  49. #ifdef _OPENMP
  50. #pragma omp threadprivate(ipr, inorm)
  51. #endif
  52. //c---------------------------------------------------------------------
  53. //c newton-raphson iteration control parameters
  54. //c---------------------------------------------------------------------
  55. int itmax, invert;
  56. double dt, omega, tolrsd[5], rsdnm[5], errnm[5], frc, ttotal;
  57. double a[5*5*isiz1*isiz2],
  58. b[5*5*isiz1*isiz2],
  59. c[5*5*isiz1*isiz2],
  60. d[5*5*isiz1*isiz2];
  61. //c---------------------------------------------------------------------
  62. //c coefficients of the exact solution
  63. //c---------------------------------------------------------------------
  64. double ce[5*13];
  65. #ifdef _OPENMP
  66. #pragma omp threadprivate(ce)
  67. #endif
  68. //c---------------------------------------------------------------------
  69. //c multi-processor common blocks
  70. //c---------------------------------------------------------------------
  71. int id, ndim, num, xdim, ydim, row, col;
  72. int north,south,east,west;
  73. int npmax=isiz01+isiz02;
  74. // double buf[5*2*isiz2*isiz3], buf1[5*2*isiz2*isiz3];
  75. double maxtime;
  76. //c---------------------------------------------------------------------
  77. //c coordination flags
  78. //c---------------------------------------------------------------------
  79. RCCE_FLAG flagsent[4], flagready[4];
  80. double *buf1_exch_1;
  81. #ifdef _OPENMP
  82. #pragma omp threadprivate (nx, ny, nz, nx0, ny0, nz0, \
  83. ipt, ist, iend, jpt, jst, jend, \
  84. ii1, ii2, ji1, ji2, ki1, ki2, \
  85. dxi, deta, dzeta, \
  86. tx1, tx2, tx3, ty1, ty2, ty3, tz1, tz2, tz3)
  87. #pragma omp threadprivate (dx1, dx2, dx3, dx4, dx5, \
  88. dy1, dy2, dy3, dy4, dy5, \
  89. dz1, dz2, dz3, dz4, dz5, \
  90. dssp)
  91. #pragma omp threadprivate(u, rsd, frct, flux)
  92. #pragma omp threadprivate(itmax, invert, \
  93. dt, omega, tolrsd, rsdnm, errnm, frc, ttotal, \
  94. a, b, c, d)
  95. #pragma omp threadprivate (id, ndim, num, xdim, ydim, row, col, \
  96. north,south,east,west, flagsent, flagready, \
  97. buf1_exch_1, npmax, maxtime)
  98. #endif
  99. //c---------------------------------------------------------------------
  100. //c end of include file
  101. //c---------------------------------------------------------------------