PROGRAM rfe1_dat_to_ascii c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c Program: rfe1_dat_to_ascii.f c c Description: This program reads in a 10-day rainfall estimate c (version 1) in .dat format and creates a comma c delimited ascii text file with corresponding latitude/ c longitude on each line. The program was written c in Fortran90 on the HP operating system, while each c dat file was created on SGI. Rainfall resolution c is 0.1 degree with a domain of 20W-55E, 40S-20N. c c Created: Feb 28, 2002 by Tim Love (Tim.Love@noaa.gov) c c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc REAL:: rfe(751,601) INTEGER:: x,y,a,b real:: lat,lon character*20:: input_file c ##### CHANGE FILE NAME BELOW TO INPUT FILE ##### input_file="afpfinalcal98093.dat" c ################################################## do 3002 x = 1, 751 do 3002 y = 1, 601 rfe (x,y) = -999 3002 continue open (unit=22, # file=input_file, # access="direct",status="unknown",recl=751*601*4) read (22, rec=1) rfe open (unit=88, # file="10day_rfe1.txt", # access='sequential', # status='unknown',form='formatted') write (88,FMT=200) "precip, lat, lon" 200 format(A) do a=1,751 do b=1,601 lon=(0-20+(a-1)*.10) lat=(0-40+(b-1)*.10) write (88,FMT=100) rfe(a,b),",",lat,",",lon 100 format(I4,A,F5.1,A,F5.1) end do end do END PROGRAM rfe1_dat_to_ascii