/[MITgcm]/MITgcm/verification/testreport
ViewVC logotype

Diff of /MITgcm/verification/testreport

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.51 by mlosch, Mon Nov 29 21:38:08 2004 UTC revision 1.52 by edhill, Wed Dec 1 16:59:42 2004 UTC
# Line 519  createcodelet() Line 519  createcodelet()
519  #include <math.h>  #include <math.h>
520  int main( int argc, char** argv )  {  int main( int argc, char** argv )  {
521    int linnum,best,lncnt;    int linnum,best,lncnt;
522    double a,b,diff;    double a,b,abave,relerr;
523    best = -16;    best = -16;
524    lncnt = 0;    lncnt = 0;
525    while( 1 & (lncnt+=1) < 999 )  {    while( 1 & (lncnt+=1) < 999 )  {
526      scanf("%d", &linnum);      scanf("%d", &linnum);
527      if (linnum == -1)  break;      if (linnum == -1)  break;
528      scanf("%lf", &a);  scanf("%lf", &b);      scanf("%lf", &a);  scanf("%lf", &b);
529      diff = 0.5*(fabs(a)+fabs(b));      abave = 0.5*(fabs(a)+fabs(b));
530      if (diff > 0.0) {      if (abave > 0.0) {
531        diff=fabs(a-b)/diff;        relerr=fabs(a-b)/abave;
532        if (diff > 1.e-12) {        if (relerr > 0.0) {
533          linnum = (int)log10(diff);          linnum = (int)log10(relerr);
534          best = (best > linnum) ? best : linnum;          best = (best > linnum) ? best : linnum;
535        }        }
536        else {      }
537          if (best == -16 && diff != 0)  best = -22;      else {
538        }        if (best == -16 && abave != 0)  best = -22;
539      }      }
540    }    }
541    if (lncnt == 999) best=-29;    if (lncnt == 999) best=-29;

Legend:
Removed from v.1.51  
changed lines
  Added in v.1.52

  ViewVC Help
Powered by ViewVC 1.1.22