I’m doing a classical simulation of the buoyancy driven mixing of two fluids in a sloping channel.
The simulation gives good results, but I’m having some worries with the computation of front velocity when running parallel simulation.
I’m working with a 2D rectangular and uniform mesh, x being the horizontal direction and z the vertical one.
Basically, I want to integrate the density over the z direction for all x values.
I'm working with version 3.0.7 .
Here is the problematic part of my code:
Code: Select all
double precision, allocatable, dimension(:) :: hauteurfx
double precision dx, dz
integer nb_mesh_x, nb_mesh_z, ii, jj
…
nb_mesh_x = 1500 ! number of cells in the horizontal direction
nb_mesh_z = 250 ! number of cells in the vertical direction
dx = 20 / float(nb_mesh_x)
dz = 1.0 / float(nb_mesh_z)
! Integration of the density in each x abscissa
allocate(hauteurfx(nb_mesh_x))
hauteurfx = hauteurfx*0.d0 ! initialisation for security
do ii=1,ncel
!calculation of the absciss
jj = int(floor(xyzcen(1,ii)/dx))+1
hauteurfx(jj) = hauteurfx(jj) + propce(ii,irom) * dz
! hauteurfx(jj) = 1.0
enddo
! sum over all procs
if (irangp.ge.0) then
call parrsm(nb_mesh_x, hauteurfx)
I check the code with a single process, all work fine.
In order to understand the way parrsm work, I try to replace ‘hauteurfx(jj) = 1.0’, expecting to get a result between 1 and 16 (number of procs I’m using). Instead, I get strange values, seeming to follow the law
hauteurfx(x) = n_procs(x) * nb_mesh_x + 1
nprocs(x) being the number of procs ‘encountered’ at the x abscissa…
I’ve to admit I’m completely lost here. If someone could help me, I’ll be more than grateful!
Thank in advance for helping.
Fanny