NetCDF-Fortran  4.4.2
netcdf_file.f90
1 ! This is part of the netCDF F90 API, or. Copyright 2006 UCAR. See COPYRIGHT file
2 ! for details.
3 
4 ! This file contains the netcdf file functions that are shared by
5 ! netcdf-3 and netcdf-4.
6 
7 ! $Id: netcdf4_constants.f90,v 1.14 2010/05/25 13:53:00 ed Exp $
8 ! -------
9 function nf90_inq_libvers()
10  character(len = 80) :: nf90_inq_libvers
11 
12  nf90_inq_libvers = nf_inq_libvers()
13 end function nf90_inq_libvers
14 ! -------
15 function nf90_strerror(ncerr)
16  integer, intent( in) :: ncerr
17  character(len = 80) :: nf90_strerror
18 
19  nf90_strerror = nf_strerror(ncerr)
20 end function nf90_strerror
21 ! -------
22 !
23 ! File level control routines:
24 !
25 function nf90_inq_base_pe(ncid, pe)
26  integer, intent( in) :: ncid
27  integer, intent(out) :: pe
28  integer :: nf90_inq_base_pe
29 
30  nf90_inq_base_pe = nf_inq_base_pe(ncid, pe)
31 end function nf90_inq_base_pe
32 ! -------
33 function nf90_set_base_pe(ncid, pe)
34  integer, intent( in) :: ncid, pe
35  integer :: nf90_set_base_pe
36 
37  nf90_set_base_pe = nf_set_base_pe(ncid, pe)
38 end function nf90_set_base_pe
39 ! -------
40 function nf90_create_mp(path, cmode, initalsz, basepe, chunksizehint, ncid)
41  character (len = *), intent( in) :: path
42  integer, intent( in) :: cmode, initalsz, basepe, chunksizehint
43  integer, intent(out) :: ncid
44  integer :: nf90_create_mp
45 
46  nf90_create_mp = nf__create_mp(path, cmode, initalsz, basepe, chunksizehint, ncid)
47 end function nf90_create_mp
48 ! -------
49 function nf90_open_mp(path, mode, basepe, chunksizeint, ncid)
50  character (len = *), intent( in) :: path
51  integer, intent( in) :: mode, basepe, chunksizeint
52  integer, intent(out) :: ncid
53  integer :: nf90_open_mp
54 
55  nf90_open_mp = nf__open_mp(path, mode, basepe, chunksizeint, ncid)
56 end function nf90_open_mp
57 ! -------
58 function nf90_set_fill(ncid, fillmode, old_mode)
59  integer, intent( in) :: ncid, fillmode
60  integer, intent(out) :: old_mode
61  integer :: nf90_set_fill
62 
63  nf90_set_fill = nf_set_fill(ncid, fillmode, old_mode)
64 end function nf90_set_fill
65 ! -------
66 function nf90_redef(ncid)
67  integer, intent( in) :: ncid
68  integer :: nf90_redef
69 
70  nf90_redef = nf_redef(ncid)
71 end function nf90_redef
72 ! -------
73 function nf90_enddef(ncid, h_minfree, v_align, v_minfree, r_align)
74  integer, intent( in) :: ncid
75  integer, optional, intent( in) :: h_minfree, v_align, v_minfree, r_align
76  integer :: nf90_enddef
77 
78  integer :: hminfree, valign, vminfree, ralign
79 
80  if(.not. any( (/ present(h_minfree), present(v_align), &
81  present(v_minfree), present(r_align) /) ) )then
82  nf90_enddef = nf_enddef(ncid)
83  else
84  ! Default values per the man page
85  hminfree = 0; vminfree = 0
86  valign = 4; ralign = 4
87  if(present(h_minfree)) hminfree = h_minfree
88  if(present(v_align )) valign = v_align
89  if(present(v_minfree)) vminfree = v_minfree
90  if(present(r_align )) ralign = r_align
91  nf90_enddef = nf__enddef(ncid, hminfree, valign, vminfree, ralign)
92  end if
93 end function nf90_enddef
94 ! -------
95 function nf90_sync(ncid)
96  integer, intent( in) :: ncid
97  integer :: nf90_sync
98 
99  nf90_sync = nf_sync(ncid)
100 end function nf90_sync
101 ! -------
102 function nf90_abort(ncid)
103  integer, intent( in) :: ncid
104  integer :: nf90_abort
105 
106  nf90_abort = nf_abort(ncid)
107 end function nf90_abort
108 ! -------
109 function nf90_close(ncid)
110  integer, intent( in) :: ncid
111  integer :: nf90_close
112 
113  nf90_close = nf_close(ncid)
114 end function nf90_close
115 ! -------
116 function nf90_delete(name)
117  character(len = *), intent( in) :: name
118  integer :: nf90_delete
119 
120  nf90_delete = nf_delete(name)
121 end function nf90_delete
122 
123 !
124 ! A single file level inquiry routine
125 !
126 function nf90_inquire(ncid, nDimensions, nVariables, nAttributes, unlimitedDimId, formatNum)
127  integer, intent( in) :: ncid
128  integer, optional, intent(out) :: ndimensions, nvariables, nattributes, unlimiteddimid, formatnum
129  integer :: nf90_inquire
130 
131  integer :: ndims, nvars, ngatts, unlimdimid, frmt
132 
133  nf90_inquire = nf_inq(ncid, ndims, nvars, ngatts, unlimdimid)
134  if(present(ndimensions)) ndimensions = ndims
135  if(present(nvariables)) nvariables = nvars
136  if(present(nattributes)) nattributes = ngatts
137  if(present(unlimiteddimid)) unlimiteddimid = unlimdimid
138  if(present(formatnum)) then
139  nf90_inquire = nf_inq_format(ncid, frmt)
140  formatnum = frmt
141  endif
142 end function nf90_inquire
143 
144 function nf90_inq_path(ncid, pathlen, path)
145 
146  integer, intent(in) :: ncid
147  integer, intent(inout) :: pathlen
148  character(len = *), intent(inout) :: path
149 
150  integer :: nf90_inq_path
151 
152  nf90_inq_path = nf_inq_path(ncid, pathlen, path)
153 
154 end function nf90_inq_path
155 

Return to the Main Unidata NetCDF page.
Generated on Fri Sep 25 2015 01:52:27 for NetCDF-Fortran. NetCDF is a Unidata library.