-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal for a common data model module to set default KINDS #13
Comments
I typically prefer |
I think ideally, we want all the procedures in the library to work for all the integer/real/logical kinds that are available on the compiler. We don't want to force a user to have to recompile it for different kinds, and there are many use cases where the same application needs to use multiple kinds of real variables. Example: if a compiler adds Since this is basically impossible with standard Fortran, it's going to require some kind of external templating tool, e.g. jin2for. |
A simpler variant of this has been implemented using standard kind parameters in stdlib_kinds. @rweed if you think specific parts of it should be improved, let's tackle it in a new specific issue. |
The following (sorry about the length) is a module that sets defaults for real and integer KIND parameters (what I call a data model) but allows users to define there own or change the defaults using preprocessor defines. I think something like this along with some module procedures for checking things like storage size and interrogating machine parameters ala R1MACH from Linpack etc. should be a basic part of the library. This would allow users to build different versions with different combinations of integer and real default types. I prefer this approach over trying to provide a different routine for each possible combination of integer and real types. Again, thats a personal preference but I prefer having 4 different versions of a library over trying to to provide four different versions of a subroutine/function and providing a generic interface. Also, I think part of the coding standard for the library should forbid real(8), real*8, implicit double precision etc.
*** dataModel.F90 ***
The text was updated successfully, but these errors were encountered: