subroutine plot_fp_mkvec(zrange1,zrange2,n,vec)

  ! generate logarithmically spaced ascending vector, from endpt values

  use iso_c_binding, only: fp => c_double
  real(fp), intent(in) :: zrange1,zrange2  ! min and max of range for vec
  integer, intent(in) :: n  ! size of vec

  real(fp), intent(out) :: vec(n)

  !------------------

  real(fp) :: zmin,zmax,zv
  integer i

  !------------------

  zmin=log(min(zrange1,zrange2))
  zmax=log(max(zrange1,zrange2))

  vec(1)=min(zrange1,zrange2)
  vec(n)=max(zrange1,zrange2)

  do i=2,n-1
     zv=((n-i)*zmin+(i-1)*zmax)/(n-1)
     vec(i)=exp(zv)
  enddo

end subroutine plot_fp_mkvec
