NACA Airfoils Code - Convert Fortran to C++ #3.5
completed by: Andromeda Galaxy
mentors: Kesha Shah, Ishwerdas
The NACA airfoils are airplane wing shapes developed by the National Advisory Committee for Aeronautics (NACA). These shapes are described by a series of digits, which are translated into actual shapes by a series of computer programs. These programs date back several decades, and were written in Fortran.
BRL-CAD's interest in this code is as a possible means of procedurally generating wing geometry in BRL-CAD models, but we would prefer to have the shape generating logic in one of BRL-CAD's standard languages - C or C++. The target code for this effort is a modernization of older NACA codes by Ralph Carmichael called naca456.
The initial conversion will attempt to precisely reproduce the functionality as currently expressed in the Fortran code - any more elaborate reworking of the logic will be evaluated after we have a C/C++ version that reproduces the Fortran outputs correctly.
Your task involves identifying and implementing in C an approach to the file input code in the file https://github.com/starseeker/naca/blob/master/naca456.f90. This code currently uses Fortran features for input parsing - your task is to create an approach in C that achieves the same results.
- Check out the git repository: git clone https://github.com/starseeker/naca
- Make sure you can build the stub files that are there (cd naca; mkdir build; cd build; cmake ..; make)
- Translate the file parsing logic in naca456.f90 into functionally similar C code.
- Make sure the code compiles (a full conversion of naca456.f90 is not required for this task, since the input parsing looks a bit tricky.)
- Submit the new .c file contents as a patch.
You'll want to make sure to preserve any comments that contain useful information from the Fortran sources, as well as the actual logic. If you're successful, there will be follow-on tasks building on this one to compare the output of the new C naca456 to the original Fortran version.
References:- http://www.pdas.com/naca456.html
- src/proc-db/naca