subroutine stats_write_tavg_jslice implicit none integer :: n, j, m real, allocatable :: fld(:,:,:), tmp(:,:,:) if (local_ntjslice > 0) then ! this rank holds at least one plane of this orientation allocate(fld(ib:ie, jb:je, kb:ke), tmp(ib:ie, local_ntjslice, kb:ke)) if (myidx == 0) call writestat_nc(ncidtjs, 'time', timee, nrectjs, .true.) do n = 1, tVarsCount call stats_tavg_field(trim(tVars(n,1)), fld) m = 0 do j = 1, njslice if (jslice(j) >= zstart(2) .and. jslice(j) <= zend(2)) then m = m + 1 tmp(:,m,:) = fld(:, jslice(j) - zstart(2) + 1, :) end if end do call writeoffset_1dx(ncidtjs, trim(tVars(n,1)), tmp, nrectjs, xdim, local_ntjslice, zdim) end do deallocate(fld, tmp) end if end subroutine stats_write_tavg_jslice