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_StateEvalwCheckSyntax
w
wESMF_AttributeSet
w
wesmf_stateget
w
wfieldAbs
w
wfieldAcos
w
wfieldAdd
w
wfieldAsin
w
wfieldAtan
w
wFieldClone
w
wFieldCopyBroadcast
w
wfieldCos
w
wfieldCosh
w
wfieldDivide
w
wfieldExp
w
wfieldLog
w
wfieldLog10
w
wfieldMultiply
w
wFieldNegate
w
wfieldPower
w
wFieldsAreBroadCastConformable
w
wFieldSet
w
wfieldSin
w
wfieldSinh
w
wfieldSqrt
w
wfieldSubtract
w
wfieldTan
w
wfieldTanh
w
wLowCase
w
wMAPL_Assert
w
wMAPL_FieldDestroy
w
wMAPL_Return
w
wMAPL_Verify
w
wRealNum
w

Called by

proc~~mapl_stateeval~~CalledByGraph proc~mapl_stateeval MAPL_StateEval none~evaluate_box_mask ExtDataMask%evaluate_box_mask none~evaluate_box_mask->proc~mapl_stateeval none~evaluate_region_mask ExtDataMask%evaluate_region_mask none~evaluate_region_mask->proc~mapl_stateeval none~evaluate_zone_mask ExtDataMask%evaluate_zone_mask none~evaluate_zone_mask->proc~mapl_stateeval proc~evaluate_derived_field DerivedExport%evaluate_derived_field proc~evaluate_derived_field->proc~mapl_stateeval none~evaluate_mask 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