C+ C NAME: C xc3dtshift_rrms.f C PURPOSE: C To provide a shift matrix to determine the approximate propagation from RR to the lower magnetic surface. C C CATEGORY: C I/O C CALLING SEQUENCE: C call xc3dtshift_rrms(iPrint,mode,nLng,nLat,nMap,nT,RR,dRR,RADMS,XCshift,XCshift3,XCshiftM) C C INPUTS: C iPrint integer iPrint = 1, print confirmation C mode integer mode = 0, transfer XCshift to XCshift3, mode .gt. 0 , don't transfer C nLng integer Number of Longitude bins C nLat integer Number of Latitude bins C nMap integer Number of Map heights C nT integer Number of times in written out nson files (used in MAPCOORDINATES.H) C RRS real Beginning Height of the 3D-MHD modeling C dRR real Outward step height of the modeling C RADMS real Beginning Height of the Magnetic Field pick-up C XCshift (nLng,nLat,nMap,nT,3)real XCshift matrix to get back to tomography base C XCshift3(nLng,nLat,nMap,nT,3)real XCshift matrix to get back to tomography base (external version) C C OUTPUTS: C XCshiftM(nLng,nLat,nT,3) real XCshiftM matrix to provide increments to get down to the magnetic field base C MODIFICATION HISTORY: C November-2015, Bernard Jackson (UCSD) C-C3DTN subroutine xc3dtshift_rrms(iPrint,mode,nLng,nLat,nMap,nT,RR,dRR,RADMS,XCshift,XCshift3,XCshiftM) real XCshift (nLng,nLat,nMap,nT,3) real XCshift3(nLng,nLat,nMap,nT,3) real XCshiftM(nLng,nLat,nT,3) if(iPrint.eq.1) then print *, ' ' write(*,'(A,4I5)') 'Inside xc3dtshift_rrms, nLng, nLat, nMap, nT',nLng, nLat, nMap, nT end if BAD = badR4() XBOTFRAC = (RR-RADMS)/dRR ! fraction of way from RADMS to RSS tomography surface relative to dRR if(iPrint.eq.1) write(*,'(A,4F10.6)') 'XBOTFRAC, RR, RADMS, dRR', XBOTFRAC, RR, RADMS, dRR do I=1, nLng do J=1, nLat do L=1, nT do NX=1,3 if(XCshift(I,J,2,L,NX) .ne. Bad) then XCshiftM(I,J,L,NX) = XCshift(I,J,2,L,NX)*XBOTFRAC ! This places the approximate trace increment to RADMS else XCshiftM(I,J,L,NX) = Bad end if end do end do end do end do if(mode.eq.0) then do I=1, nLng do J=1, nLat do N=1, nMap do L=1, nT do NX=1,3 XCshift3(I,J,N,L,NX) = XCshift(I,J,N,L,NX) if(iPrint.eq.1) then if(NX.eq.1.and.J.eq.5.and.I.eq.30.and.N.eq.2) & write(*,'(A,4I4,2F12.8)'), 'In xc3dtshift_rrms.f',I,J,L,NX,XCshift(I,J,2,L,NX),XCshiftM(I,J,L,NX) if(NX.eq.3.and.J.eq.5.and.I.eq.30.and.N.eq.2) & write(*,'(A,4I4,2F12.8)'), 'In xc3dtshift_rrms.f',I,J,L,NX,XCshift(I,J,2,L,NX),XCshiftM(I,J,L,NX) end if end do end do end do end do end do end if if(iPrint.eq.1) then write(*,'(A,I2)')'End of xc3dtshift_rrms. Mode =', mode print *, ' ' end if return end