36 character(len=*),
intent(in) :: grid
37 logical(LGP) :: layered
55 input_fname, iout, kper)
56 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(in) :: int1d
57 integer(I4B),
dimension(:),
contiguous,
pointer,
intent(in) :: mshape
61 character(len=*),
intent(in) :: input_fname
62 integer(I4B),
intent(in) :: iout
63 integer(I4B),
optional,
intent(in) :: kper
66 logical(LGP) :: layered
68 layered = (idt%layered .and.
is_layered(nc_vars%grid))
74 if (
present(kper))
then
75 varid = nc_vars%varid(idt%mf6varname, period=kper)
77 varid = nc_vars%varid(idt%mf6varname)
91 integer(I4B),
dimension(:, :),
pointer,
contiguous,
intent(in) :: int2d
92 integer(I4B),
dimension(:),
contiguous,
pointer,
intent(in) :: mshape
96 character(len=*),
intent(in) :: input_fname
97 integer(I4B),
intent(in) :: iout
100 logical(LGP) :: layered
102 layered = (idt%layered .and.
is_layered(nc_vars%grid))
108 varid = nc_vars%varid(idt%mf6varname)
121 integer(I4B),
dimension(:, :, :),
pointer,
contiguous,
intent(in) :: int3d
122 integer(I4B),
dimension(:),
contiguous,
pointer,
intent(in) :: mshape
126 character(len=*),
intent(in) :: input_fname
127 integer(I4B),
intent(in) :: iout
129 integer(I4B) :: varid
130 logical(LGP) :: layered
132 layered = (idt%layered .and.
is_layered(nc_vars%grid))
138 varid = nc_vars%varid(idt%mf6varname)
150 input_fname, iout, kper, iaux)
151 real(DP),
dimension(:),
pointer,
contiguous,
intent(in) :: dbl1d
152 integer(I4B),
dimension(:),
contiguous,
pointer,
intent(in) :: mshape
156 character(len=*),
intent(in) :: input_fname
157 integer(I4B),
intent(in) :: iout
158 integer(I4B),
optional,
intent(in) :: kper
159 integer(I4B),
optional,
intent(in) :: iaux
161 integer(I4B) :: varid
162 logical(LGP) :: layered
164 if (
present(kper))
then
165 layered = (kper > 0 .and.
is_layered(nc_vars%grid))
167 layered = (idt%layered .and.
is_layered(nc_vars%grid))
171 if (
present(kper))
then
173 kper, input_fname, iaux)
179 if (
present(kper))
then
181 kper, input_fname, iaux)
183 varid = nc_vars%varid(idt%mf6varname)
197 real(DP),
dimension(:, :),
pointer,
contiguous,
intent(in) :: dbl2d
198 integer(I4B),
dimension(:),
contiguous,
pointer,
intent(in) :: mshape
202 character(len=*),
intent(in) :: input_fname
203 integer(I4B),
intent(in) :: iout
205 integer(I4B) :: varid
206 logical(LGP) :: layered
208 layered = (idt%layered .and.
is_layered(nc_vars%grid))
214 varid = nc_vars%varid(idt%mf6varname)
227 real(DP),
dimension(:, :, :),
pointer,
contiguous,
intent(in) :: dbl3d
228 integer(I4B),
dimension(:),
contiguous,
pointer,
intent(in) :: mshape
232 character(len=*),
intent(in) :: input_fname
233 integer(I4B),
intent(in) :: iout
235 integer(I4B) :: varid
236 logical(LGP) :: layered
238 layered = (idt%layered .and.
is_layered(nc_vars%grid))
244 varid = nc_vars%varid(idt%mf6varname)
258 integer(I4B),
dimension(:),
contiguous,
pointer,
intent(in) :: int1d
260 integer(I4B),
dimension(:),
contiguous,
pointer,
intent(in) :: mshape
263 integer(I4B),
intent(in) :: varid
264 character(len=*),
intent(in) :: input_fname
266 integer(I4B),
dimension(:),
allocatable :: array_shape
267 integer(I4B),
dimension(:, :, :),
contiguous,
pointer :: int3d_ptr
268 integer(I4B),
dimension(:, :),
contiguous,
pointer :: int2d_ptr
269 integer(I4B) :: nvals
274 if (idt%shape ==
'NODES')
then
276 nvals = product(mshape)
278 if (
size(mshape) == 3)
then
279 int3d_ptr(1:mshape(3), 1:mshape(2), 1:mshape(1)) => int1d(1:nvals)
280 call nf_verify(nf90_get_var(nc_vars%ncid, varid, int3d_ptr), &
282 else if (
size(mshape) == 2)
then
283 int2d_ptr(1:mshape(2), 1:mshape(1)) => int1d(1:nvals)
284 call nf_verify(nf90_get_var(nc_vars%ncid, varid, int2d_ptr), &
286 else if (
size(mshape) == 1)
then
287 call nf_verify(nf90_get_var(nc_vars%ncid, varid, int1d), nc_vars%nc_fname)
294 nvals = array_shape(1)
297 call nf_verify(nf90_get_var(nc_vars%ncid, varid, int1d), nc_vars%nc_fname)
309 integer(I4B),
dimension(:),
contiguous,
pointer,
intent(in) :: int1d
311 integer(I4B),
dimension(:),
contiguous,
pointer,
intent(in) :: mshape
314 character(len=*),
intent(in) :: input_fname
316 integer(I4B),
dimension(:),
allocatable :: layer_shape
317 integer(I4B) :: nlay, varid
318 integer(I4B) :: k, ncpl
319 integer(I4B) :: index_start, index_stop
320 integer(I4B),
dimension(:),
contiguous,
pointer :: int1d_ptr
326 ncpl = product(layer_shape)
329 varid = nc_vars%varid(idt%mf6varname, layer=k)
330 index_stop = index_start + ncpl - 1
331 int1d_ptr(1:ncpl) => int1d(index_start:index_stop)
332 call nf_verify(nf90_get_var(nc_vars%ncid, varid, int1d_ptr), &
334 index_start = index_stop + 1
346 integer(I4B),
dimension(:, :),
contiguous,
pointer,
intent(in) :: int2d
348 integer(I4B),
dimension(:),
contiguous,
pointer,
intent(in) :: mshape
351 integer(I4B),
intent(in) :: varid
352 character(len=*),
intent(in) :: input_fname
354 integer(I4B),
dimension(:),
contiguous,
pointer :: int1d_ptr
355 integer(I4B),
dimension(:),
allocatable :: array_shape
356 integer(I4B) :: ncpl, nlay
360 if (nc_vars%grid ==
'STRUCTURED')
then
361 call nf_verify(nf90_get_var(nc_vars%ncid, varid, int2d), nc_vars%nc_fname)
362 else if (nc_vars%grid ==
'LAYERED MESH')
then
364 ncpl = product(array_shape)
365 int1d_ptr(1:ncpl) => int2d(:, :)
366 call nf_verify(nf90_get_var(nc_vars%ncid, varid, int1d_ptr), &
379 integer(I4B),
dimension(:, :),
contiguous,
pointer,
intent(in) :: int2d
381 integer(I4B),
dimension(:),
contiguous,
pointer,
intent(in) :: mshape
384 character(len=*),
intent(in) :: input_fname
386 integer(I4B),
dimension(:),
allocatable :: layer_shape
388 integer(I4B) :: ncpl, nlay, varid
389 integer(I4B),
dimension(:),
contiguous,
pointer :: int1d_ptr
393 if (
size(mshape) == 3)
then
394 write (
errmsg,
'(a,a,a)') &
395 'Layered netcdf read not supported for DIS int2d type ('// &
396 trim(idt%tagname)//
').'
399 else if (
size(mshape) == 2)
then
401 ncpl = layer_shape(1)
403 varid = nc_vars%varid(idt%mf6varname, layer=k)
404 int1d_ptr(1:ncpl) => int2d(1:ncpl, k)
405 call nf_verify(nf90_get_var(nc_vars%ncid, varid, int1d_ptr), &
419 integer(I4B),
dimension(:, :, :),
contiguous,
pointer,
intent(in) :: int3d
421 integer(I4B),
dimension(:),
contiguous,
pointer,
intent(in) :: mshape
424 integer(I4B),
intent(in) :: varid
425 character(len=*),
intent(in) :: input_fname
428 call nf_verify(nf90_get_var(nc_vars%ncid, varid, int3d), nc_vars%nc_fname)
438 integer(I4B),
dimension(:, :, :),
contiguous,
pointer,
intent(in) :: int3d
440 integer(I4B),
dimension(:),
contiguous,
pointer,
intent(in) :: mshape
443 character(len=*),
intent(in) :: input_fname
445 integer(I4B),
dimension(:),
allocatable :: layer_shape
447 integer(I4B) :: ncpl, nlay, varid
448 integer(I4B) :: index_start, index_stop
449 integer(I4B),
dimension(:),
contiguous,
pointer :: int1d_ptr
456 ncpl = product(layer_shape)
459 varid = nc_vars%varid(idt%mf6varname, layer=k)
460 index_stop = index_start + ncpl - 1
461 int1d_ptr(1:ncpl) => int3d(:, :, k:k)
462 call nf_verify(nf90_get_var(nc_vars%ncid, varid, int1d_ptr), &
464 index_start = index_stop + 1
476 real(DP),
dimension(:),
contiguous,
pointer,
intent(in) :: dbl1d
478 integer(I4B),
dimension(:),
contiguous,
pointer,
intent(in) :: mshape
481 integer(I4B),
intent(in) :: varid
482 character(len=*),
intent(in) :: input_fname
484 integer(I4B),
dimension(:),
allocatable :: array_shape
485 real(DP),
dimension(:, :, :),
contiguous,
pointer :: dbl3d_ptr
486 real(DP),
dimension(:, :),
contiguous,
pointer :: dbl2d_ptr
487 integer(I4B) :: nvals
492 if (idt%shape ==
'NODES')
then
494 nvals = product(mshape)
496 if (
size(mshape) == 3)
then
497 dbl3d_ptr(1:mshape(3), 1:mshape(2), 1:mshape(1)) => dbl1d(1:nvals)
498 call nf_verify(nf90_get_var(nc_vars%ncid, varid, dbl3d_ptr), &
500 else if (
size(mshape) == 2)
then
501 dbl2d_ptr(1:mshape(2), 1:mshape(1)) => dbl1d(1:nvals)
502 call nf_verify(nf90_get_var(nc_vars%ncid, varid, dbl2d_ptr), &
504 else if (
size(mshape) == 1)
then
505 call nf_verify(nf90_get_var(nc_vars%ncid, varid, dbl1d), nc_vars%nc_fname)
512 nvals = array_shape(1)
515 call nf_verify(nf90_get_var(nc_vars%ncid, varid, dbl1d), nc_vars%nc_fname)
525 iper, input_fname, iaux)
528 real(DP),
dimension(:),
contiguous,
pointer,
intent(in) :: dbl1d
530 integer(I4B),
dimension(:),
contiguous,
pointer,
intent(in) :: mshape
533 integer(I4B),
intent(in) :: iper
534 character(len=*),
intent(in) :: input_fname
535 integer(I4B),
optional,
intent(in) :: iaux
537 real(DP),
dimension(:, :, :),
contiguous,
pointer :: dbl3d
538 integer(I4B) :: nvals, varid
539 integer(I4B) :: n, i, j, k
545 if (
present(iaux))
then
546 varid = nc_vars%varid(idt%mf6varname, period=iper, iaux=iaux)
548 varid = nc_vars%varid(idt%mf6varname, period=iper)
551 if (idt%shape ==
'NODES')
then
554 'IDM NetCDF load_double1d_spd NODES var shape not supported => '// &
558 else if (idt%shape ==
'NCPL' .or. idt%shape ==
'NAUX NCPL')
then
560 if (
size(mshape) == 3)
then
562 allocate (dbl3d(mshape(3), mshape(2), mshape(1)))
564 call nf_verify(nf90_get_var(nc_vars%ncid, varid, dbl3d), &
568 do k = 1,
size(dbl3d, dim=3)
569 do i = 1,
size(dbl3d, dim=2)
570 do j = 1,
size(dbl3d, dim=1)
571 if (n <
size(dbl1d))
then
576 if (dbl3d(j, i, k) /=
dnodata)
then
577 dbl1d(n) = dbl3d(j, i, k)
583 else if (
size(mshape) == 2)
then
586 'IDM NetCDF load_double1d_spd DISV model not supported => '// &
599 real(DP),
dimension(:),
contiguous,
pointer,
intent(in) :: dbl1d
601 integer(I4B),
dimension(:),
contiguous,
pointer,
intent(in) :: mshape
604 character(len=*),
intent(in) :: input_fname
606 integer(I4B),
dimension(:),
allocatable :: layer_shape
607 integer(I4B) :: nlay, varid
608 integer(I4B) :: k, ncpl
609 integer(I4B) :: index_start, index_stop
610 real(DP),
dimension(:),
contiguous,
pointer :: dbl1d_ptr
617 ncpl = product(layer_shape)
620 varid = nc_vars%varid(idt%mf6varname, layer=k)
621 index_stop = index_start + ncpl - 1
622 dbl1d_ptr(1:ncpl) => dbl1d(index_start:index_stop)
623 call nf_verify(nf90_get_var(nc_vars%ncid, varid, dbl1d_ptr), &
625 index_start = index_stop + 1
635 iper, input_fname, iaux)
638 real(DP),
dimension(:),
contiguous,
pointer,
intent(in) :: dbl1d
640 integer(I4B),
dimension(:),
contiguous,
pointer,
intent(in) :: mshape
643 integer(I4B),
intent(in) :: iper
644 character(len=*),
intent(in) :: input_fname
645 integer(I4B),
optional,
intent(in) :: iaux
647 integer(I4B),
dimension(:),
allocatable :: layer_shape
648 integer(I4B) :: nlay, varid
649 integer(I4B) :: k, n, ncpl
650 integer(I4B) :: index_start, index_stop
651 real(DP),
dimension(:),
contiguous,
pointer :: dbl1d_ptr
655 ncpl = product(layer_shape)
656 allocate (dbl1d_ptr(ncpl))
660 index_stop = index_start + ncpl - 1
661 if (
present(iaux))
then
662 varid = nc_vars%varid(idt%mf6varname, layer=k, period=iper, iaux=iaux)
664 varid = nc_vars%varid(idt%mf6varname, layer=k, period=iper)
666 call nf_verify(nf90_get_var(nc_vars%ncid, varid, dbl1d_ptr), &
669 if (dbl1d_ptr(n) /=
dnodata)
then
670 dbl1d(n) = dbl1d_ptr(n)
676 deallocate (dbl1d_ptr)
687 real(DP),
dimension(:, :),
contiguous,
pointer,
intent(in) :: dbl2d
689 integer(I4B),
dimension(:),
contiguous,
pointer,
intent(in) :: mshape
692 integer(I4B),
intent(in) :: varid
693 character(len=*),
intent(in) :: input_fname
695 real(DP),
dimension(:),
contiguous,
pointer :: dbl1d_ptr
696 integer(I4B),
dimension(:),
allocatable :: array_shape
697 integer(I4B) :: ncpl, nlay
701 if (nc_vars%grid ==
'STRUCTURED')
then
702 call nf_verify(nf90_get_var(nc_vars%ncid, varid, dbl2d), nc_vars%nc_fname)
703 else if (nc_vars%grid ==
'LAYERED MESH')
then
705 ncpl = product(array_shape)
706 dbl1d_ptr(1:ncpl) => dbl2d(:, :)
707 call nf_verify(nf90_get_var(nc_vars%ncid, varid, dbl1d_ptr), &
720 real(DP),
dimension(:, :),
contiguous,
pointer,
intent(in) :: dbl2d
722 integer(I4B),
dimension(:),
contiguous,
pointer,
intent(in) :: mshape
725 character(len=*),
intent(in) :: input_fname
727 integer(I4B),
dimension(:),
allocatable :: layer_shape
729 integer(I4B) :: ncpl, nlay, varid
730 real(DP),
dimension(:),
contiguous,
pointer :: dbl1d_ptr
734 if (
size(mshape) == 3)
then
735 write (
errmsg,
'(a,a,a)') &
736 'Layered netcdf read not supported for DIS dbl2d type ('// &
737 trim(idt%tagname)//
').'
740 else if (
size(mshape) == 2)
then
742 ncpl = layer_shape(1)
744 varid = nc_vars%varid(idt%mf6varname, layer=k)
745 dbl1d_ptr(1:ncpl) => dbl2d(1:ncpl, k)
746 call nf_verify(nf90_get_var(nc_vars%ncid, varid, dbl1d_ptr), &
760 real(DP),
dimension(:, :, :),
contiguous,
pointer,
intent(in) :: dbl3d
762 integer(I4B),
dimension(:),
contiguous,
pointer,
intent(in) :: mshape
765 integer(I4B),
intent(in) :: varid
766 character(len=*),
intent(in) :: input_fname
769 call nf_verify(nf90_get_var(nc_vars%ncid, varid, dbl3d), nc_vars%nc_fname)
779 real(DP),
dimension(:, :, :),
contiguous,
pointer,
intent(in) :: dbl3d
781 integer(I4B),
dimension(:),
contiguous,
pointer,
intent(in) :: mshape
784 character(len=*),
intent(in) :: input_fname
786 integer(I4B),
dimension(:),
allocatable :: layer_shape
788 integer(I4B) :: ncpl, nlay, varid
789 integer(I4B) :: index_start, index_stop
790 real(DP),
dimension(:),
contiguous,
pointer :: dbl1d_ptr
796 ncpl = product(layer_shape)
799 varid = nc_vars%varid(idt%mf6varname, layer=k)
800 index_stop = index_start + ncpl - 1
801 dbl1d_ptr(1:ncpl) => dbl3d(:, :, k:k)
802 call nf_verify(nf90_get_var(nc_vars%ncid, varid, dbl1d_ptr), &
804 index_start = index_stop + 1
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
real(dp), parameter dnodata
real no data constant
This module defines variable data types.
This module contains the NCArrayReaderModule.
subroutine load_double1d_layered(dbl1d, mf6_input, mshape, idt, nc_vars, input_fname)
load type 1d double layered
subroutine nc_array_load_int2d(int2d, mshape, idt, mf6_input, nc_vars, input_fname, iout)
Load NetCDF integer 2D array.
subroutine load_double3d_layered(dbl3d, mf6_input, mshape, idt, nc_vars, input_fname)
load type 3d double layered
subroutine nc_array_load_dbl2d(dbl2d, mshape, idt, mf6_input, nc_vars, input_fname, iout)
Load NetCDF double 2D array.
subroutine load_integer3d_layered(int3d, mf6_input, mshape, idt, nc_vars, input_fname)
load type 3d integer layered
subroutine load_integer1d_type(int1d, mf6_input, mshape, idt, nc_vars, varid, input_fname)
load type 1d integer
subroutine load_double3d_type(dbl3d, mf6_input, mshape, idt, nc_vars, varid, input_fname)
load type 3d double
logical(lgp) function is_layered(grid)
does the grid support per layer variables
subroutine nc_array_load_int3d(int3d, mshape, idt, mf6_input, nc_vars, input_fname, iout)
Load NetCDF integer 3D array.
subroutine load_double2d_type(dbl2d, mf6_input, mshape, idt, nc_vars, varid, input_fname)
load type 2d double
subroutine load_integer3d_type(int3d, mf6_input, mshape, idt, nc_vars, varid, input_fname)
load type 3d integer
subroutine load_integer2d_layered(int2d, mf6_input, mshape, idt, nc_vars, input_fname)
load type 2d integer layered
subroutine load_integer2d_type(int2d, mf6_input, mshape, idt, nc_vars, varid, input_fname)
load type 2d integer
subroutine nc_array_load_int1d(int1d, mshape, idt, mf6_input, nc_vars, input_fname, iout, kper)
Load NetCDF integer 1D array.
subroutine load_double1d_layered_spd(dbl1d, mf6_input, mshape, idt, nc_vars, iper, input_fname, iaux)
load type 1d double layered
subroutine load_integer1d_layered(int1d, mf6_input, mshape, idt, nc_vars, input_fname)
load type 1d integer layered
subroutine load_double1d_type(dbl1d, mf6_input, mshape, idt, nc_vars, varid, input_fname)
load type 1d double
subroutine load_double2d_layered(dbl2d, mf6_input, mshape, idt, nc_vars, input_fname)
load type 2d double layered
subroutine nc_array_load_dbl3d(dbl3d, mshape, idt, mf6_input, nc_vars, input_fname, iout)
Load NetCDF double 3D array.
subroutine nc_array_load_dbl1d(dbl1d, mshape, idt, mf6_input, nc_vars, input_fname, iout, kper, iaux)
Load NetCDF double 1D array.
subroutine load_double1d_spd(dbl1d, mf6_input, mshape, idt, nc_vars, iper, input_fname, iaux)
load type 1d double
This module contains the NCFileVarsModule.
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_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
This module contains the SourceCommonModule.
subroutine, public get_layered_shape(mshape, nlay, layer_shape)
subroutine, public get_shape_from_string(shape_string, array_shape, memoryPath)
Type describing input variables for a package in NetCDF file.