C+ C NAME: C Mk_D2V C PURPOSE: C Make a velocity map at the density map surface if there is none available C CATEGORY: C Data processing C CALLING SEQUENCE: subroutine Mk_D2V(NN,DD,VV,D1AU,RR) C INPUTS: C DD(N) real Density map C N integer # data points C D1AU real 1 AU density C RR real Velocity map reference height C OUTPUTS: C VV(N) real Velocity map C CALLS: C BadR4 C PROCEDURE: C Bad values (indicated by BadR4()) are not processed C MODIFICATION HISTORY: C NOV, 1995 B. Jackson (STEL,UCSD) C AUG-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu) C Made NN a read-only variable. C- integer NN real DD(*) ! Density map real VV(*) ! Velocity map real D1AU real RR real V0 /400./ ! Standard velocity Bad = BadR4() D = 0.0 ! Determine average density N = 0 do I=1,NN if (DD(I) .ne. Bad) then D = D+DD(I) N = N+1 end if end do D = D/N V0 = V0*sqrt(D) do I=1,NN ! Make velocity map if (DD(I) .eq. Bad) then VV(I) = Bad else VV(I) = V0/sqrt(DD(I)) end if end do return end