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 /=
'' .or. this%crs_wkt /=
'')
then
160 write (
warnmsg,
'(a)')
'Ignoring user provided NetCDF wkt/crs_wkt &
161 ¶meter(s) as longitude and latitude arrays have been provided. &
162 &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%gridmap_name /=
'')
then
173 if (this%dis%angrot /=
dzero)
then
174 write (
warnmsg,
'(a)')
'CRS 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%df_export()
227 call this%define_dependent()
230 call nf_verify(nf90_enddef(this%ncid), this%nc_fname)
232 call this%add_grid_data()
234 call this%add_proj_data()
237 call this%add_pkg_data()
240 call this%define_gridmap()
242 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
252 do idx = 1, this%pkglist%Count()
253 export_pkg => this%get(idx)
254 call this%export_df(export_pkg)
264 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
265 integer(I4B) :: n, istp
270 if (
size(this%dis%nodeuser) < &
271 size(this%dis%nodereduced))
then
272 allocate (dbl1d(
size(this%dis%nodereduced)))
274 do n = 1,
size(this%dis%nodereduced)
275 if (this%dis%nodereduced(n) > 0)
then
276 dbl1d(n) = this%x(this%dis%nodereduced(n))
281 this%var_ids%dependent, dbl1d, &
282 start=(/1, 1, 1, istp/), &
283 count=(/this%dis%ncol, &
285 this%dis%nlay, 1/)), &
291 this%var_ids%dependent, this%x, &
292 start=(/1, 1, 1, istp/), &
293 count=(/this%dis%ncol, &
295 this%dis%nlay, 1/)), &
300 call nf_verify(nf90_put_var(this%ncid, this%var_ids%time, &
301 totim, start=(/istp/)), &
305 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
312 character(len=*),
intent(in) :: pkgtype
313 character(len=*),
intent(in) :: pkgname
314 character(len=*),
intent(in) :: mempath
316 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
317 integer(I4B),
dimension(:, :),
pointer,
contiguous :: int2d
318 integer(I4B),
dimension(:, :, :),
pointer,
contiguous :: int3d
319 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d
320 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
321 real(DP),
dimension(:, :, :),
pointer,
contiguous :: dbl3d
322 character(len=LINELENGTH) :: nc_tag
323 integer(I4B) :: iper, iaux
330 nc_tag = this%input_attribute(pkgname, idt)
332 select case (idt%datatype)
334 call mem_setptr(int1d, idt%mf6varname, mempath)
336 this%dis, idt, mempath, nc_tag, pkgname, &
337 this%gridmap_name, this%latlon, this%deflate, &
338 this%shuffle, this%chunk_z, this%chunk_y, &
339 this%chunk_x, iper, this%nc_fname)
341 call mem_setptr(int2d, idt%mf6varname, mempath)
343 this%dis, idt, mempath, nc_tag, pkgname, &
344 this%gridmap_name, this%latlon, this%deflate, &
345 this%shuffle, this%chunk_z, this%chunk_y, &
346 this%chunk_x, this%nc_fname)
348 call mem_setptr(int3d, idt%mf6varname, mempath)
350 this%dis, idt, mempath, nc_tag, pkgname, &
351 this%gridmap_name, this%latlon, this%deflate, &
352 this%shuffle, this%chunk_z, this%chunk_y, &
353 this%chunk_x, this%nc_fname)
355 call mem_setptr(dbl1d, idt%mf6varname, mempath)
357 this%dis, idt, mempath, nc_tag, pkgname, &
358 this%gridmap_name, this%latlon, this%deflate, &
359 this%shuffle, this%chunk_z, this%chunk_y, &
360 this%chunk_x, iper, iaux, this%nc_fname)
362 call mem_setptr(dbl2d, idt%mf6varname, mempath)
364 this%dis, idt, mempath, nc_tag, pkgname, &
365 this%gridmap_name, this%latlon, this%deflate, &
366 this%shuffle, this%chunk_z, this%chunk_y, &
367 this%chunk_x, this%nc_fname)
369 call mem_setptr(dbl3d, idt%mf6varname, mempath)
371 this%dis, idt, mempath, nc_tag, pkgname, &
372 this%gridmap_name, this%latlon, this%deflate, &
373 this%shuffle, this%chunk_z, this%chunk_y, &
374 this%chunk_x, this%nc_fname)
388 integer(I4B) :: iparam, iaux
391 do iparam = 1, export_pkg%nparam
397 export_pkg%mf6_input%component_type, &
398 export_pkg%mf6_input%subcomponent_type, &
399 'PERIOD', export_pkg%param_names(iparam),
'')
400 select case (idt%shape)
401 case (
'NCPL',
'NODES')
402 call this%create_timeseries(idt, iparam, iaux, export_pkg)
403 case (
'NAUX NCPL',
'NAUX NODES')
404 do iaux = 1, export_pkg%naux
405 call this%create_timeseries(idt, iparam, iaux, export_pkg)
418 integer(I4B),
intent(in) :: iparam
419 integer(I4B),
intent(in) :: iaux
421 character(len=LINELENGTH) :: varname, longname, nc_tag
422 integer(I4B) :: varid
425 nc_tag = this%input_attribute(export_pkg%mf6_input%subcomponent_name, &
429 varname = export_varname(export_pkg%mf6_input%subcomponent_name, &
430 idt%tagname, export_pkg%mf6_input%mempath, &
432 longname = export_longname(idt%longname, &
433 export_pkg%mf6_input%subcomponent_name, &
434 idt%tagname, export_pkg%mf6_input%mempath, &
436 component_type=idt%component_type, &
437 subcomponent_type=idt%subcomponent_type)
440 select case (idt%datatype)
441 case (
'DOUBLE1D',
'DOUBLE2D')
442 if (idt%shape ==
'NCPL' .or. &
443 idt%shape ==
'NAUX NCPL')
then
444 call nf_verify(nf90_def_var(this%ncid, varname, nf90_double, &
447 this%dim_ids%time/), varid), &
450 call nf_verify(nf90_def_var(this%ncid, varname, nf90_double, &
454 this%dim_ids%time/), varid), &
457 call nf_verify(nf90_put_att(this%ncid, varid, &
461 if (idt%shape ==
'NCPL' .or. &
462 idt%shape ==
'NAUX NCPL')
then
463 call nf_verify(nf90_def_var(this%ncid, varname, nf90_int, &
466 this%dim_ids%time/), varid), &
469 call nf_verify(nf90_def_var(this%ncid, varname, nf90_int, &
473 this%dim_ids%time/), varid), &
476 call nf_verify(nf90_put_att(this%ncid, varid, &
477 '_FillValue', (/nf90_fill_int/)), &
482 if (this%chunking_active)
then
483 call nf_verify(nf90_def_var_chunking(this%ncid, &
486 (/this%chunk_x, this%chunk_y, &
487 this%chunk_z, this%chunk_time/)), &
493 this%shuffle, this%nc_fname)
496 call nf_verify(nf90_put_att(this%ncid, varid, &
497 'units', this%lenunits), this%nc_fname)
498 call nf_verify(nf90_put_att(this%ncid, varid, &
499 'long_name', longname), this%nc_fname)
502 call ncvar_gridmap(this%ncid, varid, this%gridmap_name, this%latlon, &
504 call ncvar_mf6attr(this%ncid, varid, iaux, nc_tag, this%nc_fname)
507 if (idt%tagname ==
'AUX')
then
508 export_pkg%varids_aux(iaux, 1) = varid
510 export_pkg%varids_param(iparam, 1) = varid
519 character(len=*),
intent(in) :: pkgtype
520 character(len=*),
intent(in) :: pkgname
521 character(len=*),
intent(in) :: mempath
523 intent(in) :: param_dfns
525 integer(I4B) :: iparam, isize
526 do iparam = 1,
size(param_dfns)
528 idt => param_dfns(iparam)
530 if (idt%blockname ==
'GRIDDATA')
then
532 call get_isize(idt%mf6varname, mempath, isize)
534 call this%export_input_array(pkgtype, pkgname, mempath, idt)
549 integer(I4B),
dimension(:),
pointer,
contiguous :: int1d
550 real(DP),
dimension(:),
pointer,
contiguous :: dbl1d, nodes
551 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
552 character(len=LINELENGTH) :: nc_tag
553 integer(I4B) :: iaux, iparam, nvals, n
554 integer(I4B),
pointer :: nbound
560 do iparam = 1, export_pkg%nparam
561 if (export_pkg%iper /=
kper) cycle
563 if (export_pkg%param_reads(iparam)%invar < 1) cycle
568 export_pkg%mf6_input%component_type, &
569 export_pkg%mf6_input%subcomponent_type, &
570 'PERIOD', export_pkg%param_names(iparam),
'')
573 nc_tag = this%input_attribute(export_pkg%mf6_input%subcomponent_name, &
577 select case (idt%datatype)
579 call mem_setptr(int1d, idt%mf6varname, export_pkg%mf6_input%mempath)
580 this%var_ids%export = export_pkg%varids_param(iparam, 1)
582 this%dis, idt, export_pkg%mf6_input%mempath, &
583 nc_tag, export_pkg%mf6_input%subcomponent_name, &
584 this%gridmap_name, this%latlon, this%deflate, &
585 this%shuffle, this%chunk_z, this%chunk_y, &
586 this%chunk_x,
kper, this%nc_fname)
588 call mem_setptr(dbl1d, idt%mf6varname, export_pkg%mf6_input%mempath)
589 this%var_ids%export = export_pkg%varids_param(iparam, 1)
590 select case (idt%shape)
593 this%dis, idt, export_pkg%mf6_input%mempath, &
594 nc_tag, export_pkg%mf6_input%subcomponent_name, &
595 this%gridmap_name, this%latlon, this%deflate, &
596 this%shuffle, this%chunk_z, this%chunk_y, &
597 this%chunk_x,
kper, iaux, this%nc_fname)
599 nvals = this%dis%nodesuser
600 allocate (nodes(nvals))
602 call mem_setptr(dbl1d, idt%mf6varname, export_pkg%mf6_input%mempath)
603 call mem_setptr(int1d,
'NODEULIST', export_pkg%mf6_input%mempath)
604 call mem_setptr(nbound,
'NBOUND', export_pkg%mf6_input%mempath)
606 nodes(int1d(n)) = dbl1d(n)
609 this%dis, idt, export_pkg%mf6_input%mempath, &
610 nc_tag, export_pkg%mf6_input%subcomponent_name, &
611 this%gridmap_name, this%latlon, this%deflate, &
612 this%shuffle, this%chunk_z, this%chunk_y, &
613 this%chunk_x,
kper, iaux, this%nc_fname)
618 call mem_setptr(dbl2d, idt%mf6varname, export_pkg%mf6_input%mempath)
619 select case (idt%shape)
621 nvals = this%dis%nrow * this%dis%ncol
622 allocate (nodes(nvals))
623 do iaux = 1,
size(dbl2d, dim=1)
624 this%var_ids%export = export_pkg%varids_aux(iaux, 1)
626 nodes(n) = dbl2d(iaux, n)
629 this%dis, idt, export_pkg%mf6_input%mempath, &
630 nc_tag, export_pkg%mf6_input%subcomponent_name, &
631 this%gridmap_name, this%latlon, this%deflate, &
632 this%shuffle, this%chunk_z, this%chunk_y, &
633 this%chunk_x,
kper, iaux, this%nc_fname)
637 nvals = this%dis%nodesuser
638 allocate (nodes(nvals))
639 call mem_setptr(int1d,
'NODEULIST', export_pkg%mf6_input%mempath)
640 call mem_setptr(nbound,
'NBOUND', export_pkg%mf6_input%mempath)
641 do iaux = 1,
size(dbl2d, dim=1)
643 this%var_ids%export = export_pkg%varids_aux(iaux, 1)
645 nodes(int1d(n)) = dbl2d(iaux, n)
648 this%dis, idt, export_pkg%mf6_input%mempath, &
649 nc_tag, export_pkg%mf6_input%subcomponent_name, &
650 this%gridmap_name, this%latlon, this%deflate, &
651 this%shuffle, this%chunk_z, this%chunk_y, &
652 this%chunk_x,
kper, iaux, this%nc_fname)
664 call nf_verify(nf90_put_var(this%ncid, this%var_ids%time, &
669 call nf_verify(nf90_sync(this%ncid), this%nc_fname)
681 character(LENCOMPONENTNAME) :: ptype, pname, pkgtype
683 pointer :: pkgtypes => null()
685 pointer :: pkgnames => null()
687 pointer :: mempaths => null()
689 character(len=LENMEMPATH) :: input_mempath, mempath
691 integer(I4B),
pointer :: export_arrays
692 logical(LGP) :: found
697 call mem_setptr(pkgtypes,
'PKGTYPES', input_mempath)
698 call mem_setptr(pkgnames,
'PKGNAMES', input_mempath)
699 call mem_setptr(mempaths,
'MEMPATHS', input_mempath)
701 do n = 1,
size(mempaths)
703 allocate (export_arrays)
707 mempath = mempaths(n)
712 if (mempath /=
'')
then
714 call mem_set_value(export_arrays,
'EXPORT_NC', mempath, found, &
717 if (export_arrays > 0)
then
720 call this%export_input_arrays(ptype, pname, mempath, param_dfns)
725 deallocate (export_arrays)
734 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'title', &
735 this%annotation%title), this%nc_fname)
737 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'source', &
738 this%annotation%source), this%nc_fname)
740 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'modflow_grid', &
741 this%annotation%grid), this%nc_fname)
743 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'modflow_model', &
744 this%annotation%model), this%nc_fname)
746 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'history', &
747 this%annotation%history), this%nc_fname)
749 call nf_verify(nf90_put_att(this%ncid, nf90_global,
'Conventions', &
750 this%annotation%conventions), &
762 call nf_verify(nf90_def_dim(this%ncid,
'bnd', 2, this%dim_ids%bnd), &
767 call nf_verify(nf90_def_dim(this%ncid,
'time', this%totnstp, &
768 this%dim_ids%time), this%nc_fname)
769 call nf_verify(nf90_def_var(this%ncid,
'time', nf90_double, &
770 this%dim_ids%time, this%var_ids%time), &
772 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'calendar', &
773 'standard'), this%nc_fname)
774 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'units', &
775 this%datetime), this%nc_fname)
776 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'axis',
'T'), &
779 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'standard_name', &
780 'time'), this%nc_fname)
781 call nf_verify(nf90_put_att(this%ncid, this%var_ids%time,
'long_name', &
782 'time'), this%nc_fname)
786 call nf_verify(nf90_def_dim(this%ncid,
'layer', this%dis%nlay, &
787 this%dim_ids%z), this%nc_fname)
788 call nf_verify(nf90_def_var(this%ncid,
'layer', nf90_int, this%dim_ids%z, &
789 this%var_ids%z), this%nc_fname)
790 call nf_verify(nf90_put_att(this%ncid, this%var_ids%z,
'units',
'1'), &
792 call nf_verify(nf90_put_att(this%ncid, this%var_ids%z,
'axis',
'Z'), &
794 call nf_verify(nf90_put_att(this%ncid, this%var_ids%z,
'positive',
'down'), &
796 call nf_verify(nf90_put_att(this%ncid, this%var_ids%z,
'long_name', &
797 'model layer'), this%nc_fname)
807 call nf_verify(nf90_def_dim(this%ncid,
'y', this%dis%nrow, this%dim_ids%y), &
809 call nf_verify(nf90_def_var(this%ncid,
'y', nf90_double, this%dim_ids%y, &
810 this%var_ids%y), this%nc_fname)
811 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'units', &
812 this%lenunits), this%nc_fname)
813 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'axis',
'Y'), &
815 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'standard_name', &
816 'projection_y_coordinate'), this%nc_fname)
817 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'long_name', &
818 'Northing'), this%nc_fname)
819 if (this%gridmap_name /=
'')
then
820 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'grid_mapping', &
821 this%gridmap_name), this%nc_fname)
823 call nf_verify(nf90_put_att(this%ncid, this%var_ids%y,
'bounds',
'y_bnds'), &
825 call nf_verify(nf90_def_var(this%ncid,
'y_bnds', nf90_double, &
826 (/this%dim_ids%bnd, this%dim_ids%y/), &
827 this%var_ids%y_bnds), this%nc_fname)
830 call nf_verify(nf90_def_dim(this%ncid,
'x', this%dis%ncol, this%dim_ids%x), &
832 call nf_verify(nf90_def_var(this%ncid,
'x', nf90_double, this%dim_ids%x, &
833 this%var_ids%x), this%nc_fname)
834 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'units', &
835 this%lenunits), this%nc_fname)
836 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'axis',
'X'), &
838 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'standard_name', &
839 'projection_x_coordinate'), this%nc_fname)
840 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'long_name', &
841 'Easting'), this%nc_fname)
842 if (this%gridmap_name /=
'')
then
843 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'grid_mapping', &
844 this%gridmap_name), this%nc_fname)
846 call nf_verify(nf90_put_att(this%ncid, this%var_ids%x,
'bounds',
'x_bnds'), &
848 call nf_verify(nf90_def_var(this%ncid,
'x_bnds', nf90_double, &
849 (/this%dim_ids%bnd, this%dim_ids%x/), &
850 this%var_ids%x_bnds), this%nc_fname)
859 call nf_verify(nf90_def_var(this%ncid, this%xname, nf90_double, &
860 (/this%dim_ids%x, this%dim_ids%y, &
861 this%dim_ids%z, this%dim_ids%time/), &
862 this%var_ids%dependent), &
866 if (this%chunking_active)
then
867 call nf_verify(nf90_def_var_chunking(this%ncid, &
868 this%var_ids%dependent, &
870 (/this%chunk_x, this%chunk_y, &
871 this%chunk_z, this%chunk_time/)), &
876 call ncvar_deflate(this%ncid, this%var_ids%dependent, this%deflate, &
877 this%shuffle, this%nc_fname)
880 call nf_verify(nf90_put_att(this%ncid, this%var_ids%dependent, &
881 'units', this%lenunits), this%nc_fname)
882 call nf_verify(nf90_put_att(this%ncid, this%var_ids%dependent,
'long_name', &
883 this%annotation%longname), this%nc_fname)
884 call nf_verify(nf90_put_att(this%ncid, this%var_ids%dependent,
'_FillValue', &
888 call ncvar_gridmap(this%ncid, this%var_ids%dependent, this%gridmap_name, &
889 this%latlon, this%nc_fname)
896 integer(I4B) :: var_id
897 character(len=LINELENGTH) :: gmname
898 character(len=LENBIGLINE) :: effective_crs_wkt
900 if (this%wkt /=
'' .or. this%crs_wkt /=
'')
then
901 call nf_verify(nf90_redef(this%ncid), this%nc_fname)
902 call nf_verify(nf90_def_var(this%ncid, this%gridmap_name, nf90_int, &
903 var_id), this%nc_fname)
905 if (this%wkt /=
'')
then
906 call nf_verify(nf90_put_att(this%ncid, var_id,
'wkt', this%wkt), &
910 if (this%crs_wkt /=
'')
then
911 effective_crs_wkt = this%crs_wkt
913 effective_crs_wkt = this%wkt
915 call nf_verify(nf90_put_att(this%ncid, var_id,
'crs_wkt', &
916 trim(effective_crs_wkt)), this%nc_fname)
919 if (gmname /=
'')
then
920 call nf_verify(nf90_put_att(this%ncid, var_id,
'grid_mapping_name', &
921 trim(gmname)), this%nc_fname)
923 call nf_verify(nf90_enddef(this%ncid), this%nc_fname)
924 call nf_verify(nf90_put_var(this%ncid, var_id, 1), &
933 if (this%latlon)
then
935 call nf_verify(nf90_def_var(this%ncid,
'lat', nf90_double, &
936 (/this%dim_ids%x, this%dim_ids%y/), &
937 this%var_ids%latitude), this%nc_fname)
938 call nf_verify(nf90_put_att(this%ncid, this%var_ids%latitude, &
939 'units',
'degrees_north'), this%nc_fname)
940 call nf_verify(nf90_put_att(this%ncid, this%var_ids%latitude, &
941 'standard_name',
'latitude'), this%nc_fname)
942 call nf_verify(nf90_put_att(this%ncid, this%var_ids%latitude, &
943 'long_name',
'latitude'), this%nc_fname)
946 call nf_verify(nf90_def_var(this%ncid,
'lon', nf90_double, &
947 (/this%dim_ids%x, this%dim_ids%y/), &
948 this%var_ids%longitude), this%nc_fname)
949 call nf_verify(nf90_put_att(this%ncid, this%var_ids%longitude, &
950 'units',
'degrees_east'), this%nc_fname)
951 call nf_verify(nf90_put_att(this%ncid, this%var_ids%longitude, &
952 'standard_name',
'longitude'), this%nc_fname)
953 call nf_verify(nf90_put_att(this%ncid, this%var_ids%longitude, &
954 'long_name',
'longitude'), this%nc_fname)
962 if (this%latlon)
then
964 call nf_verify(nf90_put_var(this%ncid, this%var_ids%latitude, &
965 this%latitude, start=(/1, 1/), &
966 count=(/this%dis%ncol, this%dis%nrow/)), &
970 call nf_verify(nf90_put_var(this%ncid, this%var_ids%longitude, &
971 this%longitude, start=(/1, 1/), &
972 count=(/this%dis%ncol, this%dis%nrow/)), &
981 integer(I4B) :: ibnd, n
982 real(DP),
dimension(:, :),
pointer,
contiguous :: dbl2d
983 real(DP),
dimension(:),
allocatable :: x, y
984 real(DP) :: xoff, yoff
986 if (this%dis%angrot /=
dzero)
then
990 xoff = this%dis%xorigin
991 yoff = this%dis%yorigin
994 allocate (x(
size(this%dis%cellx)))
995 allocate (y(
size(this%dis%celly)))
997 do n = 1,
size(this%dis%cellx)
998 x(n) = this%dis%cellx(n) + xoff
1001 do n = 1,
size(this%dis%celly)
1002 y(n) = this%dis%celly(n) + yoff
1005 call nf_verify(nf90_put_var(this%ncid, this%var_ids%x, x), &
1007 call nf_verify(nf90_put_var(this%ncid, this%var_ids%y, y), &
1010 call nf_verify(nf90_put_var(this%ncid, this%var_ids%z, this%layers), &
1017 allocate (dbl2d(2,
size(this%dis%cellx)))
1019 do n = 1,
size(this%dis%cellx)
1021 dbl2d(1, ibnd) = xoff
1022 dbl2d(2, ibnd) = xoff + this%dis%delr(ibnd)
1024 dbl2d(1, ibnd) = dbl2d(1, ibnd - 1) + this%dis%delr(ibnd)
1025 dbl2d(2, ibnd) = dbl2d(2, ibnd - 1) + this%dis%delr(ibnd)
1029 call nf_verify(nf90_put_var(this%ncid, this%var_ids%x_bnds, dbl2d), &
1034 allocate (dbl2d(2,
size(this%dis%celly)))
1036 do n =
size(this%dis%celly), 1, -1
1038 dbl2d(1, ibnd) = yoff + sum(this%dis%delc) - this%dis%delc(n)
1039 dbl2d(2, ibnd) = yoff + sum(this%dis%delc)
1041 dbl2d(1, ibnd) = dbl2d(1, ibnd - 1) - this%dis%delc(n)
1042 dbl2d(2, ibnd) = dbl2d(2, ibnd - 1) - this%dis%delc(n)
1046 call nf_verify(nf90_put_var(this%ncid, this%var_ids%y_bnds, dbl2d), &
1054 integer(I4B),
intent(in) :: ncid
1055 integer(I4B),
intent(in) :: varid
1056 integer(I4B),
intent(in) :: chunk_x
1057 integer(I4B),
intent(in) :: chunk_y
1058 character(len=*),
intent(in) :: nc_fname
1059 if (chunk_y > 0 .and. chunk_x > 0)
then
1060 call nf_verify(nf90_def_var_chunking(ncid, varid, nf90_chunked, &
1061 (/chunk_x, chunk_y/)), nc_fname)
1068 integer(I4B),
intent(in) :: ncid
1069 integer(I4B),
intent(in) :: varid
1070 integer(I4B),
intent(in) :: chunk_x
1071 integer(I4B),
intent(in) :: chunk_y
1072 integer(I4B),
intent(in) :: chunk_z
1073 character(len=*),
intent(in) :: nc_fname
1074 if (chunk_z > 0 .and. chunk_y > 0 .and. chunk_x > 0)
then
1075 call nf_verify(nf90_def_var_chunking(ncid, varid, nf90_chunked, &
1076 (/chunk_x, chunk_y, chunk_z/)), &
1084 integer(I4B),
intent(in) :: ncid
1085 integer(I4B),
intent(in) :: varid
1086 integer(I4B),
intent(in) :: deflate
1087 integer(I4B),
intent(in) :: shuffle
1088 character(len=*),
intent(in) :: nc_fname
1090 if (deflate >= 0)
then
1091 call nf_verify(nf90_def_var_deflate(ncid, varid, shuffle=shuffle, &
1092 deflate=1, deflate_level=deflate), &
1100 integer(I4B),
intent(in) :: ncid
1101 integer(I4B),
intent(in) :: varid
1102 character(len=*),
intent(in) :: gridmap_name
1103 logical(LGP),
intent(in) :: latlon
1104 character(len=*),
intent(in) :: nc_fname
1105 if (gridmap_name /=
'')
then
1106 call nf_verify(nf90_put_att(ncid, varid,
'coordinates',
'x y'), &
1108 call nf_verify(nf90_put_att(ncid, varid,
'grid_mapping', gridmap_name), &
1110 else if (latlon)
then
1111 call nf_verify(nf90_put_att(ncid, varid,
'coordinates',
'lon lat'), &
1119 integer(I4B),
intent(in) :: ncid
1120 integer(I4B),
intent(in) :: varid
1121 integer(I4B),
intent(in) :: iaux
1122 character(len=*),
intent(in) :: nc_tag
1123 character(len=*),
intent(in) :: nc_fname
1124 if (nc_tag /=
'')
then
1125 call nf_verify(nf90_put_att(ncid, varid,
'modflow_input', &
1128 call nf_verify(nf90_put_att(ncid, varid,
'modflow_iaux', &
1137 nc_tag, pkgname, gridmap_name, latlon, deflate, &
1138 shuffle, chunk_z, chunk_y, chunk_x, iper, nc_fname)
1140 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(in) :: p_mem
1141 integer(I4B),
intent(in) :: ncid
1144 type(
distype),
pointer,
intent(in) :: dis
1146 character(len=*),
intent(in) :: mempath
1147 character(len=*),
intent(in) :: nc_tag
1148 character(len=*),
intent(in) :: pkgname
1149 character(len=*),
intent(in) :: gridmap_name
1150 logical(LGP),
intent(in) :: latlon
1151 integer(I4B),
intent(in) :: deflate
1152 integer(I4B),
intent(in) :: shuffle
1153 integer(I4B),
intent(in) :: chunk_z
1154 integer(I4B),
intent(in) :: chunk_y
1155 integer(I4B),
intent(in) :: chunk_x
1156 integer(I4B),
intent(in) :: iper
1157 character(len=*),
intent(in) :: nc_fname
1158 integer(I4B) :: var_id, axis_sz
1159 character(len=LINELENGTH) :: varname, longname
1163 if (idt%shape ==
'NROW' .or. &
1164 idt%shape ==
'NCOL' .or. &
1165 idt%shape ==
'NCPL' .or. &
1166 idt%shape ==
'NAUX NCPL')
then
1169 select case (idt%shape)
1176 longname =
export_longname(idt%longname, pkgname, idt%tagname, mempath, &
1177 component_type=idt%component_type, &
1178 subcomponent_type=idt%subcomponent_type)
1181 call nf_verify(nf90_redef(ncid), nc_fname)
1182 call nf_verify(nf90_def_var(ncid, varname, nf90_int, &
1183 (/axis_sz/), var_id), &
1187 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1190 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1191 (/nf90_fill_int/)), nc_fname)
1192 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1193 longname), nc_fname)
1199 call nf_verify(nf90_enddef(ncid), nc_fname)
1200 call nf_verify(nf90_put_var(ncid, var_id, p_mem), &
1205 var_ids%export, p_mem, &
1206 start=(/1, 1,
kper/), &
1207 count=(/dis%ncol, dis%nrow, 1/)), nc_fname)
1214 call nf_verify(nf90_redef(ncid), nc_fname)
1215 call nf_verify(nf90_def_var(ncid, varname, nf90_int, &
1216 (/dim_ids%x, dim_ids%y, dim_ids%z/), &
1220 call ncvar_chunk3d(ncid, var_id, chunk_x, chunk_y, chunk_z, nc_fname)
1222 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1225 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1226 (/nf90_fill_int/)), nc_fname)
1227 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1228 idt%longname), nc_fname)
1231 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1235 call nf_verify(nf90_enddef(ncid), nc_fname)
1236 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1, 1/), &
1237 count=(/dis%ncol, dis%nrow, dis%nlay/)), &
1242 var_ids%export, p_mem, &
1243 start=(/1, 1, 1,
kper/), &
1244 count=(/dis%ncol, dis%nrow, dis%nlay, 1/)), &
1253 nc_tag, pkgname, gridmap_name, latlon, deflate, &
1254 shuffle, chunk_z, chunk_y, chunk_x, nc_fname)
1255 integer(I4B),
dimension(:, :),
pointer,
contiguous,
intent(in) :: p_mem
1256 integer(I4B),
intent(in) :: ncid
1259 type(
distype),
pointer,
intent(in) :: dis
1261 character(len=*),
intent(in) :: mempath
1262 character(len=*),
intent(in) :: nc_tag
1263 character(len=*),
intent(in) :: pkgname
1264 character(len=*),
intent(in) :: gridmap_name
1265 logical(LGP),
intent(in) :: latlon
1266 integer(I4B),
intent(in) :: deflate
1267 integer(I4B),
intent(in) :: shuffle
1268 integer(I4B),
intent(in) :: chunk_z
1269 integer(I4B),
intent(in) :: chunk_y
1270 integer(I4B),
intent(in) :: chunk_x
1271 character(len=*),
intent(in) :: nc_fname
1272 character(len=LINELENGTH) :: varname
1273 integer(I4B) :: var_id
1278 call nf_verify(nf90_redef(ncid), nc_fname)
1279 call nf_verify(nf90_def_var(ncid, varname, nf90_int, &
1280 (/dim_ids%x, dim_ids%y/), var_id), &
1284 call ncvar_chunk2d(ncid, var_id, chunk_x, chunk_y, nc_fname)
1286 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1289 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1290 (/nf90_fill_int/)), nc_fname)
1291 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1292 idt%longname), nc_fname)
1295 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1299 call nf_verify(nf90_enddef(ncid), nc_fname)
1300 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1/), &
1301 count=(/dis%ncol, dis%nrow/)), &
1308 nc_tag, pkgname, gridmap_name, latlon, deflate, &
1309 shuffle, chunk_z, chunk_y, chunk_x, nc_fname)
1310 integer(I4B),
dimension(:, :, :),
pointer,
contiguous,
intent(in) :: p_mem
1311 integer(I4B),
intent(in) :: ncid
1314 type(
distype),
pointer,
intent(in) :: dis
1316 character(len=*),
intent(in) :: mempath
1317 character(len=*),
intent(in) :: nc_tag
1318 character(len=*),
intent(in) :: pkgname
1319 character(len=*),
intent(in) :: gridmap_name
1320 logical(LGP),
intent(in) :: latlon
1321 integer(I4B),
intent(in) :: deflate
1322 integer(I4B),
intent(in) :: shuffle
1323 integer(I4B),
intent(in) :: chunk_z
1324 integer(I4B),
intent(in) :: chunk_y
1325 integer(I4B),
intent(in) :: chunk_x
1326 character(len=*),
intent(in) :: nc_fname
1327 character(len=LINELENGTH) :: varname
1328 integer(I4B) :: var_id
1333 call nf_verify(nf90_redef(ncid), nc_fname)
1334 call nf_verify(nf90_def_var(ncid, varname, nf90_int, &
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 (/nf90_fill_int/)), nc_fname)
1346 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1347 idt%longname), 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/)), &
1363 nc_tag, pkgname, gridmap_name, latlon, deflate, &
1364 shuffle, chunk_z, chunk_y, chunk_x, iper, iaux, &
1367 real(DP),
dimension(:),
pointer,
contiguous,
intent(in) :: p_mem
1368 integer(I4B),
intent(in) :: ncid
1371 type(
distype),
pointer,
intent(in) :: dis
1373 character(len=*),
intent(in) :: mempath
1374 character(len=*),
intent(in) :: nc_tag
1375 character(len=*),
intent(in) :: pkgname
1376 character(len=*),
intent(in) :: gridmap_name
1377 logical(LGP),
intent(in) :: latlon
1378 integer(I4B),
intent(in) :: deflate
1379 integer(I4B),
intent(in) :: shuffle
1380 integer(I4B),
intent(in) :: chunk_z
1381 integer(I4B),
intent(in) :: chunk_y
1382 integer(I4B),
intent(in) :: chunk_x
1383 integer(I4B),
intent(in) :: iper
1384 integer(I4B),
intent(in) :: iaux
1385 character(len=*),
intent(in) :: nc_fname
1386 integer(I4B) :: var_id, axis_sz
1387 character(len=LINELENGTH) :: varname, longname
1389 if (idt%shape ==
'NROW' .or. &
1390 idt%shape ==
'NCOL' .or. &
1391 idt%shape ==
'NCPL' .or. &
1392 idt%shape ==
'NAUX NCPL')
then
1395 select case (idt%shape)
1403 longname =
export_longname(idt%longname, pkgname, idt%tagname, mempath, &
1405 component_type=idt%component_type, &
1406 subcomponent_type=idt%subcomponent_type)
1409 call nf_verify(nf90_redef(ncid), nc_fname)
1410 call nf_verify(nf90_def_var(ncid, varname, nf90_double, &
1411 (/axis_sz/), var_id), &
1415 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1418 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1419 (/nf90_fill_double/)), nc_fname)
1420 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1421 longname), nc_fname)
1427 call nf_verify(nf90_enddef(ncid), nc_fname)
1428 call nf_verify(nf90_put_var(ncid, var_id, p_mem), &
1433 var_ids%export, p_mem, &
1434 start=(/1, 1,
kper/), &
1435 count=(/dis%ncol, dis%nrow, 1/)), nc_fname)
1441 varname =
export_varname(pkgname, idt%tagname, mempath, iaux=iaux)
1442 longname =
export_longname(idt%longname, pkgname, idt%tagname, mempath, &
1444 component_type=idt%component_type, &
1445 subcomponent_type=idt%subcomponent_type)
1448 call nf_verify(nf90_redef(ncid), nc_fname)
1449 call nf_verify(nf90_def_var(ncid, varname, nf90_double, &
1450 (/dim_ids%x, dim_ids%y, dim_ids%z/), &
1454 call ncvar_chunk3d(ncid, var_id, chunk_x, chunk_y, chunk_z, nc_fname)
1456 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1459 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1460 (/nf90_fill_double/)), nc_fname)
1461 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1462 longname), nc_fname)
1465 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1469 call nf_verify(nf90_enddef(ncid), nc_fname)
1470 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1, 1/), &
1471 count=(/dis%ncol, dis%nrow, dis%nlay/)), &
1476 var_ids%export, p_mem, &
1477 start=(/1, 1, 1,
kper/), &
1478 count=(/dis%ncol, dis%nrow, dis%nlay, 1/)), &
1487 nc_tag, pkgname, gridmap_name, latlon, deflate, &
1488 shuffle, chunk_z, chunk_y, chunk_x, nc_fname)
1489 real(DP),
dimension(:, :),
pointer,
contiguous,
intent(in) :: p_mem
1490 integer(I4B),
intent(in) :: ncid
1493 type(
distype),
pointer,
intent(in) :: dis
1495 character(len=*),
intent(in) :: mempath
1496 character(len=*),
intent(in) :: nc_tag
1497 character(len=*),
intent(in) :: pkgname
1498 character(len=*),
intent(in) :: gridmap_name
1499 logical(LGP),
intent(in) :: latlon
1500 integer(I4B),
intent(in) :: deflate
1501 integer(I4B),
intent(in) :: shuffle
1502 integer(I4B),
intent(in) :: chunk_z
1503 integer(I4B),
intent(in) :: chunk_y
1504 integer(I4B),
intent(in) :: chunk_x
1505 character(len=*),
intent(in) :: nc_fname
1506 character(len=LINELENGTH) :: varname
1507 integer(I4B) :: var_id
1512 call nf_verify(nf90_redef(ncid), nc_fname)
1513 call nf_verify(nf90_def_var(ncid, varname, nf90_double, &
1514 (/dim_ids%x, dim_ids%y/), var_id), &
1518 call ncvar_chunk2d(ncid, var_id, chunk_x, chunk_y, nc_fname)
1520 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1523 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1524 (/nf90_fill_double/)), nc_fname)
1525 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1526 idt%longname), nc_fname)
1529 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1533 call nf_verify(nf90_enddef(ncid), nc_fname)
1534 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1/), &
1535 count=(/dis%ncol, dis%nrow/)), &
1542 nc_tag, pkgname, gridmap_name, latlon, deflate, &
1543 shuffle, chunk_z, chunk_y, chunk_x, nc_fname)
1544 real(DP),
dimension(:, :, :),
pointer,
contiguous,
intent(in) :: p_mem
1545 integer(I4B),
intent(in) :: ncid
1548 type(
distype),
pointer,
intent(in) :: dis
1550 character(len=*),
intent(in) :: mempath
1551 character(len=*),
intent(in) :: nc_tag
1552 character(len=*),
intent(in) :: pkgname
1553 character(len=*),
intent(in) :: gridmap_name
1554 logical(LGP),
intent(in) :: latlon
1555 integer(I4B),
intent(in) :: deflate
1556 integer(I4B),
intent(in) :: shuffle
1557 integer(I4B),
intent(in) :: chunk_z
1558 integer(I4B),
intent(in) :: chunk_y
1559 integer(I4B),
intent(in) :: chunk_x
1560 character(len=*),
intent(in) :: nc_fname
1561 integer(I4B) :: var_id
1562 character(len=LINELENGTH) :: varname, longname
1565 longname =
export_longname(idt%longname, pkgname, idt%tagname, mempath, &
1566 component_type=idt%component_type, &
1567 subcomponent_type=idt%subcomponent_type)
1570 call nf_verify(nf90_redef(ncid), nc_fname)
1571 call nf_verify(nf90_def_var(ncid, varname, nf90_double, &
1572 (/dim_ids%x, dim_ids%y, dim_ids%z/), var_id), &
1576 call ncvar_chunk3d(ncid, var_id, chunk_x, chunk_y, chunk_z, nc_fname)
1578 call ncvar_deflate(ncid, var_id, deflate, shuffle, nc_fname)
1581 call nf_verify(nf90_put_att(ncid, var_id,
'_FillValue', &
1582 (/nf90_fill_double/)), nc_fname)
1583 call nf_verify(nf90_put_att(ncid, var_id,
'long_name', &
1584 longname), nc_fname)
1587 call ncvar_gridmap(ncid, var_id, gridmap_name, latlon, nc_fname)
1591 call nf_verify(nf90_enddef(ncid), nc_fname)
1592 call nf_verify(nf90_put_var(ncid, var_id, p_mem, start=(/1, 1, 1/), &
1593 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, found)
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 wkt_to_cf_gridmapping(wkt)
map a WKT string to a CF-1.11 grid_mapping_name
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, component_type, subcomponent_type)
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