@@ -28,7 +28,7 @@ module MawModule
2828 use SimVariablesModule, only: errmsg, warnmsg
2929 use MemoryManagerModule, only: mem_allocate, mem_reallocate, mem_setptr, &
3030 mem_deallocate, get_isize
31- use MemoryManagerExtModule, only: mem_set_value
31+ use MemoryManagerExtModule, only: mem_set_value, memorystore_release
3232 use MemoryHelperModule, only: create_mem_path
3333 use CharacterStringModule, only: CharacterStringType
3434 use OpenSpecModule, only: access, form
@@ -50,7 +50,7 @@ module MawModule
5050 ! > @brief input context data pointers for MAW.
5151 ! !
5252 ! ! Holds persistent pointers to input context arrays used at
53- ! ! runtime. TS arrays are managed transparently by IDM.
53+ ! ! runtime.
5454 ! <
5555 type :: MawInputContextType
5656 ! -- packagedata
@@ -947,6 +947,14 @@ subroutine maw_source_packagedata(this)
947947 end do
948948 this% iaconn(n + 1 ) = idx + 1
949949 end do
950+ !
951+ ! -- release input context packagedata memory; PACKAGEDATA_IFNO excluded
952+ ! because allocate_featureauxvar retains a pointer to it
953+ call memorystore_release(' RADIUS' , this% input_mempath)
954+ call memorystore_release(' BOTTOM' , this% input_mempath)
955+ call memorystore_release(' CONDEQN' , this% input_mempath)
956+ call memorystore_release(' NGWFNODES' , this% input_mempath)
957+ call memorystore_release(' BOUNDNAME' , this% input_mempath)
950958 end subroutine maw_source_packagedata
951959
952960 ! > @brief Source CONNECTIONDATA block from input context
@@ -1171,6 +1179,15 @@ subroutine maw_source_connectiondata(this)
11711179 if (count_errors() > 0 ) then
11721180 call store_error_filename(this% input_fname)
11731181 end if
1182+ !
1183+ ! -- release input context connectiondata memory
1184+ call memorystore_release(' CONNDATA_IFNO' , this% input_mempath)
1185+ call memorystore_release(' ICON' , this% input_mempath)
1186+ call memorystore_release(' CELLID' , this% input_mempath)
1187+ call memorystore_release(' SCRN_TOP' , this% input_mempath)
1188+ call memorystore_release(' SCRN_BOT' , this% input_mempath)
1189+ call memorystore_release(' HK_SKIN' , this% input_mempath)
1190+ call memorystore_release(' RADIUS_SKIN' , this% input_mempath)
11741191 end subroutine maw_source_connectiondata
11751192
11761193 ! > @brief Read the initial parameters for this package
0 commit comments