CCSD3ZF0000100000001CCSD3FF0000500000001CCSD3CS00004markeraa ADIDNAME = NSSD0040 CCSD$$MARKERmarkeraaNSSD3KS00020markerbb ADIDNAME = "NSSD0040"; REVISION_NUMBER = "0"; SUBMISSION_DATE = 1990-12-03; REGISTRATION_DATE = 1990-12-03; REVISABLE = Y; RELEASABLE = Y; EXPECTED_RELEASE_DATE = 1990-12-03; BRIEF_TITLE = "Subroutine"; BRIEF_DESCRIPTION = "Subroutine descriptions"; REVISION_COMMENT = "Original"; GROUP = REGISTRANT; TITLE = Dr.; FIRST_NAME = T.; MIDDLE_NAME = E.; LAST_NAME = Moore; AFFILIATION = "NASA"; GROUP = ADDRESS; ADDRESS_LINE = "NASA/MSFC"; ADDRESS_LINE = "Marshall Space Flight Center, AL 35812 USA"; END_GROUP; GROUP = EMAIL_ADDRESS; NETWORK =NSI/DECNET; NET_ADDRESS = "SAM::MOORET"; END_GROUP ; PHONE = 205-544-7633; END_GROUP ; GROUP = REVISOR ; TITLE = Dr.; FIRST_NAME = T.; MIDDLE_NAME = E.; LAST_NAME = Moore ; AFFILIATION = "NASA"; GROUP = ADDRESS; ADDRESS_LINE = "NASA/MSFC"; ADDRESS_LINE = "Marshall Space Flight Center, AL 35812 USA"; END_GROUP; GROUP = EMAIL_ADDRESS; NETWORK = NSI/DECNET; NET_ADDRESS = "SAM::MOORET"; END_GROUP ; PHONE = 205-544-7633; END_GROUP; REFERENCED_ADID = 0; PROJECT_NAME = ""; MISSION_NAME = ""; INSTRUMENT_NAME = ""; CCSD$$MARKERmarkerbbCCSD3DS00002markercc SUBROUTINE DEFZMS Subroutine Author : JFE JOHNSON Version Number : 1.0 Date : 6-NOV-1981 Documented By : RL WEST Reviewed : 13-JUN-1990 1. PURPOSE: To determine which of the 512 samples are valid for a given Z head, detector combination. 2. ORGANIZATION: 1. Determine appropriate flags for each second of data. 2. Apply flags and Z head, detector combination to a look-up table to see if sample is valid. 3. EXAMPLE CALL: CALL DEFZMS (IIZ,IAZ,ITR,IDET,IZMS) 3.1 ARGUMENTS: Argument : IIZ Type : INTEGER*2 Dimension : 8 Purpose : INPUT: Initial setting of Z head data in channels D and E. Argument : IAZ Type : INTEGER*2 Dimension : 8 Purpose : INPUT: Alternate Z head mode. Argument : ITR Type : INTEGER*2 Dimension : 8 Purpose : INPUT: Z head toggle rate. Argument : IDET Type : INTEGER*2 Dimension : 1 Purpose : INPUT: The combination: 1 = +Z, low mass detector 2 = +Z, high mass detector 3 = -Z, low mass detector 4 = -Z, high mass detector Argument : IZMS Type : INTEGER*2 Dimension : 512 Purpose : OUTPUT: The validity flag: 0 = invalid combination for sample 1 = valid combination, sampled from channel D 2 = valid combination, sampled from channel E 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: NONE 6. SUBROUTINES CALLED: NONE 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE DNDT Subroutine Author : JFE JOHNSON Version Number : 1.0 Date : 1979 Documented By : RL WEST Reviewed : 13-JUN-1990 1. PURPOSE: To convert year and day of year to year, month, and day of month. 2. ORGANIZATION: 1. Check to see if leap year. 2. Calculate month. 3. Calculate day of month. 3. EXAMPLE CALL: CALL DNDT (IYR,IDN,MN,IDY,MNA) 3.1 ARGUMENTS: Argument : IYR Type : INTEGER*2 Dimension : 1 Purpose : INPUT/OUTPUT: Year in question. Argument : IDN Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Day of year in question. Argument : MN Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: Numeric value of month. Argument : IDY Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: Day of month. Argument : MNA Type : INTEGER*4 Dimension : 1 Purpose : OUTPUT: Character value of month (first 3 letters of month). 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: If MN and IDY are returned as 0(zero) and MNA is '****', inputs are invalid. 6. SUBROUTINES CALLED: NONE 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatable with VAX and PDP systems. Compile /NOI4. SUBROUTINE EXPMD1 Subroutine Author : JL GREENE Version Number : 1.0 Date : 28-SEP-1981 Documented By : RL WEST Reviewed : 12-JUN-1990 1. PURPOSE: To get the RPA amd MASS settings for each scan. 2. ORGANIZATION: 1. Load RPA and MASS settings into arrays. 2. If not valid RPA dump, set RPA's to 0. 3. If Electrometer data set MASS settings to -1. 4. If in toggle mode, set MASS settings to 3610. 3. EXAMPLE CALL: CALL EXPMD1 (IMDF,ICAL,IMSF,IRPF,IRPAC,IRPA,IMSH) 3.1 ARGUMENTS: Argument : IMDF Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Memory dump flag. Argument : ICAL Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Calibration flag. Argument : IMSF Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Memory dump validity. Argument : IRPF Type : INTEGER*2 Dimension : 1 Purpose : INPUT: RPA dump validity. Argument : IRPAC Type : INTEGER*2 Dimension : 1 Purpose : INPUT: State of IMS or Electrometer. Argument : IRPA Type : INTEGER*2 Dimension : 32 Purpose : OUTPUT: The 32 RPA settings for this scan. Argument : IMSH Type : INTEGER*2 Dimension : 32 Purpose : OUTPUT: The 32 MASS settings for this scan. 3.2 COMMONS: /MAF1/IDAT Argument : IDAT Type : INTEGER*2 Dimension : 2812 Purpose : INPUT: The array contains the data from the current input record. 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: NONE 6. SUBROUTINES CALLED: NONE 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatable with VAX and PDP systems. Compile /NOI4. SUBROUTINE GETMOD Subroutine Author : JFE JOHNSON Version Number : 1.2 Date : 29-SEP-1982 Documented By : RL WEST Reviewed : 13-JUN-1990 1. PURPOSE: To load in the complete RPA amd MASS settings for an 8 second record, and does mass slide correction if necessary. 2. ORGANIZATION: 1. See if having a memory dump or calibration, if so set RPA's and MASS's to -1. 2. If valid data, load in the RPA and MASS values. 3. If RPA dump not valid set RPA's to 0. 4. If Electrometer mode, set MASS's to -1. 5. If H+/HE+ toggle, set MASS's to 3610, otherwise call mass slide corrrection. 3. EXAMPLE CALL: CALL GETMOD 3.1 ARGUMENTS: NONE 3.2 COMMONS: /I7FLGS/I7FLGS Argument : I7FLGS Type : INTEGER*2 Dimension : (8,22) Purpose : INPUT: Contains the status and various flags. /MAF1/IDAT Argument : IDAT Type : INTEGER*2 Dimension : 2812 Purpose : INPUT: The array containing the data of the current input record. /RPAMSH/IRPA,IMSH Argument : IRPA Type : INTEGER*2 Dimension : (32,2,8) Purpose : OUTPUT: Array containing the 512 RPA values. Argument : IMSH Type : INTEGER*2 Dimension : (32,2,8) Purpose : OUTPUT: Array containing the 512 MASS values. 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: DEFFGS must be called prior to calling this subroutine. 6. SUBROUTINES CALLED: MODMSH 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE MODMSH Subroutine Author : JL GREENE Version Number : 1.3 Date : 8-JUN-1984 Documented By : RL WEST Reviewed : 13-JUN-1990 1. PURPOSE: Modifies MASS settings so they are all the same as the MASS setting for 0(zreo) RPA. 2. ORGANIZATION: 1. For 0(zero) RPA, check the MASS setting against the ranges given in MASTAB and if it is within save it. 2. If the MASS settings of the other RPA's are within the range replace them by the value saved. 3. EXAMPLE CALL: CALL MODMSH (IRPA,IMSH) 3.1 ARGUMENTS: Argument : IRPA Type : INTEGER*2 Dimension : 32 Purpose : INPUT: The 32 RPA settings for this scan. Argument : IMSH Type : INTEGER*2 Dimension : 32 Purpose : INPUT/OUTPUT: The 32 MASS settings for this scan. 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: If the MASS setting for 0(zero) RPA is 0(zero) or it is not within the ranges, none of the other MASS settings are changed. 6. SUBROUTINES CALLED: MASTAB 7. CALLED BY: GETMOD 8. NOTES ON IMPLEMENTATION: Compatable with VAX and PDP systems. Compile /NOI4. SUBROUTINE SCLIMS Subroutine Author : RC OLSEN Version Number : 1.0 Date : 4-FEB-1982 Documented By : RL WEST Reviewed : 13-JUN-1990 1. PURPOSE: To convert the 32 MASS setting for each scan to an index from 1 TO 32. 2. ORGANIZATION: Convert the 32 MASS setting for each scan to an index from 1 TO 32. 3. EXAMPLE CALL: CALL SCLIMS (IIMS) 3.1 ARGUMENTS: Argument : IIMS Type : INTEGER*2 Dimension : 32 Purpose : INPUT/OUTPUT: On input the MASS settings, on output the index value. 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: SCLIM2 5. ADDITIONAL INFORMATION / SIDE EFFECTS: NONE 6. SUBROUTINES CALLED: NONE 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatable with VAX and PDP systems. Compile /NOI4. SUBROUTINE SCLIM2 Subroutine Author : RC OLSEN Version Number : 1.0 Date : 4-FEB-1982 Documented By : RL WEST Reviewed : 13-JUN-1990 1. PURPOSE: Determines if the MASS settings are valid for a scan, and if they are, calculates the voltage and mass over charge for each if the MASS settings. 2. ORGANIZATION: 1. Determine if there are any bad MASS setting values during a scan. 2. Calculates the voltage for each of the MASS settings. 3. Calculates the mass over charge of each of the MASS settings. 3. EXAMPLE CALL: CALL SCLIM2 (IMSH,IBAD) 3.1 ARGUMENTS: Argument : IMSH Type : INTEGER*2 Dimension : 32 Purpose : INPUT: The 32 MASS settings for a scan. Argument : IBAD Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: Validity flag: 0 = all MASS settings are valid 1 = a bad MASS setting was encountered 3.2 COMMONS: /KEVENS/EVKEN Argument : EVKEN Type : INTEGER*2 Dimension : 32 Purpose : OUTPUT: Contains the voltage for each MASS setting. /SCALE/LKUIMS Argument : LKUIMS Type : INTEGER*2 Dimension : 2,32 Purpose : OUTPUT: Contains the mass over charge values for the 32 MASS settings for the low and high mass channels. 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: SCLIM2 is an entry point in SCLIMS. 6. SUBROUTINES CALLED: NONE 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatable with VAX and PDP systems. Compile /NOI4. SUBROUTINE SCLRPA Subroutine Author : JL GREENE Version Number : 1.1 Date : 25-JUL-1982 Documented By : RL WEST Reviewed : 13-JUN-1990 1. PURPOSE: Replaces the 32 RPA settings with an index from 1 to 32. 2. ORGANIZATION: 1. If RPA setting is 1023 replace it with -1. 2. If RPA setting not 1023 find it's index and replace it. 3. EXAMPLE CALL: CALL SCLRPA (IRPA) 3.1 ARGUMENTS: Argument : IRPA Type : INTEGER*2 Dimension : 32 Purpose : INPUT/OUTPUT: On input the 32 RPA settings for a scan, on output the corresponding index. 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: NONE 6. SUBROUTINES CALLED: NONE 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatable with VAX and PDP systems. Compile /NOI4. SUBROUTINE W7FLGS Subroutine Author : UNKNOWN Version Number : 1.0 Date : UNKNOWN Documented By : RL WEST Reviewed : 14-JUN-1990 1. PURPOSE: Takes the word containing the instrument status and extracts the status flags. 2. ORGANIZATION: Does bit munipulation to extract the information. 3. EXAMPLE CALL: CALL W7FLGS (IW7,IMDF,ITR,IIT,IIZ,ICAL,IFXS,IRPAC,IAT,IAZ,ISMF,IRPF) 3.1 ARGUMENTS: Argument : IW7 Type : INTEGER*2 Dimension : 16,8 Purpose : INPUT: The words containing the intsrument status. Argument : IMDF Type : INTEGER*2 Dimension : 8 Purpose : OUTPUT: Memory dump flag. Argument : ITR Type : INTEGER*2 Dimension : 8 Purpose : OUTPUT: Z head toggle rate. Argument : IIT Type : INTEGER*2 Dimension : 8 Purpose : OUTPUT: Electrometer channel F designation. Argument : IIZ Type : INTEGER*2 Dimension : 8 Purpose : OUTPUT: Initial setting of Z head data in channels D and E. Argument : ICAL Type : INTEGER*2 Dimension : 8 Purpose : OUTPUT: Calibration flag. Argument : IFXS Type : INTEGER*2 Dimension : 8 Purpose : OUTPUT: Fixed (hardware) RPA settings and H+/He+ IMS. Argument : IRPAC Type : INTEGER*2 Dimension : 8 Purpose : OUTPUT: State of IMS or Electrometer. Argument : IAT Type : INTEGER*2 Dimension : 8 Purpose : OUTPUT: Alternate Electrometer mode. Argument : IAZ Type : INTEGER*2 Dimension : 8 Purpose : OUTPUT: Alternate Z head mode. Argument : IMSF Type : INTEGER*2 Dimension : 8 Purpose : OUTPUT: Memory dump validity. Argument : IRPF Type : INTEGER*2 Dimension : 8 Purpose : OUTPUT: RPA dump validity. 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: NONE 6. SUBROUTINES CALLED: BITS71,BITS72,BITS74 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatable with VAX and PDP systems. Compile /NOI4. SUBROUTINE ADDTM2 Subroutine Author : JFE JOHNSON, RL WEST Version Number : 1.1 Date : 03-JAN-1990 Documented By : RL WEST Reviewed : 03-JAN-1990 1. PURPOSE: Adds an increment of time (milliseconds) to a given time and returns a new time. 2. ORGANIZATION: 1. Add increment and given seconds together. 2. Checks for day crossing. 3. Checks for year crossing. 3. EXAMPLE CALL: CALL ADDTM2 (IYD1,IT1,INC,IYD2,IT2) 3.1 ARGUMENTS: Argument : IYD1 Type : INTEGER*4 Dimension : 1 Purpose : INPUT: Given YRDOY to be incremented. Argument : IT1 Type : INTEGER*4 Dimension : 1 Purpose : INPUT: Given milliseconds of day to be incremented. Argument : INC Type : INTEGER*4 Dimension : 1 Purpose : INPUT: Milliseconds to be incremented. Argument : IYD2 Type : INTEGER*4 Dimension : 1 Purpose : OUTPUT: Resultant YRDOY. Argument : IT2 Type : INTEGER*4 Dimension : 1 Purpose : OUTPUT: Resultant milliseconds of day. 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: This is an INTEGER*4 version of ADDTM2R which has REAL*8 arguments. 6. SUBROUTINES CALLED: NONE 7. CALLED BY: ORBOFTR 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE ADDTM2R Subroutine Author : RL WEST Version Number : 1.0 Date : 06-APR-1989 Documented By : RL WEST Reviewed : 19-DEC-1989 1. PURPOSE: Adds an increment of time (microseconds) to a given time and returns a new time. 2. ORGANIZATION: 1. Add increment and given seconds together. 2. Checks for day crossing. 3. Checks for year crossing. 3. EXAMPLE CALL: CALL ADDTM2R (YD1,T1,INC,YD2,T2) 3.1 ARGUMENTS: Argument : YD1 Type : REAL*8 Dimension : 1 Purpose : INPUT: Given YRDOY to be incremented. Argument : T1 Type : REAL*8 Dimension : 1 Purpose : INPUT: Given microseconds of day to be incremented. Argument : INC Type : REAL*8 Dimension : 1 Purpose : INPUT: Microseconds to be incremented. Argument : YD2 Type : REAL*8 Dimension : 1 Purpose : OUTPUT: Resultant YRDOY. Argument : T2 Type : REAL*8 Dimension : 1 Purpose : OUTPUT: Resultant microseconds of day. 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: This is a REAL*8 version of ADDTM2 which has INTEGER*4 arguments. 6. SUBROUTINES CALLED: NONE 7. CALLED BY: DEFFRAR,FRASETR,LMSNXTR 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE ANGSET Subroutine Author : JFE JOHNSON Version Number : 1.3 Date : 3-MAR-1982 Documented By : RL WEST Reviewed : 6-MAR-1989 1. PURPOSE: To obtain the minimum and maximum angles from RAM over which you wish to collect the data. 2. ORGANIZATION: 1. Prompts for the minimum and maximum angles. 2. Check to make certain they are between -180 and +180, if not prompts again. 3. EXAMPLE CALL: CALL ANGSET (IANG1,IANG2) 3.1 ARGUMENTS: Argument : IANG1 Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: The minimum angle from RAM that you want data collected. Argument : IANG2 Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: The maximum angle from RAM that you want data collected. 3.2 COMMONS: /DELUNS/LUNDAT,LUNTI,LUNTO Argument : LUNDAT Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number for MF1 data input (usually 1). Argument : LUNTI Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number of terminal input (usually 5). Argument : LUNTO Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number of terminal output (usually 6). 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: NONE 6. SUBROUTINES CALLED: NONE 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatable with VAX and PDP systems. Compile /NOI4. SUBROUTINE APSET Subroutine Author : JH WAITE,JR Version Number : 1.0 Date : 27-OCT-1982 Documented By : RL WEST Reviewed : 6-MAR-1989 1. PURPOSE: Allows the user to specify a certain aperature bias voltage that the RIMS instrument must be set on before the data will be processed. 2. ORGANIZATION: Prompts for the aperature bias voltage. 3. EXAMPLE CALL: CALL APSET (ICX) 3.1 ARGUMENTS: Argument : ICX Type : BYTE Dimension : 1 Purpose : OUTPUT: The aperature bias requested. 3.2 COMMONS: /DELUNS/JLUN,JUNIN,JUNOUT Argument : JLUN Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number for MF1 data input (usually 1). Argument : JUNIN Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number of terminal input (usually 5). Argument : JUNOUT Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number of terminal output (usually 6). 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: Only certains values may be entered: 0,2,4,8, or A for all. 6. SUBROUTINES CALLED: NONE 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatable with VAX and PDP systems. Compile /NOI4. SUBROUTINE APTST Subroutine Author : JH WAITE,JR Version Number : 1.0 Date : 26-OCT-1982 Documented By : RL WEST Reviewed : 6-MAR-1989 1. PURPOSE: Checks the current record to see if the RIMS instrument is set at the desired aperature bias setting. 2. ORGANIZATION: 1. Determine the aperature bias setting of the current record. 2. Compare to the desired aperature bias setting. 3. EXAMPLE CALL: CALL APTST (ICX,KODE) 3.1 ARGUMENTS: Argument : ICX Type : BYTE Dimension : 1 Purpose : INPUT: The aperature bias setting desired. Argument : KODE Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: Return flag: 0 = aperature bias set as desired -1 = aperature bias not as desired 3.2 COMMONS: /MAF1/IDAT Argument : IDAT Type : INTEGER*2 Dimension : 2812 Purpose : INPUT: The array containing the data of the current input record. 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: Prior to calling this subroutine the aperature bias desired must have been set by the calling routine or by a call to APSET. 6. SUBROUTINES CALLED: NONE 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatable with VAX and PDP systems. Compile /NOI4. SUBROUTINE AXISRT Subroutine Author : JL GREEN Version Number : 1.0 Date : 1981 Documented By : RL WEST Reviewed : 04-JAN-1990 1. PURPOSE: Performs a vector rotation through an angle in the XY plane. 2. ORGANIZATION: Rotate vector. 3. EXAMPLE CALL: CALL AXISRT (VEC,PHI,VECPM) 3.1 ARGUMENTS: Argument : VEC Type : REAL Dimension : 3 Purpose : INPUT: The vector to be rotated. Argument : PHI Type : REAL Dimension : 1 Purpose : INPUT: The rotation angle in degrees. Argument : VECPM Type : REAL Dimension : 3 Purpose : OUTPUT: The rotated vector. 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: NONE 6. SUBROUTINES CALLED: NONE 7. CALLED BY: RBFAVG 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE BITMSK Subroutine Author : UNKNOWN Version Number : 1.0 Date : UNKNOWN Documented By : RL WEST Reviewed : 18-DEC-1989 1. PURPOSE: To do bit munipulation. 2. ORGANIZATION: 1. Apply mask. 2. Shift bits. 3. EXAMPLE CALL: CALL BITMSK (IW7,IMASK,NBSHT,IANS) 3.1 ARGUMENTS: Argument : IW7 Type : LOGICAL*1 Dimension : 1 Purpose : INPUT: The word to be operated on. Argument : IMASK Type : INTEGER*2 Dimension : 1 Purpose : INPUT: The mask to be applied. Argument : NBSHT Type : INTEGER*2 Dimension : 1 Purpose : INPUT: The number of bits to be shifted. Argument : IANS Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: The result of the operation. 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: NONE 6. SUBROUTINES CALLED: NONE 7. CALLED BY: BITS71,BITS72,BITS74 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE BITS71 Subroutine Author : UNKNOWN Version Number : 1.0 Date : UNKNOWN Documented By : RL WEST Reviewed : 18-DEC-1989 1. PURPOSE: Calculates the RIMS instrument status and flags from word 7/1 only. 2. ORGANIZATION: 1. Determines the bit mask for each output item. 2. Calls the subroutine which does the actual bit munipulation. 3. EXAMPLE CALL: CALL BITS71 (IW7,IMDF,ITR,IIT,IIZ) 3.1 ARGUMENTS: Argument : IW7 Type : LOGICAL*1 Dimension : 1 Purpose : INPUT: Contains the bits containing the information desired. Argument : IMDF Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: The memory dump flag. Argument : ITR Type : INTERGER*2 Dimension : 1 Purpose : OUTPUT: The Z head toggle rate. Argument : IIT Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: The Electrometer channel F designation. Argument : IIZ Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: Initial setting of the Z head data in channels D and E. 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: NONE 6. SUBROUTINES CALLED: BITMSK 7. CALLED BY: DEFFGS 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE BITS72 Subroutine Author : UNKNOWN Version Number : 1.0 Date : UNKNOWN Documented By : RL WEST Reviewed : 18-DEC-1989 1. PURPOSE: Calculates the RIMS instrument status and flags from word 7/2 only. 2. ORGANIZATION: 1. Determines the bit mask for each output item. 2. Calls the subroutine which does the actual bit munipulation. 3. EXAMPLE CALL: CALL BITS71 (IW7,ICAL,IFXS,IRPAC,IAT,IAZ) 3.1 ARGUMENTS: Argument : IW7 Type : LOGICAL*1 Dimension : 1 Purpose : INPUT: Contains the bits containing the information desired. Argument : ICAL Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: Calibration flag. Argument : IFXS Type : INTERGER*2 Dimension : 1 Purpose : OUTPUT: Fixed (hardware) RPA settings and H+/HE+ IMS. Argument : IRPAC Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: State of IMS or calibration. Argument : IAT Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: Alternate Electrometer mode. Argument : IAZ Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: Alternate Z head mode. 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: NONE 6. SUBROUTINES CALLED: BITMSK 7. CALLED BY: DEFFGS 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE BITS74 Subroutine Author : UNKNOWN Version Number : 1.0 Date : UNKNOWN Documented By : RL WEST Reviewed : 18-DEC-1989 1. PURPOSE: Calculates the RIMS instrument status and flags from word 7/4 only. 2. ORGANIZATION: 1. Determines the bit mask for each output item. 2. Calls the subroutine which does the actual bit munipulation. 3. EXAMPLE CALL: CALL BITS71 (IW7,IZ2DIS,IZ1DIS,IRDIS,IRPF,IMSF,IZ2HVF,IZ1HVF,IRHVF) 3.1 ARGUMENTS: Argument : IW7 Type : LOGICAL*1 Dimension : 1 Purpose : INPUT: Contains the bits containing the information desired. Argument : IZ2DIS Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: ???? Argument : IZ1DIS Type : INTERGER*2 Dimension : 1 Purpose : OUTPUT: ???? Argument : IRDIS Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: ???? Argument : IRPF Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: RPA dump validity. Argument : IMSF Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: Memory dump valitity. Argument : IZ2HVF Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: ???? Argument : IZ1HVF Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: ???? Argument : IRHVF Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: ???? 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: NONE 6. SUBROUTINES CALLED: BITMSK 7. CALLED BY: DEFFGS 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE CMPRSS Subroutine Author : Robert E. Newman Jr.,Et.Al. Version Number : V1-31 Date : 21-NOV-1989 Documented By : Robert E. Newman Jr. Reviewed : 26-JAN-1990 1. PURPOSE: The function written in "C", is actually a stand alone program when compiled with the default flags. When compiled with the CALLSUB token defined, the program compiles as a subroutine callable from "FORTRAN" to perform file decompression/compression with the Lempel-Ziv algorithim. 2. ORGANIZATION: 1. Open specified input file for decompression/compression. 2. Create output file either specified or generated with *.*_Y extension. 3. Begin decompression/compression process. 4. Close created output file. 5. Close opened input file. 6. Return status to caller. 3. EXAMPLE CALL: INTEGER*4 CMPRSS EXTERNAL CMPRSS BYTE COMMAND(80) CHARACTER*80 CMDSTR EQUIVALENCE (CMDSTR,COMMAND) BYTE NULL /0/ CHARACTER*1 NC EQUIVALENCE (NC,NULL) . . . CMDSTR='-d'//NC//'-i'//NC//'-n'//NC//'INPUT.FILE'//NC// 'OUTPUT.FILE'//NC STATUS=CMPRSS(5,COMMAND) ! Success STATUS is odd value. ! Fail STATUS is even value. 3.1 ARGUMENTS: Argument : argcc Type : INTEGER Dimension : 1 Purpose : INPUT: This argument is READ_ONLY, and is set by the caller. The argument is set to the number of null terminated parameters in argvs. Argument : argvs Type : Byte Dimension : Variable Purpose : INPUT: This argument is READ_ONLY, and is filled by the caller with the appropriate NULL Terminated ASCII parameters. The format of the parameter input is: [-i][-d][-bmaxbits][-n]ifile [ofile] = a byte value of zero. * Switches: * -d: If given, decompression is done instead. * -b: Bits to use (DEFAULTS: 16 for VAX, 13 for pc) * -i: Inhibit Deletion After Comp/Decomp * -n: Print no Diagnostic Messages. 3.2 COMMON BLOCKS: NONE 3.3 FILES REQUIRED: Input File Specifed by Caller. Output File Created by "Cmprss" function. 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: CMPRSS can be found in the module COMPTST.C. The command file in [DE1RIMS.SOFTWARE.SUBROUTINE] called COMPTST.COM must be run prior to the creation of any executable which utilizes the function CMPRSS, however, this need to be done only once. When no output file is given, the output file is named like the input, except that the type name of the input file name is appended with an "*.*_Y". 6. SUBROUTINES CALLED: A User written set of I/O routines written in "C" in the Module named RMSIO.C included with the COMPTST.C compress source. 7. CALLED BY: DECOM_OPEN_MAF1 8. NOTES ON IMPLEMENTATION: Refer to COMPTST.C inline documentation. SUBROUTINE CMPTM2 Subroutine Author : JFE JOHNSON Version Number : 1.0 Date : 31-0CT-1981 Documented By : RL WEST Reviewed : 04-JAN-1990 1. PURPOSE: Compares two times to see which one is the earliest. 2. ORGANIZATION: 1. Compare the year and day of year. 2. Compare the seconds of day. 3. EXAMPLE CALL: CALL CMPTM2 (IYD1,IT1,IYD2,IT2,IFLAG) 3.1 ARGUMENTS: Argument : IYD1 Type : INTEGER*4 Dimension : 1 Purpose : INPUT: The first YRDOY. Argument : IT1 Type : INTEGER*4 Dimension : 1 Purpose : INPUT: The first milliseconds. Argument : IYD2 Type : INTEGER*4 Dimension : 1 Purpose : INPUT: The second YRDOY. Argument : IT2 Type : INTEGER*4 Dimension : 1 Purpose : INPUT: The second milliseconds. Argument : IFLAG Type : INTEGER*4 Dimension : 1 Purpose : OUTPUT: Return code: -1 = IYD1,IT1 before IYD2,IT2 0 = IYD1,IT1 equals IYD2,IT2 1 = IYD1,IT1 after IYD2,IT2 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: This is an INTEGER*4 version of CMPTM2R which has REAL*8 arguments. 6. SUBROUTINES CALLED: NONE 7. CALLED BY: ORB_SAVE 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE CMPTM2R Subroutine Author : RL WEST Version Number : 1.0 Date : 06-APR-1989 Documented By : RL WEST Reviewed : 21-DEC-1989 1. PURPOSE: Compares two times to see which one is the earliest. 2. ORGANIZATION: 1. Compare the year and day of year. 2. Compare the seconds of day. 3. EXAMPLE CALL: CALL CMPTM2R (YD1,T1,YD2,T2,IFLAG) 3.1 ARGUMENTS: Argument : YD1 Type : REAL*8 Dimension : 1 Purpose : INPUT: The first YRDOY. Argument : T1 Type : REAL*8 Dimension : 1 Purpose : INPUT: The first microseconds. Argument : YD2 Type : REAL*8 Dimension : 1 Purpose : INPUT: The second YRDOY. Argument : T2 Type : REAL*8 Dimension : 1 Purpose : INPUT: The second microseconds. Argument : IFLAG Type : INTEGER*4 Dimension : 1 Purpose : OUTPUT: Return code: -1 = YD1,T1 before YD2,T2 0 = YD1,T1 equals YD2,T2 1 = YD1,T1 after YD2,T2 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: This is a REAL*8 version of CMPTM2 which has INTEGER*4 arguments. 6. SUBROUTINES CALLED: NONE 7. CALLED BY: DEFFRAR,LMSNXTR,LMSSETR 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE DECLOSE Subroutine Author : JFE JOHNSON, BARRY LEE, RL WEST Version Number : 2.0 Date : SEP-1989 Documented By : RL WEST Reviewed : 28-DEC-1989 1. PURPOSE: To close the MF1 file. 2. ORGANIZATION: 1. Checks the open flag to see if a MF1 has been opened. 2. If opened closes the file, and sets the open flag to close. 3. EXAMPLE CALL: CALL DECLOS 3.1 ARGUMENTS: NONE 3.2 COMMONS: /DELUNS/JLUN,JUNIN,JUNOUT Argument : JLUN Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number for MF1 data input (usually 1). Argument : JUNIN Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number for terminal input (usually 5). Argument : JUNOUT Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number for terminal output (usually 6). 3.3 FILES REQUIRED: The MF1 file desired. 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: DECLOS is an entry point in DELUNS. 6. SUBROUTINES CALLED: NONE 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE DECOM_OPEN_MAF1 Subroutine Author : BF LEE Version Number : 1.0 Date : 17-JAN-1990 Documented By : BF LEE Reviewed : 18-JAN-1990 1. PURPOSE: To search for compressed MAF1 files that contain the required time period and set up the decompression command for the compression software that is called in order to create a decompressed MAF1 file, and then to open the decompressed MAF1 file for reading. An exit handler is set up to delete the decompressed MAF1 file when the program terminates. 2. ORGANIZATION: 1. Convert REAL*8 date/time values to INTEGER*4 2. Check logical names to make sure assignments have been made 3. Set up search date to begin in previous day in case of overlap 4. Set up exit handler 5. If previous decompressed MAF1 file is open, delete it 6. If last start date is beyond current end date, set status and return 7. Find file that contains current start date. If no file is found, increment current start date by one day and try again 8. Get the date and start/stop times from the file name. If the stop date/time is less than the current start date/time go to step 7. If the current end date/time is less than the start date/time set status and return. If the status code from file find is not normal set status and return 9. Set up decompression command for compression software and call compression software 10. Open decompressed file, set status and return 3. EXAMPLE CALL: CALL DECOM_OPEN_MAF1 (LUN,ISTAT) 3.1 ARGUMENTS: Argument : LUN Type : INTEGER*2 Dimension : 1 Purpose : INPUT: The logical unit number to be assigned to the decompressed MAF1 file Argument : ISTAT Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: Return status indicating if file was opened successfully (0) or not (nonzero) 3.2 COMMONS: /COMTMS/ SD,ST,ED,ET,D1,D2 Argument : SD Type : REAL*8 Dimension : 1 Purpose : INPUT: Start date in form YDDD Argument : ST Type : REAL*8 Dimension : 1 Purpose : INPUT: Start time in microseconds Argument : ED Type : REAL*8 Dimension : 1 Purpose : INPUT: End date in form YDDD Argument : ET Type : REAL*8 Dimension : 1 Purpose : End time in microseconds 3.3 FILES REQUIRED: Compressed MAF1 files 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: Two logicals, MAF1_COMP and MAF1_DECOMP, are used. Assignments must be made for these by the user before any program using this subroutine is executed. The disk and account where the compressed files are located must be assigned to MAF1_COMP, for example @ASSIGN DISK1:[MAF1.COMPRESSED] MAF1_COMP. The disk and account where the decompressed file is to be created must be assigned to MAF1_DECOMP, for example @ASSIGN DISK2:[PRODUCTION.FILES] MAF1_DECOMP. If either or both of these assignments are not made, the routine will print out a message indicating the problem, and the program will be terminated. The return status value assigned to the variable ISTAT is as follows: 0 = successful -1 = decompression error, e.g. privilege violation, not enough disk space, etc. +1 = no more files found with necessary time period 6. SUBROUTINES CALLED: CMPRSS EXIT_HAND_DELUNS,HMSMM,ICPTIM,INCDAY,INSERT_NULLS_DELUNS, LENSTR, PRINT_STATUS, 7. CALLED BY: REDDAT 8. NOTES ON IMPLEMENTATION: VAX compatible. Compile /NOI4 SUBROUTINE DEFFGS Subroutine Author : JFE JOHNSON Version Number : 1.2 Date : 29-SEP-1982 Documented By : RL WEST Reviewed : 7-MAR-1989 1. PURPOSE: Calculates the RIMS instrument status and various flags. 2. ORGANIZATION: Does bit munipulation to to extract the information. 3. EXAMPLE CALL: CALL DEFFGS 3.1 ARGUMENTS: NONE 3.2 COMMONS: /I7FLGS/I7FLGS Argument : I7FLGS Type : INTEGER*2 Dimension : (8,22) Purpose : OUTPUT: Contains the status and various flags. /MAF1/DAT Argument : DAT Type : INTEGER*2 Dimension : 2812 Purpose : INPUT: The array containing the data from the current record. 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: Must be called after GETMF1 and prior to any data processing. 6. SUBROUTINES CALLED: BITS71, BITS72, BITS74 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatable with VAX and PDP systems. Compile /NOI4. SUBROUTINE DEFFRAR Subroutine Author : RL WEST Version Number : 1.0 Date : 07-APR-1989 Documented By : RL WEST Reviewed : 18-DEC-1989 1. PURPOSE: To update the current frame time limits. 2. ORGANIZATION: 1. Check to see if more that one (1) frame for this run. 2. Calculate new frame time limits. 3. Reset subperiod time limits. 3. EXAMPLE CALL: CALL DEFFRA (KODE) 3.1 ARGUMENTS: Argument : KODE Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: Return flag: 0 = updated time limits, continue processing. 1 = done with this run. 3.2 COMMONS: /COMLIMS/STRIP_TIMES Argument : STRIP_TIMES Type : REAL*8 Dimension : 4 Purpose : OUTPUT: The start YDOY and microseconds, and stop YDOY and microseconds of the current subperiod. /COMTMS/RUN_TIMES,INC,DUR Argument : RUN_TIMES Type : REAL*8 Dimension : 4 Purpose : INPUT: The start YDOY and microseconds and stop YDOY and microseconds of this run. Argument : INC Type : REAL*8 Dimension : 1 Purpose : INPUT: The increment (microseconds) between each subperiod. Argument : DUR Type : REAL*8 Dimension : 1 Purpose : INPUT: The duration (microseconds) of each subperiod . /FRATMS/FRAME_TIMES,NDIV Argument : FRAME_TIMES Type : REAL*8 Dimension : 4 Purpose : OUTPUT: The start YDOY and microseconds and stop YDOY and microseconds of current frame. Argument : NDIV Type : REAL*8 Dimension : 1 Purpose : INPUT: The number of subperiods in the current frame. 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: The subroutines LMSSETR and FRASETR must be called prior to calling DEFFRAR. 6. SUBROUTINES CALLED: ADDTM2R,CMPTM2R 7. CALLED BY: FRASETR 8. NOTES ON IMPLEMENTATION: Compatable with VAX and PDP systems. Compile /NOI4. SUBROUTINE DELUNS Subroutine Author : JFE JOHNSON, BARRY LEE, RL WEST Version Number : 2.0 Date : SEP-1989 Documented By : RL WEST Reviewed : 28-DEC-1989 1. PURPOSE: To put the various input/output logical unit numbers in a common block. 2. ORGANIZATION: 1. Assign the call line arguements to a second set of variables. 2. Put the second set of variables in a common block. 3. EXAMPLE CALL: CALL DELUNS (LUNDAT,LUNIN,LUNOUT) 3.1 ARGUMENTS: Argument : LUNDAT Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number for the MF1 data input (usually 1). Argument : LUNIN Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number for terminal input (usually 5). Argument : LUNOUT Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number for terminal output (usually 6). 3.2 COMMONS: /DELUNS/JLUN,JUNIN,JUNOUT Argument : JLUN Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: Logical unit number for MF1 data input (usually 1). Argument : JUNIN Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: Logical unit number for terminal input (usually 5). Argument : JUNOUT Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: Logical unit number for terminal output (usually 6). 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: DECLOS,DEOPEN,REDDAT,REWDED 5. ADDITIONAL INFORMATION / SIDE EFFECTS: NONE 6. SUBROUTINES CALLED: NONE 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE DEOPEN Subroutine Author : JFE JOHNSON, BARRY LEE, RL WEST Version Number : 2.0 Date : SEP-1989 Documented By : RL WEST Reviewed : 28-DEC-1989 1. PURPOSE: To prompt for and open a MF1 data file. 2. ORGANIZATION: 1. Prompt for the name of a MF1 file. 2. Open the MF1 file. 3. EXAMPLE CALL: CALL DEOPEN 3.1 ARGUMENTS: NONE 3.2 COMMONS: /DELUNS/JLUN,JUNIN,JUNOUT Argument : JLUN Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number for MF1 data input (usually 1). Argument : JUNIN Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number for terminal input (usually 5). Argument : JUNOUT Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number for terminal output (usually 6). 3.3 FILES REQUIRED: The MF1 file desired. 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: DEOPEN is an entry point in DELUNS. If, instead of entering a specific MF1 file name, a is entered the default files are used, which are obtained based on the run start and stop times the common /COMTMS/, and are opened as needed. 6. SUBROUTINES CALLED: NONE 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE DIFTMSR Subroutine Author : RL WEST Version Number : 1.0 Date : 06-APR-1989 Documented By : RL WEST Reviewed : 27-DEC-1989 1. PURPOSE: To calculate the difference in microseconds of (YD1,T1) - (YD2,T2). 2. ORGANIZATION: 1. Calculate T1-T2. 2. Check for day crossings. 3. Check for year crossings. 3. EXAMPLE CALL: CALL DIFTMSR (YD1,T1,YD2,T2,IFLAG,DMS) 3.1 ARGUMENTS: Argument : YD1 Type : REAL*8 Dimension : 1 Purpose : INPUT: The first year and day of year. Argument : T1 Type : REAL*8 Dimension : 1 Purpose : INPUT: The first microseconds of day. Argument : YD2 Type : REAL*8 Dimension : 1 Purpose : INPUT: The second year and day of year. Argument : T2 Type : REAL*8 Dimension : 1 Purpose : INPUT: The second microseconds of day. Argument : IFLAG Type : INTEGER*4 Dimension : 1 Purpose : OUTPUT: Not used, but kept to be compatible with original version. Argument : DMS Type : REAL*8 Dimension : 1 Purpose : OUTPUT: The difference in microseconds of (YD1,T1) - (YD2,T2). 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: NONE 6. SUBROUTINES CALLED: NONE 7. CALLED BY: FRASETR,LMSTSSR 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE EXIT_HAND_DELUNS Subroutine Author : BF LEE Version Number : 1.0 Date : 17-JAN-1990 Documented By : BF LEE Reviewed : 18-JAN-1990 1. PURPOSE: To set up an exit handler routine for program termination in order to delete the last decompressed MAF1 file created. 2. ORGANIZATION: 1. Set up array argument for SYS$DCLEXH 2. Call SYS$DCLEXH 3. Test status returned by SYS$DCLEXH and exit on abnormal status 3. EXAMPLE CALL: CALL EXIT_HAND_DELUNS (EX,OPEN,IUNIT) 3.1 ARGUMENTS: Argument : EX Type : INTEGER*4 Dimension : 1 Purpose : INPUT: The name of the exit handler routine (EXTERNAL) Argument : OPEN Type : LOGICAL*4 Dimension : 1 Purpose : INPUT: Indicates whether a decompressed MAF1 file is currently open (true/false) Argument : IUNIT Type : INTEGER*2 Dimension : 1 Purpose : INPUT: The logical unit number assigned to the decompressed MAF1 file if open (usually 1) 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: Terminates program if abnormal status is returned by SYS$DCLEXH. Uses MAF1_TERM as an EXTERNAL function. 6. SUBROUTINES CALLED: MAF1_TERM 7. CALLED BY: DECOM_OPEN_MAF1 8. NOTES ON IMPLEMENTATION: VAX compatible. Compile /NOI4. SUBROUTINE FNDVAL Subroutine Author : JFE JOHNSON Version Number : 1.0 Date : 28-SEP-1981 Documented By : RL WEST Reviewed : 05-JAN-1990 1. PURPOSE: To search through the RPA values to find how many unique RPA values there are and to save them. 2. ORGANIZATION: 1. Check an RPA value to see if it has been saved. 2. If it has not, save it. 3. EXAMPLE CALL: CALL FNDVAL (IVALS,NVALS,IDIFVL,NFIDVL) 3.1 ARGUMENTS: Argument : IVALS Type : INTEGER*2 Dimension : NVALS Purpose : INPUT: The array of RPA values to be searched. Argument : NVALS Type : INTEGER*2 Dimension : 1 Purpose : INPUT: The number of elements in IVALS to search. Argument : IDIFVL Type : INTEGER*2 Dimension : NVALS Purpose : OUTPUT: The array containing the unique RPA values. Argument : NDIFVL Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: The number of unique RPA values in IDIFVL. 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: If an element of IVALS has a value of -1 it is ignored. All elements of IDIFVL beyond NDIFVL have a value of -1. 6. SUBROUTINES CALLED: NONE 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE FRAOPTR Subroutine Author : RL WEST Version Number : 1.0 Date : 06-APR-1989 Documented By : RL WEST Reviewed : 20-DEC-1989 1. PURPOSE: To output the current frame time limits to a unit number desired. 2. ORGANIZATION: 1. Set the REAL*8 frame time limits to INTEGER*4. 2. Convert milliseconds to hours,minutes,seconds,milliseconds. 3. Write to unit desired. 3. EXAMPLE CALL: CALL FRAOPTR (LUN) 3.1 ARGUMENTS: Argument : LUN Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number for the output. 3.2 COMMONS: /FRATMS/FRAME_TIMES,NDIV Argument : FRAME_TIMES Type : REAL*8 Dimension : 4 Purpose : INPUT: The start YDOY and microseconds and stop YDOY and microseconds of the current frame. Argument : NDIV Type : REAL*8 Dimension : 1 Purpose : INPUT: The number of subperiods in the current frame. 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: NONE 6. SUBROUTINES CALLED: MSHMSM 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE FRASETR Subroutine Author : RL WEST Version Number : 06-APR-1989 Date : 1.0 Documented By : RL WEST Reviewed : 19-DEC-1989 1. PURPOSE: Prompts for the duration of each frame, calculates the number of subperiods in each frame, and the increment and duration of each subperiod. 2. ORGANIZATION: 1. Prompt for duration. 2. Calculate the number of subperiods. 3. Calculate increment and duration of subperiods. 4. Reset start and stop times of first subperiod. 5. Initialize start and stop times of first frame. 3. EXAMPLE CALL: CALL FRASETR (KODE) 3.1 ARGUMENTS: Argument : KODE Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: Return code: -1 = end of file on input 0 = successful input 3.2 COMMONS: /COMLIM/STRIP_TIMES Argument : STRIP_TIMES Type : REAL*8 Dimension : 4 Purpose : OUTPUT: Contains the subperiod start YDOY,MICROSECONDS of day and stop YDOY,MICROSECONDS of day. /COMTMS/RUN_TIMES,INC,DUR Argument : RUN_TIMES Type : REAL*8 Dimension : 4 Purpose : OUTPUT: Contains the run start YDOY,MICROSECONDS of day and stop YDOY,MICROSECONDS of day. Argument : INC Type : REAL*8 Dimension : 1 Purpose : OUTPUT: Increment of time (microseconds) between the start time of each subperiod. Argument : DUR Type : REAL*8 Dimension : 1 Purpose : OUTPUT: Duration of time (microseconds) of each subperiod. /DELUNS/LUNDAT,LUNTI,LUNTO Argument : LUNDAT Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number for MF1 data input (usually 1). Argument : LUNTI Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number for terminal input (usually 5). Argument : LUNTO Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number for terminal output (usually 6). /FRATMS/FRAME_TIMES,NDIV Argument : FRAME_TIMES Type : REAL*8 Dimension : 4 Purpose : OUTPUT: The start YDOY and microseconds and stop YDOY and microseconds of this frame. Argument : NDIV Type : REAL*8 Dimension : 1 Purpose : INPUT: The number of subperiods in this frame. 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: NONE 6. SUBROUTINES CALLED: ADDTM2R,DEFFRAR,DIFTMSR,RESLTNR 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4 SUBROUTINE GETMD1 Subroutine Author : JFE JOHNSON Version Number : 1.2 Date : 29-SEP-1982 Documented By : RL WEST Reviewed : 28-DEC-1989 1. PURPOSE: To load in the complete RPA amd MASS settings for an 8 second record. 2. ORGANIZATION: 1. See if having a memory dump or calibration, if so set RPA's and MASS's to -1. 2. If valid data, load in the RPA and MASS values. 3. If RPA dump not valid set RPA's to 0. 4. If Electrometer mode, set MASS's to -1. 5. If H+/HE+ toggle, set MASS's to 3610. 3. EXAMPLE CALL: CALL DEFFGS 3.1 ARGUMENTS: NONE 3.2 COMMONS: /I7FLGS/I7FLGS Argument : I7FLGS Type : INTEGER*2 Dimension : (8,22) Purpose : INPUT: Contains the status and various flags. /MAF1/IDAT Argument : IDAT Type : INTEGER*2 Dimension : 2812 Purpose : INPUT: The array containing the data of the current input record. /RPAMSH/IRPA,IMSH Argument : IRPA Type : INTEGER*2 Dimension : (32,2,8) Purpose : OUTPUT: Array containing the 512 RPA values. Argument : IMSH Type : INTEGER*2 Dimension : (32,2,8) Purpose : OUTPUT: Array containing the 512 MASS values. 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: DEFFGS must be called prior to calling this subroutine. 6. SUBROUTINES CALLED: NONE 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE GETMF1 Subroutine Author : JFE JOHNSON Version Number : 1.2 Date : 09-AUG-1982 Documented By : RL WEST Reviewed : 29-DEC-1989 1. PURPOSE: To read a data record. 2. ORGANIZATION: 1. Call the subroutine which actually reads the data file. 2. Put the data in its common block. 3. Calculate the time of the record and put it in its common block. 3. EXAMPLE CALL: CALL GETMF1 (IER) 3.1 ARGUMENTS: Argument : IER Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: Return code: 0 = ok read -10 = end of file on read 3.2 COMMONS: /BLKTIM/IYD,IT Argument : IYD Type : INTEGER*4 Dimension : 1 Purpose : OUTPUT: The year and day of year of the current record in the form YDDD. Argument : IT Type : INTEGER*4 Dimension : 1 Purpose : OUTPUT: The milliseconds of day of the current record. /MAF1/IDAT Argument : IDAT Type : INTEGER*2 Dimension : 2812 Purpose : OUTPUT: The array containing the data of the current input record. 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: NONE 6. SUBROUTINES CALLED: REDDAT 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE HEDSET Subroutine Author : JFE JOHNSON, JL GREEN Version Number : 1.3 Date : 14-SEP-1982 Documented By : RL WEST Reviewed : 29-DEC-1989 1. PURPOSE: Prompts for the head from which the data is to be collected. 2. ORGANIZATION: 1. Prompt for the head. 2. Verify responce is valid. 3. EXAMPLE CALL: CALL HEDSET (IHEAD) 3.1 ARGUMENTS: Argument : IHEAD Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: The head chosen: RADIAL=1, +Z=2, -Z=3, Electrometer=4. 3.2 COMMONS: /DELUNS/LUNDAT,LUNTI,LUNTO Argument : LUNDAT Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number for MF1 data input (usually 1). Argument : LUNTI Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number of terminal input (usually 5). Argument : LUNTO Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number of terminal output (usually 6). 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: A entered in responce to the prompt will stop execution of the program. 6. SUBROUTINES CALLED: NONE 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE HMSMM Subroutine Author : BF LEE Version Number : 1.0 Date : 17-JAN-1990 Documented By : BF LEE Reviewed : 18-JAN-1990 1. PURPOSE: To convert time in form HHMMSS and milliseconds to milliseconds 2. ORGANIZATION: 1. Break up input time into hours, minutes, seconds, and milliseconds 2. Compute total milliseconds from above components 3. EXAMPLE CALL: CALL HMSMM (IHMS,MR,MS) 3.1 ARGUMENTS: Argument : IHMS Type : INTEGER*4 Dimension : 1 Purpose : INPUT: Time in form HHMMSS Argument : MR Type : INTEGER*4 Dimension : 1 Purpose : INPUT: The milliseconds part of the input time Argument : MS Type : INTEGER*4 Dimension : 1 Purpose : OUTPUT: The converted time in milliseconds 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: NONE 6. SUBROUTINES CALLED: NONE 7. CALLED BY: DECOM_OPEN_MAF1 8. NOTES ON IMPLEMENTATION: Standard FORTRAN FUNCTION IANGLN Function Author : JFE JOHNSON Version Number : 1.0 Date : 25-JUL-1982 Documented By : RL WEST Reviewed : 11-JAN-1990 1. PURPOSE: Calculates the angle bin index for a given sample. 2. ORGANIZATION: 1. Calculate angle of this sample. 2. Add angle to the RAM reference angle. 3. Calculate the angle bin index. 3. Make sure index between 1 and NANG. 3. EXAMPLE CALL: INDEX = IANGLN (DEGSAM,RAMANG,NANG,ISAMPL) 3.1 ARGUMENTS: Argument : IANGLN Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: The angle bin index of this sample. Argument : DEGSAM Type : REAL Dimension : 1 Purpose : INPUT: The spin rate in degrees per sample. Argument : RAMANG Type : REAL Dimension : 1 Purpose : INPUT: The RAM reference angle. Argument : NANG Type : INTEGER*2 Dimension : 1 Purpose : INPUT: The number of angle bins. Argument : ISAMPL Type : INTEGER*2 Dimension : 1 Purpose : INPUT: The sample number. 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: This is an INTEGER*2 function. The subroutine REFANG must be call prior to IANGLN in order to calculate DEGSAM and RAMANG. 6. SUBROUTINES CALLED: NONE 7. CALLED BY: SRTANG 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE IASK Subroutine Author : C.E. MCILWAIN Version Number : 1.0 Date : 17-JUN-1978 Documented By : RL WEST Reviewed : 29-DEC-1989 1. PURPOSE: To prompt for a variable. 2. ORGANIZATION: Prompts for a variable. 3. EXAMPLE CALL: CALL IASK (IVAL,STR) 3.1 ARGUMENTS: Argument : IVAL Type : INTEGER*2 Dimension : 1 Purpose : INPUT/OUTPUT: The variable for which to be prompted. Argument : STR Type : BYTE Dimension : MAX OF 80 Purpose : INPUT: A literal character string to be used for the variable prompt. 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: This can be used when a default value is used but can be changed. Entering a at the prompt will retain the value displayed, but entering a number will change the default to something else. 6. SUBROUTINES CALLED: NONE 7. CALLED BY: RESLTNR 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. FUNCTION ICPTIM Function Author : BF LEE Version Number : 1.0 Date : 17-JAN-1990 Documented By : BF LEE Reviewed : 18-JAN-1990 1. PURPOSE: To compare two dates/times 2. ORGANIZATION: 1. Compare YEARS, if YEAR1 is less than YEAR0, return -1, if YEAR1 is greater than YEAR0, return +1 2. Compare DAY NUMBERS, if DAYNO1 is less than DAYNO0, return -1, if DAYNO1 is greater than DAYNO0, return +1 3. Compare TIMES, if TIME1 is less than TIME0, return -1, if TIME1 is greater than TIME0, return +1, else return 0 3. EXAMPLE CALL: I = ICPTIM(IY1,ID1,IT1,IY0,ID0,IT0) 3.1 ARGUMENTS: Argument : ICPTIM Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: Result of the compare: -1 = time1 < time0 0 = time1 = time0 +1 = time1 > time0 Argument : IY1 Type : INTEGER*4 Dimension : 1 Purpose : INPUT: Year 1 Argument : ID1 Type : INTEGER*4 Dimension : 1 Purpose : INPUT: Day-of-year 1 Argument : IT1 Type : INTEGER*4 Dimension : 1 Purpose : INPUT: time 1 in milliseconds Argument : IY0 Type : INTEGER*4 Dimension : 1 Purpose : INPUT: Year 0 Argument : ID0 Type : INTEGER*4 Dimension : 1 Purpose : INPUT: Day-of-year 0 Argument : IT0 Type : INTEGER*4 Dimension : 1 Purpose : INPUT: time 0 in milliseconds 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: Any arguments not needed for comparison can be set to zero 0 return means dates/times are equal +1 return means that date/time 1 > date/time 0 -1 return means that date/time 1 < date/time 0 6. SUBROUTINES CALLED: NONE 7. CALLED BY: DECOM_OPEN_MAF1 8. NOTES ON IMPLEMENTATION: Standard FORTRAN FUNCTION IDCODC Function Author : BARRY LEE Version Number : 1.0 Date : 30-OCT-1981 Documented By : RL WEST Reviewed : 29-DEC-1989 1. PURPOSE: This function log decompressed the data. 2. ORGANIZATION: 1. Check the value of the input. 2. Apply the appropriate algorithm. 3. Set return flag. 3. EXAMPLE CALL: VARIABLE = IDCODC (IDATA,IFLAG) 3.1 ARGUMENTS: Argument : IDCODC Type : INTEGER*4 Dimension : 1 Purpose : OUTPUT: The log decompressed data value. Argument : IDATA Type : INTEGER*2 Dimension : 1 Purpose : INPUT: The log compressed data value. Argument : IFLAG Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: Return flag: 0 = IDATA was less than 0(zero), invalid input 1 = valid input 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: If IDATA is less than 0(zero) then IDCODC is set to 0(zero) and IFLAG is set to 0(zero), otherwise IDCODC has a valid value and IFLAG is set to 1(one). 6. SUBROUTINES CALLED: NONE 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. FUNCTION IDYSYR Funstion Author : BF LEE Version Number : 1.0 Date : 17-JAN-1990 Documented By : BF LEE Reviewed : 19-JAN-1990 1. PURPOSE: To return the number of days in a given year (365/366) 2. ORGANIZATION: 1. Set number of days in year to 365 2. If year is not divisible by 4, return 3. If year is not a century year, set number of days to 366 and return 4. If year is not divisible by 400, return 5. Set number of days to 366 and return 3. EXAMPLE CALL: I = IDYSYR (IY) 3.1 ARGUMENTS: Argument : IDYSYR Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: The number of days in given year Argument : IY Type : INTEGER*4 Dimension : 1 Purpose : INPUT: The year for number-of-days determination 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: NONE 6. SUBROUTINES CALLED: NONE 7. CALLED BY: INCDAY 8. NOTES ON IMPLEMENTATION: Standard FORTRAN. FUNCTION IGTZMS Function Author : JFE JOHNSON Version Number : 1.0 Date : 23-JUL-1982 Documented By : RL WEST Reviewed : 29-DEC-1989 1. PURPOSE: To determine if a given Z head, detector combination is valid for a given sample. 2. ORGANIZATION: 1. Determine which second of the record the sample is in. 2. Determine the appropriate flags for this second. 3. Determine the sample within the second. 4. Determine if Z head, detector combination valid. 3. EXAMPLE CALL: IZMS = IGTZMS (IDET,ISAMPL) 3.1 ARGUMENTS: Argument : IGTZMS Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: The validity flag: 0 = invalid combination for sample 1 = valid combination, sampled from channel D 2 = valid combination, sampled from channel E Argument : IDET Type : INTEGER*2 Dimension : 1 Purpose : INPUT: The combination: 1 = +Z, low mass detector 2 = +Z, high mass detector 3 = -Z, low mass detector 4 = -Z, high mass detector Argument : ISAMPL Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Sample number from 1 to 512. 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: NONE 6. SUBROUTINES CALLED: NONE 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. FUNCTION INCDAY Function Author : BF LEE Version Number : 1.0 Date : 17-JAN-1990 Documented By : BF LEE Reviewed : 19-JAN-1990 1. PURPOSE: To increment a date in the form YYDDD by a given number of days and return the new date in the same form 2. ORGANIZATION: 1. Extract year (YY) 2. Extract day number (DDD) 3. Increment day number by number of days specified 4. Obtain number of days in the year (365 or 366) 5. If the new day number > number of days in the year, subtract the number of days in the year from the day number to obtain a new day number, increment year by 1, and go back to step 4 6. If the new day number is less than 1, decrease the year by 1, obtain the number of days for the year, add the number of days in the year to the day number, and repeat this step 7. Convert the year and day number to the form YYDDD and return 3. EXAMPLE CALL: I = INCDAY (IDATE,INC) 3.1 ARGUMENTS: Argument : INCDAY Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: The resulant date Argument : IDATE Type : INTEGER*4 Dimension : 1 Purpose : INPUT: The date to be incremented Argument : INC Type : INTEGER*4 Dimension : 1 Purpose : INPUT: The number of days to increment IDATE by (may be positive or negative) 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: NONE 6. SUBROUTINES CALLED: IDYSYR 7. CALLED BY: DECOM_OPEN_MAF1 8. NOTES ON IMPLEMENTATION: Standard FORTRAN SUBROUTINE INSERT_NULLS_DELUNS Subroutine Author : BF LEE Version Number : 1.0 Date : 17-JAN-1990 Documented By : BF LEE Reviewed : 19-JAN-1990 1. PURPOSE: To replace the first blank after each non-blank character in a character string with a null (0) 2. ORGANIZATION: 1. Find location of first non-blank character in string 2. Beginning from location of first non-blank character, find first blank after each non-blank character and replace with null 3. Set character position after last non-blank character in string to null 4. Return 3. EXAMPLE CALL: CALL INSERT_NULLS_DELUNS (STRING) 3.1 ARGUMENTS: Argument : STRING Type : CHARACTER Dimension : * Purpose : INPUT/OUTPUT: The string for which the first blank character after a non-blank character is to be set null 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: The argument STRING must be a character VARIABLE and not a LITERAL. The length of STRING should be at least be one character longer than the location of the last non-blank character contained in it. 6. SUBROUTINES CALLED: LENSTR 7. CALLED BY: DECOM_OPEN_MAF1 8. NOTES ON IMPLEMENTATION: FORTRAN 77 SUBROUTINE INTRR1 Subroutine Author : JFE JOHNSON Version Number : 1.0 Date : 15-NOV-1981 Documented By : RL WEST Reviewed : 29-DEC-1989 1. PURPOSE: Interpolates missing, non-defined values, less than 0(zero), in a real count array. 2. ORGANIZATION: 1. If element defined (value equal to or greater then 0(zero)) no interpolating performed. 2. Determine the values of the elements before and after the missing element that are to be used. 3. Apply the appropriate weighting factors to the known values to obtain the unknown value. 3. EXAMPLE CALL: CALL INTRR1 (RDAT,N) 3.1 ARGUMENTS: Argument : RDAT Type : REAL Dimension : (N) Purpose : INPUT/OUTPUT: The array to which the interpolation is to be applied. Argument : N Type : INTEGER*2 Dimension : 1 Purpose : INPUT: The dimension of array RDAT. 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: IF there are more than 3 contiguous non-defined values no interpolation will be done on these. 6. SUBROUTINES CALLED: NONE 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. FUNCTION ISANGL Function Author : JFE JOHNSON Version Number : 1.0 Date : 25-JUL-1982 Documented By : RL WEST Reviewed : 05-JAN-1990 1. PURPOSE: To calculate the RAM angle for a given sample. 2. ORGANIZATION: 1. Calculate angle of this sample. 2. Add angle to the RAM reference angle. 3. Make sure angle between -180 and +180. 3. EXAMPLE CALL: IANG = ISANGL (DEGSAM,RAMANG,ISAMPL) 3.1 ARGUMENTS: Argument : ISANGL Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: The RAM angle of this sample. Argument : DEGSAM Type : REAL Dimension : 1 Purpose : INPUT: The spin rate in degrees per sample. Argument : RAMANG Type : REAL Dimension : 1 Purpose : INPUT: The RAM reference angle. Argument : ISAMPL Type : INTEGER*2 Dimension : 1 Purpose : INPUT: The sample number. 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: This is an INTEGER*2 function. The subroutine REFANG must be call prior to ISANGL in order to calculate DEGSAM and RAMANG. 6. SUBROUTINES CALLED: NONE 7. CALLED BY: SRTRP2 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. FUNCTION LENSTR Function Author : BF LEE Version Number : 1.0 Date : 17-JAN-1990 Documented By : BF LEE Reviewed : 19-JAN-1990 1. PURPOSE: To determine the actual length of a character string, i.e. the position of the last non-blank, non-null, non-tab character. 2. ORGANIZATION: 1. Beginning at last position available in character string look for the first non-blank, non-null, non-tab character and obtain position 2. Return position obtained to calling program/routine 3. EXAMPLE CALL: L = LENSTR (STRING) 3.1 ARGUMENTS: Argument : LENSTR Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: The actual length of the character string Argument : STRING Type : CHARACTER Dimension : * Purpose : INPUT: The string for which to obtain the actual length 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: NONE 6. SUBROUTINES CALLED: NONE 7. CALLED BY: DECOM_OPEN_MAF1,INSERT_NULLS_DELUNS 8. NOTES ON IMPLEMENTATION: FORTRAN 77 SUBROUTINE LMSNXTR Subroutine Author : RL WEST Version Number : 1.0 Date : 06-APR-1989 Documented By : RL WEST Reviewed : 21-DEC-1989 1. PURPOSE: Updates the new current subperiod time limits. 2. ORGANIZATION: 1. See if subperiods have been defined. 2. See if last subperiod in the frame. 3. Calculate new subperiod start and stop times. 3. EXAMPLE CALL: CALL LMSNXT (KODE) 3.1 ARGUMENTS: Argument : KODE Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: Return code: 1 = subperiods not defined, or last subperiod in frame. 0 = update of subperiod time limits successful. 3.2 COMMONS: /COMLIM/STRIP_TIMES Argument : STRIP_TIMES Type : REAL*8 Dimension : 4 Purpose : OUTPUT: Contains the subperiod start YDOY,MICROSECONDS of day and stop YDOY,MICROSECONDS of day. /COMTMS/RUN_TIMES,INC,DUR Argument : RUN_TIMES Type : REAL*8 Dimension : 4 Purpose : INPUT: Contains the run start YDOY,MICROSECONDS of day and stop YDOY,MICROSECONDS of day. Argument : INC Type : REAL*8 Dimension : 1 Purpose : INPUT: Increment of time (microseconds) between the start time of each subperiod. Argument : DUR Type : REAL*8 Dimension : 1 Purpose : INPUT: Duration of time (microseconds) of each subperiod. /FRATMS/FRAME_TIMES,NDIV Argument : FRAME_TIMES Type : REAL*8 Dimension : 4 Purpose : INPUT: The start YDOY and microseconds and stop YDOY and microseconds of this frame. Argument : NDIV Type : REAL*8 Dimension : 1 Purpose : INPUT: The number of subperiods in this frame. 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: NONE 6. SUBROUTINES CALLED: ADDTM2R,CMPTM2R 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE LMSSETR Subroutine Author : RL WEST Version Number : 1.0 Date : 06-APR-1989 Documented By : RL WEST Reviewed : 19-DEC-1989 1. PURPOSE: To prompt for the run start and stop times. 2. ORGANIZATION: 1. Prompt for run start and stop YY,DDD,HHMMSS,MILLISEC. 2. Convert start YY,DDD to YDDD. 3. Convert start HHMMSS,MILLISEC to microseconds. 4. Convert stop YY,DDD to YDDD. 5. Convert stop HHMMSS,MILLISEC to microseconds. 6. Checks to make certain start time is prior to stop time. 7. Initialize strip and frame time limits to run time limits. 3. EXAMPLE CALL: CALL LMSSETR (KODE) 3.1 ARGUMENTS: Argument : KODE Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: Return code: -1 = end of file on input 0 = successful input 3.2 COMMONS: /COMLIM/STRIP_TIMES Argument : STRIP_TIMES Type : REAL*8 Dimension : 4 Purpose : OUTPUT: Contains the subperiod start YDOY,MICROSECONDS of day and stop YDOY,MICROSECONDS of day. /COMTMS/RUN_TIMES,INC,DUR Argument : RUN_TIMES Type : REAL*8 Dimension : 4 Purpose : OUTPUT: Contains the run start YDOY,MICROSECONDS of day and stop YDOY,MICROSECONDS of day. Argument : INC Type : REAL*8 Dimension : 1 Purpose : OUTPUT: Increment of time (microseconds) between the start time of each subperiod. Argument : DUR Type : REAL*8 Dimension : 1 Purpose : OUTPUT: Duration of time (microseconds) of each subperiod. /DELUNS/LUNDAT,LUNTI,LUNTO Argument : LUNDAT Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number for MF1 data input (usually 1). Argument : LUNTI Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number for terminal input (usually 5). Argument : LUNTO Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number for terminal output (usually 6). /FRATMS/FRAME_TIMES,NDIV Argument : FRAME_TIMES Type : REAL*8 Dimension : 4 Purpose : OUTPUT: The start YDOY and MICROSECONDS and stop YDOY and MICROSECONDS of current frame. Argument : NDIV Type : REAL*8 Dimension : 1 Purpose : OUTPUT: The number of subperiods in the current frame. 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: If the run stop YR and DN are entered as 0(zero) they will be set equal to the start YR and DN. 6. SUBROUTINES CALLED: CMPTM2R,THSM 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE LMSTSSR Subroutine Author : RL WEST Version Number : 1.0 Date : 06-APR-1989 Documented By : RL WEST Reviewed : 20-DEC-1989 1. PURPOSE: Returns the start and stop sample numbers of a record that are within the subperiod time limits. 2. ORGANIZATION: 1. See if any of record within subperiod time limits. 2. Find first sample within subperiod time limits. 3. Find last sample within subperiod time limits. 3. EXAMPLE CALL: CALL LMSTSSR (KODE,IS,IE) 3.1 ARGUMENTS: Argument : KODE Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: Return code: -1 = all of record prior to subperiod start time. 0 = some of record within subperiod time limits 1 = all of record after subperiod stop time Argument : IS Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: First sample of the record within subperiod time limits. Argument : IE Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: Last sample of the record within subperiod time limits. 3.2 COMMONS: /COMLIM/STRIP_TIMES Argument : STRIP_TIMES Type : REAL*8 Dimension : 4 Purpose : INPUT: Contains the subperiod start YDOY,MICROSECONDS of day and stop YDOY,MICROSECONDS of day. 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: If none of the record is within the subperiod time limits IS and IE are returned as 0(zero)). 6. SUBROUTINES CALLED: DIFTMSR,LMSTSTR 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE LMSTSTR Subroutine Author : RL WEST Version Number : 1.0 Date : 06-APR-1989 Documented By : RL WEST Reviewed : 27-DEC-1989 1. PURPOSE: Checks to see if any of the current record is within the current subperiod time limits. 2. ORGANIZATION: 1. Calculate start and stop times of current record. 2. See if record stop time prior to subperiod start time. 3. See if record start time after subperiod stop time. 3. EXAMPLE CALL: CALL LMSTSTR (KODE) 3.1 ARGUMENTS: Argument : KODE Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: Return code: -1 = record stop prior subperiod start 0 = some of record within subperiod time limits 1 = record start after subperiod stop. 3.2 COMMONS: /BLKTIM/IYD,IT Argument : IYD Type : INTEGER*4 Dimension : 1 Purpose : INPUT: The year and day of year of the current record. Argument : IT Type : INTEGER*4 Dimension : 1 Purpose : INPUT: The milliseconds of day of the current record. /COMLIM/STRIP_TIMES Argument : STRIP_TIMES Type : REAL*8 Dimension : 4 Purpose : OUTPUT: Contains the subperiod start YDOY,MICROSECONDS of day and stop YDOY,MICROSECONDS of day. 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: NONE 6. SUBROUTINES CALLED: ADDTM2R,CMPTM2R 7. CALLED BY: LMSTSSR 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE MAF1_TERM Subroutine Author : BF LEE Version Number : 1.0 Date : 17-JAN-1990 Documented By : BF LEE Reviewed : 19-JAN-1990 1. PURPOSE: To perform certain final actions when a program terminates. In this case, to delete the last opened decompressed MAF1 file. 2. ORGANIZATION: 1. If a MAF1 file is still open, close it with the delete option 2. Return 3. EXAMPLE CALL: CALL MAF1_TERM_(ISTAT,OPEN,IUNIT) 3.1 ARGUMENTS: Argument : ISTAT Type : INTEGER*4 Dimension : 1 Purpose : OUTPUT: To return termination status Argument : OPEN Type : LOGICAL*4 Dimension : 1 Purpose : INPUT: To indicate whether a MAF1 file is still open (true) or not (false) Argument : IUNIT Type : INTEGER*2 Dimension : 1 Purpose : INPUT: The logical unit number assigned to MAF1 file (usually 1) 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: NONE 6. SUBROUTINES CALLED: NONE 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: FORTRAN 77 SUBROUTINE MASCNV Subroutine Author : JFE JOHNSON Version Number : 1.0 Date : 18-FEB-1982 Documented By : RL WEST Reviewed : 29-DEC-1989 1. PURPOSE: Converts MASS settings which may have been expressed in lower mass detector nomenclature into high mass detector settings. 2. ORGANIZATION: 1. Check to see if both values are greater than 0(zero), if so return. 2. Divide the negative of the MASS settings by 4. 3. Make certain the lower value is in the first argument, and the higher value is in the second argument. 3. EXAMPLE CALL: CALL MASCNV (IM1,IM2) 3.1 ARGUMENTS: Argument : IM1 Type : INTEGER*2 Dimension : 1 Purpose : INPUT/OUTPUT: On input the entered lower MASS setting, on output the converted lower MASS setting. Argument : IM2 Type : INTEGER*2 Dimension : 1 Purpose : INPUT/OUTPUT: On input the entered higher MASS setting, on output the converted higher MASS setting. 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: When the subroutine MASSET is called and the response is specific MASS settings and they are positive then they are assumed to be for the lower mass detector, but if the MASS settings are negative then it is assumed that the comparable MASS settings are wanted from the high mass detector (for example: if the negative of the H+ MASS settings are entered, then it will convert them to the values for He+ in the high mass detector.) 6. SUBROUTINES CALLED: NONE 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatable with VAX and PDP systems. Compile /NOI4. SUBROUTINE MASSET Subroutine Author : JFE JOHNSON Version Number : 2.2 Date : 6-OCT-1982 Documented By : RL WEST Reviewed : 29-DEC-1989 1. PURPOSE: Prompts for the mass detector and ion species to be analysed. 2. ORGANIZATION: 1. Prompt for the mass detector and ion species. 2. Verify entry is valid. 3. EXAMPLE CALL: CALL MASSET (IM1,IM2) 3.1 ARGUMENTS: Argument : IM1 Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: The lower MASS setting. Argument : IM2 Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: The higher MASS setting. 3.2 COMMONS: /DELUNS/LUNDAT,LUNI,LUNO Argument : LUNDAT Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number of MF1 data input (usually 1). Argument : LUNI Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number of terminal input (usually 5). Argument : LUNO Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number of terminal output (usually 6). 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: A specific mass detector and ion species may be entered (i.e. L/H+) in which case the proper mass settings will be determined, but if a is entered you will be prompted for specific MASS settings. If they are positive they will assumed to be for the low mass detector but if they are negative they will be assumed to be for the high mass detector and the comparable MASS settings will be determined by a call to MASCNV. 6. SUBROUTINES CALLED: MASTAB 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatable with VAX and PDP systems. Compile /NOI4. SUBROUTINE MASTAB Subroutine Author : JFE JOHNSON, JH WAITE,JR Version Number : 1.2 Date : 05-OCT-1982 Documented By : RL WEST Reviewed : 29-DEC-1989 1. PURPOSE: Returns a mass lookup table containing the mass settings for the species in the high mass detector. 2. ORGANIZATION: Get the lookup table. 3. EXAMPLE CALL: CALL MASTAB (ITABLE) 3.1 ARGUMENTS: Argument : ITABLE Type : INTEGER*2 Dimension : (2,4) Purpose : OUTPUT: Contains the mass settings. 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: NONE 6. SUBROUTINES CALLED: NONE 7. CALLED BY: MASSET,MASTXT 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE MASTXT Subroutine Author : JFE JOHNSON Version Number : 1.2 Date : 6-OCT-1982 Documented By : RL WEST Reviewed : 29-DEC-1989 1. PURPOSE: Determines which mass detector is being used based on the 2 MASS setting and also determines the byte representations of the ion species in the low and high mass detectors to which the MASS settings correspond. 2. ORGANIZATION: 1. Determine which mass detector. 2. Using a look up table determine the 2 ion species. 3. EXAMPLE CALL: CALL MASTXT (IM1,IM2,ILOHI,TXTLM,TSTXM) 3.1 ARGUMENTS: Argument : IM1 Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Lower MASS setting. Argument : IM2 Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Higher MASS setting. Argument : ILOHI Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: Mass detector: 1 = low mass detector 2 = high mass detector. Argument : TXTLM Type : BYTE Dimension : 4 Purpose : OUTPUT: Ion species of the low mass detector. Argument : TXTHM Type : BYTE Dimension : 4 Purpose : OUTPUT: Ion species of the high mass detector. 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: If the lookup table does not contain the information for the low and high mass settings a '????' will be returned in TXTLM and TXTHM. 6. SUBROUTINES CALLED: MASTAB 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatable with VAX and PDP systems. Compile /NOI4. SUBROUTINE MSHMSM Subroutine Author : JFE JOHNSON Version Number : 1.0 Date : 22-NOV-1982 Documented By : RL WEST Reviewed : 27-DEC-1989 1. PURPOSE: Converts from milliseconds of day to hours, minutes, seconds, and milliseconds. 2. ORGANIZATION: 1. Calculate hours of day. 2. Calculate minutes of hour. 3. Calculate seconds of minutes. 4. Calculate millisecs of seconds. 3. EXAMPLE CALL: CALL MSHMSM (IMS,IHR,IMN,ISC,MS) 3.1 ARGUMENTS: Argument : IMS Type : INTEGER*4 Dimension : 1 Purpose : INPUT: Milliseconds of day to be converted. Argument : IHR Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: Hours of day. Argument : IMN Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: Minutes of hour. Argument : ISC Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: Seconds of minutes. Argument : MS Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: Milliseconds of seconds. 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: NONE 6. SUBROUTINES CALLED: NONE 7. CALLED BY: FRAOPTR 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE OPENDA Subroutine Author : JFE JOHNSON Version Number : 1.0 Date : 15-NOV-1982 Documented By : RL WEST Reviewed : 05-JAN-1990 1. PURPOSE: Prompt for and open a file for the output from a program. 2. ORGANIZATION: 1. Prompt for the name of an output file. 2. Open the output file. 3. EXAMPLE CALL: CALL OPENDA 3.1 ARGUMENTS: NONE 3.2 COMMONS: /LUNDA/LUNDA,IDAFLG Argument : LUNDA Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number for the output file (usually 3). Argument : IDAFLG Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: Return flag: 0 = output file not opened 1 = output file opened /DELUNS/LUN,LUNIN,LUNOUT Argument : LUN Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number for MF1 data input (usually 1). Argument : LUNIN Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number for terminal input (usually 5). Argument : LUNOUT Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number for terminal output (usually 6). 3.3 FILES REQUIRED: The name of an output file. 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: If no output is desired then enter at the prompt. This file is for formatted output only. 6. SUBROUTINES CALLED: NONE 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE ORBOFTR Subroutine Author : RL WEST Version Number : 1.0 Date : 02-DEC-1987 Documented By : RL WEST Reviewed : 03-JAN-1990 1. PURPOSE: To determine when to save the first set of orbit parameters and how often. 2. ORGANIZATION: 1. Calculate duration of frame. 2. Determine how often to save orbit parameters. 3. Calculate the time to save the first set of orbit parameters. 3. EXAMPLE CALL: CALL ORBOFTR 3.1 ARGUMENTS: NONE 3.2 COMMONS: /FRATMS/FRAME_TIMES,NDIV Argument : FRAME_TIMES Type : REAL*8 Dimension : 4 Purpose : INPUT: The start YDOY and microseconds and stop YDOY and microseconds of this frame. Argument : NDIV Type : REAL*8 Dimension : 1 Purpose : INPUT: The number of subperiods in this frame. /ORBIT/IORBOFT,IORBYD,IORBTIME,IN,IFIRST Argument : IORBOFT Type : INTEGER*4 Dimension : 1 Purpose : OUTPUT: How often to save the orbit parameters, in milliseconds. Argument : IORBYD Type : INTEGER*4 Dimension : 1 Purpose : OUTPUT: The YDOY to save the orbit parameters. Argument : IORBTIME Type : INTEGER*4 Dimension : 1 Purpose : OUTPUT: The milliseconds of day to save the orbit parameters. Argument : IN Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: The number of sets of orbit parameters saved. Argument : IFIRST Type : INTEGER*4 Dimension : 2 Purpose : OUTPUT: The YDOY and milliseconds of day of the first set of saved orbit parameters. 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: NONE 6. SUBROUTINES CALLED: ADDTM2,TIMDIF 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE ORBSAV Subroutine Author : JFE JOHNSON Version Number : 1.0 Date : 03-NOV-1981 Documented By : RLWEST Reviewed : 05-JAN-1990 1. PURPOSE: To save the header of the current MF1 record. 2. ORGANIZATION: Save the header and put it in common. 3. EXAMPLE CALL: CALL ORBSAV 3.1 ARGUMENTS: NONE 3.2 COMMONS: /HEDSAV/HEADER Argument : HEADER Type : INTEGER*2 Dimension : 24 Purpose : OUTPUT: The header information saved. /MAF1/IDAT Argument : IDAT Type : INTEGER*2 Dimension : 2812 Purpose : INPUT: The array containing the data of the current input record. 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: The header saved is the first 24 words of the current MF1 record. 6. SUBROUTINES CALLED: NONE 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE ORB_SAVE Subroutine Author : RL WEST Version Number : 1.0 Date : 03-DEC-1987 Documented By : RL WEST Reviewed : 03-JAN-1990 1. PURPOSE: Determine if it is time to save the orbit parameters, and to calculate next time to save the orbit parameters. 2. ORGANIZATION: 1. See if record contains the orbit parameter save time. 2. Save the orbit parameters. 3. Calculate next orbit parameter save time. 3. EXAMPLE CALL: CALL ORB_SAVE 3.1 ARGUMENTS: NONE 3.2 COMMONS: /BLKTIM/IYD,IMS Argument : IYD Type : INTEGER*4 Dimension : 1 Purpose : INPUT: The year and day of year of the current record in the form YDDD. Argument : IMS Type : INTEGER*4 Dimension : 1 Purpose : INPUT: The milliseconds of day of the current record. /MAF1/JDAT Argument : JDAT Type : INTEGER*2 Dimension : 2812 Purpose : INPUT: The array containing the data of the current input record. /ORBDAT/ITIME,ORBS Argument : ITIME Type : INTEGER*4 Dimension : (2,13) Purpose : OUTPUT: The year and day of year, and milliseconds of day of the up to 13 sets of saved orbit parameters. Argument : ORBS Type : REAL Dimension : (4,13) Purpose : OUTPUT: The up to 13 sets of saved orbit parameters. 1 = radial distance, 2 = L-shell, 3 = magnetic local time, and 4 = magnetic latitude. /ORBIT/IORBOFT,IORBYD,IORBTIME,IN,IFIRST Argument : IORBOFT Type : INTEGER*4 Dimension : 1 Purpose : INPUT: How often to save the orbit parameters, in milliseconds. Argument : IORBYD Type : INTEGER*4 Dimension : 1 Purpose : INPUT/OUTPUT: The YDOY to save the orbit parameters. Argument : IORBTIME Type : INTEGER*4 Dimension : 1 Purpose : INPUT/OUTPUT: The milliseconds of day to save the orbit parameters. Argument : IN Type : INTEGER*2 Dimension : 1 Purpose : INPUT/OUTPUT: The number of sets of orbit parameters saved. Argument : IFIRST Type : INTEGER*4 Dimension : 2 Purpose : INPUT: The YDOY and milliseconds of day of the first set of saved orbit parameters. 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: If there was no record which contained a specific orbit save time, ITIME will be defined but ORBS will be all 0',(zeroes). 6. SUBROUTINES CALLED: ADDTM2,CMPTM2 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE PARINI Subroutine Author : JFE JOHNSON Version Number : 1.0 Date : 09-AUG-1982 Documented By : RL WEST Reviewed : 10-JAN-1990 1. PURPOSE: Initialize all the minimum pitch angles to 180 and all the maximum pitch angles to 0(zero) in the pitch angle storage array. 2. ORGANIZATION: 1. Set all minimum pitch anles to 180. 2. Set all maximum pitch angles to 0(zero). 3. EXAMPLE CALL: CALL PARINI (PANGS,NANG) 3.1 ARGUMENTS: Argument : PANGS Type : INTEGER*2 Dimension : (360,2) Purpose : OUTPUT: The minimum and maximum pitch angles for each angle bin. Argument : NANG Type : INTEGER*2 Dimension : 1 Purpose : INPUT: The number of angle bins in PANGS to initialize. 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: PARSET 5. ADDITIONAL INFORMATION / SIDE EFFECTS: NONE 6. SUBROUTINES CALLED: NONE 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE PARSET Subroutine Author : JFE JOHNSON Version Number : 1.0 Date : 09-AUG-1982 Documented By : RL WEST Reviewed : 10-JAN-1990 1. PURPOSE: To calculate the pitch angle (angle between the RADIAL head and the B-field) for each angle bin and to determine if it is the minimum or maximum encountered. 2. ORGANIZATION: 1. Call routine to calculate the average despun components of the B-field. 2. Calculate the angle of each angle bin. 3. Call routine to calculate the angle between each bin and the B-field. 4. Save the angle as the minimum or maximum angle encountered for each angle bin which ever it may be. 3. EXAMPLE CALL: CALL PARSET (PANGS,NANG) 3.1 ARGUMENTS: Argument : PANGS Type : INTEGER*2 Dimension : (360,2) Purpose : INPUT/OUTPUT: The array containing the minimum and maximum pitch angles for each angle bin. Argument : NANG Type : INTEGER*2 Dimension : 1 Purpose : INPUT: The number of angle bins in PANGS to check. 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: PARSET is an entry point in PARINI. 6. SUBROUTINES CALLED: PITCH,RBFAVG 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE PITCH Subroutine Author : ???? Version Number : ???? Date : ???? Documented By : RL WEST Reviewed : 10-JAN-1989 1. PURPOSE: Calculate the angle between the RAM angle of the RADIAL head and the B-field. 2. ORGANIZATION: 1. Convert angles to degrees. 2. Calculate magnitude of B-field. 3. Calculate unit direction defined by RADIAL head RAM angle 4. Calculate angle. 3. EXAMPLE CALL: CALL PITCH (B,THETA,PHI,ALPHA) 3.1 ARGUMENTS: Argument : B Type : REAL Dimension : 3 Purpose : INPUT: The x,y,z components of the B-field. Argument : THETA Type : REAL Dimension : 1 Purpose : INPUT: The polar angle (degrees) of the RADIAL head. Argument : PHI Type : REAL Dimension : 1 Purpose : INPUT: The Ram angle (degrees) of the RADIAL head. Argument : ALPHA Type : REAL Dimension : 1 Purpose : OUTPUT: The angle (degrees) between the RAM angle of the RADIAL head and the B-field. 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: All argument angles are in degree. 6. SUBROUTINES CALLED: NONE 7. CALLED BY: PARSET 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE PITPHA Subroutine Author : JFE JOHNSON, B. LEE, RL WEST Version Number : 1.2 Date : 13-NOV-1986 Documented By : RL WEST Reviewed : 04-JAN-1990 1. PURPOSE: To calculate the minimum pitch angle between the average B-field and the RAM direction for a record. 2. ORGANIZATION: 1. Call routine to calculate average B-field in a fixed reference frame. 2. Calculate angle. 3. EXAMPLE CALL: CALL PITPHA (MINANG) 3.1 ARGUMENTS: Argument : MINANG Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: The angle between the average B-field and RAM. 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: Sometimes the B-field in the MAF data files is incorrect which will produce strange results. 6. SUBROUTINES CALLED: RBFAVG 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE PRINT_STATUS Subroutine Author : BF LEE Version Number : 1.0 Date : 17-JAN-1990 Documented By : BF LEE Reviewed : 19-JAN-1990 1. PURPOSE: To print status message associated with a given status code 2. ORGANIZATION: 1. Call SYS$GETMSG to get message associated with status code 2. Print message 3. Return 3. EXAMPLE CALL: CALL PRINT_STATUS (CODE) 3.1 ARGUMENTS: Argument : CODE Type : INTEGER*4 Dimension : 1 Purpose : INPUT: Status code for which associated message is to be printed 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: NONE 6. SUBROUTINES CALLED: NONE 7. CALLED BY: DECOM_OPEN_MAF1 8. NOTES ON IMPLEMENTATION: FORTRAN 77 SUBROUTINE RBFAVG Subroutine Author : ???? Version Number : 1.0 Date : 23-SEP-1986 Documented By : RL WEST Reviewed : 04-JAN-1990 1. PURPOSE: Computes the average of the rotated B-field components for an 8 second record. 2. ORGANIZATION: 1. Apply B-field scaling factor. 2. Calculate spin angle. 3. Rotate B-field components. 4. Sum B-filed components. 5. Average B-field components. 3. EXAMPLE CALL: CALL RBFAVG (BAVG) 3.1 ARGUMENTS: Argument : BAVG Type : REAL Dimension : 3 Purpose : OUTPUT: The average components of the B-field for an 8 second record. 3.2 COMMONS: /MAF1/IDAT Argument : IDAT Type : INTEGER*2 Dimension : 2812 Purpose : INPUT: The array containing the data of the current record. 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: NONE 6. SUBROUTINES CALLED: AXISRT 7. CALLED BY: PARSET,PITPHA 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE REDDAT Subroutine Author : JFE JOHNSON, BARRY LEE, RL WEST Version Number : 2.0 Date : SEP-1989 Documented By : RL WEST Reviewed : 28-DEC-1989 1. PURPOSE: This subroutine actually reads the MF1 file. 2. ORGANIZATION: Read the MF1 file. 3. EXAMPLE CALL: CALL REDDAT (IBUF,LBUF,IER) 3.1 ARGUMENTS: Argument : IBUF Type : INTEGER*2 Dimension : LBUF Purpose : OUTPUT: Array containing the data from the read. Argument : LBUF Type : INTEGER*2 Dimension : 1 Purpose : INPUT: The dimension of the array IBUF. Argument : IER Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: Return code: 0 = good read -10 = end of file on read 3.2 COMMONS: /DELUNS/JLUN,JUNIN,JUNOUT Argument : JLUN Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number for MF1 data input (usually 1). Argument : JUNIN Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number for terminal input (usually 5). Argument : JUNOUT Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number for terminal output (usually 6). 3.3 FILES REQUIRED: The MF1 file desired. 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: REDDAT is an entry point in DELUNS. If a had been entered for the file name in DEOPEN, this subroutine calls the necessary routine to have the MF1 files decompressed and opened as needed. 6. SUBROUTINES CALLED: DECOM_OPEN_MAF1 7. CALLED BY: GETMF1 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE REFANG Subroutine Author : JFE JOHNSON Version Number : 1.1 Date : 10-MAY-1982 Documented By : RL WEST Reviewed : 04-JAN-1990 1. PURPOSE: To determine the spin rate in degrees per sample and a reference angle (RAM) in degrees of the RADIAL head with respect to the S/C velocity vector. 2. ORGANIZATION: 1. Calculate spin rate. 2. Calculate reference angle. 3. EXAMPLE CALL: CALL REFANG (DEGSAM,EXPRAM) 3.1 ARGUMENTS: Argument : DEGSAM Type : REAL Dimension : 1 Purpose : OUTPUT: The spin rate (degrees/sample). Argument : EXPRAM Type : REAL Dimension : 1 Purpose : OUTPUT: The reference angle (RAM). 3.2 COMMONS: /MAF1/IDAT Argument : IDAT Type : INTEGER*2 Dimension : 2812 Purpose : INPUT: The array containing the data of the current input record. 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: NONE 6. SUBROUTINES CALLED: NONE 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE RESLTNR Subroutine Author : JL GREEN Version Number : V1.4 Date : 27-JAN-1982 Documented By : RL WEST Reviewed : 27-DEC-1989 1. PURPOSE: Prompts the user for the number of subperiods per frame. 2. ORGANIZATION: 1. Calculate the frame duration in minutes. 2. Displays the number of default subperiods based on the frame duration, and allows the user to change it if desired. 3. EXAMPLE CALL: CALL RESLTNR (IDMS,NDIV) 3.1 ARGUMENTS: Argument : IDMS Type : REAL*8 Dimension : 1 Purpose : INPUT: The frame duration in microseconds. Argument : NDIV Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: The number of subperiods per frame. 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: NONE 6. SUBROUTINES CALLED: IASK 7. CALLED BY: FRASETR 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE REWDED Subroutine Author : JFE JOHNSON, BARRY LEE, RL WEST Version Number : 2.0 Date : SEP-1989 Documented By : RL WEST Reviewed : 28-DEC-1989 1. PURPOSE: To rewind the MF1 file. 2. ORGANIZATION: Rewinds the MF1 file. 3. EXAMPLE CALL: CALL REWDED 3.1 ARGUMENTS: NONE 3.2 COMMONS: /DELUNS/JLUN,JUNIN,JUNOUT Argument : JLUN Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number for MF1 data input (usually 1). Argument : JUNIN Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number for terminal input (usually 5). Argument : JUNOUT Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number for terminal output (usually 6). 3.3 FILES REQUIRED: The MF1 file to be rewound. 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: REWDED is an entry point in DELUNS. 6. SUBROUTINES CALLED: NONE 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE RPASET Subroutine Author : JFE JOHNSON Version Number : 1.1 Date : 10-DEC-1982 Documented By : RL WEST Reviewed : 04-JAN-1990 1. PURPOSE: Prompts for the minimum and maximum RPA settings over which to collect the data. 2. ORGANIZATION: Prompts for the minimum and maximum RPA settings. 3. EXAMPLE CALL: CALL RPASET (IRPA1,IRPA2) 3.1 ARGUMENTS: Argument : IRPA1 Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: The minimum RPA setting. Argument : IRPA2 Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: The maximum RPA setting. 3.2 COMMONS: /DELUNS/LUNDAT,LUNTI,LUNTO Argument : LUNDAT Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number for MF1 data input (usually 1). Argument : LUNTI Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number of terminal input (usually 5). Argument : LUNTO Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number of terminal output (usually 6). 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: A entered in responce to the prompt will stop execution of the program. 6. SUBROUTINES CALLED: NONE 7. CALLED BY: NONE 8. LOCATION AND NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE SORT Subroutine Author : JFE JOHNSON Version Number : 1.0 Dated : AUG-81 Documented by : RL WEST Reviewed : 05-DEC-1990 1. PURPOSE: Sorts an integer array of values into positive ascending order. 2. ORGANIZATION Sort the data by a bubble sort. 3. EXAMPLE CALL: CALL SORT (IA,N) 3.1 ARGUMENTS: Argument : IA Type : INTEGER*2 Dimension : N Purpose : INPUT/OUTPUT: Array containing values to be sorted/the sorted array. Argument : N Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Dimension of IA. Indicates how many values in the sort array to be sorted. 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: NONE 6. SUBROUTINES CALLED: NONE 7. CALLED BY: NONE 8. NOTES ON INPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE SRTANG Subroutine Author : JFE JOHNSON Version Number : 1.2 Date : 14-SEP-1982 Documented By : RL WEST Reviewed : 10-JAN-1990 1. PURPOSE: To sort and accumulate the counts per sample as a function of RAM angle for a given head and mass channel combination, RPA range, and MASS setting range. 2. ORGANIZATION: 1. Call routine to get the spin rate (degrees/sample) and the RAM reference angle. 2. Determine which head is being requested. 3. See if RPA for this sample is within RPA range. 4. If not Electrometer, see if mass of this sample is within MASS range. 5. If Z head, see if proper head/channel combination for this sample. 6. Calculate the RAM angle bin of this sample. 7. Log decompress the data. 8. Add the counts/sample of this sample to the element in CTS that corresponds to the proper angle bin. 9. Increment the number of samples in the element in ICTN that correspond to the proper angle bin. 3. EXAMPLE CALL: CALL SRTANG (MODBLK,CTS,ICTN,NANG,I1,I2,JFLAG) 3.1 ARGUMENTS: Argument : MODBLK Type : INTEGER*2 Dimension : 8 Purpose : INPUT: Array containing the data collection requirements: 1 = head (1=radial,2=+Z,3=-Z) 2 = mass channel (1=low mass,2=high mass) 3 = lower mass setting 4 = higher mass setting 5 = lower RPA setting 6 = higher RPA setting 7 = lower RAM angle 8 = higher RAM angle Argument : CTS Type : REAL Dimension : 360 Purpose : OUTPUT: The array containing the accumulated counts per sample as a function of angle bin. Argument : ICTN Type : INTEGER*2 Dimension : 360 Purpose : OUTPUT: The array containing the accumulated number of samples, as a function of angle bin, that went into comprising the data collected in the array CTS. Argument : NANG Type : INTEGER*2 Dimension : 1 Purpose : INPUT: The number of angle bins into which to sort the data. Argument : I1 Type : INTEGER*2 Dimension : 1 Purpose : INPUT: The first sample of this record to be used in the data accumulation. Argument : I2 Type : INTEGER*2 Dimension : 1 Purpose : INPUT: The last sample of this record to be used in the data accumulation. Argument : JFLAG Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: Return flag: 0 = no data added to the array CTS 1 = data added to the array CTS 3.2 COMMONS: /MAF1/IDAT Argument : IDAT Type : INTEGER*2 Dimension : 2812 Purpose : INPUT: The array containing the data of the current input record. /RPAMSH/JRPA,JMSH Argument : JRPA Type : INTEGER*2 Dimension : (32,2,8) Purpose : INPUT: Array containing the 512 RPA values. Argument : JMSH Type : INTEGER*2 Dimension : (32,2,8) Purpose : INPUT: Array containing the 512 MASS values. 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: Suppose it is desired to sort the data into 1 degree bins, then NANG will be 360 (360/1), there will be 360 angle bins and the entire data storage arrays will be filled. However, suppose 5 degree bins are desired, then NANG will be 72 (360/5), there will be 72 angle bins and the data storage arrays will be only partially filled. The maximum number of angle bins is 360 or 1 degree resolution. 6. SUBROUTINES CALLED: IDCODC,IGTZMS,IANGLN,REFANG 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE SRTRP2 Subroutine Author : JFE JOHNSON Version Number : 1.0 Date : 22-0CT-1982 Documented By : RL WEST Reviewed : 05-JAN-1990 1. PURPOSE: To sort and accumulate the counts per sample as a function of RPA value for a given head and mass channel combination, RAM angle range, and MASS setting range. 2. ORGANIZATION: 1. Call routine to get the spin rate (degrees/sample) and the RAM reference angle. 2. Determine which head is being requested. 3. Calculate the RAM angle of this sample. 4. See if angle within angle range. 5. See if mass of this sample within MASS range. 6. If Z head, see if proper head/channel combination for this sample. 7. Determine the element in IRPA that corresponds to the RPA setting for this sample. 8. Log decompress data. 9. Add the counts/sample of this sample to the element in CTS that corresponds to the one in IRPA. 10. Increment the number of samples in the element in ICTN that correspond to the one in IRPA. 3. EXAMPLE CALL: CALL SRTRP2 (MODBLK,CTS,ICTN,I1,I2,JFLAG,IRPA,NDIF) 3.1 ARGUMENTS: Argument : MODBLK Type : INTEGER*2 Dimension : 8 Purpose : INPUT: Array containing the data collection requirements: 1 = head (1=radial,2=+Z,3=-Z) 2 = mass channel (1=low mass,2=high mass) 3 = lower mass setting 4 = higher mass setting 5 = lower RPA setting 6 = higher RPA setting 7 = lower RAM angle 8 = higher RAM angle Argument : CTS Type : REAL Dimension : 32 Purpose : OUTPUT: The array containing the accumulated counts per sample as a function of RPA setting. Argument : ICTN Type : INTEGER*2 Dimension : 32 Purpose : OUTPUT: The array containing the accumulated number of samples, as a function of RPA setting, that went into comprising the data collected in the array CTS. Argument : I1 Type : INTEGER*2 Dimension : 1 Purpose : INPUT: The first sample of this record to be used in the data accumulation. Argument : I2 Type : INTEGER*2 Dimension : 1 Purpose : INPUT: The last sample of this record to be used in the data accumulation. Argument : JFLAG Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: Return flag: 0 = no data added to the array CTS 1 = data added to the array CTS Argument : IRPA Type : INTEGER*2 Dimension : NDIF Purpose : INPUT: The array containing the sorted unique RPA values. Argument : NDIF Type : INTEGER*2 Dimension : 1 Purpose : INPUT: The dimension of IRPA, and the number of unique RPA values. 3.2 COMMONS: /MAF1/IDAT Argument : IDAT Type : INTEGER*2 Dimension : 2812 Purpose : OUTPUT: The array containing the data of the current input record. /RPAMSH/JRPA,JMSH Argument : JRPA Type : INTEGER*2 Dimension : (32,2,8) Purpose : INPUT: Array containing the 512 RPA values. Argument : JMSH Type : INTEGER*2 Dimension : (32,2,8) Purpose : INPUT: Array containing the 512 MASS values. 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: This cannot be used to collect data from the Electrometer. 6. SUBROUTINES CALLED: IDCODC,IGTZMS,ISANGL,REFANG 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE SUBOPTR Subroutine Author : RL WEST Version Number : 1.0 Date : 04-JAN-1990 Documented By : RL WEST Reviewed : 04-JAN-1990 1. PURPOSE: To output the current subperiod time limits to the logical unit number desired. 2. ORGANIZATION: 1. Set the REAL*8 subperiod time limits to INTEGER*4. 2. Convert milliseconds to hours,minutes,seconds,milliseconds. 3. Write to logical unit desired. 3. EXAMPLE CALL: CALL SUBOPTR (LUN) 3.1 ARGUMENTS: Argument : LUN Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number for the output. 3.2 COMMONS: /COMLIM/STRIP_TIMES Argument : STRIP_TIMES Type : REAL*8 Dimension : 4 Purpose : INPUT: The start YDOY and microseconds and stop YDOY and microseconds of the current subperiod. 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: NONE 6. SUBROUTINES CALLED: MSHMSM 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. SUBROUTINE SUBSETR Subroutine Author : RL WEST Version Number : 1.0 Date : 06-APR-1989 Documented By : RL WEST Reviewed : 08-JAN-1990 1. PURPOSE: Prompts for the duration and increment of the subperiods when they are not defined by a call to DEFFRAR. 2. ORGANIZATION: 1. Prompt for duration and increment of subperiods. 2. Reset initital subperiod stop time. 3. Put times in common. 3. EXAMPLE CALL: CALL SUBSETR (KODE) 3.1 ARGUMENTS: Argument : KODE Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: Return code: -1 = end of job 0 = successfull input 3.2 COMMONS: /COMLIM/STRIP_TIMES Argument : STRIP_TIMES Type : REAL*8 Dimension : 4 Purpose : INPUT/OUTPUT: Contains the subperiod start YDOY, MICROSECONDS of day and stop YDOY,MICROSECONDS of day. /COMTMS/RUN_TIMES,INC,DUR Argument : RUN_TIMES Type : REAL*8 Dimension : 4 Purpose : INPUT: Contains the run start YDOY,MICROSECONDS of day and stop YDOY,MICROSECONDS of day. Argument : INC Type : REAL*8 Dimension : 1 Purpose : OUTPUT: Increment of time (microseconds) between the start time of each subperiod. Argument : DUR Type : REAL*8 Dimension : 1 Purpose : OUTPUT: Duration of time (microseconds) of each subperiod. /DELUNS/LUNDAT,LUNIN,LUNOUT Argument : LUNDAT Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number for MF1 data input (usually 1). Argument : LUNIN Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number for terminal input (usually 5). Argument : LUNOUT Type : INTEGER*2 Dimension : 1 Purpose : INPUT: Logical unit number for terminal output (usually 6). 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: The duration is the length of each subperiod and the increment is the time between the start times of consecutive subperiods. Entering a at the prompt will cause the program to stop execution. It is recommended that the increment always be greater that or equal to the duration otherwise a call to REWDED will have to be issued when done with each subperiod. 6. SUBROUTINES CALLED: ADDTM2R 7. CALLED BY: NONE 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4 SUBROUTINE THMS Subroutine Author : JFE JOHNSON Version Number : 1.0 Date : 13-FEB-1981 Documented By : RL WEST Reviewed : 28-DEC-1989 1. PURPOSE: To convert a time in the form HHMMSS to HH, MM, and SS. 2. ORGANIZATION: 1. Calculate the hours. 2. Calculate the minutes. 3. Calculate the seconds. 3. EXAMPLE CALL: CALL THMS (ITIME,IHR,IMN,ISC) 3.1 ARGUMENTS: Argument : ITIME Type : INTEGER*4 Dimension : 1 Purpose : INPUT: The time in the form HHMMSS. Argument : IHR Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: The calculated hours. Argument : IMN Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: The calculated minutes. Argument : ISC Type : INTEGER*2 Dimension : 1 Purpose : OUTPUT: The calculated seconds. 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: ITIME must have all trailing 0's(zeroes). If ITIME less than 0(zero) or greater than 235959 all output arguments will be returned as 0(zero). 6. SUBROUTINES CALLED: NONE 7. CALLED BY: LMSSETR 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4 SUBROUTINE TIMDIF Subroutine Author : RL WEST Version Number : 1.0 Date : 03-JUL-1986 Documented By : RL WEST Reviewed : 04-JAN-1990 1. PURPOSE: To calculate the difference in milliseconds of (YD1,T1) - (YD2,T2). 2. ORGANIZATION: 1. Calculate T1-T2. 2. Check for day crossings. 3. Check for year crossings. 3. EXAMPLE CALL: CALL TIMDIF (IYD1,IT1,IYD2,IT2,IDIF) 3.1 ARGUMENTS: Argument : IYD1 Type : INTEGER*4 Dimension : 1 Purpose : INPUT: The first year and day of year. Argument : IT1 Type : INTEGER*4 Dimension : 1 Purpose : INPUT: The first milliseconds of day. Argument : IYD2 Type : INTEGER*4 Dimension : 1 Purpose : INPUT: The second year and day of year. Argument : IT2 Type : INTEGER*4 Dimension : 1 Purpose : INPUT: The second milliseconds of day. Argument : IDIF Type : INTEGER*4 Dimension : 1 Purpose : OUTPUT: The difference in milliseconds of (YD1,T1) - (YD2,T2). 3.2 COMMONS: NONE 3.3 FILES REQUIRED: NONE 4. ENTRY POINTS: NONE 5. ADDITIONAL INFORMATION / SIDE EFFECTS: NONE 6. SUBROUTINES CALLED: NONE 7. CALLED BY: ORBOFTR 8. NOTES ON IMPLEMENTATION: Compatible with VAX and PDP systems. Compile /NOI4. CCSD$$MARKERmarkercc