c $Id: new_refcalc.f,v 1.1 2009/03/21 03:50:34 wil844 Exp wil844 $ subroutine new_refcalc( site, refsite, source, freq_MHz, 1 utctag, utcsec, 1 int_delay, fract_delay, drate, 1 uvw, duvw ) c Inputs: site, refsite, source, utctag, utcsec c c Outputs: int_delay = integer part of delay in microseconds c fract_delay = fractional part of delay in microseconds c drate = delay rate in microseconds/second c uvw = u,v,w in meters c duvw = u,v,w rates in meters/second c Use calc to get delays from station to reference site implicit none c Inputs character*(*) site, refsite, source integer*2 utctag(*) real*8 freq_MHz, utcsec c Outputs real*8 int_delay, fract_delay, drate, uvw(*), duvw(*) c COMMON AREAS c Following is required to extract tropospheric delays include 'CALCDB.i' c Following is required to extract UVW terms c include 'situvw.i' Dec 2007 - Not any more - Now done with PUTs c LOCAL integer*4 i character*8 c8sit(2), c8src real*8 del(3) real*8 trop_delay, trop_rate real*8 int_trop_delay, fract_trop_delay c BEGIN c c8sit(1) = 'LBAREF ' c8sit(1) = refsite c8sit(2) = site c8src = source c Overwrite values set in DBCOM() ndelay = 1 reffre(1) = freq_MHz call tbcalc( c8sit, c8src, utctag, utcsec, del, drate ) c print *, ' REFCALC: dels= ', del(1), del(2), ' Rate= ', drate c Get tropospheric contributions from CALCDB.I - to site 2 only - in usec trop_delay = ( NDRYCONT(2,1) + NWETCONT(2,1) ) * 1.0D06 int_trop_delay = AINT( trop_delay ) fract_trop_delay = trop_delay - int_trop_delay trop_rate = ( NDRYCONT(2,2) + NWETCONT(2,2) ) * 1.0D06 c print *, ' TROP: Delay = ', trop_delay, ' Rate = ', trop_rate c TEMPORARY - TESTING !!!!!!!!!!!!!!!!!!!!!!!!!!!! c trop_delay = 0.0 c trop_rate = 0.0 c print *, ' SETTING TROP. Delays/Rates to zero for TESTING' c Calculate final delays - Negate to get SITE-LBAREF delay, but at LBAREF time int_delay = -( del(1) + int_trop_delay ) fract_delay = -( del(2) + fract_trop_delay ) drate = -( drate + trop_rate ) c TEMPORARY !!!!!!!! - TESTING c Print out tropospheric corrections - for site 2 c print 1111, NDRYCONT(1,1)*1.D6, NWETCONT(1,1)*1.D6, c 1 NDRYCONT(1,2)*1.D12, NWETCONT(1,2)*1.D12 c1111 format( ' TROPO(DRY,WET)-DELAYSus ', 2E10.3, c 1 ' -RATESps/s ', 2E10.3 ) c print 2222, NDRYCONT(2,1)*1.D6, NWETCONT(2,1)*1.D6, c 1 NDRYCONT(2,2)*1.D12, NWETCONT(2,2)*1.D12 c2222 format( ' TROPO(DRY,WET)-DELAYSus ', 2F10.6, c 1 ' -RATESps/s ', 2F10.6 ) c c Get site UVWs do i = 1, 3 uvw( i ) = luvwp( i ) duvw( i ) = luvwv( i ) end do return end