real*8 function vmarea ( betap, model, yawmode ) C C******************************************************************************* C C Copyright (C) 1993, California Institute of Technology. U.S. C Government Sponsorhip under NASA Contract NAS7-918 is C acknowledged. C C******************************************************************************* C C Calculate the VMA Area of the Satellite C C Revision Log C C 4/21/94 Correct typo VMARAEA for VMAREA in 'CONSTANT' C area section C C 12/6/94 add second vma tab for fixed yaw values C double precision betap,vmatab(3,-90:90), betalo,betahi,alo,ahi, * RESULT,x1,x2,xtemp, careas(2), breakpts(2), * vmatab_FY(3,-90:90), careas_FY(2), * breakpts_FY(2) character model*4 integer nvmatabs common /vma/vmatab, careas, breakpts, vmatab_FY, & careas_FY, breakpts_FY, nvmatabs common /dragblock/ dragmodel, dragarea, atmos, atden character*10 dragmodel, atmos double precision dragarea, atden character*2 yawmode logical first data first/.true./ IF (DRAGMODEL .EQ. 'CONSTANT') THEN VMAREA = DRAGAREA if (first) then write(8,*) 'Using Constant Satellite Area.' first = .false. end if RETURN ELSE IF (DRAGMODEL .NE. 'VMA') THEN WRITE(8,*) 'INVALID DRAGMODEL = ', DRAGMODEL STOP '>>>>> ERROR EXIT.' END IF if (first) then write(8,*) 'Using VMA Model for Satellite Area.' first = .false. end if if (model.eq.'DRAG') then iarea = 2 else if (model(1:3).eq.'SRP') then iarea = 3 else write(8,*) 'Invalid VMA model = ',model write(8,*) 'Valid models = DRAG, SRP' stop '?? VMA Error Exit.' end if C C interpolate between two successive values. Find bounding values C in table. if ( model .eq. 'DRAG') then if ((nvmatabs.eq.1) .or. (yawmode.eq.'YS')) then if ( dabs(betap) .le. breakpts(1) ) then result = careas(1) goto 9999 else if ( dabs(betap) .ge. breakpts(2) ) then result = careas(2) goto 9999 end if else if ( dabs(betap) .le. breakpts_FY(1) ) then result = careas_FY(1) goto 9999 else if ( dabs(betap) .ge. breakpts_FY(2) ) then result = careas_FY(2) goto 9999 end if end if end if jlow = -100 C do j=-90,89 C x1 = vmatab(1,j) C x2 = vmatab(1,j+1) C if (x2.lt.x1) then C xtemp = x1 C x1 = x2 C x2 = xtemp C end if C C if ( (x1.le.betap).and.(betap.le.x2)) then C jlow = j C jhi = j+1 C end if C C end do jlow = int(betap) jhi = jlow+1 if ( (jlow .lt. -90).or.(jhi.gt.90)) then write(8,*) 'Invalid Betap = ',betap stop 'Invalid Betap in VMA model.' end if C C determine beta primes and areas for interpolation into table C IF ( (nvmatabs .eq. 1) .or. (YAWMODE .eq. 'YS') ) then betalo = vmatab(1,jlow) betahi = vmatab(1,jhi) alow = vmatab(iarea, jlow) ahi = vmatab(iarea, jhi) else betalo = vmatab_FY(1,jlow) betahi = vmatab_FY(1,jhi) alow = vmatab_FY(iarea, jlow) ahi = vmatab_FY(iarea, jhi) end if C C linearly interpolate for the area C RESULT = alow + (ahi-alow)*(betap-betalo)/(betahi-betalo) 9999 continue VMAREA = RESULT return end