Skip to content
Snippets Groups Projects
Commit 02c453b5 authored by Rene Redler's avatar Rene Redler
Browse files

bug fix in runoff example; exchange between land and ocean boundary cells

parent e6aa808e
No related branches found
No related tags found
No related merge requests found
......@@ -207,7 +207,7 @@ int main () {
if ( checksum_mask > 0 ) {
for ( int i = 0; i < num_cells; ++i ) {
if ( cell_mask[i] == -1 ) cell_mask_own[i] = 0;
if ( cell_mask[i] == 1 ) cell_mask_own[i] = 0;
else cell_mask_own[i] = 1;
}
}
......@@ -224,7 +224,6 @@ int main () {
#endif
yac_cdef_mask ( cell_mask_own, point_id, &mask_id );
free (cell_mask_own);
/* Field definition for the first component (toy-icon-atmosphere) */
......@@ -322,9 +321,9 @@ int main () {
}
for ( int i = 0; i < num_cells; ++i ) {
if ( cell_mask[i] > 0 ) {
if ( cell_mask_own[i] > 0 ) {
cell_out_runoff_data[i] = -99999;
cell_in_runoff_data[i] = -999;
cell_in_runoff_data[i] = -99999;
}
}
......@@ -407,9 +406,9 @@ int main () {
vtk_close(vtk_file);
for ( int i = 0; i < num_cells; ++i ) {
if ( cell_mask[i] > 0 ) {
if ( cell_mask_own[i] > 0 ) {
cell_out_runoff_data[i] = -99999;
cell_in_runoff_data[i] = -999;
cell_in_runoff_data[i] = -99999;
} else {
cell_out_runoff_data[i] = cell_in_runoff_data[i];
cell_in_runoff_data[i] = -10;
......@@ -424,6 +423,8 @@ int main () {
printf ("toy-icon-atmosphere: Time for ping-pong %f %f %f \n", time_min_acc, time_max_acc, time_ave_acc );
}
free (cell_mask_own);
yac_cfinalize();
MPI_Finalize();
......
......@@ -133,7 +133,7 @@ int main () {
/* Grid definition for the first component (toy-icon-ocean) */
// char * filename = "r2b4_amip.nc";
// char * filename = "iconR2B04-grid.nc";
char * filename = "Earth_Icos_0039km_from160km-amip-cor.nc";
int num_vertices;
......@@ -225,7 +225,6 @@ int main () {
#endif
yac_cdef_mask ( cell_mask_own, point_id, &mask_id );
free (cell_mask_own);
/* Field definition for the first component (toy-icon-ocean) */
......@@ -323,9 +322,9 @@ int main () {
}
for ( int i = 0; i < num_cells; ++i ) {
if ( cell_mask[i] > 0 ) {
if ( cell_mask_own[i] > 0 ) {
cell_out_runoff_data[i] = -99999;
cell_in_runoff_data[i] = -999;
cell_in_runoff_data[i] = -99999;
}
}
......@@ -408,9 +407,9 @@ int main () {
vtk_close(vtk_file);
for ( int i = 0; i < num_cells; ++i ) {
if ( cell_mask[i] > 0 ) {
if ( cell_mask_own[i] > 0 ) {
cell_out_runoff_data[i] = -99999;
cell_in_runoff_data[i] = -999;
cell_in_runoff_data[i] = -99999;
} else {
cell_out_runoff_data[i] = cell_in_runoff_data[i];
cell_in_runoff_data[i] = -10;
......@@ -425,6 +424,8 @@ int main () {
printf ("toy-icon-atmosphere: Time for ping-pong %f %f %f \n", time_min_acc, time_max_acc, time_ave_acc );
}
free (cell_mask_own);
yac_cfinalize();
MPI_Finalize();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment