20.07.2015 Views

PhD Thesis - staffweb - University of Greenwich

PhD Thesis - staffweb - University of Greenwich

PhD Thesis - staffweb - University of Greenwich

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

APPENDIX 2 : Journal Paper "Case Study : An Incremental Approach to Re-Engineeringa Legacy FORTRAN C.F.D. Code in C++", Ewer J., Knight B. and Cowell D.,Advances in Engineering S<strong>of</strong>tware, Vol. 22, pp 153-168, 1995seemingly arbitrary valued numbers represent, particularly in light <strong>of</strong> the meagre codedocumentation. Figure 2 shows the two types <strong>of</strong> literal values used in CWNN. These arearray indexing by integer values and physical constants entered explicitly withoutdefinition.A re-engineering strategy was sought that would remove the problems inherent in theFORTRAN implementation <strong>of</strong> CWNN whilst providing an extensible framework forcontinued research into CFD techniques. The approach described here was planned andrefined during the re-engineering <strong>of</strong> the legacy code. Example test cases were used to checkcode consistency throughout each stage <strong>of</strong> the development.As an investigation an attempt was made to translate the FORTRAN code into C orC++ using two proprietary tools. The results <strong>of</strong> the translations were very disappointing.The translated code was noted to be less clear than the original with little or noimprovement in structure. In some instances there was considerable degeneration in codeclarity with awkward and non-portable handling or certain library routines. The translatorswere clearly designed to allow compilation in C rather than to support continueddevelopment. This was the major reason for the manual translation strategy adopted in thiscase study.4. The multi-stage re-engineering processFORTRANCWNNAutomatictranslationC++Smartfire(1)Ensure dataconsistencyand make global(9)Optimisationsandenhancementstestruntestrun(2)Name andalgorithmclarificationtestrun(8)Create classmember functionsfor proceduralroutinestestrun(3)Removal <strong>of</strong>redundant codeand simplification(7)Create classdata structuresas in design(4)testrunEnsure consistentuse <strong>of</strong> controlReplace logicalsfinaltest(5)Manualtranslation(6)testrunModify all fileI / O and rewritefor compatibilitycompileFigure 3 :Stages <strong>of</strong> re-engineering.Appendix 11.2 Page 142-8 8

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!