Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jack Woollen's fix to optimize upb8.f routine #534

Merged
merged 1 commit into from
Nov 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions src/upb8.f
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,19 @@ subroutine upb8(nval,nbits,ibit,ibay)
!----------------------------------------------------------------------
!----------------------------------------------------------------------

if(nbits<0 ) call bort('BUFRLIB: UPB8 - nbits < zero !!!!!')
if(nbits>64) then
if(nbits<0) then
call bort('BUFRLIB: UPB8 - nbits < zero !!!!!')
elseif(nbits<=32) then
jbit=ibit; ival=0
call upb(ival,nbits,ibay,jbit)
nval=ival
elseif(nbits<=64) then
jbit=ibit; nvals=0
call upb(nvals(2),max(nbits-nbitw,0),ibay,jbit)
call upb(nvals(1),min(nbitw,nbits ),ibay,jbit)
nval=nval8
else
nval=0
return
endif

jbit=ibit
nvals=0
call upb(nvals(2),max(nbits-nbitw,0),ibay,jbit)
call upb(nvals(1),min(nbitw,nbits ),ibay,jbit)
nval=nval8

end subroutine