Skip to content
Snippets Groups Projects
Commit 532912be authored by ESCOBAR Juan's avatar ESCOBAR Juan
Browse files

Juan 14/03/2022:tensor/multigrid.f90, revert to allocate in place of zt1d_discretisation_allocate3d

parent 975d7832
No related branches found
No related tags found
No related merge requests found
...@@ -172,8 +172,6 @@ contains ...@@ -172,8 +172,6 @@ contains
real , dimension(:,:,:) , pointer , contiguous :: zxu_mg_st,zxb_mg_st,zxr_mg_st real , dimension(:,:,:) , pointer , contiguous :: zxu_mg_st,zxb_mg_st,zxr_mg_st
integer :: iindex
if (i_am_master_mpi) & if (i_am_master_mpi) &
write(STDOUT,*) '*** Initialising multigrid ***' write(STDOUT,*) '*** Initialising multigrid ***'
! Check that cell counts are valid ! Check that cell counts are valid
...@@ -281,34 +279,22 @@ contains ...@@ -281,34 +279,22 @@ contains
endif endif
if (LUseT) then if (LUseT) then
!!$ allocate(zxu_mg_st(1-halo_size:nlocal+halo_size, & allocate(zxu_mg_st(1-halo_size:nlocal+halo_size, &
!!$ 1-halo_size:nlocal+halo_size, & 1-halo_size:nlocal+halo_size, &
!!$ 0:nz+1)) 0:nz+1))
!!$ !$acc enter data create (zxu_mg_st) !$acc enter data create (zxu_mg_st)
iindex = zt1d_discretisation_allocate3d(zxu_mg_st,&
1-halo_size,nlocal+halo_size, &
1-halo_size,nlocal+halo_size, &
0,nz+1)
xu_mg(level,m)%st => zxu_mg_st xu_mg(level,m)%st => zxu_mg_st
!!$ allocate(zxb_mg_st(1-halo_size:nlocal+halo_size, & allocate(zxb_mg_st(1-halo_size:nlocal+halo_size, &
!!$ 1-halo_size:nlocal+halo_size, & 1-halo_size:nlocal+halo_size, &
!!$ 0:nz+1)) 0:nz+1))
!!$ !$acc enter data create (zxb_mg_st) !$acc enter data create (zxb_mg_st)
iindex = zt1d_discretisation_allocate3d(zxb_mg_st,&
1-halo_size,nlocal+halo_size, &
1-halo_size,nlocal+halo_size, &
0,nz+1)
xb_mg(level,m)%st => zxb_mg_st xb_mg(level,m)%st => zxb_mg_st
!!$ allocate(zxr_mg_st(1-halo_size:nlocal+halo_size, & allocate(zxr_mg_st(1-halo_size:nlocal+halo_size, &
!!$ 1-halo_size:nlocal+halo_size, & 1-halo_size:nlocal+halo_size, &
!!$ 0:nz+1)) 0:nz+1))
!!$ !$acc enter data create (zxr_mg_st) !$acc enter data create (zxr_mg_st)
iindex = zt1d_discretisation_allocate3d(zxr_mg_st,&
1-halo_size,nlocal+halo_size, &
1-halo_size,nlocal+halo_size, &
0,nz+1)
xr_mg(level,m)%st => zxr_mg_st xr_mg(level,m)%st => zxr_mg_st
!$acc kernels !$acc kernels
...@@ -825,8 +811,13 @@ contains ...@@ -825,8 +811,13 @@ contains
real , dimension(:,:,:) , pointer , contiguous :: zphifine_st , zphicoarse_st real , dimension(:,:,:) , pointer , contiguous :: zphifine_st , zphicoarse_st
integer :: nz integer :: nz
integer :: ix_min, ix_max, iy_min, iy_max
nz = phicoarse%grid_param%nz nz = phicoarse%grid_param%nz
ix_min = ixmin(iblock)
ix_max = ixmax(iblock)
iy_min = iymin(iblock)
iy_max = iymax(iblock)
! optimisation for newman MNH case : all coef constant ! optimisation for newman MNH case : all coef constant
rhox = 0.25_rl rhox = 0.25_rl
...@@ -862,8 +853,8 @@ contains ...@@ -862,8 +853,8 @@ contains
do iz=1,nz do iz=1,nz
do diy = -1,0 do diy = -1,0
do dix = -1,0 do dix = -1,0
do iy=iymin(iblock),iymax(iblock) do iy=iy_min,iy_max
do ix=ixmin(iblock),ixmax(iblock) do ix=ix_min,ix_max
zphifine_st(2*ix+dix,2*iy+diy,iz) = & zphifine_st(2*ix+dix,2*iy+diy,iz) = &
zphicoarse_st(ix,iy,iz) + & zphicoarse_st(ix,iy,iz) + &
rhox*(zphicoarse_st(ix+(2*dix+1),iy,iz) & rhox*(zphicoarse_st(ix+(2*dix+1),iy,iz) &
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment