SUBROUTINE VWARM * * Module number: 15.2.3 * * Module name: warmup * * Keyphrase: * ---------- * exhibit dark signal as a function of elapse time since last high voltage * turn-on ("warm up") * * Description: * ------------ * Observations are using one of the dark apertures (for IDT's) or sky (for * the PMT). The unit of elapse time is in seconds. * * FORTRAN name: VWARM.FOR * * Keywords of accessed files and tables: * -------------------------------------- * Name I/O Description / Comments * * Subroutines Called: * ------------------- * CDBS: * VWRMGT, VWRMPT * SDAS: * UTRGTR, UTRGTD, UTRGTT, UTRPTR, UTRPTD, UTRPTT, UTTCLO, UMSPUT * Others: * None * * History: * -------- * Version Date Author Description * 1 06-25-87 J.-C. HSU design and coding *------------------------------------------------------------------------------- * *== local: * --high voltage setting REAL VOLT, * --data buffer : COLBUF(10) * --epoch, elapse time DOUBLE PRECISION EPOCH, ELAPSE, * --high voltage turn-on time : TURNON * --number of rows and columns in input table INTEGER INROWS, INCOLS, * --number of existing rows in output table : ONROWS, * --number of valid data points : NPTS, * --pointer of table descripter and column * --identifier (input and output tables) : ITP, ICOLID(20), OTP, OCOLID(20), * --error status : STATUS, STATOK, STAT(20), * --loop index : I, J * --null flag in UTRGTR LOGICAL NULMSK(20) * --dummy CHARACTER*5 CHAR5 * --aperture name CHARACTER*10 APER * --output file name CHARACTER*128 OFILE * --error message context CHARACTER*130 CONTXT, MESS *=========================begin hsp.inc========================================= * --status return code INTEGER OK, ERRNUM(20) * --message destination and priority INTEGER DEST, PRIO DATA OK /0/ DATA ERRNUM /701, 702, 703, 704, 705, 706, 707, 708, 709, 710, : 711, 712, 713, 714, 715, 716, 717, 718, 719, 720/ DATA DEST, PRIO /1, 0/ *=========================end hsp.inc=========================================== *------------------------------------------------------------------------------ * * input parameters and input table column names * CALL VWRMGT (ITP, ICOLID, INROWS, INCOLS, OFILE, STATUS) IF (STATUS .NE. OK) THEN CONTXT = 'cannot read input parameters or input table' GO TO 999 END IF * * set up the output table * CALL VWRMPT (OFILE, ITP, ICOLID, INCOLS, OTP, OCOLID, ONROWS, : STATUS) IF (STATUS .NE. OK) THEN CONTXT = 'cannot set up output table' GO TO 999 END IF * * read data from input table * NPTS = 0 DO 50 I = 1, INROWS CALL UTRGTR (ITP, ICOLID, 3, I, COLBUF, NULMSK, : STAT(1)) CALL UTRGTD (ITP, ICOLID(4), 1, I, TURNON, NULMSK(4), : STAT(2)) CALL UTRGTD (ITP, ICOLID(5), 1, I, EPOCH, NULMSK(5), : STAT(3)) CALL UTRGTR (ITP, ICOLID(6), 1, I, VOLT, NULMSK(6), : STAT(4)) CALL UTRGTT (ITP, ICOLID(7), 1, I, APER, NULMSK(7), : STAT(5)) * STATOK = ABS(STAT(1) - OK) + ABS(STAT(2) - OK) + : ABS(STAT(3) - OK) + ABS(STAT(4) - OK) + : ABS(STAT(5) - OK) + OK DO 20 J = 1, INCOLS IF (NULMSK(J)) THEN STATOK = ERRNUM(1) GO TO 30 END IF 20 CONTINUE * * if error in UTRGTR, put an error message and do NOT process the current row * 30 CONTINUE IF (STATOK .NE. OK) THEN WRITE(CHAR5, '(I5)') I CONTXT = 'can not read input table row #' // CHAR5 CALL UMSPUT (CONTXT, DEST, PRIO, STATOK) ELSE * * calculate the elapse time (in secnds) * ELAPSE = (EPOCH - TURNON) * 86400.D0 NPTS = NPTS + 1 * * write the result to output table * CALL UTRPTR (OTP, OCOLID, 3, ONROWS+NPTS, COLBUF, : STAT(1)) CALL UTRPTD (OTP, OCOLID(4), 1, ONROWS+NPTS, ELAPSE, : STAT(2)) CALL UTRPTD (OTP, OCOLID(5), 1, ONROWS+NPTS, EPOCH, : STAT(3)) CALL UTRPTR (OTP, OCOLID(6), 1, ONROWS+NPTS, VOLT, : STAT(4)) CALL UTRPTT (OTP, OCOLID(7), 1, ONROWS+NPTS, APER, : STAT(5)) * DO 40 J = 1, 5 IF (STAT(J) .NE. OK) THEN STATUS = ERRNUM(2) CONTXT = 'cannot write a row to output table' GO TO 999 END IF 40 CONTINUE END IF * 50 CONTINUE * * close input and output tables * CALL UTTCLO (ITP, STATUS) IF (STATUS .NE. OK) THEN CONTXT = 'cannot close input table' GO TO 999 END IF * CALL UTTCLO (OTP, STATUS) IF (STATUS .NE. OK) THEN CONTXT = 'cannot close output table' GO TO 999 END IF * STATUS = OK GO TO 1000 * * write error message * 999 MESS = 'VWARM: ' // CONTXT CALL UMSPUT (MESS, DEST, PRIO, STATOK) * 1000 RETURN END