diff --git a/doc/mf6io/mf6ivar/dfn/chf-cdb.dfn b/doc/mf6io/mf6ivar/dfn/chf-cdb.dfn index ed52c6903af..ce6bc0ce420 100644 --- a/doc/mf6io/mf6ivar/dfn/chf-cdb.dfn +++ b/doc/mf6io/mf6ivar/dfn/chf-cdb.dfn @@ -1,5 +1,6 @@ # --------------------- chf cdb options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name auxiliary diff --git a/doc/mf6io/mf6ivar/dfn/chf-chd.dfn b/doc/mf6io/mf6ivar/dfn/chf-chd.dfn index 6738ca7a783..51c9f971dd4 100644 --- a/doc/mf6io/mf6ivar/dfn/chf-chd.dfn +++ b/doc/mf6io/mf6ivar/dfn/chf-chd.dfn @@ -1,5 +1,6 @@ # --------------------- chf chd options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name auxiliary diff --git a/doc/mf6io/mf6ivar/dfn/chf-dfw.dfn b/doc/mf6io/mf6ivar/dfn/chf-dfw.dfn index 8ad8ce00c2f..85d3a1658d0 100644 --- a/doc/mf6io/mf6ivar/dfn/chf-dfw.dfn +++ b/doc/mf6io/mf6ivar/dfn/chf-dfw.dfn @@ -1,4 +1,5 @@ # --------------------- chf dfw options --------------------- +# mf6 subpackage utl-obs block options name central_in_space diff --git a/doc/mf6io/mf6ivar/dfn/chf-evp.dfn b/doc/mf6io/mf6ivar/dfn/chf-evp.dfn index 4d6c751e5cc..20a0a711d2e 100644 --- a/doc/mf6io/mf6ivar/dfn/chf-evp.dfn +++ b/doc/mf6io/mf6ivar/dfn/chf-evp.dfn @@ -1,5 +1,6 @@ # --------------------- swf evp options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name auxiliary diff --git a/doc/mf6io/mf6ivar/dfn/chf-flw.dfn b/doc/mf6io/mf6ivar/dfn/chf-flw.dfn index 68e3d1f5878..1a7ca43ac3d 100644 --- a/doc/mf6io/mf6ivar/dfn/chf-flw.dfn +++ b/doc/mf6io/mf6ivar/dfn/chf-flw.dfn @@ -1,5 +1,6 @@ # --------------------- chf flw options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name auxiliary diff --git a/doc/mf6io/mf6ivar/dfn/chf-pcp.dfn b/doc/mf6io/mf6ivar/dfn/chf-pcp.dfn index 99bd07ff21b..4bb6c8802f9 100644 --- a/doc/mf6io/mf6ivar/dfn/chf-pcp.dfn +++ b/doc/mf6io/mf6ivar/dfn/chf-pcp.dfn @@ -1,5 +1,6 @@ # --------------------- swf pcp options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name auxiliary diff --git a/doc/mf6io/mf6ivar/dfn/chf-zdg.dfn b/doc/mf6io/mf6ivar/dfn/chf-zdg.dfn index 25600aac072..e4a28c5ba77 100644 --- a/doc/mf6io/mf6ivar/dfn/chf-zdg.dfn +++ b/doc/mf6io/mf6ivar/dfn/chf-zdg.dfn @@ -1,5 +1,6 @@ # --------------------- chf zdg options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name auxiliary diff --git a/doc/mf6io/mf6ivar/dfn/exg-chfgwf.dfn b/doc/mf6io/mf6ivar/dfn/exg-chfgwf.dfn index e31724a315d..b75a7f483a6 100644 --- a/doc/mf6io/mf6ivar/dfn/exg-chfgwf.dfn +++ b/doc/mf6io/mf6ivar/dfn/exg-chfgwf.dfn @@ -1,5 +1,6 @@ # --------------------- exg chfgwf options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name print_input diff --git a/doc/mf6io/mf6ivar/dfn/exg-gwegwe.dfn b/doc/mf6io/mf6ivar/dfn/exg-gwegwe.dfn index 1f4f03e6f8e..22bea53d110 100644 --- a/doc/mf6io/mf6ivar/dfn/exg-gwegwe.dfn +++ b/doc/mf6io/mf6ivar/dfn/exg-gwegwe.dfn @@ -1,5 +1,6 @@ # --------------------- exg gwegwe options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name gwfmodelname1 diff --git a/doc/mf6io/mf6ivar/dfn/exg-gwfgwf.dfn b/doc/mf6io/mf6ivar/dfn/exg-gwfgwf.dfn index 0f68acead6f..0eacf57fd8e 100644 --- a/doc/mf6io/mf6ivar/dfn/exg-gwfgwf.dfn +++ b/doc/mf6io/mf6ivar/dfn/exg-gwfgwf.dfn @@ -1,5 +1,6 @@ # --------------------- exg gwfgwf options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name auxiliary diff --git a/doc/mf6io/mf6ivar/dfn/exg-gwtgwt.dfn b/doc/mf6io/mf6ivar/dfn/exg-gwtgwt.dfn index 11af74961a7..94d2ffacde2 100644 --- a/doc/mf6io/mf6ivar/dfn/exg-gwtgwt.dfn +++ b/doc/mf6io/mf6ivar/dfn/exg-gwtgwt.dfn @@ -1,5 +1,6 @@ # --------------------- exg gwtgwt options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name gwfmodelname1 diff --git a/doc/mf6io/mf6ivar/dfn/exg-olfgwf.dfn b/doc/mf6io/mf6ivar/dfn/exg-olfgwf.dfn index 7cfb29cf230..95ed4f89dfb 100644 --- a/doc/mf6io/mf6ivar/dfn/exg-olfgwf.dfn +++ b/doc/mf6io/mf6ivar/dfn/exg-olfgwf.dfn @@ -1,5 +1,6 @@ # --------------------- exg olfgwf options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name print_input diff --git a/doc/mf6io/mf6ivar/dfn/gwe-ctp.dfn b/doc/mf6io/mf6ivar/dfn/gwe-ctp.dfn index 2f6a2c273ff..589d77217a5 100644 --- a/doc/mf6io/mf6ivar/dfn/gwe-ctp.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwe-ctp.dfn @@ -1,5 +1,6 @@ # --------------------- gwe ctp options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name auxiliary diff --git a/doc/mf6io/mf6ivar/dfn/gwe-esl.dfn b/doc/mf6io/mf6ivar/dfn/gwe-esl.dfn index fe4884631a6..b57c77d8e76 100644 --- a/doc/mf6io/mf6ivar/dfn/gwe-esl.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwe-esl.dfn @@ -1,5 +1,6 @@ # --------------------- gwe esl options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name auxiliary diff --git a/doc/mf6io/mf6ivar/dfn/gwe-lke.dfn b/doc/mf6io/mf6ivar/dfn/gwe-lke.dfn index 866cdb1a632..0f767442f33 100644 --- a/doc/mf6io/mf6ivar/dfn/gwe-lke.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwe-lke.dfn @@ -1,5 +1,6 @@ # --------------------- gwe lke options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name flow_package_name diff --git a/doc/mf6io/mf6ivar/dfn/gwe-mwe.dfn b/doc/mf6io/mf6ivar/dfn/gwe-mwe.dfn index b2b79c2cbb6..3df608ced49 100644 --- a/doc/mf6io/mf6ivar/dfn/gwe-mwe.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwe-mwe.dfn @@ -1,5 +1,6 @@ # --------------------- gwe mwe options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name flow_package_name diff --git a/doc/mf6io/mf6ivar/dfn/gwe-sfe.dfn b/doc/mf6io/mf6ivar/dfn/gwe-sfe.dfn index 440c032632f..e48b8fcefa4 100644 --- a/doc/mf6io/mf6ivar/dfn/gwe-sfe.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwe-sfe.dfn @@ -1,5 +1,6 @@ # --------------------- gwe sfe options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name flow_package_name diff --git a/doc/mf6io/mf6ivar/dfn/gwe-uze.dfn b/doc/mf6io/mf6ivar/dfn/gwe-uze.dfn index b0a00dc03d5..db924928c35 100644 --- a/doc/mf6io/mf6ivar/dfn/gwe-uze.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwe-uze.dfn @@ -1,5 +1,6 @@ # --------------------- gwe uze options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name flow_package_name diff --git a/doc/mf6io/mf6ivar/dfn/gwf-api.dfn b/doc/mf6io/mf6ivar/dfn/gwf-api.dfn index 9ab75064391..27c232d8a79 100644 --- a/doc/mf6io/mf6ivar/dfn/gwf-api.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwf-api.dfn @@ -1,5 +1,6 @@ # --------------------- gwf api options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name boundnames diff --git a/doc/mf6io/mf6ivar/dfn/gwf-chd.dfn b/doc/mf6io/mf6ivar/dfn/gwf-chd.dfn index 867c2e0a8b8..2dcab6ae499 100644 --- a/doc/mf6io/mf6ivar/dfn/gwf-chd.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwf-chd.dfn @@ -1,6 +1,7 @@ # --------------------- gwf chd options --------------------- # flopy multi-package # package-type stress-package +# mf6 subpackage utl-obs block options name auxiliary diff --git a/doc/mf6io/mf6ivar/dfn/gwf-chdg.dfn b/doc/mf6io/mf6ivar/dfn/gwf-chdg.dfn index b309d4a6ad6..4aec938cd0a 100644 --- a/doc/mf6io/mf6ivar/dfn/gwf-chdg.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwf-chdg.dfn @@ -1,6 +1,7 @@ # --------------------- gwf chdg options --------------------- # flopy multi-package # package-type stress-package +# mf6 subpackage utl-obs block options name readarraygrid diff --git a/doc/mf6io/mf6ivar/dfn/gwf-csub.dfn b/doc/mf6io/mf6ivar/dfn/gwf-csub.dfn index a5c116b2127..c89dd7775be 100644 --- a/doc/mf6io/mf6ivar/dfn/gwf-csub.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwf-csub.dfn @@ -1,4 +1,5 @@ # --------------------- gwf csub options --------------------- +# mf6 subpackage utl-obs block options name boundnames diff --git a/doc/mf6io/mf6ivar/dfn/gwf-drn.dfn b/doc/mf6io/mf6ivar/dfn/gwf-drn.dfn index e24d91bb950..3437576ab3c 100644 --- a/doc/mf6io/mf6ivar/dfn/gwf-drn.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwf-drn.dfn @@ -1,6 +1,7 @@ # --------------------- gwf drn options --------------------- # flopy multi-package # package-type stress-package +# mf6 subpackage utl-obs block options name auxiliary diff --git a/doc/mf6io/mf6ivar/dfn/gwf-drng.dfn b/doc/mf6io/mf6ivar/dfn/gwf-drng.dfn index f13dd2582a2..9e34f3f5bbb 100644 --- a/doc/mf6io/mf6ivar/dfn/gwf-drng.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwf-drng.dfn @@ -1,6 +1,7 @@ # --------------------- gwf drng options --------------------- # flopy multi-package # package-type stress-package +# mf6 subpackage utl-obs block options name readarraygrid diff --git a/doc/mf6io/mf6ivar/dfn/gwf-evt.dfn b/doc/mf6io/mf6ivar/dfn/gwf-evt.dfn index d7d715731d4..d3c92f63914 100644 --- a/doc/mf6io/mf6ivar/dfn/gwf-evt.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwf-evt.dfn @@ -1,6 +1,7 @@ # --------------------- gwf evt options --------------------- # flopy multi-package # package-type stress-package +# mf6 subpackage utl-obs block options name fixed_cell diff --git a/doc/mf6io/mf6ivar/dfn/gwf-evta.dfn b/doc/mf6io/mf6ivar/dfn/gwf-evta.dfn index 2925e2d1e52..db84493d961 100644 --- a/doc/mf6io/mf6ivar/dfn/gwf-evta.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwf-evta.dfn @@ -1,6 +1,7 @@ # --------------------- gwf evta options --------------------- # flopy multi-package # package-type stress-package +# mf6 subpackage utl-obs block options name readasarrays diff --git a/doc/mf6io/mf6ivar/dfn/gwf-ghb.dfn b/doc/mf6io/mf6ivar/dfn/gwf-ghb.dfn index 79aebd6f690..242db8916c0 100644 --- a/doc/mf6io/mf6ivar/dfn/gwf-ghb.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwf-ghb.dfn @@ -1,6 +1,7 @@ # --------------------- gwf ghb options --------------------- # flopy multi-package # package-type stress-package +# mf6 subpackage utl-obs block options name auxiliary diff --git a/doc/mf6io/mf6ivar/dfn/gwf-ghbg.dfn b/doc/mf6io/mf6ivar/dfn/gwf-ghbg.dfn index 0b81141ad5b..ad371cf031f 100644 --- a/doc/mf6io/mf6ivar/dfn/gwf-ghbg.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwf-ghbg.dfn @@ -1,6 +1,7 @@ # --------------------- gwf ghbg options --------------------- # flopy multi-package # package-type stress-package +# mf6 subpackage utl-obs block options name readarraygrid diff --git a/doc/mf6io/mf6ivar/dfn/gwf-lak.dfn b/doc/mf6io/mf6ivar/dfn/gwf-lak.dfn index 92ba00f7900..a9672be247f 100644 --- a/doc/mf6io/mf6ivar/dfn/gwf-lak.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwf-lak.dfn @@ -1,6 +1,7 @@ # --------------------- gwf lak options --------------------- # flopy multi-package # package-type advanced-stress-package +# mf6 subpackage utl-obs block options name auxiliary diff --git a/doc/mf6io/mf6ivar/dfn/gwf-maw.dfn b/doc/mf6io/mf6ivar/dfn/gwf-maw.dfn index 52ce93f0746..2e9e87ccc4e 100644 --- a/doc/mf6io/mf6ivar/dfn/gwf-maw.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwf-maw.dfn @@ -1,6 +1,7 @@ # --------------------- gwf maw options --------------------- # flopy multi-package # package-type advanced-stress-package +# mf6 subpackage utl-obs block options name auxiliary diff --git a/doc/mf6io/mf6ivar/dfn/gwf-rch.dfn b/doc/mf6io/mf6ivar/dfn/gwf-rch.dfn index 8ea6b1db217..1012645a036 100644 --- a/doc/mf6io/mf6ivar/dfn/gwf-rch.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwf-rch.dfn @@ -1,6 +1,7 @@ # --------------------- gwf rch options --------------------- # flopy multi-package # package-type stress-package +# mf6 subpackage utl-obs block options name fixed_cell diff --git a/doc/mf6io/mf6ivar/dfn/gwf-rcha.dfn b/doc/mf6io/mf6ivar/dfn/gwf-rcha.dfn index 21fa25f1ce9..b6546f0695f 100644 --- a/doc/mf6io/mf6ivar/dfn/gwf-rcha.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwf-rcha.dfn @@ -1,6 +1,7 @@ # --------------------- gwf rcha options --------------------- # flopy multi-package # package-type stress-package +# mf6 subpackage utl-obs block options name readasarrays diff --git a/doc/mf6io/mf6ivar/dfn/gwf-riv.dfn b/doc/mf6io/mf6ivar/dfn/gwf-riv.dfn index d381d4ac07a..9753230e69e 100644 --- a/doc/mf6io/mf6ivar/dfn/gwf-riv.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwf-riv.dfn @@ -1,6 +1,7 @@ # --------------------- gwf riv options --------------------- # flopy multi-package # package-type stress-package +# mf6 subpackage utl-obs block options name auxiliary diff --git a/doc/mf6io/mf6ivar/dfn/gwf-rivg.dfn b/doc/mf6io/mf6ivar/dfn/gwf-rivg.dfn index d8eb93f718f..f30b3308c7f 100644 --- a/doc/mf6io/mf6ivar/dfn/gwf-rivg.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwf-rivg.dfn @@ -1,6 +1,7 @@ # --------------------- gwf rivg options --------------------- # flopy multi-package # package-type stress-package +# mf6 subpackage utl-obs block options name readarraygrid diff --git a/doc/mf6io/mf6ivar/dfn/gwf-sfr.dfn b/doc/mf6io/mf6ivar/dfn/gwf-sfr.dfn index 4448bc50de3..cc45243eb84 100644 --- a/doc/mf6io/mf6ivar/dfn/gwf-sfr.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwf-sfr.dfn @@ -1,6 +1,7 @@ # --------------------- gwf sfr options --------------------- # flopy multi-package # package-type advanced-stress-package +# mf6 subpackage utl-obs block options name storage diff --git a/doc/mf6io/mf6ivar/dfn/gwf-uzf.dfn b/doc/mf6io/mf6ivar/dfn/gwf-uzf.dfn index 5a48312a74a..917a985d862 100644 --- a/doc/mf6io/mf6ivar/dfn/gwf-uzf.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwf-uzf.dfn @@ -1,6 +1,7 @@ # --------------------- gwf uzf options --------------------- # flopy multi-package # package-type advanced-stress-package +# mf6 subpackage utl-obs block options name auxiliary diff --git a/doc/mf6io/mf6ivar/dfn/gwf-wel.dfn b/doc/mf6io/mf6ivar/dfn/gwf-wel.dfn index 156e3b0ec6f..9a541eee4f1 100644 --- a/doc/mf6io/mf6ivar/dfn/gwf-wel.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwf-wel.dfn @@ -1,6 +1,7 @@ # --------------------- gwf wel options --------------------- # flopy multi-package # package-type stress-package +# mf6 subpackage utl-obs block options name auxiliary diff --git a/doc/mf6io/mf6ivar/dfn/gwf-welg.dfn b/doc/mf6io/mf6ivar/dfn/gwf-welg.dfn index 3b6e6380743..bb0a65aa359 100644 --- a/doc/mf6io/mf6ivar/dfn/gwf-welg.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwf-welg.dfn @@ -1,6 +1,7 @@ # --------------------- gwf wel options --------------------- # flopy multi-package # package-type stress-package +# mf6 subpackage utl-obs block options name readarraygrid diff --git a/doc/mf6io/mf6ivar/dfn/gwt-api.dfn b/doc/mf6io/mf6ivar/dfn/gwt-api.dfn index 72afa98d90d..79a53374b72 100644 --- a/doc/mf6io/mf6ivar/dfn/gwt-api.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwt-api.dfn @@ -1,5 +1,6 @@ # --------------------- gwt api options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name boundnames diff --git a/doc/mf6io/mf6ivar/dfn/gwt-cnc.dfn b/doc/mf6io/mf6ivar/dfn/gwt-cnc.dfn index 32186244de4..3a0f8d24ef6 100644 --- a/doc/mf6io/mf6ivar/dfn/gwt-cnc.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwt-cnc.dfn @@ -1,5 +1,6 @@ # --------------------- gwt cnc options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name auxiliary diff --git a/doc/mf6io/mf6ivar/dfn/gwt-lkt.dfn b/doc/mf6io/mf6ivar/dfn/gwt-lkt.dfn index bbffc7bfce9..1c36a01414d 100644 --- a/doc/mf6io/mf6ivar/dfn/gwt-lkt.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwt-lkt.dfn @@ -1,5 +1,6 @@ # --------------------- gwt lkt options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name flow_package_name diff --git a/doc/mf6io/mf6ivar/dfn/gwt-mwt.dfn b/doc/mf6io/mf6ivar/dfn/gwt-mwt.dfn index 54236cbba4d..51585399e13 100644 --- a/doc/mf6io/mf6ivar/dfn/gwt-mwt.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwt-mwt.dfn @@ -1,5 +1,6 @@ # --------------------- gwt mwt options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name flow_package_name diff --git a/doc/mf6io/mf6ivar/dfn/gwt-sft.dfn b/doc/mf6io/mf6ivar/dfn/gwt-sft.dfn index 995bd990f58..c66ed9902a4 100644 --- a/doc/mf6io/mf6ivar/dfn/gwt-sft.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwt-sft.dfn @@ -1,5 +1,6 @@ # --------------------- gwt sft options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name flow_package_name diff --git a/doc/mf6io/mf6ivar/dfn/gwt-src.dfn b/doc/mf6io/mf6ivar/dfn/gwt-src.dfn index cef9a7d9224..047e2f66b66 100644 --- a/doc/mf6io/mf6ivar/dfn/gwt-src.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwt-src.dfn @@ -1,5 +1,6 @@ # --------------------- gwt src options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name auxiliary diff --git a/doc/mf6io/mf6ivar/dfn/gwt-uzt.dfn b/doc/mf6io/mf6ivar/dfn/gwt-uzt.dfn index 7f7d7f2894a..4a3abab4ce2 100644 --- a/doc/mf6io/mf6ivar/dfn/gwt-uzt.dfn +++ b/doc/mf6io/mf6ivar/dfn/gwt-uzt.dfn @@ -1,5 +1,6 @@ # --------------------- gwt uzt options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name flow_package_name diff --git a/doc/mf6io/mf6ivar/dfn/olf-cdb.dfn b/doc/mf6io/mf6ivar/dfn/olf-cdb.dfn index 814e8e12c9c..ae523dcf33d 100644 --- a/doc/mf6io/mf6ivar/dfn/olf-cdb.dfn +++ b/doc/mf6io/mf6ivar/dfn/olf-cdb.dfn @@ -1,5 +1,6 @@ # --------------------- olf cdb options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name auxiliary diff --git a/doc/mf6io/mf6ivar/dfn/olf-chd.dfn b/doc/mf6io/mf6ivar/dfn/olf-chd.dfn index 17969d2cc37..0acecd83730 100644 --- a/doc/mf6io/mf6ivar/dfn/olf-chd.dfn +++ b/doc/mf6io/mf6ivar/dfn/olf-chd.dfn @@ -1,5 +1,6 @@ # --------------------- olf chd options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name auxiliary diff --git a/doc/mf6io/mf6ivar/dfn/olf-dfw.dfn b/doc/mf6io/mf6ivar/dfn/olf-dfw.dfn index 41730764a6d..b4447223964 100644 --- a/doc/mf6io/mf6ivar/dfn/olf-dfw.dfn +++ b/doc/mf6io/mf6ivar/dfn/olf-dfw.dfn @@ -1,4 +1,5 @@ # --------------------- olf dfw options --------------------- +# mf6 subpackage utl-obs block options name central_in_space diff --git a/doc/mf6io/mf6ivar/dfn/olf-evp.dfn b/doc/mf6io/mf6ivar/dfn/olf-evp.dfn index 4d6c751e5cc..20a0a711d2e 100644 --- a/doc/mf6io/mf6ivar/dfn/olf-evp.dfn +++ b/doc/mf6io/mf6ivar/dfn/olf-evp.dfn @@ -1,5 +1,6 @@ # --------------------- swf evp options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name auxiliary diff --git a/doc/mf6io/mf6ivar/dfn/olf-flw.dfn b/doc/mf6io/mf6ivar/dfn/olf-flw.dfn index b42a3dffb52..c9c306fe660 100644 --- a/doc/mf6io/mf6ivar/dfn/olf-flw.dfn +++ b/doc/mf6io/mf6ivar/dfn/olf-flw.dfn @@ -1,5 +1,6 @@ # --------------------- olf flw options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name auxiliary diff --git a/doc/mf6io/mf6ivar/dfn/olf-pcp.dfn b/doc/mf6io/mf6ivar/dfn/olf-pcp.dfn index 99bd07ff21b..4bb6c8802f9 100644 --- a/doc/mf6io/mf6ivar/dfn/olf-pcp.dfn +++ b/doc/mf6io/mf6ivar/dfn/olf-pcp.dfn @@ -1,5 +1,6 @@ # --------------------- swf pcp options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name auxiliary diff --git a/doc/mf6io/mf6ivar/dfn/olf-zdg.dfn b/doc/mf6io/mf6ivar/dfn/olf-zdg.dfn index 7ec9553d636..0e24b4b1223 100644 --- a/doc/mf6io/mf6ivar/dfn/olf-zdg.dfn +++ b/doc/mf6io/mf6ivar/dfn/olf-zdg.dfn @@ -1,5 +1,6 @@ # --------------------- olf zdg options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name auxiliary diff --git a/doc/mf6io/mf6ivar/dfn/swf-cdb.dfn b/doc/mf6io/mf6ivar/dfn/swf-cdb.dfn index 8ca1f4024db..3fbc9e0be6f 100644 --- a/doc/mf6io/mf6ivar/dfn/swf-cdb.dfn +++ b/doc/mf6io/mf6ivar/dfn/swf-cdb.dfn @@ -1,5 +1,6 @@ # --------------------- swf cdb options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name auxiliary diff --git a/doc/mf6io/mf6ivar/dfn/swf-chd.dfn b/doc/mf6io/mf6ivar/dfn/swf-chd.dfn index 30828bbb101..b048bc721ab 100644 --- a/doc/mf6io/mf6ivar/dfn/swf-chd.dfn +++ b/doc/mf6io/mf6ivar/dfn/swf-chd.dfn @@ -1,5 +1,6 @@ # --------------------- swf chd options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name auxiliary diff --git a/doc/mf6io/mf6ivar/dfn/swf-dfw.dfn b/doc/mf6io/mf6ivar/dfn/swf-dfw.dfn index 0eef8d71b2e..473a46210ef 100644 --- a/doc/mf6io/mf6ivar/dfn/swf-dfw.dfn +++ b/doc/mf6io/mf6ivar/dfn/swf-dfw.dfn @@ -1,4 +1,5 @@ # --------------------- swf dfw options --------------------- +# mf6 subpackage utl-obs block options name central_in_space diff --git a/doc/mf6io/mf6ivar/dfn/swf-evp.dfn b/doc/mf6io/mf6ivar/dfn/swf-evp.dfn index 4d6c751e5cc..20a0a711d2e 100644 --- a/doc/mf6io/mf6ivar/dfn/swf-evp.dfn +++ b/doc/mf6io/mf6ivar/dfn/swf-evp.dfn @@ -1,5 +1,6 @@ # --------------------- swf evp options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name auxiliary diff --git a/doc/mf6io/mf6ivar/dfn/swf-flw.dfn b/doc/mf6io/mf6ivar/dfn/swf-flw.dfn index c0c38e9da05..13811b00007 100644 --- a/doc/mf6io/mf6ivar/dfn/swf-flw.dfn +++ b/doc/mf6io/mf6ivar/dfn/swf-flw.dfn @@ -1,5 +1,6 @@ # --------------------- swf flw options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name auxiliary diff --git a/doc/mf6io/mf6ivar/dfn/swf-pcp.dfn b/doc/mf6io/mf6ivar/dfn/swf-pcp.dfn index 99bd07ff21b..4bb6c8802f9 100644 --- a/doc/mf6io/mf6ivar/dfn/swf-pcp.dfn +++ b/doc/mf6io/mf6ivar/dfn/swf-pcp.dfn @@ -1,5 +1,6 @@ # --------------------- swf pcp options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name auxiliary diff --git a/doc/mf6io/mf6ivar/dfn/swf-zdg.dfn b/doc/mf6io/mf6ivar/dfn/swf-zdg.dfn index e625e7b3288..78f3117edb1 100644 --- a/doc/mf6io/mf6ivar/dfn/swf-zdg.dfn +++ b/doc/mf6io/mf6ivar/dfn/swf-zdg.dfn @@ -1,5 +1,6 @@ # --------------------- swf zdg options --------------------- # flopy multi-package +# mf6 subpackage utl-obs block options name auxiliary diff --git a/doc/mf6io/mf6ivar/dfn/utl-obs.dfn b/doc/mf6io/mf6ivar/dfn/utl-obs.dfn index d75ce62e479..4dc5b7f3ade 100644 --- a/doc/mf6io/mf6ivar/dfn/utl-obs.dfn +++ b/doc/mf6io/mf6ivar/dfn/utl-obs.dfn @@ -54,6 +54,7 @@ tagged false reader urword longname description Name of a file to which simulated values corresponding to observations in the block are to be written. The file name can be an absolute or relative path name. A unique output file must be specified for each CONTINUOUS block. If the ``BINARY'' option is used, output is written in binary form. By convention, text output files have the extension ``csv'' (for ``Comma-Separated Values'') and binary output files have the extension ``bsv'' (for ``Binary Simulated Values''). +mf6internal obs_output_fname block continuous name binary @@ -97,7 +98,7 @@ description a string of characters used to identify the observation type. block continuous name id type string -shape +shape linelength tagged false in_record true reader urword diff --git a/make/makefile b/make/makefile index 38ff4ad25c0..4701ee84149 100644 --- a/make/makefile +++ b/make/makefile @@ -135,6 +135,7 @@ $(OBJDIR)/InputDefinition.o \ $(OBJDIR)/ListIterator.o \ $(OBJDIR)/PtrHashTable.o \ $(OBJDIR)/MemoryContainerIterator.o \ +$(OBJDIR)/utl-obsidm.o \ $(OBJDIR)/utl-ncfidm.o \ $(OBJDIR)/utl-hpcidm.o \ $(OBJDIR)/swf-zdgidm.o \ diff --git a/msvs/mf6core.vfproj b/msvs/mf6core.vfproj index c40e654f7d7..9780bd2b9b3 100644 --- a/msvs/mf6core.vfproj +++ b/msvs/mf6core.vfproj @@ -252,7 +252,8 @@ - + + diff --git a/src/Exchange/exg-chfgwf.f90 b/src/Exchange/exg-chfgwf.f90 index ad8bc8b9b95..7e2f2db5221 100644 --- a/src/Exchange/exg-chfgwf.f90 +++ b/src/Exchange/exg-chfgwf.f90 @@ -112,6 +112,7 @@ subroutine source_options(this, iout) ! modules use ConstantsModule, only: LENVARNAME, DEM6 use InputOutputModule, only: getunit, openfile + use MemoryManagerModule, only: mem_setptr use MemoryManagerExtModule, only: mem_set_value use CharacterStringModule, only: CharacterStringType use ExgChfgwfInputModule, only: ExgChfgwfParamFoundType @@ -120,6 +121,9 @@ subroutine source_options(this, iout) class(ChfGwfExchangeType) :: this !< GwfExchangeType integer(I4B), intent(in) :: iout ! local + !type(CharacterStringType), dimension(:), & + ! pointer, contiguous :: obs_mempaths + !character(len=LINELENGTH) :: obs_fname type(ExgChfgwfParamFoundType) :: found ! update defaults with idm sourced values @@ -149,11 +153,10 @@ subroutine source_options(this, iout) ! enforce 0 or 1 OBS6_FILENAME entries in option block ! if (.not. this%is_datacopy) then - ! if (filein_fname(this%obs%inputFilename, 'OBS6_FILENAME', & + ! if (filein_fname(obs_fname, 'OBS6_FILENAME', & ! this%input_mempath, this%filename)) then - ! this%obs%active = .true. - ! this%obs%inUnitObs = GetUnit() - ! call openfile(this%obs%inUnitObs, iout, this%obs%inputFilename, 'OBS') + ! call mem_setptr(obs_mempaths, 'OBS6_MEMPATH', this%input_mempath) + ! this%obs%input_mempath = obs_mempaths(1) ! end if ! end if diff --git a/src/Exchange/exg-gwegwe.f90 b/src/Exchange/exg-gwegwe.f90 index 121929c29f7..03ec31b0ad0 100644 --- a/src/Exchange/exg-gwegwe.f90 +++ b/src/Exchange/exg-gwegwe.f90 @@ -66,7 +66,6 @@ module GweGweExchangeModule type(TspMvtType), pointer :: mvt => null() !< water mover object ! ! -- Observation package - integer(I4B), pointer :: inobs => null() !< unit number for GWT-GWT observations type(ObsType), pointer :: obs => null() !< observation object ! ! -- internal data @@ -186,7 +185,7 @@ subroutine gweexchange_create(filename, name, id, m1_id, m2_id, input_mempath) end if ! ! -- Create the obs package - call obs_cr(exchange%obs, exchange%inobs) + call obs_cr(exchange%obs) end subroutine gweexchange_create !> @ brief Define GWE GWE exchange @@ -439,7 +438,7 @@ subroutine gwe_gwe_bdsav(this) !cdl todo: if(this%inmvt > 0) call this%mvt%mvt_bdsav(icbcfl, ibudfl, isuppress_output) ! ! -- Calculate and write simulated values for observations - if (this%inobs /= 0) then + if (this%obs%active) then call this%gwe_gwe_save_simvals() end if end subroutine gwe_gwe_bdsav @@ -674,6 +673,7 @@ subroutine source_options(this, iout) ! -- modules use ConstantsModule, only: LENVARNAME use InputOutputModule, only: getunit, openfile + use MemoryManagerModule, only: mem_setptr use MemoryManagerExtModule, only: mem_set_value use CharacterStringModule, only: CharacterStringType use ExgGwegweInputModule, only: ExgGwegweParamFoundType @@ -682,10 +682,12 @@ subroutine source_options(this, iout) class(GweExchangeType) :: this !< GweExchangeType integer(I4B), intent(in) :: iout ! -- local + type(CharacterStringType), dimension(:), & + pointer, contiguous :: obs_mempaths type(ExgGwegweParamFoundType) :: found character(len=LENVARNAME), dimension(4) :: adv_scheme = & &[character(len=LENVARNAME) :: 'UPSTREAM', 'CENTRAL', 'TVD', 'UTVD'] - character(len=LINELENGTH) :: mvt_fname + character(len=LINELENGTH) :: mvt_fname, obs_fname ! ! -- update defaults with values sourced from input context call mem_set_value(this%gwfmodelname1, 'GWFMODELNAME1', this%input_mempath, & @@ -744,11 +746,10 @@ subroutine source_options(this, iout) end if ! ! -- enforce 0 or 1 OBS6_FILENAME entries in option block - if (filein_fname(this%obs%inputFilename, 'OBS6_FILENAME', & + if (filein_fname(obs_fname, 'OBS6_FILENAME', & this%input_mempath, this%filename)) then - this%obs%active = .true. - this%obs%inUnitObs = GetUnit() - call openfile(this%obs%inUnitObs, iout, this%obs%inputFilename, 'OBS') + call mem_setptr(obs_mempaths, 'OBS6_MEMPATH', this%input_mempath) + this%obs%input_mempath = obs_mempaths(1) end if ! write (iout, '(1x,a)') 'END OF GWE-GWE EXCHANGE OPTIONS' @@ -789,10 +790,8 @@ subroutine allocate_scalars(this) call this%DisConnExchangeType%allocate_scalars() ! call mem_allocate(this%inewton, 'INEWTON', this%memoryPath) - call mem_allocate(this%inobs, 'INOBS', this%memoryPath) call mem_allocate(this%iAdvScheme, 'IADVSCHEME', this%memoryPath) this%inewton = 0 - this%inobs = 0 this%iAdvScheme = 0 ! call mem_allocate(this%inmvt, 'INMVT', this%memoryPath) @@ -837,7 +836,6 @@ subroutine gwe_gwe_da(this) ! -- scalars deallocate (this%filename) call mem_deallocate(this%inewton) - call mem_deallocate(this%inobs) call mem_deallocate(this%iAdvScheme) call mem_deallocate(this%inmvt) ! @@ -996,7 +994,7 @@ subroutine gwe_gwe_rp_obs(this) ! ! -- write summary of error messages if (count_errors() > 0) then - call store_error_filename(this%obs%inputFilename) + call store_error_filename(this%obs%input_fname) end if end subroutine gwe_gwe_rp_obs @@ -1087,7 +1085,7 @@ subroutine gwe_gwe_save_simvals(this) errmsg = 'Unrecognized observation type: '// & trim(obsrv%ObsTypeId) call store_error(errmsg) - call store_error_filename(this%obs%inputFilename) + call store_error_filename(this%obs%input_fname) end select call this%obs%SaveOneSimval(obsrv, v) end do diff --git a/src/Exchange/exg-gwfgwe.f90 b/src/Exchange/exg-gwfgwe.f90 index f6a67901df8..5daf38b6738 100644 --- a/src/Exchange/exg-gwfgwe.f90 +++ b/src/Exchange/exg-gwfgwe.f90 @@ -506,6 +506,9 @@ end subroutine allocate_scalars !! data (SIMVALS and SIMTOMVR) stored within each GWF flow package !< subroutine gwfbnd2gwefmi(this) + ! -- modules + use ConstantsModule, only: LENVARNAME + use BndExtModule, only: BndExtType ! -- dummy class(GwfGweExchangeType) :: this ! -- local @@ -514,6 +517,7 @@ subroutine gwfbnd2gwefmi(this) type(GwfModelType), pointer :: gwfmodel => null() type(GweModelType), pointer :: gwemodel => null() class(BndType), pointer :: packobj => null() + character(len=LENVARNAME) :: auxvarname ! ! -- set gwfmodel mb => GetBaseModelFromList(basemodellist, this%m1_idx) @@ -534,10 +538,16 @@ subroutine gwfbnd2gwefmi(this) ngwfpack = gwfmodel%bndlist%Count() iterm = 1 do ip = 1, ngwfpack + auxvarname = '' packobj => GetBndFromList(gwfmodel%bndlist, ip) + select type (packobj) + class is (BndExtType) + auxvarname = 'AUXVAR_IDM' + class is (BndType) + auxvarname = 'AUXVAR' + end select call gwemodel%fmi%gwfpackages(iterm)%set_pointers( & - 'SIMVALS', & - packobj%memoryPath, packobj%input_mempath) + 'SIMVALS', packobj%memoryPath, auxvarname) iterm = iterm + 1 ! ! -- If a mover is active for this package, then establish a separate @@ -546,8 +556,7 @@ subroutine gwfbnd2gwefmi(this) if (packobj%isadvpak /= 0) imover = 0 if (imover /= 0) then call gwemodel%fmi%gwfpackages(iterm)%set_pointers( & - 'SIMTOMVR', & - packobj%memoryPath, packobj%input_mempath) + 'SIMTOMVR', packobj%memoryPath, auxvarname) iterm = iterm + 1 end if end do diff --git a/src/Exchange/exg-gwfgwf.f90 b/src/Exchange/exg-gwfgwf.f90 index 8c0e6ea77d2..36140b5be7b 100644 --- a/src/Exchange/exg-gwfgwf.f90 +++ b/src/Exchange/exg-gwfgwf.f90 @@ -57,7 +57,6 @@ module GwfGwfExchangeModule type(GhostNodeType), pointer :: gnc => null() !< gnc object integer(I4B), pointer :: inmvr => null() !< unit number for mover (0 if off) class(GwfExgMoverType), pointer :: mvr => null() !< water mover object - integer(I4B), pointer :: inobs => null() !< unit number for GWF-GWF observations type(ObsType), pointer :: obs => null() !< observation object ! ! -- internal data @@ -196,7 +195,7 @@ subroutine gwfexchange_create(filename, name, id, m1_id, m2_id, input_mempath) end if ! ! -- Create the obs package - call obs_cr(exchange%obs, exchange%inobs) + call obs_cr(exchange%obs) end subroutine gwfexchange_create !> @ brief Define GWF GWF exchange @@ -989,7 +988,7 @@ subroutine gwf_gwf_bdsav(this) if (this%inmvr > 0) call this%mvr%mvr_bdsav(icbcfl, ibudfl, 0) ! ! -- Calculate and write simulated values for observations - if (this%inobs /= 0) then + if (this%obs%active) then call this%gwf_gwf_save_simvals() end if end subroutine gwf_gwf_bdsav @@ -1231,6 +1230,7 @@ subroutine source_options(this, iout) ! -- modules use ConstantsModule, only: LENVARNAME, DEM6 use InputOutputModule, only: getunit, openfile + use MemoryManagerModule, only: mem_setptr use MemoryManagerExtModule, only: mem_set_value use CharacterStringModule, only: CharacterStringType use ExgGwfgwfInputModule, only: ExgGwfgwfParamFoundType @@ -1239,10 +1239,12 @@ subroutine source_options(this, iout) class(GwfExchangeType) :: this !< GwfExchangeType integer(I4B), intent(in) :: iout ! -- local + type(CharacterStringType), dimension(:), & + pointer, contiguous :: obs_mempaths type(ExgGwfgwfParamFoundType) :: found character(len=LENVARNAME), dimension(3) :: cellavg_method = & &[character(len=LENVARNAME) :: 'HARMONIC', 'LOGARITHMIC', 'AMT-LMK'] - character(len=LINELENGTH) :: gnc_fname, mvr_fname + character(len=LINELENGTH) :: gnc_fname, mvr_fname, obs_fname ! ! -- update defaults with idm sourced values call mem_set_value(this%icellavg, 'CELL_AVERAGING', this%input_mempath, & @@ -1307,11 +1309,10 @@ subroutine source_options(this, iout) ! ! -- enforce 0 or 1 OBS6_FILENAME entries in option block if (.not. this%is_datacopy) then - if (filein_fname(this%obs%inputFilename, 'OBS6_FILENAME', & + if (filein_fname(obs_fname, 'OBS6_FILENAME', & this%input_mempath, this%filename)) then - this%obs%active = .true. - this%obs%inUnitObs = GetUnit() - call openfile(this%obs%inUnitObs, iout, this%obs%inputFilename, 'OBS') + call mem_setptr(obs_mempaths, 'OBS6_MEMPATH', this%input_mempath) + this%obs%input_mempath = obs_mempaths(1) end if end if ! @@ -1656,7 +1657,6 @@ subroutine allocate_scalars(this) call mem_allocate(this%inewton, 'INEWTON', this%memoryPath) call mem_allocate(this%ingnc, 'INGNC', this%memoryPath) call mem_allocate(this%inmvr, 'INMVR', this%memoryPath) - call mem_allocate(this%inobs, 'INOBS', this%memoryPath) call mem_allocate(this%satomega, 'SATOMEGA', this%memoryPath) this%icellavg = 0 this%ivarcv = 0 @@ -1664,7 +1664,6 @@ subroutine allocate_scalars(this) this%inewton = 0 this%ingnc = 0 this%inmvr = 0 - this%inobs = 0 this%satomega = DZERO end subroutine allocate_scalars @@ -1718,7 +1717,6 @@ subroutine gwf_gwf_da(this) call mem_deallocate(this%inewton) call mem_deallocate(this%ingnc) call mem_deallocate(this%inmvr) - call mem_deallocate(this%inobs) call mem_deallocate(this%satomega) ! ! -- deallocate base @@ -1879,7 +1877,7 @@ subroutine gwf_gwf_rp_obs(this) ! ! -- write summary of error messages if (count_errors() > 0) then - call store_error_filename(this%obs%inputFilename) + call store_error_filename(this%obs%input_fname) end if end subroutine gwf_gwf_rp_obs @@ -2015,7 +2013,7 @@ subroutine gwf_gwf_save_simvals(this) errmsg = 'Unrecognized observation type: '// & trim(obsrv%ObsTypeId) call store_error(errmsg) - call store_error_filename(this%obs%inputFilename) + call store_error_filename(this%obs%input_fname) end select call this%obs%SaveOneSimval(obsrv, v) end do diff --git a/src/Exchange/exg-gwfgwt.f90 b/src/Exchange/exg-gwfgwt.f90 index c8a0df86253..0426c714497 100644 --- a/src/Exchange/exg-gwfgwt.f90 +++ b/src/Exchange/exg-gwfgwt.f90 @@ -526,6 +526,9 @@ end subroutine allocate_scalars !! data !< subroutine gwfbnd2gwtfmi(this) + ! -- modules + use ConstantsModule, only: LENVARNAME + use BndExtModule, only: BndExtType ! -- dummy class(GwfGwtExchangeType) :: this ! -- local @@ -534,6 +537,7 @@ subroutine gwfbnd2gwtfmi(this) type(GwfModelType), pointer :: gwfmodel => null() type(GwtModelType), pointer :: gwtmodel => null() class(BndType), pointer :: packobj => null() + character(len=LENVARNAME) :: auxvarname ! ! -- set gwfmodel mb => GetBaseModelFromList(basemodellist, this%m1_idx) @@ -554,10 +558,16 @@ subroutine gwfbnd2gwtfmi(this) ngwfpack = gwfmodel%bndlist%Count() iterm = 1 do ip = 1, ngwfpack + auxvarname = '' packobj => GetBndFromList(gwfmodel%bndlist, ip) + select type (packobj) + class is (BndExtType) + auxvarname = 'AUXVAR_IDM' + class is (BndType) + auxvarname = 'AUXVAR' + end select call gwtmodel%fmi%gwfpackages(iterm)%set_pointers( & - 'SIMVALS', & - packobj%memoryPath, packobj%input_mempath) + 'SIMVALS', packobj%memoryPath, auxvarname) iterm = iterm + 1 ! ! -- If a mover is active for this package, then establish a separate @@ -566,8 +576,7 @@ subroutine gwfbnd2gwtfmi(this) if (packobj%isadvpak /= 0) imover = 0 if (imover /= 0) then call gwtmodel%fmi%gwfpackages(iterm)%set_pointers( & - 'SIMTOMVR', & - packobj%memoryPath, packobj%input_mempath) + 'SIMTOMVR', packobj%memoryPath, auxvarname) iterm = iterm + 1 end if end do diff --git a/src/Exchange/exg-gwfprt.f90 b/src/Exchange/exg-gwfprt.f90 index 61929f13693..be1329ab56b 100644 --- a/src/Exchange/exg-gwfprt.f90 +++ b/src/Exchange/exg-gwfprt.f90 @@ -317,6 +317,8 @@ end subroutine allocate_scalars subroutine gwfbnd2prtfmi(this) ! -- modules + use ConstantsModule, only: LENVARNAME + use BndExtModule, only: BndExtType ! -- dummy class(GwfPrtExchangeType) :: this ! -- local @@ -325,6 +327,7 @@ subroutine gwfbnd2prtfmi(this) type(GwfModelType), pointer :: gwfmodel => null() type(PrtModelType), pointer :: prtmodel => null() class(BndType), pointer :: packobj => null() + character(len=LENVARNAME) :: auxvarname ! ! -- set gwfmodel mb => GetBaseModelFromList(basemodellist, this%m1id) @@ -345,11 +348,16 @@ subroutine gwfbnd2prtfmi(this) ngwfpack = gwfmodel%bndlist%Count() iterm = 1 do ip = 1, ngwfpack + auxvarname = '' packobj => GetBndFromList(gwfmodel%bndlist, ip) + select type (packobj) + class is (BndExtType) + auxvarname = 'AUXVAR_IDM' + class is (BndType) + auxvarname = 'AUXVAR' + end select call prtmodel%fmi%gwfpackages(iterm)%set_pointers( & - 'SIMVALS', & - packobj%memoryPath, & - packobj%input_mempath) + 'SIMVALS', packobj%memoryPath, auxvarname) iterm = iterm + 1 ! ! -- If a mover is active for this package, then establish a separate @@ -358,9 +366,7 @@ subroutine gwfbnd2prtfmi(this) if (packobj%isadvpak /= 0) imover = 0 if (imover /= 0) then call prtmodel%fmi%gwfpackages(iterm)%set_pointers( & - 'SIMTOMVR', & - packobj%memoryPath, & - packobj%input_mempath) + 'SIMTOMVR', packobj%memoryPath, auxvarname) iterm = iterm + 1 end if end do diff --git a/src/Exchange/exg-gwtgwt.f90 b/src/Exchange/exg-gwtgwt.f90 index 4f7877f397d..6088ac0fd62 100644 --- a/src/Exchange/exg-gwtgwt.f90 +++ b/src/Exchange/exg-gwtgwt.f90 @@ -64,7 +64,6 @@ module GwtGwtExchangeModule type(TspMvtType), pointer :: mvt => null() !< water mover object ! ! -- Observation package - integer(I4B), pointer :: inobs => null() !< unit number for GWT-GWT observations type(ObsType), pointer :: obs => null() !< observation object ! ! -- internal data @@ -184,7 +183,7 @@ subroutine gwtexchange_create(filename, name, id, m1_id, m2_id, input_mempath) end if ! ! -- Create the obs package - call obs_cr(exchange%obs, exchange%inobs) + call obs_cr(exchange%obs) end subroutine gwtexchange_create !> @ brief Define GWT GWT exchange @@ -435,7 +434,7 @@ subroutine gwt_gwt_bdsav(this) !cdl todo: if(this%inmvt > 0) call this%mvt%mvt_bdsav(icbcfl, ibudfl, isuppress_output) ! ! -- Calculate and write simulated values for observations - if (this%inobs /= 0) then + if (this%obs%active) then call this%gwt_gwt_save_simvals() end if end subroutine gwt_gwt_bdsav @@ -670,6 +669,7 @@ subroutine source_options(this, iout) ! -- modules use ConstantsModule, only: LENVARNAME use InputOutputModule, only: getunit, openfile + use MemoryManagerModule, only: mem_setptr use MemoryManagerExtModule, only: mem_set_value use CharacterStringModule, only: CharacterStringType use ExgGwtgwtInputModule, only: ExgGwtgwtParamFoundType @@ -678,10 +678,12 @@ subroutine source_options(this, iout) class(GwtExchangeType) :: this !< GwtExchangeType integer(I4B), intent(in) :: iout ! -- local + type(CharacterStringType), dimension(:), & + pointer, contiguous :: obs_mempaths type(ExgGwtgwtParamFoundType) :: found character(len=LENVARNAME), dimension(4) :: adv_scheme = & &[character(len=LENVARNAME) :: 'UPSTREAM', 'CENTRAL', 'TVD', 'UTVD'] - character(len=LINELENGTH) :: mvt_fname + character(len=LINELENGTH) :: mvt_fname, obs_fname ! ! -- update defaults with values sourced from input context call mem_set_value(this%gwfmodelname1, 'GWFMODELNAME1', this%input_mempath, & @@ -740,11 +742,10 @@ subroutine source_options(this, iout) end if ! ! -- enforce 0 or 1 OBS6_FILENAME entries in option block - if (filein_fname(this%obs%inputFilename, 'OBS6_FILENAME', & + if (filein_fname(obs_fname, 'OBS6_FILENAME', & this%input_mempath, this%filename)) then - this%obs%active = .true. - this%obs%inUnitObs = GetUnit() - call openfile(this%obs%inUnitObs, iout, this%obs%inputFilename, 'OBS') + call mem_setptr(obs_mempaths, 'OBS6_MEMPATH', this%input_mempath) + this%obs%input_mempath = obs_mempaths(1) end if ! write (iout, '(1x,a)') 'END OF GWT-GWT EXCHANGE OPTIONS' @@ -785,10 +786,8 @@ subroutine allocate_scalars(this) call this%DisConnExchangeType%allocate_scalars() ! call mem_allocate(this%inewton, 'INEWTON', this%memoryPath) - call mem_allocate(this%inobs, 'INOBS', this%memoryPath) call mem_allocate(this%iAdvScheme, 'IADVSCHEME', this%memoryPath) this%inewton = 0 - this%inobs = 0 this%iAdvScheme = 0 ! call mem_allocate(this%inmvt, 'INMVT', this%memoryPath) @@ -833,7 +832,6 @@ subroutine gwt_gwt_da(this) ! -- scalars deallocate (this%filename) call mem_deallocate(this%inewton) - call mem_deallocate(this%inobs) call mem_deallocate(this%iAdvScheme) call mem_deallocate(this%inmvt) ! @@ -992,7 +990,7 @@ subroutine gwt_gwt_rp_obs(this) ! ! -- write summary of error messages if (count_errors() > 0) then - call store_error_filename(this%obs%inputFilename) + call store_error_filename(this%obs%input_fname) end if end subroutine gwt_gwt_rp_obs @@ -1083,7 +1081,7 @@ subroutine gwt_gwt_save_simvals(this) errmsg = 'Unrecognized observation type: '// & trim(obsrv%ObsTypeId) call store_error(errmsg) - call store_error_filename(this%obs%inputFilename) + call store_error_filename(this%obs%input_fname) end select call this%obs%SaveOneSimval(obsrv, v) end do diff --git a/src/Exchange/exg-olfgwf.f90 b/src/Exchange/exg-olfgwf.f90 index 130d336efc6..c4e3afe488d 100644 --- a/src/Exchange/exg-olfgwf.f90 +++ b/src/Exchange/exg-olfgwf.f90 @@ -112,6 +112,7 @@ subroutine source_options(this, iout) ! modules use ConstantsModule, only: LENVARNAME, DEM6 use InputOutputModule, only: getunit, openfile + use MemoryManagerModule, only: mem_setptr use MemoryManagerExtModule, only: mem_set_value use CharacterStringModule, only: CharacterStringType use ExgOlfgwfInputModule, only: ExgOlfgwfParamFoundType @@ -120,6 +121,9 @@ subroutine source_options(this, iout) class(OlfGwfExchangeType) :: this !< GwfExchangeType integer(I4B), intent(in) :: iout ! local + !type(CharacterStringType), dimension(:), & + ! pointer, contiguous :: obs_mempaths + !character(len=LINELENGTH) :: obs_fname type(ExgOlfgwfParamFoundType) :: found ! update defaults with idm sourced values @@ -149,11 +153,10 @@ subroutine source_options(this, iout) ! enforce 0 or 1 OBS6_FILENAME entries in option block ! if (.not. this%is_datacopy) then - ! if (filein_fname(this%obs%inputFilename, 'OBS6_FILENAME', & + ! if (filein_fname(obs_fname, 'OBS6_FILENAME', & ! this%input_mempath, this%filename)) then - ! this%obs%active = .true. - ! this%obs%inUnitObs = GetUnit() - ! call openfile(this%obs%inUnitObs, iout, this%obs%inputFilename, 'OBS') + ! call mem_setptr(obs_mempaths, 'OBS6_MEMPATH', this%input_mempath) + ! this%obs%input_mempath = obs_mempaths(1) ! end if ! end if diff --git a/src/Exchange/exg-swfgwf.f90 b/src/Exchange/exg-swfgwf.f90 index b745fe79e85..b67c4b6f17f 100644 --- a/src/Exchange/exg-swfgwf.f90 +++ b/src/Exchange/exg-swfgwf.f90 @@ -10,8 +10,7 @@ module SwfGwfExchangeModule use KindModule, only: DP, I4B, LGP use ConstantsModule, only: LINELENGTH, DZERO, LENFTYPE use SimVariablesModule, only: errmsg, iout, model_loc_idx - use SimModule, only: count_errors, store_error, store_error_unit, & - store_error_filename + use SimModule, only: count_errors, store_error, store_error_filename use InputOutputModule, only: getunit, openfile use MemoryManagerModule, only: mem_allocate use BaseModelModule, only: BaseModelType, GetBaseModelFromList @@ -53,7 +52,6 @@ module SwfGwfExchangeModule integer(I4B), dimension(:), pointer, contiguous :: idxsymglo => null() !< mapping to global (solution) symmetric amat real(DP), dimension(:), pointer, contiguous :: simvals => null() !< simulated flow rate for each exchange - integer(I4B), pointer :: inobs => null() !< unit number for GWF-GWF observations type(ObsType), pointer :: obs => null() !< observation object ! -- table objects @@ -167,7 +165,7 @@ subroutine initialize(this, filename, name, swf_ftype, id, m1_id, m2_id, & end if ! Create the obs package - call obs_cr(this%obs, this%inobs) + call obs_cr(this%obs) end subroutine initialize @@ -354,7 +352,6 @@ subroutine swf_gwf_da(this) call mem_deallocate(this%ipr_flow) call mem_deallocate(this%ifixedcond) call mem_deallocate(this%nexg) - call mem_deallocate(this%inobs) end subroutine swf_gwf_da !> @ brief Allocate scalars @@ -375,13 +372,11 @@ subroutine allocate_scalars(this) call mem_allocate(this%ipr_flow, 'IPR_FLOW', this%memoryPath) call mem_allocate(this%ifixedcond, 'IFIXEDCOND', this%memoryPath) call mem_allocate(this%nexg, 'NEXG', this%memoryPath) - call mem_allocate(this%inobs, 'INOBS', this%memoryPath) ! this%ipr_input = 0 this%ipr_flow = 0 this%ifixedcond = 0 this%nexg = 0 - this%inobs = 0 end subroutine allocate_scalars !> @brief Allocate array data, using the number of @@ -745,7 +740,7 @@ subroutine swf_gwf_bdsav(this) ibudfl = 1 ! ! -- Calculate and write simulated values for observations - if (this%inobs /= 0) then + if (this%obs%active) then call this%swf_gwf_save_simvals() end if end subroutine swf_gwf_bdsav @@ -960,7 +955,7 @@ end subroutine swf_gwf_ot !< subroutine swf_gwf_save_simvals(this) ! -- modules - use SimModule, only: store_error, store_error_unit + use SimModule, only: store_error use SimVariablesModule, only: errmsg use ConstantsModule, only: DZERO use ObserveModule, only: ObserveType @@ -992,7 +987,7 @@ subroutine swf_gwf_save_simvals(this) errmsg = 'Unrecognized observation type: '// & trim(obsrv%ObsTypeId) call store_error(errmsg) - call store_error_unit(this%inobs) + call store_error_filename(this%obs%input_fname) end select call this%obs%SaveOneSimval(obsrv, v) end do diff --git a/src/Idm/chf-cdbidm.f90 b/src/Idm/chf-cdbidm.f90 index 7c260d19d35..cedd6f3db81 100644 --- a/src/Idm/chf-cdbidm.f90 +++ b/src/Idm/chf-cdbidm.f90 @@ -34,7 +34,7 @@ module ChfCdbInputModule character(len=16), parameter :: & chf_cdb_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/chf-chdidm.f90 b/src/Idm/chf-chdidm.f90 index 01a5dde9d80..78414002abe 100644 --- a/src/Idm/chf-chdidm.f90 +++ b/src/Idm/chf-chdidm.f90 @@ -37,7 +37,7 @@ module ChfChdInputModule character(len=16), parameter :: & chf_chd_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/chf-dfwidm.f90 b/src/Idm/chf-dfwidm.f90 index 10f7bcf9e0a..5c0f086cb1c 100644 --- a/src/Idm/chf-dfwidm.f90 +++ b/src/Idm/chf-dfwidm.f90 @@ -33,7 +33,7 @@ module ChfDfwInputModule character(len=16), parameter :: & chf_dfw_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/chf-evpidm.f90 b/src/Idm/chf-evpidm.f90 index 19e4f769a1f..1ea3bfa492c 100644 --- a/src/Idm/chf-evpidm.f90 +++ b/src/Idm/chf-evpidm.f90 @@ -37,7 +37,7 @@ module ChfEvpInputModule character(len=16), parameter :: & chf_evp_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/chf-flwidm.f90 b/src/Idm/chf-flwidm.f90 index cb56d08cd97..43cda48ba86 100644 --- a/src/Idm/chf-flwidm.f90 +++ b/src/Idm/chf-flwidm.f90 @@ -37,7 +37,7 @@ module ChfFlwInputModule character(len=16), parameter :: & chf_flw_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/chf-pcpidm.f90 b/src/Idm/chf-pcpidm.f90 index 56c0265fe33..08eb6493df7 100644 --- a/src/Idm/chf-pcpidm.f90 +++ b/src/Idm/chf-pcpidm.f90 @@ -37,7 +37,7 @@ module ChfPcpInputModule character(len=16), parameter :: & chf_pcp_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/chf-zdgidm.f90 b/src/Idm/chf-zdgidm.f90 index 9fcf3f6c8c9..451d20c3c82 100644 --- a/src/Idm/chf-zdgidm.f90 +++ b/src/Idm/chf-zdgidm.f90 @@ -39,7 +39,7 @@ module ChfZdgInputModule character(len=16), parameter :: & chf_zdg_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/exg-chfgwfidm.f90 b/src/Idm/exg-chfgwfidm.f90 index 991cf971ecb..c3bca4bf47d 100644 --- a/src/Idm/exg-chfgwfidm.f90 +++ b/src/Idm/exg-chfgwfidm.f90 @@ -31,7 +31,7 @@ module ExgChfgwfInputModule character(len=16), parameter :: & exg_chfgwf_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/exg-gwegweidm.f90 b/src/Idm/exg-gwegweidm.f90 index c4aad687ec5..8c007ee6532 100644 --- a/src/Idm/exg-gwegweidm.f90 +++ b/src/Idm/exg-gwegweidm.f90 @@ -46,7 +46,7 @@ module ExgGwegweInputModule character(len=16), parameter :: & exg_gwegwe_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/exg-gwfgwfidm.f90 b/src/Idm/exg-gwfgwfidm.f90 index 938ce22a7a7..1a1ef88a69b 100644 --- a/src/Idm/exg-gwfgwfidm.f90 +++ b/src/Idm/exg-gwfgwfidm.f90 @@ -50,7 +50,7 @@ module ExgGwfgwfInputModule character(len=16), parameter :: & exg_gwfgwf_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/exg-gwtgwtidm.f90 b/src/Idm/exg-gwtgwtidm.f90 index f25b78e444a..71434f6c12d 100644 --- a/src/Idm/exg-gwtgwtidm.f90 +++ b/src/Idm/exg-gwtgwtidm.f90 @@ -46,7 +46,7 @@ module ExgGwtgwtInputModule character(len=16), parameter :: & exg_gwtgwt_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/exg-olfgwfidm.f90 b/src/Idm/exg-olfgwfidm.f90 index ba3d01eb08b..ea04a66a4a7 100644 --- a/src/Idm/exg-olfgwfidm.f90 +++ b/src/Idm/exg-olfgwfidm.f90 @@ -31,7 +31,7 @@ module ExgOlfgwfInputModule character(len=16), parameter :: & exg_olfgwf_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/gwe-ctpidm.f90 b/src/Idm/gwe-ctpidm.f90 index 6fb065e2ca0..f04989ddb9e 100644 --- a/src/Idm/gwe-ctpidm.f90 +++ b/src/Idm/gwe-ctpidm.f90 @@ -37,7 +37,7 @@ module GweCtpInputModule character(len=16), parameter :: & gwe_ctp_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/gwe-eslidm.f90 b/src/Idm/gwe-eslidm.f90 index 04803b52ce5..5b378415586 100644 --- a/src/Idm/gwe-eslidm.f90 +++ b/src/Idm/gwe-eslidm.f90 @@ -37,7 +37,7 @@ module GweEslInputModule character(len=16), parameter :: & gwe_esl_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/gwf-apiidm.f90 b/src/Idm/gwf-apiidm.f90 index ec643e9a3b6..13c1d4756b4 100644 --- a/src/Idm/gwf-apiidm.f90 +++ b/src/Idm/gwf-apiidm.f90 @@ -29,7 +29,7 @@ module GwfApiInputModule character(len=16), parameter :: & gwf_api_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/gwf-chdgidm.f90 b/src/Idm/gwf-chdgidm.f90 index 4f94517b6cb..56c56788f62 100644 --- a/src/Idm/gwf-chdgidm.f90 +++ b/src/Idm/gwf-chdgidm.f90 @@ -34,7 +34,7 @@ module GwfChdgInputModule character(len=16), parameter :: & gwf_chdg_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/gwf-chdidm.f90 b/src/Idm/gwf-chdidm.f90 index 4365748705a..0454b0959d2 100644 --- a/src/Idm/gwf-chdidm.f90 +++ b/src/Idm/gwf-chdidm.f90 @@ -38,7 +38,7 @@ module GwfChdInputModule character(len=16), parameter :: & gwf_chd_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/gwf-csubidm.f90 b/src/Idm/gwf-csubidm.f90 index 542e6de1736..4c0a2e9d41e 100644 --- a/src/Idm/gwf-csubidm.f90 +++ b/src/Idm/gwf-csubidm.f90 @@ -89,7 +89,7 @@ module GwfCsubInputModule character(len=16), parameter :: & gwf_csub_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/gwf-drngidm.f90 b/src/Idm/gwf-drngidm.f90 index 2992d741fc0..7338645c8b7 100644 --- a/src/Idm/gwf-drngidm.f90 +++ b/src/Idm/gwf-drngidm.f90 @@ -37,7 +37,7 @@ module GwfDrngInputModule character(len=16), parameter :: & gwf_drng_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/gwf-drnidm.f90 b/src/Idm/gwf-drnidm.f90 index de29681cf85..3fc6e8e07b5 100644 --- a/src/Idm/gwf-drnidm.f90 +++ b/src/Idm/gwf-drnidm.f90 @@ -41,7 +41,7 @@ module GwfDrnInputModule character(len=16), parameter :: & gwf_drn_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/gwf-evtaidm.f90 b/src/Idm/gwf-evtaidm.f90 index 2b0f810f354..3c4ea208ef5 100644 --- a/src/Idm/gwf-evtaidm.f90 +++ b/src/Idm/gwf-evtaidm.f90 @@ -39,7 +39,7 @@ module GwfEvtaInputModule character(len=16), parameter :: & gwf_evta_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/gwf-evtidm.f90 b/src/Idm/gwf-evtidm.f90 index ee41b92bb53..78dfcd1a68b 100644 --- a/src/Idm/gwf-evtidm.f90 +++ b/src/Idm/gwf-evtidm.f90 @@ -45,7 +45,7 @@ module GwfEvtInputModule character(len=16), parameter :: & gwf_evt_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/gwf-ghbgidm.f90 b/src/Idm/gwf-ghbgidm.f90 index 2525d00e443..e93df49cae4 100644 --- a/src/Idm/gwf-ghbgidm.f90 +++ b/src/Idm/gwf-ghbgidm.f90 @@ -35,7 +35,7 @@ module GwfGhbgInputModule character(len=16), parameter :: & gwf_ghbg_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/gwf-ghbidm.f90 b/src/Idm/gwf-ghbidm.f90 index 16f62f58823..aaa8ad64242 100644 --- a/src/Idm/gwf-ghbidm.f90 +++ b/src/Idm/gwf-ghbidm.f90 @@ -39,7 +39,7 @@ module GwfGhbInputModule character(len=16), parameter :: & gwf_ghb_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/gwf-rchaidm.f90 b/src/Idm/gwf-rchaidm.f90 index c57da1ef335..925a09cb6ab 100644 --- a/src/Idm/gwf-rchaidm.f90 +++ b/src/Idm/gwf-rchaidm.f90 @@ -37,7 +37,7 @@ module GwfRchaInputModule character(len=16), parameter :: & gwf_rcha_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/gwf-rchidm.f90 b/src/Idm/gwf-rchidm.f90 index 3999037070f..a4babf809e0 100644 --- a/src/Idm/gwf-rchidm.f90 +++ b/src/Idm/gwf-rchidm.f90 @@ -38,7 +38,7 @@ module GwfRchInputModule character(len=16), parameter :: & gwf_rch_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/gwf-rivgidm.f90 b/src/Idm/gwf-rivgidm.f90 index a03552585ce..4f7521b082e 100644 --- a/src/Idm/gwf-rivgidm.f90 +++ b/src/Idm/gwf-rivgidm.f90 @@ -36,7 +36,7 @@ module GwfRivgInputModule character(len=16), parameter :: & gwf_rivg_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/gwf-rividm.f90 b/src/Idm/gwf-rividm.f90 index bbd62422a35..cbb88619042 100644 --- a/src/Idm/gwf-rividm.f90 +++ b/src/Idm/gwf-rividm.f90 @@ -40,7 +40,7 @@ module GwfRivInputModule character(len=16), parameter :: & gwf_riv_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/gwf-welgidm.f90 b/src/Idm/gwf-welgidm.f90 index eb140e09af0..67404c9d5eb 100644 --- a/src/Idm/gwf-welgidm.f90 +++ b/src/Idm/gwf-welgidm.f90 @@ -39,7 +39,7 @@ module GwfWelgInputModule character(len=16), parameter :: & gwf_welg_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/gwf-welidm.f90 b/src/Idm/gwf-welidm.f90 index a6de1337ba3..3f06a9204c8 100644 --- a/src/Idm/gwf-welidm.f90 +++ b/src/Idm/gwf-welidm.f90 @@ -43,7 +43,7 @@ module GwfWelInputModule character(len=16), parameter :: & gwf_wel_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/gwt-apiidm.f90 b/src/Idm/gwt-apiidm.f90 index 442745fd2e5..4b6a18705dc 100644 --- a/src/Idm/gwt-apiidm.f90 +++ b/src/Idm/gwt-apiidm.f90 @@ -29,7 +29,7 @@ module GwtApiInputModule character(len=16), parameter :: & gwt_api_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/gwt-cncidm.f90 b/src/Idm/gwt-cncidm.f90 index b3ba36c47a2..544a2bf11ec 100644 --- a/src/Idm/gwt-cncidm.f90 +++ b/src/Idm/gwt-cncidm.f90 @@ -37,7 +37,7 @@ module GwtCncInputModule character(len=16), parameter :: & gwt_cnc_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/gwt-srcidm.f90 b/src/Idm/gwt-srcidm.f90 index 954326be4f4..585b0628d35 100644 --- a/src/Idm/gwt-srcidm.f90 +++ b/src/Idm/gwt-srcidm.f90 @@ -38,7 +38,7 @@ module GwtSrcInputModule character(len=16), parameter :: & gwt_src_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/olf-cdbidm.f90 b/src/Idm/olf-cdbidm.f90 index 567ede20dae..8a8986dc6f3 100644 --- a/src/Idm/olf-cdbidm.f90 +++ b/src/Idm/olf-cdbidm.f90 @@ -34,7 +34,7 @@ module OlfCdbInputModule character(len=16), parameter :: & olf_cdb_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/olf-chdidm.f90 b/src/Idm/olf-chdidm.f90 index ac45c575f11..b023900ac39 100644 --- a/src/Idm/olf-chdidm.f90 +++ b/src/Idm/olf-chdidm.f90 @@ -37,7 +37,7 @@ module OlfChdInputModule character(len=16), parameter :: & olf_chd_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/olf-dfwidm.f90 b/src/Idm/olf-dfwidm.f90 index e968896456c..79ca3a6a825 100644 --- a/src/Idm/olf-dfwidm.f90 +++ b/src/Idm/olf-dfwidm.f90 @@ -33,7 +33,7 @@ module OlfDfwInputModule character(len=16), parameter :: & olf_dfw_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/olf-evpidm.f90 b/src/Idm/olf-evpidm.f90 index 876ac2739e7..911a1678f44 100644 --- a/src/Idm/olf-evpidm.f90 +++ b/src/Idm/olf-evpidm.f90 @@ -37,7 +37,7 @@ module OlfEvpInputModule character(len=16), parameter :: & olf_evp_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/olf-flwidm.f90 b/src/Idm/olf-flwidm.f90 index 1ff07401e58..45e1cb630d4 100644 --- a/src/Idm/olf-flwidm.f90 +++ b/src/Idm/olf-flwidm.f90 @@ -37,7 +37,7 @@ module OlfFlwInputModule character(len=16), parameter :: & olf_flw_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/olf-pcpidm.f90 b/src/Idm/olf-pcpidm.f90 index 4e2ac7d4a3e..abad9699894 100644 --- a/src/Idm/olf-pcpidm.f90 +++ b/src/Idm/olf-pcpidm.f90 @@ -37,7 +37,7 @@ module OlfPcpInputModule character(len=16), parameter :: & olf_pcp_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/olf-zdgidm.f90 b/src/Idm/olf-zdgidm.f90 index 461ec583a2e..8979da693d8 100644 --- a/src/Idm/olf-zdgidm.f90 +++ b/src/Idm/olf-zdgidm.f90 @@ -39,7 +39,7 @@ module OlfZdgInputModule character(len=16), parameter :: & olf_zdg_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/selector/IdmChfDfnSelector.f90 b/src/Idm/selector/IdmChfDfnSelector.f90 index 1d65c71b838..e29d3891bc0 100644 --- a/src/Idm/selector/IdmChfDfnSelector.f90 +++ b/src/Idm/selector/IdmChfDfnSelector.f90 @@ -18,6 +18,7 @@ module IdmChfDfnSelectorModule use ChfEvpInputModule use ChfStoInputModule use ChfZdgInputModule + use UtlObsInputModule implicit none private @@ -79,6 +80,8 @@ function chf_param_definitions(subcomponent) result(input_definition) call set_param_pointer(input_definition, chf_sto_param_definitions) case ('ZDG') call set_param_pointer(input_definition, chf_zdg_param_definitions) + case ('OBS') + call set_param_pointer(input_definition, utl_obs_param_definitions) case default end select return @@ -115,6 +118,8 @@ function chf_aggregate_definitions(subcomponent) result(input_definition) call set_param_pointer(input_definition, chf_sto_aggregate_definitions) case ('ZDG') call set_param_pointer(input_definition, chf_zdg_aggregate_definitions) + case ('OBS') + call set_param_pointer(input_definition, utl_obs_aggregate_definitions) case default end select return @@ -151,6 +156,8 @@ function chf_block_definitions(subcomponent) result(input_definition) call set_block_pointer(input_definition, chf_sto_block_definitions) case ('ZDG') call set_block_pointer(input_definition, chf_zdg_block_definitions) + case ('OBS') + call set_block_pointer(input_definition, utl_obs_block_definitions) case default end select return @@ -186,6 +193,8 @@ function chf_idm_multi_package(subcomponent) result(multi_package) multi_package = chf_sto_multi_package case ('ZDG') multi_package = chf_zdg_multi_package + case ('OBS') + multi_package = utl_obs_multi_package case default call store_error('Idm selector subcomponent not found; '//& &'component="CHF"'//& @@ -224,6 +233,8 @@ function chf_idm_subpackages(subcomponent) result(subpackages) call set_subpkg_pointer(subpackages, chf_sto_subpackages) case ('ZDG') call set_subpkg_pointer(subpackages, chf_zdg_subpackages) + case ('OBS') + call set_subpkg_pointer(subpackages, utl_obs_subpackages) case default end select return @@ -260,6 +271,8 @@ function chf_idm_integrated(subcomponent) result(integrated) integrated = .true. case ('ZDG') integrated = .true. + case ('OBS') + integrated = .true. case default end select return diff --git a/src/Idm/selector/IdmGweDfnSelector.f90 b/src/Idm/selector/IdmGweDfnSelector.f90 index 91a4a35cb6f..49c49954d76 100644 --- a/src/Idm/selector/IdmGweDfnSelector.f90 +++ b/src/Idm/selector/IdmGweDfnSelector.f90 @@ -18,6 +18,7 @@ module IdmGweDfnSelectorModule use GweIcInputModule use GweOcInputModule use GweSsmInputModule + use UtlObsInputModule implicit none private @@ -79,6 +80,8 @@ function gwe_param_definitions(subcomponent) result(input_definition) call set_param_pointer(input_definition, gwe_oc_param_definitions) case ('SSM') call set_param_pointer(input_definition, gwe_ssm_param_definitions) + case ('OBS') + call set_param_pointer(input_definition, utl_obs_param_definitions) case default end select return @@ -115,6 +118,8 @@ function gwe_aggregate_definitions(subcomponent) result(input_definition) call set_param_pointer(input_definition, gwe_oc_aggregate_definitions) case ('SSM') call set_param_pointer(input_definition, gwe_ssm_aggregate_definitions) + case ('OBS') + call set_param_pointer(input_definition, utl_obs_aggregate_definitions) case default end select return @@ -151,6 +156,8 @@ function gwe_block_definitions(subcomponent) result(input_definition) call set_block_pointer(input_definition, gwe_oc_block_definitions) case ('SSM') call set_block_pointer(input_definition, gwe_ssm_block_definitions) + case ('OBS') + call set_block_pointer(input_definition, utl_obs_block_definitions) case default end select return @@ -186,6 +193,8 @@ function gwe_idm_multi_package(subcomponent) result(multi_package) multi_package = gwe_oc_multi_package case ('SSM') multi_package = gwe_ssm_multi_package + case ('OBS') + multi_package = utl_obs_multi_package case default call store_error('Idm selector subcomponent not found; '//& &'component="GWE"'//& @@ -224,6 +233,8 @@ function gwe_idm_subpackages(subcomponent) result(subpackages) call set_subpkg_pointer(subpackages, gwe_oc_subpackages) case ('SSM') call set_subpkg_pointer(subpackages, gwe_ssm_subpackages) + case ('OBS') + call set_subpkg_pointer(subpackages, utl_obs_subpackages) case default end select return @@ -260,6 +271,8 @@ function gwe_idm_integrated(subcomponent) result(integrated) integrated = .true. case ('SSM') integrated = .true. + case ('OBS') + integrated = .true. case default end select return diff --git a/src/Idm/selector/IdmGwfDfnSelector.f90 b/src/Idm/selector/IdmGwfDfnSelector.f90 index c25504118b2..aaba9c239e2 100644 --- a/src/Idm/selector/IdmGwfDfnSelector.f90 +++ b/src/Idm/selector/IdmGwfDfnSelector.f90 @@ -32,6 +32,7 @@ module IdmGwfDfnSelectorModule use GwfVscInputModule use GwfWelInputModule use GwfWelgInputModule + use UtlObsInputModule implicit none private @@ -121,6 +122,8 @@ function gwf_param_definitions(subcomponent) result(input_definition) call set_param_pointer(input_definition, gwf_wel_param_definitions) case ('WELG') call set_param_pointer(input_definition, gwf_welg_param_definitions) + case ('OBS') + call set_param_pointer(input_definition, utl_obs_param_definitions) case default end select return @@ -185,6 +188,8 @@ function gwf_aggregate_definitions(subcomponent) result(input_definition) call set_param_pointer(input_definition, gwf_wel_aggregate_definitions) case ('WELG') call set_param_pointer(input_definition, gwf_welg_aggregate_definitions) + case ('OBS') + call set_param_pointer(input_definition, utl_obs_aggregate_definitions) case default end select return @@ -249,6 +254,8 @@ function gwf_block_definitions(subcomponent) result(input_definition) call set_block_pointer(input_definition, gwf_wel_block_definitions) case ('WELG') call set_block_pointer(input_definition, gwf_welg_block_definitions) + case ('OBS') + call set_block_pointer(input_definition, utl_obs_block_definitions) case default end select return @@ -312,6 +319,8 @@ function gwf_idm_multi_package(subcomponent) result(multi_package) multi_package = gwf_wel_multi_package case ('WELG') multi_package = gwf_welg_multi_package + case ('OBS') + multi_package = utl_obs_multi_package case default call store_error('Idm selector subcomponent not found; '//& &'component="GWF"'//& @@ -378,6 +387,8 @@ function gwf_idm_subpackages(subcomponent) result(subpackages) call set_subpkg_pointer(subpackages, gwf_wel_subpackages) case ('WELG') call set_subpkg_pointer(subpackages, gwf_welg_subpackages) + case ('OBS') + call set_subpkg_pointer(subpackages, utl_obs_subpackages) case default end select return @@ -442,6 +453,8 @@ function gwf_idm_integrated(subcomponent) result(integrated) integrated = .true. case ('WELG') integrated = .true. + case ('OBS') + integrated = .true. case default end select return diff --git a/src/Idm/selector/IdmGwtDfnSelector.f90 b/src/Idm/selector/IdmGwtDfnSelector.f90 index 35ad43e95b3..a26ae68182c 100644 --- a/src/Idm/selector/IdmGwtDfnSelector.f90 +++ b/src/Idm/selector/IdmGwtDfnSelector.f90 @@ -20,6 +20,7 @@ module IdmGwtDfnSelectorModule use GwtOcInputModule use GwtSrcInputModule use GwtSsmInputModule + use UtlObsInputModule implicit none private @@ -85,6 +86,8 @@ function gwt_param_definitions(subcomponent) result(input_definition) call set_param_pointer(input_definition, gwt_src_param_definitions) case ('SSM') call set_param_pointer(input_definition, gwt_ssm_param_definitions) + case ('OBS') + call set_param_pointer(input_definition, utl_obs_param_definitions) case default end select return @@ -125,6 +128,8 @@ function gwt_aggregate_definitions(subcomponent) result(input_definition) call set_param_pointer(input_definition, gwt_src_aggregate_definitions) case ('SSM') call set_param_pointer(input_definition, gwt_ssm_aggregate_definitions) + case ('OBS') + call set_param_pointer(input_definition, utl_obs_aggregate_definitions) case default end select return @@ -165,6 +170,8 @@ function gwt_block_definitions(subcomponent) result(input_definition) call set_block_pointer(input_definition, gwt_src_block_definitions) case ('SSM') call set_block_pointer(input_definition, gwt_ssm_block_definitions) + case ('OBS') + call set_block_pointer(input_definition, utl_obs_block_definitions) case default end select return @@ -204,6 +211,8 @@ function gwt_idm_multi_package(subcomponent) result(multi_package) multi_package = gwt_src_multi_package case ('SSM') multi_package = gwt_ssm_multi_package + case ('OBS') + multi_package = utl_obs_multi_package case default call store_error('Idm selector subcomponent not found; '//& &'component="GWT"'//& @@ -246,6 +255,8 @@ function gwt_idm_subpackages(subcomponent) result(subpackages) call set_subpkg_pointer(subpackages, gwt_src_subpackages) case ('SSM') call set_subpkg_pointer(subpackages, gwt_ssm_subpackages) + case ('OBS') + call set_subpkg_pointer(subpackages, utl_obs_subpackages) case default end select return @@ -286,6 +297,8 @@ function gwt_idm_integrated(subcomponent) result(integrated) integrated = .true. case ('SSM') integrated = .true. + case ('OBS') + integrated = .true. case default end select return diff --git a/src/Idm/selector/IdmOlfDfnSelector.f90 b/src/Idm/selector/IdmOlfDfnSelector.f90 index 4f43369330f..da9d64fda4b 100644 --- a/src/Idm/selector/IdmOlfDfnSelector.f90 +++ b/src/Idm/selector/IdmOlfDfnSelector.f90 @@ -18,6 +18,7 @@ module IdmOlfDfnSelectorModule use OlfEvpInputModule use OlfStoInputModule use OlfZdgInputModule + use UtlObsInputModule implicit none private @@ -79,6 +80,8 @@ function olf_param_definitions(subcomponent) result(input_definition) call set_param_pointer(input_definition, olf_sto_param_definitions) case ('ZDG') call set_param_pointer(input_definition, olf_zdg_param_definitions) + case ('OBS') + call set_param_pointer(input_definition, utl_obs_param_definitions) case default end select return @@ -115,6 +118,8 @@ function olf_aggregate_definitions(subcomponent) result(input_definition) call set_param_pointer(input_definition, olf_sto_aggregate_definitions) case ('ZDG') call set_param_pointer(input_definition, olf_zdg_aggregate_definitions) + case ('OBS') + call set_param_pointer(input_definition, utl_obs_aggregate_definitions) case default end select return @@ -151,6 +156,8 @@ function olf_block_definitions(subcomponent) result(input_definition) call set_block_pointer(input_definition, olf_sto_block_definitions) case ('ZDG') call set_block_pointer(input_definition, olf_zdg_block_definitions) + case ('OBS') + call set_block_pointer(input_definition, utl_obs_block_definitions) case default end select return @@ -186,6 +193,8 @@ function olf_idm_multi_package(subcomponent) result(multi_package) multi_package = olf_sto_multi_package case ('ZDG') multi_package = olf_zdg_multi_package + case ('OBS') + multi_package = utl_obs_multi_package case default call store_error('Idm selector subcomponent not found; '//& &'component="OLF"'//& @@ -224,6 +233,8 @@ function olf_idm_subpackages(subcomponent) result(subpackages) call set_subpkg_pointer(subpackages, olf_sto_subpackages) case ('ZDG') call set_subpkg_pointer(subpackages, olf_zdg_subpackages) + case ('OBS') + call set_subpkg_pointer(subpackages, utl_obs_subpackages) case default end select return @@ -260,6 +271,8 @@ function olf_idm_integrated(subcomponent) result(integrated) integrated = .true. case ('ZDG') integrated = .true. + case ('OBS') + integrated = .true. case default end select return diff --git a/src/Idm/selector/IdmPrtDfnSelector.f90 b/src/Idm/selector/IdmPrtDfnSelector.f90 index c80102b45b9..c8a37ef4478 100644 --- a/src/Idm/selector/IdmPrtDfnSelector.f90 +++ b/src/Idm/selector/IdmPrtDfnSelector.f90 @@ -12,6 +12,7 @@ module IdmPrtDfnSelectorModule use PrtMipInputModule use PrtOcInputModule use PrtPrpInputModule + use UtlObsInputModule implicit none private @@ -61,6 +62,8 @@ function prt_param_definitions(subcomponent) result(input_definition) call set_param_pointer(input_definition, prt_oc_param_definitions) case ('PRP') call set_param_pointer(input_definition, prt_prp_param_definitions) + case ('OBS') + call set_param_pointer(input_definition, utl_obs_param_definitions) case default end select return @@ -85,6 +88,8 @@ function prt_aggregate_definitions(subcomponent) result(input_definition) call set_param_pointer(input_definition, prt_oc_aggregate_definitions) case ('PRP') call set_param_pointer(input_definition, prt_prp_aggregate_definitions) + case ('OBS') + call set_param_pointer(input_definition, utl_obs_aggregate_definitions) case default end select return @@ -109,6 +114,8 @@ function prt_block_definitions(subcomponent) result(input_definition) call set_block_pointer(input_definition, prt_oc_block_definitions) case ('PRP') call set_block_pointer(input_definition, prt_prp_block_definitions) + case ('OBS') + call set_block_pointer(input_definition, utl_obs_block_definitions) case default end select return @@ -132,6 +139,8 @@ function prt_idm_multi_package(subcomponent) result(multi_package) multi_package = prt_oc_multi_package case ('PRP') multi_package = prt_prp_multi_package + case ('OBS') + multi_package = utl_obs_multi_package case default call store_error('Idm selector subcomponent not found; '//& &'component="PRT"'//& @@ -158,6 +167,8 @@ function prt_idm_subpackages(subcomponent) result(subpackages) call set_subpkg_pointer(subpackages, prt_oc_subpackages) case ('PRP') call set_subpkg_pointer(subpackages, prt_prp_subpackages) + case ('OBS') + call set_subpkg_pointer(subpackages, utl_obs_subpackages) case default end select return @@ -182,6 +193,8 @@ function prt_idm_integrated(subcomponent) result(integrated) integrated = .true. case ('PRP') integrated = .true. + case ('OBS') + integrated = .true. case default end select return diff --git a/src/Idm/selector/IdmSwfDfnSelector.f90 b/src/Idm/selector/IdmSwfDfnSelector.f90 index d66a41b28dd..46052c27b12 100644 --- a/src/Idm/selector/IdmSwfDfnSelector.f90 +++ b/src/Idm/selector/IdmSwfDfnSelector.f90 @@ -20,6 +20,7 @@ module IdmSwfDfnSelectorModule use SwfEvpInputModule use SwfStoInputModule use SwfZdgInputModule + use UtlObsInputModule implicit none private @@ -85,6 +86,8 @@ function swf_param_definitions(subcomponent) result(input_definition) call set_param_pointer(input_definition, swf_sto_param_definitions) case ('ZDG') call set_param_pointer(input_definition, swf_zdg_param_definitions) + case ('OBS') + call set_param_pointer(input_definition, utl_obs_param_definitions) case default end select return @@ -125,6 +128,8 @@ function swf_aggregate_definitions(subcomponent) result(input_definition) call set_param_pointer(input_definition, swf_sto_aggregate_definitions) case ('ZDG') call set_param_pointer(input_definition, swf_zdg_aggregate_definitions) + case ('OBS') + call set_param_pointer(input_definition, utl_obs_aggregate_definitions) case default end select return @@ -165,6 +170,8 @@ function swf_block_definitions(subcomponent) result(input_definition) call set_block_pointer(input_definition, swf_sto_block_definitions) case ('ZDG') call set_block_pointer(input_definition, swf_zdg_block_definitions) + case ('OBS') + call set_block_pointer(input_definition, utl_obs_block_definitions) case default end select return @@ -204,6 +211,8 @@ function swf_idm_multi_package(subcomponent) result(multi_package) multi_package = swf_sto_multi_package case ('ZDG') multi_package = swf_zdg_multi_package + case ('OBS') + multi_package = utl_obs_multi_package case default call store_error('Idm selector subcomponent not found; '//& &'component="SWF"'//& @@ -246,6 +255,8 @@ function swf_idm_subpackages(subcomponent) result(subpackages) call set_subpkg_pointer(subpackages, swf_sto_subpackages) case ('ZDG') call set_subpkg_pointer(subpackages, swf_zdg_subpackages) + case ('OBS') + call set_subpkg_pointer(subpackages, utl_obs_subpackages) case default end select return @@ -286,6 +297,8 @@ function swf_idm_integrated(subcomponent) result(integrated) integrated = .true. case ('ZDG') integrated = .true. + case ('OBS') + integrated = .true. case default end select return diff --git a/src/Idm/selector/IdmUtlDfnSelector.f90 b/src/Idm/selector/IdmUtlDfnSelector.f90 index 1a3d125b206..3a9ea6a59a2 100644 --- a/src/Idm/selector/IdmUtlDfnSelector.f90 +++ b/src/Idm/selector/IdmUtlDfnSelector.f90 @@ -7,6 +7,7 @@ module IdmUtlDfnSelectorModule InputBlockDefinitionType use UtlHpcInputModule use UtlNcfInputModule + use UtlObsInputModule implicit none private @@ -46,6 +47,8 @@ function utl_param_definitions(subcomponent) result(input_definition) call set_param_pointer(input_definition, utl_hpc_param_definitions) case ('NCF') call set_param_pointer(input_definition, utl_ncf_param_definitions) + case ('OBS') + call set_param_pointer(input_definition, utl_obs_param_definitions) case default end select return @@ -60,6 +63,8 @@ function utl_aggregate_definitions(subcomponent) result(input_definition) call set_param_pointer(input_definition, utl_hpc_aggregate_definitions) case ('NCF') call set_param_pointer(input_definition, utl_ncf_aggregate_definitions) + case ('OBS') + call set_param_pointer(input_definition, utl_obs_aggregate_definitions) case default end select return @@ -74,6 +79,8 @@ function utl_block_definitions(subcomponent) result(input_definition) call set_block_pointer(input_definition, utl_hpc_block_definitions) case ('NCF') call set_block_pointer(input_definition, utl_ncf_block_definitions) + case ('OBS') + call set_block_pointer(input_definition, utl_obs_block_definitions) case default end select return @@ -87,6 +94,8 @@ function utl_idm_multi_package(subcomponent) result(multi_package) multi_package = utl_hpc_multi_package case ('NCF') multi_package = utl_ncf_multi_package + case ('OBS') + multi_package = utl_obs_multi_package case default call store_error('Idm selector subcomponent not found; '//& &'component="UTL"'//& @@ -103,6 +112,8 @@ function utl_idm_subpackages(subcomponent) result(subpackages) call set_subpkg_pointer(subpackages, utl_hpc_subpackages) case ('NCF') call set_subpkg_pointer(subpackages, utl_ncf_subpackages) + case ('OBS') + call set_subpkg_pointer(subpackages, utl_obs_subpackages) case default end select return @@ -117,6 +128,8 @@ function utl_idm_integrated(subcomponent) result(integrated) integrated = .true. case ('NCF') integrated = .true. + case ('OBS') + integrated = .true. case default end select return diff --git a/src/Idm/swf-cdbidm.f90 b/src/Idm/swf-cdbidm.f90 index 057f324dff8..473e657b778 100644 --- a/src/Idm/swf-cdbidm.f90 +++ b/src/Idm/swf-cdbidm.f90 @@ -34,7 +34,7 @@ module SwfCdbInputModule character(len=16), parameter :: & swf_cdb_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/swf-chdidm.f90 b/src/Idm/swf-chdidm.f90 index 6c1df0b7930..f50c3b2aa53 100644 --- a/src/Idm/swf-chdidm.f90 +++ b/src/Idm/swf-chdidm.f90 @@ -37,7 +37,7 @@ module SwfChdInputModule character(len=16), parameter :: & swf_chd_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/swf-dfwidm.f90 b/src/Idm/swf-dfwidm.f90 index e07bd6e4054..0cc83b418ee 100644 --- a/src/Idm/swf-dfwidm.f90 +++ b/src/Idm/swf-dfwidm.f90 @@ -33,7 +33,7 @@ module SwfDfwInputModule character(len=16), parameter :: & swf_dfw_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/swf-evpidm.f90 b/src/Idm/swf-evpidm.f90 index 16cf18308e0..bab724dbc52 100644 --- a/src/Idm/swf-evpidm.f90 +++ b/src/Idm/swf-evpidm.f90 @@ -37,7 +37,7 @@ module SwfEvpInputModule character(len=16), parameter :: & swf_evp_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/swf-flwidm.f90 b/src/Idm/swf-flwidm.f90 index d2345be6122..760cdd63b00 100644 --- a/src/Idm/swf-flwidm.f90 +++ b/src/Idm/swf-flwidm.f90 @@ -37,7 +37,7 @@ module SwfFlwInputModule character(len=16), parameter :: & swf_flw_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/swf-pcpidm.f90 b/src/Idm/swf-pcpidm.f90 index ec3a91099aa..5bc960f1109 100644 --- a/src/Idm/swf-pcpidm.f90 +++ b/src/Idm/swf-pcpidm.f90 @@ -37,7 +37,7 @@ module SwfPcpInputModule character(len=16), parameter :: & swf_pcp_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/swf-zdgidm.f90 b/src/Idm/swf-zdgidm.f90 index 6122e4352b3..e615d3e4c14 100644 --- a/src/Idm/swf-zdgidm.f90 +++ b/src/Idm/swf-zdgidm.f90 @@ -39,7 +39,7 @@ module SwfZdgInputModule character(len=16), parameter :: & swf_zdg_subpackages(*) = & [ & - ' ' & + 'UTL-OBS ' & ] type(InputParamDefinitionType), parameter :: & diff --git a/src/Idm/utl-obsidm.f90 b/src/Idm/utl-obsidm.f90 new file mode 100644 index 00000000000..96ec7e458f4 --- /dev/null +++ b/src/Idm/utl-obsidm.f90 @@ -0,0 +1,261 @@ +! ** Do Not Modify! MODFLOW 6 system generated file. ** +module UtlObsInputModule + use ConstantsModule, only: LENVARNAME + use InputDefinitionModule, only: InputParamDefinitionType, & + InputBlockDefinitionType + private + public utl_obs_param_definitions + public utl_obs_aggregate_definitions + public utl_obs_block_definitions + public UtlObsParamFoundType + public utl_obs_multi_package + public utl_obs_subpackages + + type UtlObsParamFoundType + logical :: digits = .false. + logical :: print_input = .false. + logical :: fileout = .false. + logical :: obs_output_fname = .false. + logical :: binary = .false. + logical :: obsname = .false. + logical :: obstype = .false. + logical :: id = .false. + logical :: id2 = .false. + end type UtlObsParamFoundType + + logical :: utl_obs_multi_package = .true. + + character(len=16), parameter :: & + utl_obs_subpackages(*) = & + [ & + ' ' & + ] + + type(InputParamDefinitionType), parameter :: & + utlobs_digits = InputParamDefinitionType & + ( & + 'UTL', & ! component + 'OBS', & ! subcomponent + 'OPTIONS', & ! block + 'DIGITS', & ! tag name + 'DIGITS', & ! fortran variable + 'INTEGER', & ! type + '', & ! shape + '', & ! longname + .false., & ! required + .false., & ! developmode + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + utlobs_print_input = InputParamDefinitionType & + ( & + 'UTL', & ! component + 'OBS', & ! subcomponent + 'OPTIONS', & ! block + 'PRINT_INPUT', & ! tag name + 'PRINT_INPUT', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'print input to listing file', & ! longname + .false., & ! required + .false., & ! developmode + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + utlobs_fileout = InputParamDefinitionType & + ( & + 'UTL', & ! component + 'OBS', & ! subcomponent + 'CONTINUOUS', & ! block + 'FILEOUT', & ! tag name + 'FILEOUT', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + 'file keyword', & ! longname + .true., & ! required + .false., & ! developmode + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + utlobs_obs_output_fname = InputParamDefinitionType & + ( & + 'UTL', & ! component + 'OBS', & ! subcomponent + 'CONTINUOUS', & ! block + 'OBS_OUTPUT_FILE_NAME', & ! tag name + 'OBS_OUTPUT_FNAME', & ! fortran variable + 'STRING', & ! type + '', & ! shape + '', & ! longname + .true., & ! required + .false., & ! developmode + .true., & ! multi-record + .true., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + utlobs_binary = InputParamDefinitionType & + ( & + 'UTL', & ! component + 'OBS', & ! subcomponent + 'CONTINUOUS', & ! block + 'BINARY', & ! tag name + 'BINARY', & ! fortran variable + 'KEYWORD', & ! type + '', & ! shape + '', & ! longname + .false., & ! required + .false., & ! developmode + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + utlobs_obsname = InputParamDefinitionType & + ( & + 'UTL', & ! component + 'OBS', & ! subcomponent + 'CONTINUOUS', & ! block + 'OBSNAME', & ! tag name + 'OBSNAME', & ! fortran variable + 'STRING', & ! type + '', & ! shape + 'observation name', & ! longname + .true., & ! required + .false., & ! developmode + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + utlobs_obstype = InputParamDefinitionType & + ( & + 'UTL', & ! component + 'OBS', & ! subcomponent + 'CONTINUOUS', & ! block + 'OBSTYPE', & ! tag name + 'OBSTYPE', & ! fortran variable + 'STRING', & ! type + '', & ! shape + 'observation type', & ! longname + .true., & ! required + .false., & ! developmode + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + utlobs_id = InputParamDefinitionType & + ( & + 'UTL', & ! component + 'OBS', & ! subcomponent + 'CONTINUOUS', & ! block + 'ID', & ! tag name + 'ID', & ! fortran variable + 'STRING', & ! type + 'LINELENGTH', & ! shape + 'time', & ! longname + .true., & ! required + .false., & ! developmode + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + utlobs_id2 = InputParamDefinitionType & + ( & + 'UTL', & ! component + 'OBS', & ! subcomponent + 'CONTINUOUS', & ! block + 'ID2', & ! tag name + 'ID2', & ! fortran variable + 'STRING', & ! type + '', & ! shape + 'time', & ! longname + .false., & ! required + .false., & ! developmode + .true., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + utl_obs_param_definitions(*) = & + [ & + utlobs_digits, & + utlobs_print_input, & + utlobs_fileout, & + utlobs_obs_output_fname, & + utlobs_binary, & + utlobs_obsname, & + utlobs_obstype, & + utlobs_id, & + utlobs_id2 & + ] + + type(InputParamDefinitionType), parameter :: & + utlobs_continuous = InputParamDefinitionType & + ( & + 'UTL', & ! component + 'OBS', & ! subcomponent + 'CONTINUOUS', & ! block + 'CONTINUOUS', & ! tag name + 'CONTINUOUS', & ! fortran variable + 'RECARRAY OBSNAME OBSTYPE ID ID2', & ! type + '', & ! shape + '', & ! longname + .true., & ! required + .false., & ! developmode + .false., & ! multi-record + .false., & ! preserve case + .false., & ! layered + .false. & ! timeseries + ) + + type(InputParamDefinitionType), parameter :: & + utl_obs_aggregate_definitions(*) = & + [ & + utlobs_continuous & + ] + + type(InputBlockDefinitionType), parameter :: & + utl_obs_block_definitions(*) = & + [ & + InputBlockDefinitionType( & + 'OPTIONS', & ! blockname + .false., & ! required + .false., & ! aggregate + .false. & ! block_variable + ), & + InputBlockDefinitionType( & + 'CONTINUOUS', & ! blockname + .true., & ! required + .true., & ! aggregate + .true. & ! block_variable + ) & + ] + +end module UtlObsInputModule diff --git a/src/Model/Connection/GweGweConnection.f90 b/src/Model/Connection/GweGweConnection.f90 index 1c5ba428e32..e80efcfffbb 100644 --- a/src/Model/Connection/GweGweConnection.f90 +++ b/src/Model/Connection/GweGweConnection.f90 @@ -319,7 +319,7 @@ subroutine gwegwecon_ar(this) !cdl if (this%gweExchange%inmvt > 0) then !cdl call this%gweExchange%mvt%mvt_ar() !cdl end if - if (this%gweExchange%inobs > 0) then + if (this%gweExchange%obs%active) then call this%gweExchange%obs%obs_ar() end if end if diff --git a/src/Model/Connection/GweInterfaceModel.f90 b/src/Model/Connection/GweInterfaceModel.f90 index 4905f535bc7..ce05f163722 100644 --- a/src/Model/Connection/GweInterfaceModel.f90 +++ b/src/Model/Connection/GweInterfaceModel.f90 @@ -99,7 +99,7 @@ subroutine gweifmod_cr(this, name, iout, gridConn) this%ieqnsclfac) call cnd_cr(this%cnd, this%name, '', -cnd_unit, this%iout, this%fmi, & this%ieqnsclfac, this%gwecommon) - call tsp_obs_cr(this%obs, inobs, this%depvartype) + call tsp_obs_cr(this%obs, '', inobs, this%depvartype) end subroutine gweifmod_cr !> @brief Allocate scalars associated with the interface model object diff --git a/src/Model/Connection/GwfGwfConnection.f90 b/src/Model/Connection/GwfGwfConnection.f90 index 178e88c0fa2..b84ce3cb37c 100644 --- a/src/Model/Connection/GwfGwfConnection.f90 +++ b/src/Model/Connection/GwfGwfConnection.f90 @@ -282,7 +282,7 @@ subroutine gwfgwfcon_ar(this) if (this%gwfExchange%inmvr > 0) then call this%gwfExchange%mvr%mvr_ar() end if - if (this%gwfExchange%inobs > 0) then + if (this%gwfExchange%obs%active) then call this%gwfExchange%obs%obs_ar() end if end if diff --git a/src/Model/Connection/GwtGwtConnection.f90 b/src/Model/Connection/GwtGwtConnection.f90 index cac6b44d14b..fa3bfd12226 100644 --- a/src/Model/Connection/GwtGwtConnection.f90 +++ b/src/Model/Connection/GwtGwtConnection.f90 @@ -300,7 +300,7 @@ subroutine gwtgwtcon_ar(this) !cdl if (this%gwtExchange%inmvt > 0) then !cdl call this%gwtExchange%mvt%mvt_ar() !cdl end if - if (this%gwtExchange%inobs > 0) then + if (this%gwtExchange%obs%active) then call this%gwtExchange%obs%obs_ar() end if end if diff --git a/src/Model/Connection/GwtInterfaceModel.f90 b/src/Model/Connection/GwtInterfaceModel.f90 index 06c9b10ebdd..4d7e26019fd 100644 --- a/src/Model/Connection/GwtInterfaceModel.f90 +++ b/src/Model/Connection/GwtInterfaceModel.f90 @@ -89,7 +89,7 @@ subroutine gwtifmod_cr(this, name, iout, gridConn) call adv_cr(this%adv, this%name, '', adv_unit, this%iout, this%fmi, & this%ieqnsclfac) call dsp_cr(this%dsp, this%name, '', -dsp_unit, this%iout, this%fmi) - call tsp_obs_cr(this%obs, inobs, this%depvartype) + call tsp_obs_cr(this%obs, '', inobs, this%depvartype) end subroutine gwtifmod_cr !> @brief Allocate scalars associated with the interface model object diff --git a/src/Model/GroundWaterEnergy/gwe-lke.f90 b/src/Model/GroundWaterEnergy/gwe-lke.f90 index b85b9d91ba5..467b0929ac1 100644 --- a/src/Model/GroundWaterEnergy/gwe-lke.f90 +++ b/src/Model/GroundWaterEnergy/gwe-lke.f90 @@ -103,7 +103,7 @@ module GweLkeModule !> @brief Create a new lke package !< subroutine lke_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & - fmi, eqnsclfac, gwecommon, dvt, dvu, dvua) + fmi, eqnsclfac, gwecommon, dvt, dvu, dvua, input_mempath) ! -- dummy class(BndType), pointer :: packobj integer(I4B), intent(in) :: id @@ -118,6 +118,7 @@ subroutine lke_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & character(len=*), intent(in) :: dvt !< For GWE, set to "TEMPERATURE" in TspAptType character(len=*), intent(in) :: dvu !< For GWE, set to "energy" in TspAptType character(len=*), intent(in) :: dvua !< For GWE, set to "E" in TspAptType + character(len=*), intent(in) :: input_mempath ! -- local type(GweLkeType), pointer :: lkeobj ! @@ -126,7 +127,7 @@ subroutine lke_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & packobj => lkeobj ! ! -- Create name and memory path - call packobj%set_names(ibcnum, namemodel, pakname, ftype) + call packobj%set_names(ibcnum, namemodel, pakname, ftype, input_mempath) packobj%text = text ! ! -- Allocate scalars diff --git a/src/Model/GroundWaterEnergy/gwe-mwe.f90 b/src/Model/GroundWaterEnergy/gwe-mwe.f90 index a7723fd7ced..29dee0e8bfb 100644 --- a/src/Model/GroundWaterEnergy/gwe-mwe.f90 +++ b/src/Model/GroundWaterEnergy/gwe-mwe.f90 @@ -96,7 +96,7 @@ module GweMweModule !> Create new MWE package !< subroutine mwe_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & - fmi, eqnsclfac, gwecommon, dvt, dvu, dvua) + fmi, eqnsclfac, gwecommon, dvt, dvu, dvua, input_mempath) ! -- dummy class(BndType), pointer :: packobj integer(I4B), intent(in) :: id @@ -111,6 +111,7 @@ subroutine mwe_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & character(len=*), intent(in) :: dvt !< For GWE, set to "TEMPERATURE" in TspAptType character(len=*), intent(in) :: dvu !< For GWE, set to "energy" in TspAptType character(len=*), intent(in) :: dvua !< For GWE, set to "E" in TspAptType + character(len=*), intent(in) :: input_mempath ! -- local type(GweMweType), pointer :: mweobj ! @@ -119,7 +120,7 @@ subroutine mwe_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & packobj => mweobj ! ! -- Create name and memory path - call packobj%set_names(ibcnum, namemodel, pakname, ftype) + call packobj%set_names(ibcnum, namemodel, pakname, ftype, input_mempath) packobj%text = text ! ! -- Allocate scalars diff --git a/src/Model/GroundWaterEnergy/gwe-sfe.f90 b/src/Model/GroundWaterEnergy/gwe-sfe.f90 index f539ff39a44..ef6b55d2008 100644 --- a/src/Model/GroundWaterEnergy/gwe-sfe.f90 +++ b/src/Model/GroundWaterEnergy/gwe-sfe.f90 @@ -104,7 +104,7 @@ module GweSfeModule !> @brief Create a new sfe package !< subroutine sfe_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & - fmi, eqnsclfac, gwecommon, dvt, dvu, dvua) + fmi, eqnsclfac, gwecommon, dvt, dvu, dvua, input_mempath) ! -- dummy class(BndType), pointer :: packobj integer(I4B), intent(in) :: id @@ -119,6 +119,7 @@ subroutine sfe_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & character(len=*), intent(in) :: dvt !< For GWE, set to "TEMPERATURE" in TspAptType character(len=*), intent(in) :: dvu !< For GWE, set to "energy" in TspAptType character(len=*), intent(in) :: dvua !< For GWE, set to "E" in TspAptType + character(len=*), intent(in) :: input_mempath ! -- local type(GweSfeType), pointer :: sfeobj ! @@ -127,7 +128,7 @@ subroutine sfe_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & packobj => sfeobj ! ! -- Create name and memory path - call packobj%set_names(ibcnum, namemodel, pakname, ftype) + call packobj%set_names(ibcnum, namemodel, pakname, ftype, input_mempath) packobj%text = text ! ! -- Allocate scalars diff --git a/src/Model/GroundWaterEnergy/gwe-uze.f90 b/src/Model/GroundWaterEnergy/gwe-uze.f90 index 8816ccdebb1..83d45d8e4e4 100644 --- a/src/Model/GroundWaterEnergy/gwe-uze.f90 +++ b/src/Model/GroundWaterEnergy/gwe-uze.f90 @@ -92,7 +92,7 @@ module GweUzeModule !> @brief Create a new UZE package !< subroutine uze_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & - fmi, eqnsclfac, gwecommon, dvt, dvu, dvua) + fmi, eqnsclfac, gwecommon, dvt, dvu, dvua, input_mempath) ! -- dummy class(BndType), pointer :: packobj integer(I4B), intent(in) :: id @@ -107,6 +107,7 @@ subroutine uze_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & character(len=*), intent(in) :: dvt !< For GWE, set to "TEMPERATURE" in TspAptType character(len=*), intent(in) :: dvu !< For GWE, set to "energy" in TspAptType character(len=*), intent(in) :: dvua !< For GWE, set to "E" in TspAptType + character(len=*), intent(in) :: input_mempath ! -- local type(GweUzeType), pointer :: uzeobj ! @@ -115,7 +116,7 @@ subroutine uze_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & packobj => uzeobj ! ! -- Create name and memory path - call packobj%set_names(ibcnum, namemodel, pakname, ftype) + call packobj%set_names(ibcnum, namemodel, pakname, ftype, input_mempath) packobj%text = text ! ! -- Allocate scalars diff --git a/src/Model/GroundWaterEnergy/gwe.f90 b/src/Model/GroundWaterEnergy/gwe.f90 index 072cf10e218..e73e7f66f20 100644 --- a/src/Model/GroundWaterEnergy/gwe.f90 +++ b/src/Model/GroundWaterEnergy/gwe.f90 @@ -753,19 +753,23 @@ subroutine package_create(this, filtyp, ipakid, ipaknum, pakname, mempath, & case ('LKE6') call lke_create(packobj, ipakid, ipaknum, inunit, iout, this%name, & pakname, this%fmi, this%eqnsclfac, this%gwecommon, & - this%depvartype, this%depvarunit, this%depvarunitabbrev) + this%depvartype, this%depvarunit, this%depvarunitabbrev, & + mempath) case ('SFE6') call sfe_create(packobj, ipakid, ipaknum, inunit, iout, this%name, & pakname, this%fmi, this%eqnsclfac, this%gwecommon, & - this%depvartype, this%depvarunit, this%depvarunitabbrev) + this%depvartype, this%depvarunit, this%depvarunitabbrev, & + mempath) case ('MWE6') call mwe_create(packobj, ipakid, ipaknum, inunit, iout, this%name, & pakname, this%fmi, this%eqnsclfac, this%gwecommon, & - this%depvartype, this%depvarunit, this%depvarunitabbrev) + this%depvartype, this%depvarunit, this%depvarunitabbrev, & + mempath) case ('UZE6') call uze_create(packobj, ipakid, ipaknum, inunit, iout, this%name, & pakname, this%fmi, this%eqnsclfac, this%gwecommon, & - this%depvartype, this%depvarunit, this%depvarunitabbrev) + this%depvartype, this%depvarunit, this%depvarunitabbrev, & + mempath) !case('API6') ! call api_create(packobj, ipakid, ipaknum, inunit, iout, this%name, & ! pakname) diff --git a/src/Model/GroundWaterFlow/gwf-api.f90 b/src/Model/GroundWaterFlow/gwf-api.f90 index b9153f90d27..fc97fc8f095 100644 --- a/src/Model/GroundWaterFlow/gwf-api.f90 +++ b/src/Model/GroundWaterFlow/gwf-api.f90 @@ -11,7 +11,7 @@ !< module apimodule use KindModule, only: DP, I4B - use ConstantsModule, only: DZERO, LENFTYPE, LENPACKAGENAME + use ConstantsModule, only: DZERO, LENFTYPE, LENPACKAGENAME, LINELENGTH use MemoryHelperModule, only: create_mem_path use BndModule, only: BndType use ObsModule, only: DefaultObsIdProcessor @@ -86,13 +86,19 @@ end subroutine api_create !> @ brief Source package options from input context !< subroutine source_options(this) + use MemoryManagerModule, only: mem_setptr use MemoryManagerExtModule, only: mem_set_value use InputOutputModule, only: GetUnit, openfile + use CharacterStringModule, only: CharacterStringType use SourceCommonModule, only: filein_fname use GwfApiInputModule, only: GwfApiParamFoundType ! -- dummy variables class(ApiType), intent(inout) :: this + ! -- local variables type(GwfApiParamFoundType) :: found + type(CharacterStringType), dimension(:), pointer, & + contiguous :: obs_mempath + character(len=LINELENGTH) :: obs_fname ! -- formats character(len=*), parameter :: fmtflow2 = & &"(4x, 'FLOWS WILL BE SAVED TO BUDGET FILE SPECIFIED IN OUTPUT CONTROL')" @@ -109,11 +115,10 @@ subroutine source_options(this) if (found%ipakcb) this%ipakcb = -1 ! enforce 0 or 1 OBS6_FILENAME entries in option block - if (filein_fname(this%obs%inputFilename, 'OBS6_FILENAME', & + if (filein_fname(obs_fname, 'OBS6_FILENAME', & this%input_mempath, this%input_fname)) then - this%obs%active = .true. - this%obs%inUnitObs = GetUnit() - call openfile(this%obs%inUnitObs, this%iout, this%obs%inputFilename, 'OBS') + call mem_setptr(obs_mempath, 'OBS6_MEMPATH', this%input_mempath) + this%obs%input_mempath = obs_mempath(1) end if ! log package options diff --git a/src/Model/GroundWaterFlow/gwf-csub.f90 b/src/Model/GroundWaterFlow/gwf-csub.f90 index 8151567e9be..601eef9fee6 100644 --- a/src/Model/GroundWaterFlow/gwf-csub.f90 +++ b/src/Model/GroundWaterFlow/gwf-csub.f90 @@ -211,7 +211,6 @@ module GwfCsubModule real(DP), dimension(:), pointer, contiguous :: sig0 => null() !< array of package specific boundary numbers ! ! -- observation data - integer(I4B), pointer :: inobspkg => null() !< unit number for obs package type(ObsType), pointer :: obs => null() !< observation package ! ! -- table objects @@ -385,7 +384,7 @@ subroutine csub_ar(this, dis, ibound) this%ibound => ibound ! ! -- create obs package - call obs_cr(this%obs, this%inobspkg) + call obs_cr(this%obs) ! ! -- source csub options call this%source_options() @@ -530,20 +529,22 @@ end subroutine csub_ar subroutine source_options(this) ! -- modules use ConstantsModule, only: MAXCHARLEN, DZERO, MNORMAL - use MemoryManagerModule, only: mem_reallocate + use MemoryManagerModule, only: mem_reallocate, mem_setptr use MemoryManagerExtModule, only: mem_set_value use OpenSpecModule, only: access, form use InputOutputModule, only: getunit, urdaux, openfile + use CharacterStringModule, only: CharacterStringType use GwfCsubInputModule, only: GwfCsubParamFoundType use SourceCommonModule, only: filein_fname ! -- dummy variables class(GwfCsubType), intent(inout) :: this ! -- local variables + type(CharacterStringType), dimension(:), pointer, & + contiguous :: obs_mempath integer(I4B), pointer :: ibs - integer(I4B) :: inobs character(len=LINELENGTH) :: csv_interbed, csv_coarse character(len=LINELENGTH) :: cmp_fn, ecmp_fn, iecmp_fn, ibcmp_fn, cmpcoarse_fn - character(len=LINELENGTH) :: zdisp_fn, pkg_converge_fn + character(len=LINELENGTH) :: zdisp_fn, pkg_converge_fn, obs_fname type(GwfCsubParamFoundType) :: found logical(LGP) :: warn_estress_lag = .false. @@ -598,13 +599,10 @@ subroutine source_options(this) found%pkgconvergefn) ! -- enforce 0 or 1 OBS6_FILENAME entries in option block - if (filein_fname(this%obs%inputFilename, 'OBS6_FILENAME', & + if (filein_fname(obs_fname, 'OBS6_FILENAME', & this%input_mempath, this%input_fname)) then - this%obs%active = .true. - inobs = GetUnit() - call openfile(inobs, this%iout, this%obs%inputFilename, 'OBS') - this%obs%inUnitObs = inobs - this%inobspkg = inobs + call mem_setptr(obs_mempath, 'OBS6_MEMPATH', this%input_mempath) + this%obs%input_mempath = obs_mempath(1) call this%obs%obs_df(this%iout, this%packName, this%filtyp, this%dis) call this%csub_df_obs() end if @@ -874,7 +872,6 @@ subroutine csub_allocate_scalars(this) ! ! -- allocate the object and assign values to object variables call mem_allocate(this%istounit, 'ISTOUNIT', this%memoryPath) - call mem_allocate(this%inobspkg, 'INOBSPKG', this%memoryPath) call mem_allocate(this%ninterbeds, 'NINTERBEDS', this%memoryPath) call mem_allocate(this%maxsig0, 'MAXSIG0', this%memoryPath) call mem_allocate(this%nbound, 'NBOUND', this%memoryPath) @@ -917,7 +914,6 @@ subroutine csub_allocate_scalars(this) ! ! -- initialize values this%istounit = 0 - this%inobspkg = 0 this%ninterbeds = 0 this%maxsig0 = 0 this%nbound = 0 @@ -2220,7 +2216,6 @@ subroutine csub_da(this) ! ! -- deallocate scalars call mem_deallocate(this%istounit) - call mem_deallocate(this%inobspkg) call mem_deallocate(this%ninterbeds) call mem_deallocate(this%maxsig0) call mem_deallocate(this%nbound) diff --git a/src/Model/GroundWaterFlow/gwf-lak.f90 b/src/Model/GroundWaterFlow/gwf-lak.f90 index 419e8f7bc92..ff6753ec6c0 100644 --- a/src/Model/GroundWaterFlow/gwf-lak.f90 +++ b/src/Model/GroundWaterFlow/gwf-lak.f90 @@ -287,7 +287,8 @@ module LakModule !> @brief Create a new LAK Package and point bndobj to the new package !< - subroutine lak_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname) + subroutine lak_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & + input_mempath) ! -- dummy class(BndType), pointer :: packobj integer(I4B), intent(in) :: id @@ -296,6 +297,7 @@ subroutine lak_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname) integer(I4B), intent(in) :: iout character(len=*), intent(in) :: namemodel character(len=*), intent(in) :: pakname + character(len=*), intent(in) :: input_mempath ! -- local type(LakType), pointer :: lakobj ! @@ -304,7 +306,7 @@ subroutine lak_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname) packobj => lakobj ! ! -- create name and memory path - call packobj%set_names(ibcnum, namemodel, pakname, ftype) + call packobj%set_names(ibcnum, namemodel, pakname, ftype, input_mempath) packobj%text = text ! ! -- allocate scalars diff --git a/src/Model/GroundWaterFlow/gwf-maw.f90 b/src/Model/GroundWaterFlow/gwf-maw.f90 index 9877c1b6896..f65ac180d0e 100644 --- a/src/Model/GroundWaterFlow/gwf-maw.f90 +++ b/src/Model/GroundWaterFlow/gwf-maw.f90 @@ -230,7 +230,8 @@ module MawModule !! !! After creating the package object point bndobj to the new package !< - subroutine maw_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname) + subroutine maw_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & + input_mempath) ! -- dummy class(BndType), pointer :: packobj integer(I4B), intent(in) :: id @@ -239,6 +240,7 @@ subroutine maw_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname) integer(I4B), intent(in) :: iout character(len=*), intent(in) :: namemodel character(len=*), intent(in) :: pakname + character(len=*), intent(in) :: input_mempath type(MawType), pointer :: mawobj ! ! -- allocate the object and assign values to object variables @@ -246,7 +248,7 @@ subroutine maw_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname) packobj => mawobj ! ! -- create name and memory path - call packobj%set_names(ibcnum, namemodel, pakname, ftype) + call packobj%set_names(ibcnum, namemodel, pakname, ftype, input_mempath) packobj%text = text ! ! -- allocate scalars diff --git a/src/Model/GroundWaterFlow/gwf-obs.f90 b/src/Model/GroundWaterFlow/gwf-obs.f90 index 79495d0136a..b4dce937c65 100644 --- a/src/Model/GroundWaterFlow/gwf-obs.f90 +++ b/src/Model/GroundWaterFlow/gwf-obs.f90 @@ -37,16 +37,16 @@ module GwfObsModule !! !! Create observation object, allocate pointers, initialize values !< - subroutine gwf_obs_cr(obs, inobs) + subroutine gwf_obs_cr(obs, input_mempath, inobs) ! -- dummy type(GwfObsType), pointer, intent(out) :: obs + character(len=*), intent(in) :: input_mempath integer(I4B), pointer, intent(in) :: inobs ! allocate (obs) call obs%allocate_scalars() - obs%active = .false. - obs%inputFilename = '' - obs%inUnitObs => inobs + obs%inUnitObs = inobs + obs%input_mempath = input_mempath end subroutine gwf_obs_cr !> @brief Allocate and read diff --git a/src/Model/GroundWaterFlow/gwf-sfr.f90 b/src/Model/GroundWaterFlow/gwf-sfr.f90 index 320d8bb9d5c..cff45edb4b5 100644 --- a/src/Model/GroundWaterFlow/gwf-sfr.f90 +++ b/src/Model/GroundWaterFlow/gwf-sfr.f90 @@ -291,7 +291,8 @@ module subroutine sfr_calc_constant(this, n, d1, hgwf, qgwf, qd) !! !! Create a new SFR Package object !< - subroutine sfr_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname) + subroutine sfr_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & + input_mempath) ! -- modules use MemoryHelperModule, only: create_mem_path ! -- dummy @@ -302,6 +303,7 @@ subroutine sfr_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname) integer(I4B), intent(in) :: iout !< unit number of model listing file character(len=*), intent(in) :: namemodel !< model name character(len=*), intent(in) :: pakname !< package name + character(len=*), intent(in) :: input_mempath ! -- local type(SfrType), pointer :: sfrobj ! @@ -310,7 +312,7 @@ subroutine sfr_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname) packobj => sfrobj ! ! -- create name and memory path - call packobj%set_names(ibcnum, namemodel, pakname, ftype) + call packobj%set_names(ibcnum, namemodel, pakname, ftype, input_mempath) packobj%text = text ! ! -- allocate scalars diff --git a/src/Model/GroundWaterFlow/gwf-uzf.f90 b/src/Model/GroundWaterFlow/gwf-uzf.f90 index 00f7910b3f7..14549255e62 100644 --- a/src/Model/GroundWaterFlow/gwf-uzf.f90 +++ b/src/Model/GroundWaterFlow/gwf-uzf.f90 @@ -172,7 +172,8 @@ module UzfModule !> @brief Create a New UZF Package and point packobj to the new package !< - subroutine uzf_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname) + subroutine uzf_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & + input_mempath) ! -- modules use MemoryManagerModule, only: mem_allocate ! -- dummy @@ -183,6 +184,7 @@ subroutine uzf_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname) integer(I4B), intent(in) :: iout character(len=*), intent(in) :: namemodel character(len=*), intent(in) :: pakname + character(len=*), intent(in) :: input_mempath ! -- local type(UzfType), pointer :: uzfobj ! @@ -191,7 +193,7 @@ subroutine uzf_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname) packobj => uzfobj ! ! -- create name and memory path - call packobj%set_names(ibcnum, namemodel, pakname, ftype) + call packobj%set_names(ibcnum, namemodel, pakname, ftype, input_mempath) packobj%text = text ! ! -- allocate scalars diff --git a/src/Model/GroundWaterFlow/gwf.f90 b/src/Model/GroundWaterFlow/gwf.f90 index 46dddb758d2..b2323f1da0d 100644 --- a/src/Model/GroundWaterFlow/gwf.f90 +++ b/src/Model/GroundWaterFlow/gwf.f90 @@ -1264,13 +1264,17 @@ subroutine package_create(this, filtyp, ipakid, ipaknum, pakname, mempath, & call evt_create(packobj, ipakid, ipaknum, inunit, iout, this%name, & pakname, mempath) case ('MAW6') - call maw_create(packobj, ipakid, ipaknum, inunit, iout, this%name, pakname) + call maw_create(packobj, ipakid, ipaknum, inunit, iout, this%name, & + pakname, mempath) case ('SFR6') - call sfr_create(packobj, ipakid, ipaknum, inunit, iout, this%name, pakname) + call sfr_create(packobj, ipakid, ipaknum, inunit, iout, this%name, & + pakname, mempath) case ('LAK6') - call lak_create(packobj, ipakid, ipaknum, inunit, iout, this%name, pakname) + call lak_create(packobj, ipakid, ipaknum, inunit, iout, this%name, & + pakname, mempath) case ('UZF6') - call uzf_create(packobj, ipakid, ipaknum, inunit, iout, this%name, pakname) + call uzf_create(packobj, ipakid, ipaknum, inunit, iout, this%name, & + pakname, mempath) case ('API6') call api_create(packobj, ipakid, ipaknum, inunit, iout, this%name, & pakname, mempath) @@ -1443,6 +1447,7 @@ subroutine create_packages(this) character(len=LENMEMPATH) :: mempathhfb = '' character(len=LENMEMPATH) :: mempathic = '' character(len=LENMEMPATH) :: mempathnpf = '' + character(len=LENMEMPATH) :: mempathobs = '' character(len=LENMEMPATH) :: mempathoc = '' character(len=LENMEMPATH) :: mempathsto = '' character(len=LENMEMPATH) :: mempathvsc = '' @@ -1504,7 +1509,8 @@ subroutine create_packages(this) this%inoc = 1 mempathoc = mempath case ('OBS6') - this%inobs = inunit + this%inobs = 1 + mempathobs = mempath case ('WEL6', 'DRN6', 'RIV6', 'GHB6', 'RCH6', & 'EVT6', 'API6', 'CHD6', 'MAW6', 'SFR6', & 'LAK6', 'UZF6') @@ -1528,7 +1534,7 @@ subroutine create_packages(this) call ic_cr(this%ic, this%name, mempathic, this%inic, this%iout, this%dis) call mvr_cr(this%mvr, this%name, this%inmvr, this%iout, this%dis) call oc_cr(this%oc, this%name, mempathoc, this%inoc, this%iout) - call gwf_obs_cr(this%obs, this%inobs) + call gwf_obs_cr(this%obs, mempathobs, this%inobs) ! ! -- Check to make sure that required ftype's have been specified call this%ftype_check(indis) diff --git a/src/Model/GroundWaterTransport/gwt-lkt.f90 b/src/Model/GroundWaterTransport/gwt-lkt.f90 index 7560ae8b694..2cefd9fd02e 100644 --- a/src/Model/GroundWaterTransport/gwt-lkt.f90 +++ b/src/Model/GroundWaterTransport/gwt-lkt.f90 @@ -95,7 +95,7 @@ module GwtLktModule !> @brief Create a new lkt package !< subroutine lkt_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & - fmi, eqnsclfac, dvt, dvu, dvua) + fmi, eqnsclfac, dvt, dvu, dvua, input_mempath) ! -- dummy class(BndType), pointer :: packobj integer(I4B), intent(in) :: id @@ -109,6 +109,7 @@ subroutine lkt_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & character(len=*), intent(in) :: dvt !< For GWT, set to "CONCENTRATION" in TspAptType character(len=*), intent(in) :: dvu !< For GWT, set to "mass" in TspAptType character(len=*), intent(in) :: dvua !< For GWT, set to "M" in TspAptType + character(len=*), intent(in) :: input_mempath ! -- local type(GwtLktType), pointer :: lktobj ! @@ -117,7 +118,7 @@ subroutine lkt_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & packobj => lktobj ! ! -- create name and memory path - call packobj%set_names(ibcnum, namemodel, pakname, ftype) + call packobj%set_names(ibcnum, namemodel, pakname, ftype, input_mempath) packobj%text = text ! ! -- allocate scalars diff --git a/src/Model/GroundWaterTransport/gwt-mwt.f90 b/src/Model/GroundWaterTransport/gwt-mwt.f90 index da6c217fee8..ee2ad9efa86 100644 --- a/src/Model/GroundWaterTransport/gwt-mwt.f90 +++ b/src/Model/GroundWaterTransport/gwt-mwt.f90 @@ -88,7 +88,7 @@ module GwtMwtModule !> Create new MWT package !< subroutine mwt_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & - fmi, eqnsclfac, dvt, dvu, dvua) + fmi, eqnsclfac, dvt, dvu, dvua, input_mempath) ! -- dummy class(BndType), pointer :: packobj integer(I4B), intent(in) :: id @@ -102,6 +102,7 @@ subroutine mwt_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & character(len=*), intent(in) :: dvt !< For GWT, set to "CONCENTRATION" in TspAptType character(len=*), intent(in) :: dvu !< For GWT, set to "mass" in TspAptType character(len=*), intent(in) :: dvua !< For GWT, set to "M" in TspAptType + character(len=*), intent(in) :: input_mempath ! -- local type(GwtMwtType), pointer :: mwtobj ! @@ -110,7 +111,7 @@ subroutine mwt_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & packobj => mwtobj ! ! -- create name and memory path - call packobj%set_names(ibcnum, namemodel, pakname, ftype) + call packobj%set_names(ibcnum, namemodel, pakname, ftype, input_mempath) packobj%text = text ! ! -- allocate scalars diff --git a/src/Model/GroundWaterTransport/gwt-sft.f90 b/src/Model/GroundWaterTransport/gwt-sft.f90 index 7631f191d9a..ac125e60a2f 100644 --- a/src/Model/GroundWaterTransport/gwt-sft.f90 +++ b/src/Model/GroundWaterTransport/gwt-sft.f90 @@ -92,7 +92,7 @@ module GwtSftModule !> @brief Create a new sft package !< subroutine sft_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & - fmi, eqnsclfac, dvt, dvu, dvua) + fmi, eqnsclfac, dvt, dvu, dvua, input_mempath) ! -- dummy class(BndType), pointer :: packobj integer(I4B), intent(in) :: id @@ -106,6 +106,7 @@ subroutine sft_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & character(len=*), intent(in) :: dvt !< For GWT, set to "CONCENTRATION" in TspAptType character(len=*), intent(in) :: dvu !< For GWT, set to "mass" in TspAptType character(len=*), intent(in) :: dvua !< For GWT, set to "M" in TspAptType + character(len=*), intent(in) :: input_mempath ! -- local type(GwtSftType), pointer :: sftobj ! @@ -114,7 +115,7 @@ subroutine sft_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & packobj => sftobj ! ! -- create name and memory path - call packobj%set_names(ibcnum, namemodel, pakname, ftype) + call packobj%set_names(ibcnum, namemodel, pakname, ftype, input_mempath) packobj%text = text ! ! -- allocate scalars diff --git a/src/Model/GroundWaterTransport/gwt-uzt.f90 b/src/Model/GroundWaterTransport/gwt-uzt.f90 index 9d8013dcb85..54d59b9b9e4 100644 --- a/src/Model/GroundWaterTransport/gwt-uzt.f90 +++ b/src/Model/GroundWaterTransport/gwt-uzt.f90 @@ -81,7 +81,7 @@ module GwtUztModule !> @brief Create a new UZT package !< subroutine uzt_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & - fmi, eqnsclfac, dvt, dvu, dvua) + fmi, eqnsclfac, dvt, dvu, dvua, input_mempath) ! -- dummy class(BndType), pointer :: packobj integer(I4B), intent(in) :: id @@ -95,6 +95,7 @@ subroutine uzt_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & character(len=*), intent(in) :: dvt !< For GWT, set to "CONCENTRATION" in TspAptType character(len=*), intent(in) :: dvu !< For GWT, set to "mass" in TspAptType character(len=*), intent(in) :: dvua !< For GWT, set to "M" in TspAptType + character(len=*), intent(in) :: input_mempath ! -- local type(GwtUztType), pointer :: uztobj ! @@ -103,7 +104,7 @@ subroutine uzt_create(packobj, id, ibcnum, inunit, iout, namemodel, pakname, & packobj => uztobj ! ! -- create name and memory path - call packobj%set_names(ibcnum, namemodel, pakname, ftype) + call packobj%set_names(ibcnum, namemodel, pakname, ftype, input_mempath) packobj%text = text ! ! -- allocate scalars diff --git a/src/Model/GroundWaterTransport/gwt.f90 b/src/Model/GroundWaterTransport/gwt.f90 index 0b4293cb5f8..589cd9c5dc7 100644 --- a/src/Model/GroundWaterTransport/gwt.f90 +++ b/src/Model/GroundWaterTransport/gwt.f90 @@ -781,19 +781,19 @@ subroutine package_create(this, filtyp, ipakid, ipaknum, pakname, mempath, & case ('LKT6') call lkt_create(packobj, ipakid, ipaknum, inunit, iout, this%name, & pakname, this%fmi, this%eqnsclfac, this%depvartype, & - this%depvarunit, this%depvarunitabbrev) + this%depvarunit, this%depvarunitabbrev, mempath) case ('SFT6') call sft_create(packobj, ipakid, ipaknum, inunit, iout, this%name, & pakname, this%fmi, this%eqnsclfac, this%depvartype, & - this%depvarunit, this%depvarunitabbrev) + this%depvarunit, this%depvarunitabbrev, mempath) case ('MWT6') call mwt_create(packobj, ipakid, ipaknum, inunit, iout, this%name, & pakname, this%fmi, this%eqnsclfac, this%depvartype, & - this%depvarunit, this%depvarunitabbrev) + this%depvarunit, this%depvarunitabbrev, mempath) case ('UZT6') call uzt_create(packobj, ipakid, ipaknum, inunit, iout, this%name, & pakname, this%fmi, this%eqnsclfac, this%depvartype, & - this%depvarunit, this%depvarunitabbrev) + this%depvarunit, this%depvarunitabbrev, mempath) case ('IST6') call ist_create(packobj, ipakid, ipaknum, inunit, iout, this%name, & pakname, mempath, this%fmi, this%mst) diff --git a/src/Model/ModelUtilities/BoundaryPackage.f90 b/src/Model/ModelUtilities/BoundaryPackage.f90 index b0920d9ffc1..71797d6ae13 100644 --- a/src/Model/ModelUtilities/BoundaryPackage.f90 +++ b/src/Model/ModelUtilities/BoundaryPackage.f90 @@ -94,7 +94,6 @@ module BndModule logical(LGP) :: AllowTimeArraySeries = .false. ! ! -- pointers for observations - integer(I4B), pointer :: inobspkg => null() !< unit number for obs package type(ObsType), pointer :: obs => null() !< observation package ! ! -- pointers to model/solution variables @@ -189,7 +188,7 @@ subroutine bnd_df(this, neq, dis) call tasmanager_cr(this%TasManager, dis, this%name_model, this%iout) ! ! -- create obs package - call obs_cr(this%obs, this%inobspkg) + call obs_cr(this%obs) ! ! -- Write information to model list file write (this%iout, 1) this%filtyp, trim(adjustl(this%text)), this%inunit @@ -898,7 +897,6 @@ subroutine bnd_da(this) call mem_deallocate(this%naux) call mem_deallocate(this%inamedbound) call mem_deallocate(this%iauxmultcol) - call mem_deallocate(this%inobspkg) call mem_deallocate(this%imover) call mem_deallocate(this%npakeq) call mem_deallocate(this%ioffset) @@ -952,7 +950,6 @@ subroutine allocate_scalars(this) call mem_allocate(this%naux, 'NAUX', this%memoryPath) call mem_allocate(this%inamedbound, 'INAMEDBOUND', this%memoryPath) call mem_allocate(this%iauxmultcol, 'IAUXMULTCOL', this%memoryPath) - call mem_allocate(this%inobspkg, 'INOBSPKG', this%memoryPath) ! ! -- allocate the object and assign values to object variables call mem_allocate(this%imover, 'IMOVER', this%memoryPath) @@ -983,7 +980,6 @@ subroutine allocate_scalars(this) this%naux = 0 this%inamedbound = 0 this%iauxmultcol = 0 - this%inobspkg = 0 this%imover = 0 this%npakeq = 0 this%ioffset = 0 @@ -1141,7 +1137,9 @@ end subroutine set_pointers subroutine bnd_read_options(this) ! -- modules use InputOutputModule, only: urdaux - use MemoryManagerModule, only: mem_reallocate + use MemoryManagerModule, only: mem_reallocate, mem_setptr + use MemoryHelperModule, only: create_mem_path + use SimVariablesModule, only: idm_context ! -- dummy class(BndType), intent(inout) :: this !< BndType object ! -- local @@ -1150,12 +1148,14 @@ subroutine bnd_read_options(this) character(len=LINELENGTH) :: keyword character(len=LENAUXNAME) :: sfacauxname character(len=LENAUXNAME), dimension(:), allocatable :: caux + character(len=LENMEMPATH) :: input_mempath + type(CharacterStringType), dimension(:), & + pointer, contiguous :: obs_mempath integer(I4B) :: lloc integer(I4B) :: istart integer(I4B) :: istop integer(I4B) :: n integer(I4B) :: ierr - integer(I4B) :: inobs logical(LGP) :: isfound logical(LGP) :: endOfBlock logical(LGP) :: foundchildclassoption @@ -1263,16 +1263,16 @@ subroutine bnd_read_options(this) call store_error(errmsg) call this%parser%StoreErrorUnit() end if - if (this%obs%active) then + if (this%obs%input_mempath /= '') then errmsg = 'Multiple OBS6 keywords detected in OPTIONS block. '// & 'Only one OBS6 entry allowed for a package.' call store_error(errmsg) end if - this%obs%active = .true. - call this%parser%GetString(this%obs%inputFilename) - inobs = GetUnit() - call openfile(inobs, this%iout, this%obs%inputFilename, 'OBS') - this%obs%inUnitObs = inobs + call this%parser%GetString(this%obs%input_fname) + input_mempath = create_mem_path(this%name_model, this%packName, & + idm_context) + call mem_setptr(obs_mempath, 'OBS6_MEMPATH', input_mempath) + this%obs%input_mempath = obs_mempath(1) ! ! -- right now these are options that are only available in the ! development version and are not included in the documentation. diff --git a/src/Model/ModelUtilities/BoundaryPackageExt.f90 b/src/Model/ModelUtilities/BoundaryPackageExt.f90 index 49f5376a22f..a4ed22ab50e 100644 --- a/src/Model/ModelUtilities/BoundaryPackageExt.f90 +++ b/src/Model/ModelUtilities/BoundaryPackageExt.f90 @@ -99,7 +99,7 @@ subroutine bndext_df(this, neq, dis) call tasmanager_cr(this%TasManager, dis, this%name_model, this%iout) ! ! -- create obs package - call obs_cr(this%obs, this%inobspkg) + call obs_cr(this%obs) ! ! -- Write information to model list file write (this%iout, 1) trim(this%filtyp), trim(adjustl(this%text)), & @@ -277,7 +277,7 @@ end subroutine bndext_allocate_arrays !< subroutine source_options(this) ! -- modules - use MemoryManagerModule, only: mem_reallocate, mem_setptr !, get_isize + use MemoryManagerModule, only: mem_reallocate, mem_setptr use MemoryManagerExtModule, only: mem_set_value use InputOutputModule, only: GetUnit, openfile use CharacterStringModule, only: CharacterStringType @@ -285,9 +285,12 @@ subroutine source_options(this) ! -- dummy variables class(BndExtType), intent(inout) :: this !< BndExtType object ! -- local variables + type(CharacterStringType), dimension(:), & + pointer, contiguous :: obs_mempath type(BndExtFoundType) :: found logical(LGP) :: found_readarr character(len=LENAUXNAME) :: sfacauxname + character(len=LINELENGTH) :: obs_fname integer(I4B) :: n ! ! -- update defaults with idm sourced values @@ -330,11 +333,10 @@ subroutine source_options(this) ! ! ! -- enforce 0 or 1 OBS6_FILENAME entries in option block - if (filein_fname(this%obs%inputFilename, 'OBS6_FILENAME', & + if (filein_fname(obs_fname, 'OBS6_FILENAME', & this%input_mempath, this%input_fname)) then - this%obs%active = .true. - this%obs%inUnitObs = GetUnit() - call openfile(this%obs%inUnitObs, this%iout, this%obs%inputFilename, 'OBS') + call mem_setptr(obs_mempath, 'OBS6_MEMPATH', this%input_mempath) + this%obs%input_mempath = obs_mempath(1) end if ! ! -- no newton specified diff --git a/src/Model/ModelUtilities/ModelPackageInput.f90 b/src/Model/ModelUtilities/ModelPackageInput.f90 index bed5b2a0062..9a8dcdc080c 100644 --- a/src/Model/ModelUtilities/ModelPackageInput.f90 +++ b/src/Model/ModelUtilities/ModelPackageInput.f90 @@ -49,8 +49,8 @@ module ModelPackageInputModule subroutine supported_model_packages(mtype, pkgtypes, numpkgs) ! -- modules ! -- dummy - character(len=LENFTYPE), intent(in) :: mtype - character(len=LENPACKAGETYPE), dimension(:), allocatable, & + character(len=*), intent(in) :: mtype + character(len=*), dimension(:), allocatable, & intent(inout) :: pkgtypes integer(I4B), intent(inout) :: numpkgs ! -- local @@ -90,9 +90,9 @@ function multi_package_type(mtype_component, ptype_component, pkgtype) & result(multi_package) ! -- modules ! -- dummy - character(len=LENFTYPE), intent(in) :: mtype_component - character(len=LENFTYPE), intent(in) :: ptype_component - character(len=LENFTYPE), intent(in) :: pkgtype + character(len=*), intent(in) :: mtype_component + character(len=*), intent(in) :: ptype_component + character(len=*), intent(in) :: pkgtype ! -- return logical(LGP) :: multi_package ! -- local diff --git a/src/Model/SurfaceWaterFlow/swf-dfw.f90 b/src/Model/SurfaceWaterFlow/swf-dfw.f90 index 87d3c30962d..d876c6cbff4 100644 --- a/src/Model/SurfaceWaterFlow/swf-dfw.f90 +++ b/src/Model/SurfaceWaterFlow/swf-dfw.f90 @@ -55,7 +55,6 @@ module SwfDfwModule real(DP), dimension(:), pointer, contiguous :: dhdsja => null() !< gradient for each connection (of size njas) ! observation data - integer(I4B), pointer :: inobspkg => null() !< unit number for obs package type(ObsType), pointer :: obs => null() !< observation package ! pointer to cross section data @@ -145,7 +144,7 @@ subroutine dfw_cr(dfwobj, name_model, input_mempath, inunit, iout, & dfwobj%cxs => cxs ! create obs package - call obs_cr(dfwobj%obs, dfwobj%inobspkg) + call obs_cr(dfwobj%obs) ! check if dfw is enabled if (inunit > 0) then @@ -207,7 +206,6 @@ subroutine allocate_scalars(this) call mem_allocate(this%unitconv, 'UNITCONV', this%memoryPath) call mem_allocate(this%lengthconv, 'LENGTHCONV', this%memoryPath) call mem_allocate(this%timeconv, 'TIMECONV', this%memoryPath) - call mem_allocate(this%inobspkg, 'INOBSPKG', this%memoryPath) call mem_allocate(this%icalcvelocity, 'ICALCVELOCITY', this%memoryPath) call mem_allocate(this%isavvelocity, 'ISAVVELOCITY', this%memoryPath) call mem_allocate(this%nedges, 'NEDGES', this%memoryPath) @@ -219,7 +217,6 @@ subroutine allocate_scalars(this) this%unitconv = DONE this%lengthconv = DONE this%timeconv = DONE - this%inobspkg = 0 this%icalcvelocity = 0 this%isavvelocity = 0 this%nedges = 0 @@ -301,7 +298,7 @@ subroutine source_options(this) integer(I4B) :: isize type(SwfDfwParamFoundType) :: found type(CharacterStringType), dimension(:), pointer, & - contiguous :: obs6_fnames + contiguous :: obs6_fnames, obs6_mempaths ! update defaults with idm sourced values call mem_set_value(this%icentral, 'ICENTRAL', & @@ -342,13 +339,10 @@ subroutine source_options(this) end if call mem_setptr(obs6_fnames, 'OBS6_FILENAME', this%input_mempath) + call mem_setptr(obs6_mempaths, 'OBS6_MEMPATH', this%input_mempath) found%obs6_filename = .true. - this%obs%inputFilename = obs6_fnames(1) - this%obs%active = .true. - this%inobspkg = GetUnit() - this%obs%inUnitObs = this%inobspkg - call openfile(this%inobspkg, this%iout, this%obs%inputFilename, 'OBS') + this%obs%input_mempath = obs6_mempaths(1) call this%obs%obs_df(this%iout, this%packName, this%filtyp, this%dis) call this%dfw_df_obs() end if @@ -1262,7 +1256,6 @@ subroutine dfw_da(this) call mem_deallocate(this%lastedge) ! obs package - call mem_deallocate(this%inobspkg) call this%obs%obs_da() deallocate (this%obs) nullify (this%obs) diff --git a/src/Model/SurfaceWaterFlow/swf-obs.f90 b/src/Model/SurfaceWaterFlow/swf-obs.f90 index 9432f4fcbdd..985d5567ab1 100644 --- a/src/Model/SurfaceWaterFlow/swf-obs.f90 +++ b/src/Model/SurfaceWaterFlow/swf-obs.f90 @@ -35,16 +35,16 @@ module SwfObsModule !! !! Create observation object, allocate pointers, initialize values !< - subroutine swf_obs_cr(obs, inobs) + subroutine swf_obs_cr(obs, input_mempath, inobs) ! -- dummy type(SwfObsType), pointer, intent(out) :: obs + character(len=*), intent(in) :: input_mempath integer(I4B), pointer, intent(in) :: inobs ! allocate (obs) call obs%allocate_scalars() - obs%active = .false. - obs%inputFilename = '' - obs%inUnitObs => inobs + obs%inUnitObs = inobs + obs%input_mempath = input_mempath end subroutine swf_obs_cr !> @brief Allocate and read diff --git a/src/Model/SurfaceWaterFlow/swf.f90 b/src/Model/SurfaceWaterFlow/swf.f90 index 68d85939e02..49d70003d78 100644 --- a/src/Model/SurfaceWaterFlow/swf.f90 +++ b/src/Model/SurfaceWaterFlow/swf.f90 @@ -1033,6 +1033,7 @@ subroutine create_packages(this) character(len=LENMEMPATH) :: mempathic = '' character(len=LENMEMPATH) :: mempathdfw = '' character(len=LENMEMPATH) :: mempathcxs = '' + character(len=LENMEMPATH) :: mempathobs = '' character(len=LENMEMPATH) :: mempathoc = '' character(len=LENMEMPATH) :: mempathsto = '' @@ -1081,7 +1082,8 @@ subroutine create_packages(this) this%inoc = 1 mempathoc = mempath case ('OBS6') - this%inobs = inunit + this%inobs = 1 + mempathobs = mempath case ('CHD6', 'FLW6', 'CDB6', 'ZDG6', 'PCP6', 'EVP6') call expandarray(bndpkgs) bndpkgs(size(bndpkgs)) = n @@ -1106,7 +1108,7 @@ subroutine create_packages(this) this%cxs) end if call oc_cr(this%oc, this%name, mempathoc, this%inoc, this%iout) - call swf_obs_cr(this%obs, this%inobs) + call swf_obs_cr(this%obs, mempathobs, this%inobs) ! Check to make sure that required ftype's have been specified call this%ftype_check(indis) diff --git a/src/Model/TransportModel/tsp-obs.f90 b/src/Model/TransportModel/tsp-obs.f90 index 7d37f86ced4..a592d8ebfcf 100644 --- a/src/Model/TransportModel/tsp-obs.f90 +++ b/src/Model/TransportModel/tsp-obs.f90 @@ -40,17 +40,17 @@ module TspObsModule !! - allocates pointers !! - initializes values !< - subroutine tsp_obs_cr(obs, inobs, dvt) + subroutine tsp_obs_cr(obs, input_mempath, inobs, dvt) ! -- dummy type(TspObsType), pointer, intent(out) :: obs + character(len=*), intent(in) :: input_mempath integer(I4B), pointer, intent(in) :: inobs character(len=LENVARNAME), intent(in) :: dvt !< "concentration" or "temperature" ! allocate (obs) call obs%allocate_scalars() - obs%active = .false. - obs%inputFilename = '' - obs%inUnitObs => inobs + obs%inUnitObs = inobs + obs%input_mempath = input_mempath obs%depvartype = dvt end subroutine tsp_obs_cr diff --git a/src/Model/TransportModel/tsp.f90 b/src/Model/TransportModel/tsp.f90 index b39563c1daa..cfb88efd4e3 100644 --- a/src/Model/TransportModel/tsp.f90 +++ b/src/Model/TransportModel/tsp.f90 @@ -701,6 +701,7 @@ subroutine create_tsp_packages(this, indis) character(len=LENMEMPATH) :: mempathadv = '' character(len=LENMEMPATH) :: mempathfmi = '' character(len=LENMEMPATH) :: mempathic = '' + character(len=LENMEMPATH) :: mempathobs = '' character(len=LENMEMPATH) :: mempathoc = '' character(len=LENMEMPATH) :: mempathssm = '' ! @@ -753,8 +754,10 @@ subroutine create_tsp_packages(this, indis) this%inoc = 1 mempathoc = mempath case ('OBS6') - this%inobs = inunit + this%inobs = 1 + mempathobs = mempath case default + ! no-op end select end do ! @@ -770,7 +773,7 @@ subroutine create_tsp_packages(this, indis) call mvt_cr(this%mvt, this%name, this%inmvt, this%iout, this%fmi, & this%eqnsclfac, this%depvartype) call oc_cr(this%oc, this%name, mempathoc, this%inoc, this%iout) - call tsp_obs_cr(this%obs, this%inobs, this%depvartype) + call tsp_obs_cr(this%obs, mempathobs, this%inobs, this%depvartype) end subroutine create_tsp_packages !> @brief return 1 if option to normalize the x and rhs has been specified. diff --git a/src/Utilities/Export/NCModel.f90 b/src/Utilities/Export/NCModel.f90 old mode 100644 new mode 100755 index ca4c7247a84..38136f6eea6 --- a/src/Utilities/Export/NCModel.f90 +++ b/src/Utilities/Export/NCModel.f90 @@ -277,6 +277,7 @@ subroutine export_init(this, modelname, modeltype, modelfname, nc_fname, & use MemoryHelperModule, only: create_mem_path use MemoryManagerExtModule, only: mem_set_value use InputOutputModule, only: lowcase + use SourceCommonModule, only: filein_fname use UtlNcfInputModule, only: UtlNcfParamFoundType class(NCModelExportType), intent(inout) :: this character(len=*), intent(in) :: modelname @@ -288,7 +289,6 @@ subroutine export_init(this, modelname, modeltype, modelfname, nc_fname, & integer(I4B), intent(in) :: iout character(len=LENMEMPATH) :: model_mempath type(UtlNcfParamFoundType) :: ncf_found - logical(LGP) :: found_mempath ! allocate allocate (this%deflate) @@ -348,10 +348,8 @@ subroutine export_init(this, modelname, modeltype, modelfname, nc_fname, & call mem_setptr(this%x, 'X', model_mempath) ! set ncf_mempath if provided - call mem_set_value(this%ncf_mempath, 'NCF6_MEMPATH', this%dis_mempath, & - found_mempath) - - if (found_mempath) then + if (filein_fname(this%ncf_mempath, 'NCF6_MEMPATH', this%dis_mempath, & + modelfname)) then call mem_set_value(this%wkt, 'WKT', this%ncf_mempath, & ncf_found%wkt) call mem_set_value(this%deflate, 'DEFLATE', this%ncf_mempath, & diff --git a/src/Utilities/Idm/DefinitionSelect.f90 b/src/Utilities/Idm/DefinitionSelect.f90 index da05af43b31..480723579ad 100644 --- a/src/Utilities/Idm/DefinitionSelect.f90 +++ b/src/Utilities/Idm/DefinitionSelect.f90 @@ -87,6 +87,8 @@ function get_param_definition_type(input_definition_types, & component_type, subcomponent_type, & blockname, tagname, filename) & result(idt) + use ConstantsModule, only: LINELENGTH + use SourceCommonModule, only: idm_utl_type type(InputParamDefinitionType), dimension(:), intent(in), target :: & input_definition_types character(len=*), intent(in) :: component_type !< component type, such as GWF or GWT @@ -96,12 +98,19 @@ function get_param_definition_type(input_definition_types, & character(len=*), intent(in) :: filename !< input filename type(InputParamDefinitionType), pointer :: idt !< corresponding InputParameterDefinitionType for this tag type(InputParamDefinitionType), pointer :: tmp_ptr + character(len=LINELENGTH) :: component integer(I4B) :: i + if (idm_utl_type(component_type, subcomponent_type)) then + component = 'UTL' + else + component = component_type + end if + nullify (idt) do i = 1, size(input_definition_types) tmp_ptr => input_definition_types(i) - if (tmp_ptr%component_type == component_type .and. & + if (tmp_ptr%component_type == component .and. & tmp_ptr%subcomponent_type == subcomponent_type .and. & tmp_ptr%blockname == blockname .and. & tmp_ptr%tagname == tagname) then @@ -124,6 +133,8 @@ end function get_param_definition_type !< function get_aggregate_definition_type(input_definition_types, component_type, & subcomponent_type, blockname) result(idt) + use ConstantsModule, only: LINELENGTH + use SourceCommonModule, only: idm_utl_type type(InputParamDefinitionType), dimension(:), intent(in), target :: & input_definition_types character(len=*), intent(in) :: component_type !< component type, such as GWF or GWT @@ -131,12 +142,19 @@ function get_aggregate_definition_type(input_definition_types, component_type, & character(len=*), intent(in) :: blockname !< name of the block type(InputParamDefinitionType), pointer :: idt !< corresponding InputParameterDefinitionType for this block type(InputParamDefinitionType), pointer :: tmp_ptr + character(len=LINELENGTH) :: component integer(I4B) :: i + if (idm_utl_type(component_type, subcomponent_type)) then + component = 'UTL' + else + component = component_type + end if + nullify (idt) do i = 1, size(input_definition_types) tmp_ptr => input_definition_types(i) - if (tmp_ptr%component_type == component_type .and. & + if (tmp_ptr%component_type == component .and. & tmp_ptr%subcomponent_type == subcomponent_type .and. & tmp_ptr%blockname == blockname) then idt => input_definition_types(i) diff --git a/src/Utilities/Idm/IdmLoad.f90 b/src/Utilities/Idm/IdmLoad.f90 index fb1f89ddee6..9c541192e02 100644 --- a/src/Utilities/Idm/IdmLoad.f90 +++ b/src/Utilities/Idm/IdmLoad.f90 @@ -7,11 +7,15 @@ module IdmLoadModule use KindModule, only: DP, I4B, LGP - use SimVariablesModule, only: errmsg + use SimVariablesModule, only: errmsg, simfile, idm_context use ConstantsModule, only: LINELENGTH, LENMEMPATH, LENMODELNAME, & - LENEXCHANGENAME, LENCOMPONENTNAME + LENVARNAME, LENEXCHANGENAME, LENCOMPONENTNAME use SimModule, only: store_error, count_errors, store_error_filename + use MemoryManagerModule, only: mem_setptr, mem_allocate, mem_reallocate, & + mem_deallocate, get_isize + use MemoryHelperModule, only: create_mem_path, split_mem_path use ListModule, only: ListType + use CharacterStringModule, only: CharacterStringType use InputLoadTypeModule, only: StaticPkgLoadBaseType, & DynamicPkgLoadBaseType, & ModelDynamicPkgsType, & @@ -71,11 +75,7 @@ end subroutine idm_ad !> @brief idm deallocate routine !< subroutine idm_da(iout) - use SimVariablesModule, only: idm_context - use MemoryManagerModule, only: mem_setptr - use MemoryHelperModule, only: create_mem_path, split_mem_path use MemoryManagerExtModule, only: memorystore_remove - use CharacterStringModule, only: CharacterStringType integer(I4B), intent(in) :: iout type(CharacterStringType), dimension(:), contiguous, & pointer :: mempaths @@ -104,6 +104,96 @@ subroutine idm_da(iout) call memorystore_remove(component='SIM', context=idm_context) end subroutine idm_da + function subpkg_load(component_type, subcomponent_type, modelname, & + pkgname, pkgtype, filename, modelfname, & + nc_vars, iout) result(mempath) + use BlockParserModule, only: BlockParserType + use InputOutputModule, only: openfile, getunit + use NCFileVarsModule, only: NCFileVarsType + use InputLoadTypeModule, only: SubPackageListType + use SourceCommonModule, only: idm_utl_type, idm_subcomponent_type + character(len=*), intent(in) :: component_type + character(len=*), intent(in) :: subcomponent_type + character(len=*), intent(in) :: pkgname + character(len=*), intent(in) :: pkgtype + character(len=*), intent(in) :: filename + character(len=*), intent(in) :: modelname + character(len=*), intent(in) :: modelfname + type(NCFileVarsType), pointer, intent(in) :: nc_vars + integer(I4B), intent(in) :: iout + type(BlockParserType) :: parser + type(SubPackageListType) :: subpkg_list + character(len=LENMEMPATH) :: mempath + character(len=LENCOMPONENTNAME) :: ctype, sctype + character(len=LINELENGTH) :: subpkg_fname + character(len=LINELENGTH) :: kw, kw2, iotag + integer(I4B) :: n, ierr, inunit + logical(LGP) :: isfound, endOfBlock + + ! initialize + mempath = '' + + inunit = getunit() + call openfile(inunit, 0, trim(adjustl(filename)), pkgtype, & + 'FORMATTED', 'SEQUENTIAL', 'OLD') + call parser%Initialize(inunit, 0) + + ! get options block + call parser%GetBlock('OPTIONS', isfound, ierr, & + supportOpenClose=.true., blockRequired=.false.) + + ! create subpackage list + call subpkg_list%create(component_type, modelname) + + ! parse options block if detected + do + if (.not. isfound) exit + + ! initialize per tag + ctype = '' + sctype = '' + iotag = '' + subpkg_fname = '' + + ! process line + call parser%GetNextLine(endOfBlock) + + ! exit if none + if (endOfBlock) exit + + ! try reading first 2 line tags + call parser%GetStringCaps(kw) + call parser%GetStringCaps(kw2) + + if (kw2 == 'FILEIN') then + if (idm_utl_type(component_type, kw)) then + iotag = kw + ctype = 'UTL' + sctype = idm_subcomponent_type(component_type, kw) + call parser%GetString(subpkg_fname, .false.) + call subpkg_list%add(iotag, ctype, sctype, subpkg_fname) + end if + end if + end do + + if (mempath == '') mempath = create_mem_path(modelname, pkgname, idm_context) + call subpkg_list%set_names(subcomponent_type, pkgname, mempath, modelfname) + + ! load idm integrated subpackages + do n = 1, subpkg_list%pnum + ! load subpackage + call input_load(subpkg_list%component_types(n), & + subpkg_list%subcomponent_types(n), & + modelname, & + subpkg_list%subcomponent_names(n), & + subpkg_list%pkgtypes(n), & + subpkg_list%filenames(n), & + modelfname, nc_vars, iout) + end do + + call parser%clear() + end function subpkg_load + !> @brief load an integrated model package from supported source !< recursive subroutine input_load(component_type, subcomponent_type, modelname, & @@ -154,7 +244,7 @@ recursive subroutine input_load(component_type, subcomponent_type, modelname, & call input_load(static_loader%subpkg_list%component_types(n), & static_loader%subpkg_list%subcomponent_types(n), & static_loader%mf6_input%component_name, & - static_loader%subpkg_list%subcomponent_types(n), & + static_loader%subpkg_list%subcomponent_names(n), & static_loader%subpkg_list%pkgtypes(n), & static_loader%subpkg_list%filenames(n), & modelfname, nc_vars, iout) @@ -172,9 +262,11 @@ subroutine load_model_pkgs(model_pkg_inputs, iout) use NCFileVarsModule, only: NCFileVarsType use SourceLoadModule, only: open_source_file, netcdf_context use IdmDfnSelectorModule, only: idm_integrated + use SourceCommonModule, only: idm_utl_type type(ModelPackageInputsType), intent(inout) :: model_pkg_inputs integer(i4B), intent(in) :: iout type(NCFileVarsType), pointer :: nc_vars + character(len=LENMEMPATH) :: mempath integer(I4B) :: itype, ipkg nc_vars => netcdf_context(model_pkg_inputs%modeltype, & @@ -188,7 +280,7 @@ subroutine load_model_pkgs(model_pkg_inputs, iout) if (idm_integrated(model_pkg_inputs%component_type, & model_pkg_inputs%pkglist(itype)%subcomponent_type)) & then - ! only load if model pkg can read from input context + ! load package to memory call input_load(model_pkg_inputs%component_type, & model_pkg_inputs%pkglist(itype)%subcomponent_type, & model_pkg_inputs%modelname, & @@ -197,6 +289,20 @@ subroutine load_model_pkgs(model_pkg_inputs, iout) model_pkg_inputs%pkglist(itype)%filenames(ipkg), & model_pkg_inputs%modelfname, nc_vars, iout) else + ! load supported subpackages + mempath = & + subpkg_load(model_pkg_inputs%component_type, & + model_pkg_inputs%pkglist(itype)%subcomponent_type, & + model_pkg_inputs%modelname, & + model_pkg_inputs%pkglist(itype)%pkgnames(ipkg), & + model_pkg_inputs%pkglist(itype)%pkgtype, & + model_pkg_inputs%pkglist(itype)%filenames(ipkg), & + model_pkg_inputs%modelfname, nc_vars, iout) + + if (mempath /= '') then + model_pkg_inputs%pkglist(itype)%mempaths(ipkg) = mempath + end if + ! open input file for package parser model_pkg_inputs%pkglist(itype)%inunits(ipkg) = & open_source_file(model_pkg_inputs%pkglist(itype)%pkgtype, & @@ -215,11 +321,7 @@ end subroutine load_model_pkgs !> @brief load model namfiles and model package files !< subroutine load_models(iout) - use MemoryHelperModule, only: create_mem_path - use MemoryManagerModule, only: mem_setptr - use CharacterStringModule, only: CharacterStringType use DistributedSimModule, only: DistributedSimType, get_dsim - use SimVariablesModule, only: idm_context, simfile use ModelPackageInputsModule, only: ModelPackageInputsType use SourceCommonModule, only: idm_component_type, inlen_check use SourceLoadModule, only: load_modelnam @@ -282,14 +384,9 @@ end subroutine load_models !> @brief load exchange files !< subroutine load_exchanges(iout) - use MemoryHelperModule, only: create_mem_path - use MemoryManagerModule, only: mem_setptr, mem_allocate, & - mem_deallocate, get_isize - use CharacterStringModule, only: CharacterStringType - use SimVariablesModule, only: idm_context, simfile use DistributedSimModule, only: DistributedSimType, get_dsim use SourceCommonModule, only: idm_subcomponent_type, ifind_charstr, & - inlen_check + inlen_check, idm_utl_type use SourceLoadModule, only: create_input_loader, remote_model_ndim integer(I4B), intent(in) :: iout type(DistributedSimType), pointer :: ds @@ -317,7 +414,7 @@ subroutine load_exchanges(iout) character(len=LENCOMPONENTNAME) :: sc_type, sc_name, mtype class(StaticPkgLoadBaseType), pointer :: static_loader class(DynamicPkgLoadBaseType), pointer :: dynamic_loader - integer(I4B) :: n, m1_idx, m2_idx, irem, isize + integer(I4B) :: n, m, m1_idx, m2_idx, irem, isize ! get model mask ds => get_dsim() @@ -398,7 +495,7 @@ subroutine load_exchanges(iout) write (sc_name, '(a,i0)') trim(sc_type)//'_', n ! create and set exchange mempath - mempath = create_mem_path('EXG', sc_name, idm_context) + mempath = create_mem_path(sc_name, 'EXG', idm_context) emempaths(n) = mempath ! allocate and set exgid @@ -406,11 +503,29 @@ subroutine load_exchanges(iout) exgid = n ! create exchange loader - static_loader => create_input_loader('EXG', sc_type, 'EXG', sc_name, & + static_loader => create_input_loader('EXG', sc_type, sc_name, 'EXG', & exgtype, 'SIM', efname, simfile) ! load static input dynamic_loader => static_loader%load(iout) + ! create subpackage list + call static_loader%create_subpkg_list() + + ! load idm integrated subpackages + do m = 1, static_loader%subpkg_list%pnum + ! + static_loader => & + create_input_loader(static_loader%subpkg_list%component_types(m), & + static_loader%subpkg_list%subcomponent_types(m), & + static_loader%mf6_input%component_name, & + static_loader%subpkg_list%subcomponent_names(m), & + static_loader%subpkg_list%pkgtypes(m), & + 'EXCHANGE', & + static_loader%subpkg_list%filenames(m), & + efname) + dynamic_loader => static_loader%load(iout) + end do + if (associated(dynamic_loader)) then errmsg = 'IDM unimplemented. Dynamic Exchanges not supported.' call store_error(errmsg) @@ -516,9 +631,6 @@ end subroutine dynamic_da !> @brief return sim input context PRINT_INPUT value !< function input_param_log() result(paramlog) - use MemoryHelperModule, only: create_mem_path - use MemoryManagerModule, only: mem_setptr - use SimVariablesModule, only: idm_context character(len=LENMEMPATH) :: simnam_mempath integer(I4B) :: paramlog integer(I4B), pointer :: p @@ -531,10 +643,6 @@ end function input_param_log !> @brief load simulation summary info to input context !< subroutine simnam_load_dim() - use MemoryHelperModule, only: create_mem_path - use MemoryManagerModule, only: mem_allocate, mem_setptr - use SimVariablesModule, only: idm_context - use CharacterStringModule, only: CharacterStringType character(len=LENMEMPATH) :: sim_mempath, simnam_mempath type(CharacterStringType), dimension(:), contiguous, & pointer :: mtypes !< model types @@ -602,7 +710,6 @@ end subroutine allocate_simnam_int subroutine allocate_simnam_param(input_mempath, idt) use SimVariablesModule, only: simfile use MemoryManagerModule, only: mem_allocate - use CharacterStringModule, only: CharacterStringType use DefinitionSelectModule, only: idt_datatype character(len=LENMEMPATH), intent(in) :: input_mempath type(InputParamDefinitionType), pointer, intent(in) :: idt @@ -645,8 +752,6 @@ end subroutine allocate_simnam_param subroutine simnam_allocate() use MemoryHelperModule, only: create_mem_path use MemoryManagerModule, only: get_isize, mem_allocate - use SimVariablesModule, only: idm_context - use CharacterStringModule, only: CharacterStringType character(len=LENMEMPATH) :: input_mempath type(ModflowInputType) :: mf6_input type(InputParamDefinitionType), pointer :: idt diff --git a/src/Utilities/Idm/InputLoadType.f90 b/src/Utilities/Idm/InputLoadType.f90 index 9a7b3c0a2ef..8a3c5293e31 100644 --- a/src/Utilities/Idm/InputLoadType.f90 +++ b/src/Utilities/Idm/InputLoadType.f90 @@ -23,6 +23,7 @@ module InputLoadTypeModule public :: ModelDynamicPkgsType public :: AddDynamicModelToList, GetDynamicModelFromList public :: StaticPkgLoadType, DynamicPkgLoadType + public :: SubPackageListType public :: model_inputs !> @brief type representing package subpackage list @@ -31,13 +32,16 @@ module InputLoadTypeModule character(len=LENCOMPONENTNAME), dimension(:), allocatable :: component_types character(len=LENCOMPONENTNAME), dimension(:), & allocatable :: subcomponent_types + character(len=LENCOMPONENTNAME), dimension(:), & + allocatable :: subcomponent_names character(len=LINELENGTH), dimension(:), allocatable :: filenames - character(len=LENMEMPATH) :: mempath + character(len=LENCOMPONENTNAME) :: component_type character(len=LENCOMPONENTNAME) :: component_name integer(I4B) :: pnum contains procedure :: create => subpkg_create procedure :: add => subpkg_add + procedure :: set_names => subpkg_names procedure :: destroy => subpkg_destroy end type SubPackageListType @@ -151,46 +155,40 @@ subroutine period_load_if(this) !> @brief create a new package type !< - subroutine subpkg_create(this, mempath, component_name) + subroutine subpkg_create(this, component_type, component_name) class(SubPackageListType) :: this - character(len=*), intent(in) :: mempath + character(len=*), intent(in) :: component_type character(len=*), intent(in) :: component_name ! initialize this%pnum = 0 - this%mempath = mempath + this%component_type = component_type this%component_name = component_name ! allocate arrays allocate (this%pkgtypes(0)) allocate (this%component_types(0)) allocate (this%subcomponent_types(0)) + allocate (this%subcomponent_names(0)) allocate (this%filenames(0)) end subroutine subpkg_create !> @brief create a new package type !< subroutine subpkg_add(this, pkgtype, component_type, subcomponent_type, & - tagname, filename) + filename) use ArrayHandlersModule, only: expandarray - use MemoryHelperModule, only: create_mem_path - use MemoryManagerModule, only: mem_allocate - use SimVariablesModule, only: idm_context class(SubPackageListType) :: this character(len=*), intent(in) :: pkgtype character(len=*), intent(in) :: component_type character(len=*), intent(in) :: subcomponent_type - character(len=*), intent(in) :: tagname character(len=*), intent(in) :: filename - character(len=LENVARNAME) :: mempath_tag - character(len=LENMEMPATH), pointer :: subpkg_mempath - character(len=LINELENGTH), pointer :: input_fname - integer(I4B) :: idx, trimlen ! reallocate call expandarray(this%pkgtypes) call expandarray(this%component_types) call expandarray(this%subcomponent_types) + call expandarray(this%subcomponent_names) call expandarray(this%filenames) ! add new package instance @@ -198,34 +196,153 @@ subroutine subpkg_add(this, pkgtype, component_type, subcomponent_type, & this%pkgtypes(this%pnum) = pkgtype this%component_types(this%pnum) = component_type this%subcomponent_types(this%pnum) = subcomponent_type + this%subcomponent_names(this%pnum) = '' this%filenames(this%pnum) = filename + end subroutine subpkg_add + + !> @brief set subpackage mempaths + !< + subroutine subpkg_names(this, sc_type, sc_name, sc_mempath, modelfname) + use MemoryHelperModule, only: create_mem_path + use MemoryManagerModule, only: mem_allocate, mem_setptr + use ArrayHandlersModule, only: expandarray + use SimVariablesModule, only: idm_context + use CharacterStringModule, only: CharacterStringType + use ModelPackageInputModule, only: multi_package_type + use IdmDfnSelectorModule, only: idm_multi_package, idm_integrated + use SourceCommonModule, only: idm_utl_type, idm_component_type + class(SubPackageListType) :: this + character(len=*), intent(in) :: sc_type !< parent subcomponent type + character(len=*), intent(in) :: sc_name !< parent subcomponent name + character(len=*), intent(in) :: sc_mempath !< parent mempath + character(len=*), intent(in) :: modelfname !< model name file + character(len=LINELENGTH), dimension(:), allocatable :: ptypes + integer(I4B), dimension(:), allocatable :: nptypes + type(CharacterStringType), dimension(:), & + pointer, contiguous :: mempaths + type(CharacterStringType), dimension(:), contiguous, & + pointer :: pnames, ftypes + character(len=LINELENGTH), pointer :: input_fname + character(len=LENVARNAME) :: mempath_tag + character(len=LENVARNAME) :: pname_prefix, pname, ptype, sctype + character(len=LENMEMPATH) :: mempath, model_mempath + integer(I4B) :: n, m, idx + logical(LGP) :: multi + + ! no subpackages to load + if (size(this%pkgtypes) == 0) return - ! initialize mempath tag - mempath_tag = tagname - trimlen = len_trim(tagname) - idx = 0 + ! assume utility types do not support subpackages + if (idm_utl_type(this%component_type, sc_type)) return - ! create mempath tagname - idx = index(tagname, '_') - if (idx > 0) then - if (tagname(idx + 1:trimlen) == 'FILENAME') then - write (mempath_tag, '(a)') tagname(1:idx)//'MEMPATH' + ! initialize + pname_prefix = '' + allocate (ptypes(0)) + allocate (nptypes(0)) + + ! reset updated readasarrays, readarraygrid types + select case (sc_type) + case ('EVTA', 'RCHA', & + 'RIVG', 'CHDG', & + 'WELG', 'DRNG', & + 'GHBG') + sctype = sc_type(1:3) + case default + sctype = sc_type + end select + + ! set package type + ptype = trim(sctype)//'6' + + ! determine if multi instance package + if (idm_integrated(this%component_type, sctype)) then + multi = idm_multi_package(this%component_type, sctype) + else + multi = multi_package_type(this%component_type, sctype, ptype) + end if + + ! set package name prefix based on parent package + if (this%component_type == 'EXG') then + ! no-op + else + if (multi) then + idx = 0 + model_mempath = create_mem_path(this%component_name, 'NAM', idm_context) + call mem_setptr(pnames, 'PNAME', model_mempath) + call mem_setptr(ftypes, 'FTYPE', model_mempath) + + ! identify instance number of the package type to distinguish in name + do n = 1, size(pnames) + if (ftypes(n) == ptype) then + idx = idx + 1 + ! multi packages must match on type and name + pname = pnames(n) + if (pname == '') then + write (pname, '(a,i0)') trim(sctype)//'-', idx + end if + if (pname == sc_name) then + write (pname_prefix, '(a,i0,a)') trim(sctype), idx, '-' + exit + end if + end if + end do + + if (pname_prefix == '') then + errmsg = & + 'Internal IDM error: subpackage load cannot identify & + &package "'//trim(sc_name)//'" in model name file & + &packages block.' + call store_error(errmsg) + call store_error_filename(modelfname) + end if + + else + write (pname_prefix, '(2a)') trim(sctype), '-' end if end if - ! allocate mempath variable for subpackage - call mem_allocate(subpkg_mempath, LENMEMPATH, mempath_tag, & - this%mempath) + ! count number of each package type + do n = 1, size(this%pkgtypes) + idx = 0 + do m = 1, size(ptypes) + if (ptypes(m) == this%pkgtypes(n)) then + nptypes(m) = nptypes(m) + 1 + idx = m + end if + end do + if (idx == 0) then + call expandarray(ptypes) + call expandarray(nptypes) + ptypes(size(ptypes)) = this%pkgtypes(n) + nptypes(size(ptypes)) = 1 + end if + end do - ! create and set the mempath - subpkg_mempath = & - create_mem_path(this%component_name, & - subcomponent_type, idm_context) + ! set subpackage names and mempaths + do n = 1, size(ptypes) + idx = 0 + mempath_tag = trim(ptypes(n))//'_MEMPATH' + call mem_allocate(mempaths, LENMEMPATH, nptypes(n), & + mempath_tag, sc_mempath) + do m = 1, size(this%pkgtypes) + if (this%pkgtypes(m) == ptypes(n)) then + idx = idx + 1 + write (this%subcomponent_names(m), '(a,i0)') & + trim(pname_prefix)//trim(this%subcomponent_types(m)), idx + mempath = create_mem_path(this%component_name, & + this%subcomponent_names(m), & + idm_context) + mempaths(idx) = mempath + call mem_allocate(input_fname, LINELENGTH, 'INPUT_FNAME', mempath) + input_fname = trim(this%filenames(m)) + end if + end do + end do - ! allocate and initialize filename for subpackage - call mem_allocate(input_fname, LINELENGTH, 'INPUT_FNAME', subpkg_mempath) - input_fname = filename - end subroutine subpkg_add + ! cleanup + deallocate (ptypes) + deallocate (nptypes) + end subroutine subpkg_names !> @brief create a new package type !< @@ -235,6 +352,7 @@ subroutine subpkg_destroy(this) deallocate (this%pkgtypes) deallocate (this%component_types) deallocate (this%subcomponent_types) + deallocate (this%subcomponent_names) deallocate (this%filenames) end subroutine subpkg_destroy @@ -257,7 +375,7 @@ subroutine static_init(this, mf6_input, component_name, component_input_name, & this%iperblock = 0 ! create subpackage list - call this%subpkg_list%create(this%mf6_input%mempath, & + call this%subpkg_list%create(this%mf6_input%component_type, & this%mf6_input%component_name) ! identify period block definition @@ -276,42 +394,44 @@ subroutine create_subpkg_list(this) use IdmDfnSelectorModule, only: idm_subpackages, idm_integrated, & idm_multi_package use SourceCommonModule, only: filein_fname + use MemoryManagerModule, only: mem_setptr, get_isize + use ArrayHandlersModule, only: expandarray + use CharacterStringModule, only: CharacterStringType class(StaticPkgLoadType), intent(inout) :: this character(len=16), dimension(:), pointer :: subpkgs + type(CharacterStringType), dimension(:), pointer, & + contiguous :: fnames character(len=LINELENGTH) :: tag, fname, pkgtype character(len=LENFTYPE) :: c_type, sc_type character(len=16) :: subpkg - integer(I4B) :: idx, n + integer(I4B) :: idx, n, m, isize ! set pointer to package (idm integrated) subpackage list subpkgs => idm_subpackages(this%mf6_input%component_type, & this%mf6_input%subcomponent_type) - ! check if tag matches subpackage do n = 1, size(subpkgs) + ! check for input matching this supported subpackage subpkg = subpkgs(n) idx = index(subpkg, '-') - ! split sp string into component/subcomponent + if (idx > 0) then ! split string in component/subcomponent types c_type = subpkg(1:idx - 1) sc_type = subpkg(idx + 1:len_trim(subpkg)) + if (idm_integrated(c_type, sc_type)) then - ! set pkgtype and input filename tag + ! construct FILEIN filename tag pkgtype = trim(sc_type)//'6' tag = trim(pkgtype)//'_FILENAME' - ! support single instance of each subpackage - if (idm_multi_package(c_type, sc_type)) then - errmsg = 'Multi-instance subpackages not supported. Remove dfn & - &subpackage tagline for package "'//trim(subpkg)//'".' - call store_error(errmsg) - call store_error_filename(this%input_name) - else - if (filein_fname(fname, tag, this%mf6_input%mempath, & - this%input_name)) then - call this%subpkg_list%add(pkgtype, c_type, sc_type, & - trim(tag), trim(fname)) - end if + call get_isize(tag, this%mf6_input%mempath, isize) + if (isize > 0) then + + call mem_setptr(fnames, tag, this%mf6_input%mempath) + do m = 1, size(fnames) + fname = fnames(m) + call this%subpkg_list%add(pkgtype, c_type, sc_type, fname) + end do end if else errmsg = 'Identified subpackage is not IDM integrated. Remove dfn & @@ -321,6 +441,11 @@ subroutine create_subpkg_list(this) end if end if end do + + call this%subpkg_list%set_names(this%mf6_input%subcomponent_type, & + this%mf6_input%subcomponent_name, & + this%mf6_input%mempath, & + this%component_input_name) end subroutine create_subpkg_list subroutine static_destroy(this) @@ -378,7 +503,7 @@ subroutine dynamic_init(this, mf6_input, component_name, component_input_name, & ! set readasarrays and readarraygrid if (mf6_input%block_dfns(iperblock)%aggregate) then - ! no-op + ! no-op, list based input else do iparam = 1, size(mf6_input%param_dfns) idt => mf6_input%param_dfns(iparam) diff --git a/src/Utilities/Idm/LoadContext.f90 b/src/Utilities/Idm/LoadContext.f90 index 71420c23ec3..491c93a8c63 100644 --- a/src/Utilities/Idm/LoadContext.f90 +++ b/src/Utilities/Idm/LoadContext.f90 @@ -39,6 +39,7 @@ module LoadContextModule enumerator :: MODELPKG = 4 !< model package context type enumerator :: STRESSPKG = 5 !< model stress package context type enumerator :: EXCHANGE = 6 !< exchange context type + enumerator :: UTIL = 7 end enum !> @brief Pointer type for read state variable @@ -99,6 +100,7 @@ module LoadContextModule subroutine init(this, mf6_input, blockname, named_bound) use InputOutputModule, only: upcase use ModelPackageInputsModule, only: supported_model + use SourceCommonModule, only: idm_utl_type class(LoadContextType) :: this type(ModflowInputType), intent(in) :: mf6_input character(len=*), optional, intent(in) :: blockname @@ -134,9 +136,14 @@ subroutine init(this, mf6_input, blockname, named_bound) end select if (this%ctxtype == CONTEXT_UNDEF) then - errmsg = 'LoadContext unidentified context for mempath: '// & - trim(mf6_input%mempath) - call store_error(errmsg, .true.) + if (idm_utl_type(mf6_input%component_type, & + mf6_input%subcomponent_type)) then + this%ctxtype = UTIL + else + errmsg = 'LoadContext unidentified context for mempath: '// & + trim(mf6_input%mempath) + call store_error(errmsg, .true.) + end if end if if (present(blockname)) then @@ -447,6 +454,8 @@ function in_scope(this, mf6_input, blockname, tagname) end if case ('NAM') in_scope = .true. + case ('OBS') + if (tagname == 'ID2') in_scope = .false. case ('SSM') if (tagname == 'MIXED') in_scope = .true. case default diff --git a/src/Utilities/Idm/SourceCommon.f90 b/src/Utilities/Idm/SourceCommon.f90 index f9fdaa756d5..a08d1bdfefb 100644 --- a/src/Utilities/Idm/SourceCommon.f90 +++ b/src/Utilities/Idm/SourceCommon.f90 @@ -16,6 +16,7 @@ module SourceCommonModule private public :: package_source_type public :: idm_component_type, idm_subcomponent_type, idm_subcomponent_name + public :: idm_utl_type public :: set_model_shape public :: get_shape_from_string public :: get_layered_shape @@ -126,13 +127,42 @@ function idm_subcomponent_name(component_type, subcomponent_type, sc_name) & character(len=*), intent(in) :: sc_name character(len=LENPACKAGENAME) :: subcomponent_name subcomponent_name = '' - if (idm_multi_package(component_type, subcomponent_type)) then + if (idm_utl_type(component_type, subcomponent_type) .or. & + idm_multi_package(component_type, subcomponent_type)) then subcomponent_name = sc_name else subcomponent_name = subcomponent_type end if end function idm_subcomponent_name + !> @brief is utility type + !! + !! Is this subcompentent type an idm integrated utility + !! type. + !! + !< + function idm_utl_type(component, subcomponent) & + result(utl_type) + use IdmDfnSelectorModule, only: idm_integrated + character(len=*), intent(in) :: component + character(len=*), intent(in) :: subcomponent !< subcomponent, e.g. CHD6 + character(len=LENCOMPONENTNAME) :: subcomponent_type + logical(LGP) :: utl_type + integer(I4B) :: i, ilen, idx + idx = 0 + ilen = len_trim(subcomponent) + subcomponent_type = '' + do i = 1, ilen + if (subcomponent(i:i) == '6' .or. subcomponent(i:i) == '-') then + exit + else + idx = idx + 1 + subcomponent_type(idx:idx) = subcomponent(i:i) + end if + end do + utl_type = idm_integrated('UTL', subcomponent_type) + end function idm_utl_type + !> @brief input file extension !! !! Return a file extension, or an empty string if diff --git a/src/Utilities/Idm/mf6blockfile/LoadMf6File.f90 b/src/Utilities/Idm/mf6blockfile/LoadMf6File.f90 index c775e3ce06c..ed5f197c2f4 100644 --- a/src/Utilities/Idm/mf6blockfile/LoadMf6File.f90 +++ b/src/Utilities/Idm/mf6blockfile/LoadMf6File.f90 @@ -70,6 +70,7 @@ module LoadMf6FileModule procedure :: parse_record_tag procedure :: load_tag procedure :: block_index_dfn + procedure :: add_obs_block_memrec procedure :: parse_structarray_block end type LoadMf6FileType @@ -165,7 +166,7 @@ subroutine load_block(this, iblk) allocate (this%block_tags(0)) ! load the block - call this%parse_block(iblk, .false.) + call this%parse_block(iblk, 0) ! post process block call this%block_post_process(iblk) ! cleanup @@ -253,12 +254,12 @@ end subroutine block_post_process !> @brief parse block !! !< - recursive subroutine parse_block(this, iblk, recursive_call) + recursive subroutine parse_block(this, iblk, irecurse) use MemoryTypeModule, only: MemoryType use MemoryManagerModule, only: get_from_memorystore class(LoadMf6FileType) :: this integer(I4B), intent(in) :: iblk - logical(LGP), intent(in) :: recursive_call !< true if recursive call + integer(I4B), intent(in) :: irecurse !< recurse count logical(LGP) :: isblockfound logical(LGP) :: endOfBlock logical(LGP) :: supportOpenClose @@ -285,7 +286,7 @@ recursive subroutine parse_block(this, iblk, recursive_call) supportOpenClose = (this%mf6_input%block_dfns(iblk)%blockname /= 'GRIDDATA') ! parser search for block - required = this%mf6_input%block_dfns(iblk)%required .and. .not. recursive_call + required = this%mf6_input%block_dfns(iblk)%required .and. (irecurse == 0) call this%parser%GetBlock(this%mf6_input%block_dfns(iblk)%blockname, & isblockfound, ierr, & supportOpenClose=supportOpenClose, & @@ -294,7 +295,7 @@ recursive subroutine parse_block(this, iblk, recursive_call) if (isblockfound) then if (this%mf6_input%block_dfns(iblk)%aggregate) then ! process block recarray type, set of variable 1d/2d types - call this%parse_structarray_block(iblk) + call this%parse_structarray_block(iblk, irecurse) else do ! process each line in block @@ -320,7 +321,7 @@ recursive subroutine parse_block(this, iblk, recursive_call) ! recurse if block is reloadable and was just read if (this%mf6_input%block_dfns(iblk)%block_variable) then if (isblockfound) then - call this%parse_block(iblk, .true.) + call this%parse_block(iblk, irecurse + 1) end if end if end subroutine parse_block @@ -539,6 +540,35 @@ function block_index_dfn(this, iblk) result(idt) idt%datatype = 'INTEGER' end function block_index_dfn + subroutine add_obs_block_memrec(this, irecurse, obs_fname, obs_fmt) + use MemoryManagerModule, only: mem_allocate, mem_reallocate, & + mem_setptr, get_isize + use CharacterStringModule, only: CharacterStringType + class(LoadMf6FileType) :: this + integer(I4B), intent(in) :: irecurse + character(len=*), intent(in) :: obs_fname + character(len=*), intent(in) :: obs_fmt + type(CharacterStringType), dimension(:), pointer, contiguous :: fnames, fmts + integer(I4B) :: ilen, isize, idx + ilen = LINELENGTH + call get_isize('OBSFNAMES', this%mf6_input%mempath, isize) + if (isize < 0) then + call mem_allocate(fnames, ilen, 1, 'OBSFNAMES', this%mf6_input%mempath) + call mem_allocate(fmts, ilen, 1, 'OBSFMTS', this%mf6_input%mempath) + idx = 1 + else + call mem_setptr(fnames, 'OBSFNAMES', this%mf6_input%mempath) + call mem_reallocate(fnames, ilen, isize + 1, 'OBSFNAMES', & + this%mf6_input%mempath) + call mem_setptr(fmts, 'OBSFMTS', this%mf6_input%mempath) + call mem_reallocate(fmts, ilen, isize + 1, 'OBSFMTS', & + this%mf6_input%mempath) + idx = isize + 1 + end if + fnames(idx) = trim(obs_fname) + fmts(idx) = trim(obs_fmt) + end subroutine add_obs_block_memrec + !> @brief parse a structured array record into memory manager !! !! A structarray is similar to a numpy recarray. It it used to @@ -547,13 +577,15 @@ end function block_index_dfn !! vector. !! !< - subroutine parse_structarray_block(this, iblk) + subroutine parse_structarray_block(this, iblk, irecurse) use StructArrayModule, only: StructArrayType, constructStructArray use LoadContextModule, only: LoadContextType class(LoadMf6FileType) :: this integer(I4B), intent(in) :: iblk + integer(I4B), intent(in) :: irecurse type(LoadContextType) :: ctx character(len=LINELENGTH), dimension(:), allocatable :: param_names + character(len=LINELENGTH) :: tag, obs_fname type(InputParamDefinitionType), pointer :: idt !< input data type object describing this record type(InputParamDefinitionType), target :: blockvar_idt integer(I4B) :: blocknum @@ -575,10 +607,20 @@ subroutine parse_structarray_block(this, iblk) this%mf6_input%subcomponent_type, & this%mf6_input%block_dfns(iblk)%blockname) ! if block is reloadable read the block number + blocknum = 0 if (this%mf6_input%block_dfns(iblk)%block_variable) then - blocknum = this%parser%GetInteger() - else - blocknum = 0 + select case (this%mf6_input%block_dfns(iblk)%blockname) + case ('SOLUTIONGROUP') + blocknum = this%parser%GetInteger() + case ('CONTINUOUS') + blocknum = irecurse + 1 + call this%parser%GetStringCaps(tag) + if (tag == 'FILEOUT') then + call this%parser%GetString(obs_fname, .false.) + call this%parser%GetStringCaps(tag) + call this%add_obs_block_memrec(irecurse, obs_fname, tag) + end if + end select end if ! set ncol diff --git a/src/Utilities/Idm/mf6blockfile/StructArray.f90 b/src/Utilities/Idm/mf6blockfile/StructArray.f90 index 2e0e67d9193..df836ea2342 100644 --- a/src/Utilities/Idm/mf6blockfile/StructArray.f90 +++ b/src/Utilities/Idm/mf6blockfile/StructArray.f90 @@ -412,9 +412,14 @@ subroutine load_deferred_vector(this, icol) character(len=LENVARNAME) :: varname logical(LGP) :: overwrite - overwrite = .true. - if (this%struct_vectors(icol)%idt%blockname == 'SOLUTIONGROUP') & + select case (this%struct_vectors(icol)%idt%blockname) + case ('CONTINUOUS') overwrite = .false. + case ('SOLUTIONGROUP') + overwrite = .false. + case default + overwrite = .true. + end select ! set varname varname = this%struct_vectors(icol)%idt%mf6varname diff --git a/src/Utilities/Observation/Obs.f90 b/src/Utilities/Observation/Obs.f90 index 4fe8f8d68a1..842059c2e93 100644 --- a/src/Utilities/Observation/Obs.f90 +++ b/src/Utilities/Observation/Obs.f90 @@ -126,10 +126,9 @@ !< module ObsModule - use KindModule, only: DP, I4B + use KindModule, only: DP, I4B, LGP use ArrayHandlersModule, only: ExpandArray use BaseDisModule, only: DisBaseType - use BlockParserModule, only: BlockParserType use ConstantsModule, only: LENBIGLINE, LENFTYPE, LENOBSNAME, & LENOBSTYPE, LENPACKAGENAME, LENBOUNDNAME, & LINELENGTH, NAMEDBOUNDFLAG, MAXCHARLEN, & @@ -147,7 +146,8 @@ module ObsModule use ObsUtilityModule, only: write_fmtd_obs, write_unfmtd_obs use OpenSpecModule, only: ACCESS, FORM use SimVariablesModule, only: errmsg - use SimModule, only: count_errors, store_error, store_error_unit + use SimModule, only: count_errors, store_error, store_error_unit, & + store_error_filename use TdisModule, only: totim implicit none @@ -159,11 +159,13 @@ module ObsModule ! -- Public members integer(I4B), public :: iout = 0 !< model list file unit integer(I4B), public :: npakobs = 0 !< number of observations - integer(I4B), pointer, public :: inUnitObs => null() !< observation input file unit - character(len=LINELENGTH), pointer, public :: inputFilename => null() !< observation input file name - character(len=2*LENPACKAGENAME + 4), public :: pkgName = '' !< package name + integer(I4B), public :: inUnitObs = 0 !< observation input file unit + character(len=LINELENGTH), pointer, public :: input_mempath => null() !< observation input mempath + character(len=LINELENGTH), pointer, public :: input_fname => null() !< observation input file name + character(len=LENPACKAGENAME), public :: pkgName = '' !< package name character(len=LENFTYPE), public :: filtyp = '' !< package file type - logical, pointer, public :: active => null() !> logical indicating if a observation is active + !logical, pointer, public :: active => null() !> logical indicating if a observation is active + logical, pointer, public :: active type(ObsContainerType), dimension(:), pointer, public :: pakobs => null() !< package observations type(ObsDataType), dimension(:), pointer, public :: obsData => null() !< observation data ! -- Private members @@ -177,7 +179,6 @@ module ObsModule type(ListType), private :: obsList type(ObsOutputListType), pointer, private :: obsOutputList => null() class(DisBaseType), pointer, private :: dis => null() - type(BlockParserType), private :: parser ! ! -- table object type(TableType), pointer :: obstab => null() @@ -199,12 +200,10 @@ module ObsModule procedure, private :: get_obs procedure, private :: get_obs_array procedure, private :: get_obs_datum - procedure, private :: obs_ar1 - procedure, private :: obs_ar2 procedure, private :: set_obs_array - procedure, private :: read_observations - procedure, private :: read_obs_blocks - procedure, private :: read_obs_options + procedure, private :: source_observations + procedure, private :: source_options + procedure, private :: source_continuous procedure, private :: write_obs_simvals end type ObsType @@ -221,14 +220,12 @@ module ObsModule !! - initializes values !! !< - subroutine obs_cr(obs, inobs) + subroutine obs_cr(obs) ! -- dummy type(ObsType), pointer, intent(out) :: obs !< observation ObsType - integer(I4B), pointer, intent(in) :: inobs !< observation input file unit ! allocate (obs) call obs%allocate_scalars() - obs%inUnitObs => inobs end subroutine obs_cr !> @ brief Process IDstring provided for each observation @@ -287,39 +284,46 @@ end subroutine DefaultObsIdProcessor !! !< subroutine obs_df(this, iout, pkgname, filtyp, dis) + ! -- modules + use MemoryManagerExtModule, only: mem_set_value ! -- dummy class(ObsType), intent(inout) :: this integer(I4B), intent(in) :: iout !< model list file unit character(len=*), intent(in) :: pkgname !< package name character(len=*), intent(in) :: filtyp !< package file type class(DisBaseType), pointer :: dis !< discretization object + ! -- local + logical(LGP) :: found + ! -- formats +10 format(/, 'The observation utility is active for "', a, '"') ! this%iout = iout this%pkgName = pkgname this%filtyp = filtyp this%dis => dis ! - ! -- Initialize block parser - call this%parser%Initialize(this%inUnitObs, this%iout) - end subroutine obs_df - - !> @ brief Allocate and read package observations - !! - !! Subroutine to allocate and read observations for a package. Subroutine - !! - !! - reads OPTIONS block of OBS input file - !! - reads CONTINUOUS blocks of OBS input file - !! - !< - subroutine obs_ar(this) - ! -- dummy - class(ObsType) :: this - ! - call this%obs_ar1(this%pkgName) - if (this%active) then - call this%obs_ar2(this%dis) + if (this%input_mempath /= '') then + this%active = .true. + ! + ! -- Indicate that OBS is active + write (this%iout, 10) trim(pkgname) + ! + ! -- Source Options block + call this%source_options() + ! + ! -- define output formats + call this%define_fmts() + ! + ! set input obs file name + call mem_set_value(this%input_fname, 'INPUT_FNAME', & + this%input_mempath, found) + if (found) then + ! reopen input file for error handling + this%inUnitObs = GetUnit() + call openfile(this%inUnitObs, this%iout, this%input_fname, 'OBS') + end if end if - end subroutine obs_ar + end subroutine obs_df !> @ brief Advance package observations !! @@ -389,7 +393,7 @@ subroutine obs_da(this) class(ObserveType), pointer :: obsrv => null() ! deallocate (this%active) - deallocate (this%inputFilename) + deallocate (this%input_mempath) deallocate (this%obsData) ! ! -- observation table object @@ -416,9 +420,6 @@ subroutine obs_da(this) ! ! -- deallocate obslist call this%obslist%Clear() - ! - ! -- nullify - nullify (this%inUnitObs) end subroutine obs_da !> @ brief Save a simulated value @@ -489,7 +490,7 @@ subroutine StoreObsType(this, obsrvType, cumulative, indx) msg = 'Size of obsData array is insufficient; ' & //'need to increase MAXOBSTYPES.' call store_error(msg) - call store_error_unit(this%inUnitObs) + call store_error_filename(this%input_fname) end if ! ! -- Convert character argument to upper case @@ -514,59 +515,39 @@ subroutine allocate_scalars(this) class(ObsType) :: this ! allocate (this%active) - allocate (this%inputFilename) + allocate (this%input_mempath) + allocate (this%input_fname) allocate (this%obsOutputList) allocate (this%obsData(MAXOBSTYPES)) ! ! -- Initialize this%active = .false. - this%inputFilename = '' + this%input_mempath = '' + this%input_fname = '' end subroutine allocate_scalars - !> @ brief Read observation options and output formats + !> @ brief Allocate and read package observations !! - !! Subroutine to read the options block in the observation input file and - !! define output formats. + !! Subroutine to allocate and read observations for a package. !! - !< - subroutine obs_ar1(this, pkgname) - ! -- dummy - class(ObsType), intent(inout) :: this - character(len=*), intent(in) :: pkgname !< package name - ! -- formats -10 format(/, 'The observation utility is active for "', a, '"') - ! - if (this%inUnitObs > 0) then - this%active = .true. - ! - ! -- Indicate that OBS is active - write (this%iout, 10) trim(pkgname) - ! - ! -- Read Options block - call this%read_obs_options() - ! - ! -- define output formats - call this%define_fmts() - end if - end subroutine obs_ar1 - - !> @ brief Call procedure provided by package - !! - !! Subroutine to call procedure provided by package to interpret IDstring - !! and store required data. + !! - reads OPTIONS block of OBS input file + !! - reads CONTINUOUS blocks of OBS input file + !! - call procedure provided by package to interpret IDstring + !! and store required data. !! !< - subroutine obs_ar2(this, dis) + subroutine obs_ar(this) ! -- dummy class(ObsType), intent(inout) :: this - class(DisBaseType) :: dis !< discretization object ! -- local integer(I4B) :: i type(ObsDataType), pointer :: obsDat => null() character(len=LENOBSTYPE) :: obsTypeID class(ObserveType), pointer :: obsrv => null() ! - call this%read_observations() + if (.not. this%active) return + ! + call this%source_observations() ! -- allocate and set observation array call this%get_obs_array(this%npakobs, this%pakobs) ! @@ -576,127 +557,81 @@ subroutine obs_ar2(this, dis) obsTypeID = obsrv%ObsTypeId obsDat => this%get_obs_datum(obsTypeID) if (associated(obsDat%ProcessIdPtr)) then - call obsDat%ProcessIdPtr(obsrv, dis, & + call obsDat%ProcessIdPtr(obsrv, this%dis, & this%inUnitObs, this%iout) else - call DefaultObsIdProcessor(obsrv, dis, & + call DefaultObsIdProcessor(obsrv, this%dis, & this%inUnitObs, this%iout) end if end do ! if (count_errors() > 0) then - call store_error_unit(this%inunitobs) + call store_error_filename(this%input_fname) end if - end subroutine obs_ar2 + end subroutine obs_ar - !> @ brief Read observation options block - !! - !! Subroutine to read the options block in the observation input file. - !! - !< - subroutine read_obs_options(this) + subroutine source_options(this) + ! -- modules + use ConstantsModule, only: MAXCHARLEN, DZERO, MNORMAL + use MemoryManagerExtModule, only: mem_set_value + use UtlObsInputModule, only: UtlObsParamFoundType + use SourceCommonModule, only: filein_fname ! -- dummy class(ObsType) :: this ! -- local - integer(I4B) :: iin - integer(I4B) :: ierr - integer(I4B) :: localprecision - integer(I4B) :: localdigits - character(len=40) :: keyword - character(len=LINELENGTH) :: fname - type(ListType), pointer :: lineList => null() - logical :: continueread, found, endOfBlock + integer(I4B), pointer :: intptr, idigits + type(UtlObsParamFoundType) :: found ! -- formats -10 format('No options block found in OBS input. Defaults will be used.') 40 format('Text output number of digits of precision set to: ', i2) 50 format('Text output number of digits set to internal representation (G0).') 60 format(/, 'Processing observation options:',/) - ! - localprecision = 0 - localdigits = -1 - lineList => null() - ! - ! -- Find and store file name - iin = this%inUnitObs - inquire (unit=iin, name=fname) - this%inputFilename = fname - ! - ! -- Read Options block - continueread = .false. - ierr = 0 - ! - ! -- get BEGIN line of OPTIONS block - call this%parser%GetBlock('OPTIONS', found, ierr, & - supportOpenClose=.true., blockRequired=.false.) - if (ierr /= 0) then - ! end of file - errmsg = 'End-of-file encountered while searching for'// & - ' OPTIONS in OBS '// & - 'input file "'//trim(this%inputFilename)//'"' - call store_error(errmsg) - call this%parser%StoreErrorUnit() - elseif (.not. found) then - this%blockTypeFound = '' - if (this%iout > 0) write (this%iout, 10) +70 format(/, 'End processing observation options',/) + + ! -- allocate and initialize variables + allocate (intptr) + allocate (idigits) + + write (this%iout, 60) + + ! -- update defaults from input context + call mem_set_value(idigits, 'DIGITS', this%input_mempath, & + found%digits) + call mem_set_value(intptr, 'PRINT_INPUT', this%input_mempath, & + found%print_input) + + if (found%digits) then + ! -- Set localdigits to valid value: 0, or 2 to 16 + if (idigits == 0) then + this%idigits = idigits + write (this%iout, 50) + else if (idigits < 1) then + errmsg = 'Error in OBS input: Invalid value for DIGITS option' + call store_error(errmsg) + else + if (idigits < 2) then + this%idigits = 2 + else if (idigits > 16) then + this%idigits = 16 + else + this%idigits = idigits + end if + write (this%iout, 40) this%idigits + end if end if - ! - ! -- parse OPTIONS entries - if (found) then - write (this%iout, 60) - readblockoptions: do - call this%parser%GetNextLine(endOfBlock) - if (endOfBlock) exit - call this%parser%GetStringCaps(keyword) - select case (keyword) - case ('DIGITS') - ! - ! -- error if digits already read - if (localdigits /= -1) then - errmsg = 'Error in OBS input: DIGITS has already been defined' - call store_error(errmsg) - exit readblockoptions - end if - ! - ! -- Specifies number of significant digits used writing simulated - ! values to a text file. Default is stored digits. - ! - ! -- Read integer value - localdigits = this%parser%GetInteger() - ! - ! -- Set localdigits to valid value: 0, or 2 to 16 - if (localdigits == 0) then - write (this%iout, 50) - else if (localdigits < 1) then - errmsg = 'Error in OBS input: Invalid value for DIGITS option' - call store_error(errmsg) - exit readblockoptions - else - if (localdigits < 2) localdigits = 2 - if (localdigits > 16) localdigits = 16 - write (this%iout, 40) localdigits - end if - case ('PRINT_INPUT') - this%echo = .true. - write (this%iout, '(a)') 'The PRINT_INPUT option has been specified.' - case default - errmsg = 'Error in OBS input: Unrecognized option: '// & - trim(keyword) - call store_error(errmsg) - exit readblockoptions - end select - end do readblockoptions + if (found%print_input) then + this%echo = .true. + write (this%iout, '(a)') 'The PRINT_INPUT option has been specified.' end if - ! + + write (this%iout, 70) + if (count_errors() > 0) then - call this%parser%StoreErrorUnit() + call store_error_filename(this%input_fname) end if - ! - write (this%iout, '(1x)') - ! - ! -- Assign type variables - if (localprecision > 0) this%iprecision = localprecision - if (localdigits >= 0) this%idigits = localdigits - end subroutine read_obs_options + + deallocate (intptr) + deallocate (idigits) + end subroutine source_options !> @ brief Define observation output formats !! @@ -716,23 +651,23 @@ subroutine define_fmts(this) end if end subroutine define_fmts - !> @ brief Read observations + !> @ brief Source observations !! - !! Subroutine to read the observations from the observation input file - !! and build headers for the observation output files. + !! Subroutine to source the observations from the observation input + !! context and build headers for the observation output files. !! !< - subroutine read_observations(this) + subroutine source_observations(this) ! -- dummy class(ObsType) :: this ! -- local ! - ! -- Read CONTINUOUS blocks and store observations - call this%read_obs_blocks(this%outputFilename) + ! -- Source CONTINUOUS blocks and store observations + call this%source_continuous() ! ! -- build headers call this%build_headers() - end subroutine read_observations + end subroutine source_observations !> @ brief Get the number of observations !! @@ -870,7 +805,7 @@ function get_obs_datum(this, obsTypeID) result(obsDatum) if (.not. associated(obsDatum)) then errmsg = 'Observation type not found: '//trim(obsTypeID) call store_error(errmsg) - call store_error_unit(this%inUnitObs) + call store_error_filename(this%input_fname) end if end function get_obs_datum @@ -912,36 +847,41 @@ function get_obs(this, indx) result(obsrv) obsrv => GetObsFromList(this%obsList, indx) end function get_obs - !> @ brief Read observation blocks - !! - !! Subroutine to read CONTIGUOUS block from the observation input file. - !! - !< - subroutine read_obs_blocks(this, fname) - ! -- dummy + subroutine source_continuous(this) + ! -- modules + use MemoryManagerModule, only: mem_setptr, mem_allocate + use MemoryManagerExtModule, only: mem_set_value + use CharacterStringModule, only: CharacterStringType + ! -- dummy variables class(ObsType), intent(inout) :: this - character(len=*), intent(inout) :: fname - ! -- local - integer(I4B) :: ierr, indexobsout, numspec - logical :: fmtd, found, endOfBlock - character(len=LENBIGLINE) :: pnamein, fnamein - character(len=LENHUGELINE) :: line - character(len=LINELENGTH) :: btagfound, message, word - character(len=LINELENGTH) :: title - character(len=LINELENGTH) :: tag - character(len=20) :: accarg, bin, fmtarg + integer(I4B), dimension(:), pointer, contiguous :: iblock + type(CharacterStringType), dimension(:), pointer, & + contiguous :: obsfnames, obsfmts + type(CharacterStringType), dimension(:), pointer, & + contiguous :: obsname, obstype + type(CharacterStringType), dimension(:), pointer, & + contiguous :: idstr + character(len=LINELENGTH) :: obsfname, obsfmt, oname, otype, ids, tag, title + character(len=20) :: accarg, fmtarg type(ObserveType), pointer :: obsrv => null() type(ObsOutputType), pointer :: obsOutput => null() - integer(I4B) :: ntabrows - integer(I4B) :: ntabcols - ! - ! -- initialize local variables - numspec = -1 - errmsg = '' - ! - inquire (unit=this%parser%iuactive, name=pnamein) - call GetFileFromPath(pnamein, fnamein) - ! + integer(I4B) :: n, ntabrows, ntabcols, numspec + integer(I4B) :: icont, indexobsout + logical(LGP) :: fmtd + + ! -- initialize + icont = 0 + obsfname = '' + obsfmt = '' + + ! -- set input context pointers + call mem_setptr(obsfnames, 'OBSFNAMES', this%input_mempath) + call mem_setptr(obsfmts, 'OBSFMTS', this%input_mempath) + call mem_setptr(iblock, 'CONTINUOUSNUM', this%input_mempath) + call mem_setptr(obsname, 'OBSNAME', this%input_mempath) + call mem_setptr(obstype, 'OBSTYPE', this%input_mempath) + call mem_setptr(idstr, 'ID', this%input_mempath) + if (this%echo) then ! ! -- create the observation table @@ -950,8 +890,8 @@ subroutine read_obs_blocks(this, fname) ntabcols = 5 ! ! -- initialize table and define columns - title = 'OBSERVATIONS READ FROM FILE "'//trim(fnamein)//'"' - call table_cr(this%obstab, fnamein, title) + title = 'OBSERVATIONS READ FROM FILE "'//trim(this%input_fname)//'"' + call table_cr(this%obstab, this%input_fname, title) call this%obstab%table_df(ntabrows, ntabcols, this%iout, & finalize=.FALSE.) tag = 'NAME' @@ -965,94 +905,60 @@ subroutine read_obs_blocks(this, fname) tag = 'OUTPUT FILENAME' call this%obstab%initialize_column(tag, 80, alignment=TABLEFT) end if - ! - found = .true. - readblocks: do - if (.not. found) exit - ! - call this%parser%GetBlock('*', found, ierr, .true., .false., btagfound) - if (.not. found) then - exit readblocks - end if - this%blockTypeFound = btagfound - ! - ! Get keyword, which should be FILEOUT - call this%parser%GetStringCaps(word) - if (word /= 'FILEOUT') then - call store_error('CONTINUOUS keyword must be followed by '// & - '"FILEOUT" then by filename.') - cycle - end if - ! - ! -- get name of output file - call this%parser%GetString(fname) - ! Fname is the output file name defined in the BEGIN line of the block. - if (fname == '') then - message = 'Error reading OBS input file, likely due to bad'// & - ' block or missing file name.' - call store_error(message) - cycle - else if (this%obsOutputList%ContainsFile(fname)) then - errmsg = 'OBS outfile "'//trim(fname)// & - '" is provided more than once.' - call store_error(errmsg) - cycle - end if - ! - ! -- look for BINARY option - call this%parser%GetStringCaps(bin) - if (bin == 'BINARY') then - fmtarg = FORM - accarg = ACCESS - fmtd = .false. - else - fmtarg = 'FORMATTED' - accarg = 'SEQUENTIAL' - fmtd = .true. + + do n = 1, size(obsfnames) + obsfname = obsfnames(n) + obsfmt = obsfmts(n) + end do + + do n = 1, size(obsname) + + if (icont /= iblock(n)) then + icont = iblock(n) + obsfname = obsfnames(icont) + obsfmt = obsfmts(icont) + ! -- look for BINARY option + if (obsfmt == 'BINARY') then + fmtarg = FORM + accarg = ACCESS + fmtd = .false. + else + fmtarg = 'FORMATTED' + accarg = 'SEQUENTIAL' + fmtd = .true. + end if + ! + ! -- open the output file + numspec = 0 + call openfile(numspec, 0, obsfname, 'OBS OUTPUT', fmtarg, & + accarg, 'REPLACE') + ! + ! -- add output file to list of output files and assign its + ! FormattedOutput member appropriately + call this%obsOutputList%Add(obsfname, numspec) + indexobsout = this%obsOutputList%Count() + obsOutput => this%obsOutputList%Get(indexobsout) + obsOutput%FormattedOutput = fmtd end if + + oname = obsname(n) + otype = obstype(n) + ids = idstr(n) + + call ConstructObservation(obsrv, oname, otype, ids, numspec, & + fmtd, indexobsout, this%obsData) ! - ! -- open the output file - numspec = 0 - call openfile(numspec, 0, fname, 'OBS OUTPUT', fmtarg, & - accarg, 'REPLACE') - ! - ! -- add output file to list of output files and assign its - ! FormattedOutput member appropriately - call this%obsOutputList%Add(fname, numspec) - indexobsout = this%obsOutputList%Count() + ! -- increment number of observations + ! to be written to this output file. obsOutput => this%obsOutputList%Get(indexobsout) - obsOutput%FormattedOutput = fmtd + obsOutput%nobs = obsOutput%nobs + 1 + call AddObsToList(this%obsList, obsrv) ! - ! -- process lines defining observations - select case (btagfound) - case ('CONTINUOUS') - ! - ! -- construct a continuous observation from each line in the block - readblockcontinuous: do - call this%parser%GetNextLine(endOfBlock) - if (endOfBlock) exit - call this%parser%GetCurrentLine(line) - call ConstructObservation(obsrv, line, numspec, fmtd, & - indexobsout, this%obsData, & - this%parser%iuactive) - ! - ! -- increment number of observations - ! to be written to this output file. - obsOutput => this%obsOutputList%Get(indexobsout) - obsOutput%nobs = obsOutput%nobs + 1 - call AddObsToList(this%obsList, obsrv) - ! - ! -- write line to the observation table - if (this%echo) then - call obsrv%WriteTo(this%obstab, btagfound, fname) - end if - end do readblockcontinuous - case default - errmsg = 'Error: Observation block type not recognized: '// & - trim(btagfound) - call store_error(errmsg) - end select - end do readblocks + ! -- write line to the observation table + if (this%echo) then + call obsrv%WriteTo(this%obstab, 'CONTINUOUS', obsfname) + end if + end do ! ! -- finalize the observation table if (this%echo) then @@ -1061,9 +967,9 @@ subroutine read_obs_blocks(this, fname) ! ! -- determine if error condition occurs if (count_errors() > 0) then - call this%parser%StoreErrorUnit() + call store_error_filename(this%input_fname) end if - end subroutine read_obs_blocks + end subroutine source_continuous !> @ brief Write observation data !! diff --git a/src/Utilities/Observation/Observe.f90 b/src/Utilities/Observation/Observe.f90 index 50692ad984a..82e58cf4703 100644 --- a/src/Utilities/Observation/Observe.f90 +++ b/src/Utilities/Observation/Observe.f90 @@ -225,28 +225,19 @@ end subroutine da !! on the contents of defLine. !! !< - subroutine ConstructObservation(newObservation, defLine, numunit, & - formatted, indx, obsData, inunit) + subroutine ConstructObservation(newObservation, obs_name, obs_type, obs_ids, & + numunit, formatted, indx, obsData) ! -- dummy variables type(ObserveType), pointer :: newObservation !< new ObserveType - character(len=*), intent(in) :: defLine !< string with observation data + character(len=*), intent(in) :: obs_name + character(len=*), intent(in) :: obs_type + character(len=*), intent(in) :: obs_ids integer(I4B), intent(in) :: numunit !< Output unit number logical, intent(in) :: formatted !< logical indicating if formatted output will be written integer(I4B), intent(in) :: indx !< Index in ObsOutput array type(ObsDataType), dimension(:), pointer, intent(in) :: obsData !< obsData type - integer(I4B), intent(in) :: inunit !< observation input file unit ! -- local - real(DP) :: r integer(I4B) :: i - integer(I4B) :: icol - integer(I4B) :: iout - integer(I4B) :: istart - integer(I4B) :: istop - integer(I4B) :: n - ! - ! -- initialize - iout = 0 - icol = 1 ! ! -- Allocate an ObserveType object. allocate (newObservation) @@ -257,14 +248,9 @@ subroutine ConstructObservation(newObservation, defLine, numunit, & ! ! -- Define the contents of the ObservationSingleType object based on the ! contents of defLine. - ! - ! -- Get observation name and store it - call urword(defLine, icol, istart, istop, 1, n, r, iout, inunit) - newObservation%Name = defLine(istart:istop) - ! - ! -- Get observation type, convert it to uppercase, and store it. - call urword(defLine, icol, istart, istop, 1, n, r, iout, inunit) - newObservation%ObsTypeId = defLine(istart:istop) + newObservation%Name = trim(obs_name) + newObservation%ObsTypeId = trim(obs_type) + newObservation%IDstring = trim(obs_ids) ! ! -- Look up package ID for this observation type and store it do i = 1, MAXOBSTYPES @@ -276,14 +262,6 @@ subroutine ConstructObservation(newObservation, defLine, numunit, & end if end do ! - ! -- Remaining text is ID [and ID2]; store the remainder of the string - istart = istop + 1 - istop = len_trim(defLine) - if (istart > istop) then - istart = istop - end if - newObservation%IDstring = defLine(istart:istop) - ! ! Store UnitNumber, FormattedOutput, and IndxObsOutput newObservation%UnitNumber = numunit newObservation%FormattedOutput = formatted diff --git a/src/Utilities/PackageBudget.f90 b/src/Utilities/PackageBudget.f90 index f82e1c976bd..c68b7e5e51a 100644 --- a/src/Utilities/PackageBudget.f90 +++ b/src/Utilities/PackageBudget.f90 @@ -116,21 +116,12 @@ end subroutine set_auxname !! GWF Package members stored in BndType. !! !< - subroutine set_pointers(this, flowvarname, mem_path_target, input_mempath) + subroutine set_pointers(this, flowvarname, mem_path_target, auxvarname) use ConstantsModule, only: LENVARNAME class(PackageBudgetType) :: this !< PackageBudgetType object character(len=*), intent(in) :: flowvarname !< name of variable storing flow (SIMVALS, SIMTOMVR) character(len=*), intent(in) :: mem_path_target !< path where target variable is stored - character(len=*), intent(in) :: input_mempath - character(len=LENVARNAME) :: auxvarname - ! - ! -- set memory manager aux varname - if (input_mempath /= '') then - auxvarname = 'AUXVAR_IDM' - else - auxvarname = 'AUXVAR' - end if - ! + character(len=*), intent(in) :: auxvarname ! -- Reassign pointers to variables in the flow model call mem_reassignptr(this%nbound, 'NBOUND', this%memoryPath, & 'NBOUND', mem_path_target) diff --git a/src/meson.build b/src/meson.build index 4949b4e28bf..fa9e932d473 100644 --- a/src/meson.build +++ b/src/meson.build @@ -157,6 +157,7 @@ modflow_sources = files( 'Idm' / 'prt-prpidm.f90', 'Idm' / 'utl-hpcidm.f90', 'Idm' / 'utl-ncfidm.f90', + 'Idm' / 'utl-obsidm.f90', 'Idm' / 'selector' / 'IdmDfnSelector.f90', 'Idm' / 'selector' / 'IdmExgDfnSelector.f90', 'Idm' / 'selector' / 'IdmGweDfnSelector.f90', diff --git a/utils/idmloader/dfns.txt b/utils/idmloader/dfns.txt index 37635b11c55..44c123e02af 100644 --- a/utils/idmloader/dfns.txt +++ b/utils/idmloader/dfns.txt @@ -113,3 +113,4 @@ exg-gwfprt.dfn exg-olfgwf.dfn utl-hpc.dfn utl-ncf.dfn +utl-obs.dfn diff --git a/utils/idmloader/scripts/dfn2f90.py b/utils/idmloader/scripts/dfn2f90.py index 31029836530..d78bbf6c196 100644 --- a/utils/idmloader/scripts/dfn2f90.py +++ b/utils/idmloader/scripts/dfn2f90.py @@ -580,6 +580,11 @@ def write(self): self._write_selectors() self._write_master() + def component(self, component, subcomponent): + if subcomponent == "OBS": + return "UTL" + return component + def _write_master(self): ofspec = SRC_PATH / "Idm" / "selector" / "IdmDfnSelector.f90" with open(ofspec, "w") as fh: @@ -630,8 +635,8 @@ def _write_selector_decl(self, fh=None, component=None, sc_list=None): for sc in sc_list: len_sc = len(sc) spacer = space * (len_c + len_sc) - - s += f" use {c.title()}{sc.title()}InputModule\n" + cc = self.component(c, sc) + s += f" use {cc.title()}{sc.title()}InputModule\n" s += ( f"\n implicit none\n" @@ -696,10 +701,11 @@ def _write_selector_defn( ) for sc in sc_list: + cc = self.component(c, sc) s += ( f" case ('{sc}')\n" f" call set_{dtype.lower()}_pointer(input_definition, " - f"{c.lower()}_{sc.lower()}_{defn.lower()}_definitions)\n" + f"{cc.lower()}_{sc.lower()}_{defn.lower()}_definitions)\n" ) s += ( @@ -723,9 +729,10 @@ def _write_selector_multi(self, fh=None, component=None, sc_list=None): ) for sc in sc_list: + cc = self.component(c, sc) s += ( f" case ('{sc}')\n" - f" multi_package = {c.lower()}_{sc.lower()}_" + f" multi_package = {cc.lower()}_{sc.lower()}_" f"multi_package\n" ) @@ -755,10 +762,11 @@ def _write_selector_sub(self, fh=None, component=None, sc_list=None): ) for sc in sc_list: + cc = self.component(c, sc) s += ( f" case ('{sc}')\n" f" call set_subpkg_pointer(subpackages, " - f"{c.lower()}_{sc.lower()}_subpackages)\n" + f"{cc.lower()}_{sc.lower()}_subpackages)\n" ) s += ( @@ -1048,6 +1056,12 @@ def _write_master_component(self, fh=None): converter.warn() converter.add_dfn_entry(dfn_d=dfn_d) + # add obs component to models + clist = ["SIM", "SLN", "EXG", "UTL"] + for c in dfn_d: + if c not in clist: + dfn_d[c].append("OBS") + selectors = IdmDfnSelector(dfn_d=dfn_d) selectors.write()