Subroutine setco
Use comm
Implicit None
Integer :: j,k

art(0)=0d0
ForAll(j=1:ny+1)
  art(j) = y(j)*dy(j)
End ForAll

ForAll(j=1:ny+1,k=0:nz+1)
  arn(j,k) = (y(j)+5d-1*dy(j))*dz(k)
End ForAll
ForAll(k=0:nz+1) arn(0,k) = (y(1)-5d-1*dy(1))*dz(k)

ForAll(j=0:ny+1,k=0:nz+1)
  vol(j,k) = art(j) * dz(k)
End ForAll

ForAll(j=0:ny)
  g(j) = dy(j)/(dy(j) + dy(j+1))
End ForAll

ForAll(k=0:nz)
  h(k) = dz(k)/(dz(k) + dz(k+1))
End ForAll

total_vol = Sum(vol)
total_gas_vol = Sum(vol,Mask=ian==0)

End Subroutine setco