How to have access to all cell data?

You can access the East, North and Top face locations of a scalar cell with

use cutcell, only: xg_e, yg_n, zg_t

at the top of the routine (with other “use” statements). Then if you want the location in a cell that has I,J,K indices, use XG_E(I) , YG_N(J), and ZG_T(K) .

If you need the cell center coordinate, you have to offset the face location by half the cell size (dx,dy,dz). These are in the “geometry” module:

USE geometry, only: dx,dy,dz

so the cell center would be at

xc = XG_E(I) - 0.5 * dx(I)
yc = YG_N(J) - 0.5 * dy(J)
zc = ZG_T(K) - 0.5 * dz(K)
1 Like