Package: code-saturne / 6.0.2-2

gcc-10.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
Index: code-saturne-6.0.2/src/base/cs_c_bindings.f90
===================================================================
--- code-saturne-6.0.2.orig/src/base/cs_c_bindings.f90
+++ code-saturne-6.0.2/src/base/cs_c_bindings.f90
@@ -3188,6 +3188,9 @@ contains
     integer        :: hyd_p_flag
     integer        :: idimtr, ipond
     type(c_ptr)    :: f
+    real(kind=c_double), dimension(:), pointer :: c_weight
+    real(kind=c_double), dimension(:), pointer :: f_ext
+    real(kind=c_double), dimension(1), target :: rvoid1
 
     ! Preparation for periodicity of rotation
 
@@ -3218,11 +3221,14 @@ contains
 
     hyd_p_flag = 0
     ipond = 0
+    rvoid1(1) = 0
+    f_ext => rvoid1
+    c_weight => rvoid1
 
     call cgdcel(f_id, imrgra, inc, recompute_cocg, nswrgp,                     &
                 idimtr, hyd_p_flag, ipond, iwarnp, imligp, epsrgp, extrap,     &
-                climgp, c_null_ptr, coefap, coefbp,                            &
-                pvar, c_null_ptr, grad)
+                climgp, f_ext, coefap, coefbp,                            &
+                pvar, c_weight, grad)
 
   end subroutine gradient_s
 
@@ -3269,13 +3275,15 @@ contains
     double precision, intent(in) :: epsrgp, climgp, extrap
     real(kind=c_double), dimension(nfabor), intent(in) :: coefap, coefbp
     real(kind=c_double), dimension(ncelet), intent(inout) :: pvar
-    real(kind=c_double), dimension(3, *), intent(in) :: f_ext
+    real(kind=c_double), dimension(:,:), pointer, intent(in) :: f_ext
     real(kind=c_double), dimension(3, ncelet), intent(out) :: grad
 
     ! Local variables
 
     integer          :: imrgrp
     integer          :: idimtr, ipond
+    real(kind=c_double), dimension(:), pointer :: c_weight
+    real(kind=c_double), dimension(1), target :: rvoid1
 
     ! Use iterative gradient
 
@@ -3289,11 +3297,13 @@ contains
 
     idimtr = 0
     ipond = 0
+    rvoid1(1) = 0
+    c_weight => rvoid1
 
     call cgdcel(f_id, imrgrp, inc, recompute_cocg, nswrgp,                     &
                 idimtr, hyd_p_flag, ipond, iwarnp, imligp, epsrgp, extrap,     &
                 climgp, f_ext, coefap, coefbp,                                 &
-                pvar, c_null_ptr, grad)
+                pvar, c_weight, grad)
 
   end subroutine gradient_potential_s
 
@@ -3342,8 +3352,8 @@ contains
     double precision, intent(in) :: epsrgp, climgp, extrap
     real(kind=c_double), dimension(nfabor), intent(in) :: coefap, coefbp
     real(kind=c_double), dimension(ncelet), intent(inout) :: pvar
-    real(kind=c_double), dimension(*), intent(in) :: c_weight
-    real(kind=c_double), dimension(3, *), intent(in) :: f_ext
+    real(kind=c_double), dimension(:), intent(in) :: c_weight
+    real(kind=c_double), dimension(:,:), pointer, intent(in) :: f_ext
     real(kind=c_double), dimension(3, ncelet), intent(out) :: grad
 
     ! Local variables
Index: code-saturne-6.0.2/src/base/prehyd.f90
===================================================================
--- code-saturne-6.0.2.orig/src/base/prehyd.f90
+++ code-saturne-6.0.2/src/base/prehyd.f90
@@ -125,6 +125,9 @@ double precision normp
 
 double precision rvoid(1)
 
+real(kind=c_double), dimension(:,:), pointer :: pvoid2
+real(kind=c_double), dimension(1,1), target :: rvoid2
+
 double precision, allocatable, dimension(:) :: coefap, cofafp, coefbp, cofbfp
 
 double precision, allocatable, dimension(:) :: viscf, viscb
@@ -169,6 +172,9 @@ endif
 ! --- Matrix block size
 ibsize = 1
 
+! Void arrays
+pvoid2 => rvoid2
+
 !===============================================================================
 ! 2. Solving a diffusion equation with source term to obtain
 !    the a priori hydrostatic pressure
@@ -290,7 +296,7 @@ hyd_p_flag = 0
 call gradient_weighted_s &
  ( f_id   , imrgra , inc    , iccocg , nswrgp , imligp ,         &
    hyd_p_flag,                                                   &
-   iwarnp , epsrgp , climgp , extrap , rvoid  ,                  &
+   iwarnp , epsrgp , climgp , extrap , pvoid2  ,                 &
    prhyd  , xinvro , coefap , coefbp ,                           &
    grdphd   )
 
Index: code-saturne-6.0.2/src/base/ptrglo.f90
===================================================================
--- code-saturne-6.0.2.orig/src/base/ptrglo.f90
+++ code-saturne-6.0.2/src/base/ptrglo.f90
@@ -102,7 +102,7 @@ contains
     deallocate(buffer)
 
     do ii = 1, size
-      call synsca (array(1,ii))
+      call synsca (array(:,ii))
       !==========
     enddo
 
@@ -143,7 +143,7 @@ contains
     enddo
     deallocate(buffer)
 
-    call synvec (array(1,1), array(1,2), array(1,3))
+    call synvec (array(:,1), array(:,2), array(:,3))
     !==========
 
   end subroutine resize_vec_real_array_ni
@@ -225,9 +225,9 @@ contains
 
     call synten &
     !==========
-   ( array(1,1), array(1,2), array(1,3), &
-     array(1,4), array(1,5), array(1,6), &
-     array(1,7), array(1,8), array(1,9) )
+   ( array(:,1), array(:,2), array(:,3), &
+     array(:,4), array(:,5), array(:,6), &
+     array(:,7), array(:,8), array(:,9) )
 
   end subroutine resize_tens_real_array_ni
 
Index: code-saturne-6.0.2/src/cogz/sootsc.f90
===================================================================
--- code-saturne-6.0.2.orig/src/cogz/sootsc.f90
+++ code-saturne-6.0.2/src/cogz/sootsc.f90
@@ -167,7 +167,7 @@ if (ivar.eq.isca(ifsm).or.ivar.eq.isca(i
   d2s3 = 2.d0/3.d0
 
   if (irangp.ge.0.or.iperio.eq.1) then
-    call synsca(cpro_temp(1))
+    call synsca(cpro_temp)
     call synsca(cvar_scal)
   endif