diff --git a/src/driver/mpas_subdriver.F b/src/driver/mpas_subdriver.F index 4126ff2f2f..d00e40616a 100644 --- a/src/driver/mpas_subdriver.F +++ b/src/driver/mpas_subdriver.F @@ -48,6 +48,7 @@ subroutine mpas_init() use mpas_c_interfacing, only : mpas_f_to_c_string, mpas_c_to_f_string use mpas_timekeeping, only : mpas_get_clock_time, mpas_get_time use mpas_bootstrapping, only : mpas_bootstrap_framework_phase1, mpas_bootstrap_framework_phase2 + use mpas_filter_list, only : mpas_filter_list_create_list implicit none @@ -146,6 +147,10 @@ end subroutine xml_stream_get_attributes domain_ptr => corelist % domainlist domain_ptr % core => corelist + allocate(corelist % filters) + call mpas_filter_list_create_list(corelist % filters) + call mpas_pool_create_pool(corelist % filterLists) + call mpas_allocate_domain(domain_ptr) ! @@ -182,6 +187,13 @@ end subroutine xml_stream_get_attributes call test_setup_domain(domain_ptr) #endif + if ( associated(corelist % setup_filter_list) ) then + iErr = corelist % setup_filter_list(corelist % filters, corelist % filterLists) + if ( iErr /= 0 ) then + call mpas_dmpar_global_abort('ERROR: Filter setup failed for core ' // trim(corelist % coreName)) + end if + end if + if ( readNamelistArg ) then domain_ptr % namelist_filename = namelistFile end if @@ -330,6 +342,7 @@ end subroutine mpas_run subroutine mpas_finalize() use mpas_stream_manager, only : MPAS_stream_mgr_finalize + use mpas_filter_list, only : mpas_filter_list_destroy_list implicit none @@ -355,7 +368,10 @@ subroutine mpas_finalize() call mpas_framework_finalize(domain_ptr % dminfo, domain_ptr) + call mpas_filter_list_destroy_list(corelist % filters) + deallocate(corelist % domainlist) + deallocate(corelist % filters) deallocate(corelist) end subroutine mpas_finalize