TY - JOUR
T1 - The introspective may achieve more
T2 - Enhancing existing Geoscientific models with native-language emulated structural reflection
AU - Ji, Xinye
AU - Shen, Chaopeng
N1 - Publisher Copyright:
© 2017 Elsevier Ltd
PY - 2018/1
Y1 - 2018/1
N2 - Geoscientific models manage myriad and increasingly complex data structures as trans-disciplinary models are integrated. They often incur significant redundancy with cross-cutting tasks. Reflection, the ability of a program to inspect and modify its structure and behavior at runtime, is known as a powerful tool to improve code reusability, abstraction, and separation of concerns. Reflection is rarely adopted in high-performance Geoscientific models, especially with Fortran, where it was previously deemed implausible. Practical constraints of language and legacy often limit us to feather-weight, native-language solutions. We demonstrate the usefulness of a structural-reflection-emulating, dynamically-linked metaObjects, gd. We show real-world examples including data structure self-assembly, effortless input/output (IO) and upgrade to parallel I/O, recursive actions and batch operations. We share gd and a derived module that reproduces MATLAB-like structure in Fortran and C++. We suggest that both a gd representation and a Fortran-native representation are maintained to access the data, each for separate purposes. Embracing emulated reflection allows generically-written codes that are highly re-usable across projects.
AB - Geoscientific models manage myriad and increasingly complex data structures as trans-disciplinary models are integrated. They often incur significant redundancy with cross-cutting tasks. Reflection, the ability of a program to inspect and modify its structure and behavior at runtime, is known as a powerful tool to improve code reusability, abstraction, and separation of concerns. Reflection is rarely adopted in high-performance Geoscientific models, especially with Fortran, where it was previously deemed implausible. Practical constraints of language and legacy often limit us to feather-weight, native-language solutions. We demonstrate the usefulness of a structural-reflection-emulating, dynamically-linked metaObjects, gd. We show real-world examples including data structure self-assembly, effortless input/output (IO) and upgrade to parallel I/O, recursive actions and batch operations. We share gd and a derived module that reproduces MATLAB-like structure in Fortran and C++. We suggest that both a gd representation and a Fortran-native representation are maintained to access the data, each for separate purposes. Embracing emulated reflection allows generically-written codes that are highly re-usable across projects.
UR - http://www.scopus.com/inward/record.url?scp=85032468347&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=85032468347&partnerID=8YFLogxK
U2 - 10.1016/j.cageo.2017.09.014
DO - 10.1016/j.cageo.2017.09.014
M3 - Article
AN - SCOPUS:85032468347
SN - 0098-3004
VL - 110
SP - 32
EP - 40
JO - Computers and Geosciences
JF - Computers and Geosciences
ER -