[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20010430: link



>From: "Alliss, Randall J." <address@hidden>
>Organization: TASC
>Keywords: 200104302002.f3UK2WL09978 cloud top pressure application

Randy,

>can you take a look at the program i have enclosed. I got it from Tony
>Schreiner at SSEC. It reads in an AREA which contains cloud top pressure
>from their CO2 slicing technique and prints it in ascii. 
>
>I am trying to compile / link on my alpha. I can compile but it complains
>about linking.
>
>i get,
>
>unresolved main0_
>severe failed while trying to link.
>
>the main.o in /usr/users/mcidas7.7/src does exist.
>
>any ideas?

Without actually trying to understand the flow of your program, I suggest
adding the line:

      SUBROUTINE MAIN0

as the first line of the program and retrying your compile.

By the way, how exactly are you trying to compile this program?  If
you are using the DEC OSF/1 compiler directly, then you will run into
problems.

>thanks,

Let me know the results of adding 'SUBROUTINE MAIN0'.

>Randy

>      REAL  FLINE, FELEM, FLAT, FLON, Z
>      REAL PCLD, ECA           ! percent cloud, effective cloud amount
>      INTEGER IPTR1, IPTR2, OPNARA
>      INTEGER IAREA1, IAREA2
>      INTEGER IDIR1(64), IDIR2(64)
>      INTEGER NAVPARMS(128*12)
>      INTEGER NLINES, NELEMS
>      INTEGER LCOR, ECOR, LRES, ERES, LX, EX
>      INTEGER NPIXS            ! number of pixels to output per area
>      INTEGER NEBYTES          ! bytes per element
>      INTEGER NBANDS           ! NUMBER OF BANDS
>      INTEGER*1 LINE1(1000), LINE2(1000)       ! hold contents for a line
>      INTEGER*4 LINE41, LINE42
>      INTEGER MASK /z000000FF/
>      INTEGER MAXC1 /0/, MAXC2 /0/
>      INTEGER IDATE, ITIME
>      INTEGER MEMO1(8)
>     1 /4hGOES,4h SND,4hR  C,4hLOUD,4h TOP,4h PRE,4hSS  ,4h    /
>      INTEGER MEMO2(8)
>     1 /4hGOES,4h SND,4hR  E,4hFF C,4hLOUD,4h AMO,4hUNT ,4h    /
>      INTEGER HH,DD,MM,YY
>      LOGICAL LINIT /.TRUE./
>      CHARACTER CBUFF*16
>      CHARACTER COUTFILE*48    ! output file
>C
>      WRITE (6,6000)
>C
>      NARG =3D IARGC()
>      NPAIR =3D (NARG-1)/2
>      WRITE(6,'(''narg'',i4)') NARG
>      CALL GETARG(1  ,COUTFILE)
>      WRITE (6,6001) COUTFILE
>      OPEN =
>(1,IOSTAT=3Diostat,ERR=3D90,FILE=3DCOUTFILE,STATUS=3D'UNKNOWN',
>     1  ACCESS=3D'SEQUENTIAL',FORM=3D'FORMATTED')
>C
>      DO 800 ILX=3D1,NPAIR
>C
>      WRITE(6,'(''set number'',i4)') ILX
>      MAXC1 =3D 0
>      MAXC1 =3D 0
>C
>      CALL GETARG(ILX*2  ,CBUFF)
>      READ (CBUFF,'(I4)') IAREA1
>      CALL GETARG(ILX*2+1,CBUFF)
>      READ (CBUFF,'(I4)') IAREA2
>C
>      IPTR1 =3D OPNARA(IAREA1)
>      IPTR2 =3D OPNARA(IAREA2)
>C
>C Get area directory
>      CALL READD(IAREA1, IDIR1)
>      WRITE (6,6002) IAREA1, IDIR1(3), IDIR1(4), IDIR1(5)
>      CALL READD(IAREA2, IDIR2)
>      WRITE (6,6002) IAREA2, IDIR2(3), IDIR2(4), IDIR2(5)
>C
>C Check that areas are the same time and colocated
>      IDATE =3D IDIR1(4)
>      ITIME =3D IDIR1(5)
>      LCOR =3D IDIR1(6)
>      ECOR =3D IDIR1(7)
>      IF (LCOR .NE. IDIR2(6)) GOTO 910
>      IF (ECOR .NE. IDIR2(7)) GOTO 910
>      NLINES =3D IDIR1(9)
>      NELEMS =3D IDIR1(10)
>      LRES =3D IDIR1(12)
>      ERES =3D IDIR1(13)
>      NEBYTES =3D IDIR1(11)
>      NBANDS =3D IDIR1(14)
>      WRITE (6,6003) NLINES, NELEMS, LRES, ERES, NEBYTES, NBANDS
>      WRITE(6,6005) =
>IDIR1(25),IDIR1(26),IDIR1(27),IDIR1(28),IDIR1(29),
>     1 IDIR1(30),IDIR1(31)
>      WRITE(6,6005) =
>IDIR2(25),IDIR2(26),IDIR2(27),IDIR2(28),IDIR2(29),
>     1 IDIR2(30),IDIR2(31)
>      DO 20 I=3D1,7
>      IF (IDIR1(24+I) .NE. MEMO1(I)) GOTO 901
>      IF (IDIR2(24+I) .NE. MEMO2(I)) GOTO 902
> 20   CONTINUE
>C
>C Write out header record
>      IF (LINIT) THEN
>       LINIT =3D .FALSE.
>       WRITE(6,6004) IDATE, ITIME
>C      WRITE(1,1000) IDATE, ITIME
>       HH =3D ITIME / 10000
>       YY =3D IDATE / 1000
>       CALL DDMMYY(DD,MM,YY,IDATE)
>       WRITE (6,6006) HH,DD,MM,YY
>       WRITE (1,1100) HH,DD,MM,YY
> 1100 FORMAT ('GNRCLEVL   MB   SFC   FOR 00  HRS AFTER  ',I2,
>     1 'UTC ',i2,1x,i2,1x,i2)
>       WRITE (1,1101)
> 1101 FORMAT ('  LAT    LON       1  CTP     ECA ')
>      ENDIF
>C
>C Initialize the navigation for slot 1.
>      WRITE(6,'(3I8)') IDIR1(34), IDIR1(35), IDIR1(63)
>      NBYTES =3D IDIR1(63) - IDIR1(35)
>      CALL ARAGET(IAREA1, IDIR1(35), NBYTES, NAVPARMS)
>      WRITE(6,'(''nav cod '',z8)') NAVPARMS(1)         ! DEBUG
>      IRET =3D NVPREP(1, NAVPARMS)
>C
>      NPIXS =3D 0
>      DO 400 LX=3D1,NLINES
>C     SUBROUTINE REDARA(AREA,LINE,ELEM,NELE,BAND,IARRAY)
>      CALL REDARA (IAREA1,LX-1,0,1000,1,LINE1)
>      CALL REDARA (IAREA2,LX-1,0,1000,1,LINE2)
>      DO 300 EX=3D1,NELEMS
>      FLINE =3D LX*LRES + LCOR
>      FELEM =3D EX*ERES + ECOR
>      CALL NV1SAE(FLINE,FELEM,XDUM,FLAT,FLON,Z)
>      FLON =3D -FLON
>      LINE41 =3D LINE1(EX)
>      LINE42 =3D LINE2(EX)
>      LINE41 =3D IAND(LINE41,MASK)
>      LINE42 =3D IAND(LINE42,MASK)
>      if (line41 .gt. maxc1) maxc1 =3D line41
>      if (line42 .gt. maxc2) maxc2 =3D line42
>      IF (LINE41 .EQ. 0  .OR.  LINE42 .EQ. 0) GOTO 300
>      IF (LINE41 .GE. 1  .AND.  LINE41 .LE. 75) THEN
>       PCLD =3D 1013.0
>      ELSE
>       PCLD =3D 950.0 - 800.0 * (FLOAT(LINE41-76)/179.0)
>      ENDIF
>      IF (LINE42 .GE. 1  .AND.  LINE42 .LE. 75) THEN
>       ECA =3D 0.0
>      ELSE
>       ECA =3D 100.0 * (FLOAT(LINE42-76)/179.0)
>      ENDIF
>      write (1,1001) FLAT, FLON, PCLD, ECA
>c     write (1,1001) FLAT, FLON, LINE41, LINE42
>CX    if (npixs .lt. 250)              ! DEBUG
>CX   1write (6,'(z8,2x,z2,4x,z8,2x,z2)') line41,line1(ex),
>CX   2 line42, line2(ex)
>      NPIXS =3D NPIXS + 1
>      if (npixs .lt. 800) then
>      write (6,6600) NPIXS, FLINE, FELEM, FLAT, FLON, LINE41, =
>LINE42,
>     1 PCLD, ECA
>      endif
> 300  CONTINUE
> 400  CONTINUE
>C
>      WRITE (6,'(''max'',2i8)') maxc1, maxc2
>      CALL CLSARA(IAREA1)
>      CALL CLSARA(IAREA2)
> 800  CONTINUE
>C
>      CLOSE(1)
>      RETURN
>C
> 90   WRITE(6,690) IOSTAT
> 690  FORMAT ('OPEN ERROR IOSTAT=3D',i6)
>      RETURN
>C
> 901  WRITE(6,6901)
> 6901 FORMAT ('area 1 memo not cloud height')
>      RETURN
>C
> 902  WRITE(6,6902)
> 6902 FORMAT ('area 2 memo not eff cloud amt')
>      RETURN
>C
> 910  WRITE (6,6910) IDIR1(6), IDIR2(6)
> 6910 FORMAT ('areas not colocated',2I8,2I8)
>      return
> 1000 FORMAT(2I8)
>c1001 FORMAT(2F8.2,1x,2I4)
>c1001 FORMAT(2F7.2,6h     0,2I8)
> 1001 FORMAT(2F7.2,6h     0,2F8.1)
> 6000 FORMAT('start cloud_height')
> 6001 FORMAT('output file ',A48)
> 6002 FORMAT('AREA',I5,I6,2I8)
> 6003 FORMAT('nlines',i8,' nelems',i8,' lres',i4,' eres',i4,
>     1 ' b/e ',i2,' nband',i3)
> 6004 FORMAT('DATE ',2i8)
> 6005 FORMAT(8A4)
> 6006 FORMAT (I2,2hZ ,3I3)
>C temperary
> 6600 FORMAT(I6,2F8.0,2x,2F10.2,2x,2I5,2f8.2)
>      end
>
>
>
>      SUBROUTINE DDMMYY(IDAY,IMON,IYR,IYYDDD)
>      INTEGER NDAY(12) /0,31,59,90,120,151,181,212,243,273,304,334/
>      INTEGER LDAY(12) /0,31,60,91,121,152,182,213,244,274,305,335/
>C
>      IDAY =3D 0
>      IMON =3D 0
>      IYR  =3D 0
>      IDAY =3D MOD(IYYDDD,1000)
>      IYR =3D IYYDDD / 1000
>      IF (MOD(IYR,4) .EQ. 0) GO TO 3
>      L =3D 1
>      DO 1 I=3D2,12
>      IF (IDAY .LE. NDAY(I)) GO TO 2
>      L =3D I
> 1    CONTINUE
> 2    CONTINUE
>      IDAY =3D IDAY - NDAY(L)
>      IMON =3D L
>      RETURN
>C FOR LEAP YEAR COMPUTE DDMMYY HERE.
> 3    CONTINUE
>      IF (IDAY .GT. 366) GO TO 94
>      L =3D 1
>      DO 4 I=3D2,12
>      IF (IDAY .LE. LDAY(I)) GO TO 5
>      L =3D I
> 4    CONTINUE
> 5    CONTINUE
>      IDAY =3D IDAY - LDAY(L)
>      IMON =3D L
>      RETURN
> 94   CONTINUE
>      RETURN
>      END

Tom

>From address@hidden Tue May  1 08:26:11 2001
>Subject: RE: 20010430: link 

Tom,
that worked. thanks.

Randy