<commit_before>module mg_solvers

  use mg_mpi
  use mg_tictoc
  use mg_namelist
  use mg_grids
  use mg_intergrids
  use mg_relax
  use mg_intergrids
  use mg_netcdf_out

  implicit none

contains

  !---------------------------------------------------------------------
  subroutine solve(tol,maxite)

    real(kind=rp)   , intent(in) :: tol
    integer(kind=ip), intent(in) :: maxite

    ! local
    real(kind=rp)    :: rnorm,bnorm,res0,conv,rnorm0
    integer(kind=ip) :: nite

    integer(kind=ip) :: nx,ny,nz
    real(kind=rp), dimension(:,:,:), allocatable :: p0,b0
    real(kind=rp), dimension(:,:,:), pointer :: p,b,r

    real(kind = lg) :: tstart,tend,perf
    real(kind=rp) :: rnxg,rnyg,rnzg
    real(kind=rp) :: rnpxg,rnpyg

    p  => grid(1)%p
    b  => grid(1)%b
    r  => grid(1)%r

    nx = grid(1)%nx
    ny = grid(1)%ny
    nz = grid(1)%nz

!!$    allocate(p0(nz,0:ny+1,0:nx+1))
!!$    allocate(b0(nz,0:ny+1,0:nx+1))
!!$
!!$    p0 = p
!!$    b0 = b

    call tic(1,'solve')
    call cpu_time(tstart)

    nite=0

    res0 = sum(grid(1)%b(1:nz,1:ny,1:nx)**2)<commit_msg>Removing allocatable p0 and b0 arrays which are not necessary<commit_after>module mg_solvers

  use mg_mpi
  use mg_tictoc
  use mg_namelist
  use mg_grids
  use mg_intergrids
  use mg_relax
  use mg_intergrids
  use mg_netcdf_out

  implicit none

contains

  !---------------------------------------------------------------------
  subroutine solve(tol,maxite)

    real(kind=rp)   , intent(in) :: tol
    integer(kind=ip), intent(in) :: maxite

    ! local
    real(kind=rp)    :: rnorm,bnorm,res0,conv,rnorm0
    integer(kind=ip) :: nite

    integer(kind=ip) :: nx,ny,nz
    real(kind=rp), dimension(:,:,:), pointer :: p,b,r

    real(kind = lg) :: tstart,tend,perf
    real(kind=rp) :: rnxg,rnyg,rnzg
    real(kind=rp) :: rnpxg,rnpyg

    p  => grid(1)%p
    b  => grid(1)%b
    r  => grid(1)%r

    nx = grid(1)%nx
    ny = grid(1)%ny
    nz = grid(1)%nz

    call tic(1,'solve')
    call cpu_time(tstart)

    nite=0

    res0 = sum(grid(1)%b(1:nz,1:ny,1:nx)**2)
{'fraction_non_alphanumeric': 0.21952404079650314, 'fraction_numerical': 0.023312287518212724, 'mean_word_length': 2.4390651085141903, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1633787', 'n_tokens_mistral': 897, 'n_tokens_neox': 853, 'n_words': 150}