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

How do we test tocgrib2super? #735

Open
edwardhartnett opened this issue Jul 16, 2024 · 3 comments
Open

How do we test tocgrib2super? #735

edwardhartnett opened this issue Jul 16, 2024 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@edwardhartnett
Copy link
Contributor

edwardhartnett commented Jul 16, 2024

How in the world do we run togrib2super?

I am trying this and it's not working:

export FORT11="../tests/data/rrfs.t12z.prslevfaa.f010.na3km.grib2"
export FORT51=out.grib2
../utils/tocgrib2super < data/tocgrib2.nml

and this does not work. Fails opening a file.

When I look at the code I see:

!        Read GRIB2 data and index file names from the FORTnn
 !        environment variables, and open the files.
 !
 envvar='FORT  '
 write(envvar(5:6),fmt='(I2)') lugb
 call getenv(envvar,fileb)
 write(envvar(5:6),fmt='(I2)') luga
 call getenv(envvar,filea)
 write(envvar(5:6),fmt='(I2)') lugi
 call getenv(envvar,filei)
 !
 !     Get the file size of the grib file
 !
 !     call baopenr(luga,filea,iret1)
 open(unit=luga,file='filesize',form='formatted',status='old', &
      iostat=iret1)
 if (iret1  .ne. 0) then
    write(6,fmt='(" Error opening GRIB file: ",A200)') filea
    write(6,fmt='(" baopenr error = ",I5)') iret1
    stop 10
 endif

How is the file size supposed to be passed in?

Do we know where this is being used? If so, can I look at how they do it?

@Hang-Lei-NOAA and @GeorgeVandenberghe-NOAA do you know where tocgrib2super is used?

@GeorgeVandenberghe-NOAA

I will try to snag this. Meanwhile if you have access to source, put in prints to find out what the %^( is going on here. "Filesize" is a very odd variable name for a NAME btw but I know this ain't your code.

To speed this up if you have source and a testcase, where are they.

@edwardhartnett
Copy link
Contributor Author

@GeorgeVandenberghe-NOAA

Okay, filesize is the NAME of a file read as unit 12 that has the exact size of the file in unit 11. THis method of obtaining file size was common at the turn of the century and predates the more modern method of using stat() to return the size in the inode. (And be careful.. the internal stat structure also unix, linux and filesystem implementation dependent but it's still the preferred method and seems to have stabilized with both Lustre and GPFS returning the same data structure). Anyway if fortran unit 11 is, 40999888 bytes long, then fortran unit 12 should be a single 8 character text string containing this integer value. In setting up this test I am stuck getting a proper namelist for unit 5 input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
Status: To do
Development

No branches or pull requests

4 participants