45 Integer,
Intent(IN) :: ncopts
47 Integer(C_INT) :: cncopts
61 Integer,
Intent(INOUT) :: ncopts
63 Integer(C_INT) :: cncopts
73 Function nccre(filename, cmode, rcode) RESULT(ncid)
79 Character(LEN=*),
Intent(IN) :: filename
80 Integer,
Intent(IN) :: cmode
81 Integer,
Intent(OUT) :: rcode
85 Character(LEN=(LEN(filename)+1)) :: cfilename
87 Integer(C_INT) :: ccmode, crcode, cncid
98 cncid =
c_nccre(cfilename(1:ilen), ccmode, crcode )
105 Function ncopn(filename, rwmode, rcode) RESULT(ncid)
111 Character(LEN=*),
Intent(IN) :: filename
112 Integer,
Intent(IN) :: rwmode
113 Integer,
Intent(OUT) :: rcode
117 Character(LEN=(LEN(filename)+1)) :: cfilename
119 Integer(C_INT) :: crwmode, crcode, cncid
130 cncid =
c_ncopn(cfilename(1:ilen), crwmode, crcode )
137 Function ncddef(ncid, dimname, dimlen, rcode) RESULT(ndimid)
143 Character(LEN=*),
Intent(IN) :: dimname
144 Integer,
Intent(IN) :: ncid, dimlen
145 Integer,
Intent(OUT) :: rcode
149 Character(LEN=(LEN(dimname)+1)) :: cdimname
151 Integer(C_INT) :: cncid, cdimlen, cndimid, crcode
163 cndimid =
c_ncddef(cncid, cdimname(1:ilen), cdimlen, crcode )
170 Function ncdid(ncid, dimname, rcode) RESULT(ndimid)
176 Character(LEN=*),
Intent(IN) :: dimname
177 Integer,
Intent(IN) :: ncid
178 Integer,
Intent(OUT) :: rcode
182 Character(LEN=(LEN(dimname)+1)) :: cdimname
184 Integer(C_INT) :: cncid, crcode, cndimid
195 cndimid =
c_ncdid(cncid, cdimname(1:ilen), crcode )
202 Function ncvdef(ncid, varname, vartype, nvdims, vdims, rcode) RESULT(nvarid)
208 Character(LEN=*),
Intent(IN) :: varname
209 Integer,
Intent(IN) :: ncid, vartype, nvdims
210 Integer,
Intent(IN) :: vdims(*)
211 Integer,
Intent(OUT) :: rcode
215 Character(LEN=(LEN(varname)+1)) :: cvarname
217 Integer(C_INT) :: cncid, crcode, cnvdims, cvartype, cnvarid
218 Type(c_ptr
) :: cvdimsptr
220 Integer(C_INT),
ALLOCATABLE,
TARGET :: cvdims(:)
235 cvdimsptr = c_null_ptr
238 ALLOCATE(cvdims(nvdims))
239 cvdims(1:nvdims) = vdims(nvdims:1:-1) - 1
240 cvdimsptr = c_loc(cvdims)
243 cnvarid =
c_ncvdef(cncid, cvarname(1:ilen), cvartype, &
244 cnvdims, cvdimsptr, crcode )
249 cvdimsptr = c_null_ptr
250 If (
ALLOCATED(cvdims))
DEALLOCATE(cvdims)
254 Function ncvid(ncid, varname, rcode) RESULT(nvarid)
260 Character(LEN=*),
Intent(IN) :: varname
261 Integer,
Intent(IN) :: ncid
262 Integer,
Intent(OUT) :: rcode
266 Character(LEN=(LEN(varname)+1)) :: cvarname
268 Integer(C_INT) :: cncid, crcode, cnvarid
280 cnvarid =
c_ncvid(cncid, cvarname(1:ilen), crcode)
287 Function nctlen(datatype, rcode) RESULT(nvarlen)
293 Integer,
Intent(IN) :: datatype
294 Integer,
Intent(OUT) :: rcode
298 Integer(C_INT) :: crcode, cnvarlen, cdtype
319 Integer,
Intent(IN) :: ncid
320 Integer,
Intent(OUT) :: rcode
322 Integer(C_INT) :: crcode, cncid
340 Integer,
Intent(IN) :: ncid
341 Integer,
Intent(OUT) :: rcode
343 Integer(C_INT) :: crcode, cncid
361 Integer,
Intent(IN) :: ncid
362 Integer,
Intent(OUT) :: rcode
364 Integer(C_INT) :: crcode, cncid
376 Subroutine ncinq(ncid, ndims, nvars, natts, recdim, rcode)
382 Integer,
Intent(IN) :: ncid
383 Integer,
Intent(OUT) :: ndims, nvars, natts, recdim, rcode
385 Integer(C_INT) :: crcode, cncid, cndims, cnvars, cnatts, crecdim
397 Call
c_ncinq(cncid, cndims, cnvars, cnatts, crecdim, crcode)
402 If (crecdim == -1)
Then
418 Integer,
Intent(IN) :: ncid
419 Integer,
Intent(OUT) :: rcode
421 Integer(C_INT) :: crcode, cncid
439 Integer,
Intent(IN) :: ncid
440 Integer,
Intent(OUT) :: rcode
442 Integer(C_INT) :: crcode, cncid
454 Subroutine ncdinq(ncid, dimid, dimname, dimlen, rcode)
461 Integer,
Intent(IN) :: ncid, dimid
462 Character(LEN=*),
Intent(OUT) :: dimname
463 Integer,
Intent(OUT) :: dimlen, rcode
465 Integer(C_INT) :: cncid, crcode, cdimlen, cdimid
466 Character(LEN=(NC_MAX_NAME+1)) :: cdimname
474 cdimname = repeat(
" ", len(cdimname))
477 Call
c_ncdinq(cncid, cdimid, cdimname, cdimlen, crcode)
488 Subroutine ncdren(ncid, dimid, dimname, rcode)
494 Character(LEN=*),
Intent(IN) :: dimname
495 Integer,
Intent(IN) :: ncid, dimid
496 Integer,
Intent(OUT) :: rcode
498 Character(LEN=(LEN(dimname)+1)) :: cdimname
499 Integer(C_INT) :: cncid, crcode, cdimid
511 Call
c_ncdren(cncid, cdimid, cdimname(1:ilen), crcode)
517 Subroutine ncvinq(ncid, varid, varname, vartype, nvdims, vdims, &
525 Integer,
Intent(IN) :: ncid, varid
526 Character(LEN=*),
Intent(INOUT) :: varname
527 Integer,
Intent(OUT) :: vartype, nvdims, nvatts, rcode
528 Integer,
Intent(INOUT) :: vdims(*)
530 Integer(C_INT) :: cncid, crcode, cvarid, cvartype, cnvdims, &
532 Character(LEN=NC_MAX_NAME+1) :: cvarname
535 Integer(C_INT),
ALLOCATABLE :: cvdims(:)
547 cvarname = repeat(
" ", len(cvarname))
553 If (cnvdims > 0)
Then
554 ALLOCATE(cvdims(cnvdims))
559 Call
c_ncvinq(cncid, cvarid, cvarname, cvartype, cnvdims, cvdims, &
575 vdims(1:nvdims) = cvdims(nvdims:1:-1) + 1
579 If (
ALLOCATED(cvdims))
DEALLOCATE(cvdims)
583 Subroutine ncvpt1(ncid, varid, mindex, values, rcode)
590 Integer,
Intent(IN) :: ncid, varid
591 Integer,
Intent(IN) :: mindex(*)
592 Character(KIND=C_CHAR),
Intent(IN),
TARGET :: values(*)
593 Integer,
Intent(OUT) :: rcode
595 Integer(C_INT) :: cncid, crcode, cvarid, cstatus, cndims
596 Type(c_ptr
) :: cmindexptr, cvaluesptr
599 Integer(C_SIZE_T),
ALLOCATABLE,
TARGET :: cmindex(:)
610 cmindexptr = c_null_ptr
613 If (cstatus == nc_noerr)
Then
615 ALLOCATE(cmindex(ndims))
616 cmindex(1:ndims) = mindex(ndims:1:-1) - 1
617 cmindexptr = c_loc(cmindex)
621 cvaluesptr = c_loc(values)
623 Call
c_ncvpt1(cncid, cvarid, cmindexptr, cvaluesptr, crcode)
629 cvaluesptr = c_null_ptr
630 cmindexptr = c_null_ptr
631 If (
ALLOCATED(cmindex))
DEALLOCATE(cmindex)
635 Subroutine ncvp1c(ncid, varid, mindex, strings, rcode)
642 Integer,
Intent(IN) :: ncid, varid
643 Integer,
Intent(IN) :: mindex(*)
644 Character(LEN=*),
Intent(IN) :: strings
645 Integer,
Intent(OUT) :: rcode
647 Integer(C_INT) :: cncid, crcode, cvarid, cstatus, cndims
648 Type(c_ptr
) :: cmindexptr
651 Integer(C_SIZE_T),
ALLOCATABLE,
TARGET :: cmindex(:)
662 cmindexptr = c_null_ptr
665 If (cstatus == nc_noerr)
Then
667 ALLOCATE(cmindex(ndims))
668 cmindex(1:ndims) = mindex(ndims:1:-1) - 1
669 cmindexptr = c_loc(cmindex)
673 Call
c_ncvp1c(cncid, cvarid, cmindexptr, strings, crcode)
679 cmindexptr = c_null_ptr
680 If (
ALLOCATED(cmindex))
DEALLOCATE(cmindex)
684 Subroutine ncvpt(ncid, varid, start, counts, values, rcode)
691 Integer,
Intent(IN) :: ncid, varid
692 Integer,
Intent(IN) :: start(*), counts(*)
693 Character(KIND=C_CHAR),
Intent(IN),
TARGET :: values(*)
694 Integer,
Intent(OUT) :: rcode
696 Integer(C_INT) :: cncid, crcode, cvarid, cstatus, cndims
697 Type(c_ptr
) :: cstartptr, ccountsptr
698 Type(c_ptr
) :: cvaluesptr
701 Integer(C_SIZE_T),
ALLOCATABLE,
TARGET :: cstart(:), ccounts(:)
712 cstartptr = c_null_ptr
713 ccountsptr = c_null_ptr
716 If (cstatus == nc_noerr)
Then
718 ALLOCATE(cstart(ndims))
719 ALLOCATE(ccounts(ndims))
720 cstart(1:ndims) = start(ndims:1:-1) - 1
721 ccounts(1:ndims) = counts(ndims:1:-1)
722 cstartptr = c_loc(cstart)
723 ccountsptr = c_loc(ccounts)
727 cvaluesptr = c_loc(values)
729 Call
c_ncvpt(cncid, cvarid, cstartptr, ccountsptr, cvaluesptr, crcode)
735 cstartptr = c_null_ptr
736 ccountsptr = c_null_ptr
737 cvaluesptr = c_null_ptr
738 If (
ALLOCATED(ccounts))
DEALLOCATE(ccounts)
739 If (
ALLOCATED(cstart))
DEALLOCATE(cstart)
743 Subroutine ncvptc(ncid, varid, start, counts, strings, lenstr, rcode)
750 Integer,
Intent(IN) :: ncid, varid, lenstr
751 Integer,
Intent(IN) :: start(*), counts(*)
752 Character(LEN=*),
Intent(INOUT) :: strings
753 Integer,
Intent(OUT) :: rcode
755 Integer(C_INT) :: cncid, crcode, cvarid, cstatus, cndims, clenstr
756 Type(c_ptr
) :: cstartptr, ccountsptr
759 Integer(C_SIZE_T),
ALLOCATABLE,
TARGET :: cstart(:), ccounts(:)
771 cstartptr = c_null_ptr
772 ccountsptr = c_null_ptr
775 If (cstatus == nc_noerr)
Then
777 ALLOCATE(cstart(ndims))
778 ALLOCATE(ccounts(ndims))
779 cstart(1:ndims) = start(ndims:1:-1) - 1
780 ccounts(1:ndims) = counts(ndims:1:-1)
781 cstartptr = c_loc(cstart)
782 ccountsptr = c_loc(ccounts)
786 Call
c_ncvptc(cncid, cvarid, cstartptr, ccountsptr, strings(1:lenstr),&
793 cstartptr = c_null_ptr
794 ccountsptr = c_null_ptr
795 If (
ALLOCATED(ccounts))
DEALLOCATE(ccounts)
796 If (
ALLOCATED(cstart))
DEALLOCATE(cstart)
800 Subroutine ncvptg(ncid, varid, start, counts, strides, imap, values, &
808 Integer,
Intent(IN) :: ncid, varid
809 Integer,
Intent(IN) :: start(*), counts(*), &
811 Character(KIND=C_CHAR),
Intent(IN),
TARGET :: values(*)
812 Integer,
Intent(OUT) :: rcode
814 Integer(C_INT) :: cncid, crcode, cvarid, cstatus, cndims
815 Type(c_ptr
) :: cstartptr, ccountsptr, cimapptr, cstridesptr
816 Type(c_ptr
) :: cvaluesptr
817 Integer :: ndims, inullp
819 Integer(C_SIZE_T),
ALLOCATABLE,
TARGET :: cstart(:), ccounts(:)
820 Integer(C_PTRDIFF_T),
ALLOCATABLE,
TARGET :: cstrides(:), cimap(:)
833 ALLOCATE(cimap(cndims))
841 cstartptr = c_null_ptr
842 ccountsptr = c_null_ptr
843 cstridesptr = c_null_ptr
844 cimapptr = c_loc(cimap)
845 If (inullp /= 0) cimapptr = c_null_ptr
847 ALLOCATE(cstart(ndims))
848 ALLOCATE(ccounts(ndims))
849 ALLOCATE(cstrides(ndims))
850 cstart(1:ndims) = start(ndims:1:-1) - 1
851 ccounts(1:ndims) = counts(ndims:1:-1)
852 cstrides(1:ndims) = strides(ndims:1:-1)
853 cstartptr = c_loc(cstart)
854 ccountsptr = c_loc(ccounts)
855 cstridesptr = c_loc(cstrides)
858 cvaluesptr = c_loc(values)
860 Call
c_ncvptg(cncid, cvarid, cstartptr, ccountsptr, cstridesptr, &
861 cimapptr, cvaluesptr, crcode)
867 cstartptr = c_null_ptr
868 ccountsptr = c_null_ptr
869 cstridesptr = c_null_ptr
870 cvaluesptr = c_null_ptr
871 cimapptr = c_null_ptr
872 If (
ALLOCATED(cimap))
DEALLOCATE(cimap)
873 If (
ALLOCATED(cstrides))
DEALLOCATE(cstrides)
874 If (
ALLOCATED(ccounts))
DEALLOCATE(ccounts)
875 If (
ALLOCATED(cstart))
DEALLOCATE(cstart)
879 Subroutine ncvpgc(ncid, varid, start, counts, strides, imap, string, rcode)
886 Integer,
Intent(IN) :: ncid, varid
887 Integer,
Intent(IN) :: start(*), counts(*), strides(*), imap(*)
888 Character(LEN=*),
Intent(IN) :: string
889 Integer,
Intent(OUT) :: rcode
891 Integer(C_INT) :: cncid, crcode, cvarid, cstatus, cndims
892 Type(c_ptr
) :: cstartptr, ccountsptr, cstridesptr, cimapptr
893 Integer :: ndims, inullp
895 Integer(C_SIZE_T),
ALLOCATABLE,
TARGET :: cstart(:), ccounts(:)
896 Integer(C_PTRDIFF_T),
ALLOCATABLE,
TARGET :: cstrides(:), cimap(:)
909 ALLOCATE(cimap(cndims))
916 cstartptr = c_null_ptr
917 ccountsptr = c_null_ptr
918 cstridesptr = c_null_ptr
919 cimapptr = c_loc(cimap)
920 If (inullp /= 0) cimapptr = c_null_ptr
923 ALLOCATE(cstart(ndims))
924 ALLOCATE(ccounts(ndims))
925 ALLOCATE(cstrides(ndims))
926 cstart(1:ndims) = start(ndims:1:-1) - 1
927 ccounts(1:ndims) = counts(ndims:1:-1)
928 cstrides(1:ndims) = strides(ndims:1:-1)
929 cstartptr = c_loc(cstart)
930 ccountsptr = c_loc(ccounts)
931 cstridesptr = c_loc(cstrides)
934 Call
c_ncvpgc(cncid, cvarid, cstartptr, ccountsptr, cstridesptr, &
935 cimapptr, string, crcode)
942 cstartptr = c_null_ptr
943 ccountsptr = c_null_ptr
944 cstridesptr = c_null_ptr
945 cimapptr = c_null_ptr
946 If (
ALLOCATED(cimap))
DEALLOCATE(cimap)
947 If (
ALLOCATED(cstrides))
DEALLOCATE(cstrides)
948 If (
ALLOCATED(ccounts))
DEALLOCATE(ccounts)
949 If (
ALLOCATED(cstart))
DEALLOCATE(cstart)
953 Subroutine ncvgt1(ncid, varid, mindex, values, rcode)
960 Integer,
Intent(IN) :: ncid, varid
961 Integer,
Intent(IN) :: mindex(*)
962 Character(KIND=C_CHAR),
Intent(OUT) :: values(*)
963 Integer,
Intent(OUT) :: rcode
965 Integer(C_INT) :: cncid, crcode, cvarid, cstatus, cndims
966 Type(c_ptr
) :: cmindexptr
969 Integer(C_SIZE_T),
ALLOCATABLE,
TARGET :: cmindex(:)
980 cmindexptr = c_null_ptr
983 If (cstatus == nc_noerr)
Then
985 ALLOCATE(cmindex(ndims))
986 cmindex(1:ndims) = mindex(ndims:1:-1) - 1
987 cmindexptr = c_loc(cmindex)
991 Call
c_ncvgt1(cncid, cvarid, cmindexptr, values, crcode)
997 cmindexptr = c_null_ptr
998 If (
ALLOCATED(cmindex))
DEALLOCATE(cmindex)
1002 Subroutine ncvg1c(ncid, varid, mindex, string, rcode)
1009 Integer,
Intent(IN) :: ncid, varid
1010 Integer,
Intent(IN) :: mindex(*)
1011 Character(LEN=*),
Intent(INOUT) :: string
1012 Integer,
Intent(OUT) :: rcode
1014 Integer(C_INT) :: cncid, crcode, cvarid, cstatus, cndims
1015 Type(c_ptr
) :: cmindexptr
1018 Integer(C_SIZE_T),
ALLOCATABLE,
TARGET :: cmindex(:)
1029 cmindexptr = c_null_ptr
1032 If (cstatus == nc_noerr)
Then
1034 ALLOCATE(cmindex(ndims))
1035 cmindex(1:ndims) = mindex(ndims:1:-1) - 1
1036 cmindexptr = c_loc(cmindex)
1040 Call
c_ncvg1c(cncid, cvarid, cmindexptr, string, crcode)
1046 cmindexptr = c_null_ptr
1047 If (
ALLOCATED(cmindex))
DEALLOCATE(cmindex)
1051 Subroutine ncvgt(ncid, varid, start, counts, values, rcode)
1058 Integer,
Intent(IN) :: ncid, varid
1059 Integer,
Intent(IN) :: start(*), counts(*)
1060 Character(KIND=C_CHAR),
Intent(OUT) :: values(*)
1061 Integer,
Intent(OUT) :: rcode
1063 Integer(C_INT) :: cncid, crcode, cvarid, cstatus, cndims
1064 Type(c_ptr
) :: cstartptr, ccountsptr
1067 Integer(C_SIZE_T),
ALLOCATABLE,
TARGET :: cstart(:), ccounts(:)
1078 cstartptr = c_null_ptr
1079 ccountsptr = c_null_ptr
1082 If (cstatus == nc_noerr)
Then
1084 ALLOCATE(cstart(ndims))
1085 ALLOCATE(ccounts(ndims))
1086 cstart(1:ndims) = start(ndims:1:-1) - 1
1087 ccounts(1:ndims) = counts(ndims:1:-1)
1088 cstartptr = c_loc(cstart)
1089 ccountsptr = c_loc(ccounts)
1093 Call
c_ncvgt(cncid, cvarid, cstartptr, ccountsptr, values, crcode)
1099 cstartptr = c_null_ptr
1100 ccountsptr = c_null_ptr
1101 If (
ALLOCATED(ccounts))
DEALLOCATE(ccounts)
1102 If (
ALLOCATED(cstart))
DEALLOCATE(cstart)
1104 End Subroutine ncvgt
1106 Subroutine ncvgtc(ncid, varid, start, counts, string, lenstr, rcode)
1113 Integer,
Intent(IN) :: ncid, varid, lenstr
1114 Integer,
Intent(IN) :: start(*), counts(*)
1115 Character(LEN=*),
Intent(INOUT) :: string
1116 Integer,
Intent(OUT) :: rcode
1118 Integer(C_INT) :: cncid, crcode, cvarid, cstatus, cndims, &
1120 Type(c_ptr
) :: cstartptr, ccountsptr
1121 Character(LEN=lenstr+1) :: cstring
1122 Integer :: ndims, slen
1124 Integer(C_SIZE_T),
ALLOCATABLE,
TARGET :: cstart(:), ccounts(:)
1133 string = repeat(
" ", len(string))
1134 cstring = repeat(
" ", len(cstring))
1138 cstartptr = c_null_ptr
1139 ccountsptr = c_null_ptr
1142 If (cstatus == nc_noerr)
Then
1144 ALLOCATE(cstart(ndims))
1145 ALLOCATE(ccounts(ndims))
1146 cstart(1:ndims) = start(ndims:1:-1) - 1
1147 ccounts(1:ndims) = counts(ndims:1:-1)
1148 cstartptr = c_loc(cstart)
1149 ccountsptr = c_loc(ccounts)
1153 Call
c_ncvgtc(cncid, cvarid, cstartptr, ccountsptr, cstring, clenstr, crcode)
1155 If (len(string) >= lenstr)
Then
1156 string(1:lenstr) = cstring(1:lenstr)
1159 string(1:slen) = cstring(1:slen)
1166 cstartptr = c_null_ptr
1167 ccountsptr = c_null_ptr
1168 If (
ALLOCATED(ccounts))
DEALLOCATE(ccounts)
1169 If (
ALLOCATED(cstart))
DEALLOCATE(cstart)
1173 Subroutine ncvgtg(ncid, varid, start, counts, strides, imap, values, &
1181 Integer,
Intent(IN) :: ncid, varid
1182 Integer,
Intent(IN) :: start(*), counts(*), strides(*), imap(*)
1183 Character(KIND=C_CHAR),
Intent(OUT) :: values(*)
1184 Integer,
Intent(OUT) :: rcode
1186 Integer(C_INT) :: cncid, crcode, cvarid, cstatus, cndims
1187 Type(c_ptr
) :: cstartptr, ccountsptr, cimapptr, cstridesptr
1188 Integer :: ndims, inullp
1190 Integer(C_SIZE_T),
ALLOCATABLE,
TARGET :: cstart(:), ccounts(:)
1191 Integer(C_PTRDIFF_T),
ALLOCATABLE,
TARGET :: cstrides(:), cimap(:)
1201 If (cndims > 0)
Then
1202 ALLOCATE(cimap(cndims))
1209 cstartptr = c_null_ptr
1210 ccountsptr = c_null_ptr
1211 cstridesptr = c_null_ptr
1212 cimapptr = c_loc(cimap)
1215 If (inullp /= 0) cimapptr = c_null_ptr
1217 ALLOCATE(cstart(ndims))
1218 ALLOCATE(ccounts(ndims))
1219 ALLOCATE(cstrides(ndims))
1220 cstart(1:ndims) = start(ndims:1:-1) - 1
1221 ccounts(1:ndims) = counts(ndims:1:-1)
1222 cstrides(1:ndims) = strides(ndims:1:-1)
1223 cstartptr = c_loc(cstart)
1224 ccountsptr = c_loc(ccounts)
1225 cstridesptr = c_loc(cstrides)
1228 Call
c_ncvgtg(cncid, cvarid, cstartptr, ccountsptr, cstridesptr, &
1229 cimapptr, values, crcode)
1235 cstartptr = c_null_ptr
1236 ccountsptr = c_null_ptr
1237 cstridesptr = c_null_ptr
1238 cimapptr = c_null_ptr
1239 If (
ALLOCATED(cimap))
DEALLOCATE(cimap)
1240 If (
ALLOCATED(cstrides))
DEALLOCATE(cstrides)
1241 If (
ALLOCATED(ccounts))
DEALLOCATE(ccounts)
1242 If (
ALLOCATED(cstart))
DEALLOCATE(cstart)
1246 Subroutine ncvggc(ncid, varid, start, counts, strides, imap, string, rcode)
1253 Integer,
Intent(IN) :: ncid, varid
1254 Integer,
Intent(IN) :: start(*), counts(*), strides(*), imap(*)
1255 Character(LEN=*),
Intent(INOUT) :: string
1256 Integer,
Intent(OUT) :: rcode
1258 Integer(C_INT) :: cncid, crcode, cvarid, cstatus, cndims
1259 Character(LEN=(LEN(string)+1)) :: cstring
1260 Type(c_ptr
) :: cstartptr, ccountsptr, cstridesptr, &
1262 Integer :: ndims, inullp,slen
1264 Integer(C_SIZE_T),
ALLOCATABLE,
TARGET :: cstart(:), ccounts(:)
1265 Integer(C_PTRDIFF_T),
ALLOCATABLE,
TARGET :: cstrides(:), cimap(:)
1276 string = repeat(
" ", len(string))
1277 cstring = repeat(
" ", len(cstring))
1281 If (cndims > 0)
Then
1282 ALLOCATE(cimap(cndims))
1288 cstartptr = c_null_ptr
1289 ccountsptr = c_null_ptr
1290 cstridesptr = c_null_ptr
1291 cimapptr = c_loc(cimap)
1294 If (inullp /= 0) cimapptr = c_null_ptr
1296 ALLOCATE(cstart(ndims))
1297 ALLOCATE(ccounts(ndims))
1298 ALLOCATE(cstrides(ndims))
1299 cstart(1:ndims) = start(ndims:1:-1) - 1
1300 ccounts(1:ndims) = counts(ndims:1:-1)
1301 cstrides(1:ndims) = strides(ndims:1:-1)
1302 cstartptr = c_loc(cstart)
1303 ccountsptr = c_loc(ccounts)
1304 cstridesptr = c_loc(cstrides)
1307 Call
c_ncvggc(cncid, cvarid, cstartptr, ccountsptr, cstridesptr, &
1308 cimapptr, cstring, crcode)
1311 string(1:slen) = cstring(1:slen)
1317 cstartptr = c_null_ptr
1318 ccountsptr = c_null_ptr
1319 cstridesptr = c_null_ptr
1320 cimapptr = c_null_ptr
1321 If (
ALLOCATED(cimap))
DEALLOCATE(cimap)
1322 If (
ALLOCATED(cstrides))
DEALLOCATE(cstrides)
1323 If (
ALLOCATED(ccounts))
DEALLOCATE(ccounts)
1324 If (
ALLOCATED(cstart))
DEALLOCATE(cstart)
1328 Subroutine ncvren(ncid, varid, newnam, rcode)
1334 Character(LEN=*),
Intent(IN) :: newnam
1335 Integer,
Intent(IN) :: ncid, varid
1336 Integer,
Intent(OUT) :: rcode
1338 Character(LEN=(LEN(newnam)+1)) :: cnewnam
1339 Integer(C_INT) :: cncid, cvarid, crcode
1350 Call
c_ncvren(cncid, cvarid, cnewnam(1:ilen), crcode )
1356 Subroutine ncapt(ncid, varid, attnam, attype, attlen, value, rcode)
1362 Character(LEN=*),
Intent(IN) :: attnam
1363 Integer,
Intent(IN) :: ncid, varid, attype, attlen
1364 Character(KIND=C_CHAR),
Intent(IN),
TARGET :: value(*)
1365 Integer,
Intent(OUT) :: rcode
1367 Integer(C_INT) :: cncid, cvarid, cattype, crcode
1368 Integer(C_SIZE_T) :: cattlen
1369 Type(c_ptr
) :: cvalueptr
1370 Character(LEN=(LEN(attnam)+1)) :: cattnam
1383 cvalueptr = c_loc(value)
1385 Call
c_ncapt(cncid, cvarid, cattnam(1:ilen), cattype, &
1386 cattlen, cvalueptr, crcode )
1390 End Subroutine ncapt
1392 Subroutine ncaptc(ncid, varid, attnam, attype, lenstr, string, rcode)
1398 Character(LEN=*),
Intent(IN) :: attnam
1399 Integer,
Intent(IN) :: ncid, varid, attype, lenstr
1400 Character(LEN=*),
Intent(IN) :: string
1401 Integer,
Intent(OUT) :: rcode
1403 Integer(C_INT) :: cncid, cvarid, cattype, crcode
1404 Integer(C_SIZE_T) :: clenstr
1405 Character(LEN=(LEN(attnam)+1)) :: cattnam
1418 Call
c_ncaptc(cncid, cvarid, cattnam(1:ilen), cattype, &
1419 clenstr, string, crcode )
1425 Subroutine ncainq(ncid, varid, attnam, attype, attlen, rcode)
1431 Character(LEN=*),
Intent(IN) :: attnam
1432 Integer,
Intent(IN) :: ncid, varid
1433 Integer,
Intent(OUT) :: attype, attlen, rcode
1435 Integer(C_INT) :: cncid, cvarid, cattype, crcode, cattlen
1436 Character(LEN=(LEN(attnam)+1)) :: cattnam
1449 Call
c_ncainq(cncid, cvarid, cattnam(1:ilen), cattype, &
1458 Subroutine ncagt(ncid, varid, attnam, values, rcode)
1464 Character(LEN=*),
Intent(IN) :: attnam
1465 Integer,
Intent(IN) :: ncid, varid
1466 Character(KIND=C_CHAR),
Intent(OUT) :: values(*)
1467 Integer,
Intent(OUT) :: rcode
1469 Integer(C_INT) :: cncid, cvarid, crcode
1470 Character(LEN=(LEN(attnam)+1)) :: cattnam
1481 Call
c_ncagt(cncid, cvarid, cattnam(1:ilen), values, crcode)
1485 End Subroutine ncagt
1487 Subroutine ncagtc(ncid, varid, attnam, string, lenstr, rcode)
1493 Character(LEN=*),
Intent(IN) :: attnam
1494 Integer,
Intent(IN) :: ncid, varid, lenstr
1495 Character(LEN=*),
Intent(INOUT) :: string
1496 Integer,
Intent(OUT) :: rcode
1498 Integer(C_INT) :: cncid, cvarid, crcode
1499 Character(LEN=(LEN(attnam)+1)) :: cattnam
1500 Character(LEN=(lenstr+1)) :: cstring
1506 string = repeat(
" ", len(string))
1507 cstring = repeat(
" ", len(cstring))
1513 Call
c_ncagtc(cncid, cvarid, cattnam(1:ilen), cstring, lenstr, &
1516 string(1:lenstr) = cstring(1:lenstr)
1522 Subroutine ncacpy(ncid, varid, attnam, outcdf, outvar, rcode)
1528 Character(LEN=*),
Intent(IN) :: attnam
1529 Integer,
Intent(IN) :: ncid, varid, outcdf, outvar
1530 Integer,
Intent(OUT) :: rcode
1532 Integer(C_INT) :: cncid, cvarid, coutcdf, coutvar, crcode
1533 Character(LEN=(LEN(attnam)+1)) :: cattnam
1546 Call
c_ncacpy(cncid, cvarid, cattnam(1:ilen), coutcdf, &
1553 Subroutine ncanam(ncid, varid, attnum, attnam, rcode)
1560 Character(LEN=*),
Intent(INOUT) :: attnam
1561 Integer,
Intent(IN) :: ncid, varid, attnum
1562 Integer,
Intent(OUT) :: rcode
1565 Integer(C_INT) :: cncid, cvarid, cattnum, crcode
1566 Character(LEN=NC_MAX_NAME+1) :: cattnam
1570 cattnum = attnum - 1
1572 cattnam = repeat(
" ", len(cattnam))
1575 Call
c_ncanam(cncid, cvarid, cattnum, cattnam, crcode)
1585 Subroutine ncaren(ncid, varid, attnam, newnam, rcode)
1591 Character(LEN=*),
Intent(IN) :: attnam, newnam
1592 Integer,
Intent(IN) :: ncid, varid
1593 Integer,
Intent(OUT) :: rcode
1595 Integer(C_INT) :: cncid, cvarid, crcode
1596 Character(LEN=(LEN(attnam)+1)) :: cattnam
1597 Character(LEN=(LEN(newnam)+1)) :: cnewnam
1598 Integer :: ilen, ilen2
1610 Call
c_ncaren(cncid, cvarid, cattnam(1:ilen), cnewnam(1:ilen2+1), crcode)
1616 Subroutine ncadel(ncid, varid, attnam, rcode)
1622 Character(LEN=*),
Intent(IN) :: attnam
1623 Integer,
Intent(IN) :: ncid, varid
1624 Integer,
Intent(OUT) :: rcode
1626 Integer(C_INT) :: cncid, cvarid, crcode
1627 Character(LEN=(LEN(attnam)+1)) :: cattnam
1638 Call
c_ncadel(cncid, cvarid, cattnam(1:ilen),crcode)
1644 Function ncsfil(ncid, fillmode, rcode) RESULT(currentmode)
1650 Integer,
Intent(IN) :: ncid, fillmode
1651 Integer,
Intent(OUT) :: rcode
1653 Integer :: currentmode
1655 Integer(C_INT) :: cncid, cfillmode, crcode, cstatus
1658 cfillmode = fillmode
1660 cstatus =
c_ncsfil(cncid, cfillmode, crcode)
1662 currentmode = cstatus
subroutine ncvgtc(ncid, varid, start, counts, string, lenstr, rcode)
subroutine ncvpt1(ncid, varid, mindex, values, rcode)
subroutine ncvgt(ncid, varid, start, counts, values, rcode)
subroutine ncsnc(ncid, rcode)
subroutine ncdren(ncid, dimid, dimname, rcode)
subroutine ncanam(ncid, varid, attnum, attnam, rcode)
subroutine ncabor(ncid, rcode)
subroutine ncendf(ncid, rcode)
subroutine ncvpt(ncid, varid, start, counts, values, rcode)
subroutine ncacpy(ncid, varid, attnam, outcdf, outvar, rcode)
subroutine ncagt(ncid, varid, attnam, values, rcode)
subroutine ncaren(ncid, varid, attnam, newnam, rcode)
subroutine ncvgt1(ncid, varid, mindex, values, rcode)
subroutine ncredf(ncid, rcode)
subroutine ncadel(ncid, varid, attnam, rcode)
subroutine ncaptc(ncid, varid, attnam, attype, lenstr, string, rcode)
integer function ncvid(ncid, varname, rcode)
subroutine convert_v2_imap(cncid, cvarid, fmap, cmap, inullp)
subroutine ncvren(ncid, varid, newnam, rcode)
subroutine ncvptc(ncid, varid, start, counts, strings, lenstr, rcode)
subroutine ncclos(ncid, rcode)
integer function ncsfil(ncid, fillmode, rcode)
subroutine ncvpgc(ncid, varid, start, counts, strides, imap, string, rcode)
integer function nccre(filename, cmode, rcode)
subroutine ncvptg(ncid, varid, start, counts, strides, imap, values, rcode)
subroutine ncgopt(ncopts)
integer function ncopn(filename, rwmode, rcode)
subroutine ncvgtg(ncid, varid, start, counts, strides, imap, values, rcode)
subroutine ncinq(ncid, ndims, nvars, natts, recdim, rcode)
integer function ncddef(ncid, dimname, dimlen, rcode)
subroutine ncvinq(ncid, varid, varname, vartype, nvdims, vdims, nvatts, rcode)
subroutine ncvp1c(ncid, varid, mindex, strings, rcode)
character(len=(len(string)+1)) function addcnullchar(string, nlen)
subroutine ncpopt(ncopts)
subroutine ncagtc(ncid, varid, attnam, string, lenstr, rcode)
subroutine ncapt(ncid, varid, attnam, attype, attlen, value, rcode)
subroutine ncvggc(ncid, varid, start, counts, strides, imap, string, rcode)
integer function nctlen(datatype, rcode)
subroutine ncdinq(ncid, dimid, dimname, dimlen, rcode)
subroutine ncvg1c(ncid, varid, mindex, string, rcode)
integer function ncvdef(ncid, varname, vartype, nvdims, vdims, rcode)
subroutine ncainq(ncid, varid, attnam, attype, attlen, rcode)
integer function ncdid(ncid, dimname, rcode)