Skip Navigation Links www.nws.noaa.gov 
NOAA logo - Click to go to the NOAA home page National Weather Service   NWS logo - Click to go to the NWS home page
Climate Prediction Center
 
 

 
About Us
   Our Mission
   Who We Are

Contact Us
   CPC Information
   CPC Web Team

 
HOME > Monitoring_and_Data > Oceanic and Atmospheric Data > Reanalysis: Atmospheric Data > wgrib2api: grb2_free_file
 

wgrib2api: grb2_free_file(..)

Introduction

When files are opened using wgrib2api, they are normally not closed until the program ends. This saves time in closing and then reopening files. For most programs using wgrib2api, there is no need to close files opened using wgrib2api. However, there are two cases. First, you use wgrib2api to write a file, and you then want to use the file before the program that created the file ends. Wgrib2api may buffer some of the writes in an output buffer until the program ends or until the file is closed. For this case, you have to free the file. Second, there are exceptional programs which open huge numbers of files. Since we all write exceptional programs, some more frequently than others, there is a function to close usused files that are opened by wgrib2api. This function does not affect the files opened by the normal fortran "open" routine.

Usage

    i = grb2_free_file(FILE)
    i =  0    ok
      /= 0   failure

    FILE:      character (len=*) file to close

NOAA/ National Weather Service
National Centers for Environmental Prediction
Climate Prediction Center
5830 University Research Court
College Park, Maryland 20740
Climate Prediction Center Web Team
Page last modified: March 13, 2017, May 1, 2020
Disclaimer Privacy Policy