module OW_block
use OW_type
use OW_sltpar
implicit none
contains
!===================================================================================
  subroutine owblock()
    integer  :: iwb, izb

    zblock%bres = .false.
    zblock%ds = vgrid%az%d
    zblock%nb = vgrid%az%n / zblock%ns
    zblock%nb_res = mod(vgrid%az%n, zblock%ns)
    if(zblock%nb_res /= 0) then
       zblock%nb = zblock%nb + 1
       zblock%bres = .true.
    end if
    allocate(zblock%blen(zblock%nb), zblock%os(zblock%nb), zblock%indx(zblock%nb))
    zblock%blen = zblock%ns
    if(zblock%bres) zblock%blen(zblock%nb) = zblock%nb_res
    do izb=1, zblock%nb
       zblock%os(izb)   = vgrid%az%o + (izb-1)*zblock%ns*vgrid%az%d
       zblock%indx(izb) = 1 + (izb-1)*zblock%ns
    end do
write(0,*)"zblock%indx", zblock%indx
write(0,*)"zblock%nb", zblock%nb
  end subroutine
!===================================================================================
end module

!        do izb=1, zblock%nb
!           azs%o = zblock%os(izb); azs%d = zblock%ds; azs%n = zblock%blen(izb)
!           if (azs%n /= nzs_bak) then
!              call wei_modl_dealloc()
!              call wei_modl_alloc(azs%n)
!              nzs_bak = azs%n
!           end if
!           call wei_io_velo(zblock%indx(izb), azs%n)
!           do izs=1, azs%n
!              vmod_slice => vmod(:,:,izs)
!              vref_slice => vref(:,izs)
!              stat = wei_vel_oper(vmod_slice, vref_slice)
!              !if (taper) stat = wei_taper_2d_oper(wfld_d, taper_pct)
