8 function nf90_open(path, mode, ncid, chunksize, cache_size, cache_nelems, &
9 cache_preemption, comm, info)
11 character (len = *),
intent(in) :: path
12 integer,
intent(in) :: mode
13 integer,
intent(out) :: ncid
14 integer,
optional,
intent(inout) :: chunksize
15 integer,
optional,
intent(in) :: cache_size, cache_nelems
16 real,
optional,
intent(in) :: cache_preemption
17 integer,
optional,
intent(in) :: comm, info
18 integer :: size_in, nelems_in, preemption_in
19 integer :: size_out, nelems_out, preemption_out, ret
23 if (
present(comm) .and. .not.
present(info))
then
24 nf90_open = nf90_einval;
31 if (
present(cache_size) .or.
present(cache_nelems) .or. &
32 present(cache_preemption))
then
33 ret = nf_get_chunk_cache(size_in, nelems_in, preemption_in)
34 if (ret .ne. nf90_noerr)
then
38 if (
present(cache_size))
then
43 if (
present(cache_nelems))
then
44 nelems_out = cache_nelems
46 nelems_out = nelems_in
48 if (
present(cache_preemption))
then
49 preemption_out = cache_preemption
51 preemption_out = preemption_in
53 nf90_open = nf_set_chunk_cache(size_out, nelems_out, preemption_out)
54 if (nf90_open .ne. nf90_noerr)
return
58 if(
present(chunksize))
then
59 nf90_open = nf__open(path, mode, chunksize, ncid)
61 if (
present(comm))
then
62 nf90_open = nf_open_par(path, mode, comm, info, ncid)
64 nf90_open = nf_open(path, mode, ncid)
67 if (nf90_open .ne. nf90_noerr)
return
70 if (
present(cache_size) .or.
present(cache_nelems) .or. &
71 present(cache_preemption))
then
72 nf90_open = nf_set_chunk_cache(size_in, nelems_in, preemption_in)
75 end function nf90_open
77 function nf90_create(path, cmode, ncid, initialsize, chunksize, cache_size, &
78 cache_nelems, cache_preemption, comm, info)
80 character (len = *),
intent(in) :: path
81 integer,
intent(in) :: cmode
82 integer,
intent(out) :: ncid
83 integer,
optional,
intent(in) :: initialsize
84 integer,
optional,
intent(inout) :: chunksize
85 integer,
optional,
intent(in) :: cache_size, cache_nelems
86 integer,
optional,
intent(in) :: cache_preemption
87 integer,
optional,
intent(in) :: comm, info
88 integer :: size_in, nelems_in, preemption_in
89 integer :: size_out, nelems_out, preemption_out, ret
90 integer :: nf90_create
91 integer :: filesize, chunk
99 if (
present(comm) .and. .not.
present(info))
then
100 nf90_create = nf90_einval;
107 if (
present(cache_size) .or.
present(cache_nelems) .or. &
108 present(cache_preemption))
then
109 nf90_create = nf_get_chunk_cache(size_in, nelems_in, preemption_in)
110 if (nf90_create .ne. nf90_noerr)
return
111 if (
present(cache_size))
then
112 size_out = cache_size
116 if (
present(cache_nelems))
then
117 nelems_out = cache_nelems
119 nelems_out = nelems_in
121 if (
present(cache_preemption))
then
122 preemption_out = cache_preemption
124 preemption_out = preemption_in
126 nf90_create = nf_set_chunk_cache(size_out, nelems_out, preemption_out)
127 if (nf90_create .ne. nf90_noerr)
return
131 if(.not. (
present(initialsize) .or.
present(chunksize)) )
then
132 if (
present(comm))
then
133 nf90_create = nf_create_par(path, cmode, comm, info, ncid)
135 nf90_create = nf_create(path, cmode, ncid)
139 filesize = 0; chunk = nf90_sizehint_default
140 if(
present(initialsize)) filesize = initialsize
141 if(
present(chunksize )) chunk = chunksize
142 nf90_create = nf__create(path, cmode, filesize, chunk, ncid)
144 if(
present(chunksize )) chunksize = chunk
146 if (nf90_create .ne. nf90_noerr)
return
149 if (
present(cache_size) .or.
present(cache_nelems) .or. &
150 present(cache_preemption))
then
151 nf90_create = nf_set_chunk_cache(size_in, nelems_in, preemption_in)
155 end function nf90_create