Skip to content

MAPL Arithmetic Parser

Ben Auer edited this page Apr 18, 2022 · 5 revisions

The MAPL library includes and arithmetic expression parser. The main use for this is to allow ExtData and History fill fields using some arithmetic expression involving other fields. As such the parser's main subroutine used by MAPL, MAPL_StateEval takes an ESMF_State, a character representing the expression, where the variables in the expression are fields in the state, and finally fills the field passed into the subroutine. The value in the resultant field is simple the value by applying the expression to each array index in the original fields in the expression. So you can think of this as a shortcut to avoid having to loop over each element of the fields.

The parser expressions can have the usual arithmetic operations +-*/^, in addition the parser supports the following Fortran intrinsic functions: abs,exp,log10,log,sqrt,sinh,cosh,tanh,sin,cos,tan,asin,acos,atan,heav

Clone this wiki locally