fielddump Subroutine

public subroutine fielddump()

Uses

  • proc~~fielddump~~UsesGraph proc~fielddump fielddump module~modfields modfields proc~fielddump->module~modfields module~modglobal modglobal proc~fielddump->module~modglobal module~modmpi modmpi proc~fielddump->module~modmpi module~modstat_nc modstat_nc proc~fielddump->module~modstat_nc module~modsurfdata modsurfdata proc~fielddump->module~modsurfdata decomp_2d decomp_2d module~modfields->decomp_2d mpi mpi module~modmpi->mpi module~modstat_nc->module~modmpi netcdf netcdf module~modstat_nc->netcdf

Arguments

None

Calls

proc~~fielddump~~CallsGraph proc~fielddump fielddump interface~writestat_nc writestat_nc proc~fielddump->interface~writestat_nc proc~writestat_1d_nc writestat_1D_nc interface~writestat_nc->proc~writestat_1d_nc proc~writestat_2d_nc writestat_2D_nc interface~writestat_nc->proc~writestat_2d_nc proc~writestat_3d_nc writestat_3D_nc interface~writestat_nc->proc~writestat_3d_nc proc~writestat_3d_short_nc writestat_3D_short_nc interface~writestat_nc->proc~writestat_3d_short_nc proc~writestat_time_nc writestat_time_nc interface~writestat_nc->proc~writestat_time_nc nf90_inq_varid nf90_inq_varid proc~writestat_1d_nc->nf90_inq_varid nf90_put_var nf90_put_var proc~writestat_1d_nc->nf90_put_var nf90_sync nf90_sync proc~writestat_1d_nc->nf90_sync proc~writestat_2d_nc->nf90_inq_varid proc~writestat_2d_nc->nf90_put_var proc~writestat_2d_nc->nf90_sync proc~writestat_3d_nc->nf90_inq_varid proc~writestat_3d_nc->nf90_put_var proc~writestat_3d_nc->nf90_sync proc~writestat_3d_short_nc->nf90_inq_varid proc~writestat_3d_short_nc->nf90_put_var proc~writestat_3d_short_nc->nf90_sync proc~writestat_time_nc->nf90_inq_varid proc~writestat_time_nc->nf90_put_var proc~writestat_time_nc->nf90_sync

Called by

proc~~fielddump~~CalledByGraph proc~fielddump fielddump program~dalesurban DALESURBAN program~dalesurban->proc~fielddump

Source Code

  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