49 disenum, nctype, iout)
52 character(len=*),
intent(in) :: modelname
53 character(len=*),
intent(in) :: modeltype
54 character(len=*),
intent(in) :: modelfname
55 character(len=*),
intent(in) :: nc_fname
56 integer(I4B),
intent(in) :: disenum
57 integer(I4B),
intent(in) :: nctype
58 integer(I4B),
intent(in) :: iout
61 this%nlay = this%disv%nlay
64 allocate (this%var_ids%dependent(this%nlay))
65 allocate (this%var_ids%export(this%nlay))
68 call this%mesh_init(modelname, modeltype, modelfname, nc_fname, disenum, &
69 nctype, this%disv%lenuni, iout)
76 deallocate (this%var_ids%dependent)
78 call this%mesh_destroy()
79 call this%NCModelExportType%destroy()
89 call this%add_global_att()
91 call this%define_dim()
93 call this%create_mesh()
99 call this%define_dependent()
102 call nf_verify(nf90_enddef(this%ncid), this%nc_fname)
104 call this%add_mesh_data()
107 call this%add_pkg_data()
110 call this%define_gridmap()
112 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
121 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
122 integer(I4B) :: n, k, nvals, istp
123 integer(I4B),
dimension(2) :: dis_shape
124 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
133 dis_shape(1) = this%disv%ncpl
134 dis_shape(2) = this%disv%nlay
136 nvals = product(dis_shape)
139 if (
size(this%disv%nodeuser) < &
140 size(this%disv%nodereduced))
then
142 allocate (dbl1d(
size(this%disv%nodereduced)))
148 do n = 1,
size(this%disv%nodereduced)
149 if (this%disv%nodereduced(n) > 0)
then
150 dbl1d(n) = this%x(this%disv%nodereduced(n))
154 dbl2d(1:dis_shape(1), 1:dis_shape(2)) => dbl1d(1:nvals)
156 dbl2d(1:dis_shape(1), 1:dis_shape(2)) => this%x(1:nvals)
159 do k = 1, this%disv%nlay
162 this%var_ids%dependent(k), dbl2d(:, k), &
164 count=(/this%disv%ncpl, 1/)), &
169 call nf_verify(nf90_put_var(this%ncid, this%var_ids%time, &
170 totim, start=(/istp/)), &
174 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
177 if (
associated(dbl1d))
deallocate (dbl1d)
191 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
192 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d, nodes
193 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
194 character(len=LINELENGTH) :: nc_tag
195 integer(I4B) :: iaux, iparam, nvals
197 integer(I4B),
pointer :: nbound
203 do iparam = 1, export_pkg%nparam
205 if (export_pkg%param_reads(iparam)%invar < 1) cycle
210 export_pkg%mf6_input%component_type, &
211 export_pkg%mf6_input%subcomponent_type, &
212 'PERIOD', export_pkg%param_names(iparam),
'')
215 nc_tag = this%input_attribute(export_pkg%mf6_input%subcomponent_name, &
219 select case (idt%datatype)
221 call mem_setptr(int1d, idt%mf6varname, export_pkg%mf6_input%mempath)
222 this%var_ids%export(1) = export_pkg%varids_param(iparam, 1)
224 this%disv, idt, export_pkg%mf6_input%mempath, &
225 nc_tag, export_pkg%mf6_input%subcomponent_name, &
226 this%gridmap_name, this%deflate, this%shuffle, &
227 this%chunk_face,
kper, this%nc_fname)
229 call mem_setptr(dbl1d, idt%mf6varname, export_pkg%mf6_input%mempath)
230 select case (idt%shape)
232 this%var_ids%export(1) = export_pkg%varids_param(iparam, 1)
234 this%disv, idt, export_pkg%mf6_input%mempath, &
235 nc_tag, export_pkg%mf6_input%subcomponent_name, &
236 this%gridmap_name, this%deflate, this%shuffle, &
237 this%chunk_face,
kper, iaux, this%nc_fname)
239 nvals = this%disv%nodesuser
240 allocate (nodes(nvals))
242 do k = 1, this%disv%nlay
243 this%var_ids%export(k) = export_pkg%varids_param(iparam, k)
245 call mem_setptr(dbl1d, idt%mf6varname, export_pkg%mf6_input%mempath)
246 call mem_setptr(int1d,
'NODEULIST', export_pkg%mf6_input%mempath)
247 call mem_setptr(nbound,
'NBOUND', export_pkg%mf6_input%mempath)
249 nodes(int1d(n)) = dbl1d(n)
252 this%disv, idt, export_pkg%mf6_input%mempath, &
253 nc_tag, export_pkg%mf6_input%subcomponent_name, &
254 this%gridmap_name, this%deflate, this%shuffle, &
255 this%chunk_face,
kper, iaux, this%nc_fname)
260 call mem_setptr(dbl2d, idt%mf6varname, export_pkg%mf6_input%mempath)
261 select case (idt%shape)
263 nvals = this%disv%ncpl
264 allocate (nodes(nvals))
265 do iaux = 1,
size(dbl2d, dim=1)
266 this%var_ids%export(1) = export_pkg%varids_aux(iaux, 1)
268 nodes(n) = dbl2d(iaux, n)
271 this%disv, idt, export_pkg%mf6_input%mempath, &
272 nc_tag, export_pkg%mf6_input%subcomponent_name, &
273 this%gridmap_name, this%deflate, this%shuffle, &
274 this%chunk_face,
kper, iaux, this%nc_fname)
278 nvals = this%disv%nodesuser
279 allocate (nodes(nvals))
280 call mem_setptr(int1d,
'NODEULIST', export_pkg%mf6_input%mempath)
281 call mem_setptr(nbound,
'NBOUND', export_pkg%mf6_input%mempath)
282 do iaux = 1,
size(dbl2d, dim=1)
284 do k = 1, this%disv%nlay
285 this%var_ids%export(k) = export_pkg%varids_aux(iaux, k)
288 nodes(int1d(n)) = dbl2d(iaux, n)
291 this%disv, idt, export_pkg%mf6_input%mempath, &
292 nc_tag, export_pkg%mf6_input%subcomponent_name, &
293 this%gridmap_name, this%deflate, this%shuffle, &
294 this%chunk_face,
kper, iaux, this%nc_fname)
305 call nf_verify(nf90_put_var(this%ncid, this%var_ids%time, &
310 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
317 character(len=*),
intent(in) :: pkgtype
318 character(len=*),
intent(in) :: pkgname
319 character(len=*),
intent(in) :: mempath
321 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
322 integer(I4B),
dimension(:, :),
pointer,
contiguous :: int2d
323 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
324 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
325 character(len=LINELENGTH) :: nc_tag
326 integer(I4B) :: iper, iaux
332 nc_tag = this%input_attribute(pkgname, idt)
334 select case (idt%datatype)
336 call mem_setptr(int1d, idt%mf6varname, mempath)
338 this%disv, idt, mempath, nc_tag, pkgname, &
339 this%gridmap_name, this%deflate, this%shuffle, &
340 this%chunk_face, iper, this%nc_fname)
342 call mem_setptr(int2d, idt%mf6varname, mempath)
344 this%disv, idt, mempath, nc_tag, pkgname, &
345 this%gridmap_name, this%deflate, this%shuffle, &
346 this%chunk_face, this%nc_fname)
348 call mem_setptr(dbl1d, idt%mf6varname, mempath)
350 this%disv, idt, mempath, nc_tag, pkgname, &
351 this%gridmap_name, this%deflate, this%shuffle, &
352 this%chunk_face, iper, iaux, this%nc_fname)
354 call mem_setptr(dbl2d, idt%mf6varname, mempath)
356 this%disv, idt, mempath, nc_tag, pkgname, &
357 this%gridmap_name, this%deflate, this%shuffle, &
358 this%chunk_face, this%nc_fname)
370 integer(I4B),
dimension(:),
contiguous,
pointer :: ncvert
372 character(len=LINELENGTH) :: varname
373 character(len=LINELENGTH) :: elev_longname
376 call mem_setptr(ncvert,
'NCVERT', this%dis_mempath)
380 call nf_verify(nf90_def_dim(this%ncid,
'time', this%totnstp, &
381 this%dim_ids%time), this%nc_fname)
382 call nf_verify(nf90_def_var(this%ncid,
'time', nf90_double, &
383 this%dim_ids%time, this%var_ids%time), &
385 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'calendar', &
386 'standard'), this%nc_fname)
387 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'units', &
388 this%datetime), this%nc_fname)
389 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'axis',
'T'), &
391 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'standard_name', &
392 'time'), this%nc_fname)
393 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'long_name', &
394 'time'), this%nc_fname)
398 call nf_verify(nf90_def_dim(this%ncid,
'nmesh_node', this%disv%nvert, &
399 this%dim_ids%nmesh_node), this%nc_fname)
400 call nf_verify(nf90_def_dim(this%ncid,
'nmesh_face', this%disv%ncpl, &
401 this%dim_ids%nmesh_face), this%nc_fname)
402 call nf_verify(nf90_def_dim(this%ncid,
'max_nmesh_face_nodes', &
404 this%dim_ids%max_nmesh_face_nodes), &
408 call nf_verify(nf90_def_dim(this%ncid,
'layer', this%nlay, &
409 this%dim_ids%layer), this%nc_fname)
410 call nf_verify(nf90_def_var(this%ncid,
'layer', nf90_int, &
411 this%dim_ids%layer, this%var_ids%layer), &
413 call nf_verify(nf90_put_att(this%ncid, this%var_ids%layer,
'units',
'1'), &
415 call nf_verify(nf90_put_att(this%ncid, this%var_ids%layer,
'axis',
'Z'), &
417 call nf_verify(nf90_put_att(this%ncid, this%var_ids%layer,
'positive', &
418 'down'), this%nc_fname)
419 call nf_verify(nf90_put_att(this%ncid, this%var_ids%layer,
'long_name', &
420 'model layer'), this%nc_fname)
428 allocate (this%var_ids%elevation(this%nlay))
430 write (varname,
'(a,i0)')
'z_l', k
431 call nf_verify(nf90_def_var(this%ncid, trim(varname), nf90_double, &
432 (/this%dim_ids%nmesh_face/), &
433 this%var_ids%elevation(k)), this%nc_fname)
434 call ncvar_chunk(this%ncid, this%var_ids%elevation(k), this%chunk_face, &
436 call ncvar_deflate(this%ncid, this%var_ids%elevation(k), this%deflate, &
437 this%shuffle, this%nc_fname)
438 call nf_verify(nf90_put_att(this%ncid, this%var_ids%elevation(k), &
439 'units', this%lenunits), this%nc_fname)
440 call nf_verify(nf90_put_att(this%ncid, this%var_ids%elevation(k), &
441 'standard_name',
'altitude'), this%nc_fname)
442 call nf_verify(nf90_put_att(this%ncid, this%var_ids%elevation(k), &
443 'positive',
'up'), this%nc_fname)
444 write (elev_longname,
'(a,i0,a)')
'cell center elevation (layer ', &
446 call nf_verify(nf90_put_att(this%ncid, this%var_ids%elevation(k), &
447 'long_name', trim(elev_longname)), &
449 call ncvar_layer(this%ncid, this%var_ids%elevation(k), k, this%nc_fname)
458 integer(I4B),
dimension(:),
contiguous,
pointer :: ncvert => null()
459 integer(I4B),
dimension(:),
contiguous,
pointer :: icvert => null()
460 real(DP),
dimension(:),
contiguous,
pointer :: cell_xt => null()
461 real(DP),
dimension(:),
contiguous,
pointer :: cell_yt => null()
462 real(DP),
dimension(:),
contiguous,
pointer :: vert_xt => null()
463 real(DP),
dimension(:),
contiguous,
pointer :: vert_yt => null()
464 real(DP) :: x_transform, y_transform
465 integer(I4B) :: n, m, idx, cnt, iv, maxvert, k
466 integer(I4B),
dimension(:),
allocatable :: verts, layers
467 real(DP),
dimension(:),
allocatable :: bnds
468 real(DP),
dimension(:),
allocatable :: elev_face
469 integer(I4B) :: istop
472 call mem_setptr(ncvert,
'NCVERT', this%dis_mempath)
473 call mem_setptr(icvert,
'ICVERT', this%dis_mempath)
476 allocate (cell_xt(this%disv%ncpl))
477 allocate (cell_yt(this%disv%ncpl))
478 allocate (vert_xt(this%disv%nvert))
479 allocate (vert_yt(this%disv%nvert))
482 call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh, 1), &
486 allocate (layers(this%nlay))
490 call nf_verify(nf90_put_var(this%ncid, this%var_ids%layer, layers), &
495 do n = 1, this%disv%nvert
500 x_transform, y_transform)
501 vert_xt(n) = x_transform
502 vert_yt(n) = y_transform
506 do n = 1, this%disv%ncpl
511 x_transform, y_transform)
512 cell_xt(n) = x_transform
513 cell_yt(n) = y_transform
517 call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_node_x, &
518 vert_xt), this%nc_fname)
519 call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_node_y, &
520 vert_yt), this%nc_fname)
523 call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_face_x, &
524 cell_xt), this%nc_fname)
525 call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_face_y, &
526 cell_yt), this%nc_fname)
530 allocate (elev_face(this%disv%ncpl))
533 elev_face(:) = (this%disv%top1d(:) + this%disv%bot2d(:, k)) *
dhalf
535 elev_face(:) = (this%disv%bot2d(:, k - 1) + &
536 this%disv%bot2d(:, k)) *
dhalf
538 call nf_verify(nf90_put_var(this%ncid, this%var_ids%elevation(k), &
539 elev_face), this%nc_fname)
541 deallocate (elev_face)
544 maxvert = maxval(ncvert)
547 allocate (verts(maxvert))
548 allocate (bnds(maxvert))
552 do n = 1, this%disv%ncpl
553 verts = nf90_fill_int
554 idx = cnt + ncvert(n)
557 do m = idx, istop, -1
560 verts(iv) = icvert(m)
564 if (verts(iv) == verts(1)) verts(iv) = nf90_fill_int
567 call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_face_nodes, &
568 verts, start=(/1, n/), &
569 count=(/maxvert, 1/)), &
573 bnds = nf90_fill_double
575 if (verts(m) /= nf90_fill_int)
then
576 bnds(m) = vert_yt(verts(m))
579 call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_face_ybnds, &
580 bnds, start=(/1, n/), &
581 count=(/maxvert, 1/)), &
586 bnds = nf90_fill_double
588 if (verts(m) /= nf90_fill_int)
then
589 bnds(m) = vert_xt(verts(m))
592 call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_face_xbnds, &
593 bnds, start=(/1, n/), &
594 count=(/maxvert, 1/)), &
611 nc_tag, pkgname, gridmap_name, deflate, shuffle, &
612 chunk_face, iper, nc_fname)
614 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(in) :: p_mem
615 integer(I4B),
intent(in) :: ncid
618 type(
disvtype),
pointer,
intent(in) :: disv
620 character(len=*),
intent(in) :: mempath
621 character(len=*),
intent(in) :: nc_tag
622 character(len=*),
intent(in) :: pkgname
623 character(len=*),
intent(in) :: gridmap_name
624 integer(I4B),
intent(in) :: deflate
625 integer(I4B),
intent(in) :: shuffle
626 integer(I4B),
intent(in) :: chunk_face
627 integer(I4B),
intent(in) :: iper
628 character(len=*),
intent(in) :: nc_fname
629 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
630 integer(I4B),
dimension(:, :),
pointer,
contiguous :: int2d
631 integer(I4B) :: axis_sz, k
632 integer(I4B),
dimension(:),
allocatable :: var_id
633 character(len=LINELENGTH) :: longname, varname
635 if (idt%shape ==
'NCPL' .or. &
636 idt%shape ==
'NAUX NCPL')
then
641 longname =
export_longname(idt%longname, pkgname, idt%tagname, mempath, &
642 component_type=idt%component_type, &
643 subcomponent_type=idt%subcomponent_type)
646 axis_sz = dim_ids%nmesh_face
649 call nf_verify(nf90_redef(ncid), nc_fname)
650 call nf_verify(nf90_def_var(ncid, varname, nf90_int, &
651 (/axis_sz/), var_id(1)), &
655 call ncvar_chunk(ncid, var_id(1), chunk_face, nc_fname)
657 call ncvar_deflate(ncid, var_id(1), deflate, shuffle, nc_fname)
660 call nf_verify(nf90_put_att(ncid, var_id(1),
'_FillValue', &
661 (/nf90_fill_int/)), nc_fname)
662 call nf_verify(nf90_put_att(ncid, var_id(1),
'long_name', &
666 call ncvar_gridmap(ncid, var_id(1), gridmap_name, 0, nc_fname)
670 call nf_verify(nf90_enddef(ncid), nc_fname)
671 call nf_verify(nf90_put_var(ncid, var_id(1), p_mem), &
676 var_ids%export(1), p_mem, &
678 count=(/disv%ncpl, 1/)), nc_fname)
683 int2d(1:disv%ncpl, 1:disv%nlay) => p_mem(1:disv%nodesuser)
686 allocate (var_id(disv%nlay))
689 call nf_verify(nf90_redef(ncid), nc_fname)
695 component_type=idt%component_type, &
696 subcomponent_type=idt%subcomponent_type)
698 call nf_verify(nf90_def_var(ncid, varname, nf90_int, &
699 (/dim_ids%nmesh_face/), var_id(k)), &
703 call ncvar_chunk(ncid, var_id(k), chunk_face, nc_fname)
705 call ncvar_deflate(ncid, var_id(k), deflate, shuffle, nc_fname)
708 call nf_verify(nf90_put_att(ncid, var_id(k),
'_FillValue', &
709 (/nf90_fill_int/)), nc_fname)
710 call nf_verify(nf90_put_att(ncid, var_id(k),
'long_name', &
714 call ncvar_gridmap(ncid, var_id(k), gridmap_name, k, nc_fname)
719 call nf_verify(nf90_enddef(ncid), nc_fname)
721 call nf_verify(nf90_put_var(ncid, var_id(k), int2d(:, k)), nc_fname)
729 int1d(1:disv%ncpl) => int2d(:, k)
731 var_ids%export(k), int1d, &
733 count=(/disv%ncpl, 1/)), nc_fname)
742 nc_tag, pkgname, gridmap_name, deflate, shuffle, &
743 chunk_face, nc_fname)
744 integer(I4B),
dimension(:, :),
pointer,
contiguous,
intent(in) :: p_mem
745 integer(I4B),
intent(in) :: ncid
748 type(
disvtype),
pointer,
intent(in) :: disv
750 character(len=*),
intent(in) :: mempath
751 character(len=*),
intent(in) :: nc_tag
752 character(len=*),
intent(in) :: pkgname
753 character(len=*),
intent(in) :: gridmap_name
754 integer(I4B),
intent(in) :: deflate
755 integer(I4B),
intent(in) :: shuffle
756 integer(I4B),
intent(in) :: chunk_face
757 character(len=*),
intent(in) :: nc_fname
758 integer(I4B),
dimension(:),
allocatable :: var_id
759 character(len=LINELENGTH) :: longname, varname
762 allocate (var_id(disv%nlay))
765 call nf_verify(nf90_redef(ncid), nc_fname)
771 component_type=idt%component_type, &
772 subcomponent_type=idt%subcomponent_type)
774 call nf_verify(nf90_def_var(ncid, varname, nf90_int, &
775 (/dim_ids%nmesh_face/), var_id(k)), &
779 call ncvar_chunk(ncid, var_id(k), chunk_face, nc_fname)
781 call ncvar_deflate(ncid, var_id(k), deflate, shuffle, nc_fname)
784 call nf_verify(nf90_put_att(ncid, var_id(k),
'_FillValue', &
785 (/nf90_fill_int/)), nc_fname)
786 call nf_verify(nf90_put_att(ncid, var_id(k),
'long_name', &
790 call ncvar_gridmap(ncid, var_id(k), gridmap_name, k, nc_fname)
795 call nf_verify(nf90_enddef(ncid), nc_fname)
797 call nf_verify(nf90_put_var(ncid, var_id(k), p_mem(:, k)), nc_fname)
806 nc_tag, pkgname, gridmap_name, deflate, shuffle, &
807 chunk_face, iper, iaux, nc_fname)
809 real(DP),
dimension(:),
pointer,
contiguous,
intent(in) :: p_mem
810 integer(I4B),
intent(in) :: ncid
813 type(
disvtype),
pointer,
intent(in) :: disv
815 character(len=*),
intent(in) :: mempath
816 character(len=*),
intent(in) :: nc_tag
817 character(len=*),
intent(in) :: pkgname
818 character(len=*),
intent(in) :: gridmap_name
819 integer(I4B),
intent(in) :: deflate
820 integer(I4B),
intent(in) :: shuffle
821 integer(I4B),
intent(in) :: chunk_face
822 integer(I4B),
intent(in) :: iper
823 integer(I4B),
intent(in) :: iaux
824 character(len=*),
intent(in) :: nc_fname
825 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
826 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
827 integer(I4B) :: axis_sz, k
828 integer(I4B),
dimension(:),
allocatable :: var_id
829 character(len=LINELENGTH) :: longname, varname
831 if (idt%shape ==
'NCPL' .or. &
832 idt%shape ==
'NAUX NCPL')
then
839 mempath, iaux=iaux, &
840 component_type=idt%component_type, &
841 subcomponent_type=idt%subcomponent_type)
844 axis_sz = dim_ids%nmesh_face
847 call nf_verify(nf90_redef(ncid), nc_fname)
848 call nf_verify(nf90_def_var(ncid, varname, nf90_double, &
849 (/axis_sz/), var_id(1)), &
853 call ncvar_chunk(ncid, var_id(1), chunk_face, nc_fname)
855 call ncvar_deflate(ncid, var_id(1), deflate, shuffle, nc_fname)
858 call nf_verify(nf90_put_att(ncid, var_id(1),
'_FillValue', &
859 (/nf90_fill_double/)), nc_fname)
860 call nf_verify(nf90_put_att(ncid, var_id(1),
'long_name', &
864 call ncvar_gridmap(ncid, var_id(1), gridmap_name, 0, nc_fname)
865 call ncvar_mf6attr(ncid, var_id(1), 0, iaux, nc_tag, nc_fname)
868 call nf_verify(nf90_enddef(ncid), nc_fname)
869 call nf_verify(nf90_put_var(ncid, var_id(1), p_mem), &
874 var_ids%export(1), p_mem, &
876 count=(/disv%ncpl, 1/)), nc_fname)
881 dbl2d(1:disv%ncpl, 1:disv%nlay) => p_mem(1:disv%nodesuser)
884 allocate (var_id(disv%nlay))
887 call nf_verify(nf90_redef(ncid), nc_fname)
890 varname =
export_varname(pkgname, idt%tagname, mempath, layer=k, &
893 mempath, layer=k, iaux=iaux, &
894 component_type=idt%component_type, &
895 subcomponent_type=idt%subcomponent_type)
897 call nf_verify(nf90_def_var(ncid, varname, nf90_double, &
898 (/dim_ids%nmesh_face/), var_id(k)), &
902 call ncvar_chunk(ncid, var_id(k), chunk_face, nc_fname)
904 call ncvar_deflate(ncid, var_id(k), deflate, shuffle, nc_fname)
907 call nf_verify(nf90_put_att(ncid, var_id(k),
'_FillValue', &
908 (/nf90_fill_double/)), nc_fname)
909 call nf_verify(nf90_put_att(ncid, var_id(k),
'long_name', &
913 call ncvar_gridmap(ncid, var_id(k), gridmap_name, k, nc_fname)
914 call ncvar_mf6attr(ncid, var_id(k), k, iaux, nc_tag, nc_fname)
918 call nf_verify(nf90_enddef(ncid), nc_fname)
920 call nf_verify(nf90_put_var(ncid, var_id(k), dbl2d(:, k)), nc_fname)
928 dbl1d(1:disv%ncpl) => dbl2d(:, k)
930 var_ids%export(k), dbl1d, &
932 count=(/disv%ncpl, 1/)), nc_fname)
941 nc_tag, pkgname, gridmap_name, deflate, shuffle, &
942 chunk_face, nc_fname)
943 real(DP),
dimension(:, :),
pointer,
contiguous,
intent(in) :: p_mem
944 integer(I4B),
intent(in) :: ncid
947 type(
disvtype),
pointer,
intent(in) :: disv
949 character(len=*),
intent(in) :: mempath
950 character(len=*),
intent(in) :: nc_tag
951 character(len=*),
intent(in) :: pkgname
952 character(len=*),
intent(in) :: gridmap_name
953 integer(I4B),
intent(in) :: deflate
954 integer(I4B),
intent(in) :: shuffle
955 integer(I4B),
intent(in) :: chunk_face
956 character(len=*),
intent(in) :: nc_fname
957 integer(I4B),
dimension(:),
allocatable :: var_id
958 character(len=LINELENGTH) :: longname, varname
961 allocate (var_id(disv%nlay))
964 call nf_verify(nf90_redef(ncid), nc_fname)
970 component_type=idt%component_type, &
971 subcomponent_type=idt%subcomponent_type)
973 call nf_verify(nf90_def_var(ncid, varname, nf90_double, &
974 (/dim_ids%nmesh_face/), var_id(k)), &
978 call ncvar_chunk(ncid, var_id(k), chunk_face, nc_fname)
980 call ncvar_deflate(ncid, var_id(k), deflate, shuffle, nc_fname)
983 call nf_verify(nf90_put_att(ncid, var_id(k),
'_FillValue', &
984 (/nf90_fill_double/)), nc_fname)
985 call nf_verify(nf90_put_att(ncid, var_id(k),
'long_name', &
989 call ncvar_gridmap(ncid, var_id(k), gridmap_name, k, nc_fname)
994 call nf_verify(nf90_enddef(ncid), nc_fname)
996 call nf_verify(nf90_put_var(ncid, var_id(k), p_mem(:, k)), 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 dhalf
real constant 1/2
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, found)
Return parameter definition.
This module defines variable data types.
This module contains the MeshDisvModelModule.
subroutine add_mesh_data(this)
netcdf export add mesh information
subroutine nc_export_dbl1d(p_mem, ncid, dim_ids, var_ids, disv, idt, mempath, nc_tag, pkgname, gridmap_name, deflate, shuffle, chunk_face, iper, iaux, nc_fname)
netcdf export 1D double array
subroutine disv_export_init(this, modelname, modeltype, modelfname, nc_fname, disenum, nctype, iout)
netcdf export disv init
subroutine nc_export_int2d(p_mem, ncid, dim_ids, var_ids, disv, idt, mempath, nc_tag, pkgname, gridmap_name, deflate, shuffle, chunk_face, nc_fname)
netcdf export 2D integer array
subroutine package_step(this, export_pkg)
netcdf export package dynamic input
subroutine nc_export_dbl2d(p_mem, ncid, dim_ids, var_ids, disv, idt, mempath, nc_tag, pkgname, gridmap_name, deflate, shuffle, chunk_face, nc_fname)
netcdf export 2D double array
subroutine define_dim(this)
netcdf export define dimensions
subroutine df(this)
netcdf export define
subroutine nc_export_int1d(p_mem, ncid, dim_ids, var_ids, disv, idt, mempath, nc_tag, pkgname, gridmap_name, deflate, shuffle, chunk_face, iper, nc_fname)
netcdf export 1D integer array
subroutine step(this)
netcdf export step
subroutine disv_export_destroy(this)
netcdf export disv destroy
subroutine export_input_array(this, pkgtype, pkgname, mempath, idt)
netcdf export an input array
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, layer, nc_fname)
put variable gridmap attributes
subroutine, public ncvar_chunk(ncid, varid, chunk_face, nc_fname)
define variable chunking
subroutine, public ncvar_layer(ncid, varid, layer, nc_fname)
put the layer attribute (only when layer > 0)
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, component_type, subcomponent_type)
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 ...
Vertex grid discretization.
type for storing model export dimension ids
type for storing model export variable ids