C NCLFORTSTART SUBROUTINE read_visst_1(outdat,sizeandstat,fn) c array sizeandstat contains: c first three elements are the elelents of act_size c fourth element is status IMPLICIT NONE INCLUDE 'vintrt.inc' INTEGER unpack INTEGER NPARAMS, NLINES, NELEMENTS PARAMETER(NPARAMS = 25, NLINES = 2000, NELEMENTS = 2000) INTEGER ounit, strlen INTEGER i,j,status CHARACTER*(150) fn REAL outdat(NELEMENTS, NLINES, NPARAMS) INTEGER mcidas_navarr(MCIDAS_NAVARRAY_INTS) INTEGER mcidas_headarr(MCIDAS_HEADARRAY_INTS) INTEGER phy_size(3), act_size(3), sizeandstat(4) INTEGER selection(MAX_PARAMETERS) REAL lat_lon(6) CHARACTER*(COMMENT_SIZE) comment C NCLEND ounit=66 open(unit=ounit,file='visstreader.log') i=lnblnk(fn) fn(i+1:i+1)='\0' phy_size(1) = NPARAMS phy_size(2) = NLINES phy_size(3) = NELEMENTS write(ounit,*) 'location of blank: ', i write(ounit,*) 'From within reader, ',fn C C Let's select the required parameters C DO i = 1, MAX_PARAMETERS selection(i) = 0 ENDDO selection(1)=1 selection(2)=1 selection(12)=1 DO i = 14, 22 selection(i) = 1 ENDDO status = unpackCP(fn, phy_size, selection, mcidas_navarr, & mcidas_headarr, act_size, outdat, lat_lon, comment) sizeandstat(1)=act_size(1) sizeandstat(2)=act_size(2) sizeandstat(3)=act_size(3) sizeandstat(4)=status IF (status .NE. 0) THEN WRITE(OUNIT,*) 'Error return from unpack: ', status ENDIF IF (status .EQ. 0) THEN WRITE(OUNIT,*) 'Data extracted sucessfully' WRITE(OUNIT,*) 'Nparam = ',act_size(1) WRITE(OUNIT,*) 'Npixels= ',act_size(3) WRITE(OUNIT,*) 'Nlines = ',act_size(2) WRITE(ounit,'(a,f7.2,2x,f7.2,a,f7.2,2X,F7.2)') & 'Upper left corner : ', & lat_lon(1), lat_lon(2), ' Lower right corner : ', lat_lon(3), & lat_lon(4) WRITE(OUNIT,*) 'CO-LAT CO-LON ' DO i=301,320 WRITE(OUNIT,'(F7.2,2X,F7.2,2X,20F7.2)') outdat(250,I,1), & outdat(250,I,2), (outdat(250,I,j), j=3,22) ENDDO ENDIF close(ounit) return END