51 disenum, nctype, iout)
54 character(len=*),
intent(in) :: modelname
55 character(len=*),
intent(in) :: modeltype
56 character(len=*),
intent(in) :: modelfname
57 character(len=*),
intent(in) :: nc_fname
58 integer(I4B),
intent(in) :: disenum
59 integer(I4B),
intent(in) :: nctype
60 integer(I4B),
intent(in) :: iout
63 this%nlay = this%dis%nlay
66 allocate (this%var_ids%dependent(this%nlay))
67 allocate (this%var_ids%export(this%nlay))
70 call this%mesh_init(modelname, modeltype, modelfname, nc_fname, disenum, &
71 nctype, this%dis%lenuni, iout)
78 deallocate (this%var_ids%dependent)
80 call this%mesh_destroy()
81 call this%NCModelExportType%destroy()
91 call this%add_global_att()
93 call this%define_dim()
95 call this%create_mesh()
101 call this%define_dependent()
104 call nf_verify(nf90_enddef(this%ncid), this%nc_fname)
106 call this%add_mesh_data()
109 call this%add_pkg_data()
112 call this%define_gridmap()
114 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
123 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
124 integer(I4B) :: n, k, nvals, istp
125 integer(I4B),
dimension(2) :: dis_shape
126 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
135 dis_shape(1) = this%dis%ncol * this%dis%nrow
136 dis_shape(2) = this%dis%nlay
138 nvals = product(dis_shape)
141 if (
size(this%dis%nodeuser) < &
142 size(this%dis%nodereduced))
then
144 allocate (dbl1d(
size(this%dis%nodereduced)))
150 do n = 1,
size(this%dis%nodereduced)
151 if (this%dis%nodereduced(n) > 0)
then
152 dbl1d(n) = this%x(this%dis%nodereduced(n))
156 dbl2d(1:dis_shape(1), 1:dis_shape(2)) => dbl1d(1:nvals)
158 dbl2d(1:dis_shape(1), 1:dis_shape(2)) => this%x(1:nvals)
161 do k = 1, this%dis%nlay
164 this%var_ids%dependent(k), dbl2d(:, k), &
166 count=(/(this%dis%ncol * this%dis%nrow), 1/)), &
171 call nf_verify(nf90_put_var(this%ncid, this%var_ids%time, &
172 totim, start=(/istp/)), &
175 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
178 if (
associated(dbl1d))
deallocate (dbl1d)
192 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
193 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d, nodes
194 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
195 character(len=LINELENGTH) :: nc_tag
196 integer(I4B) :: iaux, iparam, nvals
198 integer(I4B),
pointer :: nbound
204 do iparam = 1, export_pkg%nparam
206 if (export_pkg%param_reads(iparam)%invar < 1) cycle
211 export_pkg%mf6_input%component_type, &
212 export_pkg%mf6_input%subcomponent_type, &
213 'PERIOD', export_pkg%param_names(iparam),
'')
216 nc_tag = this%input_attribute(export_pkg%mf6_input%subcomponent_name, &
220 select case (idt%datatype)
222 call mem_setptr(int1d, idt%mf6varname, export_pkg%mf6_input%mempath)
223 this%var_ids%export(1) = export_pkg%varids_param(iparam, 1)
225 this%y_dim, this%var_ids, this%dis, idt, &
226 export_pkg%mf6_input%mempath, nc_tag, &
227 export_pkg%mf6_input%subcomponent_name, &
228 this%gridmap_name, this%deflate, this%shuffle, &
229 this%chunk_face,
kper, this%nc_fname)
231 call mem_setptr(dbl1d, idt%mf6varname, export_pkg%mf6_input%mempath)
232 select case (idt%shape)
234 this%var_ids%export(1) = export_pkg%varids_param(iparam, 1)
236 this%y_dim, this%var_ids, this%dis, idt, &
237 export_pkg%mf6_input%mempath, nc_tag, &
238 export_pkg%mf6_input%subcomponent_name, &
239 this%gridmap_name, this%deflate, this%shuffle, &
240 this%chunk_face,
kper, iaux, this%nc_fname)
242 nvals = this%dis%nodesuser
243 allocate (nodes(nvals))
245 do k = 1, this%dis%nlay
246 this%var_ids%export(k) = export_pkg%varids_param(iparam, k)
248 call mem_setptr(dbl1d, idt%mf6varname, export_pkg%mf6_input%mempath)
249 call mem_setptr(int1d,
'NODEULIST', export_pkg%mf6_input%mempath)
250 call mem_setptr(nbound,
'NBOUND', export_pkg%mf6_input%mempath)
252 nodes(int1d(n)) = dbl1d(n)
255 this%y_dim, this%var_ids, this%dis, idt, &
256 export_pkg%mf6_input%mempath, nc_tag, &
257 export_pkg%mf6_input%subcomponent_name, &
258 this%gridmap_name, this%deflate, this%shuffle, &
259 this%chunk_face,
kper, iaux, this%nc_fname)
264 call mem_setptr(dbl2d, idt%mf6varname, export_pkg%mf6_input%mempath)
265 select case (idt%shape)
267 nvals = this%dis%nrow * this%dis%ncol
268 allocate (nodes(nvals))
269 do iaux = 1,
size(dbl2d, dim=1)
270 this%var_ids%export(1) = export_pkg%varids_aux(iaux, 1)
272 nodes(n) = dbl2d(iaux, n)
275 this%y_dim, this%var_ids, this%dis, idt, &
276 export_pkg%mf6_input%mempath, nc_tag, &
277 export_pkg%mf6_input%subcomponent_name, &
278 this%gridmap_name, this%deflate, this%shuffle, &
279 this%chunk_face,
kper, iaux, this%nc_fname)
283 nvals = this%dis%nodesuser
284 allocate (nodes(nvals))
285 call mem_setptr(int1d,
'NODEULIST', export_pkg%mf6_input%mempath)
286 call mem_setptr(nbound,
'NBOUND', export_pkg%mf6_input%mempath)
287 do iaux = 1,
size(dbl2d, dim=1)
289 do k = 1, this%dis%nlay
290 this%var_ids%export(k) = export_pkg%varids_aux(iaux, k)
293 nodes(int1d(n)) = dbl2d(iaux, n)
296 this%y_dim, this%var_ids, this%dis, idt, &
297 export_pkg%mf6_input%mempath, nc_tag, &
298 export_pkg%mf6_input%subcomponent_name, &
299 this%gridmap_name, this%deflate, this%shuffle, &
300 this%chunk_face,
kper, iaux, this%nc_fname)
312 call nf_verify(nf90_put_var(this%ncid, this%var_ids%time, &
317 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
324 character(len=*),
intent(in) :: pkgtype
325 character(len=*),
intent(in) :: pkgname
326 character(len=*),
intent(in) :: mempath
328 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
329 integer(I4B),
dimension(:, :),
pointer,
contiguous :: int2d
330 integer(I4B),
dimension(:, :, :),
pointer,
contiguous :: int3d
331 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
332 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
333 real(DP),
dimension(:, :, :),
pointer,
contiguous :: dbl3d
334 character(len=LINELENGTH) :: nc_tag
335 integer(I4B) :: iper, iaux
341 nc_tag = this%input_attribute(pkgname, idt)
343 select case (idt%datatype)
345 call mem_setptr(int1d, idt%mf6varname, mempath)
347 this%y_dim, this%var_ids, this%dis, idt, mempath, &
348 nc_tag, pkgname, this%gridmap_name, this%deflate, &
349 this%shuffle, this%chunk_face, iper, this%nc_fname)
351 call mem_setptr(int2d, idt%mf6varname, mempath)
353 this%dis, idt, mempath, nc_tag, pkgname, &
354 this%gridmap_name, this%deflate, this%shuffle, &
355 this%chunk_face, this%nc_fname)
357 call mem_setptr(int3d, idt%mf6varname, mempath)
359 this%dis, idt, mempath, nc_tag, pkgname, &
360 this%gridmap_name, this%deflate, this%shuffle, &
361 this%chunk_face, this%nc_fname)
363 call mem_setptr(dbl1d, idt%mf6varname, mempath)
365 this%y_dim, this%var_ids, this%dis, idt, mempath, &
366 nc_tag, pkgname, this%gridmap_name, this%deflate, &
367 this%shuffle, this%chunk_face, iper, iaux, &
370 call mem_setptr(dbl2d, idt%mf6varname, mempath)
372 this%dis, idt, mempath, nc_tag, pkgname, &
373 this%gridmap_name, this%deflate, this%shuffle, &
374 this%chunk_face, this%nc_fname)
376 call mem_setptr(dbl3d, idt%mf6varname, mempath)
378 this%dis, idt, mempath, nc_tag, pkgname, &
379 this%gridmap_name, this%deflate, this%shuffle, &
380 this%chunk_face, this%nc_fname)
395 call nf_verify(nf90_def_dim(this%ncid,
'time', this%totnstp, &
396 this%dim_ids%time), this%nc_fname)
397 call nf_verify(nf90_def_var(this%ncid,
'time', nf90_double, &
398 this%dim_ids%time, this%var_ids%time), &
400 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'calendar', &
401 'standard'), this%nc_fname)
402 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'units', &
403 this%datetime), this%nc_fname)
404 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'axis',
'T'), &
406 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'standard_name', &
407 'time'), this%nc_fname)
408 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'long_name', &
409 'time'), this%nc_fname)
413 call nf_verify(nf90_def_dim(this%ncid,
'nmesh_node', &
414 ((this%dis%ncol + 1) * (this%dis%nrow + 1)), &
415 this%dim_ids%nmesh_node), this%nc_fname)
416 call nf_verify(nf90_def_dim(this%ncid,
'nmesh_face', &
417 (this%dis%ncol * this%dis%nrow), &
418 this%dim_ids%nmesh_face), this%nc_fname)
419 call nf_verify(nf90_def_dim(this%ncid,
'max_nmesh_face_nodes', 4, &
420 this%dim_ids%max_nmesh_face_nodes), &
424 call nf_verify(nf90_def_dim(this%ncid,
'x', this%dis%ncol, &
425 this%x_dim), this%nc_fname)
426 call nf_verify(nf90_def_dim(this%ncid,
'y', this%dis%nrow, &
427 this%y_dim), this%nc_fname)
435 integer(I4B) :: cnt, maxvert, m
436 integer(I4B),
dimension(:),
allocatable :: verts
437 real(DP),
dimension(:),
allocatable :: bnds
439 real(DP) :: x, y, x_transform, y_transform
440 real(DP),
dimension(:),
allocatable :: node_x, node_y
441 real(DP),
dimension(:),
allocatable :: cell_x, cell_y
447 call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh, 1), &
451 allocate (verts(maxvert))
452 allocate (bnds(maxvert))
453 allocate (node_x(((this%dis%ncol + 1) * (this%dis%nrow + 1))))
454 allocate (node_y(((this%dis%ncol + 1) * (this%dis%nrow + 1))))
455 allocate (cell_x((this%dis%ncol * this%dis%nrow)))
456 allocate (cell_y((this%dis%ncol * this%dis%nrow)))
460 node_x = nf90_fill_double
461 node_y = nf90_fill_double
462 y = sum(this%dis%delc)
463 do j = this%dis%nrow, 0, -1
465 do i = this%dis%ncol, 0, -1
471 x_transform, y_transform)
472 node_x(cnt) = x_transform
473 node_y(cnt) = y_transform
474 if (i > 0) x = x + this%dis%delr(i)
476 if (j > 0) y = y - this%dis%delc(j)
480 call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_node_x, node_x), &
482 call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_node_y, node_y), &
487 cell_x = nf90_fill_double
488 cell_y = nf90_fill_double
489 do j = 1, this%dis%nrow
490 y = this%dis%celly(j)
491 do i = 1, this%dis%ncol
492 x = this%dis%cellx(i)
497 x_transform, y_transform)
498 cell_x(cnt) = x_transform
499 cell_y(cnt) = y_transform
505 call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_face_x, cell_x), &
507 call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_face_y, cell_y), &
512 do i = 1, this%dis%nrow
513 do j = 1, this%dis%ncol
515 verts = nf90_fill_int
516 verts(1) = cnt + this%dis%ncol + i
517 verts(2) = cnt + this%dis%ncol + i + 1
520 verts(4) = cnt + i - 1
527 call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_face_nodes, &
528 verts, start=(/1, cnt/), &
529 count=(/maxvert, 1/)), &
533 bnds = nf90_fill_double
535 if (verts(m) /= nf90_fill_int)
then
536 bnds(m) = node_y(verts(m))
539 call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_face_ybnds, &
540 bnds, start=(/1, cnt/), &
541 count=(/maxvert, 1/)), &
546 bnds = nf90_fill_double
548 if (verts(m) /= nf90_fill_int)
then
549 bnds(m) = node_x(verts(m))
552 call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_face_xbnds, &
553 bnds, start=(/1, cnt/), &
554 count=(/maxvert, 1/)), &
572 idt, mempath, nc_tag, pkgname, gridmap_name, &
573 deflate, shuffle, chunk_face, iper, nc_fname)
575 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(in) :: p_mem
576 integer(I4B),
intent(in) :: ncid
578 integer(I4B),
intent(in) :: x_dim
579 integer(I4B),
intent(in) :: y_dim
581 type(
distype),
pointer,
intent(in) :: dis
583 character(len=*),
intent(in) :: mempath
584 character(len=*),
intent(in) :: nc_tag
585 character(len=*),
intent(in) :: pkgname
586 character(len=*),
intent(in) :: gridmap_name
587 integer(I4B),
intent(in) :: deflate
588 integer(I4B),
intent(in) :: shuffle
589 integer(I4B),
intent(in) :: chunk_face
590 integer(I4B),
intent(in) :: iper
591 character(len=*),
intent(in) :: nc_fname
592 integer(I4B),
dimension(:, :, :),
pointer,
contiguous :: int3d
593 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
594 integer(I4B) :: axis_dim, nvals, k
595 integer(I4B),
dimension(:),
allocatable :: var_id
596 character(len=LINELENGTH) :: longname, varname
598 if (idt%shape ==
'NROW' .or. &
599 idt%shape ==
'NCOL' .or. &
600 idt%shape ==
'NCPL' .or. &
601 idt%shape ==
'NAUX NCPL')
then
605 select case (idt%shape)
610 case (
'NCPL',
'NAUX NCPL')
611 axis_dim = dim_ids%nmesh_face
616 longname =
export_longname(idt%longname, pkgname, idt%tagname, mempath)
621 call nf_verify(nf90_redef(ncid), nc_fname)
622 call nf_verify(nf90_def_var(ncid, varname, nf90_int, &
623 (/axis_dim/), var_id(1)), &
627 call ncvar_deflate(ncid, var_id(1), deflate, shuffle, nc_fname)
630 call nf_verify(nf90_put_att(ncid, var_id(1),
'_FillValue', &
631 (/nf90_fill_int/)), nc_fname)
632 call nf_verify(nf90_put_att(ncid, var_id(1),
'long_name', &
639 call nf_verify(nf90_enddef(ncid), nc_fname)
640 call nf_verify(nf90_put_var(ncid, var_id(1), p_mem), &
643 nvals = dis%nrow * dis%ncol
645 var_ids%export(1), p_mem, &
647 count=(/nvals, 1/)), nc_fname)
652 int3d(1:dis%ncol, 1:dis%nrow, 1:dis%nlay) => p_mem(1:dis%nodesuser)
655 nvals = dis%nrow * dis%ncol
659 allocate (var_id(dis%nlay))
662 call nf_verify(nf90_redef(ncid), nc_fname)
670 call nf_verify(nf90_def_var(ncid, varname, nf90_int, &
671 (/dim_ids%nmesh_face/), var_id(k)), &
675 call ncvar_chunk(ncid, var_id(k), chunk_face, nc_fname)
677 call ncvar_deflate(ncid, var_id(k), deflate, shuffle, nc_fname)
680 call nf_verify(nf90_put_att(ncid, var_id(k),
'_FillValue', &
681 (/nf90_fill_int/)), nc_fname)
682 call nf_verify(nf90_put_att(ncid, var_id(k),
'long_name', &
691 call nf_verify(nf90_enddef(ncid), nc_fname)
693 int1d(1:nvals) => int3d(:, :, k)
694 call nf_verify(nf90_put_var(ncid, var_id(k), int1d), nc_fname)
702 int1d(1:nvals) => int3d(:, :, k)
704 var_ids%export(k), int1d, &
706 count=(/nvals, 1/)), nc_fname)
715 nc_tag, pkgname, gridmap_name, deflate, shuffle, &
716 chunk_face, nc_fname)
717 integer(I4B),
dimension(:, :),
pointer,
contiguous,
intent(in) :: p_mem
718 integer(I4B),
intent(in) :: ncid
721 type(
distype),
pointer,
intent(in) :: dis
723 character(len=*),
intent(in) :: mempath
724 character(len=*),
intent(in) :: nc_tag
725 character(len=*),
intent(in) :: pkgname
726 character(len=*),
intent(in) :: gridmap_name
727 integer(I4B),
intent(in) :: deflate
728 integer(I4B),
intent(in) :: shuffle
729 integer(I4B),
intent(in) :: chunk_face
730 character(len=*),
intent(in) :: nc_fname
731 integer(I4B) :: var_id, nvals
732 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
733 character(len=LINELENGTH) :: longname, varname
737 longname =
export_longname(idt%longname, pkgname, idt%tagname, mempath)
740 call nf_verify(nf90_redef(ncid), nc_fname)
741 call nf_verify(nf90_def_var(ncid, varname, nf90_int, &
742 (/dim_ids%nmesh_face/), var_id), &
746 call ncvar_chunk(ncid, var_id, chunk_face, nc_fname)
751 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
752 (/nf90_fill_int/)), nc_fname)
753 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
761 call nf_verify(nf90_enddef(ncid), nc_fname)
762 nvals = dis%nrow * dis%ncol
763 int1d(1:nvals) => p_mem
764 call nf_verify(nf90_put_var(ncid, var_id, int1d), nc_fname)
770 nc_tag, pkgname, gridmap_name, deflate, shuffle, &
771 chunk_face, nc_fname)
772 integer(I4B),
dimension(:, :, :),
pointer,
contiguous,
intent(in) :: p_mem
773 integer(I4B),
intent(in) :: ncid
776 type(
distype),
pointer,
intent(in) :: dis
778 character(len=*),
intent(in) :: mempath
779 character(len=*),
intent(in) :: nc_tag
780 character(len=*),
intent(in) :: pkgname
781 character(len=*),
intent(in) :: gridmap_name
782 integer(I4B),
intent(in) :: deflate
783 integer(I4B),
intent(in) :: shuffle
784 integer(I4B),
intent(in) :: chunk_face
785 character(len=*),
intent(in) :: nc_fname
786 integer(I4B),
dimension(:),
allocatable :: var_id
787 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
788 character(len=LINELENGTH) :: longname, varname
789 integer(I4B) :: k, nvals
791 allocate (var_id(dis%nlay))
794 call nf_verify(nf90_redef(ncid), nc_fname)
801 call nf_verify(nf90_def_var(ncid, varname, nf90_int, &
802 (/dim_ids%nmesh_face/), var_id(k)), &
806 call ncvar_chunk(ncid, var_id(k), chunk_face, nc_fname)
808 call ncvar_deflate(ncid, var_id(k), deflate, shuffle, nc_fname)
811 call nf_verify(nf90_put_att(ncid, var_id(k),
'_FillValue', &
812 (/nf90_fill_int/)), nc_fname)
813 call nf_verify(nf90_put_att(ncid, var_id(k),
'long_name', &
822 call nf_verify(nf90_enddef(ncid), nc_fname)
823 nvals = dis%nrow * dis%ncol
825 int1d(1:nvals) => p_mem(:, :, k)
826 call nf_verify(nf90_put_var(ncid, var_id(k), int1d), nc_fname)
836 idt, mempath, nc_tag, pkgname, gridmap_name, &
837 deflate, shuffle, chunk_face, iper, iaux, nc_fname)
839 real(DP),
dimension(:),
pointer,
contiguous,
intent(in) :: p_mem
840 integer(I4B),
intent(in) :: ncid
842 integer(I4B),
intent(in) :: x_dim
843 integer(I4B),
intent(in) :: y_dim
845 type(
distype),
pointer,
intent(in) :: dis
847 character(len=*),
intent(in) :: mempath
848 character(len=*),
intent(in) :: nc_tag
849 character(len=*),
intent(in) :: pkgname
850 character(len=*),
intent(in) :: gridmap_name
851 integer(I4B),
intent(in) :: deflate
852 integer(I4B),
intent(in) :: shuffle
853 integer(I4B),
intent(in) :: chunk_face
854 integer(I4B),
intent(in) :: iper
855 integer(I4B),
intent(in) :: iaux
856 character(len=*),
intent(in) :: nc_fname
857 real(DP),
dimension(:, :, :),
pointer,
contiguous :: dbl3d
858 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
859 integer(I4B) :: axis_dim, nvals, k
860 integer(NF90_INT),
dimension(:),
allocatable :: var_id
861 character(len=LINELENGTH) :: longname, varname
863 if (idt%shape ==
'NROW' .or. &
864 idt%shape ==
'NCOL' .or. &
865 idt%shape ==
'NCPL' .or. &
866 idt%shape ==
'NAUX NCPL')
then
870 select case (idt%shape)
875 case (
'NCPL',
'NAUX NCPL')
876 axis_dim = dim_ids%nmesh_face
880 varname =
export_varname(pkgname, idt%tagname, mempath, iaux=iaux)
887 call nf_verify(nf90_redef(ncid), nc_fname)
888 call nf_verify(nf90_def_var(ncid, varname, nf90_double, &
889 (/axis_dim/), var_id(1)), &
893 call ncvar_deflate(ncid, var_id(1), deflate, shuffle, nc_fname)
896 call nf_verify(nf90_put_att(ncid, var_id(1),
'_FillValue', &
897 (/nf90_fill_double/)), nc_fname)
898 call nf_verify(nf90_put_att(ncid, var_id(1),
'long_name', &
902 call ncvar_mf6attr(ncid, var_id(1), 0, iaux, nc_tag, nc_fname)
905 call nf_verify(nf90_enddef(ncid), nc_fname)
906 call nf_verify(nf90_put_var(ncid, var_id(1), p_mem), &
909 nvals = dis%nrow * dis%ncol
911 var_ids%export(1), p_mem, &
913 count=(/nvals, 1/)), nc_fname)
918 dbl3d(1:dis%ncol, 1:dis%nrow, 1:dis%nlay) => p_mem(1:dis%nodesuser)
921 nvals = dis%nrow * dis%ncol
927 allocate (var_id(dis%nlay))
930 call nf_verify(nf90_redef(ncid), nc_fname)
933 varname =
export_varname(pkgname, idt%tagname, mempath, layer=k, &
936 mempath, layer=k, iaux=iaux)
939 call nf_verify(nf90_def_var(ncid, varname, nf90_double, &
940 (/dim_ids%nmesh_face/), var_id(k)), &
944 call ncvar_chunk(ncid, var_id(k), chunk_face, nc_fname)
946 call ncvar_deflate(ncid, var_id(k), deflate, shuffle, nc_fname)
949 call nf_verify(nf90_put_att(ncid, var_id(k),
'_FillValue', &
950 (/nf90_fill_double/)), nc_fname)
951 call nf_verify(nf90_put_att(ncid, var_id(k),
'long_name', &
956 call ncvar_mf6attr(ncid, var_id(k), k, iaux, nc_tag, nc_fname)
960 call nf_verify(nf90_enddef(ncid), nc_fname)
964 dbl1d(1:nvals) => dbl3d(:, :, k)
965 call nf_verify(nf90_put_var(ncid, var_id(k), dbl1d), nc_fname)
973 dbl1d(1:nvals) => dbl3d(:, :, k)
975 var_ids%export(k), dbl1d, &
977 count=(/nvals, 1/)), nc_fname)
986 nc_tag, pkgname, gridmap_name, deflate, shuffle, &
987 chunk_face, nc_fname)
988 real(DP),
dimension(:, :),
pointer,
contiguous,
intent(in) :: p_mem
989 integer(I4B),
intent(in) :: ncid
992 type(
distype),
pointer,
intent(in) :: dis
994 character(len=*),
intent(in) :: mempath
995 character(len=*),
intent(in) :: nc_tag
996 character(len=*),
intent(in) :: pkgname
997 character(len=*),
intent(in) :: gridmap_name
998 integer(I4B),
intent(in) :: deflate
999 integer(I4B),
intent(in) :: shuffle
1000 integer(I4B),
intent(in) :: chunk_face
1001 character(len=*),
intent(in) :: nc_fname
1002 integer(I4B) :: var_id, nvals
1003 character(len=LINELENGTH) :: longname, varname
1004 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
1008 longname =
export_longname(idt%longname, pkgname, idt%tagname, mempath)
1011 call nf_verify(nf90_redef(ncid), nc_fname)
1012 call nf_verify(nf90_def_var(ncid, varname, nf90_double, &
1013 (/dim_ids%nmesh_face/), var_id), &
1017 call ncvar_chunk(ncid, var_id, chunk_face, nc_fname)
1019 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1022 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1023 (/nf90_fill_double/)), nc_fname)
1024 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1025 longname), nc_fname)
1032 call nf_verify(nf90_enddef(ncid), nc_fname)
1033 nvals = dis%nrow * dis%ncol
1034 dbl1d(1:nvals) => p_mem
1035 call nf_verify(nf90_put_var(ncid, var_id, dbl1d), nc_fname)
1041 nc_tag, pkgname, gridmap_name, deflate, shuffle, &
1042 chunk_face, nc_fname)
1043 real(DP),
dimension(:, :, :),
pointer,
contiguous,
intent(in) :: p_mem
1044 integer(I4B),
intent(in) :: ncid
1047 type(
distype),
pointer,
intent(in) :: dis
1049 character(len=*),
intent(in) :: mempath
1050 character(len=*),
intent(in) :: nc_tag
1051 character(len=*),
intent(in) :: pkgname
1052 character(len=*),
intent(in) :: gridmap_name
1053 integer(I4B),
intent(in) :: deflate
1054 integer(I4B),
intent(in) :: shuffle
1055 integer(I4B),
intent(in) :: chunk_face
1056 character(len=*),
intent(in) :: nc_fname
1057 integer(I4B),
dimension(:),
allocatable :: var_id
1058 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
1059 character(len=LINELENGTH) :: longname, varname
1060 integer(I4B) :: k, nvals
1063 nvals = dis%nrow * dis%ncol
1065 allocate (var_id(dis%nlay))
1068 call nf_verify(nf90_redef(ncid), nc_fname)
1075 call nf_verify(nf90_def_var(ncid, varname, nf90_double, &
1076 (/dim_ids%nmesh_face/), var_id(k)), &
1080 call ncvar_chunk(ncid, var_id(k), chunk_face, nc_fname)
1082 call ncvar_deflate(ncid, var_id(k), deflate, shuffle, nc_fname)
1085 call nf_verify(nf90_put_att(ncid, var_id(k),
'_FillValue', &
1086 (/nf90_fill_double/)), nc_fname)
1087 call nf_verify(nf90_put_att(ncid, var_id(k),
'long_name', &
1088 longname), nc_fname)
1096 call nf_verify(nf90_enddef(ncid), nc_fname)
1098 dbl1d(1:nvals) => p_mem(:, :, k)
1099 call nf_verify(nf90_put_var(ncid, var_id(k), dbl1d), nc_fname)
subroutine, public dis_transform_xy(x, y, xorigin, yorigin, angrot, xglo, yglo)
Get global (x, y) coordinates from cell-local coordinates.
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
integer(i4b), parameter lencomponentname
maximum length of a component name
@ mvalidate
validation mode - do not run time steps
real(dp), parameter dnodata
real no data constant
integer(i4b), parameter lenbigline
maximum length of a big line
real(dp), parameter dhnoflo
real no flow constant
real(dp), parameter dzero
real constant zero
integer(i4b), parameter lenmempath
maximum length of the memory path
This module contains the DefinitionSelectModule.
type(inputparamdefinitiontype) function, pointer, public get_param_definition_type(input_definition_types, component_type, subcomponent_type, blockname, tagname, filename)
Return parameter definition.
This module defines variable data types.
This module contains the MeshDisModelModule.
subroutine nc_export_dbl2d(p_mem, ncid, dim_ids, var_ids, dis, idt, mempath, nc_tag, pkgname, gridmap_name, deflate, shuffle, chunk_face, nc_fname)
netcdf export 2D double
subroutine nc_export_int1d(p_mem, ncid, dim_ids, x_dim, y_dim, var_ids, dis, idt, mempath, nc_tag, pkgname, gridmap_name, deflate, shuffle, chunk_face, iper, nc_fname)
netcdf export 1D integer
subroutine define_dim(this)
netcdf export define dimensions
subroutine add_mesh_data(this)
netcdf export add mesh information
subroutine nc_export_dbl3d(p_mem, ncid, dim_ids, var_ids, dis, idt, mempath, nc_tag, pkgname, gridmap_name, deflate, shuffle, chunk_face, nc_fname)
netcdf export 3D double
subroutine nc_export_int2d(p_mem, ncid, dim_ids, var_ids, dis, idt, mempath, nc_tag, pkgname, gridmap_name, deflate, shuffle, chunk_face, nc_fname)
netcdf export 2D integer
subroutine dis_export_init(this, modelname, modeltype, modelfname, nc_fname, disenum, nctype, iout)
netcdf export dis init
subroutine step(this)
netcdf export step
subroutine package_step(this, export_pkg)
netcdf export package dynamic input
subroutine dis_export_destroy(this)
netcdf export dis destroy
subroutine nc_export_int3d(p_mem, ncid, dim_ids, var_ids, dis, idt, mempath, nc_tag, pkgname, gridmap_name, deflate, shuffle, chunk_face, nc_fname)
netcdf export 3D integer
subroutine nc_export_dbl1d(p_mem, ncid, dim_ids, x_dim, y_dim, var_ids, dis, idt, mempath, nc_tag, pkgname, gridmap_name, deflate, shuffle, chunk_face, iper, iaux, nc_fname)
netcdf export 1D double
subroutine export_input_array(this, pkgtype, pkgname, mempath, idt)
netcdf export an input array
subroutine df(this)
netcdf export define
This module contains the MeshModelModule.
subroutine, public ncvar_mf6attr(ncid, varid, layer, iaux, nc_tag, nc_fname)
put variable internal attributes
subroutine, public ncvar_gridmap(ncid, varid, gridmap_name, nc_fname)
put variable gridmap attributes
subroutine, public ncvar_chunk(ncid, varid, chunk_face, nc_fname)
define variable chunking
subroutine, public ncvar_deflate(ncid, varid, deflate, shuffle, nc_fname)
define variable compression
This module contains the NCModelExportModule.
character(len=linelength) function, public export_varname(pkgname, tagname, mempath, layer, iaux)
build netcdf variable name
character(len=linelength) function, public export_longname(longname, pkgname, tagname, mempath, layer, iaux)
build netcdf variable longname
This module contains the NetCDFCommonModule.
subroutine, public nf_verify(res, nc_fname)
error check a netcdf-fortran interface call
This module contains simulation methods.
subroutine, public store_error(msg, terminate)
Store an error message.
subroutine, public store_error_filename(filename, terminate)
Store the erroring file name.
This module contains simulation variables.
character(len=maxcharlen) errmsg
error message string
integer(i4b) isim_mode
simulation mode
real(dp), pointer, public totim
time relative to start of simulation
integer(i4b), pointer, public kper
current stress period number
This class is used to store a single deferred-length character string. It was designed to work in an ...
Structured grid discretization.
type for storing model export dimension ids
type for storing model export variable ids