MAPL_LocStreamFracArea Subroutine

public subroutine MAPL_LocStreamFracArea(LocStream, TYPE, AREA, RC)

Arguments

Type IntentOptional Attributes Name
type(MAPL_LocStream), intent(in) :: LocStream
integer, intent(in) :: TYPE
real, intent(out) :: AREA(:,:)
integer, intent(out), optional :: RC

Calls

proc~~mapl_locstreamfracarea~~CallsGraph proc~mapl_locstreamfracarea MAPL_LocStreamFracArea interface~mapl_assert MAPL_Assert proc~mapl_locstreamfracarea->interface~mapl_assert proc~mapl_return MAPL_Return proc~mapl_locstreamfracarea->proc~mapl_return at at proc~mapl_return->at insert insert proc~mapl_return->insert proc~mapl_throw_exception MAPL_throw_exception proc~mapl_return->proc~mapl_throw_exception

Source Code

subroutine MAPL_LocStreamFracArea (LocStream, TYPE, AREA, RC )
  type(MAPL_LocStream),      intent(IN ) :: LocStream
  integer,                   intent(IN ) :: TYPE
  real,                      intent(OUT) :: AREA(:,:)
  integer, optional,         intent(OUT) :: RC

! Local variables



  integer                    :: II, JJ, N

! Make sure Location stream has been created...
!----------------------------------------------

  _ASSERT(associated(LocStream%Ptr),'needs informative message')

! and a grid attached...
!-----------------------

  _ASSERT(LocStream%Ptr%Current_Tiling > 0,'needs informative message')

! Compute area over masked locations
!-----------------------------------------------

  AREA   = 0.0

  do N = 1, size(LOCSTREAM%Ptr%LOCAL_INDEXLOCATION)
     if(LOCSTREAM%Ptr%LOCAL_GEOLOCATION(N)%T == TYPE) then
        II = LOCSTREAM%Ptr%LOCAL_INDEXLOCATION(N)%I
        JJ = LOCSTREAM%Ptr%LOCAL_INDEXLOCATION(N)%J
        AREA  (II,JJ) = AREA  (II,JJ) + LOCSTREAM%Ptr%LOCAL_INDEXLOCATION(N)%W
     end if
  end do

  _RETURN(ESMF_SUCCESS)

end subroutine MAPL_LocStreamFracArea