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
98 character(len=*),
intent(in) :: modelname
99 character(len=*),
intent(in) :: modeltype
100 character(len=*),
intent(in) :: modelfname
101 integer(I4B),
intent(in) :: disenum
102 integer(I4B),
intent(in) :: nctype
103 integer(I4B),
intent(in) :: iout
104 integer(I4B) :: k, latsz, lonsz
105 logical(LGP) :: found
108 this%nlay = this%dis%nlay
111 allocate (this%chunk_z)
112 allocate (this%chunk_y)
113 allocate (this%chunk_x)
114 allocate (this%layers(this%nlay))
124 this%latlon = .false.
127 call this%NCModelExportType%init(modelname, modeltype, modelfname, disenum, &
130 if (this%ncf_mempath /=
'')
then
131 call mem_set_value(this%chunk_z,
'CHUNK_Z', this%ncf_mempath, found)
132 call mem_set_value(this%chunk_y,
'CHUNK_Y', this%ncf_mempath, found)
133 call mem_set_value(this%chunk_x,
'CHUNK_X', this%ncf_mempath, found)
135 if (this%chunk_time > 0 .and. this%chunk_z > 0 .and. &
136 this%chunk_y > 0 .and. this%chunk_x > 0)
then
137 this%chunking_active = .true.
140 call get_isize(
'LAT', this%ncf_mempath, latsz)
141 call get_isize(
'LON', this%ncf_mempath, lonsz)
143 if (latsz > 0 .and. lonsz > 0)
then
145 call mem_setptr(this%lat,
'LAT', this%ncf_mempath)
146 call mem_setptr(this%lon,
'LON', this%ncf_mempath)
151 call nf_verify(nf90_create(this%nc_fname, &
152 ior(nf90_clobber, nf90_netcdf4), this%ncid), &
160 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)
167 nullify (this%chunk_z)
168 nullify (this%chunk_y)
169 nullify (this%chunk_x)
172 call this%NCModelExportType%destroy()
182 call this%add_global_att()
184 call this%define_dim()
186 call this%define_projection()
189 call this%define_dependent()
192 call nf_verify(nf90_enddef(this%ncid), this%nc_fname)
194 call this%add_grid_data()
196 call this%add_proj_data()
198 call this%add_pkg_data()
200 call this%define_gridmap()
202 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
211 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
214 this%stepcnt = this%stepcnt + 1
216 if (
size(this%dis%nodeuser) < &
217 size(this%dis%nodereduced))
then
218 allocate (dbl1d(
size(this%dis%nodereduced)))
220 do n = 1,
size(this%dis%nodereduced)
221 if (this%dis%nodereduced(n) > 0)
then
222 dbl1d(n) = this%x(this%dis%nodereduced(n))
227 this%var_ids%dependent, dbl1d, &
228 start=(/1, 1, 1, this%stepcnt/), &
229 count=(/this%dis%ncol, &
231 this%dis%nlay, 1/)), &
237 this%var_ids%dependent, this%x, &
238 start=(/1, 1, 1, this%stepcnt/), &
239 count=(/this%dis%ncol, &
241 this%dis%nlay, 1/)), &
246 call nf_verify(nf90_put_var(this%ncid, this%var_ids%time, &
247 totim, start=(/this%stepcnt/)), &
250 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
257 character(len=*),
intent(in) :: pkgtype
258 character(len=*),
intent(in) :: pkgname
259 character(len=*),
intent(in) :: mempath
261 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
262 integer(I4B),
dimension(:, :),
pointer,
contiguous :: int2d
263 integer(I4B),
dimension(:, :, :),
pointer,
contiguous :: int3d
264 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
265 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
266 real(DP),
dimension(:, :, :),
pointer,
contiguous :: dbl3d
267 character(len=LINELENGTH) :: nc_varname, input_attr
268 integer(I4B) :: iper, iaux
276 input_attr = this%input_attribute(pkgname, idt)
278 select case (idt%datatype)
280 call mem_setptr(int1d, idt%mf6varname, mempath)
281 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, &
282 int1d, nc_varname, pkgname, idt%tagname, &
283 idt%shape, idt%longname, input_attr, &
284 this%gridmap_name, this%latlon, this%deflate, &
285 this%shuffle, this%chunk_z, this%chunk_y, &
286 this%chunk_x, iper, this%nc_fname)
288 call mem_setptr(int2d, idt%mf6varname, mempath)
289 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, &
290 int2d, nc_varname, pkgname, idt%tagname, &
291 idt%shape, idt%longname, input_attr, &
292 this%gridmap_name, this%latlon, this%deflate, &
293 this%shuffle, this%chunk_z, this%chunk_y, &
294 this%chunk_x, this%nc_fname)
296 call mem_setptr(int3d, idt%mf6varname, mempath)
297 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, &
298 int3d, nc_varname, pkgname, idt%tagname, &
299 idt%shape, idt%longname, input_attr, &
300 this%gridmap_name, this%latlon, this%deflate, &
301 this%shuffle, this%chunk_z, this%chunk_y, &
302 this%chunk_x, this%nc_fname)
304 call mem_setptr(dbl1d, idt%mf6varname, mempath)
305 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, &
306 dbl1d, nc_varname, pkgname, idt%tagname, &
307 idt%shape, idt%longname, input_attr, &
308 this%gridmap_name, this%latlon, this%deflate, &
309 this%shuffle, this%chunk_z, this%chunk_y, &
310 this%chunk_x, iper, this%nc_fname)
312 call mem_setptr(dbl2d, idt%mf6varname, mempath)
313 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, &
314 dbl2d, nc_varname, pkgname, idt%tagname, &
315 idt%shape, idt%longname, input_attr, &
316 this%gridmap_name, this%latlon, this%deflate, &
317 this%shuffle, this%chunk_z, this%chunk_y, &
318 this%chunk_x, this%nc_fname)
320 call mem_setptr(dbl3d, idt%mf6varname, mempath)
321 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, &
322 dbl3d, nc_varname, pkgname, idt%tagname, &
323 idt%shape, idt%longname, input_attr, &
324 this%gridmap_name, this%latlon, this%deflate, &
325 this%shuffle, this%chunk_z, this%chunk_y, &
326 this%chunk_x, iper, iaux, this%nc_fname)
337 character(len=*),
intent(in) :: pkgtype
338 character(len=*),
intent(in) :: pkgname
339 character(len=*),
intent(in) :: mempath
341 intent(in) :: param_dfns
343 integer(I4B) :: iparam, isize
345 do iparam = 1,
size(param_dfns)
347 idt => param_dfns(iparam)
349 if (idt%blockname ==
'GRIDDATA')
then
351 call get_isize(idt%mf6varname, mempath, isize)
354 call this%export_input_array(pkgtype, pkgname, mempath, idt)
369 character(len=*),
intent(in) :: ilayer_varname
370 integer(I4B),
intent(in) :: ilayer
373 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
374 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
375 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
376 integer(I4B),
dimension(:),
pointer,
contiguous :: ialayer
377 real(DP),
dimension(:),
contiguous,
pointer :: dbl1d_ptr
378 character(len=LINELENGTH) :: nc_varname, input_attr
379 integer(I4B) :: n, iparam, nvals
380 logical(LGP) :: ilayer_read
384 ilayer_read = .false.
387 call mem_setptr(ialayer, export_pkg%param_names(ilayer), &
388 export_pkg%mf6_input%mempath)
391 if (export_pkg%param_reads(ilayer)%invar == 1)
then
396 do iparam = 1, export_pkg%nparam
399 if (export_pkg%param_reads(iparam)%invar < 1) cycle
404 export_pkg%mf6_input%component_type, &
405 export_pkg%mf6_input%subcomponent_type, &
406 'PERIOD', export_pkg%param_names(iparam), &
410 nc_varname =
export_varname(export_pkg%mf6_input%subcomponent_name, idt, &
412 input_attr = this%input_attribute(export_pkg%mf6_input%subcomponent_name, &
416 select case (idt%datatype)
418 call mem_setptr(int1d, idt%mf6varname, export_pkg%mf6_input%mempath)
419 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, &
421 export_pkg%mf6_input%subcomponent_name, &
422 idt%tagname, idt%shape, idt%longname, input_attr, &
423 this%gridmap_name, this%latlon, this%deflate, &
424 this%shuffle, this%chunk_z, this%chunk_y, &
425 this%chunk_x, export_pkg%iper, this%nc_fname)
427 call mem_setptr(dbl1d, idt%mf6varname, export_pkg%mf6_input%mempath)
428 call this%export_layer_3d(export_pkg, idt, ilayer_read, ialayer, &
429 dbl1d, nc_varname, input_attr)
431 call mem_setptr(dbl2d, idt%mf6varname, export_pkg%mf6_input%mempath)
432 nvals = this%dis%ncol * this%dis%nrow
434 do n = 1,
size(dbl2d, dim=1)
435 dbl1d_ptr(1:nvals) => dbl2d(n, :)
436 if (all(dbl1d_ptr ==
dzero))
then
438 call this%export_layer_3d(export_pkg, idt, ilayer_read, ialayer, &
439 dbl1d_ptr, nc_varname, input_attr, n)
444 errmsg =
'EXPORT ilayer unsupported datatype='//trim(idt%datatype)
450 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
464 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
465 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
467 character(len=LINELENGTH) :: nc_varname, input_attr
468 integer(I4B) :: iparam
470 do iparam = 1, export_pkg%nparam
474 export_pkg%mf6_input%component_type, &
475 export_pkg%mf6_input%subcomponent_type, &
476 'PERIOD', export_pkg%param_names(iparam), &
480 nc_varname =
export_varname(export_pkg%mf6_input%subcomponent_name, idt, &
482 input_attr = this%input_attribute(export_pkg%mf6_input%subcomponent_name, &
486 select case (idt%datatype)
489 call mem_setptr(int1d, export_pkg%param_names(iparam), &
490 export_pkg%mf6_input%mempath)
491 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, &
493 export_pkg%mf6_input%subcomponent_name, &
494 idt%tagname, idt%shape, idt%longname, input_attr, &
495 this%gridmap_name, this%latlon, this%deflate, &
496 this%shuffle, this%chunk_z, this%chunk_y, &
497 this%chunk_x,
kper, this%nc_fname)
501 call mem_setptr(dbl1d, export_pkg%param_names(iparam), &
502 export_pkg%mf6_input%mempath)
503 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, &
505 export_pkg%mf6_input%subcomponent_name, &
506 idt%tagname, idt%shape, idt%longname, input_attr, &
507 this%gridmap_name, this%latlon, this%deflate, &
508 this%shuffle, this%chunk_z, this%chunk_y, &
509 this%chunk_x,
kper, this%nc_fname)
513 errmsg =
'EXPORT unsupported datatype='//trim(idt%datatype)
520 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
526 dbl1d, nc_varname, input_attr, iaux)
533 logical(LGP),
intent(in) :: ilayer_read
534 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(in) :: ialayer
535 real(DP),
dimension(:),
pointer,
contiguous,
intent(in) :: dbl1d
536 character(len=*),
intent(inout) :: nc_varname
537 character(len=*),
intent(in) :: input_attr
538 integer(I4B),
optional,
intent(in) :: iaux
540 real(DP),
dimension(:, :, :),
pointer,
contiguous :: dbl3d
541 integer(I4B) :: n, i, j, k, nvals, idxaux
542 real(DP),
dimension(:, :),
contiguous,
pointer :: dbl2d_ptr
546 if (
present(iaux))
then
547 nc_varname =
export_varname(export_pkg%mf6_input%subcomponent_name, &
548 idt, iper=
kper, iaux=iaux)
552 allocate (dbl3d(export_pkg%mshape(3), export_pkg%mshape(2), &
553 export_pkg%mshape(1)))
555 if (ilayer_read)
then
556 do k = 1,
size(dbl3d, dim=3)
558 do i = 1,
size(dbl3d, dim=2)
559 do j = 1,
size(dbl3d, dim=1)
561 if (ialayer(n) == k)
then
562 dbl3d(j, i, k) = dbl1d(n)
571 nvals = export_pkg%mshape(3) * export_pkg%mshape(2)
572 dbl2d_ptr(1:export_pkg%mshape(3), 1:export_pkg%mshape(2)) => dbl1d(1:nvals)
573 dbl3d(:, :, 1) = dbl2d_ptr(:, :)
576 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, dbl3d, &
577 nc_varname, export_pkg%mf6_input%subcomponent_name, &
578 idt%tagname, idt%shape, idt%longname, input_attr, &
579 this%gridmap_name, this%latlon, this%deflate, &
580 this%shuffle, this%chunk_z, this%chunk_y, this%chunk_x, &
581 export_pkg%iper, idxaux, this%nc_fname)
595 character(LENCOMPONENTNAME) :: ptype, pname, pkgtype
597 pointer :: pkgtypes => null()
599 pointer :: pkgnames => null()
601 pointer :: mempaths => null()
603 character(len=LENMEMPATH) :: input_mempath, mempath
605 integer(I4B),
pointer :: export_arrays
606 logical(LGP) :: found
611 call mem_setptr(pkgtypes,
'PKGTYPES', input_mempath)
612 call mem_setptr(pkgnames,
'PKGNAMES', input_mempath)
613 call mem_setptr(mempaths,
'MEMPATHS', input_mempath)
615 do n = 1,
size(mempaths)
618 allocate (export_arrays)
622 mempath = mempaths(n)
627 if (mempath /=
'')
then
629 call mem_set_value(export_arrays,
'EXPORT_NC', mempath, found)
631 if (export_arrays > 0)
then
634 call this%export_input_arrays(ptype, pname, mempath, param_dfns)
639 deallocate (export_arrays)
648 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'title', &
649 this%annotation%title), this%nc_fname)
651 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'source', &
652 this%annotation%source), this%nc_fname)
654 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'modflow6_grid', &
655 this%annotation%grid), this%nc_fname)
657 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'modflow6_model', &
658 this%annotation%model), this%nc_fname)
660 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'history', &
661 this%annotation%history), this%nc_fname)
663 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'Conventions', &
664 this%annotation%conventions), &
676 call nf_verify(nf90_def_dim(this%ncid,
'bnd', 2, this%dim_ids%bnd), &
681 call nf_verify(nf90_def_dim(this%ncid,
'time', this%totnstp, &
682 this%dim_ids%time), this%nc_fname)
683 call nf_verify(nf90_def_var(this%ncid,
'time', nf90_double, &
684 this%dim_ids%time, this%var_ids%time), &
686 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'calendar', &
687 'standard'), this%nc_fname)
688 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'units', &
689 this%datetime), this%nc_fname)
690 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'axis',
'T'), &
693 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'standard_name', &
694 'time'), this%nc_fname)
695 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'long_name', &
696 'time'), this%nc_fname)
700 call nf_verify(nf90_def_dim(this%ncid,
'z', this%dis%nlay, this%dim_ids%z), &
702 call nf_verify(nf90_def_var(this%ncid,
'z', nf90_double, this%dim_ids%z, &
703 this%var_ids%z), this%nc_fname)
704 call nf_verify(nf90_put_att(this%ncid, this%var_ids%z,
'units',
'layer'), &
706 call nf_verify(nf90_put_att(this%ncid, this%var_ids%z,
'long_name', &
707 'layer number'), this%nc_fname)
717 call nf_verify(nf90_def_dim(this%ncid,
'y', this%dis%nrow, this%dim_ids%y), &
719 call nf_verify(nf90_def_var(this%ncid,
'y', nf90_double, this%dim_ids%y, &
720 this%var_ids%y), this%nc_fname)
721 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'units',
'm'), &
723 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'axis',
'Y'), &
725 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'standard_name', &
726 'projection_y_coordinate'), this%nc_fname)
727 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'long_name', &
728 'Northing'), this%nc_fname)
729 if (this%ogc_wkt /=
'')
then
730 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'grid_mapping', &
731 this%gridmap_name), this%nc_fname)
733 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'bounds',
'y_bnds'), &
735 call nf_verify(nf90_def_var(this%ncid,
'y_bnds', nf90_double, &
736 (/this%dim_ids%bnd, this%dim_ids%y/), &
737 this%var_ids%y_bnds), this%nc_fname)
740 call nf_verify(nf90_def_dim(this%ncid,
'x', this%dis%ncol, this%dim_ids%x), &
742 call nf_verify(nf90_def_var(this%ncid,
'x', nf90_double, this%dim_ids%x, &
743 this%var_ids%x), this%nc_fname)
744 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'units',
'm'), &
746 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'axis',
'X'), &
748 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'standard_name', &
749 'projection_x_coordinate'), this%nc_fname)
750 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'long_name', &
751 'Easting'), this%nc_fname)
752 if (this%ogc_wkt /=
'')
then
753 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'grid_mapping', &
754 this%gridmap_name), this%nc_fname)
756 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'bounds',
'x_bnds'), &
758 call nf_verify(nf90_def_var(this%ncid,
'x_bnds', nf90_double, &
759 (/this%dim_ids%bnd, this%dim_ids%x/), &
760 this%var_ids%x_bnds), this%nc_fname)
764 call nf_verify(nf90_def_dim(this%ncid,
'ncpl', &
765 this%dis%ncol * this%dis%nrow, &
766 this%dim_ids%ncpl), this%nc_fname)
775 call nf_verify(nf90_def_var(this%ncid, this%xname, nf90_double, &
776 (/this%dim_ids%x, this%dim_ids%y, &
777 this%dim_ids%z, this%dim_ids%time/), &
778 this%var_ids%dependent), &
781 if (this%chunking_active)
then
782 call nf_verify(nf90_def_var_chunking(this%ncid, &
783 this%var_ids%dependent, &
785 (/this%chunk_x, this%chunk_y, &
786 this%chunk_z, this%chunk_time/)), &
790 call ncvar_deflate(this%ncid, this%var_ids%dependent, this%deflate, &
791 this%shuffle, this%nc_fname)
794 call nf_verify(nf90_put_att(this%ncid, this%var_ids%dependent, &
795 'units',
'm'), this%nc_fname)
796 call nf_verify(nf90_put_att(this%ncid, this%var_ids%dependent, &
797 'standard_name', this%annotation%stdname), &
799 call nf_verify(nf90_put_att(this%ncid, this%var_ids%dependent,
'long_name', &
800 this%annotation%longname), this%nc_fname)
801 call nf_verify(nf90_put_att(this%ncid, this%var_ids%dependent,
'_FillValue', &
805 call ncvar_gridmap(this%ncid, this%var_ids%dependent, this%gridmap_name, &
806 this%latlon, this%nc_fname)
813 integer(I4B) :: var_id
814 if (this%ogc_wkt /=
'')
then
815 call nf_verify(nf90_redef(this%ncid), this%nc_fname)
816 call nf_verify(nf90_def_var(this%ncid, this%gridmap_name, nf90_int, &
817 var_id), this%nc_fname)
819 call nf_verify(nf90_put_att(this%ncid, var_id,
'crs_wkt', this%ogc_wkt), &
821 call nf_verify(nf90_enddef(this%ncid), this%nc_fname)
822 call nf_verify(nf90_put_var(this%ncid, var_id, 1), &
831 if (this%latlon .and. this%ogc_wkt /=
'')
then
833 call nf_verify(nf90_def_var(this%ncid,
'lat', nf90_double, &
834 (/this%dim_ids%x, this%dim_ids%y/), &
835 this%var_ids%lat), this%nc_fname)
836 call nf_verify(nf90_put_att(this%ncid, this%var_ids%lat,
'units', &
837 'degrees_north'), this%nc_fname)
838 call nf_verify(nf90_put_att(this%ncid, this%var_ids%lat,
'standard_name', &
839 'latitude'), this%nc_fname)
840 call nf_verify(nf90_put_att(this%ncid, this%var_ids%lat,
'long_name', &
841 'latitude'), this%nc_fname)
844 call nf_verify(nf90_def_var(this%ncid,
'lon', nf90_double, &
845 (/this%dim_ids%x, this%dim_ids%y/), &
846 this%var_ids%lon), this%nc_fname)
847 call nf_verify(nf90_put_att(this%ncid, this%var_ids%lon,
'units', &
848 'degrees_east'), this%nc_fname)
849 call nf_verify(nf90_put_att(this%ncid, this%var_ids%lon,
'standard_name', &
850 'longitude'), this%nc_fname)
851 call nf_verify(nf90_put_att(this%ncid, this%var_ids%lon,
'long_name', &
852 'longitude'), this%nc_fname)
860 if (this%latlon .and. this%ogc_wkt /=
'')
then
863 call nf_verify(nf90_put_var(this%ncid, this%var_ids%lat, &
864 this%lat, start=(/1, 1/), &
865 count=(/this%dis%ncol, this%dis%nrow/)), &
869 call nf_verify(nf90_put_var(this%ncid, this%var_ids%lon, &
870 this%lon, start=(/1, 1/), &
871 count=(/this%dis%ncol, this%dis%nrow/)), &
880 integer(I4B) :: ibnd, n
881 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
882 real(DP),
dimension(:),
allocatable :: x, y
884 allocate (x(
size(this%dis%cellx)))
885 allocate (y(
size(this%dis%celly)))
887 do n = 1,
size(this%dis%cellx)
888 x(n) = this%dis%cellx(n) + this%dis%xorigin
891 do n = 1,
size(this%dis%celly)
892 y(n) = this%dis%celly(n) + this%dis%yorigin
895 call nf_verify(nf90_put_var(this%ncid, this%var_ids%x, x), &
897 call nf_verify(nf90_put_var(this%ncid, this%var_ids%y, y), &
900 call nf_verify(nf90_put_var(this%ncid, this%var_ids%z, this%layers), &
908 allocate (dbl2d(2,
size(this%dis%cellx)))
910 do n = 1,
size(this%dis%cellx)
912 dbl2d(1, ibnd) = this%dis%xorigin
913 dbl2d(2, ibnd) = this%dis%xorigin + this%dis%delr(ibnd)
915 dbl2d(1, ibnd) = dbl2d(1, ibnd - 1) + this%dis%delr(ibnd)
916 dbl2d(2, ibnd) = dbl2d(2, ibnd - 1) + this%dis%delr(ibnd)
920 call nf_verify(nf90_put_var(this%ncid, this%var_ids%x_bnds, dbl2d), &
925 allocate (dbl2d(2,
size(this%dis%celly)))
927 do n =
size(this%dis%celly), 1, -1
929 dbl2d(1, ibnd) = this%dis%yorigin + sum(this%dis%delc) - this%dis%delc(n)
930 dbl2d(2, ibnd) = this%dis%yorigin + sum(this%dis%delc)
932 dbl2d(1, ibnd) = dbl2d(1, ibnd - 1) - this%dis%delc(n)
933 dbl2d(2, ibnd) = dbl2d(2, ibnd - 1) - this%dis%delc(n)
937 call nf_verify(nf90_put_var(this%ncid, this%var_ids%y_bnds, dbl2d), &
945 integer(I4B),
intent(in) :: ncid
946 integer(I4B),
intent(in) :: varid
947 integer(I4B),
intent(in) :: chunk_x
948 integer(I4B),
intent(in) :: chunk_y
949 character(len=*),
intent(in) :: nc_fname
951 if (chunk_y > 0 .and. chunk_x > 0)
then
952 call nf_verify(nf90_def_var_chunking(ncid, varid, nf90_chunked, &
953 (/chunk_x, chunk_y/)), nc_fname)
960 integer(I4B),
intent(in) :: ncid
961 integer(I4B),
intent(in) :: varid
962 integer(I4B),
intent(in) :: chunk_x
963 integer(I4B),
intent(in) :: chunk_y
964 integer(I4B),
intent(in) :: chunk_z
965 character(len=*),
intent(in) :: nc_fname
967 if (chunk_z > 0 .and. chunk_y > 0 .and. chunk_x > 0)
then
968 call nf_verify(nf90_def_var_chunking(ncid, varid, nf90_chunked, &
969 (/chunk_x, chunk_y, chunk_z/)), &
977 integer(I4B),
intent(in) :: ncid
978 integer(I4B),
intent(in) :: varid
979 integer(I4B),
intent(in) :: deflate
980 integer(I4B),
intent(in) :: shuffle
981 character(len=*),
intent(in) :: nc_fname
983 if (deflate >= 0)
then
984 call nf_verify(nf90_def_var_deflate(ncid, varid, shuffle=shuffle, &
985 deflate=1, deflate_level=deflate), &
993 integer(I4B),
intent(in) :: ncid
994 integer(I4B),
intent(in) :: varid
995 character(len=*),
intent(in) :: gridmap_name
996 logical(LGP),
intent(in) :: latlon
997 character(len=*),
intent(in) :: nc_fname
999 if (gridmap_name /=
'')
then
1001 call nf_verify(nf90_put_att(ncid, varid,
'coordinates',
'lon lat'), &
1004 call nf_verify(nf90_put_att(ncid, varid,
'coordinates',
'x y'), &
1007 call nf_verify(nf90_put_att(ncid, varid,
'grid_mapping', gridmap_name), &
1015 integer(I4B),
intent(in) :: ncid
1016 integer(I4B),
intent(in) :: varid
1017 integer(I4B),
intent(in) :: iper
1018 integer(I4B),
intent(in) :: iaux
1019 character(len=*),
intent(in) :: nc_tag
1020 character(len=*),
intent(in) :: nc_fname
1022 if (nc_tag /=
'')
then
1023 call nf_verify(nf90_put_att(ncid, varid,
'modflow6_input', &
1026 call nf_verify(nf90_put_att(ncid, varid,
'modflow6_iper', &
1031 call nf_verify(nf90_put_att(ncid, varid,
'modflow6_iaux', &
1040 pkgname, tagname, shapestr, longname, nc_tag, &
1041 gridmap_name, latlon, deflate, shuffle, chunk_z, &
1042 chunk_y, chunk_x, iper, nc_fname)
1043 integer(I4B),
intent(in) :: ncid
1046 type(
distype),
pointer,
intent(in) :: dis
1047 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(in) :: p_mem
1048 character(len=*),
intent(in) :: nc_varname
1049 character(len=*),
intent(in) :: pkgname
1050 character(len=*),
intent(in) :: tagname
1051 character(len=*),
intent(in) :: shapestr
1052 character(len=*),
intent(in) :: longname
1053 character(len=*),
intent(in) :: nc_tag
1054 character(len=*),
intent(in) :: gridmap_name
1055 logical(LGP),
intent(in) :: latlon
1056 integer(I4B),
intent(in) :: deflate
1057 integer(I4B),
intent(in) :: shuffle
1058 integer(I4B),
intent(in) :: chunk_z
1059 integer(I4B),
intent(in) :: chunk_y
1060 integer(I4B),
intent(in) :: chunk_x
1061 integer(I4B),
intent(in) :: iper
1062 character(len=*),
intent(in) :: nc_fname
1064 integer(I4B) :: var_id, axis_sz
1065 character(len=LINELENGTH) :: longname_l
1067 if (shapestr ==
'NROW' .or. &
1068 shapestr ==
'NCOL' .or. &
1069 shapestr ==
'NCPL')
then
1071 select case (shapestr)
1077 axis_sz = dim_ids%ncpl
1080 longname_l =
export_longname(longname, pkgname, tagname, layer=0, iper=iper)
1083 call nf_verify(nf90_redef(ncid), nc_fname)
1084 call nf_verify(nf90_def_var(ncid, nc_varname, nf90_int, &
1085 (/axis_sz/), var_id), &
1089 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1092 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1093 (/nf90_fill_int/)), nc_fname)
1094 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1095 longname_l), nc_fname)
1101 call nf_verify(nf90_enddef(ncid), nc_fname)
1102 call nf_verify(nf90_put_var(ncid, var_id, p_mem), &
1108 call nf_verify(nf90_redef(ncid), nc_fname)
1109 call nf_verify(nf90_def_var(ncid, nc_varname, nf90_int, &
1110 (/dim_ids%x, dim_ids%y, dim_ids%z/), var_id), &
1114 call ncvar_chunk3d(ncid, var_id, chunk_x, chunk_y, chunk_z, nc_fname)
1116 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1119 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1120 (/nf90_fill_int/)), nc_fname)
1121 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1122 longname), nc_fname)
1125 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1129 call nf_verify(nf90_enddef(ncid), nc_fname)
1130 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1, 1/), &
1131 count=(/dis%ncol, dis%nrow, dis%nlay/)), &
1139 pkgname, tagname, shapestr, longname, nc_tag, &
1140 gridmap_name, latlon, deflate, shuffle, chunk_z, &
1141 chunk_y, chunk_x, nc_fname)
1142 integer(I4B),
intent(in) :: ncid
1145 type(
distype),
pointer,
intent(in) :: dis
1146 integer(I4B),
dimension(:, :),
pointer,
contiguous,
intent(in) :: p_mem
1147 character(len=*),
intent(in) :: nc_varname
1148 character(len=*),
intent(in) :: pkgname
1149 character(len=*),
intent(in) :: tagname
1150 character(len=*),
intent(in) :: shapestr
1151 character(len=*),
intent(in) :: longname
1152 character(len=*),
intent(in) :: nc_tag
1153 character(len=*),
intent(in) :: gridmap_name
1154 logical(LGP),
intent(in) :: latlon
1155 integer(I4B),
intent(in) :: deflate
1156 integer(I4B),
intent(in) :: shuffle
1157 integer(I4B),
intent(in) :: chunk_z
1158 integer(I4B),
intent(in) :: chunk_y
1159 integer(I4B),
intent(in) :: chunk_x
1160 character(len=*),
intent(in) :: nc_fname
1162 integer(I4B) :: var_id
1165 call nf_verify(nf90_redef(ncid), nc_fname)
1166 call nf_verify(nf90_def_var(ncid, nc_varname, nf90_int, &
1167 (/dim_ids%x, dim_ids%y/), var_id), &
1171 call ncvar_chunk2d(ncid, var_id, chunk_x, chunk_y, nc_fname)
1173 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1176 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1177 (/nf90_fill_int/)), nc_fname)
1178 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1179 longname), nc_fname)
1182 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1186 call nf_verify(nf90_enddef(ncid), nc_fname)
1187 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1/), &
1188 count=(/dis%ncol, dis%nrow/)), &
1195 pkgname, tagname, shapestr, longname, nc_tag, &
1196 gridmap_name, latlon, deflate, shuffle, chunk_z, &
1197 chunk_y, chunk_x, nc_fname)
1198 integer(I4B),
intent(in) :: ncid
1201 type(
distype),
pointer,
intent(in) :: dis
1202 integer(I4B),
dimension(:, :, :),
pointer,
contiguous,
intent(in) :: p_mem
1203 character(len=*),
intent(in) :: nc_varname
1204 character(len=*),
intent(in) :: pkgname
1205 character(len=*),
intent(in) :: tagname
1206 character(len=*),
intent(in) :: shapestr
1207 character(len=*),
intent(in) :: longname
1208 character(len=*),
intent(in) :: nc_tag
1209 character(len=*),
intent(in) :: gridmap_name
1210 logical(LGP),
intent(in) :: latlon
1211 integer(I4B),
intent(in) :: deflate
1212 integer(I4B),
intent(in) :: shuffle
1213 integer(I4B),
intent(in) :: chunk_z
1214 integer(I4B),
intent(in) :: chunk_y
1215 integer(I4B),
intent(in) :: chunk_x
1216 character(len=*),
intent(in) :: nc_fname
1218 integer(I4B) :: var_id
1221 call nf_verify(nf90_redef(ncid), nc_fname)
1222 call nf_verify(nf90_def_var(ncid, nc_varname, nf90_int, &
1223 (/dim_ids%x, dim_ids%y, dim_ids%z/), var_id), &
1227 call ncvar_chunk3d(ncid, var_id, chunk_x, chunk_y, chunk_z, nc_fname)
1229 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1232 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1233 (/nf90_fill_int/)), nc_fname)
1234 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1235 longname), nc_fname)
1238 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1242 call nf_verify(nf90_enddef(ncid), nc_fname)
1243 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1, 1/), &
1244 count=(/dis%ncol, dis%nrow, dis%nlay/)), &
1251 pkgname, tagname, shapestr, longname, nc_tag, &
1252 gridmap_name, latlon, deflate, shuffle, chunk_z, &
1253 chunk_y, chunk_x, iper, nc_fname)
1255 integer(I4B),
intent(in) :: ncid
1258 type(
distype),
pointer,
intent(in) :: dis
1259 real(DP),
dimension(:),
pointer,
contiguous,
intent(in) :: p_mem
1260 character(len=*),
intent(in) :: nc_varname
1261 character(len=*),
intent(in) :: pkgname
1262 character(len=*),
intent(in) :: tagname
1263 character(len=*),
intent(in) :: shapestr
1264 character(len=*),
intent(in) :: longname
1265 character(len=*),
intent(in) :: nc_tag
1266 character(len=*),
intent(in) :: gridmap_name
1267 logical(LGP),
intent(in) :: latlon
1268 integer(I4B),
intent(in) :: deflate
1269 integer(I4B),
intent(in) :: shuffle
1270 integer(I4B),
intent(in) :: chunk_z
1271 integer(I4B),
intent(in) :: chunk_y
1272 integer(I4B),
intent(in) :: chunk_x
1273 integer(I4B),
intent(in) :: iper
1274 character(len=*),
intent(in) :: nc_fname
1276 integer(I4B) :: var_id, axis_sz
1277 real(DP) :: fill_value
1278 character(len=LINELENGTH) :: longname_l
1280 if (shapestr ==
'NROW' .or. &
1281 shapestr ==
'NCOL' .or. &
1282 shapestr ==
'NCPL')
then
1284 select case (shapestr)
1290 axis_sz = dim_ids%ncpl
1294 call nf_verify(nf90_redef(ncid), nc_fname)
1295 call nf_verify(nf90_def_var(ncid, nc_varname, nf90_double, &
1296 (/axis_sz/), var_id), &
1300 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1303 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1304 (/nf90_fill_double/)), nc_fname)
1305 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1306 longname), nc_fname)
1312 call nf_verify(nf90_enddef(ncid), nc_fname)
1313 call nf_verify(nf90_put_var(ncid, var_id, p_mem), &
1321 fill_value = nf90_fill_double
1324 longname_l =
export_longname(longname, pkgname, tagname, layer=0, iper=iper)
1327 call nf_verify(nf90_redef(ncid), nc_fname)
1328 call nf_verify(nf90_def_var(ncid, nc_varname, nf90_double, &
1329 (/dim_ids%x, dim_ids%y, dim_ids%z/), var_id), &
1333 call ncvar_chunk3d(ncid, var_id, chunk_x, chunk_y, chunk_z, nc_fname)
1335 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1338 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1339 (/fill_value/)), nc_fname)
1340 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1341 longname_l), nc_fname)
1344 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1348 call nf_verify(nf90_enddef(ncid), nc_fname)
1349 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1, 1/), &
1350 count=(/dis%ncol, dis%nrow, dis%nlay/)), &
1358 pkgname, tagname, shapestr, longname, nc_tag, &
1359 gridmap_name, latlon, deflate, shuffle, chunk_z, &
1360 chunk_y, chunk_x, nc_fname)
1361 integer(I4B),
intent(in) :: ncid
1364 type(
distype),
pointer,
intent(in) :: dis
1365 real(DP),
dimension(:, :),
pointer,
contiguous,
intent(in) :: p_mem
1366 character(len=*),
intent(in) :: nc_varname
1367 character(len=*),
intent(in) :: pkgname
1368 character(len=*),
intent(in) :: tagname
1369 character(len=*),
intent(in) :: shapestr
1370 character(len=*),
intent(in) :: longname
1371 character(len=*),
intent(in) :: nc_tag
1372 character(len=*),
intent(in) :: gridmap_name
1373 logical(LGP),
intent(in) :: latlon
1374 integer(I4B),
intent(in) :: deflate
1375 integer(I4B),
intent(in) :: shuffle
1376 integer(I4B),
intent(in) :: chunk_z
1377 integer(I4B),
intent(in) :: chunk_y
1378 integer(I4B),
intent(in) :: chunk_x
1379 character(len=*),
intent(in) :: nc_fname
1381 integer(I4B) :: var_id
1384 call nf_verify(nf90_redef(ncid), nc_fname)
1385 call nf_verify(nf90_def_var(ncid, nc_varname, nf90_double, &
1386 (/dim_ids%x, dim_ids%y/), var_id), &
1390 call ncvar_chunk2d(ncid, var_id, chunk_x, chunk_y, nc_fname)
1392 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1395 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1396 (/nf90_fill_double/)), nc_fname)
1397 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1398 longname), nc_fname)
1401 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1405 call nf_verify(nf90_enddef(ncid), nc_fname)
1406 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1/), &
1407 count=(/dis%ncol, dis%nrow/)), &
1414 pkgname, tagname, shapestr, longname, nc_tag, &
1415 gridmap_name, latlon, deflate, shuffle, chunk_z, &
1416 chunk_y, chunk_x, iper, iaux, nc_fname)
1418 integer(I4B),
intent(in) :: ncid
1421 type(
distype),
pointer,
intent(in) :: dis
1422 real(DP),
dimension(:, :, :),
pointer,
contiguous,
intent(in) :: p_mem
1423 character(len=*),
intent(in) :: nc_varname
1424 character(len=*),
intent(in) :: pkgname
1425 character(len=*),
intent(in) :: tagname
1426 character(len=*),
intent(in) :: shapestr
1427 character(len=*),
intent(in) :: longname
1428 character(len=*),
intent(in) :: nc_tag
1429 character(len=*),
intent(in) :: gridmap_name
1430 logical(LGP),
intent(in) :: latlon
1431 integer(I4B),
intent(in) :: deflate
1432 integer(I4B),
intent(in) :: shuffle
1433 integer(I4B),
intent(in) :: chunk_z
1434 integer(I4B),
intent(in) :: chunk_y
1435 integer(I4B),
intent(in) :: chunk_x
1436 integer(I4B),
intent(in) :: iper
1437 integer(I4B),
intent(in) :: iaux
1438 character(len=*),
intent(in) :: nc_fname
1440 integer(I4B) :: var_id
1441 real(DP) :: fill_value
1442 character(len=LINELENGTH) :: longname_l
1447 fill_value = nf90_fill_double
1450 longname_l =
export_longname(longname, pkgname, tagname, layer=0, iper=iper)
1453 call nf_verify(nf90_redef(ncid), nc_fname)
1454 call nf_verify(nf90_def_var(ncid, nc_varname, nf90_double, &
1455 (/dim_ids%x, dim_ids%y, dim_ids%z/), var_id), &
1459 call ncvar_chunk3d(ncid, var_id, chunk_x, chunk_y, chunk_z, nc_fname)
1461 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1464 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1465 (/fill_value/)), nc_fname)
1466 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1467 longname_l), nc_fname)
1470 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1471 call ncvar_mf6attr(ncid, var_id, iper, iaux, nc_tag, nc_fname)
1474 call nf_verify(nf90_enddef(ncid), nc_fname)
1475 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1, 1/), &
1476 count=(/dis%ncol, dis%nrow, dis%nlay/)), &
1484 character(len=*),
intent(in) :: pkgname
1486 integer(I4B),
optional,
intent(in) :: iper
1487 integer(I4B),
optional,
intent(in) :: iaux
1488 character(len=LINELENGTH) :: varname
1489 character(len=LINELENGTH) :: pname, vname
1492 vname = idt%mf6varname
1495 if (
present(iper))
then
1496 if (
present(iaux))
then
1497 write (varname,
'(a,i0,a,i0)') trim(pname)//
'_'//trim(vname)// &
1498 '_p', iper,
'a', iaux
1500 write (varname,
'(a,i0)') trim(pname)//
'_'//trim(vname)//
'_p', iper
1503 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 dis_export_init(this, modelname, modeltype, modelfname, disenum, nctype, iout)
netcdf export dis init
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 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