44 character(len=LINELENGTH),
dimension(:),
allocatable :: param_names
46 integer(I4B),
dimension(:, :),
allocatable :: varids_param
47 integer(I4B),
dimension(:, :),
allocatable :: varids_aux
48 integer(I4B),
dimension(:),
pointer,
contiguous :: mshape => null()
49 integer(I4B),
pointer :: iper
51 integer(I4B) :: nparam
53 integer(I4B),
dimension(:),
pointer, &
54 contiguous :: aux_reads => null()
55 logical(LGP),
dimension(:),
allocatable :: param_value
56 logical(LGP),
dimension(:),
allocatable :: aux_value
69 character(len=LINELENGTH) :: title
70 character(len=LINELENGTH) :: model
71 character(len=LINELENGTH) :: mesh
72 character(len=LINELENGTH) :: grid
73 character(len=LINELENGTH) :: history
74 character(len=LINELENGTH) :: source
75 character(len=LINELENGTH) :: conventions
76 character(len=LINELENGTH) :: stdname
77 character(len=LINELENGTH) :: longname
86 character(len=LENMODELNAME) :: modelname
87 character(len=LENCOMPONENTNAME) :: modeltype
88 character(len=LINELENGTH) :: modelfname
89 character(len=LINELENGTH) :: nc_fname
90 character(len=LINELENGTH) :: gridmap_name
91 character(len=LINELENGTH) :: mesh_name =
'mesh'
92 character(len=LENMEMPATH) :: dis_mempath
93 character(len=LENMEMPATH) :: ncf_mempath
94 character(len=LENBIGLINE) :: wkt
95 character(len=LENBIGLINE) :: crs_wkt
96 character(len=LINELENGTH) :: datetime
97 character(len=LINELENGTH) :: xname
98 character(len=LINELENGTH) :: lenunits
100 real(dp),
dimension(:),
pointer,
contiguous :: x
101 integer(I4B) :: disenum
103 integer(I4B) :: totnstp
104 integer(I4B),
pointer :: deflate
105 integer(I4B),
pointer :: shuffle
106 integer(I4B),
pointer :: input_attr
107 integer(I4B),
pointer :: chunk_time
109 logical(LGP) :: chunking_active
150 character(len=*),
intent(in) :: ilayer_varname
151 integer(I4B),
intent(in) :: ilayer
159 subroutine epkg_init(this, mf6_input, mshape, naux, param_names, &
167 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(in) :: mshape
168 integer(I4B),
intent(in) :: naux
169 character(len=LINELENGTH),
dimension(:),
allocatable, &
170 intent(in) :: param_names
171 integer(I4B),
intent(in) :: nparam
173 character(len=LENVARNAME) :: rs_varname
174 character(len=LENMEMPATH) :: input_mempath
175 integer(I4B),
pointer :: rsvar
177 this%mf6_input = mf6_input
178 this%mshape => mshape
184 subcomponent=mf6_input%subcomponent_name, &
188 allocate (this%param_names(nparam))
189 allocate (this%param_reads(nparam))
190 allocate (this%varids_param(nparam, mshape(1)))
191 allocate (this%varids_aux(naux, mshape(1)))
195 this%param_names(n) = param_names(n)
196 rs_varname =
rsv_name(param_names(n))
197 call mem_setptr(rsvar, rs_varname, mf6_input%mempath)
198 this%param_reads(n)%invar => rsvar
202 call mem_setptr(this%iper,
'IPER', mf6_input%mempath)
205 call mem_setptr(this%aux_reads,
'INAUXVARS', mf6_input%mempath)
209 allocate (this%param_value(nparam))
210 allocate (this%aux_value(naux))
211 this%param_value = .false.
212 this%aux_value = .false.
214 if (param_names(n) ==
'I'//trim(mf6_input%subcomponent_type(1:3))) &
215 this%param_value(n) = .true.
229 if (this%iper /=
kper)
return
230 do n = 1, this%nparam
231 call set_state(this%param_reads(n)%invar, this%param_value(n))
234 call set_state(this%aux_reads(n), this%aux_value(n))
241 integer(I4B),
intent(in) :: invar
242 logical(LGP),
intent(inout) :: has_value
257 integer(I4B),
intent(in) :: iparam
258 logical(LGP) :: exported
259 if (this%param_names(iparam) ==
'AUX')
then
260 exported = any(this%aux_value)
262 exported = this%param_value(iparam)
270 integer(I4B),
intent(in) :: iaux
271 logical(LGP) :: exported
272 exported = this%aux_value(iaux)
284 real(DP),
dimension(:),
intent(in) :: vals
285 real(DP),
dimension(:),
intent(inout) :: nodes
286 integer(I4B),
dimension(:),
pointer,
contiguous :: nodeulist
287 integer(I4B),
pointer :: nbound
289 call mem_setptr(nodeulist,
'NODEULIST', this%mf6_input%mempath)
290 if (
size(nodeulist) == 0)
then
291 nodes(1:
size(vals)) = vals
293 call mem_setptr(nbound,
'NBOUND', this%mf6_input%mempath)
295 nodes(nodeulist(n)) = vals(n)
305 if (
allocated(this%param_names))
deallocate (this%param_names)
306 if (
allocated(this%param_value))
deallocate (this%param_value)
307 if (
allocated(this%aux_value))
deallocate (this%aux_value)
308 nullify (this%aux_reads)
313 subroutine set(this, modelname, modeltype, modelfname, nctype, disenum)
317 character(len=*),
intent(in) :: modelname
318 character(len=*),
intent(in) :: modeltype
319 character(len=*),
intent(in) :: modelfname
320 integer(I4B),
intent(in) :: nctype
321 integer(I4B),
intent(in) :: disenum
330 this%conventions =
''
335 this%conventions =
'CF-1.13'
337 trim(this%conventions)//
' UGRID-1.0'
340 select case (modeltype)
342 this%title = trim(modelname)//
' hydraulic head'
343 this%longname =
'head'
345 this%title = trim(modelname)//
' concentration'
346 this%longname =
'concentration'
348 this%title = trim(modelname)//
' temperature'
349 this%longname =
'temperature'
351 errmsg = trim(modeltype)//
' models not supported for NetCDF export.'
357 this%title = trim(this%title)//
' array input'
362 this%mesh =
'layered'
366 if (disenum ==
dis)
then
367 this%grid =
'structured'
368 else if (disenum ==
disv)
then
373 this%model = trim(modeltype)//
': '//trim(modelname)
377 this%source =
'MODFLOW 6 '//trim(adjustl(
fullversion))
380 call date_and_time(values=values)
381 write (this%history,
'(a,i0,a,i0,a,i0,a,i0,a,i0,a,i0,a,i0)') &
382 'first created ', values(1),
'/', values(2),
'/', values(3),
' ', &
383 values(5),
':', values(6),
':', values(7),
'.', values(8)
388 subroutine export_init(this, modelname, modeltype, modelfname, nc_fname, &
389 disenum, nctype, iout)
398 character(len=*),
intent(in) :: modelname
399 character(len=*),
intent(in) :: modeltype
400 character(len=*),
intent(in) :: modelfname
401 character(len=*),
intent(in) :: nc_fname
402 integer(I4B),
intent(in) :: disenum
403 integer(I4B),
intent(in) :: nctype
404 integer(I4B),
intent(in) :: iout
405 character(len=LENMEMPATH) :: model_mempath
409 allocate (this%deflate)
410 allocate (this%shuffle)
411 allocate (this%input_attr)
412 allocate (this%chunk_time)
415 this%modelname = modelname
416 this%modeltype = modeltype
417 this%modelfname = modelfname
418 this%nc_fname = nc_fname
419 this%gridmap_name =
''
420 this%ncf_mempath =
''
426 this%disenum = disenum
434 this%chunking_active = .false.
437 call this%annotation%set(modelname, modeltype, modelfname, nctype, disenum)
440 select case (modeltype)
444 this%xname =
'concentration'
446 this%xname =
'temperature'
448 errmsg = trim(modeltype)//
' models not supported for NetCDF export.'
454 if (disenum ==
dis)
then
456 else if (disenum ==
disu)
then
458 else if (disenum ==
disv)
then
467 if (
filein_fname(this%ncf_mempath,
'NCF6_MEMPATH', this%dis_mempath, &
471 call mem_set_value(this%crs_wkt,
'CRS_WKT', this%ncf_mempath, &
473 call mem_set_value(this%deflate,
'DEFLATE', this%ncf_mempath, &
475 call mem_set_value(this%shuffle,
'SHUFFLE', this%ncf_mempath, &
477 call mem_set_value(this%input_attr,
'ATTR_OFF', this%ncf_mempath, &
479 call mem_set_value(this%chunk_time,
'CHUNK_TIME', this%ncf_mempath, &
480 ncf_found%chunk_time)
483 if (ncf_found%wkt .or. ncf_found%crs_wkt)
then
484 this%gridmap_name =
'projection'
488 if (ncf_found%attr_off)
then
494 this%datetime =
'days since '//trim(
datetime0)
497 this%datetime =
'days since 1970-01-01T00:00:00'
504 this%totnstp = sum(
nstp)
513 integer(I4B),
intent(in) :: idx
515 class(*),
pointer :: obj
517 obj => this%pkglist%GetItem(idx)
518 if (
associated(obj))
then
533 character(len=*),
intent(in) :: pkgname
535 character(len=LINELENGTH) :: attr
537 if (this%input_attr > 0)
then
549 integer(I4B) :: n,
istp
565 character(len=*),
intent(in) :: pkgname
566 character(len=*),
intent(in) :: tagname
567 character(len=*),
intent(in) :: mempath
568 integer(I4B),
optional,
intent(in) :: layer
569 integer(I4B),
optional,
intent(in) :: iaux
570 character(len=LINELENGTH) :: varname
572 contiguous :: auxnames
573 character(len=LINELENGTH) :: pname, vname
577 if (
present(iaux))
then
579 if (tagname ==
'AUX')
then
581 call mem_setptr(auxnames,
'AUXILIARY', mempath)
582 vname = auxnames(iaux)
589 varname = trim(pname)//
'_'//trim(vname)
591 if (
present(layer))
then
594 write (varname,
'(a,i0)') trim(varname)//
'_l', layer
602 component_type, subcomponent_type)
result(lname)
607 character(len=*),
intent(in) :: longname
608 character(len=*),
intent(in) :: pkgname
609 character(len=*),
intent(in) :: tagname
610 character(len=*),
intent(in) :: mempath
611 integer(I4B),
optional,
intent(in) :: layer
612 integer(I4B),
optional,
intent(in) :: iaux
613 character(len=*),
optional,
intent(in) :: component_type
614 character(len=*),
optional,
intent(in) :: subcomponent_type
615 character(len=LINELENGTH) :: lname
617 contiguous :: auxnames
618 character(len=LINELENGTH) :: pname, vname, auxname
623 if (longname ==
'')
then
624 lname = trim(pname)//
' '//trim(vname)
627 if (
present(component_type) .and.
present(subcomponent_type))
then
629 lname = trim(pname)//
' '//trim(lname)
634 if (
present(iaux))
then
636 if (tagname ==
'AUX')
then
638 call mem_setptr(auxnames,
'AUXILIARY', mempath)
639 auxname = auxnames(iaux)
641 lname = trim(lname)//
' '//trim(auxname)
646 if (
present(layer))
then
648 write (lname,
'(a,i0)') trim(lname)//
' layer ', layer
660 do idx = 1, this%pkglist%Count()
661 export_pkg => this%get(idx)
663 if (export_pkg%eper >=
kper) cycle
665 call this%package_step(export_pkg)
667 export_pkg%eper =
kper
682 character(len=*),
intent(in) :: wkt
683 character(len=LINELENGTH) :: gmname
684 character(len=LINELENGTH) :: proj_name
685 character(len=LENBIGLINE) :: wkt_upper
686 integer :: istart, iend
696 istart = index(wkt_upper,
'PROJECTION[')
697 if (istart /= 0)
then
698 istart = istart + len(
'PROJECTION[')
699 do while (istart <= len(wkt))
700 if (wkt(istart:istart) ==
'"')
exit
703 if (istart > len(wkt))
return
705 iend = index(wkt(istart:),
'"')
706 if (iend == 0)
return
707 iend = istart + iend - 2
708 if (iend < istart)
return
709 proj_name = wkt(istart:iend)
711 select case (trim(proj_name))
712 case (
'TRANSVERSE_MERCATOR')
713 gmname =
'transverse_mercator'
714 case (
'LAMBERT_CONFORMAL_CONIC_2SP',
'LAMBERT_CONFORMAL_CONIC_1SP')
715 gmname =
'lambert_conformal_conic'
716 case (
'ALBERS_CONIC_EQUAL_AREA')
717 gmname =
'albers_conical_equal_area'
718 case (
'MERCATOR_1SP',
'MERCATOR_2SP')
720 case (
'POLAR_STEREOGRAPHIC')
721 gmname =
'polar_stereographic'
727 istart = index(wkt_upper,
'METHOD[')
728 if (istart == 0)
return
729 istart = istart + len(
'METHOD[')
730 do while (istart <= len(wkt))
731 if (wkt(istart:istart) ==
'"')
exit
734 if (istart > len(wkt))
return
736 iend = index(wkt(istart:),
'"')
737 if (iend == 0)
return
738 iend = istart + iend - 2
739 if (iend < istart)
return
740 proj_name = wkt(istart:iend)
742 select case (trim(proj_name))
743 case (
'TRANSVERSE MERCATOR')
744 gmname =
'transverse_mercator'
745 case (
'LAMBERT CONIC CONFORMAL (2SP)',
'LAMBERT CONIC CONFORMAL (1SP)')
746 gmname =
'lambert_conformal_conic'
747 case (
'ALBERS EQUAL AREA')
748 gmname =
'albers_conical_equal_area'
749 case (
'MERCATOR (VARIANT A)',
'MERCATOR (VARIANT B)')
751 case (
'POLAR STEREOGRAPHIC (VARIANT A)',
'POLAR STEREOGRAPHIC (VARIANT B)')
752 gmname =
'polar_stereographic'
765 character(len=*),
intent(in) :: wkt
766 character(len=*),
intent(in) :: name
767 logical(LGP),
intent(out) :: found
769 character(len=LENBIGLINE) :: wkt_upper
770 character(len=LINELENGTH) :: target_upper
771 integer :: ipos, istart, iend, ios, wkt_len
775 wkt_len = len_trim(wkt)
776 target_upper =
'"'//trim(name)//
'"'
780 ipos = index(wkt_upper(1:wkt_len), trim(target_upper))
781 if (ipos == 0)
return
783 istart = ipos + len_trim(target_upper)
784 do while (istart <= wkt_len)
785 if (wkt(istart:istart) ==
',')
exit
790 do while (iend <= wkt_len)
791 if (wkt(iend:iend) ==
',' .or. wkt(iend:iend) ==
']')
exit
794 if (iend <= istart)
return
795 read (wkt(istart:iend - 1), *, iostat=ios)
value
796 if (ios == 0) found = .true.
807 character(len=*),
intent(in) :: wkt
808 real(DP),
intent(out) :: semi_major_axis
809 real(DP),
intent(out) :: inverse_flattening
810 logical(LGP),
intent(out) :: found
811 character(len=LENBIGLINE) :: wkt_upper
812 integer :: ipos, i, iend, ios, wkt_len, nquote
815 semi_major_axis =
dzero
816 inverse_flattening =
dzero
817 wkt_len = len_trim(wkt)
821 ipos = index(wkt_upper(1:wkt_len),
'SPHEROID[')
822 if (ipos == 0) ipos = index(wkt_upper(1:wkt_len),
'ELLIPSOID[')
823 if (ipos == 0)
return
828 do while (i <= wkt_len)
829 if (wkt(i:i) ==
'"') nquote = nquote + 1
830 if (nquote == 2)
exit
833 if (nquote < 2)
return
835 if (wkt(i:i) ==
',') i = i + 1
838 do while (iend <= wkt_len)
839 if (wkt(iend:iend) ==
',')
exit
842 if (iend <= i)
return
843 read (wkt(i:iend - 1), *, iostat=ios) semi_major_axis
848 do while (iend <= wkt_len)
849 if (wkt(iend:iend) ==
',' .or. wkt(iend:iend) ==
']')
exit
852 if (iend <= i)
return
853 read (wkt(i:iend - 1), *, iostat=ios) inverse_flattening
854 if (ios == 0) found = .true.
865 latitude_of_projection_origin, &
866 scale_factor_at_central_meridian, &
867 false_easting, false_northing, &
868 semi_major_axis, inverse_flattening, &
870 character(len=*),
intent(in) :: wkt
871 real(dp),
intent(out) :: longitude_of_central_meridian
872 real(dp),
intent(out) :: latitude_of_projection_origin
873 real(dp),
intent(out) :: scale_factor_at_central_meridian
874 real(dp),
intent(out) :: false_easting
875 real(dp),
intent(out) :: false_northing
876 real(dp),
intent(out) :: semi_major_axis
877 real(dp),
intent(out) :: inverse_flattening
878 logical(LGP),
intent(out) :: found
879 logical(LGP) :: f1, f2, f3, f4, f5, f6
881 longitude_of_central_meridian =
wkt_find_param(wkt,
'central_meridian', f1)
882 if (.not. f1) longitude_of_central_meridian = &
885 latitude_of_projection_origin =
wkt_find_param(wkt,
'latitude_of_origin', f2)
886 if (.not. f2) latitude_of_projection_origin = &
889 scale_factor_at_central_meridian =
wkt_find_param(wkt,
'scale_factor', f3)
890 if (.not. f3) scale_factor_at_central_meridian = &
894 if (.not. f4) false_easting =
wkt_find_param(wkt,
'False easting', f4)
897 if (.not. f5) false_northing =
wkt_find_param(wkt,
'False northing', f5)
901 found = f1 .and. f2 .and. f3 .and. f4 .and. f5 .and. f6
915 standard_parallel_2, &
916 longitude_of_central_meridian, &
917 latitude_of_projection_origin, &
918 false_easting, false_northing, &
920 inverse_flattening, is_2sp, found)
921 character(len=*),
intent(in) :: wkt
922 real(dp),
intent(out) :: standard_parallel_1
923 real(dp),
intent(out) :: standard_parallel_2
924 real(dp),
intent(out) :: longitude_of_central_meridian
925 real(dp),
intent(out) :: latitude_of_projection_origin
926 real(dp),
intent(out) :: false_easting
927 real(dp),
intent(out) :: false_northing
928 real(dp),
intent(out) :: semi_major_axis
929 real(dp),
intent(out) :: inverse_flattening
930 logical(LGP),
intent(out) :: is_2sp
931 logical(LGP),
intent(out) :: found
932 logical(LGP) :: f1, f2, f3, f4, f5, f6, f7
934 standard_parallel_2 =
wkt_find_param(wkt,
'standard_parallel_2', f2)
935 if (.not. f2) standard_parallel_2 = &
938 if (.not. is_2sp)
then
943 standard_parallel_1 =
wkt_find_param(wkt,
'standard_parallel_1', f1)
944 if (.not. f1) standard_parallel_1 = &
947 longitude_of_central_meridian =
wkt_find_param(wkt,
'central_meridian', f3)
948 if (.not. f3) longitude_of_central_meridian = &
951 latitude_of_projection_origin =
wkt_find_param(wkt,
'latitude_of_origin', f4)
952 if (.not. f4) latitude_of_projection_origin = &
956 if (.not. f5) false_easting = &
960 if (.not. f6) false_northing = &
965 found = f1 .and. f3 .and. f4 .and. f5 .and. f6 .and. f7
975 standard_parallel_2, &
976 longitude_of_central_meridian, &
977 latitude_of_projection_origin, &
981 inverse_flattening, found)
982 character(len=*),
intent(in) :: wkt
983 real(dp),
intent(out) :: standard_parallel_1
984 real(dp),
intent(out) :: standard_parallel_2
985 real(dp),
intent(out) :: longitude_of_central_meridian
986 real(dp),
intent(out) :: latitude_of_projection_origin
987 real(dp),
intent(out) :: false_easting
988 real(dp),
intent(out) :: false_northing
989 real(dp),
intent(out) :: semi_major_axis
990 real(dp),
intent(out) :: inverse_flattening
991 logical(LGP),
intent(out) :: found
992 logical(LGP) :: f1, f2, f3, f4, f5, f6, f7
994 standard_parallel_1 =
wkt_find_param(wkt,
'standard_parallel_1', f1)
995 if (.not. f1) standard_parallel_1 = &
998 standard_parallel_2 =
wkt_find_param(wkt,
'standard_parallel_2', f2)
999 if (.not. f2) standard_parallel_2 = &
1002 longitude_of_central_meridian =
wkt_find_param(wkt,
'longitude_of_center', f3)
1003 if (.not. f3) longitude_of_central_meridian = &
1006 latitude_of_projection_origin =
wkt_find_param(wkt,
'latitude_of_center', f4)
1007 if (.not. f4) latitude_of_projection_origin = &
1011 if (.not. f5) false_easting = &
1015 if (.not. f6) false_northing = &
1020 found = f1 .and. f2 .and. f3 .and. f4 .and. f5 .and. f6 .and. f7
1037 character(len=*),
intent(in) :: wkt
1038 real(dp),
intent(in) :: xorigin, yorigin, angrot
1039 character(len=LENBIGLINE) :: derived_wkt
1040 character(len=LENBIGLINE) :: wkt_trim, wkt_upper, base_body, conversion
1041 character(len=30) :: a0s, a1s, a2s, b0s, b1s, b2s
1042 integer :: nstart, i, depth, closures, iend, wkt_len
1043 real(dp) :: ang, a0, a1, a2, b0, b1, b2
1048 wkt_trim = trim(adjustl(wkt))
1049 wkt_len = len_trim(wkt_trim)
1050 wkt_upper = wkt_trim
1052 if (wkt_len < 9 .or. wkt_upper(1:8) /=
'PROJCRS[')
return
1061 do i = nstart, wkt_len
1062 if (wkt_trim(i:i) ==
'[')
then
1064 else if (wkt_trim(i:i) ==
']')
then
1066 if (depth == 0)
then
1067 closures = closures + 1
1068 if (closures == 2)
then
1075 if (iend == 0)
return
1076 base_body = wkt_trim(nstart:iend)
1080 a0 = -(xorigin * cos(ang) + yorigin * sin(ang))
1083 b0 = xorigin * sin(ang) - yorigin * cos(ang)
1086 write (a0s,
'(es22.15)') a0
1087 write (a1s,
'(es22.15)') a1
1088 write (a2s,
'(es22.15)') a2
1089 write (b0s,
'(es22.15)') b0
1090 write (b1s,
'(es22.15)') b1
1091 write (b2s,
'(es22.15)') b2
1093 conversion =
'DERIVINGCONVERSION["MODFLOW 6 grid rotation",'// &
1094 'METHOD["Affine parametric transformation",'// &
1095 'ID["EPSG",9624]],'// &
1096 'PARAMETER["A0",'//trim(adjustl(a0s))// &
1097 ',LENGTHUNIT["metre",1]],'// &
1098 'PARAMETER["A1",'//trim(adjustl(a1s))// &
1099 ',SCALEUNIT["unity",1]],'// &
1100 'PARAMETER["A2",'//trim(adjustl(a2s))// &
1101 ',SCALEUNIT["unity",1]],'// &
1102 'PARAMETER["B0",'//trim(adjustl(b0s))// &
1103 ',LENGTHUNIT["metre",1]],'// &
1104 'PARAMETER["B1",'//trim(adjustl(b1s))// &
1105 ',SCALEUNIT["unity",1]],'// &
1106 'PARAMETER["B2",'//trim(adjustl(b2s))// &
1107 ',SCALEUNIT["unity",1]]]'
1109 derived_wkt =
'DERIVEDPROJCRS["MODFLOW 6 rotated grid CRS",'// &
1110 'BASEPROJCRS['//trim(base_body)//
'],'// &
1111 trim(conversion)//
','// &
1112 'CS[Cartesian,2],'// &
1113 'AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],'// &
1114 'AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]]]'
1124 deallocate (this%deflate)
1125 deallocate (this%shuffle)
1126 deallocate (this%input_attr)
1127 deallocate (this%chunk_time)
1129 if (this%ncf_mempath /=
'')
then
abstract interfaces for model netcdf export type
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
integer(i4b), parameter lenmodelname
maximum length of the model name
integer(i4b), parameter lenbigline
maximum length of a big line
@ disu
DISV6 discretization.
@ dis
DIS6 discretization.
@ disv
DISU6 discretization.
integer(i4b), parameter lenvarname
maximum length of a variable name
real(dp), parameter dpio180
real constant
real(dp), parameter dzero
real constant zero
integer(i4b), parameter lenmempath
maximum length of the memory path
logical function, public idm_multi_package(component, subcomponent)
This module defines variable data types.
Load context for IDM generic dynamic loaders.
@ rs_series
time-array series given in the most recent period block
@ rs_netcdf
values read from NetCDF in the most recent period block
@ rs_values
values given in the most recent period block
subroutine init(this, mf6_input, blockname, named_bound)
Initialize the load context.
subroutine destroy(this)
destroy input context object
character(len=lenvarname) function, public rsv_name(mf6varname)
create read state variable name
character(len=lenmemseparator), parameter mempathseparator
used to build up the memory address for the stored variables
character(len=lenmempath) function create_mem_path(component, subcomponent, context)
returns the path to the memory object
subroutine, public memorystore_remove(component, subcomponent, context)
This module contains the NCModelExportModule.
character(len=lenbigline) function, public wrap_rotated_crs(wkt, xorigin, yorigin, angrot)
wrap a WKT2 PROJCRS in a derived CRS encoding grid rotation
class(exportpackagetype) function, pointer export_get(this, idx)
retrieve dynamic export object from package list
@ netcdf_undef
undefined netcdf export type
@ netcdf_mesh2d
netcdf ugrid layered mesh export
@ netcdf_structured
netcdf structrured export
logical(lgp) function param_state(this, iparam)
.true. if a param has input in effect to export
character(len=linelength) function, public wkt_to_cf_gridmapping(wkt)
map a WKT string to a CF-1.13 grid_mapping_name
character(len=linelength) function, public export_varname(pkgname, tagname, mempath, layer, iaux)
build netcdf variable name
integer(i4b) function istp(this)
step index for timeseries data
subroutine epkg_init(this, mf6_input, mshape, naux, param_names, nparam)
initialize dynamic package export object
subroutine update_state(this)
Update input in effect from the period block read states.
logical(lgp) function aux_state(this, iaux)
.true. if an auxiliary variable has input in effect to export
subroutine set_state(invar, has_value)
Set input in effect from a read state.
subroutine export_destroy(this)
destroy model netcdf export object
subroutine export_init(this, modelname, modeltype, modelfname, nc_fname, disenum, nctype, iout)
initialization of model netcdf export
subroutine user_nodes(this, vals, nodes)
Set user node values from a loaded period array.
subroutine, public wkt_lambert_conformal_conic_params(wkt, standard_parallel_1, standard_parallel_2, longitude_of_central_meridian, latitude_of_projection_origin, false_easting, false_northing, semi_major_axis, inverse_flattening, is_2sp, found)
extract CF lambert_conformal_conic grid_mapping parameters
subroutine, public wkt_transverse_mercator_params(wkt, longitude_of_central_meridian, latitude_of_projection_origin, scale_factor_at_central_meridian, false_easting, false_northing, semi_major_axis, inverse_flattening, found)
extract CF transverse_mercator grid_mapping parameters
real(dp) function wkt_find_param(wkt, name, found)
find the first number following a quoted parameter name
subroutine set(this, modelname, modeltype, modelfname, nctype, disenum)
set netcdf file scoped attributes
character(len=linelength) function input_attribute(this, pkgname, idt)
build modflow_input attribute string
subroutine epkg_destroy(this)
destroy dynamic package export object
subroutine wkt_find_ellipsoid(wkt, semi_major_axis, inverse_flattening, found)
find semi-major axis and inverse flattening from a WKT string
character(len=linelength) function, public export_longname(longname, pkgname, tagname, mempath, layer, iaux, component_type, subcomponent_type)
build netcdf variable longname
subroutine export_input(this)
netcdf dynamic package period export
subroutine, public wkt_albers_conical_equal_area_params(wkt, standard_parallel_1, standard_parallel_2, longitude_of_central_meridian, latitude_of_projection_origin, false_easting, false_northing, semi_major_axis, inverse_flattening, found)
extract CF albers_conical_equal_area grid_mapping parameters
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
character(len=linelength) idm_context
integer(i4b) iout
file unit number for simulation output
integer(i4b) isim_mode
simulation mode
This module contains the SourceCommonModule.
logical(lgp) function, public filein_fname(filename, tagname, input_mempath, input_fname)
enforce and set a single input filename provided via FILEIN keyword
integer(i4b), dimension(:), pointer, public, contiguous nstp
number of time steps in each stress period
character(len=lendatetime), pointer, public datetime0
starting date and time for the simulation
integer(i4b), pointer, public kstp
current time step number
integer(i4b), pointer, public kper
current stress period number
integer(i4b), pointer, public nper
number of stress period
This module contains version information.
character(len= *), parameter fullversion
This class is used to store a single deferred-length character string. It was designed to work in an ...
A generic heterogeneous doubly-linked list.
Pointer type for read state variable.
abstract type for model netcdf export type
netcdf export attribute annotations
base class for an export model