[4918] | 1 | # Datasets & co |
---|
| 2 | |
---|
| 3 | This page describles procedures handling a whole dataset, or handling |
---|
| 4 | a combination of NetCDF variables and dimensions. |
---|
| 5 | |
---|
| 6 | See the [improvements page](improvements.md) for an |
---|
| 7 | explanation 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 | |
---|
| 18 | Reference: [`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 | |
---|
| 32 | Reference: [`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 | |
---|
| 43 | This procedure is a shortcut to create a NetCDF file containing a |
---|
| 44 | single primary variable, with all its coordinates. The coordinates are |
---|
| 45 | specified 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 | |
---|
| 53 | After the call to `nf95_create_single`, the NetCDF dataset is still in |
---|
| 54 | define 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 | |
---|
| 65 | Reference: [`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 | |
---|
| 85 | This procedure returns the name, dimension id or variable id of the |
---|
| 86 | NetCDF coordinate with standard name `std_name`, if such a coordinate |
---|
| 87 | exists. The standard name is only used to know what to search, it is not |
---|
| 88 | used for the search itself. The search itself is done via a string match |
---|
| 89 | on the attribute \"units\". So the NetCDF variable one looks for does |
---|
| 90 | not 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 | |
---|
| 104 | Reference: [`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 | |
---|
| 117 | Reference: |
---|
| 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 | |
---|
| 128 | Reference: [`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 | ``` |
---|
| 135 | subroutine nf95_sync(ncid, ncerr) |
---|
| 136 | |
---|
| 137 | integer, intent( in) :: ncid |
---|
| 138 | integer, intent(out), optional :: ncerr |
---|
| 139 | ``` |
---|