SUBROUTINE VPVFPT ( * * inputs * : OFILE, APERT, POL, PA, INTEN, P0, PA0, : TEMP, EPOCH, TARGET, NPTS, * * outputs * : STATUS) * * Module Number: 15.12.4.2 * * Module Name: polverify * * Keyphrase: * ---------- * Write the result of VPOLVF to output table * * Description: * ------------ * * FORTRAN name: VPVFPT.FOR * * Keywords of accessed files and tables: * -------------------------------------- * Name I/O Description / Comments * * output table column names: * * 'APER_NAME' O aperture name * 'POLARIZATION' O observed polarization * 'POS_ANG' O observed position angle * 'INTENSITY' O observed intensity of the target * 'REF_POL' O reference polarization * 'REF_POS_ANG' O reference position angle * 'TEMPAVE' O mean temperature * 'EPOCHAVE' O mean epoch * 'TRGTNAME' O target name * * Subroutines Called: * ------------------- * CDBS: * CDTOUT * SDAS: * UTRPTR, UTRPTD, UTRPTT, UTTCLO, UMSPUT * Others: * None * * History: * -------- * Version Date Author Description * 1 07-15-86 J.-C. HSU design and coding * 2 10-05-87 J.-C. HSU F77 standard * *------------------------------------------------------------------------------- * *== input: * --VMS file name of 'OUTTABLE' CHARACTER*(*) OFILE, * --aperture name : APERT(1), * --target name : TARGET(1) * --observed and reference polarization REAL POL(1), P0(1), * --observed and reference position angle : PA(1), PA0(1), * --intensity : INTEN(1), * --mean temperature : TEMP(1) * --mean epoch DOUBLE PRECISION EPOCH(1) * --number of data points INTEGER NPTS * *== output: * --error status INTEGER STATUS * *== local: * --loop index INTEGER I, J, NPUT, * --number of existed rows of output * --SDAS table : NROWS, * --number of columns : NCOLS, * --pointer to table descripter : TP, * --column identifiers : COLIDN(20), * --data type : DTYPE(20), * --error status : STAT(20), STATOK * --data buffer REAL CBUFF(20) * --column format CHARACTER*8 COLFMT(20) * --output SDAS table names CHARACTER*16 CNAME(20), * --column units : UNIT(20) * --error message context CHARACTER*130 CONTXT *==========================begin iraf77.inc (without INTEGER*2)================= * Include file for the iraf77 FORTRAN interface to the IRAF VOS * Get IRAF common into main program * LOGICAL MEMB(1) INTEGER MEMI(1) INTEGER MEML(1) REAL MEMR(1) DOUBLE PRECISION MEMD(1) COMPLEX MEMX(1) EQUIVALENCE (MEMB, MEMI, MEML, MEMR, MEMD, MEMX) COMMON /MEM/ MEMD * * File I/O access modes * INTEGER RDONLY PARAMETER (RDONLY = 1) INTEGER RDWRIT PARAMETER (RDWRIT = 2) INTEGER WRONLY PARAMETER (WRONLY = 3) INTEGER APPEND PARAMETER (APPEND = 4) INTEGER NEWFIL PARAMETER (NEWFIL = 5) INTEGER TMPFIL PARAMETER (TMPFIL = 6) INTEGER NEWCPY PARAMETER (NEWCPY = 7) INTEGER NEWIMG PARAMETER (NEWIMG = 5) * * codes for data types * INTEGER TYBOOL PARAMETER (TYBOOL = 1) INTEGER TYCHAR PARAMETER (TYCHAR = 2) INTEGER TYSHOR PARAMETER (TYSHOR = 3) INTEGER TYINT PARAMETER (TYINT = 4) INTEGER TYLONG PARAMETER (TYLONG = 5) INTEGER TYREAL PARAMETER (TYREAL = 6) INTEGER TYDOUB PARAMETER (TYDOUB = 7) INTEGER TYCPLX PARAMETER (TYCPLX = 8) INTEGER TYUSHT PARAMETER (TYUSHT = 11) INTEGER TYUBYT PARAMETER (TYUBYT = 12) * * TYTEXT is a special code for the iraf77 interface; it is not in the VOS * INTEGER TYTEXT PARAMETER (TYTEXT = 13) *========================end iraf77.inc========================================= *=========================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=========================================== *------------------------------------------------------------------------------ * * specify column names * NCOLS = 9 * CNAME(1) = 'APER_NAME' CNAME(2) = 'POLARIZATION' CNAME(3) = 'POS_ANG' CNAME(4) = 'INTENSITY' CNAME(5) = 'REF_POL' CNAME(6) = 'REF_POS_ANG' CNAME(7) = 'TEMPAVE' CNAME(8) = 'EPOCHAVE' CNAME(9) = 'TRGTNAME' * * column data type * DTYPE(1) = -10 DO 10 I = 2, 7 DTYPE(I) = TYREAL 10 CONTINUE DTYPE(8) = TYDOUB DTYPE(9) = -20 * * find out the number of rows the SDAS table already has and append * the result of this routine as one new row at the bottom * DO 20 I = 1, NCOLS UNIT(I) = ' ' COLFMT(I) = ' ' 20 CONTINUE * * set up output table * CALL CDTOUT (OFILE, CNAME, UNIT, COLFMT, DTYPE, NCOLS, : TP, COLIDN, NROWS, STATUS) IF (STATUS .NE. OK) THEN CONTXT = 'error setting up output table' GO TO 999 END IF * * put each observation to output table * DO 40 I = 1, NPTS * * specify buffer contents * CBUFF(1) = POL(I) CBUFF(2) = PA(I) CBUFF(3) = INTEN(I) CBUFF(4) = P0(I) CBUFF(5) = PA0(I) CBUFF(6) = TEMP(I) * * write results to the output table * CALL UTRPTT (TP, COLIDN(1), 1, NROWS+I, APERT(I), STAT(1)) CALL UTRPTR (TP, COLIDN(2), 6, NROWS+I, CBUFF, STAT(2)) CALL UTRPTD (TP, COLIDN(8), 1, NROWS+I, EPOCH(I), STAT(3)) CALL UTRPTT (TP, COLIDN(9), 1, NROWS+I, TARGET(I), STAT(4)) STAT(5) = OK * * if no reference polarization data, write indefinite to output table * IF (P0(I) .LT. 0.) THEN CALL UTRUDF (TP, COLIDN(5), 2, NROWS+I, STAT(5)) END IF * NPUT = 5 * DO 30 J = 1, NPUT IF (STAT(J) .NE. OK) THEN STATUS = ERRNUM(1) CONTXT = 'cannot write a row to output table' GO TO 999 END IF 30 CONTINUE 40 CONTINUE * CALL UTTCLO (TP, 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 CALL UMSPUT ('VPVFPT: ' // CONTXT, DEST, PRIO, STATOK) * 1000 RETURN END