roundoff_minmax Function

public function roundoff_minmax(val, minval, maxval)

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: val
double precision, intent(in) :: minval
double precision, intent(in) :: maxval

Return Value doubleprecision


Called by

proc~~roundoff_minmax~~CalledByGraph proc~roundoff_minmax roundoff_minmax proc~put_slice put_slice proc~put_slice->proc~roundoff_minmax proc~write_slice write_slice proc~write_slice->proc~put_slice proc~saveamrfile saveamrfile proc~saveamrfile->proc~write_slice proc~timeintegration timeintegration proc~timeintegration->proc~saveamrfile proc~main main proc~main->proc~timeintegration program~agile agile program~agile->proc~main

Source Code

  double precision function roundoff_minmax(val,minval,maxval)
    implicit none
    double precision,intent(in)         :: val, minval, maxval

    roundoff_minmax = val

    if (abs(roundoff_minmax) .le. minval) then
       roundoff_minmax = 0.0d0
    end if

    if (roundoff_minmax .gt. maxval) then
       roundoff_minmax = maxval
    else if (roundoff_minmax .lt. -maxval) then
       roundoff_minmax = -maxval
    end if

    ! Replace NaN with maxval (e.g. Paraview chokes on ASCII NaN):
    if (roundoff_minmax /= roundoff_minmax) roundoff_minmax = maxval

  end function roundoff_minmax