source: CIVL/examples/omp/HydroC/qleftright.c@ 1aaefd4

main test-branch
Last change on this file since 1aaefd4 was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 2.7 KB
Line 
1/*
2 A simple 2D hydro code
3 (C) Romain Teyssier : CEA/IRFU -- original F90 code
4 (C) Pierre-Francois Lavallee : IDRIS -- original F90 code
5 (C) Guillaume Colin de Verdiere : CEA/DAM -- for the C version
6*/
7/*
8
9This software is governed by the CeCILL license under French law and
10abiding by the rules of distribution of free software. You can use,
11modify and/ or redistribute the software under the terms of the CeCILL
12license as circulated by CEA, CNRS and INRIA at the following URL
13"http://www.cecill.info".
14
15As a counterpart to the access to the source code and rights to copy,
16modify and redistribute granted by the license, users are provided only
17with a limited warranty and the software's author, the holder of the
18economic rights, and the successive licensors have only limited
19liability.
20
21In this respect, the user's attention is drawn to the risks associated
22with loading, using, modifying and/or developing or reproducing the
23software by the user in light of its specific status of free software,
24that may mean that it is complicated to manipulate, and that also
25therefore means that it is reserved for developers and experienced
26professionals having in-depth computer knowledge. Users are therefore
27encouraged to load and test the software's suitability as regards their
28requirements in conditions enabling the security of their systems and/or
29data to be ensured and, more generally, to use and operate it in the
30same conditions as regards security.
31
32The fact that you are presently reading this means that you have had
33knowledge of the CeCILL license and that you accept its terms.
34
35*/
36
37#include <stdlib.h>
38#include <unistd.h>
39#include <math.h>
40#include <stdio.h>
41
42#include "parametres.h"
43#include "utils.h"
44#include "qleftright.h"
45
46#ifndef HMPP
47
48void
49// qleftright(const int idim, const hydroparam_t H, hydrovarwork_t * Hvw)
50qleftright(const int idim,
51 const int Hnx,
52 const int Hny,
53 const int Hnxyt,
54 const int Hnvar,
55 const int slices, const int Hstep,
56 real_t qxm[Hnvar][Hstep][Hnxyt],
57 real_t qxp[Hnvar][Hstep][Hnxyt], real_t qleft[Hnvar][Hstep][Hnxyt],
58 real_t qright[Hnvar][Hstep][Hnxyt]) {
59 // #define IHVW(i,v) ((i) + (v) * Hnxyt)
60 int nvar, i, s;
61 int bmax;
62 WHERE("qleftright");
63 if (idim == 1) {
64 bmax = Hnx + 1;
65 } else {
66 bmax = Hny + 1;
67 }
68
69#pragma omp parallel for private(nvar, i, s), shared(qleft, qright)
70 for (s = 0; s < slices; s++) {
71 for (nvar = 0; nvar < Hnvar; nvar++) {
72#pragma simd
73 for (i = 0; i < bmax; i++) {
74 qleft[nvar][s][i] = qxm[nvar][s][i + 1];
75 qright[nvar][s][i] = qxp[nvar][s][i + 2];
76 }
77 }
78 }
79}
80
81#undef IHVW
82
83#endif /* HMPP */
84// EOF
Note: See TracBrowser for help on using the repository browser.