anchor.diff:           END IF
   
         ENDIF
  -
  -      !----------------------------------------------------------------------------------------
  -      ! Display simulation status every SttsTime-seconds:
  -      !----------------------------------------------------------------------------------------
  -
  -      IF ( t_global - TiLstPrn >= p_FAST%SttsTime )  THEN !bjj: perhaps we should do this with integer math now...
  -
  -         CALL SimStatus( TiLstPrn, PrevClockTime, t_global, p_FAST%TMax )
  -
  -      ENDIF
  -      
  -            
  -  END DO ! n_t_global
  -  
  -  
  -   !...............................................................................................................................
  -   !  Write simulation times and stop
  -   !...............................................................................................................................
  -   n_t_global =  n_TMax_m1 + 1    
  -   CALL ExitThisProgram( Error=.FALSE. )
  -
  -
  -CONTAINS
  +            
  +   END SUBROUTINE WriteOutputToFile      
      !...............................................................................................................................
      SUBROUTINE InitModuleMappings()
      ! This routine initializes all of the mapping data structures needed between the various modules.
  
positive.code:                         , x_AD  , xd_AD  , z_AD   &
                          )           
        
     !...............
     ! Copy values of these initial guesses for interpolation/extrapolation and 
     ! initialize predicted states for j_pc loop (use MESH_NEWCOPY here so we can use MESH_UPDATE copy later)
  
negative.code:       ! Check to see if we should output data this time step:
        !----------------------------------------------------------------------------------------
  
        CALL WriteOutputToFile()
        
        !----------------------------------------------------------------------------------------
        ! Display simulation status every SttsTime-seconds:
        !----------------------------------------------------------------------------------------
  
        IF ( t_global - TiLstPrn >= p_FAST%SttsTime )  THEN !bjj: perhaps we should do this with integer math now...
  
           CALL SimStatus( TiLstPrn, PrevClockTime, t_global, p_FAST%TMax )
  
        ENDIF
        
              
    END DO ! n_t_global
    
    
     !...............................................................................................................................
     !  Write simulation times and stop
     !...............................................................................................................................
     n_t_global =  n_TMax_m1 + 1               ! set this for the message in ProgAbort, if necessary
     CALL ExitThisProgram( Error=.FALSE. )
  
  
  CONTAINS
     !...............................................................................................................................
     SUBROUTINE WriteOutputToFile()
     ! This routine determines if it's time to write to the output files, and calls the routine to write to the files
     ! with the output data. It should be called after all the output solves for a given time have been completed.
     !...............................................................................................................................
        REAL(DbKi)                      :: OutTime                                 ! Used to determine if output should be generated at this simulation time
  
        
        IF ( t_global >= p_FAST%TStart )  THEN
  
              !bjj FIX THIS algorithm!!! this assumes dt_out is an integer multiple of dt; we will probably have to do some interpolation to get these outputs at the times we want them....
  