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
48 integer(I4B) :: export
57 real(dp),
dimension(:),
pointer,
contiguous :: latitude => null()
58 real(dp),
dimension(:),
pointer,
contiguous :: longitude => null()
59 integer(I4B),
pointer :: chunk_z
60 integer(I4B),
pointer :: chunk_y
61 integer(I4B),
pointer :: chunk_x
62 integer(I4B),
dimension(:),
allocatable :: layers
63 logical(LGP) :: latlon
96 disenum, nctype, iout)
100 character(len=*),
intent(in) :: modelname
101 character(len=*),
intent(in) :: modeltype
102 character(len=*),
intent(in) :: modelfname
103 character(len=*),
intent(in) :: nc_fname
104 integer(I4B),
intent(in) :: disenum
105 integer(I4B),
intent(in) :: nctype
106 integer(I4B),
intent(in) :: iout
107 integer(I4B) :: k, latsz, lonsz
108 logical(LGP) :: found
111 this%nlay = this%dis%nlay
114 allocate (this%chunk_z)
115 allocate (this%chunk_y)
116 allocate (this%chunk_x)
117 allocate (this%layers(this%nlay))
127 this%latlon = .false.
130 call this%NCModelExportType%init(modelname, modeltype, modelfname, nc_fname, &
131 disenum, nctype, iout)
134 if (this%ncf_mempath /=
'')
then
135 call mem_set_value(this%chunk_z,
'CHUNK_Z', this%ncf_mempath, found)
136 call mem_set_value(this%chunk_y,
'CHUNK_Y', this%ncf_mempath, found)
137 call mem_set_value(this%chunk_x,
'CHUNK_X', this%ncf_mempath, found)
139 if (this%chunk_time > 0 .and. this%chunk_z > 0 .and. &
140 this%chunk_y > 0 .and. this%chunk_x > 0)
then
141 this%chunking_active = .true.
142 else if (this%chunk_time > 0 .or. this%chunk_z > 0 .or. &
143 this%chunk_y > 0 .or. this%chunk_x > 0)
then
148 write (
warnmsg,
'(a)')
'Ignoring user provided NetCDF chunking &
149 ¶meters. Define chunk_time, chunk_x, chunk_y and chunk_z input &
150 ¶meters to see an effect in file "'//trim(nc_fname)//
'".'
154 call get_isize(
'LATITUDE', this%ncf_mempath, latsz)
155 call get_isize(
'LONGITUDE', this%ncf_mempath, lonsz)
157 if (latsz > 0 .and. lonsz > 0)
then
159 if (this%wkt /=
'')
then
160 write (
warnmsg,
'(a)')
'Ignoring user provided NetCDF wkt parameter &
161 &as longitude and latitude arrays have been provided. &
162 &Applies to file "'//trim(nc_fname)//
'".'
165 this%gridmap_name =
''
167 call mem_setptr(this%latitude,
'LATITUDE', this%ncf_mempath)
168 call mem_setptr(this%longitude,
'LONGITUDE', this%ncf_mempath)
171 if (this%wkt /=
'')
then
172 if (this%dis%angrot /=
dzero)
then
173 write (
warnmsg,
'(a)')
'WKT parameter set with structured rotated &
174 &grid. Projected coordinates will have grid local values. &
175 &Applies to file "'//trim(nc_fname)//
'".'
181 if (this%dis%lenuni == 1)
then
188 call nf_verify(nf90_create(this%nc_fname, &
189 ior(nf90_clobber, nf90_netcdf4), this%ncid), &
197 call nf_verify(nf90_close(this%ncid), this%nc_fname)
198 deallocate (this%chunk_z)
199 deallocate (this%chunk_y)
200 deallocate (this%chunk_x)
201 deallocate (this%layers)
202 nullify (this%chunk_z)
203 nullify (this%chunk_y)
204 nullify (this%chunk_x)
206 call this%NCModelExportType%destroy()
216 call this%add_global_att()
218 call this%define_dim()
220 call this%define_geocoords()
223 call this%define_dependent()
226 call this%df_export()
228 call nf_verify(nf90_enddef(this%ncid), this%nc_fname)
230 call this%add_grid_data()
232 call this%add_proj_data()
234 call this%add_pkg_data()
236 call this%define_gridmap()
238 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
248 do idx = 1, this%pkglist%Count()
249 export_pkg => this%get(idx)
250 call this%export_df(export_pkg)
261 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
262 integer(I4B) :: n, istp
267 if (
size(this%dis%nodeuser) < &
268 size(this%dis%nodereduced))
then
269 allocate (dbl1d(
size(this%dis%nodereduced)))
271 do n = 1,
size(this%dis%nodereduced)
272 if (this%dis%nodereduced(n) > 0)
then
273 dbl1d(n) = this%x(this%dis%nodereduced(n))
277 call nf_verify(nf90_put_var(this%ncid, &
278 this%var_ids%dependent, dbl1d, &
279 start=(/1, 1, 1, istp/), &
280 count=(/this%dis%ncol, &
282 this%dis%nlay, 1/)), &
287 call nf_verify(nf90_put_var(this%ncid, &
288 this%var_ids%dependent, this%x, &
289 start=(/1, 1, 1, istp/), &
290 count=(/this%dis%ncol, &
292 this%dis%nlay, 1/)), &
297 call nf_verify(nf90_put_var(this%ncid, this%var_ids%time, &
298 totim, start=(/istp/)), &
302 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
309 character(len=*),
intent(in) :: pkgtype
310 character(len=*),
intent(in) :: pkgname
311 character(len=*),
intent(in) :: mempath
313 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
314 integer(I4B),
dimension(:, :),
pointer,
contiguous :: int2d
315 integer(I4B),
dimension(:, :, :),
pointer,
contiguous :: int3d
316 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
317 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
318 real(DP),
dimension(:, :, :),
pointer,
contiguous :: dbl3d
319 character(len=LINELENGTH) :: nc_tag
320 integer(I4B) :: iper, iaux
327 nc_tag = this%input_attribute(pkgname, idt)
329 select case (idt%datatype)
331 call mem_setptr(int1d, idt%mf6varname, mempath)
333 this%dis, idt, mempath, nc_tag, pkgname, &
334 this%gridmap_name, this%latlon, this%deflate, &
335 this%shuffle, this%chunk_z, this%chunk_y, &
336 this%chunk_x, iper, this%nc_fname)
338 call mem_setptr(int2d, idt%mf6varname, mempath)
340 this%dis, idt, mempath, nc_tag, pkgname, &
341 this%gridmap_name, this%latlon, this%deflate, &
342 this%shuffle, this%chunk_z, this%chunk_y, &
343 this%chunk_x, this%nc_fname)
345 call mem_setptr(int3d, idt%mf6varname, mempath)
347 this%dis, idt, mempath, nc_tag, pkgname, &
348 this%gridmap_name, this%latlon, this%deflate, &
349 this%shuffle, this%chunk_z, this%chunk_y, &
350 this%chunk_x, this%nc_fname)
352 call mem_setptr(dbl1d, idt%mf6varname, mempath)
354 this%dis, idt, mempath, nc_tag, pkgname, &
355 this%gridmap_name, this%latlon, this%deflate, &
356 this%shuffle, this%chunk_z, this%chunk_y, &
357 this%chunk_x, iper, iaux, this%nc_fname)
359 call mem_setptr(dbl2d, idt%mf6varname, mempath)
361 this%dis, idt, mempath, nc_tag, pkgname, &
362 this%gridmap_name, this%latlon, this%deflate, &
363 this%shuffle, this%chunk_z, this%chunk_y, &
364 this%chunk_x, this%nc_fname)
366 call mem_setptr(dbl3d, idt%mf6varname, mempath)
368 this%dis, idt, mempath, nc_tag, pkgname, &
369 this%gridmap_name, this%latlon, this%deflate, &
370 this%shuffle, this%chunk_z, this%chunk_y, &
371 this%chunk_x, this%nc_fname)
385 integer(I4B) :: iparam, iaux
388 do iparam = 1, export_pkg%nparam
394 export_pkg%mf6_input%component_type, &
395 export_pkg%mf6_input%subcomponent_type, &
396 'PERIOD', export_pkg%param_names(iparam),
'')
397 select case (idt%shape)
398 case (
'NCPL',
'NODES')
399 call this%create_timeseries(idt, iparam, iaux, export_pkg)
400 case (
'NAUX NCPL',
'NAUX NODES')
401 do iaux = 1, export_pkg%naux
402 call this%create_timeseries(idt, iparam, iaux, export_pkg)
415 integer(I4B),
intent(in) :: iparam
416 integer(I4B),
intent(in) :: iaux
418 character(len=LINELENGTH) :: varname, longname, nc_tag
419 integer(I4B) :: varid
422 nc_tag = this%input_attribute(export_pkg%mf6_input%subcomponent_name, &
426 varname = export_varname(export_pkg%mf6_input%subcomponent_name, &
427 idt%tagname, export_pkg%mf6_input%mempath, &
429 longname = export_longname(idt%longname, &
430 export_pkg%mf6_input%subcomponent_name, &
431 idt%tagname, export_pkg%mf6_input%mempath, &
435 select case (idt%datatype)
436 case (
'DOUBLE1D',
'DOUBLE2D')
437 if (idt%shape ==
'NCPL' .or. &
438 idt%shape ==
'NAUX NCPL')
then
439 call nf_verify(nf90_def_var(this%ncid, varname, nf90_double, &
442 this%dim_ids%time/), varid), &
445 call nf_verify(nf90_def_var(this%ncid, varname, nf90_double, &
449 this%dim_ids%time/), varid), &
452 call nf_verify(nf90_put_att(this%ncid, varid, &
456 if (idt%shape ==
'NCPL' .or. &
457 idt%shape ==
'NAUX NCPL')
then
458 call nf_verify(nf90_def_var(this%ncid, varname, nf90_int, &
461 this%dim_ids%time/), varid), &
464 call nf_verify(nf90_def_var(this%ncid, varname, nf90_int, &
468 this%dim_ids%time/), varid), &
471 call nf_verify(nf90_put_att(this%ncid, varid, &
472 '_FillValue', (/nf90_fill_int/)), &
477 if (this%chunking_active)
then
478 call nf_verify(nf90_def_var_chunking(this%ncid, &
481 (/this%chunk_x, this%chunk_y, &
482 this%chunk_z, this%chunk_time/)), &
488 this%shuffle, this%nc_fname)
491 call nf_verify(nf90_put_att(this%ncid, varid, &
492 'units', this%lenunits), this%nc_fname)
493 call nf_verify(nf90_put_att(this%ncid, varid, &
494 'long_name', longname), this%nc_fname)
497 call ncvar_gridmap(this%ncid, varid, this%gridmap_name, this%latlon, &
499 call ncvar_mf6attr(this%ncid, varid, iaux, nc_tag, this%nc_fname)
502 if (idt%tagname ==
'AUX')
then
503 export_pkg%varids_aux(iaux, 1) = varid
505 export_pkg%varids_param(iparam, 1) = varid
514 character(len=*),
intent(in) :: pkgtype
515 character(len=*),
intent(in) :: pkgname
516 character(len=*),
intent(in) :: mempath
518 intent(in) :: param_dfns
520 integer(I4B) :: iparam, isize
521 do iparam = 1,
size(param_dfns)
523 idt => param_dfns(iparam)
525 if (idt%blockname ==
'GRIDDATA')
then
527 call get_isize(idt%mf6varname, mempath, isize)
529 call this%export_input_array(pkgtype, pkgname, mempath, idt)
544 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
545 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d, nodes
546 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
547 character(len=LINELENGTH) :: nc_tag
548 integer(I4B) :: iaux, iparam, nvals, n
549 integer(I4B),
pointer :: nbound
555 do iparam = 1, export_pkg%nparam
557 if (export_pkg%param_reads(iparam)%invar < 1) cycle
562 export_pkg%mf6_input%component_type, &
563 export_pkg%mf6_input%subcomponent_type, &
564 'PERIOD', export_pkg%param_names(iparam),
'')
567 nc_tag = this%input_attribute(export_pkg%mf6_input%subcomponent_name, &
571 select case (idt%datatype)
573 call mem_setptr(int1d, idt%mf6varname, export_pkg%mf6_input%mempath)
574 this%var_ids%export = export_pkg%varids_param(iparam, 1)
576 this%dis, idt, export_pkg%mf6_input%mempath, &
577 nc_tag, export_pkg%mf6_input%subcomponent_name, &
578 this%gridmap_name, this%latlon, this%deflate, &
579 this%shuffle, this%chunk_z, this%chunk_y, &
580 this%chunk_x,
kper, this%nc_fname)
582 call mem_setptr(dbl1d, idt%mf6varname, export_pkg%mf6_input%mempath)
583 this%var_ids%export = export_pkg%varids_param(iparam, 1)
584 select case (idt%shape)
587 this%dis, idt, export_pkg%mf6_input%mempath, &
588 nc_tag, export_pkg%mf6_input%subcomponent_name, &
589 this%gridmap_name, this%latlon, this%deflate, &
590 this%shuffle, this%chunk_z, this%chunk_y, &
591 this%chunk_x,
kper, iaux, this%nc_fname)
593 nvals = this%dis%nodesuser
594 allocate (nodes(nvals))
596 call mem_setptr(dbl1d, idt%mf6varname, export_pkg%mf6_input%mempath)
597 call mem_setptr(int1d,
'NODEULIST', export_pkg%mf6_input%mempath)
598 call mem_setptr(nbound,
'NBOUND', export_pkg%mf6_input%mempath)
600 nodes(int1d(n)) = dbl1d(n)
603 this%dis, idt, export_pkg%mf6_input%mempath, &
604 nc_tag, export_pkg%mf6_input%subcomponent_name, &
605 this%gridmap_name, this%latlon, this%deflate, &
606 this%shuffle, this%chunk_z, this%chunk_y, &
607 this%chunk_x,
kper, iaux, this%nc_fname)
612 call mem_setptr(dbl2d, idt%mf6varname, export_pkg%mf6_input%mempath)
613 select case (idt%shape)
615 nvals = this%dis%nrow * this%dis%ncol
616 allocate (nodes(nvals))
617 do iaux = 1,
size(dbl2d, dim=1)
618 this%var_ids%export = export_pkg%varids_aux(iaux, 1)
620 nodes(n) = dbl2d(iaux, n)
623 this%dis, idt, export_pkg%mf6_input%mempath, &
624 nc_tag, export_pkg%mf6_input%subcomponent_name, &
625 this%gridmap_name, this%latlon, this%deflate, &
626 this%shuffle, this%chunk_z, this%chunk_y, &
627 this%chunk_x,
kper, iaux, this%nc_fname)
631 nvals = this%dis%nodesuser
632 allocate (nodes(nvals))
633 call mem_setptr(int1d,
'NODEULIST', export_pkg%mf6_input%mempath)
634 call mem_setptr(nbound,
'NBOUND', export_pkg%mf6_input%mempath)
635 do iaux = 1,
size(dbl2d, dim=1)
637 this%var_ids%export = export_pkg%varids_aux(iaux, 1)
639 nodes(int1d(n)) = dbl2d(iaux, n)
642 this%dis, idt, export_pkg%mf6_input%mempath, &
643 nc_tag, export_pkg%mf6_input%subcomponent_name, &
644 this%gridmap_name, this%latlon, this%deflate, &
645 this%shuffle, this%chunk_z, this%chunk_y, &
646 this%chunk_x,
kper, iaux, this%nc_fname)
658 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
670 character(LENCOMPONENTNAME) :: ptype, pname, pkgtype
672 pointer :: pkgtypes => null()
674 pointer :: pkgnames => null()
676 pointer :: mempaths => null()
678 character(len=LENMEMPATH) :: input_mempath, mempath
680 integer(I4B),
pointer :: export_arrays
681 logical(LGP) :: found
686 call mem_setptr(pkgtypes,
'PKGTYPES', input_mempath)
687 call mem_setptr(pkgnames,
'PKGNAMES', input_mempath)
688 call mem_setptr(mempaths,
'MEMPATHS', input_mempath)
690 do n = 1,
size(mempaths)
692 allocate (export_arrays)
696 mempath = mempaths(n)
701 if (mempath /=
'')
then
703 call mem_set_value(export_arrays,
'EXPORT_NC', mempath, found)
705 if (export_arrays > 0)
then
708 call this%export_input_arrays(ptype, pname, mempath, param_dfns)
713 deallocate (export_arrays)
722 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'title', &
723 this%annotation%title), this%nc_fname)
725 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'source', &
726 this%annotation%source), this%nc_fname)
728 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'modflow_grid', &
729 this%annotation%grid), this%nc_fname)
731 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'modflow_model', &
732 this%annotation%model), this%nc_fname)
734 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'history', &
735 this%annotation%history), this%nc_fname)
737 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'Conventions', &
738 this%annotation%conventions), &
748 call nf_verify(nf90_def_dim(this%ncid,
'bnd', 2, this%dim_ids%bnd), &
752 call nf_verify(nf90_def_dim(this%ncid,
'time', this%totnstp, &
753 this%dim_ids%time), this%nc_fname)
754 call nf_verify(nf90_def_var(this%ncid,
'time', nf90_double, &
755 this%dim_ids%time, this%var_ids%time), &
757 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'calendar', &
758 'standard'), this%nc_fname)
759 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'units', &
760 this%datetime), this%nc_fname)
761 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'axis',
'T'), &
764 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'standard_name', &
765 'time'), this%nc_fname)
766 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'long_name', &
767 'time'), this%nc_fname)
770 call nf_verify(nf90_def_dim(this%ncid,
'z', this%dis%nlay, this%dim_ids%z), &
772 call nf_verify(nf90_def_var(this%ncid,
'z', nf90_double, this%dim_ids%z, &
773 this%var_ids%z), this%nc_fname)
774 call nf_verify(nf90_put_att(this%ncid, this%var_ids%z,
'units',
'layer'), &
776 call nf_verify(nf90_put_att(this%ncid, this%var_ids%z,
'long_name', &
777 'layer number'), this%nc_fname)
787 call nf_verify(nf90_def_dim(this%ncid,
'y', this%dis%nrow, this%dim_ids%y), &
789 call nf_verify(nf90_def_var(this%ncid,
'y', nf90_double, this%dim_ids%y, &
790 this%var_ids%y), this%nc_fname)
791 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'units', &
792 this%lenunits), this%nc_fname)
793 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'axis',
'Y'), &
795 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'standard_name', &
796 'projection_y_coordinate'), this%nc_fname)
797 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'long_name', &
798 'Northing'), this%nc_fname)
799 if (this%wkt /=
'')
then
800 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'grid_mapping', &
801 this%gridmap_name), this%nc_fname)
803 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'bounds',
'y_bnds'), &
805 call nf_verify(nf90_def_var(this%ncid,
'y_bnds', nf90_double, &
806 (/this%dim_ids%bnd, this%dim_ids%y/), &
807 this%var_ids%y_bnds), this%nc_fname)
810 call nf_verify(nf90_def_dim(this%ncid,
'x', this%dis%ncol, this%dim_ids%x), &
812 call nf_verify(nf90_def_var(this%ncid,
'x', nf90_double, this%dim_ids%x, &
813 this%var_ids%x), this%nc_fname)
814 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'units', &
815 this%lenunits), this%nc_fname)
816 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'axis',
'X'), &
818 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'standard_name', &
819 'projection_x_coordinate'), this%nc_fname)
820 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'long_name', &
821 'Easting'), this%nc_fname)
822 if (this%wkt /=
'')
then
823 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'grid_mapping', &
824 this%gridmap_name), this%nc_fname)
826 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'bounds',
'x_bnds'), &
828 call nf_verify(nf90_def_var(this%ncid,
'x_bnds', nf90_double, &
829 (/this%dim_ids%bnd, this%dim_ids%x/), &
830 this%var_ids%x_bnds), this%nc_fname)
839 call nf_verify(nf90_def_var(this%ncid, this%xname, nf90_double, &
840 (/this%dim_ids%x, this%dim_ids%y, &
841 this%dim_ids%z, this%dim_ids%time/), &
842 this%var_ids%dependent), &
846 if (this%chunking_active)
then
847 call nf_verify(nf90_def_var_chunking(this%ncid, &
848 this%var_ids%dependent, &
850 (/this%chunk_x, this%chunk_y, &
851 this%chunk_z, this%chunk_time/)), &
856 call ncvar_deflate(this%ncid, this%var_ids%dependent, this%deflate, &
857 this%shuffle, this%nc_fname)
860 call nf_verify(nf90_put_att(this%ncid, this%var_ids%dependent, &
861 'units', this%lenunits), this%nc_fname)
862 call nf_verify(nf90_put_att(this%ncid, this%var_ids%dependent, &
863 'standard_name', this%annotation%stdname), &
865 call nf_verify(nf90_put_att(this%ncid, this%var_ids%dependent,
'long_name', &
866 this%annotation%longname), this%nc_fname)
867 call nf_verify(nf90_put_att(this%ncid, this%var_ids%dependent,
'_FillValue', &
871 call ncvar_gridmap(this%ncid, this%var_ids%dependent, this%gridmap_name, &
872 this%latlon, this%nc_fname)
879 integer(I4B) :: var_id
880 if (this%wkt /=
'')
then
881 call nf_verify(nf90_redef(this%ncid), this%nc_fname)
882 call nf_verify(nf90_def_var(this%ncid, this%gridmap_name, nf90_int, &
883 var_id), this%nc_fname)
885 call nf_verify(nf90_put_att(this%ncid, var_id,
'crs_wkt', this%wkt), &
887 call nf_verify(nf90_enddef(this%ncid), this%nc_fname)
888 call nf_verify(nf90_put_var(this%ncid, var_id, 1), &
897 if (this%latlon)
then
899 call nf_verify(nf90_def_var(this%ncid,
'lat', nf90_double, &
900 (/this%dim_ids%x, this%dim_ids%y/), &
901 this%var_ids%latitude), this%nc_fname)
902 call nf_verify(nf90_put_att(this%ncid, this%var_ids%latitude, &
903 'units',
'degrees_north'), this%nc_fname)
904 call nf_verify(nf90_put_att(this%ncid, this%var_ids%latitude, &
905 'standard_name',
'latitude'), this%nc_fname)
906 call nf_verify(nf90_put_att(this%ncid, this%var_ids%latitude, &
907 'long_name',
'latitude'), this%nc_fname)
910 call nf_verify(nf90_def_var(this%ncid,
'lon', nf90_double, &
911 (/this%dim_ids%x, this%dim_ids%y/), &
912 this%var_ids%longitude), this%nc_fname)
913 call nf_verify(nf90_put_att(this%ncid, this%var_ids%longitude, &
914 'units',
'degrees_east'), this%nc_fname)
915 call nf_verify(nf90_put_att(this%ncid, this%var_ids%longitude, &
916 'standard_name',
'longitude'), this%nc_fname)
917 call nf_verify(nf90_put_att(this%ncid, this%var_ids%longitude, &
918 'long_name',
'longitude'), this%nc_fname)
926 if (this%latlon)
then
928 call nf_verify(nf90_put_var(this%ncid, this%var_ids%latitude, &
929 this%latitude, start=(/1, 1/), &
930 count=(/this%dis%ncol, this%dis%nrow/)), &
934 call nf_verify(nf90_put_var(this%ncid, this%var_ids%longitude, &
935 this%longitude, start=(/1, 1/), &
936 count=(/this%dis%ncol, this%dis%nrow/)), &
945 integer(I4B) :: ibnd, n
946 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
947 real(DP),
dimension(:),
allocatable :: x, y
948 real(DP) :: xoff, yoff
950 if (this%dis%angrot /=
dzero)
then
954 xoff = this%dis%xorigin
955 yoff = this%dis%yorigin
958 allocate (x(
size(this%dis%cellx)))
959 allocate (y(
size(this%dis%celly)))
961 do n = 1,
size(this%dis%cellx)
962 x(n) = this%dis%cellx(n) + xoff
965 do n = 1,
size(this%dis%celly)
966 y(n) = this%dis%celly(n) + yoff
969 call nf_verify(nf90_put_var(this%ncid, this%var_ids%x, x), &
971 call nf_verify(nf90_put_var(this%ncid, this%var_ids%y, y), &
974 call nf_verify(nf90_put_var(this%ncid, this%var_ids%z, this%layers), &
981 allocate (dbl2d(2,
size(this%dis%cellx)))
983 do n = 1,
size(this%dis%cellx)
985 dbl2d(1, ibnd) = xoff
986 dbl2d(2, ibnd) = xoff + this%dis%delr(ibnd)
988 dbl2d(1, ibnd) = dbl2d(1, ibnd - 1) + this%dis%delr(ibnd)
989 dbl2d(2, ibnd) = dbl2d(2, ibnd - 1) + this%dis%delr(ibnd)
993 call nf_verify(nf90_put_var(this%ncid, this%var_ids%x_bnds, dbl2d), &
998 allocate (dbl2d(2,
size(this%dis%celly)))
1000 do n =
size(this%dis%celly), 1, -1
1002 dbl2d(1, ibnd) = yoff + sum(this%dis%delc) - this%dis%delc(n)
1003 dbl2d(2, ibnd) = yoff + sum(this%dis%delc)
1005 dbl2d(1, ibnd) = dbl2d(1, ibnd - 1) - this%dis%delc(n)
1006 dbl2d(2, ibnd) = dbl2d(2, ibnd - 1) - this%dis%delc(n)
1010 call nf_verify(nf90_put_var(this%ncid, this%var_ids%y_bnds, dbl2d), &
1018 integer(I4B),
intent(in) :: ncid
1019 integer(I4B),
intent(in) :: varid
1020 integer(I4B),
intent(in) :: chunk_x
1021 integer(I4B),
intent(in) :: chunk_y
1022 character(len=*),
intent(in) :: nc_fname
1023 if (chunk_y > 0 .and. chunk_x > 0)
then
1024 call nf_verify(nf90_def_var_chunking(ncid, varid, nf90_chunked, &
1025 (/chunk_x, chunk_y/)), nc_fname)
1032 integer(I4B),
intent(in) :: ncid
1033 integer(I4B),
intent(in) :: varid
1034 integer(I4B),
intent(in) :: chunk_x
1035 integer(I4B),
intent(in) :: chunk_y
1036 integer(I4B),
intent(in) :: chunk_z
1037 character(len=*),
intent(in) :: nc_fname
1038 if (chunk_z > 0 .and. chunk_y > 0 .and. chunk_x > 0)
then
1039 call nf_verify(nf90_def_var_chunking(ncid, varid, nf90_chunked, &
1040 (/chunk_x, chunk_y, chunk_z/)), &
1048 integer(I4B),
intent(in) :: ncid
1049 integer(I4B),
intent(in) :: varid
1050 integer(I4B),
intent(in) :: deflate
1051 integer(I4B),
intent(in) :: shuffle
1052 character(len=*),
intent(in) :: nc_fname
1054 if (deflate >= 0)
then
1055 call nf_verify(nf90_def_var_deflate(ncid, varid, shuffle=shuffle, &
1056 deflate=1, deflate_level=deflate), &
1064 integer(I4B),
intent(in) :: ncid
1065 integer(I4B),
intent(in) :: varid
1066 character(len=*),
intent(in) :: gridmap_name
1067 logical(LGP),
intent(in) :: latlon
1068 character(len=*),
intent(in) :: nc_fname
1069 if (gridmap_name /=
'')
then
1070 call nf_verify(nf90_put_att(ncid, varid,
'coordinates',
'x y'), &
1072 call nf_verify(nf90_put_att(ncid, varid,
'grid_mapping', gridmap_name), &
1074 else if (latlon)
then
1075 call nf_verify(nf90_put_att(ncid, varid,
'coordinates',
'lon lat'), &
1083 integer(I4B),
intent(in) :: ncid
1084 integer(I4B),
intent(in) :: varid
1085 integer(I4B),
intent(in) :: iaux
1086 character(len=*),
intent(in) :: nc_tag
1087 character(len=*),
intent(in) :: nc_fname
1088 if (nc_tag /=
'')
then
1089 call nf_verify(nf90_put_att(ncid, varid,
'modflow_input', &
1092 call nf_verify(nf90_put_att(ncid, varid,
'modflow_iaux', &
1101 nc_tag, pkgname, gridmap_name, latlon, deflate, &
1102 shuffle, chunk_z, chunk_y, chunk_x, iper, nc_fname)
1104 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(in) :: p_mem
1105 integer(I4B),
intent(in) :: ncid
1108 type(
distype),
pointer,
intent(in) :: dis
1110 character(len=*),
intent(in) :: mempath
1111 character(len=*),
intent(in) :: nc_tag
1112 character(len=*),
intent(in) :: pkgname
1113 character(len=*),
intent(in) :: gridmap_name
1114 logical(LGP),
intent(in) :: latlon
1115 integer(I4B),
intent(in) :: deflate
1116 integer(I4B),
intent(in) :: shuffle
1117 integer(I4B),
intent(in) :: chunk_z
1118 integer(I4B),
intent(in) :: chunk_y
1119 integer(I4B),
intent(in) :: chunk_x
1120 integer(I4B),
intent(in) :: iper
1121 character(len=*),
intent(in) :: nc_fname
1122 integer(I4B) :: var_id, axis_sz, istp
1123 character(len=LINELENGTH) :: varname, longname
1127 if (idt%shape ==
'NROW' .or. &
1128 idt%shape ==
'NCOL' .or. &
1129 idt%shape ==
'NCPL' .or. &
1130 idt%shape ==
'NAUX NCPL')
then
1133 select case (idt%shape)
1140 longname =
export_longname(idt%longname, pkgname, idt%tagname, mempath)
1143 call nf_verify(nf90_redef(ncid), nc_fname)
1144 call nf_verify(nf90_def_var(ncid, varname, nf90_int, &
1145 (/axis_sz/), var_id), &
1149 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1152 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1153 (/nf90_fill_int/)), nc_fname)
1154 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1155 longname), nc_fname)
1161 call nf_verify(nf90_enddef(ncid), nc_fname)
1162 call nf_verify(nf90_put_var(ncid, var_id, p_mem), &
1167 call nf_verify(nf90_put_var(ncid, &
1168 var_ids%export, p_mem, &
1169 start=(/1, istp/), &
1170 count=(/dis%ncol, dis%nrow, 1/)), nc_fname)
1177 call nf_verify(nf90_redef(ncid), nc_fname)
1178 call nf_verify(nf90_def_var(ncid, varname, nf90_int, &
1179 (/dim_ids%x, dim_ids%y, dim_ids%z/), &
1183 call ncvar_chunk3d(ncid, var_id, chunk_x, chunk_y, chunk_z, nc_fname)
1185 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1188 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1189 (/nf90_fill_int/)), nc_fname)
1190 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1191 idt%longname), nc_fname)
1194 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1198 call nf_verify(nf90_enddef(ncid), nc_fname)
1199 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1, 1/), &
1200 count=(/dis%ncol, dis%nrow, dis%nlay/)), &
1205 call nf_verify(nf90_put_var(ncid, &
1206 var_ids%export, p_mem, &
1207 start=(/1, 1, 1, istp/), &
1208 count=(/dis%ncol, dis%nrow, dis%nlay, 1/)), &
1217 nc_tag, pkgname, gridmap_name, latlon, deflate, &
1218 shuffle, chunk_z, chunk_y, chunk_x, nc_fname)
1219 integer(I4B),
dimension(:, :),
pointer,
contiguous,
intent(in) :: p_mem
1220 integer(I4B),
intent(in) :: ncid
1223 type(
distype),
pointer,
intent(in) :: dis
1225 character(len=*),
intent(in) :: mempath
1226 character(len=*),
intent(in) :: nc_tag
1227 character(len=*),
intent(in) :: pkgname
1228 character(len=*),
intent(in) :: gridmap_name
1229 logical(LGP),
intent(in) :: latlon
1230 integer(I4B),
intent(in) :: deflate
1231 integer(I4B),
intent(in) :: shuffle
1232 integer(I4B),
intent(in) :: chunk_z
1233 integer(I4B),
intent(in) :: chunk_y
1234 integer(I4B),
intent(in) :: chunk_x
1235 character(len=*),
intent(in) :: nc_fname
1236 character(len=LINELENGTH) :: varname
1237 integer(I4B) :: var_id
1242 call nf_verify(nf90_redef(ncid), nc_fname)
1243 call nf_verify(nf90_def_var(ncid, varname, nf90_int, &
1244 (/dim_ids%x, dim_ids%y/), var_id), &
1248 call ncvar_chunk2d(ncid, var_id, chunk_x, chunk_y, nc_fname)
1250 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1253 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1254 (/nf90_fill_int/)), nc_fname)
1255 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1256 idt%longname), nc_fname)
1259 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1263 call nf_verify(nf90_enddef(ncid), nc_fname)
1264 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1/), &
1265 count=(/dis%ncol, dis%nrow/)), &
1272 nc_tag, pkgname, gridmap_name, latlon, deflate, &
1273 shuffle, chunk_z, chunk_y, chunk_x, nc_fname)
1274 integer(I4B),
dimension(:, :, :),
pointer,
contiguous,
intent(in) :: p_mem
1275 integer(I4B),
intent(in) :: ncid
1278 type(
distype),
pointer,
intent(in) :: dis
1280 character(len=*),
intent(in) :: mempath
1281 character(len=*),
intent(in) :: nc_tag
1282 character(len=*),
intent(in) :: pkgname
1283 character(len=*),
intent(in) :: gridmap_name
1284 logical(LGP),
intent(in) :: latlon
1285 integer(I4B),
intent(in) :: deflate
1286 integer(I4B),
intent(in) :: shuffle
1287 integer(I4B),
intent(in) :: chunk_z
1288 integer(I4B),
intent(in) :: chunk_y
1289 integer(I4B),
intent(in) :: chunk_x
1290 character(len=*),
intent(in) :: nc_fname
1291 character(len=LINELENGTH) :: varname
1292 integer(I4B) :: var_id
1297 call nf_verify(nf90_redef(ncid), nc_fname)
1298 call nf_verify(nf90_def_var(ncid, varname, nf90_int, &
1299 (/dim_ids%x, dim_ids%y, dim_ids%z/), var_id), &
1303 call ncvar_chunk3d(ncid, var_id, chunk_x, chunk_y, chunk_z, nc_fname)
1305 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1308 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1309 (/nf90_fill_int/)), nc_fname)
1310 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1311 idt%longname), nc_fname)
1314 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1318 call nf_verify(nf90_enddef(ncid), nc_fname)
1319 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1, 1/), &
1320 count=(/dis%ncol, dis%nrow, dis%nlay/)), &
1327 nc_tag, pkgname, gridmap_name, latlon, deflate, &
1328 shuffle, chunk_z, chunk_y, chunk_x, iper, iaux, &
1331 real(DP),
dimension(:),
pointer,
contiguous,
intent(in) :: p_mem
1332 integer(I4B),
intent(in) :: ncid
1335 type(
distype),
pointer,
intent(in) :: dis
1337 character(len=*),
intent(in) :: mempath
1338 character(len=*),
intent(in) :: nc_tag
1339 character(len=*),
intent(in) :: pkgname
1340 character(len=*),
intent(in) :: gridmap_name
1341 logical(LGP),
intent(in) :: latlon
1342 integer(I4B),
intent(in) :: deflate
1343 integer(I4B),
intent(in) :: shuffle
1344 integer(I4B),
intent(in) :: chunk_z
1345 integer(I4B),
intent(in) :: chunk_y
1346 integer(I4B),
intent(in) :: chunk_x
1347 integer(I4B),
intent(in) :: iper
1348 integer(I4B),
intent(in) :: iaux
1349 character(len=*),
intent(in) :: nc_fname
1350 integer(I4B) :: var_id, axis_sz, istp
1351 character(len=LINELENGTH) :: varname, longname
1353 if (idt%shape ==
'NROW' .or. &
1354 idt%shape ==
'NCOL' .or. &
1355 idt%shape ==
'NCPL' .or. &
1356 idt%shape ==
'NAUX NCPL')
then
1359 select case (idt%shape)
1367 longname =
export_longname(idt%longname, pkgname, idt%tagname, mempath, &
1371 call nf_verify(nf90_redef(ncid), nc_fname)
1372 call nf_verify(nf90_def_var(ncid, varname, nf90_double, &
1373 (/axis_sz/), var_id), &
1377 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1380 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1381 (/nf90_fill_double/)), nc_fname)
1382 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1383 longname), nc_fname)
1389 call nf_verify(nf90_enddef(ncid), nc_fname)
1390 call nf_verify(nf90_put_var(ncid, var_id, p_mem), &
1395 call nf_verify(nf90_put_var(ncid, &
1396 var_ids%export, p_mem, &
1397 start=(/1, istp/), &
1398 count=(/dis%ncol, dis%nrow, 1/)), nc_fname)
1404 varname =
export_varname(pkgname, idt%tagname, mempath, iaux=iaux)
1405 longname =
export_longname(idt%longname, pkgname, idt%tagname, mempath, &
1409 call nf_verify(nf90_redef(ncid), nc_fname)
1410 call nf_verify(nf90_def_var(ncid, varname, nf90_double, &
1411 (/dim_ids%x, dim_ids%y, dim_ids%z/), &
1415 call ncvar_chunk3d(ncid, var_id, chunk_x, chunk_y, chunk_z, nc_fname)
1417 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1420 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1421 (/nf90_fill_double/)), nc_fname)
1422 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1423 longname), nc_fname)
1426 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1430 call nf_verify(nf90_enddef(ncid), nc_fname)
1431 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1, 1/), &
1432 count=(/dis%ncol, dis%nrow, dis%nlay/)), &
1437 call nf_verify(nf90_put_var(ncid, &
1438 var_ids%export, p_mem, &
1439 start=(/1, 1, 1, istp/), &
1440 count=(/dis%ncol, dis%nrow, dis%nlay, 1/)), &
1449 nc_tag, pkgname, gridmap_name, latlon, deflate, &
1450 shuffle, chunk_z, chunk_y, chunk_x, nc_fname)
1451 real(DP),
dimension(:, :),
pointer,
contiguous,
intent(in) :: p_mem
1452 integer(I4B),
intent(in) :: ncid
1455 type(
distype),
pointer,
intent(in) :: dis
1457 character(len=*),
intent(in) :: mempath
1458 character(len=*),
intent(in) :: nc_tag
1459 character(len=*),
intent(in) :: pkgname
1460 character(len=*),
intent(in) :: gridmap_name
1461 logical(LGP),
intent(in) :: latlon
1462 integer(I4B),
intent(in) :: deflate
1463 integer(I4B),
intent(in) :: shuffle
1464 integer(I4B),
intent(in) :: chunk_z
1465 integer(I4B),
intent(in) :: chunk_y
1466 integer(I4B),
intent(in) :: chunk_x
1467 character(len=*),
intent(in) :: nc_fname
1468 character(len=LINELENGTH) :: varname
1469 integer(I4B) :: var_id
1474 call nf_verify(nf90_redef(ncid), nc_fname)
1475 call nf_verify(nf90_def_var(ncid, varname, nf90_double, &
1476 (/dim_ids%x, dim_ids%y/), var_id), &
1480 call ncvar_chunk2d(ncid, var_id, chunk_x, chunk_y, nc_fname)
1482 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1485 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1486 (/nf90_fill_double/)), nc_fname)
1487 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1488 idt%longname), nc_fname)
1491 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1495 call nf_verify(nf90_enddef(ncid), nc_fname)
1496 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1/), &
1497 count=(/dis%ncol, dis%nrow/)), &
1504 nc_tag, pkgname, gridmap_name, latlon, deflate, &
1505 shuffle, chunk_z, chunk_y, chunk_x, nc_fname)
1506 real(DP),
dimension(:, :, :),
pointer,
contiguous,
intent(in) :: p_mem
1507 integer(I4B),
intent(in) :: ncid
1510 type(
distype),
pointer,
intent(in) :: dis
1512 character(len=*),
intent(in) :: mempath
1513 character(len=*),
intent(in) :: nc_tag
1514 character(len=*),
intent(in) :: pkgname
1515 character(len=*),
intent(in) :: gridmap_name
1516 logical(LGP),
intent(in) :: latlon
1517 integer(I4B),
intent(in) :: deflate
1518 integer(I4B),
intent(in) :: shuffle
1519 integer(I4B),
intent(in) :: chunk_z
1520 integer(I4B),
intent(in) :: chunk_y
1521 integer(I4B),
intent(in) :: chunk_x
1522 character(len=*),
intent(in) :: nc_fname
1523 integer(I4B) :: var_id
1524 character(len=LINELENGTH) :: varname, longname
1527 longname =
export_longname(idt%longname, pkgname, idt%tagname, mempath)
1530 call nf_verify(nf90_redef(ncid), nc_fname)
1531 call nf_verify(nf90_def_var(ncid, varname, nf90_double, &
1532 (/dim_ids%x, dim_ids%y, dim_ids%z/), var_id), &
1536 call ncvar_chunk3d(ncid, var_id, chunk_x, chunk_y, chunk_z, nc_fname)
1538 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1541 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1542 (/nf90_fill_double/)), nc_fname)
1543 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1544 longname), nc_fname)
1547 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1551 call nf_verify(nf90_enddef(ncid), nc_fname)
1552 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1, 1/), &
1553 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