home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.fortran      Putting John Backus on a giant pedestal      5,127 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 4,777 of 5,127   
   Lawrence D'Oliveiro to Lynn McGuire   
   Re: Is there a way in Fortran to designa   
   22 Oct 24 22:21:38   
   
   From: ldo@nz.invalid   
      
   On Tue, 22 Oct 2024 00:07:41 -0500, Lynn McGuire wrote:   
      
   > Here is one of my 197 common block include files, global.inc:   
   >   
   > C  global.inc   
   > C   
   > C   
   > C  11/21/19  Lynn McGuire  pmr 6299, add new ncp max used variable for   
   chemtran   
      
   Those are the sorts of things that belong in your version control   
   system.   
      
   > ...   
      
   What, no “implicit none”? Or do you put this in the including files?   
      
   >        integer MAX_NCP   
   >        PARAMETER (MAX_NCP = 1000)   
      
   All these pairs of lines can be replaced with single lines, e.g.   
      
      integer, parameter :: MAX_NCP = 1000   
      
   >       COMMON / GLOBAL / KTRACE, NCP, SETSTP, NDYNER, NERQQQ, LNOLIMIT,   
   >       *                  do_not_call_pivf, do_not_call_adbf,   
   >       *                  ne_did_not_converge, equipment_fail_count,   
   >       *                  lrespect_user_pitch, do_not_call_threephs,   
   >       *                  do_not_call_flai, do_not_call_liqh,   
   >       *                  do_not_call_vaph, thermo_init_failed,   
   >       *                  num_crude_streams, print_streams_for_each_unit,   
   >       *                  do_not_call_solid_isothermal_flash,   
   >       *                  ncp_max_used   
   >   
   >        integer KTRACE   
   >        integer NCP   
   >        logical SETSTP   
   >        integer NDYNER   
   >        integer NERQQQ   
   >        integer num_crude_streams   
   >        logical LNOLIMIT   
   >        logical do_not_call_pivf   
   >        logical do_not_call_adbf   
   >        logical lrespect_user_pitch   
   >        logical do_not_call_threephs   
   >        logical do_not_call_flai   
   >        logical do_not_call_liqh   
   >        logical do_not_call_vaph   
   >        logical thermo_init_failed   
   >        logical print_streams_for_each_unit   
   >        logical do_not_call_solid_isothermal_flash   
   > C        this is to record the ncp max used for chemtran since itchanges ncp   
   on the fly   
   >        integer ncp_max_used   
      
   Much more concisely:   
      
       module GLOBAL   
           integer :: KTRACE, NCP, SETSTP, NDYNER, NERQQQ, num_crude_streams   
           logical :: LNOLIMIT, do_not_call_pivf, do_not_call_adbf,   
   lrespect_user_pitch, &   
               do_not_call_threephs, do_not_call_flai, do_not_call_liqh,   
   do_not_call_vaph, &   
               thermo_init_failed, print_streams_for_each_unit, do_   
   ot_call_solid_isothermal_flash   
          integer :: ncp_max_used   
            ! this is to record the ncp max used for chemtran since itchanges ncp   
   on the fly   
       end module GLOBAL   
      
   Then you just do “use GLOBAL” where you need these definitions.   
      
   etc etc   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca