PROGRAM MAin
INTEGER, PARAMETER :: iMAx=192
INTEGER, PARAMETER :: jMAx=96
INTEGER, PARAMETER :: kMAX=28
REAL(KIND=4) :: topo(iMAx,jMAx)
REAL(KIND=4) :: psnm(iMAx,jMAx)

REAL(KIND=4) :: temp(iMAx,jMAx,kMax)
REAL(KIND=4) :: uvel(iMAx,jMAx,kMax)
REAL(KIND=4) :: vvel(iMAx,jMAx,kMax)
REAL(KIND=4) :: umes(iMAx,jMAx,kMax)
OPEN(1,FILE='GPRGNMC20181231182018123118F.icn.TQ0062L028',FORM='UNFORMATTED',ACCESS='SEQUENTIAL',ACTION='READ',STATUS='OLD')

READ(1)topo      ! 0 99 SURFACE GEOPOTENTIAL (M                )
READ(1)psnm      !  0 99 SURFACE PRESSURE (hPA              )

 DO k=1,kMAX
      READ(1)temp(:,:,k )      ! 28 99 ABSOLUTE TEMPERATURE (K               )
      PRINT*,MAXVAL(temp(:,:,k )),MINVAL(temp(:,:,k ))

 END DO
 DO k=1,kMAX
      READ(1)uvel(:,:,k )      ! 28 99 ZONAL WIND (U) (M/S             )
 END DO

 DO k=1,kMAX
      READ(1)vvel(:,:,k )      ! 28 99 MERIDIONAL WIND (V) (M/S             )
 END DO

 DO k=1,kMAX
      READ(1)umes(:,:,k )      ! 28 99 SPECIFIC HUMIDITY (KG/KG           )
      PRINT*,MAXVAL(umes(:,:,k )),MINVAL(umes(:,:,k ))

 END DO
END PROGRAM MAin
