diff --git a/examples/pdegen/mld_dexample_1lev.f90 b/examples/pdegen/mld_dexample_1lev.f90 index f52404f9..5197c4db 100644 --- a/examples/pdegen/mld_dexample_1lev.f90 +++ b/examples/pdegen/mld_dexample_1lev.f90 @@ -322,7 +322,7 @@ contains ! Using a simple BLOCK distribution. ! nt = (m+np-1)/np - nr = min(nt,m-(iam*nt)) + nr = max(0,min(nt,m-(iam*nt))) nt = nr call psb_sum(ictxt,nt) diff --git a/examples/pdegen/mld_dexample_ml.f90 b/examples/pdegen/mld_dexample_ml.f90 index 56eeb3de..5e33ad40 100644 --- a/examples/pdegen/mld_dexample_ml.f90 +++ b/examples/pdegen/mld_dexample_ml.f90 @@ -360,7 +360,7 @@ contains ! Using a simple BLOCK distribution. ! nt = (m+np-1)/np - nr = min(nt,m-(iam*nt)) + nr = max(0,min(nt,m-(iam*nt))) nt = nr call psb_sum(ictxt,nt) diff --git a/examples/pdegen/mld_sexample_1lev.f90 b/examples/pdegen/mld_sexample_1lev.f90 index fe6f5aeb..2c79ffad 100644 --- a/examples/pdegen/mld_sexample_1lev.f90 +++ b/examples/pdegen/mld_sexample_1lev.f90 @@ -323,7 +323,7 @@ contains ! Using a simple BLOCK distribution. ! nt = (m+np-1)/np - nr = min(nt,m-(iam*nt)) + nr = max(0,min(nt,m-(iam*nt))) nt = nr call psb_sum(ictxt,nt) diff --git a/examples/pdegen/mld_sexample_ml.f90 b/examples/pdegen/mld_sexample_ml.f90 index 721be329..3cf35faa 100644 --- a/examples/pdegen/mld_sexample_ml.f90 +++ b/examples/pdegen/mld_sexample_ml.f90 @@ -361,7 +361,7 @@ contains ! Using a simple BLOCK distribution. ! nt = (m+np-1)/np - nr = min(nt,m-(iam*nt)) + nr = max(0,min(nt,m-(iam*nt))) nt = nr call psb_sum(ictxt,nt) diff --git a/tests/pdegen/ppde.f90 b/tests/pdegen/ppde.f90 index caa80fe1..fd2d7464 100644 --- a/tests/pdegen/ppde.f90 +++ b/tests/pdegen/ppde.f90 @@ -456,7 +456,7 @@ contains ! Using a simple BLOCK distribution. ! nt = (m+np-1)/np - nr = min(nt,m-(iam*nt)) + nr = max(0,min(nt,m-(iam*nt))) nt = nr call psb_sum(ictxt,nt) diff --git a/tests/pdegen/spde.f90 b/tests/pdegen/spde.f90 index f8ffc16c..0caf2e9f 100644 --- a/tests/pdegen/spde.f90 +++ b/tests/pdegen/spde.f90 @@ -456,7 +456,7 @@ contains ! Using a simple BLOCK distribution. ! nt = (m+np-1)/np - nr = min(nt,m-(iam*nt)) + nr = max(0,min(nt,m-(iam*nt))) nt = nr call psb_sum(ictxt,nt)