-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add multi-rank domain decomposition test (#13)
* Add multi-rank domain decomposition test * Add MPI_FLAVOUR environment variable for github
- Loading branch information
Showing
14 changed files
with
479 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../Makefile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
read_domain_resample | ||
-------------------- | ||
|
||
These examples read in arbitrary data from a netCDF file and resample to a different horizontal domain as defined within the input netCDF file using bilinear interpolation. | ||
The original and resampled data as well as a diff between them are written to one output NetCDF file. The unit tests include two known failure test cases where the expected result is not produced. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
""" | ||
Enable this folder to be a module path, for imports and test discovery. | ||
""" |
24 changes: 24 additions & 0 deletions
24
xios_examples/read_domain_decomp_resample/domain_check.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<context> | ||
|
||
<calendar type="Gregorian"/> | ||
|
||
<domain_definition> | ||
|
||
<domain id="original_domain" type="rectilinear" > | ||
<generate_rectilinear_domain/> | ||
</domain> | ||
|
||
<domain id="resampled_domain" type="rectilinear" > | ||
<generate_rectilinear_domain/> | ||
</domain> | ||
|
||
</domain_definition> | ||
|
||
<file_definition type="one_file"> | ||
<file id="din" name="domain_input" output_freq="1ts" mode="read" enabled=".true."> | ||
<field id="odatax" name="original_data" domain_ref="original_domain" operation="instant" /> | ||
<field id="edatax" name="resample_data" domain_ref="resampled_domain" operation="instant" /> | ||
</file> | ||
</file_definition> | ||
|
||
</context> |
51 changes: 51 additions & 0 deletions
51
xios_examples/read_domain_decomp_resample/domain_input_edge_simple_square_ten.cdl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
netcdf domain_input { | ||
dimensions: | ||
x = 5 ; | ||
y = 5 ; | ||
x_resample = 4 ; | ||
y_resample = 4 ; | ||
variables: | ||
float x(x) ; | ||
x:long_name = "original x coordinate" ; | ||
x:units = "1"; | ||
float y(y) ; | ||
y:long_name = "original y coordinate" ; | ||
y:units = "1"; | ||
float x_resample(x_resample) ; | ||
x_resample:long_name = "resampled x coordinate" ; | ||
x_resample:units = "1"; | ||
float y_resample(y_resample) ; | ||
y_resample:long_name = "resampled y coordinate" ; | ||
y_resample:units = "1"; | ||
double original_data(y,x) ; | ||
original_data:long_name = "input data values" ; | ||
original_data:units = "1"; | ||
double resample_data(y_resample,x_resample) ; | ||
resample_data:long_name = "expected resampled data values" ; | ||
resample_data:units = "1"; | ||
|
||
// global attributes: | ||
:title = "Input data for XIOS Domain resampling; data is a square function of the x & y coordinates; x^2+y^2." ; | ||
|
||
data: | ||
|
||
x = 0, 2, 4, 6, 8 ; | ||
|
||
y = 0, 2, 4, 6, 8 ; | ||
|
||
x_resample = 1, 3, 5, 7 ; | ||
|
||
y_resample = 1, 3, 5, 7 ; | ||
|
||
original_data = 0, 4, 16, 36, 64, | ||
4, 8, 20, 40, 68, | ||
16, 20, 32, 52, 80, | ||
36, 40, 52, 72, 100, | ||
64, 68, 80, 100, 128 ; | ||
|
||
resample_data = 2, 10, 26, 50, | ||
10, 18, 34, 58, | ||
26, 34, 50, 74, | ||
50, 58, 74, 98 ; | ||
|
||
} |
49 changes: 49 additions & 0 deletions
49
xios_examples/read_domain_decomp_resample/domain_input_simple_linear.cdl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
netcdf domain_input { | ||
dimensions: | ||
x = 5 ; | ||
y = 5 ; | ||
x_resample = 2 ; | ||
y_resample = 2 ; | ||
variables: | ||
float x(x) ; | ||
x:long_name = "original x coordinate" ; | ||
x:units = "1"; | ||
float y(y) ; | ||
y:long_name = "original y coordinate" ; | ||
y:units = "1"; | ||
float x_resample(x_resample) ; | ||
x_resample:long_name = "resampled x coordinate" ; | ||
x_resample:units = "1"; | ||
float y_resample(y_resample) ; | ||
y_resample:long_name = "resampled y coordinate" ; | ||
y_resample:units = "1"; | ||
double original_data(y,x) ; | ||
original_data:long_name = "input data values" ; | ||
original_data:units = "1"; | ||
double resample_data(y_resample,x_resample) ; | ||
resample_data:long_name = "expected resampled data values" ; | ||
resample_data:units = "1"; | ||
|
||
// global attributes: | ||
:title = "Input data for XIOS Domain resampling; data is a sum of the x & y coordinates; x + y ." ; | ||
|
||
data: | ||
|
||
x = 0, 2, 4, 6, 8 ; | ||
|
||
y = 0, 2, 4, 6, 8 ; | ||
|
||
x_resample = 3, 5 ; | ||
|
||
y_resample = 3, 5 ; | ||
|
||
original_data = 0, 2, 4, 6, 8, | ||
2, 4, 6, 8, 10, | ||
4, 6, 8, 10, 12, | ||
6, 8, 10, 12, 14, | ||
8, 10, 12, 14, 16 ; | ||
|
||
resample_data = 6, 8, | ||
8, 10 ; | ||
|
||
} |
49 changes: 49 additions & 0 deletions
49
xios_examples/read_domain_decomp_resample/domain_input_simple_square_ten.cdl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
netcdf domain_input { | ||
dimensions: | ||
x = 5 ; | ||
y = 5 ; | ||
x_resample = 2 ; | ||
y_resample = 2 ; | ||
variables: | ||
float x(x) ; | ||
x:long_name = "original x coordinate" ; | ||
x:units = "1"; | ||
float y(y) ; | ||
y:long_name = "original y coordinate" ; | ||
y:units = "1"; | ||
float x_resample(x_resample) ; | ||
x_resample:long_name = "resampled x coordinate" ; | ||
x_resample:units = "1"; | ||
float y_resample(y_resample) ; | ||
y_resample:long_name = "resampled y coordinate" ; | ||
y_resample:units = "1"; | ||
double original_data(y,x) ; | ||
original_data:long_name = "input data values" ; | ||
original_data:units = "1"; | ||
double resample_data(y_resample,x_resample) ; | ||
resample_data:long_name = "expected resampled data values" ; | ||
resample_data:units = "1"; | ||
|
||
// global attributes: | ||
:title = "Input data for XIOS Domain resampling; data is a square function of the x & y coordinates; x^2+y^2." ; | ||
|
||
data: | ||
|
||
x = 0, 2, 4, 6, 8 ; | ||
|
||
y = 0, 2, 4, 6, 8 ; | ||
|
||
x_resample = 3, 5 ; | ||
|
||
y_resample = 3, 5 ; | ||
|
||
original_data = 0, 4, 16, 36, 64, | ||
4, 8, 20, 40, 68, | ||
16, 20, 32, 52, 80, | ||
36, 40, 52, 72, 100, | ||
64, 68, 80, 100, 128 ; | ||
|
||
resample_data = 18, 34, | ||
34, 50 ; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0"?> | ||
<simulation> | ||
|
||
<context id="main" src="main.xml"/> | ||
<context id="domain_check" src="domain_check.xml"/> | ||
|
||
<context id="xios" src="xios.xml"/> | ||
|
||
</simulation> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<context> | ||
|
||
<calendar type="Gregorian"/> | ||
|
||
<domain_definition> | ||
|
||
<domain id="original_domain" type="rectilinear" /> | ||
<domain id="resampled_domain" type="rectilinear" > | ||
<interpolate_domain id="interpolator" order="1"/> | ||
</domain> | ||
|
||
</domain_definition> | ||
|
||
<grid_definition> | ||
|
||
<grid id="original_grid"> | ||
<domain domain_ref="original_domain" /> | ||
</grid> | ||
<grid id="resampled_grid"> | ||
<domain domain_ref="resampled_domain" /> | ||
</grid> | ||
|
||
</grid_definition> | ||
|
||
<field_definition prec="8"> | ||
<field id="edata" name="resample_data" grid_ref="resampled_grid" long_name="expected resampled data values" unit="1" /> | ||
<field id="odata" name="original_data" grid_ref="original_grid" long_name="input data values" unit="1" /> | ||
<field id="rdata" name="resampled_data" field_ref="odata" grid_ref="resampled_grid" long_name="resampled data values" unit="1" /> | ||
<field id="diff" name="resampled_minus_resample" grid_ref="resampled_grid" long_name="resampled - expected" unit="1" >rdata-edata</field> | ||
</field_definition> | ||
|
||
|
||
<file_definition type="one_file"> | ||
<file id="domain_input" output_freq="1ts" mode="read" enabled=".true."> | ||
<field id="odatain" name="original_data" grid_ref="original_grid" operation="instant" /> | ||
<field id="edatain" name="resample_data" grid_ref="resampled_grid" operation="instant" /> | ||
</file> | ||
<file id="domain_output" output_freq="1ts"> | ||
<field_group operation="once"> | ||
<field field_ref="edata" /> | ||
<field field_ref="odata" /> | ||
<field field_ref="rdata" /> | ||
<field field_ref="diff" /> | ||
</field_group> | ||
</file> | ||
</file_definition> | ||
|
||
</context> |
Oops, something went wrong.