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%disv%nlay
66 allocate (this%var_ids%dependent(this%nlay))
69 call this%mesh_init(modelname, modeltype, modelfname, nc_fname, disenum, &
77 deallocate (this%var_ids%dependent)
79 call this%mesh_destroy()
80 call this%NCModelExportType%destroy()
90 call this%add_global_att()
92 call this%define_dim()
94 call this%create_mesh()
97 call this%define_dependent()
100 call nf_verify(nf90_enddef(this%ncid), this%nc_fname)
102 call this%add_mesh_data()
104 call this%add_pkg_data()
106 call this%define_gridmap()
108 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
117 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
118 integer(I4B) :: n, k, nvals
119 integer(I4B),
dimension(2) :: dis_shape
120 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
127 this%stepcnt = this%stepcnt + 1
129 dis_shape(1) = this%disv%ncpl
130 dis_shape(2) = this%disv%nlay
132 nvals = product(dis_shape)
135 if (
size(this%disv%nodeuser) < &
136 size(this%disv%nodereduced))
then
138 allocate (dbl1d(
size(this%disv%nodereduced)))
144 do n = 1,
size(this%disv%nodereduced)
145 if (this%disv%nodereduced(n) > 0)
then
146 dbl1d(n) = this%x(this%disv%nodereduced(n))
150 dbl2d(1:dis_shape(1), 1:dis_shape(2)) => dbl1d(1:nvals)
152 dbl2d(1:dis_shape(1), 1:dis_shape(2)) => this%x(1:nvals)
155 do k = 1, this%disv%nlay
158 this%var_ids%dependent(k), dbl2d(:, k), &
159 start=(/1, this%stepcnt/), &
160 count=(/this%disv%ncpl, 1/)), &
165 call nf_verify(nf90_put_var(this%ncid, this%var_ids%time, &
166 totim, start=(/this%stepcnt/)), &
170 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
173 if (
associated(dbl1d))
deallocate (dbl1d)
187 character(len=*),
intent(in) :: ilayer_varname
188 integer(I4B),
intent(in) :: ilayer
190 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
191 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
192 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
193 integer(I4B),
dimension(:),
pointer,
contiguous :: ialayer
194 real(DP),
dimension(:),
contiguous,
pointer :: dbl1d_ptr
195 character(len=LINELENGTH) :: nc_varname, input_attr
196 integer(I4B) :: n, iparam, nvals
197 logical(LGP) :: ilayer_read
201 ilayer_read = .false.
204 call mem_setptr(ialayer, export_pkg%param_names(ilayer), &
205 export_pkg%mf6_input%mempath)
208 if (export_pkg%param_reads(ilayer)%invar == 1)
then
213 do iparam = 1, export_pkg%nparam
215 if (export_pkg%param_reads(iparam)%invar < 1) cycle
220 export_pkg%mf6_input%component_type, &
221 export_pkg%mf6_input%subcomponent_type, &
222 'PERIOD', export_pkg%param_names(iparam),
'')
225 nc_varname = trim(export_pkg%mf6_input%subcomponent_name)//
'_'// &
227 input_attr = this%input_attribute(export_pkg%mf6_input%subcomponent_name, &
231 select case (idt%datatype)
233 call mem_setptr(int1d, idt%mf6varname, export_pkg%mf6_input%mempath)
234 call nc_export_int1d(this%ncid, this%dim_ids, this%var_ids, this%disv, &
236 export_pkg%mf6_input%subcomponent_name, &
237 idt%tagname, this%gridmap_name, idt%shape, &
238 idt%longname, input_attr, this%deflate, &
239 this%shuffle, this%chunk_face,
kper, this%nc_fname)
241 call mem_setptr(dbl1d, idt%mf6varname, export_pkg%mf6_input%mempath)
242 call this%export_layer_2d(export_pkg, idt, ilayer_read, ialayer, &
243 dbl1d, nc_varname, input_attr)
245 call mem_setptr(dbl2d, idt%mf6varname, export_pkg%mf6_input%mempath)
246 nvals = this%disv%ncpl
247 do n = 1,
size(dbl2d, dim=1)
248 dbl1d_ptr(1:nvals) => dbl2d(n, :)
249 if (all(dbl1d_ptr ==
dzero))
then
251 call this%export_layer_2d(export_pkg, idt, ilayer_read, ialayer, &
252 dbl1d_ptr, nc_varname, input_attr, n)
256 errmsg =
'EXPORT ilayer unsupported datatype='//trim(idt%datatype)
262 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
271 errmsg =
'NetCDF period export not supported for model='// &
272 trim(this%modelname)//
', package='// &
273 trim(export_pkg%mf6_input%subcomponent_name)
276 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
282 dbl1d, nc_varname, input_attr, iaux)
288 logical(LGP),
intent(in) :: ilayer_read
289 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(in) :: ialayer
290 real(DP),
dimension(:),
pointer,
contiguous,
intent(in) :: dbl1d
291 character(len=*),
intent(in) :: nc_varname
292 character(len=*),
intent(in) :: input_attr
293 integer(I4B),
optional,
intent(in) :: iaux
294 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
295 integer(I4B) :: n, j, k, idxaux
299 if (
present(iaux))
then
303 allocate (dbl2d(export_pkg%mshape(2), export_pkg%mshape(1)))
305 if (ilayer_read)
then
306 do k = 1,
size(dbl2d, dim=2)
308 do j = 1,
size(dbl2d, dim=1)
310 if (ialayer(n) == k)
then
311 dbl2d(j, k) = dbl1d(n)
319 dbl2d(:, 1) = dbl1d(:)
322 call nc_export_dbl2d(this%ncid, this%dim_ids, this%var_ids, this%disv, &
324 export_pkg%mf6_input%subcomponent_name, idt%tagname, &
325 this%gridmap_name, idt%shape, idt%longname, input_attr, &
326 this%deflate, this%shuffle, this%chunk_face, &
327 export_pkg%iper, idxaux, this%nc_fname)
336 character(len=*),
intent(in) :: pkgtype
337 character(len=*),
intent(in) :: pkgname
338 character(len=*),
intent(in) :: mempath
340 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
341 integer(I4B),
dimension(:, :),
pointer,
contiguous :: int2d
342 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
343 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
344 character(len=LINELENGTH) :: nc_varname, input_attr
345 integer(I4B) :: iper, iaux
351 nc_varname = trim(pkgname)//
'_'//trim(idt%mf6varname)
353 input_attr = this%input_attribute(pkgname, idt)
355 select case (idt%datatype)
357 call mem_setptr(int1d, idt%mf6varname, mempath)
358 call nc_export_int1d(this%ncid, this%dim_ids, this%var_ids, this%disv, &
359 int1d, nc_varname, pkgname, idt%tagname, &
360 this%gridmap_name, idt%shape, idt%longname, &
361 input_attr, this%deflate, this%shuffle, &
362 this%chunk_face, iper, this%nc_fname)
364 call mem_setptr(int2d, idt%mf6varname, mempath)
365 call nc_export_int2d(this%ncid, this%dim_ids, this%var_ids, this%disv, &
366 int2d, nc_varname, pkgname, idt%tagname, &
367 this%gridmap_name, idt%shape, idt%longname, &
368 input_attr, this%deflate, this%shuffle, &
369 this%chunk_face, this%nc_fname)
371 call mem_setptr(dbl1d, idt%mf6varname, mempath)
372 call nc_export_dbl1d(this%ncid, this%dim_ids, this%var_ids, this%disv, &
373 dbl1d, nc_varname, pkgname, idt%tagname, &
374 this%gridmap_name, idt%shape, idt%longname, &
375 input_attr, this%deflate, this%shuffle, &
376 this%chunk_face, this%nc_fname)
378 call mem_setptr(dbl2d, idt%mf6varname, mempath)
379 call nc_export_dbl2d(this%ncid, this%dim_ids, this%var_ids, this%disv, &
380 dbl2d, nc_varname, pkgname, idt%tagname, &
381 this%gridmap_name, idt%shape, idt%longname, &
382 input_attr, this%deflate, this%shuffle, &
383 this%chunk_face, iper, iaux, this%nc_fname)
395 integer(I4B),
dimension(:),
contiguous,
pointer :: ncvert
398 call mem_setptr(ncvert,
'NCVERT', this%dis_mempath)
402 call nf_verify(nf90_def_dim(this%ncid,
'time', this%totnstp, &
403 this%dim_ids%time), this%nc_fname)
404 call nf_verify(nf90_def_var(this%ncid,
'time', nf90_double, &
405 this%dim_ids%time, this%var_ids%time), &
407 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'calendar', &
408 'standard'), this%nc_fname)
409 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'units', &
410 this%datetime), this%nc_fname)
411 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'axis',
'T'), &
413 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'standard_name', &
414 'time'), this%nc_fname)
415 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'long_name', &
416 'time'), this%nc_fname)
420 call nf_verify(nf90_def_dim(this%ncid,
'nmesh_node', this%disv%nvert, &
421 this%dim_ids%nmesh_node), this%nc_fname)
422 call nf_verify(nf90_def_dim(this%ncid,
'nmesh_face', this%disv%ncpl, &
423 this%dim_ids%nmesh_face), this%nc_fname)
424 call nf_verify(nf90_def_dim(this%ncid,
'max_nmesh_face_nodes', &
426 this%dim_ids%max_nmesh_face_nodes), &
430 call nf_verify(nf90_def_dim(this%ncid,
'nlay', this%disv%nlay, &
431 this%dim_ids%nlay), this%nc_fname)
438 integer(I4B),
dimension(:),
contiguous,
pointer :: icell2d => null()
439 integer(I4B),
dimension(:),
contiguous,
pointer :: ncvert => null()
440 integer(I4B),
dimension(:),
contiguous,
pointer :: icvert => null()
441 real(DP),
dimension(:),
contiguous,
pointer :: cell_x => null()
442 real(DP),
dimension(:),
contiguous,
pointer :: cell_y => null()
443 real(DP),
dimension(:),
contiguous,
pointer :: vert_x => null()
444 real(DP),
dimension(:),
contiguous,
pointer :: vert_y => null()
445 integer(I4B) :: n, m, idx, cnt, iv, maxvert
446 integer(I4B),
dimension(:),
allocatable :: verts
447 real(DP),
dimension(:),
allocatable :: bnds
448 integer(I4B) :: istop
451 call mem_setptr(icell2d,
'ICELL2D', this%dis_mempath)
452 call mem_setptr(ncvert,
'NCVERT', this%dis_mempath)
453 call mem_setptr(icvert,
'ICVERT', this%dis_mempath)
454 call mem_setptr(cell_x,
'XC', this%dis_mempath)
455 call mem_setptr(cell_y,
'YC', this%dis_mempath)
456 call mem_setptr(vert_x,
'XV', this%dis_mempath)
457 call mem_setptr(vert_y,
'YV', this%dis_mempath)
460 maxvert = maxval(ncvert)
463 call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh, 1), &
467 allocate (verts(maxvert))
468 allocate (bnds(maxvert))
471 call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_node_x, &
472 vert_x + this%disv%xorigin), this%nc_fname)
473 call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_node_y, &
474 vert_y + this%disv%yorigin), this%nc_fname)
477 call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_face_x, &
478 cell_x + this%disv%xorigin), this%nc_fname)
479 call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_face_y, &
480 cell_y + this%disv%yorigin), this%nc_fname)
484 do n = 1,
size(ncvert)
485 verts = nf90_fill_int
486 idx = cnt + ncvert(n)
489 do m = idx, istop, -1
492 verts(iv) = icvert(m)
496 call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_face_nodes, &
497 verts, start=(/1, n/), &
498 count=(/maxvert, 1/)), &
502 bnds = nf90_fill_double
504 if (verts(m) /= nf90_fill_int)
then
505 bnds(m) = vert_y(verts(m))
508 call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_face_ybnds, &
509 bnds, start=(/1, n/), &
510 count=(/maxvert, 1/)), &
515 bnds = nf90_fill_double
517 if (verts(m) /= nf90_fill_int)
then
518 bnds(m) = vert_x(verts(m))
521 call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_face_xbnds, &
522 bnds, start=(/1, n/), &
523 count=(/maxvert, 1/)), &
536 pkgname, tagname, gridmap_name, shapestr, longname, &
537 nc_tag, deflate, shuffle, chunk_face, iper, nc_fname)
538 integer(I4B),
intent(in) :: ncid
541 type(
disvtype),
pointer,
intent(in) :: dis
542 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(in) :: p_mem
543 character(len=*),
intent(in) :: nc_varname
544 character(len=*),
intent(in) :: pkgname
545 character(len=*),
intent(in) :: tagname
546 character(len=*),
intent(in) :: gridmap_name
547 character(len=*),
intent(in) :: shapestr
548 character(len=*),
intent(in) :: longname
549 character(len=*),
intent(in) :: nc_tag
550 integer(I4B),
intent(in) :: deflate
551 integer(I4B),
intent(in) :: shuffle
552 integer(I4B),
intent(in) :: chunk_face
553 integer(I4B),
intent(in) :: iper
554 character(len=*),
intent(in) :: nc_fname
555 integer(I4B),
dimension(2) :: dis_shape
556 integer(I4B),
dimension(:, :),
pointer,
contiguous :: int2d
557 integer(I4B) :: axis_sz, nvals, k
558 integer(I4B),
dimension(:),
allocatable :: var_id
559 character(len=LINELENGTH) :: longname_l, varname_l
561 if (shapestr ==
'NCPL')
then
564 longname_l =
export_longname(longname, pkgname, tagname, layer=0, iper=iper)
567 axis_sz = dim_ids%nmesh_face
570 call nf_verify(nf90_redef(ncid), nc_fname)
571 call nf_verify(nf90_def_var(ncid, varname_l, nf90_int, &
572 (/axis_sz/), var_id(1)), &
576 call ncvar_chunk(ncid, var_id(1), chunk_face, nc_fname)
578 call ncvar_deflate(ncid, var_id(1), deflate, shuffle, nc_fname)
581 call nf_verify(nf90_put_att(ncid, var_id(1),
'_FillValue', &
582 (/nf90_fill_int/)), nc_fname)
583 call nf_verify(nf90_put_att(ncid, var_id(1),
'long_name', &
584 longname_l), nc_fname)
588 call ncvar_mf6attr(ncid, var_id(1), 0, iper, 0, nc_tag, nc_fname)
591 call nf_verify(nf90_enddef(ncid), nc_fname)
592 call nf_verify(nf90_put_var(ncid, var_id(1), p_mem), &
596 allocate (var_id(dis%nlay))
599 call nf_verify(nf90_redef(ncid), nc_fname)
606 call nf_verify(nf90_def_var(ncid, varname_l, nf90_int, &
607 (/dim_ids%nmesh_face/), var_id(k)), &
611 call ncvar_chunk(ncid, var_id(k), chunk_face, nc_fname)
613 call ncvar_deflate(ncid, var_id(k), deflate, shuffle, nc_fname)
616 call nf_verify(nf90_put_att(ncid, var_id(k),
'_FillValue', &
617 (/nf90_fill_int/)), nc_fname)
618 call nf_verify(nf90_put_att(ncid, var_id(k),
'long_name', &
619 longname_l), nc_fname)
623 call ncvar_mf6attr(ncid, var_id(k), k, iper, 0, nc_tag, nc_fname)
627 dis_shape(1) = dis%ncpl
628 dis_shape(2) = dis%nlay
629 nvals = product(dis_shape)
630 int2d(1:dis_shape(1), 1:dis_shape(2)) => p_mem(1:nvals)
633 call nf_verify(nf90_enddef(ncid), nc_fname)
635 call nf_verify(nf90_put_var(ncid, var_id(k), int2d(:, k)), nc_fname)
646 pkgname, tagname, gridmap_name, shapestr, longname, &
647 nc_tag, deflate, shuffle, chunk_face, nc_fname)
648 integer(I4B),
intent(in) :: ncid
651 type(
disvtype),
pointer,
intent(in) :: disv
652 integer(I4B),
dimension(:, :),
pointer,
contiguous,
intent(in) :: p_mem
653 character(len=*),
intent(in) :: nc_varname
654 character(len=*),
intent(in) :: pkgname
655 character(len=*),
intent(in) :: tagname
656 character(len=*),
intent(in) :: gridmap_name
657 character(len=*),
intent(in) :: shapestr
658 character(len=*),
intent(in) :: longname
659 character(len=*),
intent(in) :: nc_tag
660 integer(I4B),
intent(in) :: deflate
661 integer(I4B),
intent(in) :: shuffle
662 integer(I4B),
intent(in) :: chunk_face
663 character(len=*),
intent(in) :: nc_fname
664 integer(I4B),
dimension(:),
allocatable :: var_id
665 character(len=LINELENGTH) :: longname_l, varname_l
668 allocate (var_id(disv%nlay))
671 call nf_verify(nf90_redef(ncid), nc_fname)
677 call nf_verify(nf90_def_var(ncid, varname_l, nf90_int, &
678 (/dim_ids%nmesh_face/), var_id(k)), &
682 call ncvar_chunk(ncid, var_id(k), chunk_face, nc_fname)
684 call ncvar_deflate(ncid, var_id(k), deflate, shuffle, nc_fname)
687 call nf_verify(nf90_put_att(ncid, var_id(k),
'_FillValue', &
688 (/nf90_fill_int/)), nc_fname)
689 call nf_verify(nf90_put_att(ncid, var_id(k),
'long_name', &
690 longname_l), nc_fname)
694 call ncvar_mf6attr(ncid, var_id(k), k, 0, 0, nc_tag, nc_fname)
698 call nf_verify(nf90_enddef(ncid), nc_fname)
700 call nf_verify(nf90_put_var(ncid, var_id(k), p_mem(:, k)), nc_fname)
709 pkgname, tagname, gridmap_name, shapestr, longname, &
710 nc_tag, deflate, shuffle, chunk_face, nc_fname)
711 integer(I4B),
intent(in) :: ncid
714 type(
disvtype),
pointer,
intent(in) :: dis
715 real(DP),
dimension(:),
pointer,
contiguous,
intent(in) :: p_mem
716 character(len=*),
intent(in) :: nc_varname
717 character(len=*),
intent(in) :: pkgname
718 character(len=*),
intent(in) :: tagname
719 character(len=*),
intent(in) :: gridmap_name
720 character(len=*),
intent(in) :: shapestr
721 character(len=*),
intent(in) :: longname
722 character(len=*),
intent(in) :: nc_tag
723 integer(I4B),
intent(in) :: deflate
724 integer(I4B),
intent(in) :: shuffle
725 integer(I4B),
intent(in) :: chunk_face
726 character(len=*),
intent(in) :: nc_fname
727 integer(I4B),
dimension(2) :: dis_shape
728 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
729 integer(I4B) :: axis_sz, nvals, k
730 integer(I4B),
dimension(:),
allocatable :: var_id
731 character(len=LINELENGTH) :: longname_l, varname_l
733 if (shapestr ==
'NCPL')
then
739 axis_sz = dim_ids%nmesh_face
742 call nf_verify(nf90_redef(ncid), nc_fname)
743 call nf_verify(nf90_def_var(ncid, varname_l, nf90_double, &
744 (/axis_sz/), var_id(1)), &
748 call ncvar_chunk(ncid, var_id(1), chunk_face, nc_fname)
750 call ncvar_deflate(ncid, var_id(1), deflate, shuffle, nc_fname)
753 call nf_verify(nf90_put_att(ncid, var_id(1),
'_FillValue', &
754 (/nf90_fill_double/)), nc_fname)
755 call nf_verify(nf90_put_att(ncid, var_id(1),
'long_name', &
756 longname_l), nc_fname)
760 call ncvar_mf6attr(ncid, var_id(1), 0, 0, 0, nc_tag, nc_fname)
763 call nf_verify(nf90_enddef(ncid), nc_fname)
764 call nf_verify(nf90_put_var(ncid, var_id(1), p_mem), &
768 allocate (var_id(dis%nlay))
771 call nf_verify(nf90_redef(ncid), nc_fname)
777 call nf_verify(nf90_def_var(ncid, varname_l, nf90_double, &
778 (/dim_ids%nmesh_face/), var_id(k)), &
782 call ncvar_chunk(ncid, var_id(k), chunk_face, nc_fname)
784 call ncvar_deflate(ncid, var_id(k), deflate, shuffle, nc_fname)
787 call nf_verify(nf90_put_att(ncid, var_id(k),
'_FillValue', &
788 (/nf90_fill_double/)), nc_fname)
789 call nf_verify(nf90_put_att(ncid, var_id(k),
'long_name', &
790 longname_l), nc_fname)
794 call ncvar_mf6attr(ncid, var_id(k), k, 0, 0, nc_tag, nc_fname)
798 dis_shape(1) = dis%ncpl
799 dis_shape(2) = dis%nlay
800 nvals = product(dis_shape)
801 dbl2d(1:dis_shape(1), 1:dis_shape(2)) => p_mem(1:nvals)
804 call nf_verify(nf90_enddef(ncid), nc_fname)
806 call nf_verify(nf90_put_var(ncid, var_id(k), dbl2d(:, k)), nc_fname)
817 pkgname, tagname, gridmap_name, shapestr, longname, &
818 nc_tag, deflate, shuffle, chunk_face, iper, iaux, &
821 integer(I4B),
intent(in) :: ncid
824 type(
disvtype),
pointer,
intent(in) :: disv
825 real(DP),
dimension(:, :),
pointer,
contiguous,
intent(in) :: p_mem
826 character(len=*),
intent(in) :: nc_varname
827 character(len=*),
intent(in) :: pkgname
828 character(len=*),
intent(in) :: tagname
829 character(len=*),
intent(in) :: gridmap_name
830 character(len=*),
intent(in) :: shapestr
831 character(len=*),
intent(in) :: longname
832 character(len=*),
intent(in) :: nc_tag
833 integer(I4B),
intent(in) :: deflate
834 integer(I4B),
intent(in) :: shuffle
835 integer(I4B),
intent(in) :: chunk_face
836 integer(I4B),
intent(in) :: iper
837 integer(I4B),
intent(in) :: iaux
838 character(len=*),
intent(in) :: nc_fname
839 integer(I4B),
dimension(:),
allocatable :: var_id
840 character(len=LINELENGTH) :: longname_l, varname_l
842 real(DP) :: fill_value
847 fill_value = nf90_fill_double
850 allocate (var_id(disv%nlay))
853 call nf_verify(nf90_redef(ncid), nc_fname)
856 varname_l =
export_varname(nc_varname, layer=k, iper=iper, iaux=iaux)
857 longname_l =
export_longname(longname, pkgname, tagname, layer=k, iper=iper)
859 call nf_verify(nf90_def_var(ncid, varname_l, nf90_double, &
860 (/dim_ids%nmesh_face/), var_id(k)), &
864 call ncvar_chunk(ncid, var_id(k), chunk_face, nc_fname)
866 call ncvar_deflate(ncid, var_id(k), deflate, shuffle, nc_fname)
869 call nf_verify(nf90_put_att(ncid, var_id(k),
'_FillValue', &
870 (/fill_value/)), nc_fname)
871 call nf_verify(nf90_put_att(ncid, var_id(k),
'long_name', &
872 longname_l), nc_fname)
876 call ncvar_mf6attr(ncid, var_id(k), k, iper, iaux, nc_tag, nc_fname)
880 call nf_verify(nf90_enddef(ncid), nc_fname)
882 call nf_verify(nf90_put_var(ncid, var_id(k), p_mem(:, k)), nc_fname)
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 MeshDisvModelModule.
subroutine package_step_ilayer(this, export_pkg, ilayer_varname, ilayer)
netcdf export package dynamic input with ilayer index variable
subroutine export_layer_2d(this, export_pkg, idt, ilayer_read, ialayer, dbl1d, nc_varname, input_attr, iaux)
export layer variable as full grid
subroutine add_mesh_data(this)
netcdf export add mesh information
subroutine disv_export_init(this, modelname, modeltype, modelfname, nc_fname, disenum, nctype, iout)
netcdf export disv init
subroutine nc_export_dbl1d(ncid, dim_ids, var_ids, dis, p_mem, nc_varname, pkgname, tagname, gridmap_name, shapestr, longname, nc_tag, deflate, shuffle, chunk_face, nc_fname)
netcdf export 1D double array
subroutine nc_export_dbl2d(ncid, dim_ids, var_ids, disv, p_mem, nc_varname, pkgname, tagname, gridmap_name, shapestr, longname, nc_tag, deflate, shuffle, chunk_face, iper, iaux, nc_fname)
netcdf export 2D double array
subroutine nc_export_int2d(ncid, dim_ids, var_ids, disv, p_mem, nc_varname, pkgname, tagname, gridmap_name, shapestr, longname, nc_tag, deflate, shuffle, chunk_face, nc_fname)
netcdf export 2D integer array
subroutine package_step(this, export_pkg)
netcdf export package dynamic input
subroutine define_dim(this)
netcdf export define dimensions
subroutine nc_export_int1d(ncid, dim_ids, var_ids, dis, p_mem, nc_varname, pkgname, tagname, gridmap_name, shapestr, longname, nc_tag, deflate, shuffle, chunk_face, iper, nc_fname)
netcdf export 1D integer array
subroutine df(this)
netcdf export define
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.
character(len=linelength) function, public export_varname(varname, layer, iper, iaux)
build netcdf variable name
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
subroutine, public ncvar_mf6attr(ncid, varid, layer, iper, iaux, nc_tag, nc_fname)
put variable internal attributes
This module contains the NCModelExportModule.
character(len=linelength) function, public export_longname(longname, pkgname, tagname, layer, iper)
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