MODULE pression_mod
   ! to deal with name inconsistency between devel and trunk
   USE compute_pression_mod
   USE compute_diagnostics_mod, ONLY: compute_pression, compute_pression_mid
CONTAINS

   SUBROUTINE pression(f_ps, f_p)
      USE icosa
      IMPLICIT NONE
      TYPE(t_field), POINTER :: f_ps(:)
      TYPE(t_field), POINTER :: f_p(:)

      REAL(rstd), POINTER :: ps(:)
      REAL(rstd), POINTER :: p(:, :)
      INTEGER :: ind

!$OMP BARRIER
      DO ind = 1, ndomain
         IF (.NOT. assigned_domain(ind)) CYCLE
         CALL swap_dimensions(ind)
         CALL swap_geometry(ind)
         ps = f_ps(ind)
         p = f_p(ind)
         CALL compute_pression(ps, p, 0)
      END DO
!$OMP BARRIER

   END SUBROUTINE pression

   SUBROUTINE pression_mid(f_ps, f_pmid)
      USE icosa
      IMPLICIT NONE
      TYPE(t_field), POINTER :: f_ps(:)
      TYPE(t_field), POINTER :: f_pmid(:)
      REAL(rstd), POINTER :: ps(:)
      REAL(rstd), POINTER :: pmid(:, :)
      INTEGER :: ind

!$OMP BARRIER
      DO ind = 1, ndomain
         IF (.NOT. assigned_domain(ind)) CYCLE
         CALL swap_dimensions(ind)
         CALL swap_geometry(ind)
         ps = f_ps(ind)
         pmid = f_pmid(ind)
         CALL compute_pression_mid(ps, pmid, 0)
      END DO
!$OMP BARRIER

   END SUBROUTINE pression_mid

END MODULE pression_mod

