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)
132 if (this%ncf_mempath /=
'')
then
133 call mem_set_value(this%chunk_z,
'CHUNK_Z', this%ncf_mempath, found)
134 call mem_set_value(this%chunk_y,
'CHUNK_Y', this%ncf_mempath, found)
135 call mem_set_value(this%chunk_x,
'CHUNK_X', this%ncf_mempath, found)
137 if (this%chunk_time > 0 .and. this%chunk_z > 0 .and. &
138 this%chunk_y > 0 .and. this%chunk_x > 0)
then
139 this%chunking_active = .true.
140 else if (this%chunk_time > 0 .or. this%chunk_z > 0 .or. &
141 this%chunk_y > 0 .or. this%chunk_x > 0)
then
146 write (
warnmsg,
'(a)')
'Ignoring user provided NetCDF chunking &
147 ¶meters. Define chunk_time, chunk_x, chunk_y and chunk_z input &
148 ¶meters to see an effect in file "'//trim(nc_fname)//
'".'
152 call get_isize(
'LATITUDE', this%ncf_mempath, latsz)
153 call get_isize(
'LONGITUDE', this%ncf_mempath, lonsz)
155 if (latsz > 0 .and. lonsz > 0)
then
157 if (this%wkt /=
'')
then
158 write (
warnmsg,
'(a)')
'Ignoring user provided NetCDF wkt parameter &
159 &as longitude and latitude arrays have been provided. &
160 &Applies to file "'//trim(nc_fname)//
'".'
163 this%gridmap_name =
''
165 call mem_setptr(this%latitude,
'LATITUDE', this%ncf_mempath)
166 call mem_setptr(this%longitude,
'LONGITUDE', this%ncf_mempath)
169 if (this%wkt /=
'')
then
170 if (this%dis%angrot /=
dzero)
then
171 write (
warnmsg,
'(a)')
'WKT parameter set with structured rotated &
172 &grid. Projected coordinates will have grid local values. &
173 &Applies to file "'//trim(nc_fname)//
'".'
179 if (this%dis%lenuni == 1)
then
186 call nf_verify(nf90_create(this%nc_fname, &
187 ior(nf90_clobber, nf90_netcdf4), this%ncid), &
195 call nf_verify(nf90_close(this%ncid), this%nc_fname)
196 deallocate (this%chunk_z)
197 deallocate (this%chunk_y)
198 deallocate (this%chunk_x)
199 deallocate (this%layers)
200 nullify (this%chunk_z)
201 nullify (this%chunk_y)
202 nullify (this%chunk_x)
204 call this%NCModelExportType%destroy()
214 call this%add_global_att()
216 call this%define_dim()
218 call this%define_geocoords()
221 call this%define_dependent()
224 call nf_verify(nf90_enddef(this%ncid), this%nc_fname)
226 call this%add_grid_data()
228 call this%add_proj_data()
230 call this%add_pkg_data()
232 call this%define_gridmap()
234 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
243 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
246 this%stepcnt = this%stepcnt + 1
248 if (
size(this%dis%nodeuser) < &
249 size(this%dis%nodereduced))
then
250 allocate (dbl1d(
size(this%dis%nodereduced)))
252 do n = 1,
size(this%dis%nodereduced)
253 if (this%dis%nodereduced(n) > 0)
then
254 dbl1d(n) = this%x(this%dis%nodereduced(n))
259 this%var_ids%dependent, dbl1d, &
260 start=(/1, 1, 1, this%stepcnt/), &
261 count=(/this%dis%ncol, &
263 this%dis%nlay, 1/)), &
269 this%var_ids%dependent, this%x, &
270 start=(/1, 1, 1, this%stepcnt/), &
271 count=(/this%dis%ncol, &
273 this%dis%nlay, 1/)), &
278 call nf_verify(nf90_put_var(this%ncid, this%var_ids%time, &
279 totim, start=(/this%stepcnt/)), &
283 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
290 character(len=*),
intent(in) :: pkgtype
291 character(len=*),
intent(in) :: pkgname
292 character(len=*),
intent(in) :: mempath
294 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
295 integer(I4B),
dimension(:, :),
pointer,
contiguous :: int2d
296 integer(I4B),
dimension(:, :, :),
pointer,
contiguous :: int3d
297 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
298 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
299 real(DP),
dimension(:, :, :),
pointer,
contiguous :: dbl3d
300 character(len=LINELENGTH) :: nc_varname, input_attr
301 integer(I4B) :: iper, iaux
309 input_attr = this%input_attribute(pkgname, idt)
311 select case (idt%datatype)
313 call mem_setptr(int1d, idt%mf6varname, mempath)
314 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, &
315 int1d, 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(int2d, idt%mf6varname, mempath)
322 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, &
323 int2d, 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(int3d, idt%mf6varname, mempath)
330 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, &
331 int3d, 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, this%nc_fname)
337 call mem_setptr(dbl1d, idt%mf6varname, mempath)
338 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, &
339 dbl1d, nc_varname, pkgname, idt%tagname, &
340 idt%shape, idt%longname, input_attr, &
341 this%gridmap_name, this%latlon, this%deflate, &
342 this%shuffle, this%chunk_z, this%chunk_y, &
343 this%chunk_x, iper, this%nc_fname)
345 call mem_setptr(dbl2d, idt%mf6varname, mempath)
346 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, &
347 dbl2d, nc_varname, pkgname, idt%tagname, &
348 idt%shape, idt%longname, input_attr, &
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(dbl3d, idt%mf6varname, mempath)
354 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, &
355 dbl3d, nc_varname, pkgname, idt%tagname, &
356 idt%shape, idt%longname, input_attr, &
357 this%gridmap_name, this%latlon, this%deflate, &
358 this%shuffle, this%chunk_z, this%chunk_y, &
359 this%chunk_x, iper, iaux, this%nc_fname)
370 character(len=*),
intent(in) :: pkgtype
371 character(len=*),
intent(in) :: pkgname
372 character(len=*),
intent(in) :: mempath
374 intent(in) :: param_dfns
376 integer(I4B) :: iparam, isize
377 do iparam = 1,
size(param_dfns)
379 idt => param_dfns(iparam)
381 if (idt%blockname ==
'GRIDDATA')
then
383 call get_isize(idt%mf6varname, mempath, isize)
385 call this%export_input_array(pkgtype, pkgname, mempath, idt)
399 character(len=*),
intent(in) :: ilayer_varname
400 integer(I4B),
intent(in) :: ilayer
402 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
403 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
404 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
405 integer(I4B),
dimension(:),
pointer,
contiguous :: ialayer
406 real(DP),
dimension(:),
contiguous,
pointer :: dbl1d_ptr
407 character(len=LINELENGTH) :: nc_varname, input_attr
408 integer(I4B) :: n, iparam, nvals
409 logical(LGP) :: ilayer_read
413 ilayer_read = .false.
416 call mem_setptr(ialayer, export_pkg%param_names(ilayer), &
417 export_pkg%mf6_input%mempath)
420 if (export_pkg%param_reads(ilayer)%invar == 1)
then
425 do iparam = 1, export_pkg%nparam
427 if (export_pkg%param_reads(iparam)%invar < 1) cycle
432 export_pkg%mf6_input%component_type, &
433 export_pkg%mf6_input%subcomponent_type, &
434 'PERIOD', export_pkg%param_names(iparam), &
437 nc_varname =
export_varname(export_pkg%mf6_input%subcomponent_name, idt, &
439 input_attr = this%input_attribute(export_pkg%mf6_input%subcomponent_name, &
442 select case (idt%datatype)
444 call mem_setptr(int1d, idt%mf6varname, export_pkg%mf6_input%mempath)
445 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, &
447 export_pkg%mf6_input%subcomponent_name, &
448 idt%tagname, idt%shape, idt%longname, input_attr, &
449 this%gridmap_name, this%latlon, this%deflate, &
450 this%shuffle, this%chunk_z, this%chunk_y, &
451 this%chunk_x, export_pkg%iper, this%nc_fname)
453 call mem_setptr(dbl1d, idt%mf6varname, export_pkg%mf6_input%mempath)
454 call this%export_layer_3d(export_pkg, idt, ilayer_read, ialayer, &
455 dbl1d, nc_varname, input_attr)
457 call mem_setptr(dbl2d, idt%mf6varname, export_pkg%mf6_input%mempath)
458 nvals = this%dis%ncol * this%dis%nrow
459 do n = 1,
size(dbl2d, dim=1)
460 dbl1d_ptr(1:nvals) => dbl2d(n, :)
461 if (all(dbl1d_ptr ==
dzero))
then
463 call this%export_layer_3d(export_pkg, idt, ilayer_read, ialayer, &
464 dbl1d_ptr, nc_varname, input_attr, n)
468 errmsg =
'EXPORT ilayer unsupported datatype='//trim(idt%datatype)
474 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
485 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
486 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
488 character(len=LINELENGTH) :: nc_varname, input_attr
489 integer(I4B) :: iparam
491 do iparam = 1, export_pkg%nparam
494 export_pkg%mf6_input%component_type, &
495 export_pkg%mf6_input%subcomponent_type, &
496 'PERIOD', export_pkg%param_names(iparam), &
500 nc_varname =
export_varname(export_pkg%mf6_input%subcomponent_name, idt, &
502 input_attr = this%input_attribute(export_pkg%mf6_input%subcomponent_name, &
506 select case (idt%datatype)
508 call mem_setptr(int1d, export_pkg%param_names(iparam), &
509 export_pkg%mf6_input%mempath)
510 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, &
512 export_pkg%mf6_input%subcomponent_name, &
513 idt%tagname, idt%shape, idt%longname, input_attr, &
514 this%gridmap_name, this%latlon, this%deflate, &
515 this%shuffle, this%chunk_z, this%chunk_y, &
516 this%chunk_x,
kper, this%nc_fname)
518 call mem_setptr(dbl1d, export_pkg%param_names(iparam), &
519 export_pkg%mf6_input%mempath)
520 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, &
522 export_pkg%mf6_input%subcomponent_name, &
523 idt%tagname, idt%shape, idt%longname, input_attr, &
524 this%gridmap_name, this%latlon, this%deflate, &
525 this%shuffle, this%chunk_z, this%chunk_y, &
526 this%chunk_x,
kper, this%nc_fname)
528 errmsg =
'EXPORT unsupported datatype='//trim(idt%datatype)
534 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
540 dbl1d, nc_varname, input_attr, iaux)
546 logical(LGP),
intent(in) :: ilayer_read
547 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(in) :: ialayer
548 real(DP),
dimension(:),
pointer,
contiguous,
intent(in) :: dbl1d
549 character(len=*),
intent(inout) :: nc_varname
550 character(len=*),
intent(in) :: input_attr
551 integer(I4B),
optional,
intent(in) :: iaux
552 real(DP),
dimension(:, :, :),
pointer,
contiguous :: dbl3d
553 integer(I4B) :: n, i, j, k, nvals, idxaux
554 real(DP),
dimension(:, :),
contiguous,
pointer :: dbl2d_ptr
558 if (
present(iaux))
then
559 nc_varname =
export_varname(export_pkg%mf6_input%subcomponent_name, &
560 idt, iper=
kper, iaux=iaux)
564 allocate (dbl3d(export_pkg%mshape(3), export_pkg%mshape(2), &
565 export_pkg%mshape(1)))
567 if (ilayer_read)
then
568 do k = 1,
size(dbl3d, dim=3)
570 do i = 1,
size(dbl3d, dim=2)
571 do j = 1,
size(dbl3d, dim=1)
573 if (ialayer(n) == k)
then
574 dbl3d(j, i, k) = dbl1d(n)
583 nvals = export_pkg%mshape(3) * export_pkg%mshape(2)
584 dbl2d_ptr(1:export_pkg%mshape(3), 1:export_pkg%mshape(2)) => dbl1d(1:nvals)
585 dbl3d(:, :, 1) = dbl2d_ptr(:, :)
588 call nc_export_array(this%ncid, this%dim_ids, this%var_ids, this%dis, dbl3d, &
589 nc_varname, export_pkg%mf6_input%subcomponent_name, &
590 idt%tagname, idt%shape, idt%longname, input_attr, &
591 this%gridmap_name, this%latlon, this%deflate, &
592 this%shuffle, this%chunk_z, this%chunk_y, this%chunk_x, &
593 export_pkg%iper, idxaux, this%nc_fname)
607 character(LENCOMPONENTNAME) :: ptype, pname, pkgtype
609 pointer :: pkgtypes => null()
611 pointer :: pkgnames => null()
613 pointer :: mempaths => null()
615 character(len=LENMEMPATH) :: input_mempath, mempath
617 integer(I4B),
pointer :: export_arrays
618 logical(LGP) :: found
623 call mem_setptr(pkgtypes,
'PKGTYPES', input_mempath)
624 call mem_setptr(pkgnames,
'PKGNAMES', input_mempath)
625 call mem_setptr(mempaths,
'MEMPATHS', input_mempath)
627 do n = 1,
size(mempaths)
629 allocate (export_arrays)
633 mempath = mempaths(n)
638 if (mempath /=
'')
then
640 call mem_set_value(export_arrays,
'EXPORT_NC', mempath, found)
642 if (export_arrays > 0)
then
645 call this%export_input_arrays(ptype, pname, mempath, param_dfns)
650 deallocate (export_arrays)
659 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'title', &
660 this%annotation%title), this%nc_fname)
662 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'source', &
663 this%annotation%source), this%nc_fname)
665 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'modflow_grid', &
666 this%annotation%grid), this%nc_fname)
668 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'modflow_model', &
669 this%annotation%model), this%nc_fname)
671 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'history', &
672 this%annotation%history), this%nc_fname)
674 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'Conventions', &
675 this%annotation%conventions), &
687 call nf_verify(nf90_def_dim(this%ncid,
'bnd', 2, this%dim_ids%bnd), &
692 call nf_verify(nf90_def_dim(this%ncid,
'time', this%totnstp, &
693 this%dim_ids%time), this%nc_fname)
694 call nf_verify(nf90_def_var(this%ncid,
'time', nf90_double, &
695 this%dim_ids%time, this%var_ids%time), &
697 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'calendar', &
698 'standard'), this%nc_fname)
699 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'units', &
700 this%datetime), this%nc_fname)
701 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'axis',
'T'), &
704 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'standard_name', &
705 'time'), this%nc_fname)
706 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'long_name', &
707 'time'), this%nc_fname)
711 call nf_verify(nf90_def_dim(this%ncid,
'z', this%dis%nlay, this%dim_ids%z), &
713 call nf_verify(nf90_def_var(this%ncid,
'z', nf90_double, this%dim_ids%z, &
714 this%var_ids%z), this%nc_fname)
715 call nf_verify(nf90_put_att(this%ncid, this%var_ids%z,
'units',
'layer'), &
717 call nf_verify(nf90_put_att(this%ncid, this%var_ids%z,
'long_name', &
718 'layer number'), this%nc_fname)
728 call nf_verify(nf90_def_dim(this%ncid,
'y', this%dis%nrow, this%dim_ids%y), &
730 call nf_verify(nf90_def_var(this%ncid,
'y', nf90_double, this%dim_ids%y, &
731 this%var_ids%y), this%nc_fname)
732 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'units', &
733 this%lenunits), this%nc_fname)
734 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'axis',
'Y'), &
736 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'standard_name', &
737 'projection_y_coordinate'), this%nc_fname)
738 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'long_name', &
739 'Northing'), this%nc_fname)
740 if (this%wkt /=
'')
then
741 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'grid_mapping', &
742 this%gridmap_name), this%nc_fname)
744 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'bounds',
'y_bnds'), &
746 call nf_verify(nf90_def_var(this%ncid,
'y_bnds', nf90_double, &
747 (/this%dim_ids%bnd, this%dim_ids%y/), &
748 this%var_ids%y_bnds), this%nc_fname)
751 call nf_verify(nf90_def_dim(this%ncid,
'x', this%dis%ncol, this%dim_ids%x), &
753 call nf_verify(nf90_def_var(this%ncid,
'x', nf90_double, this%dim_ids%x, &
754 this%var_ids%x), this%nc_fname)
755 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'units', &
756 this%lenunits), this%nc_fname)
757 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'axis',
'X'), &
759 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'standard_name', &
760 'projection_x_coordinate'), this%nc_fname)
761 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'long_name', &
762 'Easting'), this%nc_fname)
763 if (this%wkt /=
'')
then
764 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'grid_mapping', &
765 this%gridmap_name), this%nc_fname)
767 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'bounds',
'x_bnds'), &
769 call nf_verify(nf90_def_var(this%ncid,
'x_bnds', nf90_double, &
770 (/this%dim_ids%bnd, this%dim_ids%x/), &
771 this%var_ids%x_bnds), this%nc_fname)
774 call nf_verify(nf90_def_dim(this%ncid,
'ncpl', &
775 this%dis%ncol * this%dis%nrow, &
776 this%dim_ids%ncpl), this%nc_fname)
785 call nf_verify(nf90_def_var(this%ncid, this%xname, nf90_double, &
786 (/this%dim_ids%x, this%dim_ids%y, &
787 this%dim_ids%z, this%dim_ids%time/), &
788 this%var_ids%dependent), &
792 if (this%chunking_active)
then
793 call nf_verify(nf90_def_var_chunking(this%ncid, &
794 this%var_ids%dependent, &
796 (/this%chunk_x, this%chunk_y, &
797 this%chunk_z, this%chunk_time/)), &
802 call ncvar_deflate(this%ncid, this%var_ids%dependent, this%deflate, &
803 this%shuffle, this%nc_fname)
806 call nf_verify(nf90_put_att(this%ncid, this%var_ids%dependent, &
807 'units', this%lenunits), this%nc_fname)
808 call nf_verify(nf90_put_att(this%ncid, this%var_ids%dependent, &
809 'standard_name', this%annotation%stdname), &
811 call nf_verify(nf90_put_att(this%ncid, this%var_ids%dependent,
'long_name', &
812 this%annotation%longname), this%nc_fname)
813 call nf_verify(nf90_put_att(this%ncid, this%var_ids%dependent,
'_FillValue', &
817 call ncvar_gridmap(this%ncid, this%var_ids%dependent, this%gridmap_name, &
818 this%latlon, this%nc_fname)
825 integer(I4B) :: var_id
826 if (this%wkt /=
'')
then
827 call nf_verify(nf90_redef(this%ncid), this%nc_fname)
828 call nf_verify(nf90_def_var(this%ncid, this%gridmap_name, nf90_int, &
829 var_id), this%nc_fname)
831 call nf_verify(nf90_put_att(this%ncid, var_id,
'crs_wkt', this%wkt), &
833 call nf_verify(nf90_enddef(this%ncid), this%nc_fname)
834 call nf_verify(nf90_put_var(this%ncid, var_id, 1), &
843 if (this%latlon)
then
845 call nf_verify(nf90_def_var(this%ncid,
'lat', nf90_double, &
846 (/this%dim_ids%x, this%dim_ids%y/), &
847 this%var_ids%latitude), this%nc_fname)
848 call nf_verify(nf90_put_att(this%ncid, this%var_ids%latitude, &
849 'units',
'degrees_north'), this%nc_fname)
850 call nf_verify(nf90_put_att(this%ncid, this%var_ids%latitude, &
851 'standard_name',
'latitude'), this%nc_fname)
852 call nf_verify(nf90_put_att(this%ncid, this%var_ids%latitude, &
853 'long_name',
'latitude'), this%nc_fname)
856 call nf_verify(nf90_def_var(this%ncid,
'lon', nf90_double, &
857 (/this%dim_ids%x, this%dim_ids%y/), &
858 this%var_ids%longitude), this%nc_fname)
859 call nf_verify(nf90_put_att(this%ncid, this%var_ids%longitude, &
860 'units',
'degrees_east'), this%nc_fname)
861 call nf_verify(nf90_put_att(this%ncid, this%var_ids%longitude, &
862 'standard_name',
'longitude'), this%nc_fname)
863 call nf_verify(nf90_put_att(this%ncid, this%var_ids%longitude, &
864 'long_name',
'longitude'), this%nc_fname)
872 if (this%latlon)
then
874 call nf_verify(nf90_put_var(this%ncid, this%var_ids%latitude, &
875 this%latitude, start=(/1, 1/), &
876 count=(/this%dis%ncol, this%dis%nrow/)), &
880 call nf_verify(nf90_put_var(this%ncid, this%var_ids%longitude, &
881 this%longitude, start=(/1, 1/), &
882 count=(/this%dis%ncol, this%dis%nrow/)), &
891 integer(I4B) :: ibnd, n
892 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
893 real(DP),
dimension(:),
allocatable :: x, y
894 real(DP) :: xoff, yoff
896 if (this%dis%angrot /=
dzero)
then
900 xoff = this%dis%xorigin
901 yoff = this%dis%yorigin
904 allocate (x(
size(this%dis%cellx)))
905 allocate (y(
size(this%dis%celly)))
907 do n = 1,
size(this%dis%cellx)
908 x(n) = this%dis%cellx(n) + xoff
911 do n = 1,
size(this%dis%celly)
912 y(n) = this%dis%celly(n) + yoff
915 call nf_verify(nf90_put_var(this%ncid, this%var_ids%x, x), &
917 call nf_verify(nf90_put_var(this%ncid, this%var_ids%y, y), &
920 call nf_verify(nf90_put_var(this%ncid, this%var_ids%z, this%layers), &
927 allocate (dbl2d(2,
size(this%dis%cellx)))
929 do n = 1,
size(this%dis%cellx)
931 dbl2d(1, ibnd) = xoff
932 dbl2d(2, ibnd) = xoff + this%dis%delr(ibnd)
934 dbl2d(1, ibnd) = dbl2d(1, ibnd - 1) + this%dis%delr(ibnd)
935 dbl2d(2, ibnd) = dbl2d(2, ibnd - 1) + this%dis%delr(ibnd)
939 call nf_verify(nf90_put_var(this%ncid, this%var_ids%x_bnds, dbl2d), &
944 allocate (dbl2d(2,
size(this%dis%celly)))
946 do n =
size(this%dis%celly), 1, -1
948 dbl2d(1, ibnd) = yoff + sum(this%dis%delc) - this%dis%delc(n)
949 dbl2d(2, ibnd) = yoff + sum(this%dis%delc)
951 dbl2d(1, ibnd) = dbl2d(1, ibnd - 1) - this%dis%delc(n)
952 dbl2d(2, ibnd) = dbl2d(2, ibnd - 1) - this%dis%delc(n)
956 call nf_verify(nf90_put_var(this%ncid, this%var_ids%y_bnds, dbl2d), &
964 integer(I4B),
intent(in) :: ncid
965 integer(I4B),
intent(in) :: varid
966 integer(I4B),
intent(in) :: chunk_x
967 integer(I4B),
intent(in) :: chunk_y
968 character(len=*),
intent(in) :: nc_fname
969 if (chunk_y > 0 .and. chunk_x > 0)
then
970 call nf_verify(nf90_def_var_chunking(ncid, varid, nf90_chunked, &
971 (/chunk_x, chunk_y/)), nc_fname)
978 integer(I4B),
intent(in) :: ncid
979 integer(I4B),
intent(in) :: varid
980 integer(I4B),
intent(in) :: chunk_x
981 integer(I4B),
intent(in) :: chunk_y
982 integer(I4B),
intent(in) :: chunk_z
983 character(len=*),
intent(in) :: nc_fname
984 if (chunk_z > 0 .and. chunk_y > 0 .and. chunk_x > 0)
then
985 call nf_verify(nf90_def_var_chunking(ncid, varid, nf90_chunked, &
986 (/chunk_x, chunk_y, chunk_z/)), &
994 integer(I4B),
intent(in) :: ncid
995 integer(I4B),
intent(in) :: varid
996 integer(I4B),
intent(in) :: deflate
997 integer(I4B),
intent(in) :: shuffle
998 character(len=*),
intent(in) :: nc_fname
1000 if (deflate >= 0)
then
1001 call nf_verify(nf90_def_var_deflate(ncid, varid, shuffle=shuffle, &
1002 deflate=1, deflate_level=deflate), &
1010 integer(I4B),
intent(in) :: ncid
1011 integer(I4B),
intent(in) :: varid
1012 character(len=*),
intent(in) :: gridmap_name
1013 logical(LGP),
intent(in) :: latlon
1014 character(len=*),
intent(in) :: nc_fname
1015 if (gridmap_name /=
'')
then
1016 call nf_verify(nf90_put_att(ncid, varid,
'coordinates',
'x y'), &
1018 call nf_verify(nf90_put_att(ncid, varid,
'grid_mapping', gridmap_name), &
1020 else if (latlon)
then
1021 call nf_verify(nf90_put_att(ncid, varid,
'coordinates',
'lon lat'), &
1029 integer(I4B),
intent(in) :: ncid
1030 integer(I4B),
intent(in) :: varid
1031 integer(I4B),
intent(in) :: iper
1032 integer(I4B),
intent(in) :: iaux
1033 character(len=*),
intent(in) :: nc_tag
1034 character(len=*),
intent(in) :: nc_fname
1035 if (nc_tag /=
'')
then
1036 call nf_verify(nf90_put_att(ncid, varid,
'modflow6_input', &
1039 call nf_verify(nf90_put_att(ncid, varid,
'modflow6_iper', &
1043 call nf_verify(nf90_put_att(ncid, varid,
'modflow6_iaux', &
1052 pkgname, tagname, shapestr, longname, nc_tag, &
1053 gridmap_name, latlon, deflate, shuffle, chunk_z, &
1054 chunk_y, chunk_x, iper, nc_fname)
1055 integer(I4B),
intent(in) :: ncid
1058 type(
distype),
pointer,
intent(in) :: dis
1059 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(in) :: p_mem
1060 character(len=*),
intent(in) :: nc_varname
1061 character(len=*),
intent(in) :: pkgname
1062 character(len=*),
intent(in) :: tagname
1063 character(len=*),
intent(in) :: shapestr
1064 character(len=*),
intent(in) :: longname
1065 character(len=*),
intent(in) :: nc_tag
1066 character(len=*),
intent(in) :: gridmap_name
1067 logical(LGP),
intent(in) :: latlon
1068 integer(I4B),
intent(in) :: deflate
1069 integer(I4B),
intent(in) :: shuffle
1070 integer(I4B),
intent(in) :: chunk_z
1071 integer(I4B),
intent(in) :: chunk_y
1072 integer(I4B),
intent(in) :: chunk_x
1073 integer(I4B),
intent(in) :: iper
1074 character(len=*),
intent(in) :: nc_fname
1075 integer(I4B) :: var_id, axis_sz
1076 character(len=LINELENGTH) :: longname_l
1078 if (shapestr ==
'NROW' .or. &
1079 shapestr ==
'NCOL' .or. &
1080 shapestr ==
'NCPL')
then
1082 select case (shapestr)
1088 axis_sz = dim_ids%ncpl
1091 longname_l =
export_longname(longname, pkgname, tagname, layer=0, iper=iper)
1094 call nf_verify(nf90_redef(ncid), nc_fname)
1095 call nf_verify(nf90_def_var(ncid, nc_varname, nf90_int, &
1096 (/axis_sz/), var_id), &
1100 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1103 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1104 (/nf90_fill_int/)), nc_fname)
1105 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1106 longname_l), nc_fname)
1112 call nf_verify(nf90_enddef(ncid), nc_fname)
1113 call nf_verify(nf90_put_var(ncid, var_id, p_mem), &
1118 call nf_verify(nf90_redef(ncid), nc_fname)
1119 call nf_verify(nf90_def_var(ncid, nc_varname, nf90_int, &
1120 (/dim_ids%x, dim_ids%y, dim_ids%z/), var_id), &
1124 call ncvar_chunk3d(ncid, var_id, chunk_x, chunk_y, chunk_z, nc_fname)
1126 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1129 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1130 (/nf90_fill_int/)), nc_fname)
1131 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1132 longname), nc_fname)
1135 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1139 call nf_verify(nf90_enddef(ncid), nc_fname)
1140 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1, 1/), &
1141 count=(/dis%ncol, dis%nrow, dis%nlay/)), &
1149 pkgname, tagname, shapestr, longname, nc_tag, &
1150 gridmap_name, latlon, deflate, shuffle, chunk_z, &
1151 chunk_y, chunk_x, nc_fname)
1152 integer(I4B),
intent(in) :: ncid
1155 type(
distype),
pointer,
intent(in) :: dis
1156 integer(I4B),
dimension(:, :),
pointer,
contiguous,
intent(in) :: p_mem
1157 character(len=*),
intent(in) :: nc_varname
1158 character(len=*),
intent(in) :: pkgname
1159 character(len=*),
intent(in) :: tagname
1160 character(len=*),
intent(in) :: shapestr
1161 character(len=*),
intent(in) :: longname
1162 character(len=*),
intent(in) :: nc_tag
1163 character(len=*),
intent(in) :: gridmap_name
1164 logical(LGP),
intent(in) :: latlon
1165 integer(I4B),
intent(in) :: deflate
1166 integer(I4B),
intent(in) :: shuffle
1167 integer(I4B),
intent(in) :: chunk_z
1168 integer(I4B),
intent(in) :: chunk_y
1169 integer(I4B),
intent(in) :: chunk_x
1170 character(len=*),
intent(in) :: nc_fname
1171 integer(I4B) :: var_id
1174 call nf_verify(nf90_redef(ncid), nc_fname)
1175 call nf_verify(nf90_def_var(ncid, nc_varname, nf90_int, &
1176 (/dim_ids%x, dim_ids%y/), var_id), &
1180 call ncvar_chunk2d(ncid, var_id, chunk_x, chunk_y, nc_fname)
1182 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1185 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1186 (/nf90_fill_int/)), nc_fname)
1187 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1188 longname), nc_fname)
1191 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1195 call nf_verify(nf90_enddef(ncid), nc_fname)
1196 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1/), &
1197 count=(/dis%ncol, dis%nrow/)), &
1204 pkgname, tagname, shapestr, longname, nc_tag, &
1205 gridmap_name, latlon, deflate, shuffle, chunk_z, &
1206 chunk_y, chunk_x, nc_fname)
1207 integer(I4B),
intent(in) :: ncid
1210 type(
distype),
pointer,
intent(in) :: dis
1211 integer(I4B),
dimension(:, :, :),
pointer,
contiguous,
intent(in) :: p_mem
1212 character(len=*),
intent(in) :: nc_varname
1213 character(len=*),
intent(in) :: pkgname
1214 character(len=*),
intent(in) :: tagname
1215 character(len=*),
intent(in) :: shapestr
1216 character(len=*),
intent(in) :: longname
1217 character(len=*),
intent(in) :: nc_tag
1218 character(len=*),
intent(in) :: gridmap_name
1219 logical(LGP),
intent(in) :: latlon
1220 integer(I4B),
intent(in) :: deflate
1221 integer(I4B),
intent(in) :: shuffle
1222 integer(I4B),
intent(in) :: chunk_z
1223 integer(I4B),
intent(in) :: chunk_y
1224 integer(I4B),
intent(in) :: chunk_x
1225 character(len=*),
intent(in) :: nc_fname
1226 integer(I4B) :: var_id
1229 call nf_verify(nf90_redef(ncid), nc_fname)
1230 call nf_verify(nf90_def_var(ncid, nc_varname, nf90_int, &
1231 (/dim_ids%x, dim_ids%y, dim_ids%z/), var_id), &
1235 call ncvar_chunk3d(ncid, var_id, chunk_x, chunk_y, chunk_z, nc_fname)
1237 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1240 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1241 (/nf90_fill_int/)), nc_fname)
1242 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1243 longname), nc_fname)
1246 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1250 call nf_verify(nf90_enddef(ncid), nc_fname)
1251 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1, 1/), &
1252 count=(/dis%ncol, dis%nrow, dis%nlay/)), &
1259 pkgname, tagname, shapestr, longname, nc_tag, &
1260 gridmap_name, latlon, deflate, shuffle, chunk_z, &
1261 chunk_y, chunk_x, iper, nc_fname)
1263 integer(I4B),
intent(in) :: ncid
1266 type(
distype),
pointer,
intent(in) :: dis
1267 real(DP),
dimension(:),
pointer,
contiguous,
intent(in) :: p_mem
1268 character(len=*),
intent(in) :: nc_varname
1269 character(len=*),
intent(in) :: pkgname
1270 character(len=*),
intent(in) :: tagname
1271 character(len=*),
intent(in) :: shapestr
1272 character(len=*),
intent(in) :: longname
1273 character(len=*),
intent(in) :: nc_tag
1274 character(len=*),
intent(in) :: gridmap_name
1275 logical(LGP),
intent(in) :: latlon
1276 integer(I4B),
intent(in) :: deflate
1277 integer(I4B),
intent(in) :: shuffle
1278 integer(I4B),
intent(in) :: chunk_z
1279 integer(I4B),
intent(in) :: chunk_y
1280 integer(I4B),
intent(in) :: chunk_x
1281 integer(I4B),
intent(in) :: iper
1282 character(len=*),
intent(in) :: nc_fname
1283 integer(I4B) :: var_id, axis_sz
1284 real(DP) :: fill_value
1285 character(len=LINELENGTH) :: longname_l
1287 if (shapestr ==
'NROW' .or. &
1288 shapestr ==
'NCOL' .or. &
1289 shapestr ==
'NCPL')
then
1291 select case (shapestr)
1297 axis_sz = dim_ids%ncpl
1301 call nf_verify(nf90_redef(ncid), nc_fname)
1302 call nf_verify(nf90_def_var(ncid, nc_varname, nf90_double, &
1303 (/axis_sz/), var_id), &
1307 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1310 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1311 (/nf90_fill_double/)), nc_fname)
1312 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1313 longname), nc_fname)
1319 call nf_verify(nf90_enddef(ncid), nc_fname)
1320 call nf_verify(nf90_put_var(ncid, var_id, p_mem), &
1327 fill_value = nf90_fill_double
1330 longname_l =
export_longname(longname, pkgname, tagname, layer=0, iper=iper)
1333 call nf_verify(nf90_redef(ncid), nc_fname)
1334 call nf_verify(nf90_def_var(ncid, nc_varname, nf90_double, &
1335 (/dim_ids%x, dim_ids%y, dim_ids%z/), var_id), &
1339 call ncvar_chunk3d(ncid, var_id, chunk_x, chunk_y, chunk_z, nc_fname)
1341 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1344 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1345 (/fill_value/)), nc_fname)
1346 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1347 longname_l), nc_fname)
1350 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1354 call nf_verify(nf90_enddef(ncid), nc_fname)
1355 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1, 1/), &
1356 count=(/dis%ncol, dis%nrow, dis%nlay/)), &
1364 pkgname, tagname, shapestr, longname, nc_tag, &
1365 gridmap_name, latlon, deflate, shuffle, chunk_z, &
1366 chunk_y, chunk_x, nc_fname)
1367 integer(I4B),
intent(in) :: ncid
1370 type(
distype),
pointer,
intent(in) :: dis
1371 real(DP),
dimension(:, :),
pointer,
contiguous,
intent(in) :: p_mem
1372 character(len=*),
intent(in) :: nc_varname
1373 character(len=*),
intent(in) :: pkgname
1374 character(len=*),
intent(in) :: tagname
1375 character(len=*),
intent(in) :: shapestr
1376 character(len=*),
intent(in) :: longname
1377 character(len=*),
intent(in) :: nc_tag
1378 character(len=*),
intent(in) :: gridmap_name
1379 logical(LGP),
intent(in) :: latlon
1380 integer(I4B),
intent(in) :: deflate
1381 integer(I4B),
intent(in) :: shuffle
1382 integer(I4B),
intent(in) :: chunk_z
1383 integer(I4B),
intent(in) :: chunk_y
1384 integer(I4B),
intent(in) :: chunk_x
1385 character(len=*),
intent(in) :: nc_fname
1386 integer(I4B) :: var_id
1389 call nf_verify(nf90_redef(ncid), nc_fname)
1390 call nf_verify(nf90_def_var(ncid, nc_varname, nf90_double, &
1391 (/dim_ids%x, dim_ids%y/), var_id), &
1395 call ncvar_chunk2d(ncid, var_id, chunk_x, chunk_y, nc_fname)
1397 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1400 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1401 (/nf90_fill_double/)), nc_fname)
1402 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1403 longname), nc_fname)
1406 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1410 call nf_verify(nf90_enddef(ncid), nc_fname)
1411 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1/), &
1412 count=(/dis%ncol, dis%nrow/)), &
1419 pkgname, tagname, shapestr, longname, nc_tag, &
1420 gridmap_name, latlon, deflate, shuffle, chunk_z, &
1421 chunk_y, chunk_x, iper, iaux, nc_fname)
1423 integer(I4B),
intent(in) :: ncid
1426 type(
distype),
pointer,
intent(in) :: dis
1427 real(DP),
dimension(:, :, :),
pointer,
contiguous,
intent(in) :: p_mem
1428 character(len=*),
intent(in) :: nc_varname
1429 character(len=*),
intent(in) :: pkgname
1430 character(len=*),
intent(in) :: tagname
1431 character(len=*),
intent(in) :: shapestr
1432 character(len=*),
intent(in) :: longname
1433 character(len=*),
intent(in) :: nc_tag
1434 character(len=*),
intent(in) :: gridmap_name
1435 logical(LGP),
intent(in) :: latlon
1436 integer(I4B),
intent(in) :: deflate
1437 integer(I4B),
intent(in) :: shuffle
1438 integer(I4B),
intent(in) :: chunk_z
1439 integer(I4B),
intent(in) :: chunk_y
1440 integer(I4B),
intent(in) :: chunk_x
1441 integer(I4B),
intent(in) :: iper
1442 integer(I4B),
intent(in) :: iaux
1443 character(len=*),
intent(in) :: nc_fname
1444 integer(I4B) :: var_id
1445 real(DP) :: fill_value
1446 character(len=LINELENGTH) :: longname_l
1451 fill_value = nf90_fill_double
1454 longname_l =
export_longname(longname, pkgname, tagname, layer=0, iper=iper)
1457 call nf_verify(nf90_redef(ncid), nc_fname)
1458 call nf_verify(nf90_def_var(ncid, nc_varname, nf90_double, &
1459 (/dim_ids%x, dim_ids%y, dim_ids%z/), var_id), &
1463 call ncvar_chunk3d(ncid, var_id, chunk_x, chunk_y, chunk_z, nc_fname)
1465 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1468 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1469 (/fill_value/)), nc_fname)
1470 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1471 longname_l), nc_fname)
1474 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1475 call ncvar_mf6attr(ncid, var_id, iper, iaux, nc_tag, nc_fname)
1478 call nf_verify(nf90_enddef(ncid), nc_fname)
1479 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1, 1/), &
1480 count=(/dis%ncol, dis%nrow, dis%nlay/)), &
1488 character(len=*),
intent(in) :: pkgname
1490 integer(I4B),
optional,
intent(in) :: iper
1491 integer(I4B),
optional,
intent(in) :: iaux
1492 character(len=LINELENGTH) :: varname
1493 character(len=LINELENGTH) :: pname, vname
1495 vname = idt%mf6varname
1498 if (
present(iper))
then
1499 if (
present(iaux))
then
1500 write (varname,
'(a,i0,a,i0)') trim(pname)//
'_'//trim(vname)// &
1501 '_p', iper,
'a', iaux
1503 write (varname,
'(a,i0)') trim(pname)//
'_'//trim(vname)//
'_p', iper
1506 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 define_geocoords(this)
define grid projection variables
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 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