54 character(len=*),
intent(in) :: modelname
55 character(len=*),
intent(in) :: modeltype
56 character(len=*),
intent(in) :: modelfname
57 integer(I4B),
intent(in) :: disenum
58 integer(I4B),
intent(in) :: nctype
59 integer(I4B),
intent(in) :: iout
62 this%nlay = this%disv%nlay
65 allocate (this%var_ids%dependent(this%nlay))
68 call this%mesh_init(modelname, modeltype, modelfname, disenum, nctype, iout)
76 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
139 allocate (dbl1d(
size(this%disv%nodereduced)))
145 do n = 1,
size(this%disv%nodereduced)
146 if (this%disv%nodereduced(n) > 0)
then
147 dbl1d(n) = this%x(this%disv%nodereduced(n))
151 dbl2d(1:dis_shape(1), 1:dis_shape(2)) => dbl1d(1:nvals)
154 dbl2d(1:dis_shape(1), 1:dis_shape(2)) => this%x(1:nvals)
158 do k = 1, this%disv%nlay
161 this%var_ids%dependent(k), dbl2d(:, k), &
162 start=(/1, this%stepcnt/), &
163 count=(/this%disv%ncpl, 1/)), &
168 call nf_verify(nf90_put_var(this%ncid, this%var_ids%time, &
169 totim, start=(/this%stepcnt/)), &
173 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
176 if (
associated(dbl1d))
deallocate (dbl1d)
190 character(len=*),
intent(in) :: ilayer_varname
191 integer(I4B),
intent(in) :: ilayer
194 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
195 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
196 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
197 integer(I4B),
dimension(:),
pointer,
contiguous :: ialayer
198 real(DP),
dimension(:),
contiguous,
pointer :: dbl1d_ptr
199 character(len=LINELENGTH) :: nc_varname, input_attr
200 integer(I4B) :: n, iparam, nvals
201 logical(LGP) :: ilayer_read
205 ilayer_read = .false.
208 call mem_setptr(ialayer, export_pkg%param_names(ilayer), &
209 export_pkg%mf6_input%mempath)
212 if (export_pkg%param_reads(ilayer)%invar == 1)
then
217 do iparam = 1, export_pkg%nparam
220 if (export_pkg%param_reads(iparam)%invar < 1) cycle
225 export_pkg%mf6_input%component_type, &
226 export_pkg%mf6_input%subcomponent_type, &
227 'PERIOD', export_pkg%param_names(iparam),
'')
230 nc_varname = trim(export_pkg%mf6_input%subcomponent_name)//
'_'// &
232 input_attr = this%input_attribute(export_pkg%mf6_input%subcomponent_name, &
236 select case (idt%datatype)
238 call mem_setptr(int1d, idt%mf6varname, export_pkg%mf6_input%mempath)
239 call nc_export_int1d(this%ncid, this%dim_ids, this%var_ids, this%disv, &
241 export_pkg%mf6_input%subcomponent_name, &
242 idt%tagname, this%gridmap_name, idt%shape, &
243 idt%longname, input_attr, this%deflate, &
244 this%shuffle, this%chunk_face,
kper, this%nc_fname)
246 call mem_setptr(dbl1d, idt%mf6varname, export_pkg%mf6_input%mempath)
247 call this%export_layer_2d(export_pkg, idt, ilayer_read, ialayer, &
248 dbl1d, nc_varname, input_attr)
250 call mem_setptr(dbl2d, idt%mf6varname, export_pkg%mf6_input%mempath)
251 nvals = this%disv%ncpl
253 do n = 1,
size(dbl2d, dim=1)
254 dbl1d_ptr(1:nvals) => dbl2d(n, :)
255 if (all(dbl1d_ptr ==
dzero))
then
257 call this%export_layer_2d(export_pkg, idt, ilayer_read, ialayer, &
258 dbl1d_ptr, nc_varname, input_attr, n)
263 errmsg =
'EXPORT ilayer unsupported datatype='//trim(idt%datatype)
269 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
281 errmsg =
'NetCDF period export not supported for model='// &
282 trim(this%modelname)//
', package='// &
283 trim(export_pkg%mf6_input%subcomponent_name)
287 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
293 dbl1d, nc_varname, input_attr, iaux)
299 logical(LGP),
intent(in) :: ilayer_read
300 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(in) :: ialayer
301 real(DP),
dimension(:),
pointer,
contiguous,
intent(in) :: dbl1d
302 character(len=*),
intent(in) :: nc_varname
303 character(len=*),
intent(in) :: input_attr
304 integer(I4B),
optional,
intent(in) :: iaux
306 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
307 integer(I4B) :: n, j, k, idxaux
311 if (
present(iaux))
then
315 allocate (dbl2d(export_pkg%mshape(2), export_pkg%mshape(1)))
317 if (ilayer_read)
then
318 do k = 1,
size(dbl2d, dim=2)
320 do j = 1,
size(dbl2d, dim=1)
322 if (ialayer(n) == k)
then
323 dbl2d(j, k) = dbl1d(n)
331 dbl2d(:, 1) = dbl1d(:)
334 call nc_export_dbl2d(this%ncid, this%dim_ids, this%var_ids, this%disv, &
336 export_pkg%mf6_input%subcomponent_name, idt%tagname, &
337 this%gridmap_name, idt%shape, idt%longname, input_attr, &
338 this%deflate, this%shuffle, this%chunk_face, &
339 export_pkg%iper, idxaux, this%nc_fname)
348 character(len=*),
intent(in) :: pkgtype
349 character(len=*),
intent(in) :: pkgname
350 character(len=*),
intent(in) :: mempath
352 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
353 integer(I4B),
dimension(:, :),
pointer,
contiguous :: int2d
354 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
355 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
356 character(len=LINELENGTH) :: nc_varname, input_attr
357 integer(I4B) :: iper, iaux
363 nc_varname = trim(pkgname)//
'_'//trim(idt%mf6varname)
365 input_attr = this%input_attribute(pkgname, idt)
367 select case (idt%datatype)
369 call mem_setptr(int1d, idt%mf6varname, mempath)
370 call nc_export_int1d(this%ncid, this%dim_ids, this%var_ids, this%disv, &
371 int1d, nc_varname, pkgname, idt%tagname, &
372 this%gridmap_name, idt%shape, idt%longname, &
373 input_attr, this%deflate, this%shuffle, &
374 this%chunk_face, iper, this%nc_fname)
376 call mem_setptr(int2d, idt%mf6varname, mempath)
377 call nc_export_int2d(this%ncid, this%dim_ids, this%var_ids, this%disv, &
378 int2d, nc_varname, pkgname, idt%tagname, &
379 this%gridmap_name, idt%shape, idt%longname, &
380 input_attr, this%deflate, this%shuffle, &
381 this%chunk_face, this%nc_fname)
383 call mem_setptr(dbl1d, idt%mf6varname, mempath)
384 call nc_export_dbl1d(this%ncid, this%dim_ids, this%var_ids, this%disv, &
385 dbl1d, nc_varname, pkgname, idt%tagname, &
386 this%gridmap_name, idt%shape, idt%longname, &
387 input_attr, this%deflate, this%shuffle, &
388 this%chunk_face, this%nc_fname)
390 call mem_setptr(dbl2d, idt%mf6varname, mempath)
391 call nc_export_dbl2d(this%ncid, this%dim_ids, this%var_ids, this%disv, &
392 dbl2d, nc_varname, pkgname, idt%tagname, &
393 this%gridmap_name, idt%shape, idt%longname, &
394 input_attr, this%deflate, this%shuffle, &
395 this%chunk_face, iper, iaux, this%nc_fname)
407 integer(I4B),
dimension(:),
contiguous,
pointer :: ncvert
410 call mem_setptr(ncvert,
'NCVERT', this%dis_mempath)
414 call nf_verify(nf90_def_dim(this%ncid,
'time', this%totnstp, &
415 this%dim_ids%time), this%nc_fname)
416 call nf_verify(nf90_def_var(this%ncid,
'time', nf90_double, &
417 this%dim_ids%time, this%var_ids%time), &
419 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'calendar', &
420 'standard'), this%nc_fname)
421 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'units', &
422 this%datetime), this%nc_fname)
423 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'axis',
'T'), &
425 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'standard_name', &
426 'time'), this%nc_fname)
427 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'long_name', &
428 'time'), this%nc_fname)
432 call nf_verify(nf90_def_dim(this%ncid,
'nmesh_node', this%disv%nvert, &
433 this%dim_ids%nmesh_node), this%nc_fname)
434 call nf_verify(nf90_def_dim(this%ncid,
'nmesh_face', this%disv%ncpl, &
435 this%dim_ids%nmesh_face), this%nc_fname)
436 call nf_verify(nf90_def_dim(this%ncid,
'max_nmesh_face_nodes', &
438 this%dim_ids%max_nmesh_face_nodes), &
442 call nf_verify(nf90_def_dim(this%ncid,
'nlay', this%disv%nlay, &
443 this%dim_ids%nlay), this%nc_fname)
450 integer(I4B),
dimension(:),
contiguous,
pointer :: icell2d => null()
451 integer(I4B),
dimension(:),
contiguous,
pointer :: ncvert => null()
452 integer(I4B),
dimension(:),
contiguous,
pointer :: icvert => null()
453 real(DP),
dimension(:),
contiguous,
pointer :: cell_x => null()
454 real(DP),
dimension(:),
contiguous,
pointer :: cell_y => null()
455 real(DP),
dimension(:),
contiguous,
pointer :: vert_x => null()
456 real(DP),
dimension(:),
contiguous,
pointer :: vert_y => null()
457 integer(I4B) :: n, m, idx, cnt, iv, maxvert
458 integer(I4B),
dimension(:),
allocatable :: verts
459 real(DP),
dimension(:),
allocatable :: bnds
460 integer(I4B) :: istop
463 call mem_setptr(icell2d,
'ICELL2D', this%dis_mempath)
464 call mem_setptr(ncvert,
'NCVERT', this%dis_mempath)
465 call mem_setptr(icvert,
'ICVERT', this%dis_mempath)
466 call mem_setptr(cell_x,
'XC', this%dis_mempath)
467 call mem_setptr(cell_y,
'YC', this%dis_mempath)
468 call mem_setptr(vert_x,
'XV', this%dis_mempath)
469 call mem_setptr(vert_y,
'YV', this%dis_mempath)
472 maxvert = maxval(ncvert)
475 call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh, 1), &
479 allocate (verts(maxvert))
480 allocate (bnds(maxvert))
483 call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_node_x, &
484 vert_x + this%disv%xorigin), this%nc_fname)
485 call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_node_y, &
486 vert_y + this%disv%yorigin), this%nc_fname)
489 call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_face_x, &
490 cell_x + this%disv%xorigin), this%nc_fname)
491 call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_face_y, &
492 cell_y + this%disv%yorigin), this%nc_fname)
496 do n = 1,
size(ncvert)
497 verts = nf90_fill_int
498 idx = cnt + ncvert(n)
501 do m = idx, istop, -1
504 verts(iv) = icvert(m)
508 call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_face_nodes, &
509 verts, start=(/1, n/), &
510 count=(/maxvert, 1/)), &
514 bnds = nf90_fill_double
516 if (verts(m) /= nf90_fill_int)
then
517 bnds(m) = vert_y(verts(m))
520 call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_face_ybnds, &
521 bnds, start=(/1, n/), &
522 count=(/maxvert, 1/)), &
527 bnds = nf90_fill_double
529 if (verts(m) /= nf90_fill_int)
then
530 bnds(m) = vert_x(verts(m))
533 call nf_verify(nf90_put_var(this%ncid, this%var_ids%mesh_face_xbnds, &
534 bnds, start=(/1, n/), &
535 count=(/maxvert, 1/)), &
548 pkgname, tagname, gridmap_name, shapestr, longname, &
549 nc_tag, deflate, shuffle, chunk_face, iper, nc_fname)
550 integer(I4B),
intent(in) :: ncid
553 type(
disvtype),
pointer,
intent(in) :: dis
554 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(in) :: p_mem
555 character(len=*),
intent(in) :: nc_varname
556 character(len=*),
intent(in) :: pkgname
557 character(len=*),
intent(in) :: tagname
558 character(len=*),
intent(in) :: gridmap_name
559 character(len=*),
intent(in) :: shapestr
560 character(len=*),
intent(in) :: longname
561 character(len=*),
intent(in) :: nc_tag
562 integer(I4B),
intent(in) :: deflate
563 integer(I4B),
intent(in) :: shuffle
564 integer(I4B),
intent(in) :: chunk_face
565 integer(I4B),
intent(in) :: iper
566 character(len=*),
intent(in) :: nc_fname
568 integer(I4B),
dimension(2) :: dis_shape
569 integer(I4B),
dimension(:, :),
pointer,
contiguous :: int2d
570 integer(I4B) :: axis_sz, nvals, k
571 integer(I4B),
dimension(:),
allocatable :: var_id
572 character(len=LINELENGTH) :: longname_l, varname_l
574 if (shapestr ==
'NCPL')
then
578 longname_l =
export_longname(longname, pkgname, tagname, layer=0, iper=iper)
581 axis_sz = dim_ids%nmesh_face
584 call nf_verify(nf90_redef(ncid), nc_fname)
585 call nf_verify(nf90_def_var(ncid, varname_l, nf90_int, &
586 (/axis_sz/), var_id(1)), &
590 call ncvar_chunk(ncid, var_id(1), chunk_face, nc_fname)
592 call ncvar_deflate(ncid, var_id(1), deflate, shuffle, nc_fname)
595 call nf_verify(nf90_put_att(ncid, var_id(1),
'_FillValue', &
596 (/nf90_fill_int/)), nc_fname)
597 call nf_verify(nf90_put_att(ncid, var_id(1),
'long_name', &
598 longname_l), nc_fname)
602 call ncvar_mf6attr(ncid, var_id(1), 0, iper, 0, nc_tag, nc_fname)
605 call nf_verify(nf90_enddef(ncid), nc_fname)
606 call nf_verify(nf90_put_var(ncid, var_id(1), p_mem), &
610 allocate (var_id(dis%nlay))
613 call nf_verify(nf90_redef(ncid), nc_fname)
621 call nf_verify(nf90_def_var(ncid, varname_l, nf90_int, &
622 (/dim_ids%nmesh_face/), var_id(k)), &
626 call ncvar_chunk(ncid, var_id(k), chunk_face, nc_fname)
628 call ncvar_deflate(ncid, var_id(k), deflate, shuffle, nc_fname)
631 call nf_verify(nf90_put_att(ncid, var_id(k),
'_FillValue', &
632 (/nf90_fill_int/)), nc_fname)
633 call nf_verify(nf90_put_att(ncid, var_id(k),
'long_name', &
634 longname_l), nc_fname)
638 call ncvar_mf6attr(ncid, var_id(k), k, iper, 0, nc_tag, nc_fname)
642 dis_shape(1) = dis%ncpl
643 dis_shape(2) = dis%nlay
644 nvals = product(dis_shape)
645 int2d(1:dis_shape(1), 1:dis_shape(2)) => p_mem(1:nvals)
648 call nf_verify(nf90_enddef(ncid), nc_fname)
650 call nf_verify(nf90_put_var(ncid, var_id(k), int2d(:, k)), nc_fname)
661 pkgname, tagname, gridmap_name, shapestr, longname, &
662 nc_tag, deflate, shuffle, chunk_face, nc_fname)
663 integer(I4B),
intent(in) :: ncid
666 type(
disvtype),
pointer,
intent(in) :: disv
667 integer(I4B),
dimension(:, :),
pointer,
contiguous,
intent(in) :: p_mem
668 character(len=*),
intent(in) :: nc_varname
669 character(len=*),
intent(in) :: pkgname
670 character(len=*),
intent(in) :: tagname
671 character(len=*),
intent(in) :: gridmap_name
672 character(len=*),
intent(in) :: shapestr
673 character(len=*),
intent(in) :: longname
674 character(len=*),
intent(in) :: nc_tag
675 integer(I4B),
intent(in) :: deflate
676 integer(I4B),
intent(in) :: shuffle
677 integer(I4B),
intent(in) :: chunk_face
678 character(len=*),
intent(in) :: nc_fname
680 integer(I4B),
dimension(:),
allocatable :: var_id
681 character(len=LINELENGTH) :: longname_l, varname_l
684 allocate (var_id(disv%nlay))
687 call nf_verify(nf90_redef(ncid), nc_fname)
694 call nf_verify(nf90_def_var(ncid, varname_l, nf90_int, &
695 (/dim_ids%nmesh_face/), var_id(k)), &
699 call ncvar_chunk(ncid, var_id(k), chunk_face, nc_fname)
701 call ncvar_deflate(ncid, var_id(k), deflate, shuffle, nc_fname)
704 call nf_verify(nf90_put_att(ncid, var_id(k),
'_FillValue', &
705 (/nf90_fill_int/)), nc_fname)
706 call nf_verify(nf90_put_att(ncid, var_id(k),
'long_name', &
707 longname_l), nc_fname)
711 call ncvar_mf6attr(ncid, var_id(k), k, 0, 0, nc_tag, nc_fname)
715 call nf_verify(nf90_enddef(ncid), nc_fname)
717 call nf_verify(nf90_put_var(ncid, var_id(k), p_mem(:, k)), nc_fname)
726 pkgname, tagname, gridmap_name, shapestr, longname, &
727 nc_tag, deflate, shuffle, chunk_face, nc_fname)
728 integer(I4B),
intent(in) :: ncid
731 type(
disvtype),
pointer,
intent(in) :: dis
732 real(DP),
dimension(:),
pointer,
contiguous,
intent(in) :: p_mem
733 character(len=*),
intent(in) :: nc_varname
734 character(len=*),
intent(in) :: pkgname
735 character(len=*),
intent(in) :: tagname
736 character(len=*),
intent(in) :: gridmap_name
737 character(len=*),
intent(in) :: shapestr
738 character(len=*),
intent(in) :: longname
739 character(len=*),
intent(in) :: nc_tag
740 integer(I4B),
intent(in) :: deflate
741 integer(I4B),
intent(in) :: shuffle
742 integer(I4B),
intent(in) :: chunk_face
743 character(len=*),
intent(in) :: nc_fname
745 integer(I4B),
dimension(2) :: dis_shape
746 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
747 integer(I4B) :: axis_sz, nvals, k
748 integer(I4B),
dimension(:),
allocatable :: var_id
749 character(len=LINELENGTH) :: longname_l, varname_l
751 if (shapestr ==
'NCPL')
then
758 axis_sz = dim_ids%nmesh_face
761 call nf_verify(nf90_redef(ncid), nc_fname)
762 call nf_verify(nf90_def_var(ncid, varname_l, nf90_double, &
763 (/axis_sz/), var_id(1)), &
767 call ncvar_chunk(ncid, var_id(1), chunk_face, nc_fname)
769 call ncvar_deflate(ncid, var_id(1), deflate, shuffle, nc_fname)
772 call nf_verify(nf90_put_att(ncid, var_id(1),
'_FillValue', &
773 (/nf90_fill_double/)), nc_fname)
774 call nf_verify(nf90_put_att(ncid, var_id(1),
'long_name', &
775 longname_l), nc_fname)
779 call ncvar_mf6attr(ncid, var_id(1), 0, 0, 0, nc_tag, nc_fname)
782 call nf_verify(nf90_enddef(ncid), nc_fname)
783 call nf_verify(nf90_put_var(ncid, var_id(1), p_mem), &
787 allocate (var_id(dis%nlay))
790 call nf_verify(nf90_redef(ncid), nc_fname)
797 call nf_verify(nf90_def_var(ncid, varname_l, nf90_double, &
798 (/dim_ids%nmesh_face/), var_id(k)), &
802 call ncvar_chunk(ncid, var_id(k), chunk_face, nc_fname)
804 call ncvar_deflate(ncid, var_id(k), deflate, shuffle, nc_fname)
807 call nf_verify(nf90_put_att(ncid, var_id(k),
'_FillValue', &
808 (/nf90_fill_double/)), nc_fname)
809 call nf_verify(nf90_put_att(ncid, var_id(k),
'long_name', &
810 longname_l), nc_fname)
814 call ncvar_mf6attr(ncid, var_id(k), k, 0, 0, nc_tag, nc_fname)
818 dis_shape(1) = dis%ncpl
819 dis_shape(2) = dis%nlay
820 nvals = product(dis_shape)
821 dbl2d(1:dis_shape(1), 1:dis_shape(2)) => p_mem(1:nvals)
824 call nf_verify(nf90_enddef(ncid), nc_fname)
826 call nf_verify(nf90_put_var(ncid, var_id(k), dbl2d(:, k)), nc_fname)
837 pkgname, tagname, gridmap_name, shapestr, longname, &
838 nc_tag, deflate, shuffle, chunk_face, iper, iaux, &
841 integer(I4B),
intent(in) :: ncid
844 type(
disvtype),
pointer,
intent(in) :: disv
845 real(DP),
dimension(:, :),
pointer,
contiguous,
intent(in) :: p_mem
846 character(len=*),
intent(in) :: nc_varname
847 character(len=*),
intent(in) :: pkgname
848 character(len=*),
intent(in) :: tagname
849 character(len=*),
intent(in) :: gridmap_name
850 character(len=*),
intent(in) :: shapestr
851 character(len=*),
intent(in) :: longname
852 character(len=*),
intent(in) :: nc_tag
853 integer(I4B),
intent(in) :: deflate
854 integer(I4B),
intent(in) :: shuffle
855 integer(I4B),
intent(in) :: chunk_face
856 integer(I4B),
intent(in) :: iper
857 integer(I4B),
intent(in) :: iaux
858 character(len=*),
intent(in) :: nc_fname
860 integer(I4B),
dimension(:),
allocatable :: var_id
861 character(len=LINELENGTH) :: longname_l, varname_l
863 real(DP) :: fill_value
868 fill_value = nf90_fill_double
871 allocate (var_id(disv%nlay))
874 call nf_verify(nf90_redef(ncid), nc_fname)
878 varname_l =
export_varname(nc_varname, layer=k, iper=iper, iaux=iaux)
879 longname_l =
export_longname(longname, pkgname, tagname, layer=k, iper=iper)
881 call nf_verify(nf90_def_var(ncid, varname_l, nf90_double, &
882 (/dim_ids%nmesh_face/), var_id(k)), &
886 call ncvar_chunk(ncid, var_id(k), chunk_face, nc_fname)
888 call ncvar_deflate(ncid, var_id(k), deflate, shuffle, nc_fname)
891 call nf_verify(nf90_put_att(ncid, var_id(k),
'_FillValue', &
892 (/fill_value/)), nc_fname)
893 call nf_verify(nf90_put_att(ncid, var_id(k),
'long_name', &
894 longname_l), nc_fname)
898 call ncvar_mf6attr(ncid, var_id(k), k, iper, iaux, nc_tag, nc_fname)
902 call nf_verify(nf90_enddef(ncid), nc_fname)
904 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 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 disv_export_init(this, modelname, modeltype, modelfname, disenum, nctype, iout)
netcdf export disv init
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