42 integer(I4B) :: dependent
43 integer(I4B) :: x_bnds
44 integer(I4B) :: y_bnds
45 integer(I4B) :: z_bnds
46 integer(I4B) :: latitude
47 integer(I4B) :: longitude
56 real(dp),
dimension(:),
pointer,
contiguous :: latitude => null()
57 real(dp),
dimension(:),
pointer,
contiguous :: longitude => 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.
139 else if (this%chunk_time > 0 .or. this%chunk_z > 0 .or. &
140 this%chunk_y > 0 .or. this%chunk_x > 0)
then
145 write (
warnmsg,
'(a)')
'Ignoring user provided NetCDF chunking &
146 ¶meters. Define chunk_time, chunk_x, chunk_y and chunk_z input &
147 ¶meters to see an effect.'
151 call get_isize(
'LATITUDE', this%ncf_mempath, latsz)
152 call get_isize(
'LONGITUDE', this%ncf_mempath, lonsz)
154 if (latsz > 0 .and. lonsz > 0)
then
156 call mem_setptr(this%latitude,
'LATITUDE', this%ncf_mempath)
157 call mem_setptr(this%longitude,
'LONGITUDE', this%ncf_mempath)
162 call nf_verify(nf90_create(this%nc_fname, &
163 ior(nf90_clobber, nf90_netcdf4), this%ncid), &
171 call nf_verify(nf90_close(this%ncid), this%nc_fname)
172 deallocate (this%chunk_z)
173 deallocate (this%chunk_y)
174 deallocate (this%chunk_x)
175 deallocate (this%layers)
176 nullify (this%chunk_z)
177 nullify (this%chunk_y)
178 nullify (this%chunk_x)
180 call this%NCModelExportType%destroy()
190 call this%add_global_att()
192 call this%define_dim()
194 call this%define_projection()
197 call this%define_dependent()
200 call nf_verify(nf90_enddef(this%ncid), this%nc_fname)
202 call this%add_grid_data()
204 call this%add_proj_data()
206 call this%add_pkg_data()
208 call this%define_gridmap()
210 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
219 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
222 this%stepcnt = this%stepcnt + 1
224 if (
size(this%dis%nodeuser) < &
225 size(this%dis%nodereduced))
then
226 allocate (dbl1d(
size(this%dis%nodereduced)))
228 do n = 1,
size(this%dis%nodereduced)
229 if (this%dis%nodereduced(n) > 0)
then
230 dbl1d(n) = this%x(this%dis%nodereduced(n))
235 this%var_ids%dependent, dbl1d, &
236 start=(/1, 1, 1, this%stepcnt/), &
237 count=(/this%dis%ncol, &
239 this%dis%nlay, 1/)), &
245 this%var_ids%dependent, this%x, &
246 start=(/1, 1, 1, this%stepcnt/), &
247 count=(/this%dis%ncol, &
249 this%dis%nlay, 1/)), &
254 call nf_verify(nf90_put_var(this%ncid, this%var_ids%time, &
255 totim, start=(/this%stepcnt/)), &
259 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
266 character(len=*),
intent(in) :: pkgtype
267 character(len=*),
intent(in) :: pkgname
268 character(len=*),
intent(in) :: mempath
270 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
271 integer(I4B),
dimension(:, :),
pointer,
contiguous :: int2d
272 integer(I4B),
dimension(:, :, :),
pointer,
contiguous :: int3d
273 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
274 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
275 real(DP),
dimension(:, :, :),
pointer,
contiguous :: dbl3d
276 character(len=LINELENGTH) :: nc_varname, input_attr
277 integer(I4B) :: iper, iaux
285 input_attr = this%input_attribute(pkgname, idt)
287 select case (idt%datatype)
289 call mem_setptr(int1d, idt%mf6varname, mempath)
290 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, &
291 int1d, nc_varname, pkgname, idt%tagname, &
292 idt%shape, idt%longname, input_attr, &
293 this%gridmap_name, this%latlon, this%deflate, &
294 this%shuffle, this%chunk_z, this%chunk_y, &
295 this%chunk_x, iper, this%nc_fname)
297 call mem_setptr(int2d, idt%mf6varname, mempath)
298 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, &
299 int2d, nc_varname, pkgname, idt%tagname, &
300 idt%shape, idt%longname, input_attr, &
301 this%gridmap_name, this%latlon, this%deflate, &
302 this%shuffle, this%chunk_z, this%chunk_y, &
303 this%chunk_x, this%nc_fname)
305 call mem_setptr(int3d, idt%mf6varname, mempath)
306 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, &
307 int3d, nc_varname, pkgname, idt%tagname, &
308 idt%shape, idt%longname, input_attr, &
309 this%gridmap_name, this%latlon, this%deflate, &
310 this%shuffle, this%chunk_z, this%chunk_y, &
311 this%chunk_x, this%nc_fname)
313 call mem_setptr(dbl1d, idt%mf6varname, mempath)
314 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, &
315 dbl1d, nc_varname, pkgname, idt%tagname, &
316 idt%shape, idt%longname, input_attr, &
317 this%gridmap_name, this%latlon, this%deflate, &
318 this%shuffle, this%chunk_z, this%chunk_y, &
319 this%chunk_x, iper, this%nc_fname)
321 call mem_setptr(dbl2d, idt%mf6varname, mempath)
322 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, &
323 dbl2d, nc_varname, pkgname, idt%tagname, &
324 idt%shape, idt%longname, input_attr, &
325 this%gridmap_name, this%latlon, this%deflate, &
326 this%shuffle, this%chunk_z, this%chunk_y, &
327 this%chunk_x, this%nc_fname)
329 call mem_setptr(dbl3d, idt%mf6varname, mempath)
330 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, &
331 dbl3d, nc_varname, pkgname, idt%tagname, &
332 idt%shape, idt%longname, input_attr, &
333 this%gridmap_name, this%latlon, this%deflate, &
334 this%shuffle, this%chunk_z, this%chunk_y, &
335 this%chunk_x, iper, iaux, this%nc_fname)
346 character(len=*),
intent(in) :: pkgtype
347 character(len=*),
intent(in) :: pkgname
348 character(len=*),
intent(in) :: mempath
350 intent(in) :: param_dfns
352 integer(I4B) :: iparam, isize
353 do iparam = 1,
size(param_dfns)
355 idt => param_dfns(iparam)
357 if (idt%blockname ==
'GRIDDATA')
then
359 call get_isize(idt%mf6varname, mempath, isize)
361 call this%export_input_array(pkgtype, pkgname, mempath, idt)
376 character(len=*),
intent(in) :: ilayer_varname
377 integer(I4B),
intent(in) :: ilayer
379 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
380 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
381 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
382 integer(I4B),
dimension(:),
pointer,
contiguous :: ialayer
383 real(DP),
dimension(:),
contiguous,
pointer :: dbl1d_ptr
384 character(len=LINELENGTH) :: nc_varname, input_attr
385 integer(I4B) :: n, iparam, nvals
386 logical(LGP) :: ilayer_read
390 ilayer_read = .false.
393 call mem_setptr(ialayer, export_pkg%param_names(ilayer), &
394 export_pkg%mf6_input%mempath)
397 if (export_pkg%param_reads(ilayer)%invar == 1)
then
402 do iparam = 1, export_pkg%nparam
404 if (export_pkg%param_reads(iparam)%invar < 1) cycle
409 export_pkg%mf6_input%component_type, &
410 export_pkg%mf6_input%subcomponent_type, &
411 'PERIOD', export_pkg%param_names(iparam), &
414 nc_varname =
export_varname(export_pkg%mf6_input%subcomponent_name, idt, &
416 input_attr = this%input_attribute(export_pkg%mf6_input%subcomponent_name, &
419 select case (idt%datatype)
421 call mem_setptr(int1d, idt%mf6varname, export_pkg%mf6_input%mempath)
422 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, &
424 export_pkg%mf6_input%subcomponent_name, &
425 idt%tagname, idt%shape, idt%longname, input_attr, &
426 this%gridmap_name, this%latlon, this%deflate, &
427 this%shuffle, this%chunk_z, this%chunk_y, &
428 this%chunk_x, export_pkg%iper, this%nc_fname)
430 call mem_setptr(dbl1d, idt%mf6varname, export_pkg%mf6_input%mempath)
431 call this%export_layer_3d(export_pkg, idt, ilayer_read, ialayer, &
432 dbl1d, nc_varname, input_attr)
434 call mem_setptr(dbl2d, idt%mf6varname, export_pkg%mf6_input%mempath)
435 nvals = this%dis%ncol * this%dis%nrow
436 do n = 1,
size(dbl2d, dim=1)
437 dbl1d_ptr(1:nvals) => dbl2d(n, :)
438 if (all(dbl1d_ptr ==
dzero))
then
440 call this%export_layer_3d(export_pkg, idt, ilayer_read, ialayer, &
441 dbl1d_ptr, nc_varname, input_attr, n)
445 errmsg =
'EXPORT ilayer unsupported datatype='//trim(idt%datatype)
451 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
462 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
463 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
465 character(len=LINELENGTH) :: nc_varname, input_attr
466 integer(I4B) :: iparam
468 do iparam = 1, export_pkg%nparam
471 export_pkg%mf6_input%component_type, &
472 export_pkg%mf6_input%subcomponent_type, &
473 'PERIOD', export_pkg%param_names(iparam), &
477 nc_varname =
export_varname(export_pkg%mf6_input%subcomponent_name, idt, &
479 input_attr = this%input_attribute(export_pkg%mf6_input%subcomponent_name, &
483 select case (idt%datatype)
485 call mem_setptr(int1d, 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 call mem_setptr(dbl1d, export_pkg%param_names(iparam), &
496 export_pkg%mf6_input%mempath)
497 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, &
499 export_pkg%mf6_input%subcomponent_name, &
500 idt%tagname, idt%shape, idt%longname, input_attr, &
501 this%gridmap_name, this%latlon, this%deflate, &
502 this%shuffle, this%chunk_z, this%chunk_y, &
503 this%chunk_x,
kper, this%nc_fname)
505 errmsg =
'EXPORT unsupported datatype='//trim(idt%datatype)
511 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
517 dbl1d, nc_varname, input_attr, iaux)
524 logical(LGP),
intent(in) :: ilayer_read
525 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(in) :: ialayer
526 real(DP),
dimension(:),
pointer,
contiguous,
intent(in) :: dbl1d
527 character(len=*),
intent(inout) :: nc_varname
528 character(len=*),
intent(in) :: input_attr
529 integer(I4B),
optional,
intent(in) :: iaux
530 real(DP),
dimension(:, :, :),
pointer,
contiguous :: dbl3d
531 integer(I4B) :: n, i, j, k, nvals, idxaux
532 real(DP),
dimension(:, :),
contiguous,
pointer :: dbl2d_ptr
536 if (
present(iaux))
then
537 nc_varname =
export_varname(export_pkg%mf6_input%subcomponent_name, &
538 idt, iper=
kper, iaux=iaux)
542 allocate (dbl3d(export_pkg%mshape(3), export_pkg%mshape(2), &
543 export_pkg%mshape(1)))
545 if (ilayer_read)
then
546 do k = 1,
size(dbl3d, dim=3)
548 do i = 1,
size(dbl3d, dim=2)
549 do j = 1,
size(dbl3d, dim=1)
551 if (ialayer(n) == k)
then
552 dbl3d(j, i, k) = dbl1d(n)
561 nvals = export_pkg%mshape(3) * export_pkg%mshape(2)
562 dbl2d_ptr(1:export_pkg%mshape(3), 1:export_pkg%mshape(2)) => dbl1d(1:nvals)
563 dbl3d(:, :, 1) = dbl2d_ptr(:, :)
566 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, dbl3d, &
567 nc_varname, export_pkg%mf6_input%subcomponent_name, &
568 idt%tagname, idt%shape, idt%longname, input_attr, &
569 this%gridmap_name, this%latlon, this%deflate, &
570 this%shuffle, this%chunk_z, this%chunk_y, this%chunk_x, &
571 export_pkg%iper, idxaux, this%nc_fname)
585 character(LENCOMPONENTNAME) :: ptype, pname, pkgtype
587 pointer :: pkgtypes => null()
589 pointer :: pkgnames => null()
591 pointer :: mempaths => null()
593 character(len=LENMEMPATH) :: input_mempath, mempath
595 integer(I4B),
pointer :: export_arrays
596 logical(LGP) :: found
601 call mem_setptr(pkgtypes,
'PKGTYPES', input_mempath)
602 call mem_setptr(pkgnames,
'PKGNAMES', input_mempath)
603 call mem_setptr(mempaths,
'MEMPATHS', input_mempath)
605 do n = 1,
size(mempaths)
607 allocate (export_arrays)
611 mempath = mempaths(n)
616 if (mempath /=
'')
then
618 call mem_set_value(export_arrays,
'EXPORT_NC', mempath, found)
620 if (export_arrays > 0)
then
623 call this%export_input_arrays(ptype, pname, mempath, param_dfns)
628 deallocate (export_arrays)
637 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'title', &
638 this%annotation%title), this%nc_fname)
640 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'source', &
641 this%annotation%source), this%nc_fname)
643 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'modflow6_grid', &
644 this%annotation%grid), this%nc_fname)
646 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'modflow6_model', &
647 this%annotation%model), this%nc_fname)
649 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'history', &
650 this%annotation%history), this%nc_fname)
652 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'Conventions', &
653 this%annotation%conventions), &
665 call nf_verify(nf90_def_dim(this%ncid,
'bnd', 2, this%dim_ids%bnd), &
670 call nf_verify(nf90_def_dim(this%ncid,
'time', this%totnstp, &
671 this%dim_ids%time), this%nc_fname)
672 call nf_verify(nf90_def_var(this%ncid,
'time', nf90_double, &
673 this%dim_ids%time, this%var_ids%time), &
675 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'calendar', &
676 'standard'), this%nc_fname)
677 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'units', &
678 this%datetime), this%nc_fname)
679 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'axis',
'T'), &
682 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'standard_name', &
683 'time'), this%nc_fname)
684 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'long_name', &
685 'time'), this%nc_fname)
689 call nf_verify(nf90_def_dim(this%ncid,
'z', this%dis%nlay, this%dim_ids%z), &
691 call nf_verify(nf90_def_var(this%ncid,
'z', nf90_double, this%dim_ids%z, &
692 this%var_ids%z), this%nc_fname)
693 call nf_verify(nf90_put_att(this%ncid, this%var_ids%z,
'units',
'layer'), &
695 call nf_verify(nf90_put_att(this%ncid, this%var_ids%z,
'long_name', &
696 'layer number'), this%nc_fname)
706 call nf_verify(nf90_def_dim(this%ncid,
'y', this%dis%nrow, this%dim_ids%y), &
708 call nf_verify(nf90_def_var(this%ncid,
'y', nf90_double, this%dim_ids%y, &
709 this%var_ids%y), this%nc_fname)
710 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'units',
'm'), &
712 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'axis',
'Y'), &
714 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'standard_name', &
715 'projection_y_coordinate'), this%nc_fname)
716 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'long_name', &
717 'Northing'), this%nc_fname)
718 if (this%wkt /=
'')
then
719 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'grid_mapping', &
720 this%gridmap_name), this%nc_fname)
722 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'bounds',
'y_bnds'), &
724 call nf_verify(nf90_def_var(this%ncid,
'y_bnds', nf90_double, &
725 (/this%dim_ids%bnd, this%dim_ids%y/), &
726 this%var_ids%y_bnds), this%nc_fname)
729 call nf_verify(nf90_def_dim(this%ncid,
'x', this%dis%ncol, this%dim_ids%x), &
731 call nf_verify(nf90_def_var(this%ncid,
'x', nf90_double, this%dim_ids%x, &
732 this%var_ids%x), this%nc_fname)
733 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'units',
'm'), &
735 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'axis',
'X'), &
737 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'standard_name', &
738 'projection_x_coordinate'), this%nc_fname)
739 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'long_name', &
740 'Easting'), this%nc_fname)
741 if (this%wkt /=
'')
then
742 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'grid_mapping', &
743 this%gridmap_name), this%nc_fname)
745 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'bounds',
'x_bnds'), &
747 call nf_verify(nf90_def_var(this%ncid,
'x_bnds', nf90_double, &
748 (/this%dim_ids%bnd, this%dim_ids%x/), &
749 this%var_ids%x_bnds), this%nc_fname)
752 call nf_verify(nf90_def_dim(this%ncid,
'ncpl', &
753 this%dis%ncol * this%dis%nrow, &
754 this%dim_ids%ncpl), this%nc_fname)
763 call nf_verify(nf90_def_var(this%ncid, this%xname, nf90_double, &
764 (/this%dim_ids%x, this%dim_ids%y, &
765 this%dim_ids%z, this%dim_ids%time/), &
766 this%var_ids%dependent), &
770 if (this%chunking_active)
then
771 call nf_verify(nf90_def_var_chunking(this%ncid, &
772 this%var_ids%dependent, &
774 (/this%chunk_x, this%chunk_y, &
775 this%chunk_z, this%chunk_time/)), &
780 call ncvar_deflate(this%ncid, this%var_ids%dependent, this%deflate, &
781 this%shuffle, this%nc_fname)
784 call nf_verify(nf90_put_att(this%ncid, this%var_ids%dependent, &
785 'units',
'm'), this%nc_fname)
786 call nf_verify(nf90_put_att(this%ncid, this%var_ids%dependent, &
787 'standard_name', this%annotation%stdname), &
789 call nf_verify(nf90_put_att(this%ncid, this%var_ids%dependent,
'long_name', &
790 this%annotation%longname), this%nc_fname)
791 call nf_verify(nf90_put_att(this%ncid, this%var_ids%dependent,
'_FillValue', &
795 call ncvar_gridmap(this%ncid, this%var_ids%dependent, this%gridmap_name, &
796 this%latlon, this%nc_fname)
803 integer(I4B) :: var_id
804 if (this%wkt /=
'')
then
805 call nf_verify(nf90_redef(this%ncid), this%nc_fname)
806 call nf_verify(nf90_def_var(this%ncid, this%gridmap_name, nf90_int, &
807 var_id), this%nc_fname)
809 call nf_verify(nf90_put_att(this%ncid, var_id,
'crs_wkt', this%wkt), &
811 call nf_verify(nf90_enddef(this%ncid), this%nc_fname)
812 call nf_verify(nf90_put_var(this%ncid, var_id, 1), &
821 if (this%latlon .and. this%wkt /=
'')
then
823 call nf_verify(nf90_def_var(this%ncid,
'lat', nf90_double, &
824 (/this%dim_ids%x, this%dim_ids%y/), &
825 this%var_ids%latitude), this%nc_fname)
826 call nf_verify(nf90_put_att(this%ncid, this%var_ids%latitude, &
827 'units',
'degrees_north'), this%nc_fname)
828 call nf_verify(nf90_put_att(this%ncid, this%var_ids%latitude, &
829 'standard_name',
'latitude'), this%nc_fname)
830 call nf_verify(nf90_put_att(this%ncid, this%var_ids%latitude, &
831 'long_name',
'latitude'), this%nc_fname)
834 call nf_verify(nf90_def_var(this%ncid,
'lon', nf90_double, &
835 (/this%dim_ids%x, this%dim_ids%y/), &
836 this%var_ids%longitude), this%nc_fname)
837 call nf_verify(nf90_put_att(this%ncid, this%var_ids%longitude, &
838 'units',
'degrees_east'), this%nc_fname)
839 call nf_verify(nf90_put_att(this%ncid, this%var_ids%longitude, &
840 'standard_name',
'longitude'), this%nc_fname)
841 call nf_verify(nf90_put_att(this%ncid, this%var_ids%longitude, &
842 'long_name',
'longitude'), this%nc_fname)
850 if (this%latlon .and. this%wkt /=
'')
then
852 call nf_verify(nf90_put_var(this%ncid, this%var_ids%latitude, &
853 this%latitude, start=(/1, 1/), &
854 count=(/this%dis%ncol, this%dis%nrow/)), &
858 call nf_verify(nf90_put_var(this%ncid, this%var_ids%longitude, &
859 this%longitude, start=(/1, 1/), &
860 count=(/this%dis%ncol, this%dis%nrow/)), &
869 integer(I4B) :: ibnd, n
870 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
871 real(DP),
dimension(:),
allocatable :: x, y
873 allocate (x(
size(this%dis%cellx)))
874 allocate (y(
size(this%dis%celly)))
876 do n = 1,
size(this%dis%cellx)
877 x(n) = this%dis%cellx(n) + this%dis%xorigin
880 do n = 1,
size(this%dis%celly)
881 y(n) = this%dis%celly(n) + this%dis%yorigin
884 call nf_verify(nf90_put_var(this%ncid, this%var_ids%x, x), &
886 call nf_verify(nf90_put_var(this%ncid, this%var_ids%y, y), &
889 call nf_verify(nf90_put_var(this%ncid, this%var_ids%z, this%layers), &
896 allocate (dbl2d(2,
size(this%dis%cellx)))
898 do n = 1,
size(this%dis%cellx)
900 dbl2d(1, ibnd) = this%dis%xorigin
901 dbl2d(2, ibnd) = this%dis%xorigin + this%dis%delr(ibnd)
903 dbl2d(1, ibnd) = dbl2d(1, ibnd - 1) + this%dis%delr(ibnd)
904 dbl2d(2, ibnd) = dbl2d(2, ibnd - 1) + this%dis%delr(ibnd)
908 call nf_verify(nf90_put_var(this%ncid, this%var_ids%x_bnds, dbl2d), &
913 allocate (dbl2d(2,
size(this%dis%celly)))
915 do n =
size(this%dis%celly), 1, -1
917 dbl2d(1, ibnd) = this%dis%yorigin + sum(this%dis%delc) - this%dis%delc(n)
918 dbl2d(2, ibnd) = this%dis%yorigin + sum(this%dis%delc)
920 dbl2d(1, ibnd) = dbl2d(1, ibnd - 1) - this%dis%delc(n)
921 dbl2d(2, ibnd) = dbl2d(2, ibnd - 1) - this%dis%delc(n)
925 call nf_verify(nf90_put_var(this%ncid, this%var_ids%y_bnds, dbl2d), &
933 integer(I4B),
intent(in) :: ncid
934 integer(I4B),
intent(in) :: varid
935 integer(I4B),
intent(in) :: chunk_x
936 integer(I4B),
intent(in) :: chunk_y
937 character(len=*),
intent(in) :: nc_fname
938 if (chunk_y > 0 .and. chunk_x > 0)
then
939 call nf_verify(nf90_def_var_chunking(ncid, varid, nf90_chunked, &
940 (/chunk_x, chunk_y/)), nc_fname)
947 integer(I4B),
intent(in) :: ncid
948 integer(I4B),
intent(in) :: varid
949 integer(I4B),
intent(in) :: chunk_x
950 integer(I4B),
intent(in) :: chunk_y
951 integer(I4B),
intent(in) :: chunk_z
952 character(len=*),
intent(in) :: nc_fname
953 if (chunk_z > 0 .and. chunk_y > 0 .and. chunk_x > 0)
then
954 call nf_verify(nf90_def_var_chunking(ncid, varid, nf90_chunked, &
955 (/chunk_x, chunk_y, chunk_z/)), &
963 integer(I4B),
intent(in) :: ncid
964 integer(I4B),
intent(in) :: varid
965 integer(I4B),
intent(in) :: deflate
966 integer(I4B),
intent(in) :: shuffle
967 character(len=*),
intent(in) :: nc_fname
969 if (deflate >= 0)
then
970 call nf_verify(nf90_def_var_deflate(ncid, varid, shuffle=shuffle, &
971 deflate=1, deflate_level=deflate), &
979 integer(I4B),
intent(in) :: ncid
980 integer(I4B),
intent(in) :: varid
981 character(len=*),
intent(in) :: gridmap_name
982 logical(LGP),
intent(in) :: latlon
983 character(len=*),
intent(in) :: nc_fname
984 if (gridmap_name /=
'')
then
986 call nf_verify(nf90_put_att(ncid, varid,
'coordinates',
'lon lat'), &
989 call nf_verify(nf90_put_att(ncid, varid,
'coordinates',
'x y'), &
992 call nf_verify(nf90_put_att(ncid, varid,
'grid_mapping', gridmap_name), &
1000 integer(I4B),
intent(in) :: ncid
1001 integer(I4B),
intent(in) :: varid
1002 integer(I4B),
intent(in) :: iper
1003 integer(I4B),
intent(in) :: iaux
1004 character(len=*),
intent(in) :: nc_tag
1005 character(len=*),
intent(in) :: nc_fname
1006 if (nc_tag /=
'')
then
1007 call nf_verify(nf90_put_att(ncid, varid,
'modflow6_input', &
1010 call nf_verify(nf90_put_att(ncid, varid,
'modflow6_iper', &
1014 call nf_verify(nf90_put_att(ncid, varid,
'modflow6_iaux', &
1023 pkgname, tagname, shapestr, longname, nc_tag, &
1024 gridmap_name, latlon, deflate, shuffle, chunk_z, &
1025 chunk_y, chunk_x, iper, nc_fname)
1026 integer(I4B),
intent(in) :: ncid
1029 type(
distype),
pointer,
intent(in) :: dis
1030 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(in) :: p_mem
1031 character(len=*),
intent(in) :: nc_varname
1032 character(len=*),
intent(in) :: pkgname
1033 character(len=*),
intent(in) :: tagname
1034 character(len=*),
intent(in) :: shapestr
1035 character(len=*),
intent(in) :: longname
1036 character(len=*),
intent(in) :: nc_tag
1037 character(len=*),
intent(in) :: gridmap_name
1038 logical(LGP),
intent(in) :: latlon
1039 integer(I4B),
intent(in) :: deflate
1040 integer(I4B),
intent(in) :: shuffle
1041 integer(I4B),
intent(in) :: chunk_z
1042 integer(I4B),
intent(in) :: chunk_y
1043 integer(I4B),
intent(in) :: chunk_x
1044 integer(I4B),
intent(in) :: iper
1045 character(len=*),
intent(in) :: nc_fname
1046 integer(I4B) :: var_id, axis_sz
1047 character(len=LINELENGTH) :: longname_l
1049 if (shapestr ==
'NROW' .or. &
1050 shapestr ==
'NCOL' .or. &
1051 shapestr ==
'NCPL')
then
1053 select case (shapestr)
1059 axis_sz = dim_ids%ncpl
1062 longname_l =
export_longname(longname, pkgname, tagname, layer=0, iper=iper)
1065 call nf_verify(nf90_redef(ncid), nc_fname)
1066 call nf_verify(nf90_def_var(ncid, nc_varname, nf90_int, &
1067 (/axis_sz/), var_id), &
1071 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1074 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1075 (/nf90_fill_int/)), nc_fname)
1076 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1077 longname_l), nc_fname)
1083 call nf_verify(nf90_enddef(ncid), nc_fname)
1084 call nf_verify(nf90_put_var(ncid, var_id, p_mem), &
1089 call nf_verify(nf90_redef(ncid), nc_fname)
1090 call nf_verify(nf90_def_var(ncid, nc_varname, nf90_int, &
1091 (/dim_ids%x, dim_ids%y, dim_ids%z/), var_id), &
1095 call ncvar_chunk3d(ncid, var_id, chunk_x, chunk_y, chunk_z, nc_fname)
1097 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1100 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1101 (/nf90_fill_int/)), nc_fname)
1102 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1103 longname), nc_fname)
1106 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1110 call nf_verify(nf90_enddef(ncid), nc_fname)
1111 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1, 1/), &
1112 count=(/dis%ncol, dis%nrow, dis%nlay/)), &
1120 pkgname, tagname, shapestr, longname, nc_tag, &
1121 gridmap_name, latlon, deflate, shuffle, chunk_z, &
1122 chunk_y, chunk_x, nc_fname)
1123 integer(I4B),
intent(in) :: ncid
1126 type(
distype),
pointer,
intent(in) :: dis
1127 integer(I4B),
dimension(:, :),
pointer,
contiguous,
intent(in) :: p_mem
1128 character(len=*),
intent(in) :: nc_varname
1129 character(len=*),
intent(in) :: pkgname
1130 character(len=*),
intent(in) :: tagname
1131 character(len=*),
intent(in) :: shapestr
1132 character(len=*),
intent(in) :: longname
1133 character(len=*),
intent(in) :: nc_tag
1134 character(len=*),
intent(in) :: gridmap_name
1135 logical(LGP),
intent(in) :: latlon
1136 integer(I4B),
intent(in) :: deflate
1137 integer(I4B),
intent(in) :: shuffle
1138 integer(I4B),
intent(in) :: chunk_z
1139 integer(I4B),
intent(in) :: chunk_y
1140 integer(I4B),
intent(in) :: chunk_x
1141 character(len=*),
intent(in) :: nc_fname
1142 integer(I4B) :: var_id
1145 call nf_verify(nf90_redef(ncid), nc_fname)
1146 call nf_verify(nf90_def_var(ncid, nc_varname, nf90_int, &
1147 (/dim_ids%x, dim_ids%y/), var_id), &
1151 call ncvar_chunk2d(ncid, var_id, chunk_x, chunk_y, nc_fname)
1153 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1156 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1157 (/nf90_fill_int/)), nc_fname)
1158 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1159 longname), nc_fname)
1162 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1166 call nf_verify(nf90_enddef(ncid), nc_fname)
1167 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1/), &
1168 count=(/dis%ncol, dis%nrow/)), &
1175 pkgname, tagname, shapestr, longname, nc_tag, &
1176 gridmap_name, latlon, deflate, shuffle, chunk_z, &
1177 chunk_y, chunk_x, nc_fname)
1178 integer(I4B),
intent(in) :: ncid
1181 type(
distype),
pointer,
intent(in) :: dis
1182 integer(I4B),
dimension(:, :, :),
pointer,
contiguous,
intent(in) :: p_mem
1183 character(len=*),
intent(in) :: nc_varname
1184 character(len=*),
intent(in) :: pkgname
1185 character(len=*),
intent(in) :: tagname
1186 character(len=*),
intent(in) :: shapestr
1187 character(len=*),
intent(in) :: longname
1188 character(len=*),
intent(in) :: nc_tag
1189 character(len=*),
intent(in) :: gridmap_name
1190 logical(LGP),
intent(in) :: latlon
1191 integer(I4B),
intent(in) :: deflate
1192 integer(I4B),
intent(in) :: shuffle
1193 integer(I4B),
intent(in) :: chunk_z
1194 integer(I4B),
intent(in) :: chunk_y
1195 integer(I4B),
intent(in) :: chunk_x
1196 character(len=*),
intent(in) :: nc_fname
1197 integer(I4B) :: var_id
1200 call nf_verify(nf90_redef(ncid), nc_fname)
1201 call nf_verify(nf90_def_var(ncid, nc_varname, nf90_int, &
1202 (/dim_ids%x, dim_ids%y, dim_ids%z/), var_id), &
1206 call ncvar_chunk3d(ncid, var_id, chunk_x, chunk_y, chunk_z, nc_fname)
1208 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1211 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1212 (/nf90_fill_int/)), nc_fname)
1213 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1214 longname), nc_fname)
1217 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1221 call nf_verify(nf90_enddef(ncid), nc_fname)
1222 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1, 1/), &
1223 count=(/dis%ncol, dis%nrow, dis%nlay/)), &
1230 pkgname, tagname, shapestr, longname, nc_tag, &
1231 gridmap_name, latlon, deflate, shuffle, chunk_z, &
1232 chunk_y, chunk_x, iper, nc_fname)
1234 integer(I4B),
intent(in) :: ncid
1237 type(
distype),
pointer,
intent(in) :: dis
1238 real(DP),
dimension(:),
pointer,
contiguous,
intent(in) :: p_mem
1239 character(len=*),
intent(in) :: nc_varname
1240 character(len=*),
intent(in) :: pkgname
1241 character(len=*),
intent(in) :: tagname
1242 character(len=*),
intent(in) :: shapestr
1243 character(len=*),
intent(in) :: longname
1244 character(len=*),
intent(in) :: nc_tag
1245 character(len=*),
intent(in) :: gridmap_name
1246 logical(LGP),
intent(in) :: latlon
1247 integer(I4B),
intent(in) :: deflate
1248 integer(I4B),
intent(in) :: shuffle
1249 integer(I4B),
intent(in) :: chunk_z
1250 integer(I4B),
intent(in) :: chunk_y
1251 integer(I4B),
intent(in) :: chunk_x
1252 integer(I4B),
intent(in) :: iper
1253 character(len=*),
intent(in) :: nc_fname
1254 integer(I4B) :: var_id, axis_sz
1255 real(DP) :: fill_value
1256 character(len=LINELENGTH) :: longname_l
1258 if (shapestr ==
'NROW' .or. &
1259 shapestr ==
'NCOL' .or. &
1260 shapestr ==
'NCPL')
then
1262 select case (shapestr)
1268 axis_sz = dim_ids%ncpl
1272 call nf_verify(nf90_redef(ncid), nc_fname)
1273 call nf_verify(nf90_def_var(ncid, nc_varname, nf90_double, &
1274 (/axis_sz/), var_id), &
1278 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1281 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1282 (/nf90_fill_double/)), nc_fname)
1283 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1284 longname), nc_fname)
1290 call nf_verify(nf90_enddef(ncid), nc_fname)
1291 call nf_verify(nf90_put_var(ncid, var_id, p_mem), &
1298 fill_value = nf90_fill_double
1301 longname_l =
export_longname(longname, pkgname, tagname, layer=0, iper=iper)
1304 call nf_verify(nf90_redef(ncid), nc_fname)
1305 call nf_verify(nf90_def_var(ncid, nc_varname, nf90_double, &
1306 (/dim_ids%x, dim_ids%y, dim_ids%z/), var_id), &
1310 call ncvar_chunk3d(ncid, var_id, chunk_x, chunk_y, chunk_z, nc_fname)
1312 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1315 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1316 (/fill_value/)), nc_fname)
1317 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1318 longname_l), nc_fname)
1321 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1325 call nf_verify(nf90_enddef(ncid), nc_fname)
1326 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1, 1/), &
1327 count=(/dis%ncol, dis%nrow, dis%nlay/)), &
1335 pkgname, tagname, shapestr, longname, nc_tag, &
1336 gridmap_name, latlon, deflate, shuffle, chunk_z, &
1337 chunk_y, chunk_x, nc_fname)
1338 integer(I4B),
intent(in) :: ncid
1341 type(
distype),
pointer,
intent(in) :: dis
1342 real(DP),
dimension(:, :),
pointer,
contiguous,
intent(in) :: p_mem
1343 character(len=*),
intent(in) :: nc_varname
1344 character(len=*),
intent(in) :: pkgname
1345 character(len=*),
intent(in) :: tagname
1346 character(len=*),
intent(in) :: shapestr
1347 character(len=*),
intent(in) :: longname
1348 character(len=*),
intent(in) :: nc_tag
1349 character(len=*),
intent(in) :: gridmap_name
1350 logical(LGP),
intent(in) :: latlon
1351 integer(I4B),
intent(in) :: deflate
1352 integer(I4B),
intent(in) :: shuffle
1353 integer(I4B),
intent(in) :: chunk_z
1354 integer(I4B),
intent(in) :: chunk_y
1355 integer(I4B),
intent(in) :: chunk_x
1356 character(len=*),
intent(in) :: nc_fname
1357 integer(I4B) :: var_id
1360 call nf_verify(nf90_redef(ncid), nc_fname)
1361 call nf_verify(nf90_def_var(ncid, nc_varname, nf90_double, &
1362 (/dim_ids%x, dim_ids%y/), var_id), &
1366 call ncvar_chunk2d(ncid, var_id, chunk_x, chunk_y, nc_fname)
1368 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1371 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1372 (/nf90_fill_double/)), nc_fname)
1373 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1374 longname), nc_fname)
1377 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1381 call nf_verify(nf90_enddef(ncid), nc_fname)
1382 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1/), &
1383 count=(/dis%ncol, dis%nrow/)), &
1390 pkgname, tagname, shapestr, longname, nc_tag, &
1391 gridmap_name, latlon, deflate, shuffle, chunk_z, &
1392 chunk_y, chunk_x, iper, iaux, nc_fname)
1394 integer(I4B),
intent(in) :: ncid
1397 type(
distype),
pointer,
intent(in) :: dis
1398 real(DP),
dimension(:, :, :),
pointer,
contiguous,
intent(in) :: p_mem
1399 character(len=*),
intent(in) :: nc_varname
1400 character(len=*),
intent(in) :: pkgname
1401 character(len=*),
intent(in) :: tagname
1402 character(len=*),
intent(in) :: shapestr
1403 character(len=*),
intent(in) :: longname
1404 character(len=*),
intent(in) :: nc_tag
1405 character(len=*),
intent(in) :: gridmap_name
1406 logical(LGP),
intent(in) :: latlon
1407 integer(I4B),
intent(in) :: deflate
1408 integer(I4B),
intent(in) :: shuffle
1409 integer(I4B),
intent(in) :: chunk_z
1410 integer(I4B),
intent(in) :: chunk_y
1411 integer(I4B),
intent(in) :: chunk_x
1412 integer(I4B),
intent(in) :: iper
1413 integer(I4B),
intent(in) :: iaux
1414 character(len=*),
intent(in) :: nc_fname
1415 integer(I4B) :: var_id
1416 real(DP) :: fill_value
1417 character(len=LINELENGTH) :: longname_l
1422 fill_value = nf90_fill_double
1425 longname_l =
export_longname(longname, pkgname, tagname, layer=0, iper=iper)
1428 call nf_verify(nf90_redef(ncid), nc_fname)
1429 call nf_verify(nf90_def_var(ncid, nc_varname, nf90_double, &
1430 (/dim_ids%x, dim_ids%y, dim_ids%z/), var_id), &
1434 call ncvar_chunk3d(ncid, var_id, chunk_x, chunk_y, chunk_z, nc_fname)
1436 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1439 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1440 (/fill_value/)), nc_fname)
1441 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1442 longname_l), nc_fname)
1445 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1446 call ncvar_mf6attr(ncid, var_id, iper, iaux, nc_tag, nc_fname)
1449 call nf_verify(nf90_enddef(ncid), nc_fname)
1450 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1, 1/), &
1451 count=(/dis%ncol, dis%nrow, dis%nlay/)), &
1459 character(len=*),
intent(in) :: pkgname
1461 integer(I4B),
optional,
intent(in) :: iper
1462 integer(I4B),
optional,
intent(in) :: iaux
1463 character(len=LINELENGTH) :: varname
1464 character(len=LINELENGTH) :: pname, vname
1466 vname = idt%mf6varname
1469 if (
present(iper))
then
1470 if (
present(iaux))
then
1471 write (varname,
'(a,i0,a,i0)') trim(pname)//
'_'//trim(vname)// &
1472 '_p', iper,
'a', iaux
1474 write (varname,
'(a,i0)') trim(pname)//
'_'//trim(vname)//
'_p', iper
1477 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_warning(msg, substring)
Store warning message.
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
character(len=maxcharlen) warnmsg
warning message string
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