webpage
webpage copied to clipboard
Fortran Best Practice: Type Casting in Callbacks
The chapter Type Casting in Callbacks needs some work.
- No links to external gists or pastebin entries, the document must be self-contained
- Generally more text actually explaining what is going on in the sections
- Better flow of explanation rather than multiple example
The chapter starts by saying
"There are essentially five different ways to do type casting, each with its own advantages and disadvantages.
The methods I, II and V can be used both in C and Fortran. The methods III and IV are only available in Fortran. The method VI is obsolete and should not be used."
If you are going to refer to items by number, you should provide a numbered list. What are the 6 methods? Looking at the headings, I see 7:
- Work Arrays
- General Structure
- Private Module Variables
- Nested functions
- Using type(c_ptr) Pointer
- transfer() Intrinsic Function
- Object Oriented Approach
Best is to rewrite the whole chapter and focus on a few of the available approaches which we find are best practice. At least we should remove the obsolete methods from this chapter.