43 integer(I4B) :: dependent
44 integer(I4B) :: x_bnds
45 integer(I4B) :: y_bnds
46 integer(I4B) :: z_bnds
47 integer(I4B) :: latitude
48 integer(I4B) :: longitude
49 integer(I4B) :: export
58 real(dp),
dimension(:),
pointer,
contiguous :: latitude => null()
59 real(dp),
dimension(:),
pointer,
contiguous :: longitude => null()
60 integer(I4B),
pointer :: chunk_z
61 integer(I4B),
pointer :: chunk_y
62 integer(I4B),
pointer :: chunk_x
63 integer(I4B),
dimension(:),
allocatable :: layers
64 logical(LGP) :: latlon
97 disenum, nctype, iout)
101 character(len=*),
intent(in) :: modelname
102 character(len=*),
intent(in) :: modeltype
103 character(len=*),
intent(in) :: modelfname
104 character(len=*),
intent(in) :: nc_fname
105 integer(I4B),
intent(in) :: disenum
106 integer(I4B),
intent(in) :: nctype
107 integer(I4B),
intent(in) :: iout
108 integer(I4B) :: k, latsz, lonsz
109 logical(LGP) :: found
112 this%nlay = this%dis%nlay
115 allocate (this%chunk_z)
116 allocate (this%chunk_y)
117 allocate (this%chunk_x)
118 allocate (this%layers(this%nlay))
128 this%latlon = .false.
131 call this%NCModelExportType%init(modelname, modeltype, modelfname, nc_fname, &
132 disenum, nctype, iout)
135 if (this%ncf_mempath /=
'')
then
136 call mem_set_value(this%chunk_z,
'CHUNK_Z', this%ncf_mempath, found)
137 call mem_set_value(this%chunk_y,
'CHUNK_Y', this%ncf_mempath, found)
138 call mem_set_value(this%chunk_x,
'CHUNK_X', this%ncf_mempath, found)
140 if (this%chunk_time > 0 .and. this%chunk_z > 0 .and. &
141 this%chunk_y > 0 .and. this%chunk_x > 0)
then
142 this%chunking_active = .true.
143 else if (this%chunk_time > 0 .or. this%chunk_z > 0 .or. &
144 this%chunk_y > 0 .or. this%chunk_x > 0)
then
149 write (
warnmsg,
'(a)')
'Ignoring user provided NetCDF chunking &
150 ¶meters. Define chunk_time, chunk_x, chunk_y and chunk_z input &
151 ¶meters to see an effect in file "'//trim(nc_fname)//
'".'
155 call get_isize(
'LATITUDE', this%ncf_mempath, latsz)
156 call get_isize(
'LONGITUDE', this%ncf_mempath, lonsz)
158 if (latsz > 0 .and. lonsz > 0)
then
160 if (this%wkt /=
'')
then
161 write (
warnmsg,
'(a)')
'Ignoring user provided NetCDF wkt parameter &
162 &as longitude and latitude arrays have been provided. &
163 &Applies to file "'//trim(nc_fname)//
'".'
166 this%gridmap_name =
''
168 call mem_setptr(this%latitude,
'LATITUDE', this%ncf_mempath)
169 call mem_setptr(this%longitude,
'LONGITUDE', this%ncf_mempath)
172 if (this%wkt /=
'')
then
173 if (this%dis%angrot /=
dzero)
then
174 write (
warnmsg,
'(a)')
'WKT parameter set with structured rotated &
175 &grid. Projected coordinates will have grid local values. &
176 &Applies to file "'//trim(nc_fname)//
'".'
182 if (this%dis%lenuni == 1)
then
189 call nf_verify(nf90_create(this%nc_fname, &
190 ior(nf90_clobber, nf90_netcdf4), this%ncid), &
198 call nf_verify(nf90_close(this%ncid), this%nc_fname)
199 deallocate (this%chunk_z)
200 deallocate (this%chunk_y)
201 deallocate (this%chunk_x)
202 deallocate (this%layers)
203 nullify (this%chunk_z)
204 nullify (this%chunk_y)
205 nullify (this%chunk_x)
207 call this%NCModelExportType%destroy()
217 call this%add_global_att()
219 call this%define_dim()
221 call this%define_geocoords()
224 call this%define_dependent()
227 call this%df_export()
229 call nf_verify(nf90_enddef(this%ncid), this%nc_fname)
231 call this%add_grid_data()
233 call this%add_proj_data()
235 call this%add_pkg_data()
237 call this%define_gridmap()
239 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
249 do idx = 1, this%pkglist%Count()
250 export_pkg => this%get(idx)
251 call this%export_df(export_pkg)
262 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
263 integer(I4B) :: n, istp
268 if (
size(this%dis%nodeuser) < &
269 size(this%dis%nodereduced))
then
270 allocate (dbl1d(
size(this%dis%nodereduced)))
272 do n = 1,
size(this%dis%nodereduced)
273 if (this%dis%nodereduced(n) > 0)
then
274 dbl1d(n) = this%x(this%dis%nodereduced(n))
278 call nf_verify(nf90_put_var(this%ncid, &
279 this%var_ids%dependent, dbl1d, &
280 start=(/1, 1, 1, istp/), &
281 count=(/this%dis%ncol, &
283 this%dis%nlay, 1/)), &
288 call nf_verify(nf90_put_var(this%ncid, &
289 this%var_ids%dependent, this%x, &
290 start=(/1, 1, 1, istp/), &
291 count=(/this%dis%ncol, &
293 this%dis%nlay, 1/)), &
298 call nf_verify(nf90_put_var(this%ncid, this%var_ids%time, &
299 totim, start=(/istp/)), &
303 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
310 character(len=*),
intent(in) :: pkgtype
311 character(len=*),
intent(in) :: pkgname
312 character(len=*),
intent(in) :: mempath
314 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
315 integer(I4B),
dimension(:, :),
pointer,
contiguous :: int2d
316 integer(I4B),
dimension(:, :, :),
pointer,
contiguous :: int3d
317 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
318 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
319 real(DP),
dimension(:, :, :),
pointer,
contiguous :: dbl3d
320 character(len=LINELENGTH) :: nc_tag
321 integer(I4B) :: iper, iaux
328 nc_tag = this%input_attribute(pkgname, idt)
330 select case (idt%datatype)
332 call mem_setptr(int1d, idt%mf6varname, mempath)
334 this%dis, idt, mempath, nc_tag, pkgname, &
335 this%gridmap_name, this%latlon, this%deflate, &
336 this%shuffle, this%chunk_z, this%chunk_y, &
337 this%chunk_x, iper, this%nc_fname)
339 call mem_setptr(int2d, idt%mf6varname, mempath)
341 this%dis, idt, mempath, nc_tag, pkgname, &
342 this%gridmap_name, this%latlon, this%deflate, &
343 this%shuffle, this%chunk_z, this%chunk_y, &
344 this%chunk_x, this%nc_fname)
346 call mem_setptr(int3d, idt%mf6varname, mempath)
348 this%dis, idt, mempath, nc_tag, pkgname, &
349 this%gridmap_name, this%latlon, this%deflate, &
350 this%shuffle, this%chunk_z, this%chunk_y, &
351 this%chunk_x, this%nc_fname)
353 call mem_setptr(dbl1d, idt%mf6varname, mempath)
355 this%dis, idt, mempath, nc_tag, pkgname, &
356 this%gridmap_name, this%latlon, this%deflate, &
357 this%shuffle, this%chunk_z, this%chunk_y, &
358 this%chunk_x, iper, iaux, this%nc_fname)
360 call mem_setptr(dbl2d, idt%mf6varname, mempath)
362 this%dis, idt, mempath, nc_tag, pkgname, &
363 this%gridmap_name, this%latlon, this%deflate, &
364 this%shuffle, this%chunk_z, this%chunk_y, &
365 this%chunk_x, this%nc_fname)
367 call mem_setptr(dbl3d, idt%mf6varname, mempath)
369 this%dis, idt, mempath, nc_tag, pkgname, &
370 this%gridmap_name, this%latlon, this%deflate, &
371 this%shuffle, this%chunk_z, this%chunk_y, &
372 this%chunk_x, this%nc_fname)
386 integer(I4B) :: iparam, iaux
389 do iparam = 1, export_pkg%nparam
395 export_pkg%mf6_input%component_type, &
396 export_pkg%mf6_input%subcomponent_type, &
397 'PERIOD', export_pkg%param_names(iparam),
'')
398 select case (idt%shape)
399 case (
'NCPL',
'NODES')
400 call this%create_timeseries(idt, iparam, iaux, export_pkg)
401 case (
'NAUX NCPL',
'NAUX NODES')
402 do iaux = 1, export_pkg%naux
403 call this%create_timeseries(idt, iparam, iaux, export_pkg)
416 integer(I4B),
intent(in) :: iparam
417 integer(I4B),
intent(in) :: iaux
419 character(len=LINELENGTH) :: varname, longname, nc_tag
420 integer(I4B) :: varid
423 nc_tag = this%input_attribute(export_pkg%mf6_input%subcomponent_name, &
427 varname = export_varname(export_pkg%mf6_input%subcomponent_name, &
428 idt%tagname, export_pkg%mf6_input%mempath, &
430 longname = export_longname(idt%longname, &
431 export_pkg%mf6_input%subcomponent_name, &
432 idt%tagname, export_pkg%mf6_input%mempath, &
436 select case (idt%datatype)
437 case (
'DOUBLE1D',
'DOUBLE2D')
438 if (idt%shape ==
'NCPL' .or. &
439 idt%shape ==
'NAUX NCPL')
then
440 call nf_verify(nf90_def_var(this%ncid, varname, nf90_double, &
443 this%dim_ids%time/), varid), &
446 call nf_verify(nf90_def_var(this%ncid, varname, nf90_double, &
450 this%dim_ids%time/), varid), &
453 call nf_verify(nf90_put_att(this%ncid, varid, &
457 if (idt%shape ==
'NCPL' .or. &
458 idt%shape ==
'NAUX NCPL')
then
459 call nf_verify(nf90_def_var(this%ncid, varname, nf90_int, &
462 this%dim_ids%time/), varid), &
465 call nf_verify(nf90_def_var(this%ncid, varname, nf90_int, &
469 this%dim_ids%time/), varid), &
472 call nf_verify(nf90_put_att(this%ncid, varid, &
473 '_FillValue', (/nf90_fill_int/)), &
478 if (this%chunking_active)
then
479 call nf_verify(nf90_def_var_chunking(this%ncid, &
482 (/this%chunk_x, this%chunk_y, &
483 this%chunk_z, this%chunk_time/)), &
489 this%shuffle, this%nc_fname)
492 call nf_verify(nf90_put_att(this%ncid, varid, &
493 'units', this%lenunits), this%nc_fname)
494 call nf_verify(nf90_put_att(this%ncid, varid, &
495 'long_name', longname), this%nc_fname)
498 call ncvar_gridmap(this%ncid, varid, this%gridmap_name, this%latlon, &
500 call ncvar_mf6attr(this%ncid, varid, iaux, nc_tag, this%nc_fname)
503 if (idt%tagname ==
'AUX')
then
504 export_pkg%varids_aux(iaux, 1) = varid
506 export_pkg%varids_param(iparam, 1) = varid
515 character(len=*),
intent(in) :: pkgtype
516 character(len=*),
intent(in) :: pkgname
517 character(len=*),
intent(in) :: mempath
519 intent(in) :: param_dfns
521 integer(I4B) :: iparam, isize
522 do iparam = 1,
size(param_dfns)
524 idt => param_dfns(iparam)
526 if (idt%blockname ==
'GRIDDATA')
then
528 call get_isize(idt%mf6varname, mempath, isize)
530 call this%export_input_array(pkgtype, pkgname, mempath, idt)
545 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
546 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d, nodes
547 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
548 character(len=LINELENGTH) :: nc_tag
549 integer(I4B) :: iaux, iparam, nvals, n
550 integer(I4B),
pointer :: nbound
556 do iparam = 1, export_pkg%nparam
558 if (export_pkg%param_reads(iparam)%invar < 1) cycle
563 export_pkg%mf6_input%component_type, &
564 export_pkg%mf6_input%subcomponent_type, &
565 'PERIOD', export_pkg%param_names(iparam),
'')
568 nc_tag = this%input_attribute(export_pkg%mf6_input%subcomponent_name, &
572 select case (idt%datatype)
574 call mem_setptr(int1d, idt%mf6varname, export_pkg%mf6_input%mempath)
575 this%var_ids%export = export_pkg%varids_param(iparam, 1)
577 this%dis, idt, export_pkg%mf6_input%mempath, &
578 nc_tag, export_pkg%mf6_input%subcomponent_name, &
579 this%gridmap_name, this%latlon, this%deflate, &
580 this%shuffle, this%chunk_z, this%chunk_y, &
581 this%chunk_x,
kper, this%nc_fname)
583 call mem_setptr(dbl1d, idt%mf6varname, export_pkg%mf6_input%mempath)
584 this%var_ids%export = export_pkg%varids_param(iparam, 1)
585 select case (idt%shape)
588 this%dis, idt, export_pkg%mf6_input%mempath, &
589 nc_tag, export_pkg%mf6_input%subcomponent_name, &
590 this%gridmap_name, this%latlon, this%deflate, &
591 this%shuffle, this%chunk_z, this%chunk_y, &
592 this%chunk_x,
kper, iaux, this%nc_fname)
594 nvals = this%dis%nodesuser
595 allocate (nodes(nvals))
597 call mem_setptr(dbl1d, idt%mf6varname, export_pkg%mf6_input%mempath)
598 call mem_setptr(int1d,
'NODEULIST', export_pkg%mf6_input%mempath)
599 call mem_setptr(nbound,
'NBOUND', export_pkg%mf6_input%mempath)
601 nodes(int1d(n)) = dbl1d(n)
604 this%dis, idt, export_pkg%mf6_input%mempath, &
605 nc_tag, export_pkg%mf6_input%subcomponent_name, &
606 this%gridmap_name, this%latlon, this%deflate, &
607 this%shuffle, this%chunk_z, this%chunk_y, &
608 this%chunk_x,
kper, iaux, this%nc_fname)
613 call mem_setptr(dbl2d, idt%mf6varname, export_pkg%mf6_input%mempath)
614 select case (idt%shape)
616 nvals = this%dis%nrow * this%dis%ncol
617 allocate (nodes(nvals))
618 do iaux = 1,
size(dbl2d, dim=1)
619 this%var_ids%export = export_pkg%varids_aux(iaux, 1)
621 nodes(n) = dbl2d(iaux, n)
624 this%dis, idt, export_pkg%mf6_input%mempath, &
625 nc_tag, export_pkg%mf6_input%subcomponent_name, &
626 this%gridmap_name, this%latlon, this%deflate, &
627 this%shuffle, this%chunk_z, this%chunk_y, &
628 this%chunk_x,
kper, iaux, this%nc_fname)
632 nvals = this%dis%nodesuser
633 allocate (nodes(nvals))
634 call mem_setptr(int1d,
'NODEULIST', export_pkg%mf6_input%mempath)
635 call mem_setptr(nbound,
'NBOUND', export_pkg%mf6_input%mempath)
636 do iaux = 1,
size(dbl2d, dim=1)
638 this%var_ids%export = export_pkg%varids_aux(iaux, 1)
640 nodes(int1d(n)) = dbl2d(iaux, n)
643 this%dis, idt, export_pkg%mf6_input%mempath, &
644 nc_tag, export_pkg%mf6_input%subcomponent_name, &
645 this%gridmap_name, this%latlon, this%deflate, &
646 this%shuffle, this%chunk_z, this%chunk_y, &
647 this%chunk_x,
kper, iaux, this%nc_fname)
659 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
671 character(LENCOMPONENTNAME) :: ptype, pname, pkgtype
673 pointer :: pkgtypes => null()
675 pointer :: pkgnames => null()
677 pointer :: mempaths => null()
679 character(len=LENMEMPATH) :: input_mempath, mempath
681 integer(I4B),
pointer :: export_arrays
682 logical(LGP) :: found
687 call mem_setptr(pkgtypes,
'PKGTYPES', input_mempath)
688 call mem_setptr(pkgnames,
'PKGNAMES', input_mempath)
689 call mem_setptr(mempaths,
'MEMPATHS', input_mempath)
691 do n = 1,
size(mempaths)
693 allocate (export_arrays)
697 mempath = mempaths(n)
702 if (mempath /=
'')
then
704 call mem_set_value(export_arrays,
'EXPORT_NC', mempath, found)
706 if (export_arrays > 0)
then
709 call this%export_input_arrays(ptype, pname, mempath, param_dfns)
714 deallocate (export_arrays)
723 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'title', &
724 this%annotation%title), this%nc_fname)
726 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'source', &
727 this%annotation%source), this%nc_fname)
729 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'modflow_grid', &
730 this%annotation%grid), this%nc_fname)
732 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'modflow_model', &
733 this%annotation%model), this%nc_fname)
735 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'history', &
736 this%annotation%history), this%nc_fname)
738 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'Conventions', &
739 this%annotation%conventions), &
749 call nf_verify(nf90_def_dim(this%ncid,
'bnd', 2, this%dim_ids%bnd), &
753 call nf_verify(nf90_def_dim(this%ncid,
'time', this%totnstp, &
754 this%dim_ids%time), this%nc_fname)
755 call nf_verify(nf90_def_var(this%ncid,
'time', nf90_double, &
756 this%dim_ids%time, this%var_ids%time), &
758 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'calendar', &
759 'standard'), this%nc_fname)
760 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'units', &
761 this%datetime), this%nc_fname)
762 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'axis',
'T'), &
765 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'standard_name', &
766 'time'), this%nc_fname)
767 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'long_name', &
768 'time'), this%nc_fname)
771 call nf_verify(nf90_def_dim(this%ncid,
'z', this%dis%nlay, this%dim_ids%z), &
773 call nf_verify(nf90_def_var(this%ncid,
'z', nf90_double, this%dim_ids%z, &
774 this%var_ids%z), this%nc_fname)
775 call nf_verify(nf90_put_att(this%ncid, this%var_ids%z,
'units',
'layer'), &
777 call nf_verify(nf90_put_att(this%ncid, this%var_ids%z,
'long_name', &
778 'layer number'), this%nc_fname)
788 call nf_verify(nf90_def_dim(this%ncid,
'y', this%dis%nrow, this%dim_ids%y), &
790 call nf_verify(nf90_def_var(this%ncid,
'y', nf90_double, this%dim_ids%y, &
791 this%var_ids%y), this%nc_fname)
792 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'units', &
793 this%lenunits), this%nc_fname)
794 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'axis',
'Y'), &
796 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'standard_name', &
797 'projection_y_coordinate'), this%nc_fname)
798 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'long_name', &
799 'Northing'), this%nc_fname)
800 if (this%wkt /=
'')
then
801 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'grid_mapping', &
802 this%gridmap_name), this%nc_fname)
804 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'bounds',
'y_bnds'), &
806 call nf_verify(nf90_def_var(this%ncid,
'y_bnds', nf90_double, &
807 (/this%dim_ids%bnd, this%dim_ids%y/), &
808 this%var_ids%y_bnds), this%nc_fname)
811 call nf_verify(nf90_def_dim(this%ncid,
'x', this%dis%ncol, this%dim_ids%x), &
813 call nf_verify(nf90_def_var(this%ncid,
'x', nf90_double, this%dim_ids%x, &
814 this%var_ids%x), this%nc_fname)
815 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'units', &
816 this%lenunits), this%nc_fname)
817 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'axis',
'X'), &
819 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'standard_name', &
820 'projection_x_coordinate'), this%nc_fname)
821 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'long_name', &
822 'Easting'), this%nc_fname)
823 if (this%wkt /=
'')
then
824 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'grid_mapping', &
825 this%gridmap_name), this%nc_fname)
827 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'bounds',
'x_bnds'), &
829 call nf_verify(nf90_def_var(this%ncid,
'x_bnds', nf90_double, &
830 (/this%dim_ids%bnd, this%dim_ids%x/), &
831 this%var_ids%x_bnds), this%nc_fname)
834 call nf_verify(nf90_def_dim(this%ncid,
'ncpl', &
835 this%dis%ncol * this%dis%nrow, &
836 this%dim_ids%ncpl), this%nc_fname)
845 call nf_verify(nf90_def_var(this%ncid, this%xname, nf90_double, &
846 (/this%dim_ids%x, this%dim_ids%y, &
847 this%dim_ids%z, this%dim_ids%time/), &
848 this%var_ids%dependent), &
852 if (this%chunking_active)
then
853 call nf_verify(nf90_def_var_chunking(this%ncid, &
854 this%var_ids%dependent, &
856 (/this%chunk_x, this%chunk_y, &
857 this%chunk_z, this%chunk_time/)), &
862 call ncvar_deflate(this%ncid, this%var_ids%dependent, this%deflate, &
863 this%shuffle, this%nc_fname)
866 call nf_verify(nf90_put_att(this%ncid, this%var_ids%dependent, &
867 'units', this%lenunits), this%nc_fname)
868 call nf_verify(nf90_put_att(this%ncid, this%var_ids%dependent, &
869 'standard_name', this%annotation%stdname), &
871 call nf_verify(nf90_put_att(this%ncid, this%var_ids%dependent,
'long_name', &
872 this%annotation%longname), this%nc_fname)
873 call nf_verify(nf90_put_att(this%ncid, this%var_ids%dependent,
'_FillValue', &
877 call ncvar_gridmap(this%ncid, this%var_ids%dependent, this%gridmap_name, &
878 this%latlon, this%nc_fname)
885 integer(I4B) :: var_id
886 if (this%wkt /=
'')
then
887 call nf_verify(nf90_redef(this%ncid), this%nc_fname)
888 call nf_verify(nf90_def_var(this%ncid, this%gridmap_name, nf90_int, &
889 var_id), this%nc_fname)
891 call nf_verify(nf90_put_att(this%ncid, var_id,
'crs_wkt', this%wkt), &
893 call nf_verify(nf90_enddef(this%ncid), this%nc_fname)
894 call nf_verify(nf90_put_var(this%ncid, var_id, 1), &
903 if (this%latlon)
then
905 call nf_verify(nf90_def_var(this%ncid,
'lat', nf90_double, &
906 (/this%dim_ids%x, this%dim_ids%y/), &
907 this%var_ids%latitude), this%nc_fname)
908 call nf_verify(nf90_put_att(this%ncid, this%var_ids%latitude, &
909 'units',
'degrees_north'), this%nc_fname)
910 call nf_verify(nf90_put_att(this%ncid, this%var_ids%latitude, &
911 'standard_name',
'latitude'), this%nc_fname)
912 call nf_verify(nf90_put_att(this%ncid, this%var_ids%latitude, &
913 'long_name',
'latitude'), this%nc_fname)
916 call nf_verify(nf90_def_var(this%ncid,
'lon', nf90_double, &
917 (/this%dim_ids%x, this%dim_ids%y/), &
918 this%var_ids%longitude), this%nc_fname)
919 call nf_verify(nf90_put_att(this%ncid, this%var_ids%longitude, &
920 'units',
'degrees_east'), this%nc_fname)
921 call nf_verify(nf90_put_att(this%ncid, this%var_ids%longitude, &
922 'standard_name',
'longitude'), this%nc_fname)
923 call nf_verify(nf90_put_att(this%ncid, this%var_ids%longitude, &
924 'long_name',
'longitude'), this%nc_fname)
932 if (this%latlon)
then
934 call nf_verify(nf90_put_var(this%ncid, this%var_ids%latitude, &
935 this%latitude, start=(/1, 1/), &
936 count=(/this%dis%ncol, this%dis%nrow/)), &
940 call nf_verify(nf90_put_var(this%ncid, this%var_ids%longitude, &
941 this%longitude, start=(/1, 1/), &
942 count=(/this%dis%ncol, this%dis%nrow/)), &
951 integer(I4B) :: ibnd, n
952 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
953 real(DP),
dimension(:),
allocatable :: x, y
954 real(DP) :: xoff, yoff
956 if (this%dis%angrot /=
dzero)
then
960 xoff = this%dis%xorigin
961 yoff = this%dis%yorigin
964 allocate (x(
size(this%dis%cellx)))
965 allocate (y(
size(this%dis%celly)))
967 do n = 1,
size(this%dis%cellx)
968 x(n) = this%dis%cellx(n) + xoff
971 do n = 1,
size(this%dis%celly)
972 y(n) = this%dis%celly(n) + yoff
975 call nf_verify(nf90_put_var(this%ncid, this%var_ids%x, x), &
977 call nf_verify(nf90_put_var(this%ncid, this%var_ids%y, y), &
980 call nf_verify(nf90_put_var(this%ncid, this%var_ids%z, this%layers), &
987 allocate (dbl2d(2,
size(this%dis%cellx)))
989 do n = 1,
size(this%dis%cellx)
991 dbl2d(1, ibnd) = xoff
992 dbl2d(2, ibnd) = xoff + this%dis%delr(ibnd)
994 dbl2d(1, ibnd) = dbl2d(1, ibnd - 1) + this%dis%delr(ibnd)
995 dbl2d(2, ibnd) = dbl2d(2, ibnd - 1) + this%dis%delr(ibnd)
999 call nf_verify(nf90_put_var(this%ncid, this%var_ids%x_bnds, dbl2d), &
1004 allocate (dbl2d(2,
size(this%dis%celly)))
1006 do n =
size(this%dis%celly), 1, -1
1008 dbl2d(1, ibnd) = yoff + sum(this%dis%delc) - this%dis%delc(n)
1009 dbl2d(2, ibnd) = yoff + sum(this%dis%delc)
1011 dbl2d(1, ibnd) = dbl2d(1, ibnd - 1) - this%dis%delc(n)
1012 dbl2d(2, ibnd) = dbl2d(2, ibnd - 1) - this%dis%delc(n)
1016 call nf_verify(nf90_put_var(this%ncid, this%var_ids%y_bnds, dbl2d), &
1024 integer(I4B),
intent(in) :: ncid
1025 integer(I4B),
intent(in) :: varid
1026 integer(I4B),
intent(in) :: chunk_x
1027 integer(I4B),
intent(in) :: chunk_y
1028 character(len=*),
intent(in) :: nc_fname
1029 if (chunk_y > 0 .and. chunk_x > 0)
then
1030 call nf_verify(nf90_def_var_chunking(ncid, varid, nf90_chunked, &
1031 (/chunk_x, chunk_y/)), nc_fname)
1038 integer(I4B),
intent(in) :: ncid
1039 integer(I4B),
intent(in) :: varid
1040 integer(I4B),
intent(in) :: chunk_x
1041 integer(I4B),
intent(in) :: chunk_y
1042 integer(I4B),
intent(in) :: chunk_z
1043 character(len=*),
intent(in) :: nc_fname
1044 if (chunk_z > 0 .and. chunk_y > 0 .and. chunk_x > 0)
then
1045 call nf_verify(nf90_def_var_chunking(ncid, varid, nf90_chunked, &
1046 (/chunk_x, chunk_y, chunk_z/)), &
1054 integer(I4B),
intent(in) :: ncid
1055 integer(I4B),
intent(in) :: varid
1056 integer(I4B),
intent(in) :: deflate
1057 integer(I4B),
intent(in) :: shuffle
1058 character(len=*),
intent(in) :: nc_fname
1060 if (deflate >= 0)
then
1061 call nf_verify(nf90_def_var_deflate(ncid, varid, shuffle=shuffle, &
1062 deflate=1, deflate_level=deflate), &
1070 integer(I4B),
intent(in) :: ncid
1071 integer(I4B),
intent(in) :: varid
1072 character(len=*),
intent(in) :: gridmap_name
1073 logical(LGP),
intent(in) :: latlon
1074 character(len=*),
intent(in) :: nc_fname
1075 if (gridmap_name /=
'')
then
1076 call nf_verify(nf90_put_att(ncid, varid,
'coordinates',
'x y'), &
1078 call nf_verify(nf90_put_att(ncid, varid,
'grid_mapping', gridmap_name), &
1080 else if (latlon)
then
1081 call nf_verify(nf90_put_att(ncid, varid,
'coordinates',
'lon lat'), &
1089 integer(I4B),
intent(in) :: ncid
1090 integer(I4B),
intent(in) :: varid
1091 integer(I4B),
intent(in) :: iaux
1092 character(len=*),
intent(in) :: nc_tag
1093 character(len=*),
intent(in) :: nc_fname
1094 if (nc_tag /=
'')
then
1095 call nf_verify(nf90_put_att(ncid, varid,
'modflow_input', &
1098 call nf_verify(nf90_put_att(ncid, varid,
'modflow_iaux', &
1107 nc_tag, pkgname, gridmap_name, latlon, deflate, &
1108 shuffle, chunk_z, chunk_y, chunk_x, iper, nc_fname)
1110 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(in) :: p_mem
1111 integer(I4B),
intent(in) :: ncid
1114 type(
distype),
pointer,
intent(in) :: dis
1116 character(len=*),
intent(in) :: mempath
1117 character(len=*),
intent(in) :: nc_tag
1118 character(len=*),
intent(in) :: pkgname
1119 character(len=*),
intent(in) :: gridmap_name
1120 logical(LGP),
intent(in) :: latlon
1121 integer(I4B),
intent(in) :: deflate
1122 integer(I4B),
intent(in) :: shuffle
1123 integer(I4B),
intent(in) :: chunk_z
1124 integer(I4B),
intent(in) :: chunk_y
1125 integer(I4B),
intent(in) :: chunk_x
1126 integer(I4B),
intent(in) :: iper
1127 character(len=*),
intent(in) :: nc_fname
1128 integer(I4B) :: var_id, axis_sz, istp
1129 character(len=LINELENGTH) :: varname, longname
1133 if (idt%shape ==
'NROW' .or. &
1134 idt%shape ==
'NCOL' .or. &
1135 idt%shape ==
'NCPL' .or. &
1136 idt%shape ==
'NAUX NCPL')
then
1139 select case (idt%shape)
1144 case (
'NCPL',
'NAUX NCPL')
1145 axis_sz = dim_ids%ncpl
1148 longname =
export_longname(idt%longname, pkgname, idt%tagname, mempath)
1151 call nf_verify(nf90_redef(ncid), nc_fname)
1152 call nf_verify(nf90_def_var(ncid, varname, nf90_int, &
1153 (/axis_sz/), var_id), &
1157 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1160 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1161 (/nf90_fill_int/)), nc_fname)
1162 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1163 longname), nc_fname)
1169 call nf_verify(nf90_enddef(ncid), nc_fname)
1170 call nf_verify(nf90_put_var(ncid, var_id, p_mem), &
1175 call nf_verify(nf90_put_var(ncid, &
1176 var_ids%export, p_mem, &
1177 start=(/1, istp/), &
1178 count=(/dis%ncol, dis%nrow, 1/)), nc_fname)
1185 call nf_verify(nf90_redef(ncid), nc_fname)
1186 call nf_verify(nf90_def_var(ncid, varname, nf90_int, &
1187 (/dim_ids%x, dim_ids%y, dim_ids%z/), &
1191 call ncvar_chunk3d(ncid, var_id, chunk_x, chunk_y, chunk_z, nc_fname)
1193 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1196 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1197 (/nf90_fill_int/)), nc_fname)
1198 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1199 idt%longname), nc_fname)
1202 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1206 call nf_verify(nf90_enddef(ncid), nc_fname)
1207 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1, 1/), &
1208 count=(/dis%ncol, dis%nrow, dis%nlay/)), &
1213 call nf_verify(nf90_put_var(ncid, &
1214 var_ids%export, p_mem, &
1215 start=(/1, 1, 1, istp/), &
1216 count=(/dis%ncol, dis%nrow, dis%nlay, 1/)), &
1225 nc_tag, pkgname, gridmap_name, latlon, deflate, &
1226 shuffle, chunk_z, chunk_y, chunk_x, nc_fname)
1227 integer(I4B),
dimension(:, :),
pointer,
contiguous,
intent(in) :: p_mem
1228 integer(I4B),
intent(in) :: ncid
1231 type(
distype),
pointer,
intent(in) :: dis
1233 character(len=*),
intent(in) :: mempath
1234 character(len=*),
intent(in) :: nc_tag
1235 character(len=*),
intent(in) :: pkgname
1236 character(len=*),
intent(in) :: gridmap_name
1237 logical(LGP),
intent(in) :: latlon
1238 integer(I4B),
intent(in) :: deflate
1239 integer(I4B),
intent(in) :: shuffle
1240 integer(I4B),
intent(in) :: chunk_z
1241 integer(I4B),
intent(in) :: chunk_y
1242 integer(I4B),
intent(in) :: chunk_x
1243 character(len=*),
intent(in) :: nc_fname
1244 character(len=LINELENGTH) :: varname
1245 integer(I4B) :: var_id
1250 call nf_verify(nf90_redef(ncid), nc_fname)
1251 call nf_verify(nf90_def_var(ncid, varname, nf90_int, &
1252 (/dim_ids%x, dim_ids%y/), var_id), &
1256 call ncvar_chunk2d(ncid, var_id, chunk_x, chunk_y, nc_fname)
1258 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1261 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1262 (/nf90_fill_int/)), nc_fname)
1263 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1264 idt%longname), nc_fname)
1267 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1271 call nf_verify(nf90_enddef(ncid), nc_fname)
1272 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1/), &
1273 count=(/dis%ncol, dis%nrow/)), &
1280 nc_tag, pkgname, gridmap_name, latlon, deflate, &
1281 shuffle, chunk_z, chunk_y, chunk_x, nc_fname)
1282 integer(I4B),
dimension(:, :, :),
pointer,
contiguous,
intent(in) :: p_mem
1283 integer(I4B),
intent(in) :: ncid
1286 type(
distype),
pointer,
intent(in) :: dis
1288 character(len=*),
intent(in) :: mempath
1289 character(len=*),
intent(in) :: nc_tag
1290 character(len=*),
intent(in) :: pkgname
1291 character(len=*),
intent(in) :: gridmap_name
1292 logical(LGP),
intent(in) :: latlon
1293 integer(I4B),
intent(in) :: deflate
1294 integer(I4B),
intent(in) :: shuffle
1295 integer(I4B),
intent(in) :: chunk_z
1296 integer(I4B),
intent(in) :: chunk_y
1297 integer(I4B),
intent(in) :: chunk_x
1298 character(len=*),
intent(in) :: nc_fname
1299 character(len=LINELENGTH) :: varname
1300 integer(I4B) :: var_id
1305 call nf_verify(nf90_redef(ncid), nc_fname)
1306 call nf_verify(nf90_def_var(ncid, varname, nf90_int, &
1307 (/dim_ids%x, dim_ids%y, dim_ids%z/), var_id), &
1311 call ncvar_chunk3d(ncid, var_id, chunk_x, chunk_y, chunk_z, nc_fname)
1313 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1316 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1317 (/nf90_fill_int/)), nc_fname)
1318 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1319 idt%longname), nc_fname)
1322 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1326 call nf_verify(nf90_enddef(ncid), nc_fname)
1327 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1, 1/), &
1328 count=(/dis%ncol, dis%nrow, dis%nlay/)), &
1335 nc_tag, pkgname, gridmap_name, latlon, deflate, &
1336 shuffle, chunk_z, chunk_y, chunk_x, iper, iaux, &
1339 real(DP),
dimension(:),
pointer,
contiguous,
intent(in) :: p_mem
1340 integer(I4B),
intent(in) :: ncid
1343 type(
distype),
pointer,
intent(in) :: dis
1345 character(len=*),
intent(in) :: mempath
1346 character(len=*),
intent(in) :: nc_tag
1347 character(len=*),
intent(in) :: pkgname
1348 character(len=*),
intent(in) :: gridmap_name
1349 logical(LGP),
intent(in) :: latlon
1350 integer(I4B),
intent(in) :: deflate
1351 integer(I4B),
intent(in) :: shuffle
1352 integer(I4B),
intent(in) :: chunk_z
1353 integer(I4B),
intent(in) :: chunk_y
1354 integer(I4B),
intent(in) :: chunk_x
1355 integer(I4B),
intent(in) :: iper
1356 integer(I4B),
intent(in) :: iaux
1357 character(len=*),
intent(in) :: nc_fname
1358 integer(I4B) :: var_id, axis_sz, istp
1359 character(len=LINELENGTH) :: varname, longname
1361 if (idt%shape ==
'NROW' .or. &
1362 idt%shape ==
'NCOL' .or. &
1363 idt%shape ==
'NCPL' .or. &
1364 idt%shape ==
'NAUX NCPL')
then
1367 select case (idt%shape)
1372 case (
'NCPL',
'NAUX NCPL')
1373 axis_sz = dim_ids%ncpl
1377 longname =
export_longname(idt%longname, pkgname, idt%tagname, mempath, &
1381 call nf_verify(nf90_redef(ncid), nc_fname)
1382 call nf_verify(nf90_def_var(ncid, varname, nf90_double, &
1383 (/axis_sz/), var_id), &
1387 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1390 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1391 (/nf90_fill_double/)), nc_fname)
1392 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1393 longname), nc_fname)
1399 call nf_verify(nf90_enddef(ncid), nc_fname)
1400 call nf_verify(nf90_put_var(ncid, var_id, p_mem), &
1405 call nf_verify(nf90_put_var(ncid, &
1406 var_ids%export, p_mem, &
1407 start=(/1, istp/), &
1408 count=(/dis%ncol, dis%nrow, 1/)), nc_fname)
1414 varname =
export_varname(pkgname, idt%tagname, mempath, iaux=iaux)
1415 longname =
export_longname(idt%longname, pkgname, idt%tagname, mempath, &
1419 call nf_verify(nf90_redef(ncid), nc_fname)
1420 call nf_verify(nf90_def_var(ncid, varname, nf90_double, &
1421 (/dim_ids%x, dim_ids%y, dim_ids%z/), &
1425 call ncvar_chunk3d(ncid, var_id, chunk_x, chunk_y, chunk_z, nc_fname)
1427 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1430 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1431 (/nf90_fill_double/)), nc_fname)
1432 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1433 longname), nc_fname)
1436 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1440 call nf_verify(nf90_enddef(ncid), nc_fname)
1441 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1, 1/), &
1442 count=(/dis%ncol, dis%nrow, dis%nlay/)), &
1447 call nf_verify(nf90_put_var(ncid, &
1448 var_ids%export, p_mem, &
1449 start=(/1, 1, 1, istp/), &
1450 count=(/dis%ncol, dis%nrow, dis%nlay, 1/)), &
1459 nc_tag, pkgname, gridmap_name, latlon, deflate, &
1460 shuffle, chunk_z, chunk_y, chunk_x, nc_fname)
1461 real(DP),
dimension(:, :),
pointer,
contiguous,
intent(in) :: p_mem
1462 integer(I4B),
intent(in) :: ncid
1465 type(
distype),
pointer,
intent(in) :: dis
1467 character(len=*),
intent(in) :: mempath
1468 character(len=*),
intent(in) :: nc_tag
1469 character(len=*),
intent(in) :: pkgname
1470 character(len=*),
intent(in) :: gridmap_name
1471 logical(LGP),
intent(in) :: latlon
1472 integer(I4B),
intent(in) :: deflate
1473 integer(I4B),
intent(in) :: shuffle
1474 integer(I4B),
intent(in) :: chunk_z
1475 integer(I4B),
intent(in) :: chunk_y
1476 integer(I4B),
intent(in) :: chunk_x
1477 character(len=*),
intent(in) :: nc_fname
1478 character(len=LINELENGTH) :: varname
1479 integer(I4B) :: var_id
1484 call nf_verify(nf90_redef(ncid), nc_fname)
1485 call nf_verify(nf90_def_var(ncid, varname, nf90_double, &
1486 (/dim_ids%x, dim_ids%y/), var_id), &
1490 call ncvar_chunk2d(ncid, var_id, chunk_x, chunk_y, nc_fname)
1492 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1495 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1496 (/nf90_fill_double/)), nc_fname)
1497 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1498 idt%longname), nc_fname)
1501 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1505 call nf_verify(nf90_enddef(ncid), nc_fname)
1506 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1/), &
1507 count=(/dis%ncol, dis%nrow/)), &
1514 nc_tag, pkgname, gridmap_name, latlon, deflate, &
1515 shuffle, chunk_z, chunk_y, chunk_x, nc_fname)
1516 real(DP),
dimension(:, :, :),
pointer,
contiguous,
intent(in) :: p_mem
1517 integer(I4B),
intent(in) :: ncid
1520 type(
distype),
pointer,
intent(in) :: dis
1522 character(len=*),
intent(in) :: mempath
1523 character(len=*),
intent(in) :: nc_tag
1524 character(len=*),
intent(in) :: pkgname
1525 character(len=*),
intent(in) :: gridmap_name
1526 logical(LGP),
intent(in) :: latlon
1527 integer(I4B),
intent(in) :: deflate
1528 integer(I4B),
intent(in) :: shuffle
1529 integer(I4B),
intent(in) :: chunk_z
1530 integer(I4B),
intent(in) :: chunk_y
1531 integer(I4B),
intent(in) :: chunk_x
1532 character(len=*),
intent(in) :: nc_fname
1533 integer(I4B) :: var_id
1534 character(len=LINELENGTH) :: varname, longname
1537 longname =
export_longname(idt%longname, pkgname, idt%tagname, mempath)
1540 call nf_verify(nf90_redef(ncid), nc_fname)
1541 call nf_verify(nf90_def_var(ncid, varname, nf90_double, &
1542 (/dim_ids%x, dim_ids%y, dim_ids%z/), var_id), &
1546 call ncvar_chunk3d(ncid, var_id, chunk_x, chunk_y, chunk_z, nc_fname)
1548 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1551 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1552 (/nf90_fill_double/)), nc_fname)
1553 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1554 longname), nc_fname)
1557 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1561 call nf_verify(nf90_enddef(ncid), nc_fname)
1562 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1, 1/), &
1563 count=(/dis%ncol, dis%nrow, dis%nlay/)), &
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
integer(i4b), parameter lencomponentname
maximum length of a component name
@ mvalidate
validation mode - do not run time steps
real(dp), parameter dnodata
real no data constant
integer(i4b), parameter lenbigline
maximum length of a big line
real(dp), parameter dhnoflo
real no flow constant
real(dp), parameter dzero
real constant zero
integer(i4b), parameter lenmempath
maximum length of the memory path
This module contains the DefinitionSelectModule.
type(inputparamdefinitiontype) function, pointer, public get_param_definition_type(input_definition_types, component_type, subcomponent_type, blockname, tagname, filename)
Return parameter definition.
This module contains the DisNCStructuredModule.
subroutine add_pkg_data(this)
determine packages to write gridded input
subroutine ncvar_mf6attr(ncid, varid, iaux, nc_tag, nc_fname)
put variable internal modflow6 attributes
subroutine dis_export_destroy(this)
netcdf export dis destroy
subroutine nc_export_int3d(p_mem, ncid, dim_ids, var_ids, dis, idt, mempath, nc_tag, pkgname, gridmap_name, latlon, deflate, shuffle, chunk_z, chunk_y, chunk_x, nc_fname)
netcdf export 3D integer
subroutine ncvar_gridmap(ncid, varid, gridmap_name, latlon, nc_fname)
put variable gridmap attributes
subroutine add_global_att(this)
create file (group) attributes
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 define_geocoords(this)
define grid projection variables
subroutine df(this)
netcdf export define
subroutine nc_export_dbl3d(p_mem, ncid, dim_ids, var_ids, dis, idt, mempath, nc_tag, pkgname, gridmap_name, latlon, deflate, shuffle, chunk_z, chunk_y, chunk_x, nc_fname)
netcdf export 3D double
subroutine nc_export_dbl2d(p_mem, ncid, dim_ids, var_ids, dis, idt, mempath, nc_tag, pkgname, gridmap_name, latlon, deflate, shuffle, chunk_z, chunk_y, chunk_x, nc_fname)
netcdf export 2D double
subroutine ncvar_chunk2d(ncid, varid, chunk_x, chunk_y, nc_fname)
define 2d variable chunking
subroutine nc_export_int1d(p_mem, ncid, dim_ids, var_ids, dis, idt, mempath, nc_tag, pkgname, gridmap_name, latlon, deflate, shuffle, chunk_z, chunk_y, chunk_x, iper, nc_fname)
netcdf export 1D integer
subroutine add_proj_data(this)
add grid projection data
subroutine df_export(this)
define timeseries input variables
subroutine step(this)
netcdf export step
subroutine ncvar_deflate(ncid, varid, deflate, shuffle, nc_fname)
define variable compression
subroutine export_df(this, export_pkg)
define export package
subroutine define_dependent(this)
create the model layer dependent variables
subroutine create_timeseries(this, idt, iparam, iaux, export_pkg)
create timeseries export variable
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 nc_export_int2d(p_mem, ncid, dim_ids, var_ids, dis, idt, mempath, nc_tag, pkgname, gridmap_name, latlon, deflate, shuffle, chunk_z, chunk_y, chunk_x, nc_fname)
netcdf export 2D integer
subroutine define_dim(this)
netcdf export define dimensions
subroutine package_step(this, export_pkg)
netcdf export package dynamic input
subroutine nc_export_dbl1d(p_mem, ncid, dim_ids, var_ids, dis, idt, mempath, nc_tag, pkgname, gridmap_name, latlon, deflate, shuffle, chunk_z, chunk_y, chunk_x, iper, iaux, nc_fname)
netcdf export 1D double
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_varname(pkgname, tagname, mempath, layer, iaux)
build netcdf variable name
character(len=linelength) function, public export_longname(longname, pkgname, tagname, mempath, layer, iaux)
build netcdf variable longname
This module contains the NetCDFCommonModule.
integer(i4b) function, public ixstp()
step index for timeseries data
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