Skip to content
This repository has been archived by the owner on Oct 23, 2020. It is now read-only.

Commit

Permalink
Adding driver support to filters
Browse files Browse the repository at this point in the history
This commit adds filter setup / creation to the MPAS driver, to allow
cores that include filters to have them setup automatically.
  • Loading branch information
douglasjacobsen committed Aug 18, 2015
1 parent 3661dc6 commit 11eb9cb
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/driver/mpas_subdriver.F
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)

!
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit 11eb9cb

Please sign in to comment.