28 subroutine domain_write_0d(fileobj, variable_name, vdata, unlim_dim_level, corner)
30 type(fmsnetcdfdomainfile_t),
intent(in) :: fileobj
31 character(len=*),
intent(in) :: variable_name
32 class(*),
intent(in) :: vdata
35 integer,
intent(in),
optional :: unlim_dim_level
37 integer,
intent(in),
optional :: corner
42 call compressed_write(fileobj, variable_name, vdata, &
43 unlim_dim_level=unlim_dim_level, corner=corner)
55 type(fmsnetcdfdomainfile_t),
intent(in) :: fileobj
56 character(len=*),
intent(in) :: variable_name
57 class(*),
dimension(:),
intent(in) :: vdata
60 integer,
intent(in),
optional :: unlim_dim_level
62 integer,
dimension(1),
intent(in),
optional :: corner
66 integer,
dimension(1),
intent(in),
optional :: edge_lengths
71 call compressed_write(fileobj, variable_name, vdata, &
72 unlim_dim_level=unlim_dim_level, corner=corner, &
73 edge_lengths=edge_lengths)
85 type(fmsnetcdfdomainfile_t),
intent(in) :: fileobj
86 character(len=*),
intent(in) :: variable_name
87 class(*),
contiguous,
dimension(:,:),
target,
intent(in) :: vdata
90 integer,
intent(in),
optional :: unlim_dim_level
92 integer,
dimension(2),
intent(in),
optional :: corner
96 integer,
dimension(2),
intent(in),
optional :: edge_lengths
101 integer(kind=i4_kind),
dimension(:,:),
allocatable :: global_buf_i4_kind
102 integer(kind=i8_kind),
dimension(:,:),
allocatable :: global_buf_i8_kind
103 real(kind=r4_kind),
dimension(:,:),
allocatable :: global_buf_r4_kind
104 real(kind=r8_kind),
dimension(:,:),
allocatable :: global_buf_r8_kind
105 logical :: buffer_includes_halos
106 type(domain2d),
pointer :: io_domain
112 integer :: xdim_index
114 integer :: ydim_index
117 integer(kind=i4_kind) :: fill_i4_kind
118 integer(kind=i8_kind) :: fill_i8_kind
119 real(kind=r4_kind) :: fill_r4_kind
120 real(kind=r8_kind) :: fill_r8_kind
121 class(*),
dimension(:,:,:,:),
pointer :: vdata_dummy
124 integer :: xgsize, ygsize
125 integer :: istart, jstart, iend, jend
126 integer :: ioff, joff
128 if (fileobj%use_netcdf_mpi)
then
129 call netcdf_mpi_write_2d(fileobj, variable_name, vdata, unlim_dim_level, corner, edge_lengths)
134 if (.not. is_variable_domain_decomposed(fileobj, variable_name, .true., &
135 xdim_index, ydim_index, xpos, ypos))
then
136 call compressed_write(fileobj, variable_name, vdata, &
137 unlim_dim_level=unlim_dim_level, corner=corner, &
138 edge_lengths=edge_lengths)
142 if (xdim_index .ne. 1 .or. ydim_index .ne. 2)
then
146 vdata_dummy(1:
size(vdata,1),1:
size(vdata,2), 1:1, 1:1) => vdata(:,:)
147 call domain_write_4d(fileobj, variable_name, vdata_dummy, unlim_dim_level)
155 call domain_offsets(
size(vdata, xdim_index),
size(vdata, ydim_index), fileobj%domain, &
156 xpos, ypos, isd, isc, xc_size, jsd, jsc, yc_size, buffer_includes_halos, &
157 msg=
"file:"//trim(fileobj%path)//
" and variable:"//trim(variable_name))
160 call mpp_get_global_domain(io_domain, xbegin=xgmin, xsize=xgsize, position=xpos)
161 call mpp_get_global_domain(io_domain, ybegin=ygmin, ysize=ygsize, position=ypos)
164 if (fileobj%is_root)
then
171 type is (
integer(kind=i4_kind))
172 allocate(global_buf_i4_kind(xgsize, ygsize))
173 global_buf_i4_kind = 0
174 if (get_fill_value(fileobj, variable_name, fill_i4_kind, broadcast=.false.))
then
175 global_buf_i4_kind = fill_i4_kind
177 type is (
integer(kind=i8_kind))
178 allocate(global_buf_i8_kind(xgsize, ygsize))
179 global_buf_i8_kind = 0
180 if (get_fill_value(fileobj, variable_name, fill_i8_kind, broadcast=.false.))
then
181 global_buf_i8_kind = fill_i8_kind
183 type is (real(kind=r4_kind))
184 allocate(global_buf_r4_kind(xgsize, ygsize))
185 global_buf_r4_kind = 0.
186 if (get_fill_value(fileobj, variable_name, fill_r4_kind, broadcast=.false.))
then
187 global_buf_r4_kind = fill_r4_kind
189 type is (real(kind=r8_kind))
190 allocate(global_buf_r8_kind(xgsize, ygsize))
191 global_buf_r8_kind = 0.
192 if (get_fill_value(fileobj, variable_name, fill_r8_kind, broadcast=.false.))
then
193 global_buf_r8_kind = fill_r8_kind
196 call error(
"unsupported variable type: domain_write_2d_mpp_gather: file: " &
197 & //trim(fileobj%path)//
" variable:"//trim(variable_name))
206 if (buffer_includes_halos)
then
207 istart = isc - isd + 1
208 jstart = jsc - jsd + 1
211 iend = istart + xc_size - 1
212 jend = jstart + yc_size - 1
216 type is (
integer(kind=i4_kind))
217 call mpp_gather(isc, isc+xc_size-1, jsc, jsc+yc_size-1, fileobj%pelist, vdata(istart:iend, jstart:jend), &
218 & global_buf_i4_kind, fileobj%is_root, ishift=ioff, jshift=joff)
219 type is (
integer(kind=i8_kind))
220 call mpp_gather(isc, isc+xc_size-1, jsc, jsc+yc_size-1, fileobj%pelist, vdata(istart:iend, jstart:jend), &
221 & global_buf_i8_kind, fileobj%is_root, ishift=ioff, jshift=joff)
222 type is (real(kind=r4_kind))
223 call mpp_gather(isc, isc+xc_size-1, jsc, jsc+yc_size-1, fileobj%pelist, vdata(istart:iend, jstart:jend), &
224 & global_buf_r4_kind, fileobj%is_root, ishift=ioff, jshift=joff)
225 type is (real(kind=r8_kind))
226 call mpp_gather(isc, isc+xc_size-1, jsc, jsc+yc_size-1, fileobj%pelist, vdata(istart:iend, jstart:jend), &
227 & global_buf_r8_kind, fileobj%is_root, ishift=ioff, jshift=joff)
229 call error(
"unsupported variable type: domain_write_2d_mpp_gather: file: " &
230 & //trim(fileobj%path)//
" variable:"// trim(variable_name))
234 if (fileobj%is_root)
then
236 type is (
integer(kind=i4_kind))
237 call netcdf_write_data(fileobj, variable_name, global_buf_i4_kind, &
238 & unlim_dim_level=unlim_dim_level)
239 type is (
integer(kind=i8_kind))
240 call netcdf_write_data(fileobj, variable_name, global_buf_i8_kind, &
241 & unlim_dim_level=unlim_dim_level)
242 type is (real(kind=r4_kind))
243 call netcdf_write_data(fileobj, variable_name, global_buf_r4_kind, &
244 & unlim_dim_level=unlim_dim_level)
245 type is (real(kind=r8_kind))
246 call netcdf_write_data(fileobj, variable_name, global_buf_r8_kind, &
247 & unlim_dim_level=unlim_dim_level)
249 call error(
"unsupported variable type: domain_write_2d_mpp_gather: file: " &
250 & //trim(fileobj%path)//
" variable:"// trim(variable_name))
262 corner, edge_lengths)
264 type(fmsnetcdfdomainfile_t),
intent(in) :: fileobj
265 character(len=*),
intent(in) :: variable_name
266 class(*),
contiguous,
dimension(:,:,:),
target,
intent(in) :: vdata
269 integer,
intent(in),
optional :: unlim_dim_level
271 integer,
dimension(3),
intent(in),
optional :: corner
275 integer,
dimension(3),
intent(in),
optional :: edge_lengths
280 integer(kind=i4_kind),
dimension(:,:,:),
allocatable :: global_buf_i4_kind
281 integer(kind=i8_kind),
dimension(:,:,:),
allocatable :: global_buf_i8_kind
282 real(kind=r4_kind),
dimension(:,:,:),
allocatable :: global_buf_r4_kind
283 real(kind=r8_kind),
dimension(:,:,:),
allocatable :: global_buf_r8_kind
284 logical :: buffer_includes_halos
285 type(domain2d),
pointer :: io_domain
291 integer :: xdim_index
293 integer :: ydim_index
296 integer(kind=i4_kind) :: fill_i4_kind
297 integer(kind=i8_kind) :: fill_i8_kind
298 real(kind=r4_kind) :: fill_r4_kind
299 real(kind=r8_kind) :: fill_r8_kind
300 class(*),
dimension(:,:,:,:),
pointer :: vdata_dummy
303 integer :: xgsize, ygsize
304 integer :: istart, jstart, iend, jend
305 integer :: ioff, joff
307 if (fileobj%use_netcdf_mpi)
then
308 call netcdf_mpi_write_3d(fileobj, variable_name, vdata, unlim_dim_level, corner, edge_lengths)
312 if (.not. is_variable_domain_decomposed(fileobj, variable_name, .true., &
313 xdim_index, ydim_index, xpos, ypos))
then
314 call compressed_write(fileobj, variable_name, vdata, &
315 unlim_dim_level=unlim_dim_level, corner=corner, &
316 edge_lengths=edge_lengths)
320 if (xdim_index .ne. 1 .or. ydim_index .ne. 2)
then
324 vdata_dummy(1:
size(vdata,1),1:
size(vdata,2), 1:
size(vdata,3), 1:1) => vdata(:,:,:)
325 call domain_write_4d(fileobj, variable_name, vdata_dummy, unlim_dim_level)
333 call domain_offsets(
size(vdata, xdim_index),
size(vdata, ydim_index), fileobj%domain, &
334 xpos, ypos, isd, isc, xc_size, jsd, jsc, yc_size, buffer_includes_halos, &
335 msg=
"file:"//trim(fileobj%path)//
" and variable:"//trim(variable_name))
338 call mpp_get_global_domain(io_domain, xbegin=xgmin, xsize=xgsize, position=xpos)
339 call mpp_get_global_domain(io_domain, ybegin=ygmin, ysize=ygsize, position=ypos)
342 if (fileobj%is_root)
then
349 type is (
integer(kind=i4_kind))
350 allocate(global_buf_i4_kind(xgsize, ygsize,
size(vdata,3)))
351 global_buf_i4_kind = 0
352 if (get_fill_value(fileobj, variable_name, fill_i4_kind, broadcast=.false.))
then
353 global_buf_i4_kind = fill_i4_kind
355 type is (
integer(kind=i8_kind))
356 allocate(global_buf_i8_kind(xgsize, ygsize,
size(vdata,3)))
357 global_buf_i8_kind = 0
358 if (get_fill_value(fileobj, variable_name, fill_i8_kind, broadcast=.false.))
then
359 global_buf_i8_kind = fill_i8_kind
361 type is (real(kind=r4_kind))
362 allocate(global_buf_r4_kind(xgsize, ygsize,
size(vdata,3)))
363 global_buf_r4_kind = 0.
364 if (get_fill_value(fileobj, variable_name, fill_r4_kind, broadcast=.false.))
then
365 global_buf_r4_kind = fill_r4_kind
367 type is (real(kind=r8_kind))
368 allocate(global_buf_r8_kind(xgsize, ygsize,
size(vdata,3)))
369 global_buf_r8_kind = 0.
370 if (get_fill_value(fileobj, variable_name, fill_r8_kind, broadcast=.false.))
then
371 global_buf_r8_kind = fill_r8_kind
374 call error(
"unsupported variable type: domain_write_3d_mpp_gather: file: " &
375 & //trim(fileobj%path)//
" variable:"//trim(variable_name))
384 if (buffer_includes_halos)
then
385 istart = isc - isd + 1
386 jstart = jsc - jsd + 1
389 iend = istart + xc_size - 1
390 jend = jstart + yc_size - 1
398 type is (
integer(kind=i4_kind))
399 call mpp_gather(isc, isc+xc_size-1, jsc, jsc+yc_size-1,
size(vdata,3), fileobj%pelist, &
400 & vdata(istart:iend, jstart:jend,:), global_buf_i4_kind, fileobj%is_root, ishift=ioff, jshift=joff)
401 type is (
integer(kind=i8_kind))
402 call mpp_gather(isc, isc+xc_size-1, jsc, jsc+yc_size-1,
size(vdata,3), fileobj%pelist, &
403 & vdata(istart:iend, jstart:jend,:), global_buf_i8_kind, fileobj%is_root, ishift=ioff, jshift=joff)
404 type is (real(kind=r4_kind))
405 call mpp_gather(isc, isc+xc_size-1, jsc, jsc+yc_size-1,
size(vdata,3), fileobj%pelist, &
406 & vdata(istart:iend, jstart:jend,:), global_buf_r4_kind, fileobj%is_root, ishift=ioff, jshift=joff)
407 type is (real(kind=r8_kind))
408 call mpp_gather(isc, isc+xc_size-1, jsc, jsc+yc_size-1,
size(vdata,3), fileobj%pelist, &
409 & vdata(istart:iend, jstart:jend,:), global_buf_r8_kind, fileobj%is_root, ishift=ioff, jshift=joff)
411 call error(
"unsupported variable type: domain_write_3d_mpp_gather: file: " &
412 & //trim(fileobj%path)//
" variable:"//trim(variable_name))
416 if (fileobj%is_root)
then
418 type is (
integer(kind=i4_kind))
419 call netcdf_write_data(fileobj, variable_name, global_buf_i4_kind, &
420 unlim_dim_level=unlim_dim_level)
421 type is (
integer(kind=i8_kind))
422 call netcdf_write_data(fileobj, variable_name, global_buf_i8_kind, &
423 unlim_dim_level=unlim_dim_level)
424 type is (real(kind=r4_kind))
425 call netcdf_write_data(fileobj, variable_name, global_buf_r4_kind, &
426 unlim_dim_level=unlim_dim_level)
427 type is (real(kind=r8_kind))
428 call netcdf_write_data(fileobj, variable_name, global_buf_r8_kind, &
429 unlim_dim_level=unlim_dim_level)
431 call error(
"unsupported variable type: domain_write_3d_mpp_gather: file: " &
432 & //trim(fileobj%path)//
" variable:"//trim(variable_name))
444 corner, edge_lengths)
446 type(fmsnetcdfdomainfile_t),
intent(in) :: fileobj
447 character(len=*),
intent(in) :: variable_name
448 class(*),
dimension(:,:,:,:),
intent(in) :: vdata
451 integer,
intent(in),
optional :: unlim_dim_level
453 integer,
dimension(4),
intent(in),
optional :: corner
457 integer,
dimension(4),
intent(in),
optional :: edge_lengths
462 integer(kind=i4_kind),
dimension(:,:,:,:),
allocatable :: buf_i4_kind
463 integer(kind=i8_kind),
dimension(:,:,:,:),
allocatable :: buf_i8_kind
464 real(kind=r4_kind),
dimension(:,:,:,:),
allocatable :: buf_r4_kind
465 real(kind=r8_kind),
dimension(:,:,:,:),
allocatable :: buf_r8_kind
466 logical :: buffer_includes_halos
467 integer,
dimension(4) :: c
468 integer,
dimension(4) :: e
469 integer(kind=i4_kind),
dimension(:,:,:,:),
allocatable :: global_buf_i4_kind
470 integer(kind=i8_kind),
dimension(:,:,:,:),
allocatable :: global_buf_i8_kind
471 real(kind=r4_kind),
dimension(:,:,:,:),
allocatable :: global_buf_r4_kind
472 real(kind=r8_kind),
dimension(:,:,:,:),
allocatable :: global_buf_r8_kind
474 type(domain2d),
pointer :: io_domain
479 integer,
dimension(:),
allocatable :: pe_icsize
480 integer,
dimension(:),
allocatable :: pe_iec
481 integer,
dimension(:),
allocatable :: pe_isc
482 integer,
dimension(:),
allocatable :: pe_jcsize
483 integer,
dimension(:),
allocatable :: pe_jec
484 integer,
dimension(:),
allocatable :: pe_jsc
486 integer :: xdim_index
488 integer :: ydim_index
491 integer(kind=i4_kind) :: fill_i4_kind
492 integer(kind=i8_kind) :: fill_i8_kind
493 real(kind=r4_kind) :: fill_r4_kind
494 real(kind=r8_kind) :: fill_r8_kind
500 if (fileobj%use_netcdf_mpi)
then
501 call netcdf_mpi_write_4d(fileobj, variable_name, vdata, unlim_dim_level, corner, edge_lengths)
505 if (.not. is_variable_domain_decomposed(fileobj, variable_name, .true., &
506 xdim_index, ydim_index, xpos, ypos))
then
507 call compressed_write(fileobj, variable_name, vdata, &
508 unlim_dim_level=unlim_dim_level, corner=corner, &
509 edge_lengths=edge_lengths)
513 call domain_offsets(
size(vdata, xdim_index),
size(vdata, ydim_index), fileobj%domain, &
514 xpos, ypos, isd, isc, xc_size, jsd, jsc, yc_size, &
515 buffer_includes_halos, msg=
"file:"//trim(fileobj%path)//
" and variable:"//trim(variable_name))
520 if (fileobj%is_root)
then
521 allocate(pe_isc(
size(fileobj%pelist)))
522 allocate(pe_iec(
size(fileobj%pelist)))
523 allocate(pe_icsize(
size(fileobj%pelist)))
524 call mpp_get_compute_domains(io_domain, xbegin=pe_isc, xend=pe_iec, xsize=pe_icsize, &
526 allocate(pe_jsc(
size(fileobj%pelist)))
527 allocate(pe_jec(
size(fileobj%pelist)))
528 allocate(pe_jcsize(
size(fileobj%pelist)))
529 call mpp_get_compute_domains(io_domain, ybegin=pe_jsc, yend=pe_jec, ysize=pe_jcsize, &
533 call mpp_get_global_domain(io_domain, ybegin=ygmin, yend=ygmax, position=ypos)
534 call mpp_get_global_domain(io_domain, xbegin=xgmin, xend=xgmax, position=xpos)
538 e(xdim_index) = xgmax - xgmin + 1
539 e(ydim_index) = ygmax - ygmin + 1
544 type is (
integer(kind=i4_kind))
545 call allocate_array(global_buf_i4_kind, e)
546 global_buf_i4_kind = 0
547 if (get_fill_value(fileobj, variable_name, fill_i4_kind, broadcast=.false.))
then
548 global_buf_i4_kind = fill_i4_kind
550 type is (
integer(kind=i8_kind))
551 call allocate_array(global_buf_i8_kind, e)
552 global_buf_i8_kind = 0
553 if (get_fill_value(fileobj, variable_name, fill_i8_kind, broadcast=.false.))
then
554 global_buf_i8_kind = fill_i8_kind
556 type is (real(kind=r4_kind))
557 call allocate_array(global_buf_r4_kind, e)
558 global_buf_r4_kind = 0.
559 if (get_fill_value(fileobj, variable_name, fill_r4_kind, broadcast=.false.))
then
560 global_buf_r4_kind = fill_r4_kind
562 type is (real(kind=r8_kind))
563 call allocate_array(global_buf_r8_kind, e)
564 global_buf_r8_kind = 0.
565 if (get_fill_value(fileobj, variable_name, fill_r8_kind, broadcast=.false.))
then
566 global_buf_r8_kind = fill_r8_kind
569 call error(
"unsupported variable type: domain_write_4d: file: "//trim(fileobj%path)//
" variable:"// &
570 & trim(variable_name))
573 do i = 1,
size(fileobj%pelist)
575 c(xdim_index) = pe_isc(i) - xgmin + 1
576 c(ydim_index) = pe_jsc(i) - ygmin + 1
577 e(xdim_index) = pe_icsize(i)
578 e(ydim_index) = pe_jcsize(i)
580 type is (
integer(kind=i4_kind))
581 call allocate_array(buf_i4_kind, e)
585 if (buffer_includes_halos)
then
587 c(xdim_index) = isc - isd + 1
588 c(ydim_index) = jsc - jsd + 1
593 call get_array_section(buf_i4_kind, vdata, c, e)
594 c(xdim_index) = pe_isc(i) - xgmin + 1
595 c(ydim_index) = pe_jsc(i) - ygmin + 1
598 call mpp_recv(buf_i4_kind,
size(buf_i4_kind), fileobj%pelist(i), block=.true.)
601 call put_array_section(buf_i4_kind, global_buf_i4_kind, c, e)
602 deallocate(buf_i4_kind)
603 type is (
integer(kind=i8_kind))
604 call allocate_array(buf_i8_kind, e)
608 if (buffer_includes_halos)
then
610 c(xdim_index) = isc - isd + 1
611 c(ydim_index) = jsc - jsd + 1
616 call get_array_section(buf_i8_kind, vdata, c, e)
617 c(xdim_index) = pe_isc(i) - xgmin + 1
618 c(ydim_index) = pe_jsc(i) - ygmin + 1
621 call mpp_recv(buf_i8_kind,
size(buf_i8_kind), fileobj%pelist(i), block=.true.)
624 call put_array_section(buf_i8_kind, global_buf_i8_kind, c, e)
625 deallocate(buf_i8_kind)
626 type is (real(kind=r4_kind))
627 call allocate_array(buf_r4_kind, e)
631 if (buffer_includes_halos)
then
633 c(xdim_index) = isc - isd + 1
634 c(ydim_index) = jsc - jsd + 1
639 call get_array_section(buf_r4_kind, vdata, c, e)
640 c(xdim_index) = pe_isc(i) - xgmin + 1
641 c(ydim_index) = pe_jsc(i) - ygmin + 1
644 call mpp_recv(buf_r4_kind,
size(buf_r4_kind), fileobj%pelist(i), block=.true.)
647 call put_array_section(buf_r4_kind, global_buf_r4_kind, c, e)
648 deallocate(buf_r4_kind)
649 type is (real(kind=r8_kind))
650 call allocate_array(buf_r8_kind, e)
654 if (buffer_includes_halos)
then
656 c(xdim_index) = isc - isd + 1
657 c(ydim_index) = jsc - jsd + 1
662 call get_array_section(buf_r8_kind, vdata, c, e)
663 c(xdim_index) = pe_isc(i) - xgmin + 1
664 c(ydim_index) = pe_jsc(i) - ygmin + 1
667 call mpp_recv(buf_r8_kind,
size(buf_r8_kind), fileobj%pelist(i), block=.true.)
670 call put_array_section(buf_r8_kind, global_buf_r8_kind, c, e)
671 deallocate(buf_r8_kind)
676 deallocate(pe_icsize)
679 deallocate(pe_jcsize)
683 type is (
integer(kind=i4_kind))
684 call netcdf_write_data(fileobj, variable_name, global_buf_i4_kind, &
685 unlim_dim_level=unlim_dim_level)
686 deallocate(global_buf_i4_kind)
687 type is (
integer(kind=i8_kind))
688 call netcdf_write_data(fileobj, variable_name, global_buf_i8_kind, &
689 unlim_dim_level=unlim_dim_level)
690 deallocate(global_buf_i8_kind)
691 type is (real(kind=r4_kind))
692 call netcdf_write_data(fileobj, variable_name, global_buf_r4_kind, &
693 unlim_dim_level=unlim_dim_level)
694 deallocate(global_buf_r4_kind)
695 type is (real(kind=r8_kind))
696 call netcdf_write_data(fileobj, variable_name, global_buf_r8_kind, &
697 unlim_dim_level=unlim_dim_level)
698 deallocate(global_buf_r8_kind)
701 if (buffer_includes_halos)
then
702 c(xdim_index) = isc - isd + 1
703 c(ydim_index) = jsc - jsd + 1
705 e(xdim_index) = xc_size
706 e(ydim_index) = yc_size
708 type is (
integer(kind=i4_kind))
709 call allocate_array(buf_i4_kind, e)
710 call get_array_section(buf_i4_kind, vdata, c, e)
711 call mpp_send(buf_i4_kind,
size(buf_i4_kind), fileobj%io_root)
713 deallocate(buf_i4_kind)
714 type is (
integer(kind=i8_kind))
715 call allocate_array(buf_i8_kind, e)
716 call get_array_section(buf_i8_kind, vdata, c, e)
717 call mpp_send(buf_i8_kind,
size(buf_i8_kind), fileobj%io_root)
719 deallocate(buf_i8_kind)
720 type is (real(kind=r4_kind))
721 call allocate_array(buf_r4_kind, e)
722 call get_array_section(buf_r4_kind, vdata, c, e)
723 call mpp_send(buf_r4_kind,
size(buf_r4_kind), fileobj%io_root)
725 deallocate(buf_r4_kind)
726 type is (real(kind=r8_kind))
727 call allocate_array(buf_r8_kind, e)
728 call get_array_section(buf_r8_kind, vdata, c, e)
729 call mpp_send(buf_r8_kind,
size(buf_r8_kind), fileobj%io_root)
731 deallocate(buf_r8_kind)
733 call error(
"unsupported variable type: domain_write_4d: file: "//trim(fileobj%path)//
" variable:"// &
734 & trim(variable_name))
745 corner, edge_lengths)
747 type(fmsnetcdfdomainfile_t),
intent(in) :: fileobj
748 character(len=*),
intent(in) :: variable_name
749 class(*),
dimension(:,:,:,:,:),
intent(in) :: vdata
752 integer,
intent(in),
optional :: unlim_dim_level
754 integer,
dimension(5),
intent(in),
optional :: corner
758 integer,
dimension(5),
intent(in),
optional :: edge_lengths
763 integer(kind=i4_kind),
dimension(:,:,:,:,:),
allocatable :: buf_i4_kind
764 integer(kind=i8_kind),
dimension(:,:,:,:,:),
allocatable :: buf_i8_kind
765 real(kind=r4_kind),
dimension(:,:,:,:,:),
allocatable :: buf_r4_kind
766 real(kind=r8_kind),
dimension(:,:,:,:,:),
allocatable :: buf_r8_kind
767 logical :: buffer_includes_halos
768 integer,
dimension(5) :: c
769 integer,
dimension(5) :: e
770 integer(kind=i4_kind),
dimension(:,:,:,:,:),
allocatable :: global_buf_i4_kind
771 integer(kind=i8_kind),
dimension(:,:,:,:,:),
allocatable :: global_buf_i8_kind
772 real(kind=r4_kind),
dimension(:,:,:,:,:),
allocatable :: global_buf_r4_kind
773 real(kind=r8_kind),
dimension(:,:,:,:,:),
allocatable :: global_buf_r8_kind
775 type(domain2d),
pointer :: io_domain
780 integer,
dimension(:),
allocatable :: pe_icsize
781 integer,
dimension(:),
allocatable :: pe_iec
782 integer,
dimension(:),
allocatable :: pe_isc
783 integer,
dimension(:),
allocatable :: pe_jcsize
784 integer,
dimension(:),
allocatable :: pe_jec
785 integer,
dimension(:),
allocatable :: pe_jsc
787 integer :: xdim_index
789 integer :: ydim_index
792 integer(kind=i4_kind) :: fill_i4_kind
793 integer(kind=i8_kind) :: fill_i8_kind
794 real(kind=r4_kind) :: fill_r4_kind
795 real(kind=r8_kind) :: fill_r8_kind
801 if (fileobj%use_netcdf_mpi)
then
802 call netcdf_mpi_write_5d(fileobj, variable_name, vdata, unlim_dim_level, corner, edge_lengths)
806 if (.not. is_variable_domain_decomposed(fileobj, variable_name, .true., &
807 xdim_index, ydim_index, xpos, ypos))
then
808 call compressed_write(fileobj, variable_name, vdata, &
809 unlim_dim_level=unlim_dim_level, corner=corner, &
810 edge_lengths=edge_lengths)
814 call domain_offsets(
size(vdata, xdim_index),
size(vdata, ydim_index), fileobj%domain, &
815 xpos, ypos, isd, isc, xc_size, jsd, jsc, yc_size, &
816 buffer_includes_halos, msg=
"file:"//trim(fileobj%path)//
" and variable:"//trim(variable_name))
821 if (fileobj%is_root)
then
822 allocate(pe_isc(
size(fileobj%pelist)))
823 allocate(pe_iec(
size(fileobj%pelist)))
824 allocate(pe_icsize(
size(fileobj%pelist)))
825 call mpp_get_compute_domains(io_domain, xbegin=pe_isc, xend=pe_iec, xsize=pe_icsize, &
827 allocate(pe_jsc(
size(fileobj%pelist)))
828 allocate(pe_jec(
size(fileobj%pelist)))
829 allocate(pe_jcsize(
size(fileobj%pelist)))
830 call mpp_get_compute_domains(io_domain, ybegin=pe_jsc, yend=pe_jec, ysize=pe_jcsize, &
834 call mpp_get_global_domain(io_domain, ybegin=ygmin, yend=ygmax, position=ypos)
835 call mpp_get_global_domain(io_domain, xbegin=xgmin, xend=xgmax, position=xpos)
839 e(xdim_index) = xgmax - xgmin + 1
840 e(ydim_index) = ygmax - ygmin + 1
845 type is (
integer(kind=i4_kind))
846 call allocate_array(global_buf_i4_kind, e)
847 global_buf_i4_kind = 0
848 if (get_fill_value(fileobj, variable_name, fill_i4_kind, broadcast=.false.))
then
849 global_buf_i4_kind = fill_i4_kind
851 type is (
integer(kind=i8_kind))
852 call allocate_array(global_buf_i8_kind, e)
853 global_buf_i8_kind = 0
854 if (get_fill_value(fileobj, variable_name, fill_i8_kind, broadcast=.false.))
then
855 global_buf_i8_kind = fill_i8_kind
857 type is (real(kind=r4_kind))
858 call allocate_array(global_buf_r4_kind, e)
859 global_buf_r4_kind = 0.
860 if (get_fill_value(fileobj, variable_name, fill_r4_kind, broadcast=.false.))
then
861 global_buf_r4_kind = fill_r4_kind
863 type is (real(kind=r8_kind))
864 call allocate_array(global_buf_r8_kind, e)
865 global_buf_r8_kind = 0.
866 if (get_fill_value(fileobj, variable_name, fill_r8_kind, broadcast=.false.))
then
867 global_buf_r8_kind = fill_r8_kind
870 call error(
"unsupported variable type: domain_write_5d: file: "//trim(fileobj%path)//
" variable:"// &
871 & trim(variable_name))
874 do i = 1,
size(fileobj%pelist)
876 c(xdim_index) = pe_isc(i) - xgmin + 1
877 c(ydim_index) = pe_jsc(i) - ygmin + 1
878 e(xdim_index) = pe_icsize(i)
879 e(ydim_index) = pe_jcsize(i)
881 type is (
integer(kind=i4_kind))
882 call allocate_array(buf_i4_kind, e)
886 if (buffer_includes_halos)
then
888 c(xdim_index) = isc - isd + 1
889 c(ydim_index) = jsc - jsd + 1
894 call get_array_section(buf_i4_kind, vdata, c, e)
895 c(xdim_index) = pe_isc(i) - xgmin + 1
896 c(ydim_index) = pe_jsc(i) - ygmin + 1
899 call mpp_recv(buf_i4_kind,
size(buf_i4_kind), fileobj%pelist(i), block=.true.)
902 call put_array_section(buf_i4_kind, global_buf_i4_kind, c, e)
903 deallocate(buf_i4_kind)
904 type is (
integer(kind=i8_kind))
905 call allocate_array(buf_i8_kind, e)
909 if (buffer_includes_halos)
then
911 c(xdim_index) = isc - isd + 1
912 c(ydim_index) = jsc - jsd + 1
917 call get_array_section(buf_i8_kind, vdata, c, e)
918 c(xdim_index) = pe_isc(i) - xgmin + 1
919 c(ydim_index) = pe_jsc(i) - ygmin + 1
922 call mpp_recv(buf_i8_kind,
size(buf_i8_kind), fileobj%pelist(i), block=.true.)
925 call put_array_section(buf_i8_kind, global_buf_i8_kind, c, e)
926 deallocate(buf_i8_kind)
927 type is (real(kind=r4_kind))
928 call allocate_array(buf_r4_kind, e)
932 if (buffer_includes_halos)
then
934 c(xdim_index) = isc - isd + 1
935 c(ydim_index) = jsc - jsd + 1
940 call get_array_section(buf_r4_kind, vdata, c, e)
941 c(xdim_index) = pe_isc(i) - xgmin + 1
942 c(ydim_index) = pe_jsc(i) - ygmin + 1
945 call mpp_recv(buf_r4_kind,
size(buf_r4_kind), fileobj%pelist(i), block=.true.)
948 call put_array_section(buf_r4_kind, global_buf_r4_kind, c, e)
949 deallocate(buf_r4_kind)
950 type is (real(kind=r8_kind))
951 call allocate_array(buf_r8_kind, e)
955 if (buffer_includes_halos)
then
957 c(xdim_index) = isc - isd + 1
958 c(ydim_index) = jsc - jsd + 1
963 call get_array_section(buf_r8_kind, vdata, c, e)
964 c(xdim_index) = pe_isc(i) - xgmin + 1
965 c(ydim_index) = pe_jsc(i) - ygmin + 1
968 call mpp_recv(buf_r8_kind,
size(buf_r8_kind), fileobj%pelist(i), block=.true.)
971 call put_array_section(buf_r8_kind, global_buf_r8_kind, c, e)
972 deallocate(buf_r8_kind)
977 deallocate(pe_icsize)
980 deallocate(pe_jcsize)
984 type is (
integer(kind=i4_kind))
985 call netcdf_write_data(fileobj, variable_name, global_buf_i4_kind, &
986 unlim_dim_level=unlim_dim_level)
987 deallocate(global_buf_i4_kind)
988 type is (
integer(kind=i8_kind))
989 call netcdf_write_data(fileobj, variable_name, global_buf_i8_kind, &
990 unlim_dim_level=unlim_dim_level)
991 deallocate(global_buf_i8_kind)
992 type is (real(kind=r4_kind))
993 call netcdf_write_data(fileobj, variable_name, global_buf_r4_kind, &
994 unlim_dim_level=unlim_dim_level)
995 deallocate(global_buf_r4_kind)
996 type is (real(kind=r8_kind))
997 call netcdf_write_data(fileobj, variable_name, global_buf_r8_kind, &
998 unlim_dim_level=unlim_dim_level)
999 deallocate(global_buf_r8_kind)
1002 if (buffer_includes_halos)
then
1003 c(xdim_index) = isc - isd + 1
1004 c(ydim_index) = jsc - jsd + 1
1006 e(xdim_index) = xc_size
1007 e(ydim_index) = yc_size
1009 type is (
integer(kind=i4_kind))
1010 call allocate_array(buf_i4_kind, e)
1011 call get_array_section(buf_i4_kind, vdata, c, e)
1012 call mpp_send(buf_i4_kind,
size(buf_i4_kind), fileobj%io_root)
1014 deallocate(buf_i4_kind)
1015 type is (
integer(kind=i8_kind))
1016 call allocate_array(buf_i8_kind, e)
1017 call get_array_section(buf_i8_kind, vdata, c, e)
1018 call mpp_send(buf_i8_kind,
size(buf_i8_kind), fileobj%io_root)
1020 deallocate(buf_i8_kind)
1021 type is (real(kind=r4_kind))
1022 call allocate_array(buf_r4_kind, e)
1023 call get_array_section(buf_r4_kind, vdata, c, e)
1024 call mpp_send(buf_r4_kind,
size(buf_r4_kind), fileobj%io_root)
1026 deallocate(buf_r4_kind)
1027 type is (real(kind=r8_kind))
1028 call allocate_array(buf_r8_kind, e)
1029 call get_array_section(buf_r8_kind, vdata, c, e)
1030 call mpp_send(buf_r8_kind,
size(buf_r8_kind), fileobj%io_root)
1032 deallocate(buf_r8_kind)
1034 call error(
"unsupported variable type: domain_write_5d: file: "//trim(fileobj%path)//
" variable:"// &
1035 & trim(variable_name))
1042 type(fmsnetcdfdomainfile_t),
intent(in) :: fileobj
1043 character(len=*),
intent(in) :: variable_name
1044 class(*),
dimension(:,:),
intent(in) :: vdata
1045 integer,
intent(in),
optional :: unlim_dim_level
1046 integer,
dimension(2),
intent(in),
optional :: corner
1048 integer,
dimension(2),
intent(in),
optional :: edge_lengths
1051 integer :: xdim_index
1052 integer :: ydim_index
1062 logical :: buffer_includes_halos
1065 integer,
dimension(3) :: c
1066 integer,
dimension(3) :: e
1068 integer :: unlim_dim_index
1074 if (.not. is_variable_domain_decomposed(fileobj, variable_name, .true., xdim_index, ydim_index, xpos, ypos))
then
1075 call compressed_write(fileobj, variable_name, vdata, unlim_dim_level=unlim_dim_level, corner=corner, &
1076 edge_lengths=edge_lengths)
1081 call domain_offsets(
size(vdata, xdim_index),
size(vdata, ydim_index), fileobj%domain, &
1082 xpos, ypos, isd, isc, xc_size, jsd, jsc, yc_size, &
1083 buffer_includes_halos, msg=
"file:"//trim(fileobj%path)//
" and variable:"//trim(variable_name))
1086 e = [shape(vdata), 1]
1090 e(xdim_index) = xc_size
1091 e(ydim_index) = yc_size
1093 if (
present(unlim_dim_level))
then
1094 unlim_dim_index = get_variable_unlimited_dimension_index(fileobj, variable_name, broadcast=.false.)
1095 if (unlim_dim_index .ne. 3)
then
1096 call error(
"unlimited dimension must be the slowest varying dimension in variable: "//trim(variable_name))
1098 c(unlim_dim_index) = unlim_dim_level
1103 select case (xdim_index)
1106 if (buffer_includes_halos)
then
1110 i1 = i0 + xc_size - 1
1111 j1 = j0 + yc_size - 1
1114 if (buffer_includes_halos)
then
1118 i1 = i0 + yc_size - 1
1119 j1 = j0 + xc_size - 1
1122 varid = get_variable_id(fileobj%ncid, trim(variable_name), &
1123 msg=
"file:"//trim(fileobj%path)//
" and variable:"//trim(variable_name))
1126 type is (
integer(kind=i4_kind))
1127 err = nf90_put_var(fileobj%ncid, varid, &
1128 vdata(i0:i1, j0:j1), &
1130 type is (
integer(kind=i8_kind))
1131 err = nf90_put_var(fileobj%ncid, varid, &
1132 vdata(i0:i1, j0:j1), &
1134 type is (real(kind=r4_kind))
1135 err = nf90_put_var(fileobj%ncid, varid, &
1136 vdata(i0:i1, j0:j1), &
1138 type is (real(kind=r8_kind))
1139 err = nf90_put_var(fileobj%ncid, varid, &
1140 vdata(i0:i1, j0:j1), &
1144 call check_netcdf_code(err,
"Failed to write variable: "//trim(variable_name))
1149 type(fmsnetcdfdomainfile_t),
intent(in) :: fileobj
1150 character(len=*),
intent(in) :: variable_name
1151 class(*),
dimension(:,:,:),
intent(in) :: vdata
1152 integer,
intent(in),
optional :: unlim_dim_level
1153 integer,
dimension(3),
intent(in),
optional :: corner
1155 integer,
dimension(3),
intent(in),
optional :: edge_lengths
1158 integer :: xdim_index
1159 integer :: ydim_index
1169 logical :: buffer_includes_halos
1172 integer,
dimension(4) :: c
1173 integer,
dimension(4) :: e
1175 integer :: unlim_dim_index
1182 if (.not. is_variable_domain_decomposed(fileobj, variable_name, .true., xdim_index, ydim_index, xpos, ypos))
then
1183 call compressed_write(fileobj, variable_name, vdata, unlim_dim_level=unlim_dim_level, corner=corner, &
1184 edge_lengths=edge_lengths)
1189 call domain_offsets(
size(vdata, xdim_index),
size(vdata, ydim_index), fileobj%domain, &
1190 xpos, ypos, isd, isc, xc_size, jsd, jsc, yc_size, &
1191 buffer_includes_halos, msg=
"file:"//trim(fileobj%path)//
" and variable:"//trim(variable_name))
1194 e = [shape(vdata), 1]
1198 e(xdim_index) = xc_size
1199 e(ydim_index) = yc_size
1201 if (
present(unlim_dim_level))
then
1202 unlim_dim_index = get_variable_unlimited_dimension_index(fileobj, variable_name, broadcast=.false.)
1203 if (unlim_dim_index .ne. 4)
then
1204 call error(
"unlimited dimension must be the slowest varying dimension in variable: "//trim(variable_name))
1206 c(unlim_dim_index) = unlim_dim_level
1217 select case (xdim_index)
1220 if (buffer_includes_halos)
then
1223 i1 = i0 + xc_size - 1
1226 if (buffer_includes_halos)
then
1229 j1 = j0 + xc_size - 1
1232 if (buffer_includes_halos)
then
1235 k1 = k0 + xc_size - 1
1238 select case (ydim_index)
1241 if (buffer_includes_halos)
then
1244 i1 = i0 + yc_size - 1
1247 if (buffer_includes_halos)
then
1250 j1 = j0 + yc_size - 1
1253 if (buffer_includes_halos)
then
1256 k1 = k0 + yc_size - 1
1259 varid = get_variable_id(fileobj%ncid, trim(variable_name), &
1260 msg=
"file:"//trim(fileobj%path)//
" and variable:"//trim(variable_name))
1263 type is (
integer(kind=i4_kind))
1264 err = nf90_put_var(fileobj%ncid, varid, &
1265 vdata(i0:i1, j0:j1, k0:k1), &
1267 type is (
integer(kind=i8_kind))
1268 err = nf90_put_var(fileobj%ncid, varid, &
1269 vdata(i0:i1, j0:j1, k0:k1), &
1271 type is (real(kind=r4_kind))
1272 err = nf90_put_var(fileobj%ncid, varid, &
1273 vdata(i0:i1, j0:j1, k0:k1), &
1275 type is (real(kind=r8_kind))
1276 err = nf90_put_var(fileobj%ncid, varid, &
1277 vdata(i0:i1, j0:j1, k0:k1), &
1281 call check_netcdf_code(err,
"Failed to write variable: "//trim(variable_name))
1286 type(fmsnetcdfdomainfile_t),
intent(in) :: fileobj
1287 character(len=*),
intent(in) :: variable_name
1288 class(*),
dimension(:,:,:,:),
intent(in) :: vdata
1289 integer,
intent(in),
optional :: unlim_dim_level
1290 integer,
dimension(4),
intent(in),
optional :: corner
1292 integer,
dimension(4),
intent(in),
optional :: edge_lengths
1295 integer :: xdim_index
1296 integer :: ydim_index
1306 logical :: buffer_includes_halos
1309 integer,
dimension(5) :: c
1310 integer,
dimension(5) :: e
1312 integer :: unlim_dim_index
1320 if (.not. is_variable_domain_decomposed(fileobj, variable_name, .true., xdim_index, ydim_index, xpos, ypos))
then
1321 call compressed_write(fileobj, variable_name, vdata, unlim_dim_level=unlim_dim_level, corner=corner, &
1322 edge_lengths=edge_lengths)
1327 call domain_offsets(
size(vdata, xdim_index),
size(vdata, ydim_index), fileobj%domain, &
1328 xpos, ypos, isd, isc, xc_size, jsd, jsc, yc_size, &
1329 buffer_includes_halos, msg=
"file:"//trim(fileobj%path)//
" and variable:"//trim(variable_name))
1332 e = [shape(vdata), 1]
1336 e(xdim_index) = xc_size
1337 e(ydim_index) = yc_size
1339 if (
present(unlim_dim_level))
then
1340 unlim_dim_index = get_variable_unlimited_dimension_index(fileobj, variable_name, broadcast=.false.)
1341 if (unlim_dim_index .ne. 5)
then
1342 call error(
"unlimited dimension must be the slowest varying dimension in variable: "//trim(variable_name))
1344 c(unlim_dim_index) = unlim_dim_level
1357 select case (xdim_index)
1360 if (buffer_includes_halos)
then
1363 i1 = i0 + xc_size - 1
1366 if (buffer_includes_halos)
then
1369 j1 = j0 + xc_size - 1
1372 if (buffer_includes_halos)
then
1375 k1 = k0 + xc_size - 1
1378 if (buffer_includes_halos)
then
1381 l1 = l0 + xc_size - 1
1384 select case (ydim_index)
1387 if (buffer_includes_halos)
then
1390 i1 = i0 + yc_size - 1
1393 if (buffer_includes_halos)
then
1396 j1 = j0 + yc_size - 1
1399 if (buffer_includes_halos)
then
1402 k1 = k0 + yc_size - 1
1405 if (buffer_includes_halos)
then
1408 l1 = l0 + yc_size - 1
1411 varid = get_variable_id(fileobj%ncid, trim(variable_name), &
1412 msg=
"file:"//trim(fileobj%path)//
" and variable:"//trim(variable_name))
1415 type is (
integer(kind=i4_kind))
1416 err = nf90_put_var(fileobj%ncid, varid, &
1417 vdata(i0:i1, j0:j1, k0:k1, l0:l1), &
1419 type is (
integer(kind=i8_kind))
1420 err = nf90_put_var(fileobj%ncid, varid, &
1421 vdata(i0:i1, j0:j1, k0:k1, l0:l1), &
1423 type is (real(kind=r4_kind))
1424 err = nf90_put_var(fileobj%ncid, varid, &
1425 vdata(i0:i1, j0:j1, k0:k1, l0:l1), &
1427 type is (real(kind=r8_kind))
1428 err = nf90_put_var(fileobj%ncid, varid, &
1429 vdata(i0:i1, j0:j1, k0:k1, l0:l1), &
1433 call check_netcdf_code(err,
"Failed to write variable: "//trim(variable_name))
1438 type(fmsnetcdfdomainfile_t),
intent(in) :: fileobj
1439 character(len=*),
intent(in) :: variable_name
1440 class(*),
dimension(:,:,:,:,:),
intent(in) :: vdata
1441 integer,
intent(in),
optional :: unlim_dim_level
1442 integer,
dimension(5),
intent(in),
optional :: corner
1444 integer,
dimension(5),
intent(in),
optional :: edge_lengths
1447 integer :: xdim_index
1448 integer :: ydim_index
1458 logical :: buffer_includes_halos
1461 integer,
dimension(6) :: c
1462 integer,
dimension(6) :: e
1464 integer :: unlim_dim_index
1473 if (.not. is_variable_domain_decomposed(fileobj, variable_name, .true., xdim_index, ydim_index, xpos, ypos))
then
1474 call compressed_write(fileobj, variable_name, vdata, unlim_dim_level=unlim_dim_level, corner=corner, &
1475 edge_lengths=edge_lengths)
1480 call domain_offsets(
size(vdata, xdim_index),
size(vdata, ydim_index), fileobj%domain, &
1481 xpos, ypos, isd, isc, xc_size, jsd, jsc, yc_size, &
1482 buffer_includes_halos, msg=
"file:"//trim(fileobj%path)//
" and variable:"//trim(variable_name))
1485 e = [shape(vdata), 1]
1489 e(xdim_index) = xc_size
1490 e(ydim_index) = yc_size
1492 if (
present(unlim_dim_level))
then
1493 unlim_dim_index = get_variable_unlimited_dimension_index(fileobj, variable_name, broadcast=.false.)
1494 if (unlim_dim_index .ne. 6)
then
1495 call error(
"unlimited dimension must be the slowest varying dimension in variable: "//trim(variable_name))
1497 c(unlim_dim_index) = unlim_dim_level
1512 select case (xdim_index)
1515 if (buffer_includes_halos)
then
1518 i1 = i0 + xc_size - 1
1521 if (buffer_includes_halos)
then
1524 j1 = j0 + xc_size - 1
1527 if (buffer_includes_halos)
then
1530 k1 = k0 + xc_size - 1
1533 if (buffer_includes_halos)
then
1536 l1 = l0 + xc_size - 1
1539 if (buffer_includes_halos)
then
1542 m1 = m0 + xc_size - 1
1545 select case (ydim_index)
1548 if (buffer_includes_halos)
then
1551 i1 = i0 + yc_size - 1
1554 if (buffer_includes_halos)
then
1557 j1 = j0 + yc_size - 1
1560 if (buffer_includes_halos)
then
1563 k1 = k0 + yc_size - 1
1566 if (buffer_includes_halos)
then
1569 l1 = l0 + yc_size - 1
1572 if (buffer_includes_halos)
then
1575 m1 = m0 + yc_size - 1
1578 varid = get_variable_id(fileobj%ncid, trim(variable_name), &
1579 msg=
"file:"//trim(fileobj%path)//
" and variable:"//trim(variable_name))
1582 type is (
integer(kind=i4_kind))
1583 err = nf90_put_var(fileobj%ncid, varid, &
1584 vdata(i0:i1, j0:j1, k0:k1, l0:l1, m0:m1), &
1586 type is (
integer(kind=i8_kind))
1587 err = nf90_put_var(fileobj%ncid, varid, &
1588 vdata(i0:i1, j0:j1, k0:k1, l0:l1, m0:m1), &
1590 type is (real(kind=r4_kind))
1591 err = nf90_put_var(fileobj%ncid, varid, &
1592 vdata(i0:i1, j0:j1, k0:k1, l0:l1, m0:m1), &
1594 type is (real(kind=r8_kind))
1595 err = nf90_put_var(fileobj%ncid, varid, &
1596 vdata(i0:i1, j0:j1, k0:k1, l0:l1, m0:m1), &
1600 call check_netcdf_code(err,
"Failed to write variable: "//trim(variable_name))
subroutine netcdf_mpi_write_5d(fileobj, variable_name, vdata, unlim_dim_level, corner, edge_lengths)
Write 5D data using NetCDF MPI.
subroutine domain_write_3d(fileobj, variable_name, vdata, unlim_dim_level, corner, edge_lengths)
Gather "compute" domain data on the I/O root rank and then have the I/O root write out the data that ...
subroutine domain_write_4d(fileobj, variable_name, vdata, unlim_dim_level, corner, edge_lengths)
Gather "compute" domain data on the I/O root rank and then have the I/O root write out the data that ...
subroutine domain_write_1d(fileobj, variable_name, vdata, unlim_dim_level, corner, edge_lengths)
Gather "compute" domain data on the I/O root rank and then have the I/O root write out the data that ...
subroutine netcdf_mpi_write_2d(fileobj, variable_name, vdata, unlim_dim_level, corner, edge_lengths)
Write 2D data using NetCDF MPI.
subroutine domain_write_5d(fileobj, variable_name, vdata, unlim_dim_level, corner, edge_lengths)
Gather "compute" domain data on the I/O root rank and then have the I/O root write out the data that ...
subroutine domain_write_0d(fileobj, variable_name, vdata, unlim_dim_level, corner)
Gather "compute" domain data on the I/O root rank and then have the I/O root write out the data that ...
subroutine domain_write_2d(fileobj, variable_name, vdata, unlim_dim_level, corner, edge_lengths)
Gather "compute" domain data on the I/O root rank and then have the I/O root write out the data that ...
subroutine netcdf_mpi_write_3d(fileobj, variable_name, vdata, unlim_dim_level, corner, edge_lengths)
Write 3D data using NetCDF MPI.
subroutine netcdf_mpi_write_4d(fileobj, variable_name, vdata, unlim_dim_level, corner, edge_lengths)
Write 4D data using NetCDF MPI.
type(domain2d) function, pointer mpp_get_io_domain(domain)
Set user stack size.
subroutine mpp_sync_self(pelist, check, request, msg_size, msg_type)
This is to check if current PE's outstanding puts are complete but we can't use shmem_fence because w...