PISM, A Parallel Ice Sheet Model  stable v0.5
src/verif/tests/simpleE.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 /*  STANDARD DIALOGUE:
00022 
00023 $ ./simpleE
00024 Enter  t  and  r  separated by space (or newline)
00025     (in yrs and km, resp.; e.g. 15000 500):
00026 15000 500
00027 exact test E also requires cartesian location ...
00028 Enter  x  and  y  separated by space (in km; e.g. 400 200):
00029 400 200
00030 Results for Test E:
00031     H =  2524.368242 (m)     M =     0.640174 (m/a)    mu = 2.47248e-11 (m/(Pa s))
00032     u_b =  44.721769 (m/a)   v_b =  22.360884 (m/a)
00033 
00034 */
00035 
00036 #include <stdio.h>
00037 #include "exactTestsABCDE.h"
00038 
00039 int main() {
00040 
00041   const double SperA=31556926.0;  /* seconds per year; 365.2422 days */
00042 
00043   double year, r, 
00044          x, y, HE, ME, muE, ubE, vbE;
00045   int    scanret;
00046   
00047   printf("Enter  t  and  r  separated by space (or newline)\n");
00048   printf("    (in yrs and km, resp.; e.g. 15000 500):\n");
00049   scanret = scanf("%lf",&year);
00050   if (scanret != 1) {
00051     printf("... input error; exiting\n"); 
00052     return 1;
00053   }
00054   scanret = scanf("%lf",&r);
00055   if (scanret != 1) {
00056     printf("... input error; exiting\n"); 
00057     return 1;
00058   }
00059 
00060   printf("exact test E also requires cartesian location ...\n");
00061   printf("Enter  x  and  y  separated by space ");
00062   printf("(in km; e.g. 400 200):\n");
00063   scanret = scanf("%lf",&x);
00064   if (scanret != 1) {
00065     printf("... input error; exiting\n"); 
00066     return 1;
00067   }
00068   scanret = scanf("%lf",&y);
00069   if (scanret != 1) {
00070     printf("... input error; exiting\n"); 
00071     return 1;
00072   }
00073 
00074   exactE(x*1000.0, y*1000.0, &HE, &ME, &muE, &ubE, &vbE);
00075 
00076   printf("Results for Test E:\n");
00077   printf("    H = %12.6f (m)     M = %12.6f (m/a)    mu = %11.5e (m/(Pa s))\n",HE,ME*SperA,muE);
00078   printf("    u_b = %10.6f (m/a)   v_b = %10.6f (m/a)\n",ubE*SperA,vbE*SperA);
00079 
00080   return 0;
00081 }
 All Classes Namespaces Files Functions Variables Typedefs Friends Defines