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

large amounts of duplicate code getfield.f and gf_getfld.f #188

Open
edwardhartnett opened this issue Nov 17, 2021 · 0 comments
Open

large amounts of duplicate code getfield.f and gf_getfld.f #188

edwardhartnett opened this issue Nov 17, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@edwardhartnett
Copy link
Contributor

In getfield.f we have:

      subroutine getfield(cgrib,lcgrib,ifldnum,igds,igdstmpl,igdslen,
     &                    ideflist,idefnum,ipdsnum,ipdstmpl,ipdslen,
     &                    coordlist,numcoord,ndpts,idrsnum,idrstmpl,
     &                    idrslen,ibmap,bmap,fld,ierr)

This file also contains code to unpack sections 3,4,5,6,7.

Then in gf_getfld.f we have:

subroutine gf_getfld(cgrib,lcgrib,ifldnum,unpack,expand,gfld,ierr)

This seems to be essentially the same code, but using gfld, the gribfied type, instead of intrinsic fortran types.

This is an over 500 line subroutine (including comments) and the unpack subroutines are in separate files, several hundreds of lines of repeated code.

This is an ugly hack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant