cnv_time_energy (ul_crg)

	status.i4.v = cnv_time_energy(time.r4.r, energy.r4.r, convert_type.i4.v,
				      file_number.i4.v)

	This routine returns a time when given a Tevatron energy or a 
	Tevatron energy when given a time.

       If the input time is positive for a CNV_TIME_TO_ENERGY, 
         it returns the energy on the accelerate ramp for 
         the (time after $42). $42 is Start of Ramp. 
       If the input time is negative for a CNV_TIME_TO_ENERGY, 
         it returns the energy on the decelerate ramp for 
         the (abs(time) after $6D). $6D is Start of Deceleration.

       If the input energy is positive for a CNV_ENERGY_TO_TIME, 
         it returns the (time after a $42) when the ramp reaches 
         that energy on the accelerate ramp. 
         For the injection energy, this returns 0.
         For 90 Gev,this returns the negative of the time it takes to ramp
            from 90 Gev to the injection energy.
       If the input energy is negative for a CNV_ENERGY_TO_TIME, 
         it returns the (time after a $6D) when the ramp leaves
         that energy on the decelerate ramp. 
 
       For the new types CNV_TIME_TO_ENERGY_41 and CNV_ENERGY_TO_TIME_41,
       this will do what this routine used to do, assume the times are 
       relative to a $41. Again for a negative energy input for 
       CNV_ENERGY_TO_TIME_41, the time will be when the decelerate ramp 
       reaches the abs(energy). 


	time		time in seconds
	energy		Tevatron energy in GeV
	convert_type	(CNV_TIME_TO_ENERGY -> convert time to energy,
			 CNV_ENERGY_TO_TIME -> convert energy to time,
                        CNV_TIME_TO_ENERGY_41 -> convert time ($41) to energy,
			 CNV_ENERGY_TO_TIME_41 -> convert energy to time($41))
	file_number	If not <= 0, use this file for the data source rather
			than the active file

	This function returns ACNET status values as follows:

	CBS_OK			success
	CBS_BUGCHK		conversion table is invalid
       CBS_MATH_EXCEPTION      Math exception
	DBM_xxx			database error

	This function requires the following include files:

	ul_crg_h:crg_h, acnet_errors_h

	Related functions:

	crg_param_read, crg_tecar_read, crg_read_tuner, crg_read_b2min_slope,
	crg_active_file, crg_tecar_c_to_ftn