program allsky parameter (nLng = 1800) parameter (nLat = 900) parameter (nTot = nLng*nLat) parameter (nRecl= (5+nTot)*4) real AA(nTot) real BegLng / 0.0/ real EndLng /360.0/ real BegLat /-90.0/ real EndLat / 90.0/ integer nsize(5) /2,nLng,nLat,4,nTot/ parameter (nVar=100) character cVar(100)*512 character cFile*512 character cDir *512 character cPath*512 character cDum*1 integer nDum(2) logical bOpenFile include 'openfile.h' include 'filparts.h' iPos(I,J) = nLng*(J-1)+I iVar = nVar call ForeignInput(' ',iVar,cVar) if (iVar .eq. 0) call Say('allsky','e','usage','allsky ') iActRead = OPN__REOPEN+OPN__RECLBYTE iActWrite = OPN__REOPEN+OPN__NEW+OPN__RECLBYTE do jVar=1,iVar iFirst = 1 do while (iSearch(iFirst,cVar(jVar),cFile) .eq. 1) iFirst = 0 print *, cFile(:itrim(cFile)) iRecl = nRecl if (bOpenFile(iActRead,iU,cFile,iRecl)) then read (iU, rec=1) nsize,AA iU = iFreeLun(iU) call ArrR4GetMinMax(nLng*nLat, AA, bad, hole) print *, 'Min = ', bad,' Max=', hole ! Set bad value to BadR4() call ArrR4Mask(nLng*nLat, AA, bad , BadR4(),0.0, 0.0, 1.0, AA) call WhatIsR4(nLng*nLat, AA, 'Before gridsphere') dXC = 1.0 nR = 1 WidDeg = 0.5 iBadZ = 100+10+0 ! Table lookup, open grid; don't fill bad values Threshold = 0.0 ClipLng = 5.0 ! 0.0 call GridSphere2D(dXC,nLng,nLat,nR,AA,WidDeg,iBadZ,Threshold,ClipLng) call WhatIsR4(nLng*nLat, AA, 'After gridsphere') I = iSetFileSpec(cFile) I = iPutFileSpec(FIL__TYPE, FIL__TYPE, '.pph') I = iGetFileSpec(0,FIL__DIRECTORY,cDir) I = iGetFileSpec(FIL__NAME, FIL__TYPE, cFile) I = iFilePath(cDir,1,'smooth',cFile,cPath) call lowercase(cPath) ! Total file size: integer*4 IDL size vector, plus real*4 data iRecl = nRecl if (bOpenFile(iActWrite,iU,cPath,iRecl)) then write (iU, rec=1) nsize,AA iU = iFreeLun(iU) endif end if end do end do end