C+ C NAME: C ConvertG2D C PURPOSE: C Make a density map at a given height from a G-level map from the C Hick et al. map technique. C CATEGORY: C Data processing C CALLING SEQUENCE: subroutine ConvertG2D(ID,N,G,D,RR,D1AU,PW) C INPUTS: C ID integer mode - 0=standard, 1=input conversion C N integer # data points C G(N) real G-levels C RR real Reference distance (AU) C D1AU real 1 AU density C PW real Power C OUTPUTS: C D(N) real Density map at height RR C CALLS: C BadR4, GTODEN C PROCEDURE: C Values in G = BadR4() are not converted (D is set to BadR4()). C iGfnc = 0 (n=G) C iGfnc = 1 (Tappin, n=9xG^2) C iGfnc = 2 (n=10.4xG^3.4) C iGfnc = 3 (n=9.5xG^5.1) C MODIFICATION HISTORY: C NOV, 1995 B. Jackson (STEL,UCSD) C- integer ID integer N real G(N) ! G-levels at a given height RR real D(N) ! Densities at height RR real RR real D1AU real PW parameter (iGfnc = 2) !$omp parallel private(Bad,DD,P,I) Bad = BadR4() DD = 1./(RR*RR) ! 1/r^2 scaling for density if (ID .eq. 0) then !$omp do schedule(static) do I=1,N if (G(I) .eq. Bad) then D(I) = Bad else D(I) = DD*GTODEN(iGfnc,G(I)) end if end do !$omp end do nowait else DD = DD*D1AU P = 1/PW !$omp do schedule(static) do I=1,N if (G(I) .eq. Bad) then D(I) = Bad else D(I) = DD*G(I)**P end if end do !$omp end do nowait end if !$omp end parallel return end