C+ C NAME: C WriteM_Scomp8.for C PURPOSE: C Write Model and Source comparison information into a file. C CALLING SEQUENCE: C call WriteM_Scomp8(Mo,NCoff,XCint,Nit,cStrname,nTmax,nT,NL,PW,RATIO, C & NLmax,NSR,SRC,DOYS8,XCE,OBS,AMOD,XLON,XCtpr,NLOSP1,FIX,SSIG,NBS) C INPUTS: C Mo integer 1 Write out velocities C 2 Write out densities C NCoff integer Carrington rotation offset C XCint(nTmax) real Time interval boundary values C Nit integer Iteration number C cStrname character name for the output file C nT integer number of time values C nTmax integer maximum number of time values C NL integer number of sources C PW real power of g-level to density C RATIO real ratio C NLmax integer maximum number of source values C NSR(NL) integer source counter 0 or 1C SRC*(NL) character source name C SRCS* character source name C DOYS8(NL) real*8 doy of the year C XCE(NL) real Day of year in Carrington Coordinates C OBS(NL) real Observed value C AMOD(NL) real Modeled value C XLON(NL) real Longitude of the source surface projected source point P value C XCtpr(NL) real Carrington time of the source surface projected source point P value C NLOSP1 integer Number of sources lines of sight plus one C FIX(NL) real Ratio of the source to modeled value C SSIG(NL) real Source sigma value C NBS(NL) real Source good or bad check C C OUTPUTS: C FUNCTIONS/SUBROUTINES: C- subroutine WriteM_Scomp8(Mo,NCoff,XCint,Nit,cStrname,nTmax,nT,NL,PW,RATIO, & NLmax,NSR,SRC,DOYS8,XCE,OBS,AMOD,XLON,XLproj,XCtpr,NLOSP1,FIX,SSIG,NBS) character cStrname*14, & SRC(NLmax)*(*), & SRCS*12 real*8 DOYS8 (NL) ! Day of Year real XCint (nTmax) ! Time interval boundaries real XCE (NL), ! Day of year in Carrington Coordinates & OBS (NL), ! Observed value & AMOD (NL), ! Modeled value & XLON (NLOSP1,NL), ! Longitude of the source surface projected source including the point P value & XLproj (NLOSP1,NL), ! Latitude of the source surface projected source including the point P value & FIX (NL), ! Ratio of the source to modeled value & SSIG (NL) ! Source sigma value real*8 XCtpr (NLOSP1,NL) ! Carrington time of the source surface projected source point P value integer NSR (NLmax), ! Has this source been counted? & NBS (NL) ! 1 - the source is good ! 0 - the source is bad INCoffpXC = NCoff+XCint(1) write (cStrname(4:7),'(I4)') INCoffpXC + 1 write (cStrname(9:10),'(I2.2)') Nit open (14,file=cStrname,status='new',recl=120,access='sequential',form='formatted') if(Mo.eq.1) write (14,'(A,/,2(A,I5),2(A,F7.3),/,2(A,F9.3),/,A)') & ' Velocity (Observed and Modeled) Time Series', & ' Iteration = ',Nit,' # of L.O.S. = ',NL,' PWV = ',PW,' VRATIO = ',RATIO, & ' Beginning Time = ',NCoff + XCint(1),' Ending Time = ',NCoff + XCint(NT+1), & ' Seq # Source DOY CDOY VOBS VMOD PROPCL PROPLT PROPTM FIX Vd/VsigM Good?' if(Mo.eq.2) write (14,'(A,/,2(A,I5),2(A,F7.3),/,2(A,F12.3),/,A)') & ' G-level (Observed and Modeled) Time Series', & ' Iteration = ',Nit,' # of L.O.S. = ',NL,' PWG = ',PW,' GRATIO = ',RATIO, & ' Beginning Time = ',NCoff + XCint(1),' Ending Time = ',NCoff + XCint(NT+1), & ' Seq # Source DOY CDOY GOBS GMOD PROPCL PROPLT PROPTM FIX Gd/GsigM Good?' call ArrI4Zero(NLmax,NSR) do J=1,NL if(NSR(J).eq.0) SRCS = SRC(J) do I=1,NL if(SRC(I).eq.SRCS.and.NSR(I).eq.0) then if(NBS(I).eq.0) OBS(I) = -9999.999 write (14,'(I5,2X,A,F8.3,6F9.3,2F7.3,I4)') & I,SRCS,DOYS8(I),NCoff+XCE(I),OBS(I),AMOD(I),NCoff+XLON(NLOSP1,I), & XLproj(NLOSP1,I),XCtpr(NLOSP1,I),FIX(I),SSIG(I),NBS(I) NSR(I) = 1 end if end do end do close (14) return end