Changeset 32289cd for utilities.f


Ignore:
Timestamp:
11/19/09 11:29:41 (14 years ago)
Author:
baerbaer <baerbaer@…>
Branches:
master
Children:
38d77eb
Parents:
6650a56
Message:

Explicitly declare variables.

git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/smmp/trunk@33 26dc1dd8-5c4e-0410-9ffe-d298b4865968

File:
1 edited

Legend:

Unmodified
Added
Removed
  • utilities.f

    r6650a56 r32289cd  
    88
    99!! Calculate the best way to distribute the work load across processors.
    10 !  It calculates the average number of interactions and then tries to 
     10!  It calculates the average number of interactions and then tries to
    1111!  assign a number of interactions to each processor that is as close
    1212!  as possible to the average. The routine should be called once for
     
    2121      include 'INCL.H'
    2222
     23      integer i1ms, io, iv, i2ms, ms
     24
    2325      integer num_ppr, nml
    2426      integer idxOfFirstVariable, idxOfLastVariable
     
    2628      integer totalct, irank, itarget
    2729      double precision ipps
    28      
     30
    2931      if (nml.eq.0) then
    3032         idxOfFirstVariable = ivrml1(1)
     
    3638            end do
    3739         end do
    38       else 
     40      else
    3941         idxOfFirstVariable = ivrml1(nml)
    4042         idxOfLastVariable = ivrml1(nml) + nvrml(nml) - 1
     
    4446         end do
    4547      end if
    46      
     48
    4749      isum = 0
    4850      do io = idxOfLastVariable, idxOfFirstVariable, - 1
     
    5254         do ms = i1ms, i2ms
    5355            do at = latms1(ms), latms2(ms)
    54                do ivw=ivwat1(at),ivwat2(at) 
     56               do ivw=ivwat1(at),ivwat2(at)
    5557                  do j=lvwat1(ivw),lvwat2(ivw)
    5658                     isum = isum + 1
    5759                  end do
    5860               end do
    59                do i14=i14at1(at),i14at2(at)   
     61               do i14=i14at1(at),i14at2(at)
    6062                  isum = isum + 1
    6163               end do
     
    6668      write (*,*) "Total number of interactions:", isum
    6769      write (*,*) "Average # of interactions per processor", ipps
    68      
     70
    6971      totalct = 0
    7072      irank = 1
     
    7274      if (nml.eq.0) then
    7375         i1ms = imsml1(ntlml)+ nmsml(ntlml)
    74       else 
     76      else
    7577         i1ms = imsml1(nml)+ nmsml(nml)
    7678      end if
    7779      do io = idxOfLastVariable, idxOfFirstVariable, - 1
    78          isum = 0 
     80         isum = 0
    7981         iv = iorvr(io)
    8082         i2ms = i1ms - 1
     
    8385            do at = latms1(ms), latms2(ms)
    8486               atct = atct + 1
    85                do ivw=ivwat1(at),ivwat2(at) 
     87               do ivw=ivwat1(at),ivwat2(at)
    8688                  do j=lvwat1(ivw),lvwat2(ivw)
    8789                     isum = isum + 1
    8890                  end do
    8991               end do
    90                do i14=i14at1(at),i14at2(at)   
     92               do i14=i14at1(at),i14at2(at)
    9193                  isum = isum + 1
    9294               end do
     
    113115
    114116      end subroutine distributeWorkLoad
    115      
     117
    116118!-----------------------------------------------------------------------
    117119!     The function fileNameMP takes a template of a file name in the
     
    128130!     \endcode
    129131!     will output base_0011.dat.
    130 !     
     132!
    131133!     @param base the base file name, e.g., base_0000.dat.
    132134!     @param i1 index of the first character that may be replaced
    133135!     @param i2 index of the last character that may be replaced
    134136!     @param rank the number that should be inserted into the file name.
    135 !     
     137!
    136138!     @return file name for rank
    137139!-----------------------------------------------------------------------
     
    165167         write(fileNameMP(i2-5:i2), '(i6)') rank
    166168      endif
    167       end function fileNameMP 
     169      end function fileNameMP
    168170!     End fileNameMP
    169171
     
    172174!     Add messages to log. This routine takes the log (debugging) mes-
    173175!     sages and writes them to the log file if the log level is less or
    174 !     equal to the maximum log level given by the global variable 
     176!     equal to the maximum log level given by the global variable
    175177!     MAXLOGLEVEL.
    176178!
    177179!     @author Jan H. Meinke
    178180!
    179 !     @param loglevel level at which this message should be added to 
     181!     @param loglevel level at which this message should be added to
    180182!            the log.
    181183!     @param message message to be written to the log.
    182 !     @param rank global rank of this node if running an MPI job zero 
     184!     @param rank global rank of this node if running an MPI job zero
    183185!            otherwise.
    184186!----------------------------------------------------------------------
    185187      subroutine addLogMessage(loglevel, message, rank)
    186      
     188
     189      integer maxloglevel, logfileunit
     190
    187191         integer :: loglevel, rank
    188192         character(LEN=*) :: message
    189          
     193
    190194         if (loglevel <= MAXLOGLEVEL) then
    191195            write(LOGFILEUNIT, *) message
    192196         end if
    193          
     197
    194198      end subroutine addLogMessage
Note: See TracChangeset for help on using the changeset viewer.