C NCLFORTSTART subroutine cldsi(clds,ntime,nz,ny,nx,ixend,jyend,tm) integer nx,ny,nz,ntime,ixend,jyend integer lb,ub,tm,p integer ntiles real area(100) real meanqc(nx,ny,ntime) integer cloud(nx,ny,ntime) integer oldcldt(nx,ny,ntime) integer oldcld(nx,ny,10000,ntime) real clds(100,ntime) real qcz(100,ntime,ixend,jyend) integer cldcnt(10000,ntime) integer rnknbr(100) character*2 mrk C NCLEND ntiles=12 do n = tm+1,tm+1 !....make format statment dimensioned to nx iread=1 if(iread.eq.1) then do p=0,ntiles-1 rnknbr(p)= p + 100 end do do p=0,ntiles-1 write(mrk,'(i2)') p open(unit=rnknbr(p),file=mrk//'cld_mean.out.0',status='unknown') do m=1,ntime read(rnknbr(p),*) read(rnknbr(p),*) ((qcz(p,m,i,j),i=1,ixend),j=1,jyend) end do close(rnknbr(p)) end do jnb=0 do p=0,ntiles-1 inb=mod(p,4) if(inb.eq.0) then jnb=jnb+1 end if ! print*,inb,jnb,p do m=1,ntime do i=1,ixend do j=1,jyend meanqc(inb*ixend+i,(jnb-1)*jyend+j,m)=cld(p,m,i,j) !!!!!!!!!!!!!!!!!!!!!! end do end do end do end do ! ntiles end if ! iread !!!!!!!! Check if it's a cloud column do i=1,nx do j=1,ny if(meanqc(i,j,n).gt.0.0001) then cloud(i,j,n)=1 else cloud(i,j,n)=0 end if ! print*,i,j,cloud(i,j,n) end do end do !!!!!!!!! Compute cloud sizes do i=1,nx do j=1,ny oldcldt(i,j,n)=1 do m=1,1000 oldcld(i,j,m,n)=0 end do end do end do do m=1,1000 cldcnt(m,n)=0 do i=2,nx-1 do j=2,ny-1 if(cloud(i,j,n).eq.1) then ! print*,'cloud',cloud(i,j,n),i,j,n if((cldcnt(m,n).eq.0).and.(oldcldt(i,j,n).eq.1)) then cldcnt(m,n)=cldcnt(m,n) + 1 oldcld(i,j,m,n)=1 ! print*,cldcnt(m,n),oldcld(i,j,m,n),oldcldt(i,j,n),m,i,j end if if(((cloud(i-1,j,n).eq.1).and.(oldcld(i-1,j,m,n).eq.1) >.and.(oldcldt(i-1,j,n).eq.1)).or. >((cloud(i+1,j,n).eq.1).and.(oldcld(i+1,j,m,n).eq.1) >.and.(oldcldt(i+1,j,n).eq.1)).or. >((cloud(i,j-1,n).eq.1).and.(oldcld(i,j-1,m,n).eq.1) >.and.(oldcldt(i,j-1,n).eq.1)).or. >((cloud(i,j+1,n).eq.1).and.(oldcld(i,j+1,m,n).eq.1) >.and.(oldcldt(i,j+1,n).eq.1)).or. >((cloud(i-1,j-1,n).eq.1).and.(oldcld(i-1,j-1,m,n).eq.1) >.and.(oldcldt(i-1,j-1,n).eq.1)).or. >((cloud(i-1,j+1,n).eq.1).and.(oldcld(i-1,j+1,m,n).eq.1) >.and.(oldcldt(i-1,j+1,n).eq.1)).or. >((cloud(i+1,j+1,n).eq.1).and.(oldcld(i+1,j+1,m,n).eq.1) >.and.(oldcldt(i+1,j+1,n).eq.1)).or. >((cloud(i+1,j-1,n).eq.1).and.(oldcld(i+1,j-1,m,n).eq.1) >.and.(oldcldt(i+1,j-1,n).eq.1))) then ! print*,m,oldcldt(i,j,n),oldcld(i,j,m,n),cldcnt(m,n),i,j cldcnt(m,n)=cldcnt(m,n) + 1 oldcld(i,j,m,n)=1 end if ! is next to an old cloud end if ! is a cloud column end do end do do i=2,nx-1 do j=2,ny-1 if(oldcld(i,j,m,n).eq.1) then oldcldt(i,j,n)=0 end if end do end do ! print*,cldcnt(m,n),m,n end do ! cloud number do i=1,100 clds(i,n)=0 do m=1,1000 lb=5*(i-1) ub=lb+5 if(cldcnt(m,n).gt.lb.and.cldcnt(m,n).le.ub) then clds(i,n)=clds(i,n)+1 ! print*,clds(i,n),i,n end if end do print*,clds(i,n),i,n end do end do ! time print*,'end cldsize' RETURN END