<commit_before>subroutine states(idir, qx, qy, ng, dx, dt, &
                  nvar, &
                  gamma, &
                  r, u, v, p, &
                  ldelta_r, ldelta_u, ldelta_v, ldelta_p, &
                  q_l, q_r)

  implicit none

  integer, intent(in) :: idir
  integer, intent(in) :: qx, qy, ng
  double precision, intent(in) :: dx, dt
  integer, intent(in) :: nvar
  double precision, intent(in) :: gamma

  ! 0-based indexing to match python
  double precision, intent(inout) :: r(0:qx-1, 0:qy-1)
  double precision, intent(inout) :: u(0:qx-1, 0:qy-1)
  double precision, intent(inout) :: v(0:qx-1, 0:qy-1)
  double precision, intent(inout) :: p(0:qx-1, 0:qy-1)

  double precision, intent(inout) :: ldelta_r(0:qx-1, 0:qy-1)
  double precision, intent(inout) :: ldelta_u(0:qx-1, 0:qy-1)
  double precision, intent(inout) :: ldelta_v(0:qx-1, 0:qy-1)
  double precision, intent(inout) :: ldelta_p(0:qx-1, 0:qy-1)

  double precision, intent(  out) :: q_l(0:qx-1, 0:qy-1, 0:nvar-1)
  double precision, intent(  out) :: q_r(0:qx-1, 0:qy-1, 0:nvar-1)

!f2py depend(qx, qy) :: r, u, v, p
!f2py depend(qx, qy) :: ldelta_r, ldelta_u, ldelta_v, ldelta_p
!f2py depend(qx, qy, nvar) :: q_l, q_r
!f2py intent(in) :: r, u, v, p
!f2py intent(in) :: ldelta_r, ldelta_u, ldelta_v, ldelta_p
!f2py intent(out) :: q_l, q_r
 


  ! predict the cell-centered state to the edges in one-dimension
  ! using the reconstructed, limited slopes.
  integer :: ilo, ihi, jlo, jhi
  integer :: nx, ny
  integer :: i, j, m

  double precision :: dq(0:nvar-1), q(0:nvar-1)

  double precision :: dtdx, dtdx4
  double precision :: cs

  double precision :: sum, sum_l, sum_r, factor

  nx = qx - 2*ng; ny = qy - 2*ng
  ilo = ng; ihi = ng+nx-1; jlo = ng; jhi = ng+ny-1


  ! this is the loop over zones.  For zone i, we see q_l[i+1] and q_r[i]
  do j = jlo-2, jhi+2
     do i = ilo-2, ihi+2

        dq(:) = [ldelta_r(i,j), &
                 ldelta_u(i,j), & 
                 ldelta_v(i,j), &
                 ldelta_p(i,j)]

        q(:) = [r(i,j), u(i,j), v(i,j), p(i,j)]

        ! construct the states
        if (idir == 1) then
           q_l(i+1,j,:) = q(:) + 0.5d0*dx*dq(:)
           q_r(i,  j,:) = q(:) - 0.5d0*dx*dq(:)
        else
           q_l(i,j+1,:) = q(:) + 0.5d0*dx*dq(:)
           q_r(i,j,  :) = q(:) - 0.5d0*dx*dq(:)

        endif

     enddo
  enddo

end subroutine states


subroutine riemann_cgf(idir, qx, qy, ng, &
                       nvar, idens, ixmom, iymom, iener, &
                       lower_solid, upper_solid, &
                       gamma, U_l, U_r, F)

  implicit none

  integer, intent(in) :: idir<commit_msg>fix the reconstruction -- had an extraneous dx in there<commit_after>subroutine states(idir, qx, qy, ng, dx, dt, &
                  nvar, &
                  gamma, &
                  r, u, v, p, &
                  ldelta_r, ldelta_u, ldelta_v, ldelta_p, &
                  q_l, q_r)

  implicit none

  integer, intent(in) :: idir
  integer, intent(in) :: qx, qy, ng
  double precision, intent(in) :: dx, dt
  integer, intent(in) :: nvar
  double precision, intent(in) :: gamma

  ! 0-based indexing to match python
  double precision, intent(inout) :: r(0:qx-1, 0:qy-1)
  double precision, intent(inout) :: u(0:qx-1, 0:qy-1)
  double precision, intent(inout) :: v(0:qx-1, 0:qy-1)
  double precision, intent(inout) :: p(0:qx-1, 0:qy-1)

  double precision, intent(inout) :: ldelta_r(0:qx-1, 0:qy-1)
  double precision, intent(inout) :: ldelta_u(0:qx-1, 0:qy-1)
  double precision, intent(inout) :: ldelta_v(0:qx-1, 0:qy-1)
  double precision, intent(inout) :: ldelta_p(0:qx-1, 0:qy-1)

  double precision, intent(  out) :: q_l(0:qx-1, 0:qy-1, 0:nvar-1)
  double precision, intent(  out) :: q_r(0:qx-1, 0:qy-1, 0:nvar-1)

!f2py depend(qx, qy) :: r, u, v, p
!f2py depend(qx, qy) :: ldelta_r, ldelta_u, ldelta_v, ldelta_p
!f2py depend(qx, qy, nvar) :: q_l, q_r
!f2py intent(in) :: r, u, v, p
!f2py intent(in) :: ldelta_r, ldelta_u, ldelta_v, ldelta_p
!f2py intent(out) :: q_l, q_r
 


  ! predict the cell-centered state to the edges in one-dimension
  ! using the reconstructed, limited slopes.
  integer :: ilo, ihi, jlo, jhi
  integer :: nx, ny
  integer :: i, j, m

  double precision :: dq(0:nvar-1), q(0:nvar-1)

  double precision :: dtdx, dtdx4
  double precision :: cs

  double precision :: sum, sum_l, sum_r, factor

  nx = qx - 2*ng; ny = qy - 2*ng
  ilo = ng; ihi = ng+nx-1; jlo = ng; jhi = ng+ny-1


  ! this is the loop over zones.  For zone i, we see q_l[i+1] and q_r[i]
  do j = jlo-2, jhi+2
     do i = ilo-2, ihi+2

        dq(:) = [ldelta_r(i,j), &
                 ldelta_u(i,j), & 
                 ldelta_v(i,j), &
                 ldelta_p(i,j)]

        q(:) = [r(i,j), u(i,j), v(i,j), p(i,j)]

        ! construct the states
        if (idir == 1) then
           q_l(i+1,j,:) = q(:) + 0.5d0*dq(:)
           q_r(i,  j,:) = q(:) - 0.5d0*dq(:)
        else
           q_l(i,j+1,:) = q(:) + 0.5d0*dq(:)
           q_r(i,j,  :) = q(:) - 0.5d0*dq(:)

        endif

     enddo
  enddo

end subroutine states


subroutine riemann_cgf(idir, qx, qy, ng, &
                       nvar, idens, ixmom, iymom, iener, &
                       lower_solid, upper_solid, &
                       gamma, U_l, U_r, F)

  implicit none

  integer, intent(in) :: idir
{'fraction_non_alphanumeric': 0.16641622839969947, 'fraction_numerical': 0.03005259203606311, 'mean_word_length': 2.344849246231156, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4530214', 'n_tokens_mistral': 2437, 'n_tokens_neox': 2292, 'n_words': 553}