NOAA-EMC / NCEPLIBS-grib_util

This is a collection of NCEP GRIB related utilities.
Other
19 stars 11 forks source link

refactor in degrib2 prvtime() #221

Closed edwardhartnett closed 1 year ago

edwardhartnett commented 1 year ago

In degrib2 subroutine prvtime() we have this code:

  ! Determine unit of time range.
  if ((ipdtn .ge. 0 .and. ipdtn .le. 15) .or. ipdtn .eq. 32 &
       .or. ipdtn .eq. 50 .or. ipdtn .eq. 51    &
       .or. ipdtn .eq. 91) then
     iutpos = 8
  elseif (ipdtn .ge. 40 .and. ipdtn .le. 43) then
     iutpos = 9
  elseif (ipdtn .ge. 44 .and. ipdtn .le. 47) then
     iutpos = 14
  elseif (ipdtn .eq. 48) then
     iutpos = 19
  elseif (ipdtn .eq. 52) then
     iutpos = 11
  else
     iutpos = 8
  endif

The first if condition is the same result as the else, so can be eliminated.

This should be done after more testing is in place.