[26] | 1 | MODULE netcdf_mod |
---|
[488] | 2 | |
---|
| 3 | #ifndef CPP_NO_IO |
---|
| 4 | |
---|
[26] | 5 | USE netcdf |
---|
[488] | 6 | LOGICAL,PARAMETER :: no_io = .FALSE. |
---|
| 7 | |
---|
[44] | 8 | #ifndef CPP_NETCDF4 |
---|
[26] | 9 | INTEGER :: NF90_NETCDF4 |
---|
| 10 | INTEGER :: NF90_MPIIO |
---|
| 11 | INTEGER :: NF90_CHUNKED |
---|
| 12 | |
---|
| 13 | INTEGER,EXTERNAL :: NF90_CREATE_PAR |
---|
| 14 | INTEGER,EXTERNAL :: NF90_DEF_VAR_CHUNKING |
---|
[44] | 15 | #endif |
---|
[26] | 16 | |
---|
[398] | 17 | #ifdef CPP_NF90_DEF_VAR_CHUNKING |
---|
| 18 | INTEGER,EXTERNAL :: NF90_DEF_VAR_CHUNKING |
---|
| 19 | #endif |
---|
| 20 | |
---|
[26] | 21 | END MODULE netcdf_mod |
---|
| 22 | |
---|
[44] | 23 | #ifndef CPP_NETCDF4 |
---|
[26] | 24 | SUBROUTINE NF90_CREATE_PAR |
---|
| 25 | END |
---|
| 26 | |
---|
| 27 | SUBROUTINE NF90_DEF_VAR_CHUNKING |
---|
| 28 | END |
---|
[44] | 29 | #endif |
---|
[398] | 30 | |
---|
| 31 | #ifdef CPP_NF90_DEF_VAR_CHUNKING |
---|
| 32 | SUBROUTINE NF90_DEF_VAR_CHUNKING |
---|
| 33 | END |
---|
| 34 | #endif |
---|
[488] | 35 | |
---|
| 36 | |
---|
| 37 | #else |
---|
| 38 | |
---|
| 39 | LOGICAL,PARAMETER :: no_io = .TRUE. |
---|
| 40 | |
---|
| 41 | INTEGER :: NF90_NETCDF4 |
---|
| 42 | INTEGER :: NF90_MPIIO |
---|
| 43 | INTEGER :: NF90_CHUNKED |
---|
| 44 | |
---|
| 45 | INTEGER,EXTERNAL :: NF90_CREATE_PAR |
---|
| 46 | INTEGER,EXTERNAL :: NF90_DEF_VAR_CHUNKING |
---|
| 47 | INTEGER,EXTERNAL :: NF90_CREATE |
---|
| 48 | INTEGER,EXTERNAL :: NF90_DEF_DIM |
---|
| 49 | INTEGER,EXTERNAL :: NF90_PUT_ATT |
---|
| 50 | INTEGER,EXTERNAL :: NF90_ENDDEF |
---|
| 51 | INTEGER,EXTERNAL :: NF90_CLOSE |
---|
| 52 | INTEGER,EXTERNAL :: NF90_SYNC |
---|
| 53 | INTEGER,EXTERNAL :: NF90_OPEN |
---|
| 54 | INTEGER,EXTERNAL :: NF90_INQ_VARID |
---|
| 55 | INTEGER,EXTERNAL :: NF90_GET_ATT |
---|
| 56 | |
---|
| 57 | INTEGER :: NF90_NOWRITE |
---|
| 58 | INTEGER :: NF90_CLOBBER |
---|
| 59 | INTEGER :: NF90_UNLIMITED |
---|
| 60 | INTEGER :: NF90_DOUBLE |
---|
| 61 | INTEGER :: NF90_FLOAT |
---|
| 62 | INTEGER :: NF90_GLOBAL |
---|
| 63 | |
---|
| 64 | INTERFACE nf90_put_var |
---|
| 65 | MODULE PROCEDURE nf90_put_var_int0, nf90_put_var_int1, nf90_put_var_int2, nf90_put_var_int3,& |
---|
| 66 | nf90_put_var_real0, nf90_put_var_real1, nf90_put_var_real2, nf90_put_var_real3 |
---|
| 67 | END INTERFACE nf90_put_var |
---|
| 68 | |
---|
| 69 | INTERFACE nf90_get_var |
---|
| 70 | MODULE PROCEDURE nf90_get_var_int0, nf90_get_var_int1, nf90_get_var_int2, nf90_get_var_int3,& |
---|
| 71 | nf90_get_var_real0, nf90_get_var_real1, nf90_get_var_real2, nf90_get_var_real3 |
---|
| 72 | END INTERFACE nf90_get_var |
---|
| 73 | |
---|
| 74 | CONTAINS |
---|
| 75 | |
---|
| 76 | function nf90_def_var(ncid, name, xtype, dimids, varid) |
---|
| 77 | integer, intent( in) :: ncid |
---|
| 78 | character (len = *), intent( in) :: name |
---|
| 79 | integer, intent( in) :: xtype |
---|
| 80 | integer, dimension(:), optional, intent( in) :: dimids |
---|
| 81 | integer, intent(out) :: varid |
---|
| 82 | integer :: nf90_def_var |
---|
| 83 | end function nf90_def_var |
---|
| 84 | |
---|
| 85 | |
---|
| 86 | function nf90_put_var_int0(ncid, varid, values, start, count, stride, map) |
---|
| 87 | integer, intent( in) :: ncid, varid |
---|
| 88 | integer, intent( in) :: values |
---|
| 89 | integer, dimension(:), optional, intent( in) :: start, count, stride, map |
---|
| 90 | integer :: nf90_put_var_int0 |
---|
| 91 | end function nf90_put_var_int0 |
---|
| 92 | |
---|
| 93 | function nf90_put_var_int1(ncid, varid, values, start, count, stride, map) |
---|
| 94 | integer, intent( in) :: ncid, varid |
---|
| 95 | integer, intent( in) :: values(:) |
---|
| 96 | integer, dimension(:), optional, intent( in) :: start, count, stride, map |
---|
| 97 | integer :: nf90_put_var_int1 |
---|
| 98 | end function nf90_put_var_int1 |
---|
| 99 | |
---|
| 100 | function nf90_put_var_int2(ncid, varid, values, start, count, stride, map) |
---|
| 101 | integer, intent( in) :: ncid, varid |
---|
| 102 | integer, intent( in) :: values(:,:) |
---|
| 103 | integer, dimension(:), optional, intent( in) :: start, count, stride, map |
---|
| 104 | integer :: nf90_put_var_int2 |
---|
| 105 | end function nf90_put_var_int2 |
---|
| 106 | |
---|
| 107 | function nf90_put_var_int3(ncid, varid, values, start, count, stride, map) |
---|
| 108 | integer, intent( in) :: ncid, varid |
---|
| 109 | integer, intent( in) :: values(:,:,:) |
---|
| 110 | integer, dimension(:), optional, intent( in) :: start, count, stride, map |
---|
| 111 | integer :: nf90_put_var_int3 |
---|
| 112 | end function nf90_put_var_int3 |
---|
| 113 | |
---|
| 114 | function nf90_put_var_real0(ncid, varid, values, start, count, stride, map) |
---|
| 115 | integer, intent( in) :: ncid, varid |
---|
| 116 | real, intent( in) :: values |
---|
| 117 | integer, dimension(:), optional, intent( in) :: start, count, stride, map |
---|
| 118 | integer :: nf90_put_var_real0 |
---|
| 119 | end function nf90_put_var_real0 |
---|
| 120 | |
---|
| 121 | function nf90_put_var_real1(ncid, varid, values, start, count, stride, map) |
---|
| 122 | integer, intent( in) :: ncid, varid |
---|
| 123 | real, intent( in) :: values(:) |
---|
| 124 | integer, dimension(:), optional, intent( in) :: start, count, stride, map |
---|
| 125 | integer :: nf90_put_var_real1 |
---|
| 126 | end function nf90_put_var_real1 |
---|
| 127 | |
---|
| 128 | function nf90_put_var_real2(ncid, varid, values, start, count, stride, map) |
---|
| 129 | integer, intent( in) :: ncid, varid |
---|
| 130 | real, intent( in) :: values(:,:) |
---|
| 131 | integer, dimension(:), optional, intent( in) :: start, count, stride, map |
---|
| 132 | integer :: nf90_put_var_real2 |
---|
| 133 | end function nf90_put_var_real2 |
---|
| 134 | |
---|
| 135 | function nf90_put_var_real3(ncid, varid, values, start, count, stride, map) |
---|
| 136 | integer, intent( in) :: ncid, varid |
---|
| 137 | real, intent( in) :: values(:,:,:) |
---|
| 138 | integer, dimension(:), optional, intent( in) :: start, count, stride, map |
---|
| 139 | integer :: nf90_put_var_real3 |
---|
| 140 | end function nf90_put_var_real3 |
---|
| 141 | |
---|
| 142 | |
---|
| 143 | function nf90_get_var_int0(ncid, varid, values, start, count, stride, map) |
---|
| 144 | integer, intent( in) :: ncid, varid |
---|
| 145 | integer, intent( out) :: values |
---|
| 146 | integer, dimension(:), optional, intent( in) :: start, count, stride, map |
---|
| 147 | integer :: nf90_get_var_int0 |
---|
| 148 | end function nf90_get_var_int0 |
---|
| 149 | |
---|
| 150 | function nf90_get_var_int1(ncid, varid, values, start, count, stride, map) |
---|
| 151 | integer, intent( in) :: ncid, varid |
---|
| 152 | integer, intent( out) :: values(:) |
---|
| 153 | integer, dimension(:), optional, intent( in) :: start, count, stride, map |
---|
| 154 | integer :: nf90_get_var_int1 |
---|
| 155 | end function nf90_get_var_int1 |
---|
| 156 | |
---|
| 157 | function nf90_get_var_int2(ncid, varid, values, start, count, stride, map) |
---|
| 158 | integer, intent( in) :: ncid, varid |
---|
| 159 | integer, intent( out) :: values(:,:) |
---|
| 160 | integer, dimension(:), optional, intent( in) :: start, count, stride, map |
---|
| 161 | integer :: nf90_get_var_int2 |
---|
| 162 | end function nf90_get_var_int2 |
---|
| 163 | |
---|
| 164 | function nf90_get_var_int3(ncid, varid, values, start, count, stride, map) |
---|
| 165 | integer, intent( in) :: ncid, varid |
---|
| 166 | integer, intent( out) :: values(:,:,:) |
---|
| 167 | integer, dimension(:), optional, intent( in) :: start, count, stride, map |
---|
| 168 | integer :: nf90_get_var_int3 |
---|
| 169 | end function nf90_get_var_int3 |
---|
| 170 | |
---|
| 171 | function nf90_get_var_real0(ncid, varid, values, start, count, stride, map) |
---|
| 172 | integer, intent( in) :: ncid, varid |
---|
| 173 | real, intent( out) :: values |
---|
| 174 | integer, dimension(:), optional, intent( in) :: start, count, stride, map |
---|
| 175 | integer :: nf90_get_var_real0 |
---|
| 176 | end function nf90_get_var_real0 |
---|
| 177 | |
---|
| 178 | function nf90_get_var_real1(ncid, varid, values, start, count, stride, map) |
---|
| 179 | integer, intent( in) :: ncid, varid |
---|
| 180 | real, intent( out) :: values(:) |
---|
| 181 | integer, dimension(:), optional, intent( in) :: start, count, stride, map |
---|
| 182 | integer :: nf90_get_var_real1 |
---|
| 183 | end function nf90_get_var_real1 |
---|
| 184 | |
---|
| 185 | function nf90_get_var_real2(ncid, varid, values, start, count, stride, map) |
---|
| 186 | integer, intent( in) :: ncid, varid |
---|
| 187 | real, intent( out) :: values(:,:) |
---|
| 188 | integer, dimension(:), optional, intent( in) :: start, count, stride, map |
---|
| 189 | integer :: nf90_get_var_real2 |
---|
| 190 | end function nf90_get_var_real2 |
---|
| 191 | |
---|
| 192 | function nf90_get_var_real3(ncid, varid, values, start, count, stride, map) |
---|
| 193 | integer, intent( in) :: ncid, varid |
---|
| 194 | real, intent( out) :: values(:,:,:) |
---|
| 195 | integer, dimension(:), optional, intent( in) :: start, count, stride, map |
---|
| 196 | integer :: nf90_get_var_real3 |
---|
| 197 | end function nf90_get_var_real3 |
---|
| 198 | |
---|
| 199 | END MODULE netcdf_mod |
---|
| 200 | |
---|
| 201 | SUBROUTINE NF90_CREATE_PAR |
---|
| 202 | END |
---|
| 203 | |
---|
| 204 | SUBROUTINE NF90_DEF_VAR_CHUNKING |
---|
| 205 | END |
---|
| 206 | |
---|
| 207 | SUBROUTINE NF90_CREATE |
---|
| 208 | END |
---|
| 209 | |
---|
| 210 | SUBROUTINE NF90_DEF_DIM |
---|
| 211 | END |
---|
| 212 | |
---|
| 213 | SUBROUTINE NF90_PUT_ATT |
---|
| 214 | END |
---|
| 215 | |
---|
| 216 | SUBROUTINE NF90_ENDDEF |
---|
| 217 | END |
---|
| 218 | |
---|
| 219 | SUBROUTINE NF90_CLOSE |
---|
| 220 | END |
---|
| 221 | |
---|
| 222 | SUBROUTINE NF90_SYNC |
---|
| 223 | END |
---|
| 224 | |
---|
| 225 | SUBROUTINE NF90_OPEN |
---|
| 226 | END |
---|
| 227 | |
---|
| 228 | SUBROUTINE NF90_INQ_VARID |
---|
| 229 | END |
---|
| 230 | |
---|
| 231 | SUBROUTINE NF90_GET_ATT |
---|
| 232 | END |
---|
| 233 | |
---|
| 234 | #endif |
---|
| 235 | |
---|