anchor.diff:      endif
   
   
  -    ! Parallelize the calculation of deformation at each station with OpenMP.
  -    ! The following block of code will be executed by multiple threads if o92util is compiled with
  -    ! OpenMP enabled (-fopenmp -frecursive options in the GNU compiler).
  -    ! SHARED variables are shared across threads.
  -    ! PRIVATE variables are uninitialized and isolated to each thread.
  -    ! FIRSTPRIVATE variables are initialized with their existing value and isolated to each thread.
  -    ! REDUCTION defines the operation for shared (deformation) variables.
  -    !$OMP PARALLEL SHARED(nfaults,ntensile,faults,tensile,stations,lame,shearmod), &
  -    !$OMP          SHARED(fault_type,coord_type,iWantDisp,iWantStrain,coordTypeWarning,debug_mode), &
  -    !$OMP&         PRIVATE(iFlt,ierr), &
  -    !$OMP&         PRIVATE(evlo,evla,evdp,str,dip,rak,slip_mag,wid,len,dist,az,test_dist), &
  -    !$OMP&         PRIVATE(slip,mom,disptmp,stntmp), &
  -    !$OMP&         FIRSTPRIVATE(iSta,sta_coord,warn_dist), &
  -    !$OMP&         REDUCTION(+:disp), REDUCTION(+:stn), &
  -    !$OMP&         DEFAULT(NONE)
  -
  -    ! The following loop is executed in parallel
  -    !$OMP DO
  +    ! This is the old parallel construct, looping only over the faults to compute the deformation at
  +    ! each station. This works great for situations with multiple faults, but not so well when there
  +    ! are multiple stations (the typical case).
  +    !
  +    !! Parallelize the calculation of deformation at each station with OpenMP.
  +    !
  +    !! The following block of code will be executed by multiple threads if o92util is compiled with
  +    !! OpenMP enabled (-fopenmp -frecursive options in the GNU compiler).
  +    !
  +    !! SHARED variables are shared across threads
  +    !! PRIVATE variables are uninitialized and isolated to each thread
  +    !! FIRSTPRIVATE variables are initialized with their existing value and isolated to each thread
  +    !! REDUCTION defines the operation for shared (deformation) variables
  +    !!$OMP PARALLEL SHARED(nfaults,ntensile,faults,tensile,stations,lame,shearmod), &
  +    !!$OMP          SHARED(fault_type,coord_type,iWantDisp,iWantStrain,coordTypeWarning,debug_mode), &
  +    !!$OMP&         PRIVATE(iFlt,ierr), &
  +    !!$OMP&         PRIVATE(evlo,evla,evdp,str,dip,rak,slip_mag,wid,len,dist,az,test_dist), &
  +    !!$OMP&         PRIVATE(slip,mom,disptmp,stntmp), &
  +    !!$OMP&         FIRSTPRIVATE(iSta,sta_coord,warn_dist), &
  +    !!$OMP&         REDUCTION(+:disp), REDUCTION(+:stn), &
  +    !!$OMP&         DEFAULT(NONE)
  +
  +    !! The following loop is executed in parallel
  +    !!$OMP DO
   
   
       ! Calculate deformation from each fault and tensile source at the station
  
positive.code:     enddo
  
  
      ! End the parallel do loop
      !$OMP END DO
  
      ! Stop parallelizing - the rest of the calculation for this station is serial
      !$OMP END PARALLEL
  
  
  
      if (debug_mode.eq.'calc_deformation'.or.debug_mode.eq.'all') then
  
negative.code:             call usage('calc_deformation: error in progress_indicator (usage:none)')
          endif
      endif
  
  
      ! End the ordered directive, so threads can be FREE!!!!
      !$OMP END ORDERED
  
  
  enddo
  
  
  ! End the parallel do loop
  !$OMP END DO
  
  ! Stop parallelizing - the rest of the subroutine is serial
  !$OMP END PARALLEL
  
  
  ! Close files that were opened for writing
  inquire(file=displacement_file,number=file_unit,opened=isThisUnitOpen)
  