c-------------------------------------------------------------------------- C c The input "B1" data are separate files for each geo satellite separately, c but contained in global arrays (3600 x 1800) for each 3 hr synoptic period c parameter (nx=3600, ny=1800) real*4 tb(nx,ny), work(nx,ny) integer*2 ibuf(nx,ny) logical inthere itype=0 ! running on Linux machine c isat = 1 ! GMS c sublon = 140.0 isat = 1 ! GOES-9 (GMS replacement @ 155E) sublon = 155.0 c isat = 2 ! G-W c sublon = 225.0 c isat = 3 ! G-E c sublon = 285.0 c isat = 4 ! Met-7 c sublon = 0.0 c isat = 5 ! Met-5 c sublon = 63.0 iyear=2005 imon=7 iday1 = 10 iday2 = 10 iscol = (sublon+30)*10 + 1 iecol = iscol + 14 do iday = iday1, iday2 do ihr = 0, 21, 3 c....... Read in the ISCCP B1 data & unscale call readb1(iyear,imon,iday,ihr,ibuf,nx,ny,tbmin,tb,inthere) c c....... ISCCP B1 files ordered 180-180 & south > north; reorder to 0-360 & north > south if (inthere) then call reordertb(nx,ny,work,tb) write (6,'(/, '' original cold cloud '',/// )') do jwr = 880, 900 write (6,'(15f8.1)') (tb(iwr,jwr), iwr = iscol, iecol) enddo c End if input file there if endif c End 3 hourly loop enddo c End daily loop enddo stop end subroutine readb1(iyear,imon,iday,ihr,ibuf,nx,ny,tbmin,tb,inthere) real*4 tb(nx,ny) integer*2 ibuf(nx,ny) character*120 infile logical inthere infile = '/export-3/cpclnxsvr1/cpcsat/mcidas/isccp/data/GPCP.B1.a. c &MET-7.2005.00.00.0000.GRID' &GOE-9.2005.00.00.0000.GRID' write (infile(63:66),'(i4)') iyear if (imon.lt.10) then write (infile(69:69),'(i1)') imon else write (infile(68:69),'(i2)') imon endif if (iday.lt.10) then write (infile(72:72),'(i1)') iday else write (infile(71:72),'(i2)') iday endif if (ihr.lt.10) then write (infile(75:75),'(i1)') ihr else write (infile(74:75),'(i2)') ihr endif write (6,'('' infile = '',a120)') infile inquire (file = infile, exist = inthere) if (inthere) then open(1,file=infile,access='direct',recl=nx*ny*2) read(1,rec=1) ibuf write (6,'('' infile here and read = '',a120)') infile do j=1,ny do i=1,nx tb(i,j)=ibuf(i,j) tb(i,j)=tb(i,j)*0.01 + 100. if(tb(i,j).lt.tbmin) tb(i,j)=-9999. enddo enddo write (6,'('' unscaled '')') endif return end subroutine reordertb(nx,ny,work,tb) real*4 tb(nx,ny), work(nx,ny) c--------------------------------------------------------------------------- c Data enters this subroutine ordered in longitude from 180-180 & exits c ordered from 0-360; also reorders data so that they are c arranged from north to south c--------------------------------------------------------------------------- do j=1,ny do i=1,nx ii=i+nx/2 if(ii.gt.nx) ii=ii-nx work(ii,j)=tb(i,j) enddo enddo write (6,'('' after reorder '')') do j=1,ny jj=ny+1-j do i=1,nx tb(i,j)=work(i,jj) enddo enddo return end