CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC C C This is a FORTRAN language version of the program C ReadRain.C. This program is used to extract the C Total Rain (in mm) value from the Polar Satellite C Processing Data Center (PSPDC) Special Sensor C Microwave Imager (SSM/I) oceanic rain rate data. C C A column value of 999 and row value of 99 is used as an end flag. C an end flag. Records following this are used as an "audit trail". C This reads rain rate processing version 3.4. C COMMENT-IN APPROPRIATE RESOLUTION FOR MAP_ROWS AND MAP_COLS C BEFORE COMPILING. This code is currently setup for reading C 2.5 degree global resolution oceanic rain rate data sets. C C Usage: ReadRain.out CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC C Real*4 chisq, TotalRain Integer*4 ch, I1, I2, J1, J2, numargs Integer*4 jrow, jcol, iyear, imonth, idaysinmonth Integer*2 iloop Character*80 dsn C Real*4 rNonLeapYr(12), rLeapYr(12) data rNonLeapYr/31,28,31,30,31,30,31,31,30,31,30,31/ data rLeapYr/31,29,31,30,31,30,31,31,30,31,30,31/ iunit1 = 60 iunit2 = 61 numargs = 0 idaysinmonth = 0 C C Map dimension for 5.0 degree lat and lon global resolution MapRows = 20 MapCols = 72 iloop = 2 !Read one day one nit data set C C Map dimension for 2.5 degree lat and lon global resolution C MapRows = 52 C MapCols = 144 C iloop = 1 !Read one day-nit avg data set C C Read the input data set name (dsn) from namelist open(iunit1, FILE="infile.list") do 444 ii=1,iloop !Loop over one 2.5deg or two 5.0 data sets C print *, "ii iloop ",ii, iloop read(iunit1,90)dsn 90 format(A80) write(6,90)dsn C open(iunit2, FILE=dsn) C read(iunit2,100)iyear,imonth,ch,I1,I2,J1,J2 ! Header 100 format(5X,I2,7X,I2,6X,I1,6X,2I4,6X,2I3,7X,54A1,6X,20A1,10X,5A1) write(6,100)iyear,imonth,ch,I1,I2,J1,J2 ! Test print stmt C C Check for valid input if(imonth .lt. 1 .and. imonth .gt. 12) then write(6,901)imonth 901 format("Bad input month: ",I4) endif C if((iyear/4)*4 .ne. iyear) then idaysinmonth = rNonLeapYr(imonth) else idaysinmonth = rLeapYr(imonth) endif C C Looping over the data C do while (numargs .lt. 100000) !100000 arbitrary loop number read(iunit2,101)jrow,jcol,chisq,TotalRain 101 format(I2,I4,F10.1,F9.2,5F6.2,3F8.2,F9.2,F8.0,F6.2,F8.2 & ,F10.2,2F6.2,I5,I3,F6.1,F7.1) c write(6,101)jrow,jcol,chisq,TotalRain numargs = numargs + 1 C if(jrow .eq. 99 .and. jcol .eq. 999) go to 777 ! End of map data C C Check for valid input C if(jrow .lt. 1 .or. jrow .gt. MapRows .or. jcol .lt. 1 & .or. jcol .gt. MapCols) then write(6,801)jrow, jcol, MapRows, MapCols 801 format(2x,"Unacceptable input row or col: ",2I4) endif C C Write the Total Rain value from the input data set C write(6,110)jrow, jcol, TotalRain 110 format(2x,"Row ",I4," Col ",I4," Total Rain ",F6.2) end do !End do while numargs... C772 continue C write(6,905) C905 format("Error reading input dsn from namelist.") 777 continue 444 continue write(6,906) 906 format("Normal end of input dsn, namelist.") close(iunit1) close(iunit2) stop end