Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Facing issue in reading grib file from fortran 90 code

  1. Sep 24, 2014 #1
    I am compiling a fortran 90 program using xlf90_r on AIX as following -

    xlf90_r -q64=largetype -O3 -qstrict -qrealsize=8 -qintsize=8 -qsource -qextname -qlanglvl=90std -qsigtrap=xl__trcedump -qsuppress=1518-011:1518-317:1518-234:1518-256:1518-325:1501-510:cmpmsg -qsigtrap=xl__trcedump -qflttrap=enable,invalid,nanq,overflow,zerodivide readwritegrib.f90

    Its compiling with no errors.
    but while reading grib file below - I am getting - "Error reading Message" and return IOSTAT code from READ is 122 - Incomplete record encountered during direct access READ.
    Please help

    my grib file is - -rw-r--r-- 1 hello staff 12964674 Sep 23 14:17 Cover.grb

    I am getting error ""Error reading Message" here in code -

    OPEN(Unit=InUnit,Access='DIRECT',file=InFile,form='UNFORMATTED', &

    If (OpenStatus /= 0) Then

    Print*, "Error opening input file"
    End If
    READ(Unit=InUnit,REC=1,IOSTAT=ReadStatus) GMessage

    WRITE (6,*) 'ReadStatus - ',ReadStatus
    If (ReadStatus /= 0) Then
    Print*, "Error reading GMessage"
    End If

    output on running a.out - Readstatus 122 - Incomplete record encountered during direct access READ.

    WordSize = 64
    Len_mesg = 1620736
    ReadStatus - 122
    Error reading GribMessage
    OpenStatus = 0
  2. jcsd
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted