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

Commit

Permalink
Adding filter support to the test core
Browse files Browse the repository at this point in the history
This commit adds support to the test core for filters. Additionally, it
adds two filters to the test core that test the compute interval of
filters.
  • Loading branch information
douglasjacobsen committed Aug 18, 2015
1 parent 2638587 commit bbd2273
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/core_test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ gen_includes:
$(CPP) $(CPPFLAGS) $(CPPINCLUDES) Registry.xml > Registry_processed.xml
(if [ ! -d inc ]; then mkdir -p inc; fi) # To generate *.inc files
(cd inc; $(REG_PATH)/$(REG_PARSE) < ../Registry_processed.xml )
(cd inc; $(REG_PATH)/$(FILTER_PARSE) < ../Registry_processed.xml )

post_build:
if [ ! -e $(ROOT_DIR)/default_inputs ]; then mkdir $(ROOT_DIR)/default_inputs; fi
Expand All @@ -41,7 +42,7 @@ clean:
$(RM) $@ $*.mod
ifeq "$(GEN_F90)" "true"
$(CPP) $(CPPFLAGS) $(CPPINCLUDES) $< > $*.f90
$(FC) $(FFLAGS) -c $*.f90 $(FCINCLUDES) -I../framework -I../operators -I../external/esmf_time_f90
$(FC) $(FFLAGS) -c $*.f90 $(FCINCLUDES) -I../framework -I../operators -I../filters -I../external/esmf_time_f90
else
$(FC) $(CPPFLAGS) $(FFLAGS) -c $*.F $(CPPINCLUDES) $(FCINCLUDES) -I../framework -I../operators -I../external/esmf_time_f90
$(FC) $(CPPFLAGS) $(FFLAGS) -c $*.F $(CPPINCLUDES) $(FCINCLUDES) -I../framework -I../operators -I../filters -I../external/esmf_time_f90
endif
18 changes: 18 additions & 0 deletions src/core_test/Registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,22 @@
<var name="cellsOnVertex" type="integer" dimensions="vertexDegree nVertices"/>
<var name="kiteAreasOnVertex" type="real" dimensions="vertexDegree nVertices"/>
</var_struct>
<filters>
<filter name="testComputeInterval1" module_name="mpas_filter_test_compute_interval"/>
<filter name="testComputeInterval2" module_name="mpas_filter_test_compute_interval"/>
</filters>
<nml_record name="testComputeInterval1">
<nml_option name="config_testComputeInterval1_enable" type="logical" default_value=".false."/>
<nml_option name="config_testComputeInterval1_compute_interval" type="character" default_value="dt"/>
<nml_option name="config_testComputeInterval1_stream_name" type="character" default_value="none"/>
<nml_option name="config_testComputeInterval1_compute_on_startup" type="logical" default_value=".false."/>
<nml_option name="config_testComputeInterval1_write_on_startup" type="logical" default_value=".false."/>
</nml_record>
<nml_record name="testComputeInterval2">
<nml_option name="config_testComputeInterval2_enable" type="logical" default_value=".false."/>
<nml_option name="config_testComputeInterval2_compute_interval" type="character" default_value="0000_00:05:00"/>
<nml_option name="config_testComputeInterval2_stream_name" type="character" default_value="none"/>
<nml_option name="config_testComputeInterval2_compute_on_startup" type="logical" default_value=".false."/>
<nml_option name="config_testComputeInterval2_write_on_startup" type="logical" default_value=".false."/>
</nml_record>
</registry>
1 change: 1 addition & 0 deletions src/core_test/build_options.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
PWD=$(shell pwd)
EXE_NAME=test_model
NAMELIST_SUFFIX=test
USE_FILTERS=true
override CPPFLAGS += -DCORE_TEST

report_builds:
Expand Down
11 changes: 10 additions & 1 deletion src/core_test/mpas_test_core.F
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ module test_core

use mpas_framework
use mpas_timekeeping
use mpas_stream_manager
use mpas_filter_driver

type (MPAS_Clock_type), pointer :: clock

Expand Down Expand Up @@ -53,6 +55,8 @@ function test_core_init(domain, startTimeStamp) result(iErr)!{{{
startTime = mpas_get_clock_time(clock, MPAS_START_TIME, iErr)
call mpas_get_time(startTime, dateTimeString=startTimeStamp)

call mpas_filter_driver_init(domain % core % filters, domain, iErr=iErr)

end function test_core_init!}}}


Expand Down Expand Up @@ -85,12 +89,15 @@ function test_core_run(domain) result(iErr)!{{{
type (mpas_pool_type), pointer :: pool
type (mpas_pool_iterator_type) :: itr


iErr = 0

call mpas_unit_test_fix_periodicity(iErr)
call mpas_unit_test_triangle_signed_area_sphere(iErr)

call mpas_filter_driver_compute(domain % core % filters, domain, iErr = iErr)

call mpas_stream_mgr_write(domain % streamManager, iErr = iErr)

end function test_core_run!}}}

!***********************************************************************
Expand Down Expand Up @@ -118,6 +125,8 @@ function test_core_finalize(domain) result(iErr)!{{{

iErr = 0

call mpas_filter_driver_finalize(domain % core % filters, domain, iErr=iErr)

call mpas_destroy_clock(clock, iErr)

end function test_core_finalize!}}}
Expand Down
3 changes: 3 additions & 0 deletions src/core_test/mpas_test_core_interface.F
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ subroutine test_setup_core(core)!{{{
core % setup_decomposed_dimensions => test_setup_decomposed_dimensions
core % setup_block => test_setup_block
core % setup_namelist => test_setup_namelists
core % setup_filter_list => test_setup_filters

core % Conventions = 'MPAS'
core % source = 'MPAS'
Expand Down Expand Up @@ -272,5 +273,7 @@ end function test_setup_block!}}}

#include "inc/namelist_defines.inc"

#include "inc/filter_function.inc"

end module test_core_interface

0 comments on commit bbd2273

Please sign in to comment.