subroutine stats_write_tavg_islice implicit none integer :: n, i, m real, allocatable :: fld(:,:,:), tmp(:,:,:) if (local_ntislice > 0) then ! this rank holds at least one plane of this orientation allocate(fld(ib:ie, jb:je, kb:ke), tmp(local_ntislice, jb:je, kb:ke)) if (myidy == 0) call writestat_nc(ncidtis, 'time', timee, nrectis, .true.) do n = 1, tVarsCount call stats_tavg_field(trim(tVars(n,1)), fld) m = 0 do i = 1, nislice if (islice(i) >= zstart(1) .and. islice(i) <= zend(1)) then m = m + 1 tmp(m,:,:) = fld(islice(i) - zstart(1) + 1, :, :) end if end do call writeoffset(ncidtis, trim(tVars(n,1)), tmp, nrectis, local_ntislice, ydim, zdim) end do deallocate(fld, tmp) end if end subroutine stats_write_tavg_islice