MAPL_StateEval Subroutine

public subroutine MAPL_StateEval(state, expression, field, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_State), intent(in) :: state
character(len=*), intent(in) :: expression
type(ESMF_Field), intent(inout) :: field
integer, intent(out), optional :: rc

Calls

MAPL_NewArthParserMod::MAPL_StateEvalwESMF::ESMF_AttributeSet
w
wesmf_stateget
w
wMAPL_ErrorHandlingMod::MAPL_Assert
w
wMAPL_ErrorHandlingMod::MAPL_Return
w
wMAPL_ErrorHandlingMod::MAPL_Verify
w
wMAPL_FieldBinaryOperations::fieldAdd
w
wMAPL_FieldBinaryOperations::fieldDivide
w
wMAPL_FieldBinaryOperations::fieldMultiply
w
wMAPL_FieldBinaryOperations::fieldPower
w
wMAPL_FieldBinaryOperations::fieldSubtract
w
wMAPL_FieldPointerUtilities::FieldClone
w
wMAPL_FieldPointerUtilities::FieldCopyBroadcast
w
wMAPL_FieldPointerUtilities::FieldsAreBroadCastConformable
w
wMAPL_FieldPointerUtilities::MAPL_FieldDestroy
w
wMAPL_FieldUnaryFunctions::fieldAbs
w
wMAPL_FieldUnaryFunctions::fieldAcos
w
wMAPL_FieldUnaryFunctions::fieldAsin
w
wMAPL_FieldUnaryFunctions::fieldAtan
w
wMAPL_FieldUnaryFunctions::fieldCos
w
wMAPL_FieldUnaryFunctions::fieldCosh
w
wMAPL_FieldUnaryFunctions::fieldExp
w
wMAPL_FieldUnaryFunctions::fieldLog
w
wMAPL_FieldUnaryFunctions::fieldLog10
w
wMAPL_FieldUnaryFunctions::fieldSin
w
wMAPL_FieldUnaryFunctions::fieldSinh
w
wMAPL_FieldUnaryFunctions::fieldSqrt
w
wMAPL_FieldUnaryFunctions::fieldTan
w
wMAPL_FieldUnaryFunctions::fieldTanh
w
wMAPL_FieldUtilities::FieldNegate
w
wMAPL_FieldUtilities::FieldSet
w
wMAPL_NewArthParserMod::CheckSyntax
w
wMAPL_NewArthParserMod::LowCase
w
wMAPL_NewArthParserMod::RealNum
w

Called by

proc~~mapl_stateeval~~CalledByGraph proc~mapl_stateeval MAPL_NewArthParserMod::MAPL_StateEval none~evaluate_box_mask MAPL_ExtDataMask::ExtDataMask%evaluate_box_mask none~evaluate_box_mask->proc~mapl_stateeval none~evaluate_region_mask MAPL_ExtDataMask::ExtDataMask%evaluate_region_mask none~evaluate_region_mask->proc~mapl_stateeval none~evaluate_zone_mask MAPL_ExtDataMask::ExtDataMask%evaluate_zone_mask none~evaluate_zone_mask->proc~mapl_stateeval proc~evaluate_derived_field MAPL_ExtDataTypeDef::DerivedExport%evaluate_derived_field proc~evaluate_derived_field->proc~mapl_stateeval none~evaluate_mask MAPL_ExtDataMask::ExtDataMask%evaluate_mask proc~evaluate_derived_field->none~evaluate_mask none~evaluate_mask->none~evaluate_box_mask none~evaluate_mask->none~evaluate_region_mask none~evaluate_mask->none~evaluate_zone_mask

Source Code

  subroutine MAPL_StateEval(state,expression,field,rc)
    type(ESMF_State),        intent(in   ) :: state
    character(len=*),        intent(in   ) :: expression
    type(ESMF_Field),        intent(inout) :: field
    integer, optional,       intent(out  ) :: rc

    character(len=ESMF_MAXSTR), allocatable :: fieldNames(:)
    integer                              :: varCount

    type(ESMF_Field)                     :: state_field

    integer                              :: i
    type(tComp)                          :: pcode
    logical, allocatable                 :: needed(:)
    logical                              :: isConformal
    integer :: status

    call ESMF_StateGet(state,ITEMCOUNT=varCount,_RC)
    allocate(fieldnames(varCount),needed(varCount))
    call ESMF_StateGet(state,itemnamelist=fieldNames,_RC)

    ! confirm that each needed field is conformal
    call CheckSyntax(expression,fieldNames,needed,_RC)
    do i=1,varCount
       if (needed(i)) then
          call ESMF_StateGet(state,fieldNames(i),field=state_field,_RC)

          isConformal = FieldsAreBroadcastConformable(state_field,field,_RC)
          if (.not.isConformal) then
             _FAIL('needs informative message')
          end if
       end if
    end do

    call parsef (pcode, expression, fieldNames, field, _RC)
    call evalf(pcode,state,fieldNames,field,_RC)
    call bytecode_dealloc(pcode,_RC)

    deallocate(fieldNames,needed)


    end subroutine MAPL_StateEval