This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
>From: Paul Markowski <address@hidden> >Organization: UCAR/Unidata >Keywords: 200111282240.fASMerN03867 > >Hello, > >I've had little luck trying to open a gempak surface data file (after >which calls to SF_RDAT can be made) using SF_OPNF (within an f77 program >running on a linux machine). All I get is a "Segmentation fault" error, >and I was wondering if you have any ideas of possible causes for this >type of error, or what checks I might do to track down the culprit. FWIW, >I call IN_BDTA prior to SF_OPNF. I've also tried other gempak surface >data files, so I don't believe that the cause is a >corrupt data file. Also, the arguments passed to SF_OPNF appear to be >correctly defined; i.e., WRTFLG is a logical, ISFFLN, IFLSRC, IRET, >and NPARM are integers, and PARMS(NPARM) is a 4-character string. > >Thanks a million! > >Paul Markowski > > >__________________ >Dr. Paul Markowski >Department of Meteorology >Pennsylvania State University >503 Walker Building >University Park, PA 16802 >email: address@hidden >phone: (814) 865-0478 >fax: (814) 865-3663 >web: http://www.meteo.psu.edu/~marko/ > > Paul, The genaral steps, after calling IN_BDTA are to: 1) open the file with SF_OPNF (check iret for error return) 2) Get the list of times in the file (if needed) with SF_GTIM 3) For each time returned from (2), 3a) Set the time for reading with SF_STIM 3b) Set the area for station searches using SF_UARE (if needed) 3c) Call SF_SNXT while iret returns 0 to set each station in the specified area 3d) Call SF_RDAT to retrieve the data for the current station Or, you can do it the other way using the SF_Txxx calls if you know the station you want, and get all the times for that station. Just depends on your needs. Make sure you are checking your iret values and if still segmentation faulting, check your strings being passed for the file name etc. Steve Chiswell