generalTypeScanner: automatically link variables to input data stored in gd
In our last submission, we present gd and buildMatTable as a powerful tool to use MATLAB file as input for Fortran. (https://www.mathworks.com/matlabcentral/fileexchange/65187-gd---buildmattable--a-reflective-solution--one-command-read-of-mat-file-into-fortran-programs)
Here we provide supporting MATLAB tools, 'generalTypeScanner' and 'autoLink' , which can intelligently scan and analyze the construction of dataTypes, then automatically generate the Fortran module for linking Fortran-native variable to the data stored in gd.
They can help save lots of programming time for Fortran developer. And when developers made changes to data-type definitions, this tool reduces their burden in updating input-relative codes.
1: generalTypeScanner
This code would scan the designated folder, and automatically generate a 'dictionary' structure that holds the information of datatype, including its name, dimension, and the subfield information. This dictionary will be used in the latter component.
2: autoLink
Based on the information contained in the dictionary, this piece of code generates a bunch of .f90 files, and then combines these subroutines to a final link-file for the developer. The developer just needs to add this file to the project, and this module would link the model variable to the data that read by 'buildMatTable' and stored in gd.
These two tools require relatively decent code-writing style in the data-type definition.
An example is included.
Cite As
WhoAreWe (2024). generalTypeScanner: automatically link variables to input data stored in gd (https://www.mathworks.com/matlabcentral/fileexchange/65196-generaltypescanner-automatically-link-variables-to-input-data-stored-in-gd), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
generalTypeScanner/matlab_GeneralTypeScanner/
generalTypeScanner/matlab_autoLink/
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 |