!tpl call logbook0(progname,text) ! standard event recorder (called by save,rest,ramp,epn type stuff) subroutine logbook0(prog,text) use cesr_utils_interface use str_find_mod implicit none integer, save:: ierr character(*):: prog character(*):: text character(80) :: fmt character,save:: filename*200, tim*9 integer(4), save:: iy,julday integer, save:: nch1,nch2,lun integer, save:: ival(9),iw(9),n,i nch1=len_trim(PROG) !how many chars in progname nch2=len_trim(TEXT) !how many chars in explainatory ! -------------- setup to open file of day ------------------- call time(tim) call julian(iy,julday) !returns int*4 yyyy and day of year write(filename,5)julday,iy 5 format('$CESR_ONLINE/machine_data/logging/logbook/logb_'i3.3,'.',i4.4) lun=lunget() !Get first free disk unit number at or above 30 10 ierr=1 !use to test if open failure call openap(lun,filename,ierr,128) 15 if(ierr.ne.0) then call csr_bell !wakeup user call strout(' waiting to write in $CESR_ONLINE/machine_data/logging/logbook]logb.... ') if(lun.gt.50) stop call csr_sleep(5000) !5 sec later.. goto 10 !go and try again endif ! 888 format(a,1x,a,1x,a) write (lun,888) tim,trim(prog),trim(text) close(unit=lun) end subroutine logbook0