PISM, A Parallel Ice Sheet Model  stable v0.5
src/verif/tests/simpleJ.c
Go to the documentation of this file.
00001 /*
00002    Copyright (C) 2004-2006 Jed Brown and Ed Bueler
00003   
00004    This file is part of Pism.
00005   
00006    Pism is free software; you can redistribute it and/or modify it under the
00007    terms of the GNU General Public License as published by the Free Software
00008    Foundation; either version 2 of the License, or (at your option) any later
00009    version.
00010   
00011    Pism is distributed in the hope that it will be useful, but WITHOUT ANY
00012    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00013    FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
00014    details.
00015   
00016    You should have received a copy of the GNU General Public License
00017    along with Pism; if not, write to the Free Software
00018    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00019 */
00020 
00021 /*  [NEEDS TO BE CONFIRMED AS standard] DIALOGUEs:
00022 
00023 user@home:~/pism$ simpleJ
00024 Enter  x, y  separated by space (or newline);
00025     (units: km, km; e.g. 100 100):
00026 100 100
00027 
00028 Results from Test J:
00029   H   =   500.000 (m)     nu    =     30.000 (MPa a)
00030   u   =   109.160 (m/a)   v     =     28.921 (m/a)
00031 
00032 user@home:~/pism$ simpleJ
00033 Enter  x, y  separated by space (or newline);
00034     (units: km, km; e.g. 100 100):
00035 0 0
00036 
00037 Results from Test J:
00038   H   =   770.000 (m)     nu    =     19.481 (MPa a)
00039   u   =     0.000 (m/a)   v     =      0.000 (m/a)
00040 
00041 */
00042 
00043 #include <stdio.h>
00044 #include "exactTestsIJ.h"
00045 
00046 int main() {
00047 
00048   double x, y, u, v, H, nu;
00049   int    scanret;
00050   const double secpera=31556926.0;  /* seconds per year; 365.2422 days */
00051   
00052   printf("Enter  x, y  separated by space (or newline);\n");
00053   printf("    (units: km, km; e.g. 100 100):\n");
00054   scanret = scanf("%lf",&x);
00055   if (scanret != 1) {
00056     printf("... input error; exiting\n"); 
00057     return 1;
00058   }
00059   scanret = scanf("%lf",&y);
00060   if (scanret != 1) {
00061     printf("... input error; exiting\n"); 
00062     return 1;
00063   }
00064 
00065   printf("\nResults from Test J (returned %d):\n", 
00066          exactJ(x*1000.0,y*1000.0, &H, &nu, &u, &v));
00067   printf("  H   = %10.3f (m)     nu    = %10.3f (MPa a)\n",H,(nu*1.0e-6)/secpera);
00068   printf("  u   = %10.5f (m/a)   v     = %10.5f (m/a)\n",u*secpera,v*secpera);
00069 
00070   return 0;
00071 }
 All Classes Namespaces Files Functions Variables Typedefs Friends Defines