source: LMDZ6/branches/cirrus/tools/netcdf95/docs/Detailed_content/datasets.md @ 5523

Last change on this file since 5523 was 4918, checked in by Laurent Fairhead, 10 months ago

Reintegrated NetCDF95 in LMDZ so that it is compiled and made available by the makelmdz_fcm script.
The makelmdz_fcm creates the libnetcdf95 library and copies it in the tools/netcdf/lib directory, copying
the mod files in the tools/netcdf/include library.

File size: 4.5 KB
Line 
1# Datasets & co
2
3This page describles procedures handling a whole dataset, or handling
4a combination of NetCDF variables and dimensions.
5
6See the [improvements page](improvements.md) for an
7explanation of the mnemonics \"basic change\", \"interface change\",
8\"functionality change\", \"additional procedure\".
9
10## `nf95_close`
11
12(basic change)
13
14      subroutine nf95_close(ncid, ncerr)
15        integer, intent( in) :: ncid
16        integer, intent(out), optional :: ncerr
17
18Reference: [`nf90_close`](https://docs.unidata.ucar.edu/netcdf-fortran/current/f90_datasets.html#f90-nf90_close)
19
20## `nf95_create`
21
22(basic change)
23
24      subroutine nf95_create(path, cmode, ncid, initialsize, chunksize, ncerr)
25        character (len = *), intent(in   ) :: path
26        integer,             intent(in   ) :: cmode
27        integer,             intent(  out) :: ncid
28        integer, optional,   intent(in   ) :: initialsize
29        integer, optional,   intent(inout) :: chunksize
30        integer, intent(out), optional :: ncerr
31
32Reference: [`nf90_create`](https://docs.unidata.ucar.edu/netcdf-fortran/current/f90_datasets.html#f90-nf90_create)
33
34## `nf95_create_single`
35
36(additional procedure)
37
38        subroutine nf95_create_single(name, coordinates, ncid, varid, varid_coord)
39          character(len = *), intent(in):: name
40      type(coord_def), intent(in):: coordinates(:)
41      integer, intent(out):: ncid, varid, varid_coord(:)
42
43This procedure is a shortcut to create a NetCDF file containing a
44single primary variable, with all its coordinates. The coordinates are
45specified using the derived type `coord_def` :
46
47        type coord_def
48      character(len = NF90_MAX_NAME) name
49          integer nclen
50          character(len = :), allocatable:: attr_name(:), attr_val(:)
51        end type coord_def
52
53After the call to `nf95_create_single`, the NetCDF dataset is still in
54define mode, so you can add attributes if appropriate.
55
56## `nf95_enddef`
57
58(basic change)
59
60      subroutine nf95_enddef(ncid, h_minfree, v_align, v_minfree, r_align, ncerr)
61        integer,           intent( in) :: ncid
62        integer, optional, intent( in) :: h_minfree, v_align, v_minfree, r_align
63        integer, intent(out), optional :: ncerr
64
65Reference: [`nf90_enddef`](https://docs.unidata.ucar.edu/netcdf-fortran/current/f90_datasets.html#f90-nf90_enddef)
66
67## `nf95_find_coord`
68
69(additional procedure)
70
71      subroutine nf95_find_coord(ncid, name, dimid, varid, std_name)
72
73        integer, intent(in):: ncid
74
75        character(len=*), intent(out), optional:: name ! blanks if not found
76        ! The actual character argument should normally have the length
77        ! "NF90_MAX_NAME".
78
79        integer, intent(out), optional:: dimid ! 0 if not found
80        integer, intent(out), optional:: varid ! 0 if not found
81
82        character(len=*), intent(in):: std_name
83        ! standard name : "plev", "latitude", "longitude" or "time"
84
85This procedure returns the name, dimension id or variable id of the
86NetCDF coordinate with standard name `std_name`, if such a coordinate
87exists. The standard name is only used to know what to search, it is not
88used for the search itself. The search itself is done via a string match
89on the attribute \"units\". So the NetCDF variable one looks for does
90not need to have the attribute `std_name`.
91
92## `nf95_inquire`
93
94(basic change)
95
96      subroutine nf95_inquire(ncid, nDimensions, nVariables, nAttributes, &
97           unlimitedDimId, formatNum, ncerr)
98
99        integer,           intent( in) :: ncid
100        integer, optional, intent(out) :: nDimensions, nVariables, nAttributes
101        integer, optional, intent(out) :: unlimitedDimId, formatNum
102        integer, intent(out), optional:: ncerr
103
104Reference: [`nf90_inquire`](https://docs.unidata.ucar.edu/netcdf-fortran/current/f90_datasets.html#f90-nf90_inquire-family)
105
106## `nf95_open`
107
108(basic change)
109
110      subroutine nf95_open(path, mode, ncid, chunksize, ncerr)
111        character(len=*), intent(in):: path
112        integer, intent(in):: mode
113        integer, intent(out):: ncid
114        integer, intent(inout), optional:: chunksize
115        integer, intent(out), optional:: ncerr
116
117Reference:
118[`nf90_open`](https://docs.unidata.ucar.edu/netcdf-fortran/current/f90_datasets.html#f90-nf90_open)
119
120## `nf95_redef`
121
122(basic change)
123
124      subroutine nf95_redef(ncid, ncerr)
125        integer, intent( in) :: ncid
126        integer, intent(out), optional :: ncerr
127
128Reference: [`nf90_redef`](https://docs.unidata.ucar.edu/netcdf-fortran/current/f90_datasets.html#f90-nf90_redef)
129
130## `nf95_sync`
131
132(basic change)
133
134```
135subroutine nf95_sync(ncid, ncerr)
136
137    integer, intent( in) :: ncid
138    integer, intent(out), optional :: ncerr
139```
Note: See TracBrowser for help on using the repository browser.