generalTypeScanner: automatically link variables to input data stored in gd

An automatic linking under gd structure
Updated 26 Nov 2017

View License

In our last submission, we present gd and buildMatTable as a powerful tool to use MATLAB file as input for Fortran. (
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 (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Fortran with MATLAB in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes