1 #include "nfconfig.inc" 43 Integer,
Intent(IN) :: ncid, varid
44 Integer,
Intent(IN) :: ndex(*)
45 Character(LEN=1),
Intent(IN) :: chval
49 Integer(C_INT) :: cncid, cvarid, cndims, cstat1, cstatus
50 Type(c_ptr) :: cndexptr
53 Integer(C_SIZE_T),
ALLOCATABLE,
TARGET :: cndex(:)
63 If (cstat1 == nc_noerr)
Then 65 ALLOCATE(cndex(ndims))
66 cndex(1:ndims) = ndex(ndims:1:-1) - 1
67 cndexptr = c_loc(cndex)
78 If (
ALLOCATED(cndex))
DEALLOCATE(cndex)
90 Integer,
Intent(IN) :: ncid, varid
91 Integer,
Intent(IN) :: ndex(*)
92 Integer(NFINT1),
Intent(IN) :: ival
96 Integer(C_INT) :: cncid, cvarid, cndims, cstat1, cstatus
97 Type(c_ptr) :: cndexptr
98 Integer(CINT1) :: cival
101 Integer(C_SIZE_T),
ALLOCATABLE,
TARGET :: cndex(:)
103 If (c_signed_char < 0)
Then 114 cndexptr = c_null_ptr
117 If (cstat1 == nc_noerr)
Then 119 ALLOCATE(cndex(ndims))
120 cndex(1:ndims) = ndex(ndims:1:-1) - 1
121 cndexptr = c_loc(cndex)
125 #if NF_INT1_IS_C_SIGNED_CHAR 127 #elif NF_INT1_IS_C_SHORT 129 #elif NF_INT1_IS_C_INT 131 #elif NF_INT1_IS_C_LONG 139 cndexptr = c_null_ptr
140 If (
ALLOCATED(cndex))
DEALLOCATE(cndex)
152 Integer,
Intent(IN) :: ncid, varid
153 Integer,
Intent(IN) :: ndex(*)
154 Integer(NFINT2),
Intent(IN) :: ival
158 Integer(C_INT) :: cncid, cvarid, cndims, cstat1, cstatus
159 Type(c_ptr) :: cndexptr
160 Integer(CINT2) :: cival
163 Integer(C_SIZE_T),
ALLOCATABLE,
TARGET :: cndex(:)
165 If (c_short < 0)
Then 176 cndexptr = c_null_ptr
179 If (cstat1 == nc_noerr)
Then 181 ALLOCATE(cndex(ndims))
182 cndex(1:ndims) = ndex(ndims:1:-1) - 1
183 cndexptr = c_loc(cndex)
187 #if NF_INT2_IS_C_SHORT 189 #elif NF_INT2_IS_C_INT 191 #elif NF_INT2_IS_C_LONG 199 cndexptr = c_null_ptr
200 If (
ALLOCATED(cndex))
DEALLOCATE(cndex)
212 Integer,
Intent(IN) :: ncid, varid
213 Integer,
Intent(IN) :: ndex(*)
214 Integer(NFINT),
Intent(IN) :: ival
218 Integer(C_INT) :: cncid, cvarid, cndims, cstat1, cstatus
219 Type(c_ptr) :: cndexptr
220 Integer(CINT) :: cival
223 Integer(C_SIZE_T),
ALLOCATABLE,
TARGET :: cndex(:)
231 cndexptr = c_null_ptr
234 If (cstat1 == nc_noerr)
Then 236 ALLOCATE(cndex(ndims))
237 cndex(1:ndims) = ndex(ndims:1:-1) - 1
238 cndexptr = c_loc(cndex)
244 #elif NF_INT_IS_C_LONG 252 cndexptr = c_null_ptr
253 If (
ALLOCATED(cndex))
DEALLOCATE(cndex)
265 Integer,
Intent(IN) :: ncid, varid
266 Integer,
Intent(IN) :: ndex(*)
267 Real(NFREAL),
Intent(IN) :: rval
271 Integer(C_INT) :: cncid, cvarid, cndims, cstat1, cstatus
272 Type(c_ptr) :: cndexptr
275 Integer(C_SIZE_T),
ALLOCATABLE,
TARGET :: cndex(:)
282 cndexptr = c_null_ptr
285 If (cstat1 == nc_noerr)
Then 287 ALLOCATE(cndex(ndims))
288 cndex(1:ndims) = ndex(ndims:1:-1) - 1
289 cndexptr = c_loc(cndex)
293 #if NF_REAL_IS_C_DOUBLE 303 cndexptr = c_null_ptr
304 If (
ALLOCATED(cndex))
DEALLOCATE(cndex)
316 Integer,
Intent(IN) :: ncid, varid
317 Integer,
Intent(IN) :: ndex(*)
318 Real(RK8),
Intent(IN) :: dval
322 Integer(C_INT) :: cncid, cvarid, cndims, cstat1, cstatus
323 Type(c_ptr) :: cndexptr
326 Integer(C_SIZE_T),
ALLOCATABLE,
TARGET :: cndex(:)
333 cndexptr = c_null_ptr
336 If (cstat1 == nc_noerr)
Then 338 ALLOCATE(cndex(ndims))
339 cndex(1:ndims) = ndex(ndims:1:-1) - 1
340 cndexptr = c_loc(cndex)
350 cndexptr = c_null_ptr
351 If (
ALLOCATED(cndex))
DEALLOCATE(cndex)
355 Function nf_put_var1(ncid, varid, ndex, values) RESULT(status)
366 Integer,
Intent(IN) :: ncid, varid
367 Integer,
Intent(IN) :: ndex(*)
368 Character(KIND=C_CHAR),
Intent(IN),
TARGET :: values(*)
372 Integer(C_INT) :: cncid, cvarid, cndims, cstat1, cstatus
373 Type(c_ptr) :: cndexptr, cvaluesptr
376 Integer(C_SIZE_T),
ALLOCATABLE,
TARGET :: cndex(:)
383 cndexptr = c_null_ptr
386 If (cstat1 == nc_noerr)
Then 388 ALLOCATE(cndex(ndims))
389 cndex(1:ndims) = ndex(ndims:1:-1) - 1
390 cndexptr = c_loc(cndex)
393 cndex(1:ndims) = ndex(ndims:1:-1) - 1
394 cndexptr = c_loc(cndex)
398 cvaluesptr = c_loc(values)
400 cstatus =
nc_put_var1(cncid, cvarid, cndexptr, cvaluesptr)
406 cndexptr = c_null_ptr
407 If (
ALLOCATED(cndex))
DEALLOCATE(cndex)
419 Integer,
Intent(IN) :: ncid, varid
420 Integer,
Intent(IN) :: ndex(*)
421 Character(LEN=1),
Intent(OUT) :: chval
425 Integer(C_INT) :: cncid, cvarid, cndims, cstat1, cstatus
426 Type(c_ptr) :: cndexptr
429 Integer(C_SIZE_T),
ALLOCATABLE,
TARGET :: cndex(:)
437 cndexptr = c_null_ptr
440 If (cstat1 == nc_noerr)
Then 442 ALLOCATE(cndex(ndims))
443 cndex(1:ndims) = ndex(ndims:1:-1) -1
444 cndexptr = c_loc(cndex)
454 cndexptr = c_null_ptr
455 If (
ALLOCATED(cndex))
DEALLOCATE(cndex)
467 Integer,
Intent(IN) :: ncid, varid
468 Integer,
Intent(IN) :: ndex(*)
469 Integer(NFINT1),
Intent(OUT) :: ival
473 Integer(C_INT) :: cncid, cvarid, cndims, cstat1, cstatus
474 Type(c_ptr) :: cndexptr
475 Integer(CINT1) :: cival
478 Integer(C_SIZE_T),
ALLOCATABLE,
TARGET :: cndex(:)
480 If (c_signed_char < 0)
Then 490 cndexptr = c_null_ptr
493 If (cstat1 == nc_noerr)
Then 495 ALLOCATE(cndex(ndims))
496 cndex(1:ndims) = ndex(ndims:1:-1) - 1
497 cndexptr = c_loc(cndex)
501 #if NF_INT1_IS_C_SIGNED_CHAR 503 #elif NF_INT1_IS_C_SHORT 505 #elif NF_INT1_IS_C_INT 507 #elif NF_INT1_IS_C_LONG 516 cndexptr = c_null_ptr
517 If (
ALLOCATED(cndex))
DEALLOCATE(cndex)
529 Integer,
Intent(IN) :: ncid, varid
530 Integer,
Intent(IN) :: ndex(*)
531 Integer(NFINT2),
Intent(OUT) :: ival
535 Integer(C_INT) :: cncid, cvarid, cndims, cstat1, cstatus
536 Type(c_ptr) :: cndexptr
537 Integer(CINT2) :: cival
540 Integer(C_SIZE_T),
ALLOCATABLE,
TARGET :: cndex(:)
542 If (c_short < 0)
Then 552 cndexptr = c_null_ptr
555 If (cstat1 == nc_noerr)
Then 557 ALLOCATE(cndex(ndims))
558 cndex(1:ndims) = ndex(ndims:1:-1) - 1
559 cndexptr = c_loc(cndex)
563 #if NF_INT2_IS_C_SHORT 565 #elif NF_INT2_IS_C_INT 567 #elif NF_INT2_IS_C_LONG 576 cndexptr = c_null_ptr
577 If (
ALLOCATED(cndex))
DEALLOCATE(cndex)
589 Integer,
Intent(IN) :: ncid, varid
590 Integer,
Intent(IN) :: ndex(*)
591 Integer,
Intent(OUT) :: ival
595 Integer(C_INT) :: cncid, cvarid, cndims, cstat1, cstatus
596 Type(c_ptr) :: cndexptr
597 Integer(CINT) :: cival
600 Integer(C_SIZE_T),
ALLOCATABLE,
TARGET :: cndex(:)
607 cndexptr = c_null_ptr
610 If (cstat1 == nc_noerr)
Then 612 ALLOCATE(cndex(ndims))
613 cndex(1:ndims) = ndex(ndims:1:-1) - 1
614 cndexptr = c_loc(cndex)
620 #elif NF_INT_IS_C_LONG 629 cndexptr = c_null_ptr
630 If (
ALLOCATED(cndex))
DEALLOCATE(cndex)
642 Integer,
Intent(IN) :: ncid, varid
643 Integer,
Intent(IN) :: ndex(*)
644 Real(NFREAL),
Intent(OUT) :: rval
648 Integer(C_INT) :: cncid, cvarid, cndims, cstat1, cstatus
649 Type(c_ptr) :: cndexptr
652 Integer(C_SIZE_T),
ALLOCATABLE,
TARGET :: cndex(:)
659 cndexptr = c_null_ptr
662 If (cstat1 == nc_noerr)
Then 664 ALLOCATE(cndex(ndims))
665 cndex(1:ndims) = ndex(ndims:1:-1) - 1
666 cndexptr = c_loc(cndex)
670 #if NF_REAL_IS_C_DOUBLE 680 cndexptr = c_null_ptr
681 If (
ALLOCATED(cndex))
DEALLOCATE(cndex)
693 Integer,
Intent(IN) :: ncid, varid
694 Integer,
Intent(IN) :: ndex(*)
695 Real(RK8),
Intent(OUT) :: dval
699 Integer(C_INT) :: cncid, cvarid, cndims, cstat1, cstatus
700 Type(c_ptr) :: cndexptr
703 Integer(C_SIZE_T),
ALLOCATABLE,
TARGET :: cndex(:)
710 cndexptr = c_null_ptr
713 If (cstat1 == nc_noerr)
Then 715 ALLOCATE(cndex(ndims))
716 cndex(1:ndims) = ndex(ndims:1:-1) - 1
717 cndexptr = c_loc(cndex)
727 cndexptr = c_null_ptr
728 If (
ALLOCATED(cndex))
DEALLOCATE(cndex)
732 Function nf_get_var1(ncid, varid, ndex, values) RESULT(status)
743 Integer,
Intent(IN) :: ncid, varid
744 Integer,
Intent(IN) :: ndex(*)
745 Character(KIND=C_CHAR),
Intent(OUT),
TARGET :: values(*)
749 Integer(C_INT) :: cncid, cvarid, cndims, cstat1, cstatus
750 Type(c_ptr) :: cndexptr, cvaluesptr
753 Integer(C_SIZE_T),
ALLOCATABLE,
TARGET :: cndex(:)
760 cndexptr = c_null_ptr
763 If (cstat1 == nc_noerr)
Then 765 ALLOCATE(cndex(ndims))
766 cndex(1:ndims) = ndex(ndims:1:-1) - 1
767 cndexptr = c_loc(cndex)
771 cstatus =
nc_get_var1(cncid, cvarid, cndexptr, values)
777 cndexptr = c_null_ptr
778 If (
ALLOCATED(cndex))
DEALLOCATE(cndex)
integer function nf_get_var1_double(ncid, varid, ndex, dval)
integer function nf_put_var1_int2(ncid, varid, ndex, ival)
integer function nf_put_var1_double(ncid, varid, ndex, dval)
integer function nf_put_var1_int1(ncid, varid, ndex, ival)
integer function nf_get_var1_text(ncid, varid, ndex, chval)
integer function nf_get_var1_int(ncid, varid, ndex, ival)
integer function nf_put_var1_int(ncid, varid, ndex, ival)
integer function nf_put_var1_real(ncid, varid, ndex, rval)
integer function nf_get_var1_int2(ncid, varid, ndex, ival)
integer function nf_get_var1(ncid, varid, ndex, values)
integer function nf_get_var1_int1(ncid, varid, ndex, ival)
integer function nf_get_var1_real(ncid, varid, ndex, rval)
integer function nf_put_var1(ncid, varid, ndex, values)
integer function nf_put_var1_text(ncid, varid, ndex, chval)