|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
viroxa
Joined: 28 Jul 2017 Posts: 78
|
Posted: Wed Aug 09, 2017 10:43 am Post subject: Module- / Routine-Names: Conventions |
|
|
Hello, everyone,
I was wondering, whether any conventions or recommended practices for naming modules, subroutines, functions, etc. in fortran exist. In some books I have I found conventions for variables, but modules and routines seem to be named arbitrarily.
Currently I name them as follows:
Modules - mod_module_name (i.e. mod_parameters)
Subroutines / Functions - action_routine_name (i.e. calc_area_triangle) |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Wed Aug 09, 2017 11:36 am Post subject: |
|
|
Subroutine names don't need anything special, do they, as they are always associated with 'CALL'.
I don't know if you have got round to Clearwin+ yet, but it requires lots of call-back functions, and 'action_routine_name' on its own isn't enough to remind you that you are dealing with a function, especially as the call-back routines are usually EXTERNAL within a WINIO@ function list of parameters, so they don't have any parameters of their own, and not even (). My trick is to add something to the name: e.g. _FN or _CBF on the end.
I also have very long source codes divided over many files, and I maintain another couple of files called WHEREIS.FOR and WHATIS.FOR that tell me (respectively)where every subroutine and function can be found, and what every variable does. WHATIS.FOR is a hangover from days when variable names had to be short. Then, when I have got things working to my satisfaction, I add comments adjacent to subroutine and function calls duplicating the information from WHEREIS.FOR so when I am reading my long-ago-written code I know where to look for that link. In any case, I put a list of subroutines and functions at the start of every source code file with line numbers so I know where to look, and also try to keep source code files down to 2000 lines or so.
Eddie |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|