C+ C NAME: C Fill-in C PURPOSE: C To fill Maps over heights from maps at the other times, and spatially using C programs fillwholet, FillMapL, and GridSphere2D. This is a driver program C used several places in the main tomography program and elsewhere. C When this is evoked all the time values in a given map C need to be copied from a nearby map. Hopefully, this C Needs only be done at the edges of the times reconstructed C or at some initiation stage of the program. This subroutine C was originally placed as in-line code in the main program. C C CATEGORY: C Data processing C CALLING SEQUENCE: C subroutine Fill_in(Mode,Nit,NiterT,XCbe,nLng,nLat,nMap,nT,nTmax,ConsTM,ConstL,CONRD,CONDT,aNdayG,DUMMY1,DUMMY3) C INPUTS: C Mode integer 0 - density C 1 - velocity C Nit integer iteration number C NiterT integer Total number of iterations C XCbe(2,NT) real Beginning (and ending) rotation values C nLng integer # of Longitudes C nLat integer # of Latitudes C nMap integer # of heights C nT integer # of times C nTmax integer # of times C ConsTM real Longitude filter constant (in terms of the numbers of intervals in one rotation) C ConstL real Currently nLng/3 from main program C CONRD real Gaussian density (or velocity) spatial smoothing filter C CONDT real Gaussian density (or velocity) temporal smoothing filter C aNdayG real C DUMMY1(nLng,nLat,nMap,nT) real mode 0 input, density or temperature is input C DUMMY3(nLng,nLat,nMap,nT,3) real mode 1 input, velocity or magnetic field is input C SCRATCH ARRAY: C DDD(nLng) C OUTPUTS: C DUMMY1(nLng,nLat,nMap,nT) real mode 0 output, density or temperature is input C DUMMY3(nLng,nLat,nMap,nT,3) real mode 1 output, velocity or magnetic field is input C FUNCTIONS/SUBROUTINES: C arrR4getminmax, FillMaptN C PROCEDURE: C Bad values (indicated by BadR4()) are processed C MODIFICATION HISTORY: C MAY, 1999 B. Jackson (STEL,UCSD) C- C subroutine FillWholeT(Mode,Nit,NiterT,XCbe,nLng,nLat,nT,ConsTM,ALng,DMap,DDD) C real DMap(nLng,nLat,nT), ! Map ) C & XCbe(2,nT) C real DDD(nLng) ! scratch array C subroutine Fill_in(Mode,Nit,NiterT,XCbe,nLng,nLat,nMap,nT,nTmax,ConsTM,ConstL,ALng,CONRD,CONDT,aNdayG,DUMMY1,DUMMY3) real DUMMY3(nLng,nLat,nMap,nTmax,3) ! If velocity or magnetic field is input, this map is filled. real DUMMY1(nLng,nLat,nMap,nTmax) ! If density or temperature is input, this map is filled. real XCbe(2,nTmax) real DDD(nLng) ! scratch array real Dtmp(nLng,nLat,nTmax) ! scratch array real DUMMY0(nLng,nLat,nTmax) ! scratch array used for specific input from DUMMY1, DUMMY3 write(*,'(A,I3)') 'Into Fill_in.f. Mode =',Mode if(Mode.eq.0.or.Mode.eq.10) Moden = 0 if(Mode.eq.1.or.Mode.eq.30) Moden = 1 if(Moden.eq.0) IXN = 1 if(Moden.eq.1) IXN = 3 do IX=1,IXN do NN=1,nMap do I=1,nLng do J=1,nLat do N=1,nT if(Moden.eq.0) DUMMY0(I,J,N) = DUMMY1(I,J,NN,N) ! single component input. Fill, DUMMY0 accordingly. if(Moden.eq.1) DUMMY0(I,J,N) = DUMMY3(I,J,NN,N,IX) ! three components input. Fill, DUMMY0 accordingly. end do end do end do C call FillWholeT(1,Nit,NiterT,XCbe,nLng,nLat,nTG,ConsTM,VMAPD,DDD) call FillWholeT(Moden,Nit,NiterT,XCbe,nLng,nLat,nT,ConsTM,DUMMY0,DDD) ! needs to know moden do N=1,nT C call arrR4getminmax(nLngLat,DUMMY0(1,1,N),amin,amax) C print *, 'Before Grids MkShiftdn0n DUMMY0 min max N',amin,amax,N if(NN.eq.2.and.N.eq.3) write(*,'(A,3I4,2F15.5)'), 'Before 1st FillMapL(3)', IX,NN,N, DUMMY0(nLng,5,N),DUMMY0(20,5,N) call FillMapL(2,XCbe(1,N),XCbe(2,N),nLng,nLat,ConstL,DUMMY0(1,1,N)) if(NN.eq.2.and.N.eq.3) write(*,'(A,3I4,2F15.5)'), 'After 1st FillMapL(3)', IX,NN,N, DUMMY0(nLng,5,N),DUMMY0(20,5,N) if(NN.eq.2.and.N.eq.3) write(*,'(A,3I4,2F15.5)'), 'Before FillMapL(0)', IX,NN,N, DUMMY0(nLng,5,N),DUMMY0(20,5,N) call FillMapL(0,XCbe(1,N),XCbe(2,N),nLng,nLat,ConstL,DUMMY0(1,1,N)) if(NN.eq.2.and.N.eq.3) write(*,'(A,3I4,2F15.5)'), 'After FillMapL(0)', IX,NN,N, DUMMY0(nLng,5,N),DUMMY0(20,5,N) call GridSphere2D(ALng,nLng,nLat,1,DUMMY0(1,1,N),CONRD,3,0.0,0.0) C call arrR4getminmax(nLngLat,DUMMY0(1,1,N),amin,amax) C print *, 'Before Timesmooth and MkShiftdn0n DUMMY0 min max N',amin,amax,N end do call Timesmooth(nLng,nLat,nT,DUMMY0,0,1.0*CONDT/aNdayG,0.,Dtmp) do N=1,nT if(NN.eq.2.and.N.eq.3) write(*,'(A,3I4,2F15.5)'), 'Before 2nd FillMapL(3)', IX,NN,N, DUMMY0(nLng,5,N),DUMMY0(20,5,N) call FillMapL(3,XCbe(1,N),XCbe(2,N),nLng,nLat,ConstL,DUMMY0(1,1,N)) if(NN.eq.2.and.N.eq.3) write(*,'(A,3I4,2F15.5)'), 'After 2nd FillMapL(3)', IX,NN,N, DUMMY0(nLng,5,N),DUMMY0(20,5,N) C call arrR4getminmax(nLngLat,DUMMY0(1,1,N),amin,amax) C print *, 'Before MkShiftdn0n DUMMY0 min max N',amin,amax,N do J=1,nLat do I=1,nLng if(Moden.eq.0) DUMMY1(I,J,NN,N) = DUMMY0(I,J,N) ! single component input. Fill, DUMMY1 accordingly. if(Moden.eq.1) DUMMY3(I,J,NN,N,IX) = DUMMY0(I,J,N) ! three components input. Fill, DUMMY2 accordingly. end do end do end do end do if(Moden.eq.0) write(*,'(2(A,F15.5))') 'DUMMY1(55,5,1,22)',DUMMY1(55,5,1,22),' DUMMY1(22,5,1,22)',DUMMY1(22,5,1,22) if(Moden.eq.1) write(*,'(2(A,F15.5))') 'DUMMY3(55,5,1,22,IX)',DUMMY3(55,5,1,22,IX),' DUMMY3(22,5,1,22,IX)',DUMMY3(22,5,1,22,IX) end do if(Mode.eq.0) Print *, 'All densities were filled and smoothed.' if(Mode.eq.10) Print *, 'All temperatures were filled and smoothed.' if(Mode.eq.1) Print *, 'All velocities were filled and smoothed.' if(Mode.eq.30) Print *, 'All magnetic field components were filled and smoothed.' return end