42 integer(I4B) :: dependent
43 integer(I4B) :: x_bnds
44 integer(I4B) :: y_bnds
45 integer(I4B) :: z_bnds
56 real(dp),
dimension(:),
pointer,
contiguous :: lat => null()
57 real(dp),
dimension(:),
pointer,
contiguous :: lon => null()
58 integer(I4B),
pointer :: chunk_z
59 integer(I4B),
pointer :: chunk_y
60 integer(I4B),
pointer :: chunk_x
61 integer(I4B),
dimension(:),
allocatable :: layers
62 logical(LGP) :: latlon
94 disenum, nctype, iout)
98 character(len=*),
intent(in) :: modelname
99 character(len=*),
intent(in) :: modeltype
100 character(len=*),
intent(in) :: modelfname
101 character(len=*),
intent(in) :: nc_fname
102 integer(I4B),
intent(in) :: disenum
103 integer(I4B),
intent(in) :: nctype
104 integer(I4B),
intent(in) :: iout
105 integer(I4B) :: k, latsz, lonsz
106 logical(LGP) :: found
109 this%nlay = this%dis%nlay
112 allocate (this%chunk_z)
113 allocate (this%chunk_y)
114 allocate (this%chunk_x)
115 allocate (this%layers(this%nlay))
125 this%latlon = .false.
128 call this%NCModelExportType%init(modelname, modeltype, modelfname, nc_fname, &
129 disenum, nctype, iout)
131 if (this%ncf_mempath /=
'')
then
132 call mem_set_value(this%chunk_z,
'CHUNK_Z', this%ncf_mempath, found)
133 call mem_set_value(this%chunk_y,
'CHUNK_Y', this%ncf_mempath, found)
134 call mem_set_value(this%chunk_x,
'CHUNK_X', this%ncf_mempath, found)
136 if (this%chunk_time > 0 .and. this%chunk_z > 0 .and. &
137 this%chunk_y > 0 .and. this%chunk_x > 0)
then
138 this%chunking_active = .true.
141 call get_isize(
'LAT', this%ncf_mempath, latsz)
142 call get_isize(
'LON', this%ncf_mempath, lonsz)
144 if (latsz > 0 .and. lonsz > 0)
then
146 call mem_setptr(this%lat,
'LAT', this%ncf_mempath)
147 call mem_setptr(this%lon,
'LON', this%ncf_mempath)
152 call nf_verify(nf90_create(this%nc_fname, &
153 iand(nf90_clobber, nf90_netcdf4), this%ncid), &
161 call nf_verify(nf90_close(this%ncid), this%nc_fname)
162 deallocate (this%chunk_z)
163 deallocate (this%chunk_y)
164 deallocate (this%chunk_x)
165 deallocate (this%layers)
166 nullify (this%chunk_z)
167 nullify (this%chunk_y)
168 nullify (this%chunk_x)
170 call this%NCModelExportType%destroy()
180 call this%add_global_att()
182 call this%define_dim()
184 call this%define_projection()
187 call this%define_dependent()
190 call nf_verify(nf90_enddef(this%ncid), this%nc_fname)
192 call this%add_grid_data()
194 call this%add_proj_data()
196 call this%add_pkg_data()
198 call this%define_gridmap()
200 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
209 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
212 this%stepcnt = this%stepcnt + 1
214 if (
size(this%dis%nodeuser) < &
215 size(this%dis%nodereduced))
then
216 allocate (dbl1d(
size(this%dis%nodereduced)))
218 do n = 1,
size(this%dis%nodereduced)
219 if (this%dis%nodereduced(n) > 0)
then
220 dbl1d(n) = this%x(this%dis%nodereduced(n))
225 this%var_ids%dependent, dbl1d, &
226 start=(/1, 1, 1, this%stepcnt/), &
227 count=(/this%dis%ncol, &
229 this%dis%nlay, 1/)), &
235 this%var_ids%dependent, this%x, &
236 start=(/1, 1, 1, this%stepcnt/), &
237 count=(/this%dis%ncol, &
239 this%dis%nlay, 1/)), &
244 call nf_verify(nf90_put_var(this%ncid, this%var_ids%time, &
245 totim, start=(/this%stepcnt/)), &
249 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
256 character(len=*),
intent(in) :: pkgtype
257 character(len=*),
intent(in) :: pkgname
258 character(len=*),
intent(in) :: mempath
260 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
261 integer(I4B),
dimension(:, :),
pointer,
contiguous :: int2d
262 integer(I4B),
dimension(:, :, :),
pointer,
contiguous :: int3d
263 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
264 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
265 real(DP),
dimension(:, :, :),
pointer,
contiguous :: dbl3d
266 character(len=LINELENGTH) :: nc_varname, input_attr
267 integer(I4B) :: iper, iaux
275 input_attr = this%input_attribute(pkgname, idt)
277 select case (idt%datatype)
279 call mem_setptr(int1d, idt%mf6varname, mempath)
280 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, &
281 int1d, nc_varname, pkgname, idt%tagname, &
282 idt%shape, idt%longname, input_attr, &
283 this%gridmap_name, this%latlon, this%deflate, &
284 this%shuffle, this%chunk_z, this%chunk_y, &
285 this%chunk_x, iper, this%nc_fname)
287 call mem_setptr(int2d, idt%mf6varname, mempath)
288 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, &
289 int2d, nc_varname, pkgname, idt%tagname, &
290 idt%shape, idt%longname, input_attr, &
291 this%gridmap_name, this%latlon, this%deflate, &
292 this%shuffle, this%chunk_z, this%chunk_y, &
293 this%chunk_x, this%nc_fname)
295 call mem_setptr(int3d, idt%mf6varname, mempath)
296 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, &
297 int3d, nc_varname, pkgname, idt%tagname, &
298 idt%shape, idt%longname, input_attr, &
299 this%gridmap_name, this%latlon, this%deflate, &
300 this%shuffle, this%chunk_z, this%chunk_y, &
301 this%chunk_x, this%nc_fname)
303 call mem_setptr(dbl1d, idt%mf6varname, mempath)
304 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, &
305 dbl1d, nc_varname, pkgname, idt%tagname, &
306 idt%shape, idt%longname, input_attr, &
307 this%gridmap_name, this%latlon, this%deflate, &
308 this%shuffle, this%chunk_z, this%chunk_y, &
309 this%chunk_x, iper, this%nc_fname)
311 call mem_setptr(dbl2d, idt%mf6varname, mempath)
312 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, &
313 dbl2d, nc_varname, pkgname, idt%tagname, &
314 idt%shape, idt%longname, input_attr, &
315 this%gridmap_name, this%latlon, this%deflate, &
316 this%shuffle, this%chunk_z, this%chunk_y, &
317 this%chunk_x, this%nc_fname)
319 call mem_setptr(dbl3d, idt%mf6varname, mempath)
320 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, &
321 dbl3d, nc_varname, pkgname, idt%tagname, &
322 idt%shape, idt%longname, input_attr, &
323 this%gridmap_name, this%latlon, this%deflate, &
324 this%shuffle, this%chunk_z, this%chunk_y, &
325 this%chunk_x, iper, iaux, this%nc_fname)
336 character(len=*),
intent(in) :: pkgtype
337 character(len=*),
intent(in) :: pkgname
338 character(len=*),
intent(in) :: mempath
340 intent(in) :: param_dfns
342 integer(I4B) :: iparam, isize
343 do iparam = 1,
size(param_dfns)
345 idt => param_dfns(iparam)
347 if (idt%blockname ==
'GRIDDATA')
then
349 call get_isize(idt%mf6varname, mempath, isize)
351 call this%export_input_array(pkgtype, pkgname, mempath, idt)
366 character(len=*),
intent(in) :: ilayer_varname
367 integer(I4B),
intent(in) :: ilayer
369 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
370 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
371 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
372 integer(I4B),
dimension(:),
pointer,
contiguous :: ialayer
373 real(DP),
dimension(:),
contiguous,
pointer :: dbl1d_ptr
374 character(len=LINELENGTH) :: nc_varname, input_attr
375 integer(I4B) :: n, iparam, nvals
376 logical(LGP) :: ilayer_read
380 ilayer_read = .false.
383 call mem_setptr(ialayer, export_pkg%param_names(ilayer), &
384 export_pkg%mf6_input%mempath)
387 if (export_pkg%param_reads(ilayer)%invar == 1)
then
392 do iparam = 1, export_pkg%nparam
394 if (export_pkg%param_reads(iparam)%invar < 1) cycle
399 export_pkg%mf6_input%component_type, &
400 export_pkg%mf6_input%subcomponent_type, &
401 'PERIOD', export_pkg%param_names(iparam), &
404 nc_varname =
export_varname(export_pkg%mf6_input%subcomponent_name, idt, &
406 input_attr = this%input_attribute(export_pkg%mf6_input%subcomponent_name, &
409 select case (idt%datatype)
411 call mem_setptr(int1d, idt%mf6varname, export_pkg%mf6_input%mempath)
412 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, &
414 export_pkg%mf6_input%subcomponent_name, &
415 idt%tagname, idt%shape, idt%longname, input_attr, &
416 this%gridmap_name, this%latlon, this%deflate, &
417 this%shuffle, this%chunk_z, this%chunk_y, &
418 this%chunk_x, export_pkg%iper, this%nc_fname)
420 call mem_setptr(dbl1d, idt%mf6varname, export_pkg%mf6_input%mempath)
421 call this%export_layer_3d(export_pkg, idt, ilayer_read, ialayer, &
422 dbl1d, nc_varname, input_attr)
424 call mem_setptr(dbl2d, idt%mf6varname, export_pkg%mf6_input%mempath)
425 nvals = this%dis%ncol * this%dis%nrow
426 do n = 1,
size(dbl2d, dim=1)
427 dbl1d_ptr(1:nvals) => dbl2d(n, :)
428 if (all(dbl1d_ptr ==
dzero))
then
430 call this%export_layer_3d(export_pkg, idt, ilayer_read, ialayer, &
431 dbl1d_ptr, nc_varname, input_attr, n)
435 errmsg =
'EXPORT ilayer unsupported datatype='//trim(idt%datatype)
441 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
452 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
453 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
455 character(len=LINELENGTH) :: nc_varname, input_attr
456 integer(I4B) :: iparam
458 do iparam = 1, export_pkg%nparam
461 export_pkg%mf6_input%component_type, &
462 export_pkg%mf6_input%subcomponent_type, &
463 'PERIOD', export_pkg%param_names(iparam), &
467 nc_varname =
export_varname(export_pkg%mf6_input%subcomponent_name, idt, &
469 input_attr = this%input_attribute(export_pkg%mf6_input%subcomponent_name, &
473 select case (idt%datatype)
475 call mem_setptr(int1d, export_pkg%param_names(iparam), &
476 export_pkg%mf6_input%mempath)
477 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, &
479 export_pkg%mf6_input%subcomponent_name, &
480 idt%tagname, idt%shape, idt%longname, input_attr, &
481 this%gridmap_name, this%latlon, this%deflate, &
482 this%shuffle, this%chunk_z, this%chunk_y, &
483 this%chunk_x,
kper, this%nc_fname)
485 call mem_setptr(dbl1d, export_pkg%param_names(iparam), &
486 export_pkg%mf6_input%mempath)
487 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, &
489 export_pkg%mf6_input%subcomponent_name, &
490 idt%tagname, idt%shape, idt%longname, input_attr, &
491 this%gridmap_name, this%latlon, this%deflate, &
492 this%shuffle, this%chunk_z, this%chunk_y, &
493 this%chunk_x,
kper, this%nc_fname)
495 errmsg =
'EXPORT unsupported datatype='//trim(idt%datatype)
501 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
507 dbl1d, nc_varname, input_attr, iaux)
514 logical(LGP),
intent(in) :: ilayer_read
515 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(in) :: ialayer
516 real(DP),
dimension(:),
pointer,
contiguous,
intent(in) :: dbl1d
517 character(len=*),
intent(inout) :: nc_varname
518 character(len=*),
intent(in) :: input_attr
519 integer(I4B),
optional,
intent(in) :: iaux
520 real(DP),
dimension(:, :, :),
pointer,
contiguous :: dbl3d
521 integer(I4B) :: n, i, j, k, nvals, idxaux
522 real(DP),
dimension(:, :),
contiguous,
pointer :: dbl2d_ptr
526 if (
present(iaux))
then
527 nc_varname =
export_varname(export_pkg%mf6_input%subcomponent_name, &
528 idt, iper=
kper, iaux=iaux)
532 allocate (dbl3d(export_pkg%mshape(3), export_pkg%mshape(2), &
533 export_pkg%mshape(1)))
535 if (ilayer_read)
then
536 do k = 1,
size(dbl3d, dim=3)
538 do i = 1,
size(dbl3d, dim=2)
539 do j = 1,
size(dbl3d, dim=1)
541 if (ialayer(n) == k)
then
542 dbl3d(j, i, k) = dbl1d(n)
551 nvals = export_pkg%mshape(3) * export_pkg%mshape(2)
552 dbl2d_ptr(1:export_pkg%mshape(3), 1:export_pkg%mshape(2)) => dbl1d(1:nvals)
553 dbl3d(:, :, 1) = dbl2d_ptr(:, :)
556 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, dbl3d, &
557 nc_varname, export_pkg%mf6_input%subcomponent_name, &
558 idt%tagname, idt%shape, idt%longname, input_attr, &
559 this%gridmap_name, this%latlon, this%deflate, &
560 this%shuffle, this%chunk_z, this%chunk_y, this%chunk_x, &
561 export_pkg%iper, idxaux, this%nc_fname)
575 character(LENCOMPONENTNAME) :: ptype, pname, pkgtype
577 pointer :: pkgtypes => null()
579 pointer :: pkgnames => null()
581 pointer :: mempaths => null()
583 character(len=LENMEMPATH) :: input_mempath, mempath
585 integer(I4B),
pointer :: export_arrays
586 logical(LGP) :: found
591 call mem_setptr(pkgtypes,
'PKGTYPES', input_mempath)
592 call mem_setptr(pkgnames,
'PKGNAMES', input_mempath)
593 call mem_setptr(mempaths,
'MEMPATHS', input_mempath)
595 do n = 1,
size(mempaths)
597 allocate (export_arrays)
601 mempath = mempaths(n)
606 if (mempath /=
'')
then
608 call mem_set_value(export_arrays,
'EXPORT_NC', mempath, found)
610 if (export_arrays > 0)
then
613 call this%export_input_arrays(ptype, pname, mempath, param_dfns)
618 deallocate (export_arrays)
627 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'title', &
628 this%annotation%title), this%nc_fname)
630 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'source', &
631 this%annotation%source), this%nc_fname)
633 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'modflow6_grid', &
634 this%annotation%grid), this%nc_fname)
636 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'modflow6_model', &
637 this%annotation%model), this%nc_fname)
639 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'history', &
640 this%annotation%history), this%nc_fname)
642 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'Conventions', &
643 this%annotation%conventions), &
655 call nf_verify(nf90_def_dim(this%ncid,
'bnd', 2, this%dim_ids%bnd), &
660 call nf_verify(nf90_def_dim(this%ncid,
'time', this%totnstp, &
661 this%dim_ids%time), this%nc_fname)
662 call nf_verify(nf90_def_var(this%ncid,
'time', nf90_double, &
663 this%dim_ids%time, this%var_ids%time), &
665 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'calendar', &
666 'standard'), this%nc_fname)
667 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'units', &
668 this%datetime), this%nc_fname)
669 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'axis',
'T'), &
672 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'standard_name', &
673 'time'), this%nc_fname)
674 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'long_name', &
675 'time'), this%nc_fname)
679 call nf_verify(nf90_def_dim(this%ncid,
'z', this%dis%nlay, this%dim_ids%z), &
681 call nf_verify(nf90_def_var(this%ncid,
'z', nf90_double, this%dim_ids%z, &
682 this%var_ids%z), this%nc_fname)
683 call nf_verify(nf90_put_att(this%ncid, this%var_ids%z,
'units',
'layer'), &
685 call nf_verify(nf90_put_att(this%ncid, this%var_ids%z,
'long_name', &
686 'layer number'), this%nc_fname)
696 call nf_verify(nf90_def_dim(this%ncid,
'y', this%dis%nrow, this%dim_ids%y), &
698 call nf_verify(nf90_def_var(this%ncid,
'y', nf90_double, this%dim_ids%y, &
699 this%var_ids%y), this%nc_fname)
700 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'units',
'm'), &
702 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'axis',
'Y'), &
704 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'standard_name', &
705 'projection_y_coordinate'), this%nc_fname)
706 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'long_name', &
707 'Northing'), this%nc_fname)
708 if (this%ogc_wkt /=
'')
then
709 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'grid_mapping', &
710 this%gridmap_name), this%nc_fname)
712 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'bounds',
'y_bnds'), &
714 call nf_verify(nf90_def_var(this%ncid,
'y_bnds', nf90_double, &
715 (/this%dim_ids%bnd, this%dim_ids%y/), &
716 this%var_ids%y_bnds), this%nc_fname)
719 call nf_verify(nf90_def_dim(this%ncid,
'x', this%dis%ncol, this%dim_ids%x), &
721 call nf_verify(nf90_def_var(this%ncid,
'x', nf90_double, this%dim_ids%x, &
722 this%var_ids%x), this%nc_fname)
723 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'units',
'm'), &
725 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'axis',
'X'), &
727 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'standard_name', &
728 'projection_x_coordinate'), this%nc_fname)
729 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'long_name', &
730 'Easting'), this%nc_fname)
731 if (this%ogc_wkt /=
'')
then
732 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'grid_mapping', &
733 this%gridmap_name), this%nc_fname)
735 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'bounds',
'x_bnds'), &
737 call nf_verify(nf90_def_var(this%ncid,
'x_bnds', nf90_double, &
738 (/this%dim_ids%bnd, this%dim_ids%x/), &
739 this%var_ids%x_bnds), this%nc_fname)
742 call nf_verify(nf90_def_dim(this%ncid,
'ncpl', &
743 this%dis%ncol * this%dis%nrow, &
744 this%dim_ids%ncpl), this%nc_fname)
753 call nf_verify(nf90_def_var(this%ncid, this%xname, nf90_double, &
754 (/this%dim_ids%x, this%dim_ids%y, &
755 this%dim_ids%z, this%dim_ids%time/), &
756 this%var_ids%dependent), &
760 if (this%chunking_active)
then
761 call nf_verify(nf90_def_var_chunking(this%ncid, &
762 this%var_ids%dependent, &
764 (/this%chunk_x, this%chunk_y, &
765 this%chunk_z, this%chunk_time/)), &
770 call ncvar_deflate(this%ncid, this%var_ids%dependent, this%deflate, &
771 this%shuffle, this%nc_fname)
774 call nf_verify(nf90_put_att(this%ncid, this%var_ids%dependent, &
775 'units',
'm'), this%nc_fname)
776 call nf_verify(nf90_put_att(this%ncid, this%var_ids%dependent, &
777 'standard_name', this%annotation%stdname), &
779 call nf_verify(nf90_put_att(this%ncid, this%var_ids%dependent,
'long_name', &
780 this%annotation%longname), this%nc_fname)
781 call nf_verify(nf90_put_att(this%ncid, this%var_ids%dependent,
'_FillValue', &
785 call ncvar_gridmap(this%ncid, this%var_ids%dependent, this%gridmap_name, &
786 this%latlon, this%nc_fname)
793 integer(I4B) :: var_id
794 if (this%ogc_wkt /=
'')
then
795 call nf_verify(nf90_redef(this%ncid), this%nc_fname)
796 call nf_verify(nf90_def_var(this%ncid, this%gridmap_name, nf90_int, &
797 var_id), this%nc_fname)
799 call nf_verify(nf90_put_att(this%ncid, var_id,
'crs_wkt', this%ogc_wkt), &
801 call nf_verify(nf90_enddef(this%ncid), this%nc_fname)
802 call nf_verify(nf90_put_var(this%ncid, var_id, 1), &
811 if (this%latlon .and. this%ogc_wkt /=
'')
then
813 call nf_verify(nf90_def_var(this%ncid,
'lat', nf90_double, &
814 (/this%dim_ids%x, this%dim_ids%y/), &
815 this%var_ids%lat), this%nc_fname)
816 call nf_verify(nf90_put_att(this%ncid, this%var_ids%lat,
'units', &
817 'degrees_north'), this%nc_fname)
818 call nf_verify(nf90_put_att(this%ncid, this%var_ids%lat,
'standard_name', &
819 'latitude'), this%nc_fname)
820 call nf_verify(nf90_put_att(this%ncid, this%var_ids%lat,
'long_name', &
821 'latitude'), this%nc_fname)
824 call nf_verify(nf90_def_var(this%ncid,
'lon', nf90_double, &
825 (/this%dim_ids%x, this%dim_ids%y/), &
826 this%var_ids%lon), this%nc_fname)
827 call nf_verify(nf90_put_att(this%ncid, this%var_ids%lon,
'units', &
828 'degrees_east'), this%nc_fname)
829 call nf_verify(nf90_put_att(this%ncid, this%var_ids%lon,
'standard_name', &
830 'longitude'), this%nc_fname)
831 call nf_verify(nf90_put_att(this%ncid, this%var_ids%lon,
'long_name', &
832 'longitude'), this%nc_fname)
840 if (this%latlon .and. this%ogc_wkt /=
'')
then
842 call nf_verify(nf90_put_var(this%ncid, this%var_ids%lat, &
843 this%lat, start=(/1, 1/), &
844 count=(/this%dis%ncol, this%dis%nrow/)), &
848 call nf_verify(nf90_put_var(this%ncid, this%var_ids%lon, &
849 this%lon, start=(/1, 1/), &
850 count=(/this%dis%ncol, this%dis%nrow/)), &
859 integer(I4B) :: ibnd, n
860 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
861 real(DP),
dimension(:),
allocatable :: x, y
863 allocate (x(
size(this%dis%cellx)))
864 allocate (y(
size(this%dis%celly)))
866 do n = 1,
size(this%dis%cellx)
867 x(n) = this%dis%cellx(n) + this%dis%xorigin
870 do n = 1,
size(this%dis%celly)
871 y(n) = this%dis%celly(n) + this%dis%yorigin
874 call nf_verify(nf90_put_var(this%ncid, this%var_ids%x, x), &
876 call nf_verify(nf90_put_var(this%ncid, this%var_ids%y, y), &
879 call nf_verify(nf90_put_var(this%ncid, this%var_ids%z, this%layers), &
886 allocate (dbl2d(2,
size(this%dis%cellx)))
888 do n = 1,
size(this%dis%cellx)
890 dbl2d(1, ibnd) = this%dis%xorigin
891 dbl2d(2, ibnd) = this%dis%xorigin + this%dis%delr(ibnd)
893 dbl2d(1, ibnd) = dbl2d(1, ibnd - 1) + this%dis%delr(ibnd)
894 dbl2d(2, ibnd) = dbl2d(2, ibnd - 1) + this%dis%delr(ibnd)
898 call nf_verify(nf90_put_var(this%ncid, this%var_ids%x_bnds, dbl2d), &
903 allocate (dbl2d(2,
size(this%dis%celly)))
905 do n =
size(this%dis%celly), 1, -1
907 dbl2d(1, ibnd) = this%dis%yorigin + sum(this%dis%delc) - this%dis%delc(n)
908 dbl2d(2, ibnd) = this%dis%yorigin + sum(this%dis%delc)
910 dbl2d(1, ibnd) = dbl2d(1, ibnd - 1) - this%dis%delc(n)
911 dbl2d(2, ibnd) = dbl2d(2, ibnd - 1) - this%dis%delc(n)
915 call nf_verify(nf90_put_var(this%ncid, this%var_ids%y_bnds, dbl2d), &
923 integer(I4B),
intent(in) :: ncid
924 integer(I4B),
intent(in) :: varid
925 integer(I4B),
intent(in) :: chunk_x
926 integer(I4B),
intent(in) :: chunk_y
927 character(len=*),
intent(in) :: nc_fname
928 if (chunk_y > 0 .and. chunk_x > 0)
then
929 call nf_verify(nf90_def_var_chunking(ncid, varid, nf90_chunked, &
930 (/chunk_x, chunk_y/)), nc_fname)
937 integer(I4B),
intent(in) :: ncid
938 integer(I4B),
intent(in) :: varid
939 integer(I4B),
intent(in) :: chunk_x
940 integer(I4B),
intent(in) :: chunk_y
941 integer(I4B),
intent(in) :: chunk_z
942 character(len=*),
intent(in) :: nc_fname
943 if (chunk_z > 0 .and. chunk_y > 0 .and. chunk_x > 0)
then
944 call nf_verify(nf90_def_var_chunking(ncid, varid, nf90_chunked, &
945 (/chunk_x, chunk_y, chunk_z/)), &
953 integer(I4B),
intent(in) :: ncid
954 integer(I4B),
intent(in) :: varid
955 integer(I4B),
intent(in) :: deflate
956 integer(I4B),
intent(in) :: shuffle
957 character(len=*),
intent(in) :: nc_fname
959 if (deflate >= 0)
then
960 call nf_verify(nf90_def_var_deflate(ncid, varid, shuffle=shuffle, &
961 deflate=1, deflate_level=deflate), &
969 integer(I4B),
intent(in) :: ncid
970 integer(I4B),
intent(in) :: varid
971 character(len=*),
intent(in) :: gridmap_name
972 logical(LGP),
intent(in) :: latlon
973 character(len=*),
intent(in) :: nc_fname
974 if (gridmap_name /=
'')
then
976 call nf_verify(nf90_put_att(ncid, varid,
'coordinates',
'lon lat'), &
979 call nf_verify(nf90_put_att(ncid, varid,
'coordinates',
'x y'), &
982 call nf_verify(nf90_put_att(ncid, varid,
'grid_mapping', gridmap_name), &
990 integer(I4B),
intent(in) :: ncid
991 integer(I4B),
intent(in) :: varid
992 integer(I4B),
intent(in) :: iper
993 integer(I4B),
intent(in) :: iaux
994 character(len=*),
intent(in) :: nc_tag
995 character(len=*),
intent(in) :: nc_fname
996 if (nc_tag /=
'')
then
997 call nf_verify(nf90_put_att(ncid, varid,
'modflow6_input', &
1000 call nf_verify(nf90_put_att(ncid, varid,
'modflow6_iper', &
1004 call nf_verify(nf90_put_att(ncid, varid,
'modflow6_iaux', &
1013 pkgname, tagname, shapestr, longname, nc_tag, &
1014 gridmap_name, latlon, deflate, shuffle, chunk_z, &
1015 chunk_y, chunk_x, iper, nc_fname)
1016 integer(I4B),
intent(in) :: ncid
1019 type(
distype),
pointer,
intent(in) :: dis
1020 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(in) :: p_mem
1021 character(len=*),
intent(in) :: nc_varname
1022 character(len=*),
intent(in) :: pkgname
1023 character(len=*),
intent(in) :: tagname
1024 character(len=*),
intent(in) :: shapestr
1025 character(len=*),
intent(in) :: longname
1026 character(len=*),
intent(in) :: nc_tag
1027 character(len=*),
intent(in) :: gridmap_name
1028 logical(LGP),
intent(in) :: latlon
1029 integer(I4B),
intent(in) :: deflate
1030 integer(I4B),
intent(in) :: shuffle
1031 integer(I4B),
intent(in) :: chunk_z
1032 integer(I4B),
intent(in) :: chunk_y
1033 integer(I4B),
intent(in) :: chunk_x
1034 integer(I4B),
intent(in) :: iper
1035 character(len=*),
intent(in) :: nc_fname
1036 integer(I4B) :: var_id, axis_sz
1037 character(len=LINELENGTH) :: longname_l
1039 if (shapestr ==
'NROW' .or. &
1040 shapestr ==
'NCOL' .or. &
1041 shapestr ==
'NCPL')
then
1043 select case (shapestr)
1049 axis_sz = dim_ids%ncpl
1052 longname_l =
export_longname(longname, pkgname, tagname, layer=0, iper=iper)
1055 call nf_verify(nf90_redef(ncid), nc_fname)
1056 call nf_verify(nf90_def_var(ncid, nc_varname, nf90_int, &
1057 (/axis_sz/), var_id), &
1061 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1064 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1065 (/nf90_fill_int/)), nc_fname)
1066 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1067 longname_l), nc_fname)
1073 call nf_verify(nf90_enddef(ncid), nc_fname)
1074 call nf_verify(nf90_put_var(ncid, var_id, p_mem), &
1079 call nf_verify(nf90_redef(ncid), nc_fname)
1080 call nf_verify(nf90_def_var(ncid, nc_varname, nf90_int, &
1081 (/dim_ids%x, dim_ids%y, dim_ids%z/), var_id), &
1085 call ncvar_chunk3d(ncid, var_id, chunk_x, chunk_y, chunk_z, nc_fname)
1087 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1090 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1091 (/nf90_fill_int/)), nc_fname)
1092 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1093 longname), nc_fname)
1096 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1100 call nf_verify(nf90_enddef(ncid), nc_fname)
1101 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1, 1/), &
1102 count=(/dis%ncol, dis%nrow, dis%nlay/)), &
1110 pkgname, tagname, shapestr, longname, nc_tag, &
1111 gridmap_name, latlon, deflate, shuffle, chunk_z, &
1112 chunk_y, chunk_x, nc_fname)
1113 integer(I4B),
intent(in) :: ncid
1116 type(
distype),
pointer,
intent(in) :: dis
1117 integer(I4B),
dimension(:, :),
pointer,
contiguous,
intent(in) :: p_mem
1118 character(len=*),
intent(in) :: nc_varname
1119 character(len=*),
intent(in) :: pkgname
1120 character(len=*),
intent(in) :: tagname
1121 character(len=*),
intent(in) :: shapestr
1122 character(len=*),
intent(in) :: longname
1123 character(len=*),
intent(in) :: nc_tag
1124 character(len=*),
intent(in) :: gridmap_name
1125 logical(LGP),
intent(in) :: latlon
1126 integer(I4B),
intent(in) :: deflate
1127 integer(I4B),
intent(in) :: shuffle
1128 integer(I4B),
intent(in) :: chunk_z
1129 integer(I4B),
intent(in) :: chunk_y
1130 integer(I4B),
intent(in) :: chunk_x
1131 character(len=*),
intent(in) :: nc_fname
1132 integer(I4B) :: var_id
1135 call nf_verify(nf90_redef(ncid), nc_fname)
1136 call nf_verify(nf90_def_var(ncid, nc_varname, nf90_int, &
1137 (/dim_ids%x, dim_ids%y/), var_id), &
1141 call ncvar_chunk2d(ncid, var_id, chunk_x, chunk_y, nc_fname)
1143 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1146 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1147 (/nf90_fill_int/)), nc_fname)
1148 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1149 longname), nc_fname)
1152 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1156 call nf_verify(nf90_enddef(ncid), nc_fname)
1157 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1/), &
1158 count=(/dis%ncol, dis%nrow/)), &
1165 pkgname, tagname, shapestr, longname, nc_tag, &
1166 gridmap_name, latlon, deflate, shuffle, chunk_z, &
1167 chunk_y, chunk_x, nc_fname)
1168 integer(I4B),
intent(in) :: ncid
1171 type(
distype),
pointer,
intent(in) :: dis
1172 integer(I4B),
dimension(:, :, :),
pointer,
contiguous,
intent(in) :: p_mem
1173 character(len=*),
intent(in) :: nc_varname
1174 character(len=*),
intent(in) :: pkgname
1175 character(len=*),
intent(in) :: tagname
1176 character(len=*),
intent(in) :: shapestr
1177 character(len=*),
intent(in) :: longname
1178 character(len=*),
intent(in) :: nc_tag
1179 character(len=*),
intent(in) :: gridmap_name
1180 logical(LGP),
intent(in) :: latlon
1181 integer(I4B),
intent(in) :: deflate
1182 integer(I4B),
intent(in) :: shuffle
1183 integer(I4B),
intent(in) :: chunk_z
1184 integer(I4B),
intent(in) :: chunk_y
1185 integer(I4B),
intent(in) :: chunk_x
1186 character(len=*),
intent(in) :: nc_fname
1187 integer(I4B) :: var_id
1190 call nf_verify(nf90_redef(ncid), nc_fname)
1191 call nf_verify(nf90_def_var(ncid, nc_varname, nf90_int, &
1192 (/dim_ids%x, dim_ids%y, dim_ids%z/), var_id), &
1196 call ncvar_chunk3d(ncid, var_id, chunk_x, chunk_y, chunk_z, nc_fname)
1198 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1201 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1202 (/nf90_fill_int/)), nc_fname)
1203 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1204 longname), nc_fname)
1207 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1211 call nf_verify(nf90_enddef(ncid), nc_fname)
1212 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1, 1/), &
1213 count=(/dis%ncol, dis%nrow, dis%nlay/)), &
1220 pkgname, tagname, shapestr, longname, nc_tag, &
1221 gridmap_name, latlon, deflate, shuffle, chunk_z, &
1222 chunk_y, chunk_x, iper, nc_fname)
1224 integer(I4B),
intent(in) :: ncid
1227 type(
distype),
pointer,
intent(in) :: dis
1228 real(DP),
dimension(:),
pointer,
contiguous,
intent(in) :: p_mem
1229 character(len=*),
intent(in) :: nc_varname
1230 character(len=*),
intent(in) :: pkgname
1231 character(len=*),
intent(in) :: tagname
1232 character(len=*),
intent(in) :: shapestr
1233 character(len=*),
intent(in) :: longname
1234 character(len=*),
intent(in) :: nc_tag
1235 character(len=*),
intent(in) :: gridmap_name
1236 logical(LGP),
intent(in) :: latlon
1237 integer(I4B),
intent(in) :: deflate
1238 integer(I4B),
intent(in) :: shuffle
1239 integer(I4B),
intent(in) :: chunk_z
1240 integer(I4B),
intent(in) :: chunk_y
1241 integer(I4B),
intent(in) :: chunk_x
1242 integer(I4B),
intent(in) :: iper
1243 character(len=*),
intent(in) :: nc_fname
1244 integer(I4B) :: var_id, axis_sz
1245 real(DP) :: fill_value
1246 character(len=LINELENGTH) :: longname_l
1248 if (shapestr ==
'NROW' .or. &
1249 shapestr ==
'NCOL' .or. &
1250 shapestr ==
'NCPL')
then
1252 select case (shapestr)
1258 axis_sz = dim_ids%ncpl
1262 call nf_verify(nf90_redef(ncid), nc_fname)
1263 call nf_verify(nf90_def_var(ncid, nc_varname, nf90_double, &
1264 (/axis_sz/), var_id), &
1268 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1271 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1272 (/nf90_fill_double/)), nc_fname)
1273 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1274 longname), nc_fname)
1280 call nf_verify(nf90_enddef(ncid), nc_fname)
1281 call nf_verify(nf90_put_var(ncid, var_id, p_mem), &
1288 fill_value = nf90_fill_double
1291 longname_l =
export_longname(longname, pkgname, tagname, layer=0, iper=iper)
1294 call nf_verify(nf90_redef(ncid), nc_fname)
1295 call nf_verify(nf90_def_var(ncid, nc_varname, nf90_double, &
1296 (/dim_ids%x, dim_ids%y, dim_ids%z/), var_id), &
1300 call ncvar_chunk3d(ncid, var_id, chunk_x, chunk_y, chunk_z, nc_fname)
1302 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1305 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1306 (/fill_value/)), nc_fname)
1307 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1308 longname_l), nc_fname)
1311 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1315 call nf_verify(nf90_enddef(ncid), nc_fname)
1316 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1, 1/), &
1317 count=(/dis%ncol, dis%nrow, dis%nlay/)), &
1325 pkgname, tagname, shapestr, longname, nc_tag, &
1326 gridmap_name, latlon, deflate, shuffle, chunk_z, &
1327 chunk_y, chunk_x, nc_fname)
1328 integer(I4B),
intent(in) :: ncid
1331 type(
distype),
pointer,
intent(in) :: dis
1332 real(DP),
dimension(:, :),
pointer,
contiguous,
intent(in) :: p_mem
1333 character(len=*),
intent(in) :: nc_varname
1334 character(len=*),
intent(in) :: pkgname
1335 character(len=*),
intent(in) :: tagname
1336 character(len=*),
intent(in) :: shapestr
1337 character(len=*),
intent(in) :: longname
1338 character(len=*),
intent(in) :: nc_tag
1339 character(len=*),
intent(in) :: gridmap_name
1340 logical(LGP),
intent(in) :: latlon
1341 integer(I4B),
intent(in) :: deflate
1342 integer(I4B),
intent(in) :: shuffle
1343 integer(I4B),
intent(in) :: chunk_z
1344 integer(I4B),
intent(in) :: chunk_y
1345 integer(I4B),
intent(in) :: chunk_x
1346 character(len=*),
intent(in) :: nc_fname
1347 integer(I4B) :: var_id
1350 call nf_verify(nf90_redef(ncid), nc_fname)
1351 call nf_verify(nf90_def_var(ncid, nc_varname, nf90_double, &
1352 (/dim_ids%x, dim_ids%y/), var_id), &
1356 call ncvar_chunk2d(ncid, var_id, chunk_x, chunk_y, nc_fname)
1358 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1361 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1362 (/nf90_fill_double/)), nc_fname)
1363 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1364 longname), nc_fname)
1367 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1371 call nf_verify(nf90_enddef(ncid), nc_fname)
1372 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1/), &
1373 count=(/dis%ncol, dis%nrow/)), &
1380 pkgname, tagname, shapestr, longname, nc_tag, &
1381 gridmap_name, latlon, deflate, shuffle, chunk_z, &
1382 chunk_y, chunk_x, iper, iaux, nc_fname)
1384 integer(I4B),
intent(in) :: ncid
1387 type(
distype),
pointer,
intent(in) :: dis
1388 real(DP),
dimension(:, :, :),
pointer,
contiguous,
intent(in) :: p_mem
1389 character(len=*),
intent(in) :: nc_varname
1390 character(len=*),
intent(in) :: pkgname
1391 character(len=*),
intent(in) :: tagname
1392 character(len=*),
intent(in) :: shapestr
1393 character(len=*),
intent(in) :: longname
1394 character(len=*),
intent(in) :: nc_tag
1395 character(len=*),
intent(in) :: gridmap_name
1396 logical(LGP),
intent(in) :: latlon
1397 integer(I4B),
intent(in) :: deflate
1398 integer(I4B),
intent(in) :: shuffle
1399 integer(I4B),
intent(in) :: chunk_z
1400 integer(I4B),
intent(in) :: chunk_y
1401 integer(I4B),
intent(in) :: chunk_x
1402 integer(I4B),
intent(in) :: iper
1403 integer(I4B),
intent(in) :: iaux
1404 character(len=*),
intent(in) :: nc_fname
1405 integer(I4B) :: var_id
1406 real(DP) :: fill_value
1407 character(len=LINELENGTH) :: longname_l
1412 fill_value = nf90_fill_double
1415 longname_l =
export_longname(longname, pkgname, tagname, layer=0, iper=iper)
1418 call nf_verify(nf90_redef(ncid), nc_fname)
1419 call nf_verify(nf90_def_var(ncid, nc_varname, nf90_double, &
1420 (/dim_ids%x, dim_ids%y, dim_ids%z/), var_id), &
1424 call ncvar_chunk3d(ncid, var_id, chunk_x, chunk_y, chunk_z, nc_fname)
1426 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1429 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1430 (/fill_value/)), nc_fname)
1431 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1432 longname_l), nc_fname)
1435 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1436 call ncvar_mf6attr(ncid, var_id, iper, iaux, nc_tag, nc_fname)
1439 call nf_verify(nf90_enddef(ncid), nc_fname)
1440 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1, 1/), &
1441 count=(/dis%ncol, dis%nrow, dis%nlay/)), &
1449 character(len=*),
intent(in) :: pkgname
1451 integer(I4B),
optional,
intent(in) :: iper
1452 integer(I4B),
optional,
intent(in) :: iaux
1453 character(len=LINELENGTH) :: varname
1454 character(len=LINELENGTH) :: pname, vname
1456 vname = idt%mf6varname
1459 if (
present(iper))
then
1460 if (
present(iaux))
then
1461 write (varname,
'(a,i0,a,i0)') trim(pname)//
'_'//trim(vname)// &
1462 '_p', iper,
'a', iaux
1464 write (varname,
'(a,i0)') trim(pname)//
'_'//trim(vname)//
'_p', iper
1467 varname = trim(pname)//
'_'//trim(vname)
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
integer(i4b), parameter lenvarname
maximum length of a variable name
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 contains the DisNCStructuredModule.
subroutine add_pkg_data(this)
determine packages to write gridded input
subroutine ncvar_mf6attr(ncid, varid, iper, iaux, nc_tag, nc_fname)
put variable internal modflow6 attributes
subroutine dis_export_destroy(this)
netcdf export dis destroy
character(len=linelength) function export_varname(pkgname, idt, iper, iaux)
build netcdf variable name
subroutine ncvar_gridmap(ncid, varid, gridmap_name, latlon, nc_fname)
put variable gridmap attributes
subroutine add_global_att(this)
create file (group) attributes
subroutine nc_export_int2d(ncid, dim_ids, var_ids, dis, p_mem, nc_varname, pkgname, tagname, shapestr, longname, nc_tag, gridmap_name, latlon, deflate, shuffle, chunk_z, chunk_y, chunk_x, nc_fname)
netcdf export 2D integer
subroutine dis_export_init(this, modelname, modeltype, modelfname, nc_fname, disenum, nctype, iout)
netcdf export dis init
subroutine export_input_arrays(this, pkgtype, pkgname, mempath, param_dfns)
write package gridded input data
subroutine add_grid_data(this)
add grid coordinates
subroutine nc_export_dbl3d(ncid, dim_ids, var_ids, dis, p_mem, nc_varname, pkgname, tagname, shapestr, longname, nc_tag, gridmap_name, latlon, deflate, shuffle, chunk_z, chunk_y, chunk_x, iper, iaux, nc_fname)
netcdf export 3D double
subroutine define_projection(this)
define grid projection variables
subroutine df(this)
netcdf export define
subroutine ncvar_chunk2d(ncid, varid, chunk_x, chunk_y, nc_fname)
define 2d variable chunking
subroutine add_proj_data(this)
add grid projection data
subroutine export_layer_3d(this, export_pkg, idt, ilayer_read, ialayer, dbl1d, nc_varname, input_attr, iaux)
export layer variable as full grid
subroutine nc_export_int3d(ncid, dim_ids, var_ids, dis, p_mem, nc_varname, pkgname, tagname, shapestr, longname, nc_tag, gridmap_name, latlon, deflate, shuffle, chunk_z, chunk_y, chunk_x, nc_fname)
netcdf export 3D integer
subroutine step(this)
netcdf export step
subroutine ncvar_deflate(ncid, varid, deflate, shuffle, nc_fname)
define variable compression
subroutine nc_export_dbl1d(ncid, dim_ids, var_ids, dis, p_mem, nc_varname, pkgname, tagname, shapestr, longname, nc_tag, gridmap_name, latlon, deflate, shuffle, chunk_z, chunk_y, chunk_x, iper, nc_fname)
netcdf export 1D double
subroutine nc_export_int1d(ncid, dim_ids, var_ids, dis, p_mem, nc_varname, pkgname, tagname, shapestr, longname, nc_tag, gridmap_name, latlon, deflate, shuffle, chunk_z, chunk_y, chunk_x, iper, nc_fname)
netcdf export 1D integer
subroutine define_dependent(this)
create the model layer dependent variables
subroutine nc_export_dbl2d(ncid, dim_ids, var_ids, dis, p_mem, nc_varname, pkgname, tagname, shapestr, longname, nc_tag, gridmap_name, latlon, deflate, shuffle, chunk_z, chunk_y, chunk_x, nc_fname)
netcdf export 2D double
subroutine export_input_array(this, pkgtype, pkgname, mempath, idt)
netcdf export an input array
subroutine ncvar_chunk3d(ncid, varid, chunk_x, chunk_y, chunk_z, nc_fname)
define 3d variable chunking
subroutine define_dim(this)
netcdf export define dimensions
subroutine package_step(this, export_pkg)
netcdf export package dynamic input
subroutine package_step_ilayer(this, export_pkg, ilayer_varname, ilayer)
netcdf export package dynamic input with ilayer index variable
subroutine define_gridmap(this)
create the file grid mapping container variable
type(inputparamdefinitiontype) function, dimension(:), pointer, public param_definitions(component, subcomponent)
This module defines variable data types.
character(len=lenmempath) function create_mem_path(component, subcomponent, context)
returns the path to the memory object
subroutine, public get_isize(name, mem_path, isize)
@ brief Get the number of elements for this variable
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
character(len=linelength) idm_context
integer(i4b) isim_mode
simulation mode
This module contains the SourceCommonModule.
character(len=lencomponentname) function, public idm_subcomponent_type(component, subcomponent)
component from package or model type
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.
abstract type for model netcdf export type