anchor.diff:           close (ihist)
            close (iforce)
            close (iconserv)
  -             
  +
            if(exMC) then 
              call MC_writeState(lstep) 
              call MC_finalize
            endif
  -             
  +
            if(exts) then 
              call TD_writeData(fvarts, .true.)    !force the flush of the buffer. 
              call TD_finalize
  
positive.code: c              call write_field2(myrank,'a'//char(0),'ybar'//char(0),
  c     &                          4,ybar,'d'//char(0),nshg,ndof+8,
  c     &                         lstep,istep)
              endif   
  
   2000    continue  !end of NSTEP loop
   2001    continue  
  
           ttim(1) = REAL(secs(0.0)) / 100. - ttim(1)
           ttim(2) = secs(0.0)              - ttim(2)
  
negative.code:               !restart is also being written. 
                if(mod(lstep, ntout) == 0) call BC_writePhase(lstep)
              endif
  
              !.... Yi Chen Duct geometry8
              if(isetBlowing_Duct.gt.0)then
                if(ifixBlowingVel_Duct.eq.0)then
  