subroutine fielddump use modfields, only : u0,v0,w0,thl0,qt0,ql0,sv0,pres0,u01,u02,u0h,um,div,dudx,dvdy,dwdz,tau_x !ILS13 21.04.2015 changed to u0 from um etc use modsurfdata,only : thls,qts,thvs use modglobal, only : ib,ie,ih,jb,je,jh,ke,kb,kh,rk3step,timee,dt_lim,cexpnr,ifoutput,imax,jmax,& tfielddump, tnextfielddump,nsv, lfielddump, ktot,fieldvars, imax1,jmax1,kmax1,imax2,jmax2,kmax2,rk3step,dyi,dxfi,dzhi !use modmpi, only : myid,cmyid !use modsubgriddata, only : ekm,sbshr use modstat_nc, only : writestat_nc use modmpi, only : myid,cmyid implicit none real, allocatable :: vars(:,:,:,:), vars1(:,:,:,:), vars2(:,:,:,:) integer i,j,k,n integer :: writecounter = 1 if (.not. ((timee>=tnextfielddump) .or. (rk3step==0))) return if (.not. lfielddump) return if (rk3step/=3 .and. rk3step/=0) return do k=kb,ke do j=jb,je do i=ib,ie dudx(i,j,k) = (u0(i+1,j,k) - u0(i,j,k) )*dxfi(i) dvdy(i,j,k) = (v0(i,j+1,k) - v0(i,j,k) )*dyi dwdz(i,j,k) = (w0(i,j,k+1) - w0(i,j,k) )*dzhi(k) div(i,j,k) = (u0(i+1,j,k) - u0(i,j,k) )*dxfi(i) + & (v0(i,j+1,k) - v0(i,j,k) )*dyi + & (w0(i,j,k+1) - w0(i,j,k) )*dzhi(k) end do end do end do if (rk3step == 3) tnextfielddump=tnextfielddump+tfielddump if (lhalos) then allocate(vars(ib-ih:ie+ih,jb-jh:je+jh,kb-kh:ke+kh,nvar)); vars = 0; do n=1,nvar vars(ib-ih:ie+ih,jb-jh:je+jh,kb-kh:ke+kh,n) = pfields(n)%point end do else allocate(vars(ib:ie,jb:je,kb:ke,nvar)); vars = 0; do n=1,nvar vars(ib:ie,jb:je,kb:ke,n) = pfields(n)%point end do end if call writestat_nc(ncid,1,tncname,(/timee/),nrec,.true.) !call writestat_nc(ncid,nvar,ncname,vars,nrec,imax+2,jmax+2,khigh-klow+1) call writestat_nc(ncid,nvar,ncname,vars,nrec,ihigh-ilow+1,jhigh-jlow+1,khigh-klow+1) deallocate(vars) end subroutine fielddump