finalize_field_log Subroutine

public subroutine finalize_field_log(f)

Choose default binning of field f once its range is known.

Log if range is strictly positive and spans over two decades (e.g. temperature, density, luminosity), else linear. No finite samples gives range [0, 1].

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: f

Field index in registry.


Source Code

   subroutine finalize_field_log(f)
      !! Choose default binning of field `f` once its range is known.
      !!
      !! Log if range is strictly positive and spans over two decades (e.g. temperature, density,
      !! luminosity), else linear. No finite samples gives range [0, 1].
      ! Arguments
      integer(int32), intent(in) :: f
         !! Field index in registry.
      logical :: wide

      if (field_vmax(f) < field_vmin(f)) then
         field_vmin(f) = 0.d0
         field_vmax(f) = 1.d0
      end if
      wide = (field_vmin(f) > 0.d0) .and. &
             (field_vmax(f) > field_vmin(f)*1.d2)
      field_log(f) = wide
   end subroutine finalize_field_log