NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

[netcdfgroup] How to inquire if a NetCDF file is already open for reading or writing?

  • To: "netcdfgroup@xxxxxxxxxxxxxxxx" <netcdfgroup@xxxxxxxxxxxxxxxx>
  • Subject: [netcdfgroup] How to inquire if a NetCDF file is already open for reading or writing?
  • From: Hernan Arango <arango@xxxxxxxxxxxxxxxxxx>
  • Date: Fri, 22 Jan 2021 21:00:49 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marine.rutgers.edu; dmarc=pass action=none header.from=marine.rutgers.edu; dkim=pass header.d=marine.rutgers.edu; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=c+voINU+Ct1JV7iVE9foJvxHtJWvyK5xjWQsbFuWDz4=; b=Ffy2nSO/fJolcWY2uZomcqRW40CHHx22V4YzEiOOjlHyUm0jl/mZZZad/lAXpuLQYidGyW6ihjMfXANhXm2HOwA7dM7Y7eIbMwcA/QNFpBGDw9GsdKr0WKjizNJC5zUKBC6dJ3doNI/zG3YRXg/VYj/ULlAii9sg7cK40e/JgWcutY7KeIDZL9DYG08AnzB/VJ2IfM41o2nXZ0z14wWFKpvzFU0YERy+QSbOy+dqG5TgHHspEKNkdtlmZccFV2hma+4vVnNWup5e5F2g39d04jiUTzEp+nIlaV9fIHGB7C5UZFR+YZfPW3SiEW+EHmr+vGHHWRdiY0Tu/0wU7sXwkQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nJfjd5AM5bgL6AUS1dKqE6qR+z8qsDS0G2VQ2xTGcz6C5DaZiUFf26tD/0Bznk8G6sGqLub2UNj07iT1Qb3Hi6mXoeev36S3QF8G2zh2Y0JpNE7njLlM7fSNcPfBA2yKLFdrezejbrPjG2JKB5b13Xje4+N38zzbvKdw+04254N2MkNmIHZuR/MndWMAzsCtu3dhqO+Gbx18/z+nmuy6inyF5zA8Sll/WZtKjvdQ2e7TZPP2HTeuUYoaQi3KOv9LpciR6UWCqbi8YNDemk94+jTebKyAf5iGafh8lfzMrKYTsPEALI6AzaJjIcn7DE96a0b4mn5HXQJY3EODwJupdg==
  • Authentication-results: unidata.ucar.edu; dkim=none (message not signed) header.d=none;unidata.ucar.edu; dmarc=none action=none header.from=marine.rutgers.edu;
Hello,

I am wondering if there is a function to determine if a NetCDF is already open 
for reading or writing based on the filename?   I am trying to avoid open too 
many files.   I know that there are ways in Unix to increase the number of open 
files, but that’s not what I am asking.   In parallel I/O running on lots of 
processes, there is a need to avoid opening too many files.   I am using both 
the standard NetCDF library and the PIO library that is the basis of the 
SCORPIO library (https://e3sm.org/scorpio-parallel-io-library).   Therefore, I 
have integer file ID (ncid) and file descriptors of TYPE (file_desc_t).

I am looking for something like:

     ncid=is_nc_open(‘my_file.nc’)
or
     fileDesc=is_pio_open(iosystem, my_paralle_file.nc’)

Thank you, H

----------------------------------------------------------------------
Hernan G. Arango           Department of Marine and Coastal Sciences
arango@xxxxxxxxxxxxxxxxxx<mailto:arango@xxxxxxxxxxxxxxxxxx>  Rutgers University
off: (848) 932-3368        71 Dudley Road
FAX: (732) 932-8578        New Brunswick, NJ 08901-8521, USA

http://www.researchgate.net/profile/Hernan_Arango
http://www.myroms.org
http://www.ocean-modeling.org

  • 2021 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: