create_uniform_coord Function

private function create_uniform_coord(k, finish, start, ncells)

Arguments

Type IntentOptional Attributes Name
integer :: k
real(kind=ESMF_KIND_R8) :: finish
real(kind=ESMF_KIND_R8) :: start
integer :: ncells

Return Value real(kind=esmf_kind_r8)


Source Code

  real(ESMF_KIND_R8) function create_uniform_coord(k, finish, start, ncells)
  !-----------------------------------------------------------------------------
  ! define the coordinate for a uniform grid in terms of the global index k,
  ! the top and bottom of the range (finish and start), and the total number
  ! of cells.
  ! create_uniform_coord(1) = start
  ! create_uniform_coord(ncells) = finish
  !-----------------------------------------------------------------------------
  integer :: k, ncells
  real(ESMF_KIND_R8) :: finish, start
  !-----------------------------------------------------------------------------
  create_uniform_coord =  (k-1)*(finish-start)/(ncells-1) +start

  !-----------------------------------------------------------------------------
  end function create_uniform_coord