<commit_before>module diff
    implicit none

    contains

    subroutine ddx(u,h)
        real, dimension(:,:), intent(inout) :: u
        real, intent(in) :: h

            !$OMP WORKSHARE
                u = (cshift(u,shift=1,dim=1) - u)/h
            !$OMP END WORKSHARE
    end subroutine

    subroutine ddy(u,h)
        real, dimension(:,:), intent(inout) :: u
        real, intent(in) :: h

        !$OMP WORKSHARE
            u = (cshift(u,shift=1,dim=2) - u)/h
        !$OMP END WORKSHARE
    end subroutine

    subroutine lap(u,h)
        real, dimension(:,:), intent(inout) :: u
        real, intent(in) :: h

        u = ( cshift(u,shift=+1, dim=2) &
             +cshift(u,shift=-1,dim=2) &
             +cshift(u,shift=+1,dim=1) &
             +cshift(u,shift=-1,dim=1) &
             -4*u) / h**2
              
    end subroutine

    function myiter(p,h)
        real, dimension(:,:), intent(in) :: p
        real, intent(in) :: h
        real, dimension(size(p,1),size(p,2)) :: myiter

        !$OMP WORKSHARE
        myiter = (cshift(p,shift=+1, dim=2) &
             +cshift(p,shift=-1,dim=2) &
             +cshift(p,shift=+1,dim=1) &
             +cshift(p,shift=-1,dim=1))
        !$OMP END WORKSHARE
    end function

    subroutine xavg(u)
        real, dimension(:,:), intent(inout) :: u
        u = (cshift(u,shift=1,dim=1) + u)/2
    end subroutine
<commit_msg>adapting pressure solver for non-periodic BCs<commit_after>module diff
    implicit none

    contains

    subroutine ddx(u,h)
        real, dimension(:,:), intent(inout) :: u
        real, intent(in) :: h

            !$OMP WORKSHARE
                u = (cshift(u,shift=1,dim=1) - u)/h
            !$OMP END WORKSHARE
    end subroutine

    subroutine ddy(u,h)
        real, dimension(:,:), intent(inout) :: u
        real, intent(in) :: h

        !$OMP WORKSHARE
            u = (cshift(u,shift=1,dim=2) - u)/h
        !$OMP END WORKSHARE
    end subroutine

    subroutine lap(u,h)
        real, dimension(:,:), intent(inout) :: u
        real, intent(in) :: h

        u = ( cshift(u,shift=+1, dim=2) &
             +cshift(u,shift=-1,dim=2) &
             +cshift(u,shift=+1,dim=1) &
             +cshift(u,shift=-1,dim=1) &
             -4*u) / h**2
              
    end subroutine

    function myiter(p,h)
        real, dimension(:,:), intent(in) :: p
        real, intent(in) :: h
        real, dimension(size(p,1),size(p,2)) :: myiter
        integer :: nnx

        nnx = size(p,1)

        myiter = (cshift(p,shift=+1, dim=2) &
             +cshift(p,shift=-1,dim=2) &
             +cshift(p,shift=+1,dim=1) &
             +cshift(p,shift=-1,dim=1))
        myiter(1,:) = myiter(1,:)-p(nnx,:)
        myiter(nnx,:) = myiter(nnx,:)-p(1,:)
    end function

    subroutine xavg(u)
        real, dimension(:,:), intent(inout) :: u
        u = (cshift(u,shift=1,dim=1) + u)/2
    end subroutine

{'fraction_non_alphanumeric': 0.1686206896551724, 'fraction_numerical': 0.02, 'mean_word_length': 1.8751238850346879, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7096648', 'n_tokens_mistral': 1135, 'n_tokens_neox': 1096, 'n_words': 204}