program convert2arch c ###################################################################### c # This program converts the i*2 validation files to ASCII and adds # c # lat/lon information. # c ###################################################################### implicit none real*4 x,y ! Convert HRAP x, y into km real*4 r,erad parameter (erad=6371.2) real*4 stlt ! Standard latitude of HRAP grid parameter (stlt=60.) real*4 pic ! Converts radians to degrees integer nx,ny,ist parameter (nx=1075,ny=800) ! HRAP grid size parameter (ist=7) ! 7 component algorithms integer*2 ipcp(nx,ny,ist) ! i*2 precipitation grid real*4 pcp(ist) ! real*4 equivalents real*4 alt,aln ! Lat,lon of pixel integer i,j,k pic=180./acos(-1.0) c -- Read data from i*2 file ------------------------------------------- open (10,file='all20031115.13',access='direct',form='unformatted', & status='old',recl=2*nx*ny*ist) read (10,rec=1) ipcp close (10) c -- Convert data to real*4, compute lat/lon, write to output file ----- open (20,file='all20031115.13.txt',status='new') write (20,'(2a8,7a7)') 'Lat.','Lon.','StgIV','AE','HE','HErad', & 'GMSRA1','GMSRA2','Blend' do j=1,ny do i=1,nx c -------- Conversion from HRAP to lat/lon ----------------------------- y=4.7625*(float(j+25)-1600.5) ! Archive grid starts at y=26 x=4.7625*(float(i)-400.5) r=sqrt(x*x+y*y) aln=(atan2(y,x)*pic)-15. alt=90.-2.*(atan(r/(erad*(1+sin(stlt/pic))))*pic) c -------- Conversion of integer*2 to real*4 for all algorithms -------- do k=1,ist if (ipcp(i,j,k).ne.25600) then pcp(k)=float(ipcp(i,j,k))/100. else pcp(k)=-9.99 endif end do c -------- Output ------------------------------------------------------ write (20,'(2f8.2,7f7.2)') alt,aln,(pcp(k),k=1,7) end do end do close (20) end