C+ C NAME: C MkGModel C PURPOSE: C Make model line of sight G-levels from a density map at a given height. C CATEGORY: C Data processing C CALLING SEQUENCE: subroutine MkGModel(XCbeg,XCend,XLON,XLAT,RP,WTS2,DFAC,PW,DEN1AU,NL, & NLOS,NLOSP1,DMAP,nLng,nLat,DREF,GM2,GWTij,GMWTij,GMWTi) C INPUTS: C XCbeg real Beginning Carrington Rotation value C XCend real Ending Carrington Rotation value C XLON(NLOSP1,NL) integer Projected Carr. rot. value of point on L.O.S. C XLAT(NLOSP1,NL) integer Heliographic lat. (in deg.) point on L.O.S. C RP (NLOSP1,NL) real Distance above Sun of point on L.O.S. C WTS2(NLOS ,NL) real Weights of each point along the L.O.S. C DFAC(NLOSP1,NL) real Density factors for each L.O.S. point C PW real Density power C DEN1AU real Average density at 1 AU C NL integer Number of G-level data points C NLOS integer Number of L.O.S. distance segments C NLOSP1 integer Number of L.O.S. distance segments + 1 C DMAP(nLng,nLat) real Density map C nLng integer Number of longitude points in DMAP C nLat integer Number of latitude points in DMAP C DREF real Height of density reference map C OUTPUTS: C GM2(NL) real Model G-levels for a given source C GWTij(NLOS ,NL) real Value weights C SCRATCH ARRAYS: C GMWTij(NLOS,NL) real C GMWTi(NL) real C CALLS: C BadR4, Get2Dval C PROCEDURE: C Following, a latex file containing the scintillation C index value m and the weighting function. C Line-of-sight integration C C Scintillation index \\ C $$ m^2 = \int dz W(z) $$ C Weighting function \\ C $$ W(z) = (\Delta N_e(z))^2 \int dq C \sin^2(\frac{q^2\lambda z}{4\pi}) C \exp(-\frac{\theta_o^2 q^2 z^2}{2}) C q^{-3} $$ C MODIFICATION HISTORY: C NOV, 1995 B. Jackson (STEL,UCSD) C- integer NL integer NLOS integer NLOSP1 real XCbeg real XCend real XLON(NLOSP1,NL) ! Projected Carr. rot. value of point on L.O.S. real XLAT(NLOSP1,NL) ! Heliographic lat. (in deg.) point on L.O.S. real RP (NLOSP1,NL) ! Distance above Sun of point on L.O.S. real WTS2(NLOS ,NL) ! Weights of each point along the L.O.S. real DFAC(NLOSP1,NL) ! Density factors for each L.O.S. point real PW real DEN1AU integer nLng integer nLat real DMAP(nLng,nLat) ! Density map real DREF real GM2 ( NL) ! Model G-levels for a given source real GWTij (NLOS,NL) real GMWTij(NLOS,NL) ! Scratch arrays real GMWTi ( NL) BADD = BadR4() R1AU = 1. do I=1,NL GMWTi(I) = 0. DMTOT = 0. do J=1,NLOS XLON(J,I) = max(XCbeg,min(XCend,XLON(J,I))) call Get2Dval(XCbeg,XCend,nLng,nLat,DMAP,1,XLON(J,I),XLAT(J,I),DENj) if (DENj .eq. BADD) stop 'Bad density in MkGModel' DENj = DENj*DFAC(J,I)*((DREF/RP(J,I))**2) ! Density at L.O.S. position GWTij(J,I) = (DENj**(2.0*PW))*WTS2(J,I) ! g^2 value at L.O.S. position !GWTij(J,I) = (DENj**(2.0*PW))*WTS2(J,I)*cosd(XLAT(J,I)) DENMj = DEN1AU*((R1AU/RP(J,I))**2) ! mean density at L.O.S. position !DRAT(J,I) = DENj GMWTij(J,I) = (DENMj**(2.0*PW))*WTS2(J,I) ! ^2 value at L.O.S. position !GMWTij(J,I) = (DENMj**(2.0*PW))*WTS2(J,I)*cosd(XLAT(J,I)) GMWTi(I) = GMWTi(I) + GMWTij(J,I) ! Sum of L.O.S. ^2 value !DMTOT = DMTOT + DENMj end do end do do I=1,NL GM2(I) = 0.0 !------- ! Scintillation index line of sight integration for both the modeled ! density weighting (GWTij) and the mean density weighting (GMWTij). do J=1,NLOS GWTij(J,I) = GWTij(J,I)/GMWTi(I) GM2(I) = GM2(I) + GWTij(J,I) end do !print *, 'I, GM2(I)', I, GM2(I) end do do I=1,NL do J=1,NLOS GWTij(J,I) = GWTij(J,I)/GM2(I) end do end do return end