skip to main content

DOE PAGESDOE PAGES

Title: The introspective may achieve more: Enhancing existing Geoscientific models with native-language emulated structural reflection

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 save/restart 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. In conclusion, embracing emulated reflection allows generically-written codes that are highly re-usable across projects.
Authors:
 [1] ;  [1]
  1. The Pennsylvania State Univ., University Park, PA (United States)
Publication Date:
Grant/Contract Number:
SC0010620
Type:
Accepted Manuscript
Journal Name:
Computers and Geosciences
Additional Journal Information:
Journal Volume: 110; Related Information: Softwarehttp://water.engr.psu.edu/shen/software_page.html (under the title “Integrated generic data package”); Journal ID: ISSN 0098-3004
Publisher:
Elsevier
Research Org:
Pennsylvania State Univ., University Park, PA (United States)
Sponsoring Org:
USDOE Office of Science (SC), Biological and Environmental Research (BER) (SC-23)
Country of Publication:
United States
Language:
English
Subject:
58 GEOSCIENCES; Reflection; Geoscientific modeling; Efficient programming; FORTRAN; Generic data structure; Data I/O
OSTI Identifier:
1397240

Ji, Xinye, and Shen, Chaopeng. The introspective may achieve more: Enhancing existing Geoscientific models with native-language emulated structural reflection. United States: N. p., Web. doi:10.1016/j.cageo.2017.09.014.
Ji, Xinye, & Shen, Chaopeng. The introspective may achieve more: Enhancing existing Geoscientific models with native-language emulated structural reflection. United States. doi:10.1016/j.cageo.2017.09.014.
Ji, Xinye, and Shen, Chaopeng. 2017. "The introspective may achieve more: Enhancing existing Geoscientific models with native-language emulated structural reflection". United States. doi:10.1016/j.cageo.2017.09.014. https://www.osti.gov/servlets/purl/1397240.
@article{osti_1397240,
title = {The introspective may achieve more: Enhancing existing Geoscientific models with native-language emulated structural reflection},
author = {Ji, Xinye and Shen, Chaopeng},
abstractNote = {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 save/restart 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. In conclusion, embracing emulated reflection allows generically-written codes that are highly re-usable across projects.},
doi = {10.1016/j.cageo.2017.09.014},
journal = {Computers and Geosciences},
number = ,
volume = 110,
place = {United States},
year = {2017},
month = {9}
}