function fbm_flr(i,j,k,l,ii)

  !  choose gc or ptcl version of fbm
  !  code by mg, autumn 2008

  use nbi_com
  implicit none
  real(fp) :: fbm_flr

  integer, intent(in) :: i,j,k,l,ii
  ! if nlfbmflr=.true. and ii =0 then sum over alpha_v will be observed.

  if(nlfbmflr) then
     if(ii.eq.0) then
        fbm_flr= sum(fbm_ptcl(i,j,k,l,:)) !ptcl version
     else
        fbm_flr= fbm_ptcl(i,j,k,l,ii) !ptcl version
     end if
  else
     fbm_flr= fbm(i,j,k,l) !gc
  end if

  return
end function fbm_flr
