[4918] | 1 | module nf95_put_var_m |
---|
| 2 | |
---|
[5084] | 3 | use netcdf, only: nf90_put_var |
---|
[4918] | 4 | use nf95_abort_m, only: nf95_abort |
---|
| 5 | use check_start_count_m, only: check_start_count |
---|
| 6 | use nf95_constants, only: nf95_noerr |
---|
| 7 | |
---|
| 8 | implicit none |
---|
| 9 | |
---|
| 10 | interface nf95_put_var |
---|
| 11 | module procedure nf95_put_var_FourByteReal, nf95_put_var_FourByteInt, & |
---|
| 12 | nf95_put_var_EightByteReal, nf95_put_var_1D_FourByteReal, & |
---|
| 13 | nf95_put_var_1D_FourByteInt, nf95_put_var_1D_EightByteReal, & |
---|
| 14 | nf95_put_var_2D_FourByteReal, nf95_put_var_2D_FourByteInt, & |
---|
| 15 | nf95_put_var_2D_EightByteReal, nf95_put_var_3D_FourByteReal, & |
---|
| 16 | nf95_put_var_3D_EightByteReal, nf95_put_var_4D_FourByteReal, & |
---|
| 17 | nf95_put_var_4D_EightByteReal |
---|
| 18 | end interface |
---|
| 19 | |
---|
| 20 | private |
---|
| 21 | public nf95_put_var |
---|
| 22 | |
---|
| 23 | contains |
---|
| 24 | |
---|
| 25 | subroutine nf95_put_var_FourByteReal(ncid, varid, values, start, ncerr) |
---|
| 26 | |
---|
| 27 | use typesizes, only: FourByteReal |
---|
| 28 | |
---|
| 29 | integer, intent(in) :: ncid, varid |
---|
| 30 | real(kind = FourByteReal), intent(in) :: values |
---|
| 31 | integer, dimension(:), optional, intent(in) :: start |
---|
| 32 | integer, intent(out), optional:: ncerr |
---|
| 33 | |
---|
| 34 | ! Variable local to the procedure: |
---|
| 35 | integer ncerr_not_opt |
---|
| 36 | |
---|
| 37 | !------------------- |
---|
| 38 | |
---|
| 39 | call check_start_count("nf95_put_var_FourByteReal", ncid, varid, start, & |
---|
| 40 | rank_values=0) |
---|
| 41 | |
---|
| 42 | ncerr_not_opt = nf90_put_var(ncid, varid, values, start) |
---|
| 43 | if (present(ncerr)) then |
---|
| 44 | ncerr = ncerr_not_opt |
---|
| 45 | else |
---|
| 46 | if (ncerr_not_opt /= nf95_noerr) call & |
---|
| 47 | nf95_abort("nf95_put_var_FourByteReal", ncerr_not_opt, ncid, varid) |
---|
| 48 | end if |
---|
| 49 | |
---|
| 50 | end subroutine nf95_put_var_FourByteReal |
---|
| 51 | |
---|
| 52 | !*********************** |
---|
| 53 | |
---|
| 54 | subroutine nf95_put_var_FourByteInt(ncid, varid, values, start, ncerr) |
---|
| 55 | |
---|
| 56 | use typesizes, only: FourByteInt |
---|
| 57 | |
---|
| 58 | integer, intent(in) :: ncid, varid |
---|
| 59 | integer(kind = FourByteInt), intent(in) :: values |
---|
| 60 | integer, dimension(:), optional, intent(in) :: start |
---|
| 61 | integer, intent(out), optional:: ncerr |
---|
| 62 | |
---|
| 63 | ! Variable local to the procedure: |
---|
| 64 | integer ncerr_not_opt |
---|
| 65 | |
---|
| 66 | !------------------- |
---|
| 67 | |
---|
| 68 | call check_start_count("nf95_put_var_FourByteInt", ncid, varid, start, & |
---|
| 69 | rank_values=0) |
---|
| 70 | |
---|
| 71 | ncerr_not_opt = nf90_put_var(ncid, varid, values, start) |
---|
| 72 | if (present(ncerr)) then |
---|
| 73 | ncerr = ncerr_not_opt |
---|
| 74 | else |
---|
| 75 | if (ncerr_not_opt /= nf95_noerr) call & |
---|
| 76 | nf95_abort("nf95_put_var_FourByteInt", ncerr_not_opt, ncid, varid) |
---|
| 77 | end if |
---|
| 78 | |
---|
| 79 | end subroutine nf95_put_var_FourByteInt |
---|
| 80 | |
---|
| 81 | !*********************** |
---|
| 82 | |
---|
| 83 | subroutine nf95_put_var_EightByteReal(ncid, varid, values, start, ncerr) |
---|
| 84 | |
---|
| 85 | use typesizes, only: EightByteReal |
---|
| 86 | |
---|
| 87 | integer, intent(in) :: ncid, varid |
---|
| 88 | real(kind = EightByteReal), intent(in) :: values |
---|
| 89 | integer, dimension(:), optional, intent(in) :: start |
---|
| 90 | integer, intent(out), optional:: ncerr |
---|
| 91 | |
---|
| 92 | ! Variable local to the procedure: |
---|
| 93 | integer ncerr_not_opt |
---|
| 94 | |
---|
| 95 | !------------------- |
---|
| 96 | |
---|
| 97 | call check_start_count("nf95_put_var_EightByteReal", ncid, varid, start, & |
---|
| 98 | rank_values=0) |
---|
| 99 | |
---|
| 100 | ncerr_not_opt = nf90_put_var(ncid, varid, values, start) |
---|
| 101 | if (present(ncerr)) then |
---|
| 102 | ncerr = ncerr_not_opt |
---|
| 103 | else |
---|
| 104 | if (ncerr_not_opt /= nf95_noerr) call & |
---|
| 105 | nf95_abort("nf95_put_var_EightByteReal", ncerr_not_opt, ncid, varid) |
---|
| 106 | end if |
---|
| 107 | |
---|
| 108 | end subroutine nf95_put_var_EightByteReal |
---|
| 109 | |
---|
| 110 | !*********************** |
---|
| 111 | |
---|
| 112 | subroutine nf95_put_var_1D_FourByteReal(ncid, varid, values, start, & |
---|
| 113 | count_nc, stride, map, ncerr) |
---|
| 114 | |
---|
| 115 | use typesizes, only: FourByteReal |
---|
| 116 | |
---|
| 117 | integer, intent(in) :: ncid, varid |
---|
| 118 | real(kind = FourByteReal), intent(in) :: values(:) |
---|
| 119 | integer, dimension(:), optional, intent(in) :: start, count_nc, stride, map |
---|
| 120 | integer, intent(out), optional:: ncerr |
---|
| 121 | |
---|
| 122 | ! Variable local to the procedure: |
---|
| 123 | integer ncerr_not_opt |
---|
| 124 | |
---|
| 125 | !------------------- |
---|
| 126 | |
---|
| 127 | call check_start_count("nf95_put_var_1D_FourByteReal", ncid, varid, & |
---|
| 128 | start, count_nc, rank_values=1) |
---|
| 129 | |
---|
| 130 | ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count_nc, & |
---|
| 131 | stride, map) |
---|
| 132 | if (present(ncerr)) then |
---|
| 133 | ncerr = ncerr_not_opt |
---|
| 134 | else |
---|
| 135 | if (ncerr_not_opt /= nf95_noerr) call & |
---|
| 136 | nf95_abort("nf95_put_var_1D_FourByteReal", ncerr_not_opt, ncid, & |
---|
| 137 | varid) |
---|
| 138 | end if |
---|
| 139 | |
---|
| 140 | end subroutine nf95_put_var_1D_FourByteReal |
---|
| 141 | |
---|
| 142 | !*********************** |
---|
| 143 | |
---|
| 144 | subroutine nf95_put_var_1D_FourByteInt(ncid, varid, values, start, & |
---|
| 145 | count_nc, stride, map, ncerr) |
---|
| 146 | |
---|
| 147 | use typesizes, only: FourByteInt |
---|
| 148 | |
---|
| 149 | integer, intent(in) :: ncid, varid |
---|
| 150 | integer(kind = FourByteInt), intent(in) :: values(:) |
---|
| 151 | integer, dimension(:), optional, intent(in) :: start, count_nc, stride, map |
---|
| 152 | integer, intent(out), optional:: ncerr |
---|
| 153 | |
---|
| 154 | ! Variable local to the procedure: |
---|
| 155 | integer ncerr_not_opt |
---|
| 156 | |
---|
| 157 | !------------------- |
---|
| 158 | |
---|
| 159 | call check_start_count("nf95_put_var_1D_FourByteInt", ncid, varid, start, & |
---|
| 160 | count_nc, rank_values=1) |
---|
| 161 | |
---|
| 162 | ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count_nc, & |
---|
| 163 | stride, map) |
---|
| 164 | if (present(ncerr)) then |
---|
| 165 | ncerr = ncerr_not_opt |
---|
| 166 | else |
---|
| 167 | if (ncerr_not_opt /= nf95_noerr) call & |
---|
| 168 | nf95_abort("nf95_put_var_1D_FourByteInt", ncerr_not_opt, ncid, & |
---|
| 169 | varid) |
---|
| 170 | end if |
---|
| 171 | |
---|
| 172 | end subroutine nf95_put_var_1D_FourByteInt |
---|
| 173 | |
---|
| 174 | !*********************** |
---|
| 175 | |
---|
| 176 | subroutine nf95_put_var_1D_EightByteReal(ncid, varid, values, start, & |
---|
| 177 | count_nc, stride, map, ncerr) |
---|
| 178 | |
---|
| 179 | use typesizes, only: eightByteReal |
---|
| 180 | |
---|
| 181 | integer, intent(in) :: ncid, varid |
---|
| 182 | real (kind = EightByteReal), intent(in) :: values(:) |
---|
| 183 | integer, dimension(:), optional, intent(in):: start, count_nc, stride, map |
---|
| 184 | integer, intent(out), optional:: ncerr |
---|
| 185 | |
---|
| 186 | ! Variable local to the procedure: |
---|
| 187 | integer ncerr_not_opt |
---|
| 188 | |
---|
| 189 | !------------------- |
---|
| 190 | |
---|
| 191 | call check_start_count("nf95_put_var_1D_EightByteReal", ncid, varid, & |
---|
| 192 | start, count_nc, rank_values=1) |
---|
| 193 | |
---|
| 194 | ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count_nc, & |
---|
| 195 | stride, map) |
---|
| 196 | if (present(ncerr)) then |
---|
| 197 | ncerr = ncerr_not_opt |
---|
| 198 | else |
---|
| 199 | if (ncerr_not_opt /= nf95_noerr) call & |
---|
| 200 | nf95_abort("nf95_put_var_1D_eightByteReal", ncerr_not_opt, ncid, & |
---|
| 201 | varid) |
---|
| 202 | end if |
---|
| 203 | |
---|
| 204 | end subroutine nf95_put_var_1D_EightByteReal |
---|
| 205 | |
---|
| 206 | !*********************** |
---|
| 207 | |
---|
| 208 | subroutine nf95_put_var_2D_FourByteReal(ncid, varid, values, start, & |
---|
| 209 | count_nc, stride, map, ncerr) |
---|
| 210 | |
---|
| 211 | use typesizes, only: FourByteReal |
---|
| 212 | |
---|
| 213 | integer, intent(in) :: ncid, varid |
---|
| 214 | real (kind = FourByteReal), intent(in) :: values(:, :) |
---|
| 215 | integer, dimension(:), optional, intent(in) :: start, count_nc, stride, map |
---|
| 216 | integer, intent(out), optional:: ncerr |
---|
| 217 | |
---|
| 218 | ! Variable local to the procedure: |
---|
| 219 | integer ncerr_not_opt |
---|
| 220 | |
---|
| 221 | !------------------- |
---|
| 222 | |
---|
| 223 | call check_start_count("nf95_put_var_2D_FourByteReal", ncid, varid, & |
---|
| 224 | start, count_nc, rank_values=2) |
---|
| 225 | |
---|
| 226 | ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count_nc, & |
---|
| 227 | stride, map) |
---|
| 228 | if (present(ncerr)) then |
---|
| 229 | ncerr = ncerr_not_opt |
---|
| 230 | else |
---|
| 231 | if (ncerr_not_opt /= nf95_noerr) call & |
---|
| 232 | nf95_abort("nf95_put_var_2D_FourByteReal", ncerr_not_opt, ncid, & |
---|
| 233 | varid) |
---|
| 234 | end if |
---|
| 235 | |
---|
| 236 | end subroutine nf95_put_var_2D_FourByteReal |
---|
| 237 | |
---|
| 238 | !*********************** |
---|
| 239 | |
---|
| 240 | subroutine nf95_put_var_2D_FourByteint(ncid, varid, values, start, & |
---|
| 241 | count_nc, stride, map, ncerr) |
---|
| 242 | |
---|
| 243 | use typesizes, only: FourByteInt |
---|
| 244 | |
---|
| 245 | integer, intent(in) :: ncid, varid |
---|
| 246 | integer(kind = FourByteInt), intent(in) :: values(:, :) |
---|
| 247 | integer, dimension(:), optional, intent(in) :: start, count_nc, stride, map |
---|
| 248 | integer, intent(out), optional:: ncerr |
---|
| 249 | |
---|
| 250 | ! Variable local to the procedure: |
---|
| 251 | integer ncerr_not_opt |
---|
| 252 | |
---|
| 253 | !------------------- |
---|
| 254 | |
---|
| 255 | call check_start_count("nf95_put_var_2D_FourByteInt", ncid, varid, & |
---|
| 256 | start, count_nc, rank_values=2) |
---|
| 257 | |
---|
| 258 | ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count_nc, & |
---|
| 259 | stride, map) |
---|
| 260 | if (present(ncerr)) then |
---|
| 261 | ncerr = ncerr_not_opt |
---|
| 262 | else |
---|
| 263 | if (ncerr_not_opt /= nf95_noerr) call & |
---|
| 264 | nf95_abort("nf95_put_var_2D_FourByteInt", ncerr_not_opt, ncid, & |
---|
| 265 | varid) |
---|
| 266 | end if |
---|
| 267 | |
---|
| 268 | end subroutine nf95_put_var_2D_FourByteint |
---|
| 269 | |
---|
| 270 | !*********************** |
---|
| 271 | |
---|
| 272 | subroutine nf95_put_var_2D_EightByteReal(ncid, varid, values, start, & |
---|
| 273 | count_nc, stride, map, ncerr) |
---|
| 274 | |
---|
| 275 | use typesizes, only: EightByteReal |
---|
| 276 | |
---|
| 277 | integer, intent(in) :: ncid, varid |
---|
| 278 | real (kind = EightByteReal), intent(in) :: values(:, :) |
---|
| 279 | integer, dimension(:), optional, intent(in) :: start, count_nc, stride, map |
---|
| 280 | integer, intent(out), optional:: ncerr |
---|
| 281 | |
---|
| 282 | ! Variable local to the procedure: |
---|
| 283 | integer ncerr_not_opt |
---|
| 284 | |
---|
| 285 | !------------------- |
---|
| 286 | |
---|
| 287 | call check_start_count("nf95_put_var_2D_EightByteReal", ncid, varid, & |
---|
| 288 | start, count_nc, rank_values=2) |
---|
| 289 | |
---|
| 290 | ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count_nc, & |
---|
| 291 | stride, map) |
---|
| 292 | if (present(ncerr)) then |
---|
| 293 | ncerr = ncerr_not_opt |
---|
| 294 | else |
---|
| 295 | if (ncerr_not_opt /= nf95_noerr) call & |
---|
| 296 | nf95_abort("nf95_put_var_2D_EightByteReal", ncerr_not_opt, ncid, & |
---|
| 297 | varid) |
---|
| 298 | end if |
---|
| 299 | |
---|
| 300 | end subroutine nf95_put_var_2D_EightByteReal |
---|
| 301 | |
---|
| 302 | !*********************** |
---|
| 303 | |
---|
| 304 | subroutine nf95_put_var_3D_FourByteReal(ncid, varid, values, start, & |
---|
| 305 | count_nc, stride, map, ncerr) |
---|
| 306 | |
---|
| 307 | use typesizes, only: FourByteReal |
---|
| 308 | |
---|
| 309 | integer, intent(in) :: ncid, varid |
---|
| 310 | real (kind = FourByteReal), intent(in) :: values(:, :, :) |
---|
| 311 | integer, dimension(:), optional, intent(in) :: start, count_nc, stride, map |
---|
| 312 | integer, intent(out), optional:: ncerr |
---|
| 313 | |
---|
| 314 | ! Variable local to the procedure: |
---|
| 315 | integer ncerr_not_opt |
---|
| 316 | |
---|
| 317 | !------------------- |
---|
| 318 | |
---|
| 319 | call check_start_count("nf95_put_var_3D_FourByteReal", ncid, varid, & |
---|
| 320 | start, count_nc, rank_values=3) |
---|
| 321 | |
---|
| 322 | ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count_nc, & |
---|
| 323 | stride, map) |
---|
| 324 | if (present(ncerr)) then |
---|
| 325 | ncerr = ncerr_not_opt |
---|
| 326 | else |
---|
| 327 | if (ncerr_not_opt /= nf95_noerr) call & |
---|
| 328 | nf95_abort("nf95_put_var_3D_FourByteReal", ncerr_not_opt, ncid, & |
---|
| 329 | varid) |
---|
| 330 | end if |
---|
| 331 | |
---|
| 332 | end subroutine nf95_put_var_3D_FourByteReal |
---|
| 333 | |
---|
| 334 | !*********************** |
---|
| 335 | |
---|
| 336 | subroutine nf95_put_var_3D_EightByteReal(ncid, varid, values, start, & |
---|
| 337 | count_nc, stride, map, ncerr) |
---|
| 338 | |
---|
| 339 | use typesizes, only: eightByteReal |
---|
| 340 | |
---|
| 341 | integer, intent(in) :: ncid, varid |
---|
| 342 | real (kind = EightByteReal), intent(in) :: values(:, :, :) |
---|
| 343 | integer, dimension(:), optional, intent(in) :: start, count_nc, stride, map |
---|
| 344 | integer, intent(out), optional:: ncerr |
---|
| 345 | |
---|
| 346 | ! Variable local to the procedure: |
---|
| 347 | integer ncerr_not_opt |
---|
| 348 | |
---|
| 349 | !------------------- |
---|
| 350 | |
---|
| 351 | call check_start_count("nf95_put_var_3D_EightByteReal", ncid, varid, & |
---|
| 352 | start, count_nc, rank_values=3) |
---|
| 353 | |
---|
| 354 | ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count_nc, & |
---|
| 355 | stride, map) |
---|
| 356 | if (present(ncerr)) then |
---|
| 357 | ncerr = ncerr_not_opt |
---|
| 358 | else |
---|
| 359 | if (ncerr_not_opt /= nf95_noerr) call & |
---|
| 360 | nf95_abort("nf95_put_var_3D_eightByteReal", ncerr_not_opt, ncid, & |
---|
| 361 | varid) |
---|
| 362 | end if |
---|
| 363 | |
---|
| 364 | end subroutine nf95_put_var_3D_EightByteReal |
---|
| 365 | |
---|
| 366 | !*********************** |
---|
| 367 | |
---|
| 368 | subroutine nf95_put_var_4D_FourByteReal(ncid, varid, values, start, & |
---|
| 369 | count_nc, stride, map, ncerr) |
---|
| 370 | |
---|
| 371 | use typesizes, only: FourByteReal |
---|
| 372 | |
---|
| 373 | integer, intent(in) :: ncid, varid |
---|
| 374 | real (kind = FourByteReal), intent(in) :: values(:, :, :, :) |
---|
| 375 | integer, dimension(:), optional, intent(in) :: start, count_nc, stride, map |
---|
| 376 | integer, intent(out), optional:: ncerr |
---|
| 377 | |
---|
| 378 | ! Variable local to the procedure: |
---|
| 379 | integer ncerr_not_opt |
---|
| 380 | |
---|
| 381 | !------------------- |
---|
| 382 | |
---|
| 383 | call check_start_count("nf95_put_var_4D_FourByteReal", ncid, varid, & |
---|
| 384 | start, count_nc, rank_values=4) |
---|
| 385 | |
---|
| 386 | ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count_nc, & |
---|
| 387 | stride, map) |
---|
| 388 | if (present(ncerr)) then |
---|
| 389 | ncerr = ncerr_not_opt |
---|
| 390 | else |
---|
| 391 | if (ncerr_not_opt /= nf95_noerr) call & |
---|
| 392 | nf95_abort("nf95_put_var_4D_FourByteReal", ncerr_not_opt, ncid, & |
---|
| 393 | varid) |
---|
| 394 | end if |
---|
| 395 | |
---|
| 396 | end subroutine nf95_put_var_4D_FourByteReal |
---|
| 397 | |
---|
| 398 | !*********************** |
---|
| 399 | |
---|
| 400 | subroutine nf95_put_var_4D_EightByteReal(ncid, varid, values, start, & |
---|
| 401 | count_nc, stride, map, ncerr) |
---|
| 402 | |
---|
| 403 | use typesizes, only: EightByteReal |
---|
| 404 | |
---|
| 405 | integer, intent(in):: ncid, varid |
---|
| 406 | real(kind = EightByteReal), intent(in):: values(:, :, :, :) |
---|
| 407 | integer, dimension(:), optional, intent(in):: start, count_nc, stride, map |
---|
| 408 | integer, intent(out), optional:: ncerr |
---|
| 409 | |
---|
| 410 | ! Variable local to the procedure: |
---|
| 411 | integer ncerr_not_opt |
---|
| 412 | |
---|
| 413 | !------------------- |
---|
| 414 | |
---|
| 415 | call check_start_count("nf95_put_var_4D_EightByteReal", ncid, varid, & |
---|
| 416 | start, count_nc, rank_values=4) |
---|
| 417 | |
---|
| 418 | ncerr_not_opt = nf90_put_var(ncid, varid, values, start, count_nc, & |
---|
| 419 | stride, map) |
---|
| 420 | if (present(ncerr)) then |
---|
| 421 | ncerr = ncerr_not_opt |
---|
| 422 | else |
---|
| 423 | if (ncerr_not_opt /= nf95_noerr) call & |
---|
| 424 | nf95_abort("nf95_put_var_4D_EightByteReal", ncerr_not_opt, ncid, & |
---|
| 425 | varid) |
---|
| 426 | end if |
---|
| 427 | |
---|
| 428 | end subroutine nf95_put_var_4D_EightByteReal |
---|
| 429 | |
---|
| 430 | end module nf95_put_var_m |
---|