PISM, A Parallel Ice Sheet Model  stable v0.5
src/verif/tests/simpleM.c
Go to the documentation of this file.
00001 /*
00002    Copyright (C) 2008 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 $ ./simpleM
00024 Enter  r  (in km; e.g. 600.0):   600.0
00025 Results from Test M:
00026      alpha = 1180.79793 (m/a),  D_rr = alpha' =  0.00115581 (1/a)
00027   
00028 */
00029 
00030 
00031 #include <stdio.h>
00032 #include "exactTestM.h"
00033 
00034 int main() {
00035 
00036   double       r, alpha, strainrate;
00037   int          scanret;
00038   const double secpera=31556926.0;  /* seconds per year; 365.2422 days */
00039   
00040   printf("Enter  r  (in km; e.g. 600.0):   ");
00041   scanret = scanf("%lf",&r);
00042   if (scanret != 1) {
00043     printf("... input error; exiting\n"); 
00044     return 1;
00045   }
00046 
00047   double EPS_ABS[] = { 1.0e-12, 1.0e-9, 1.0e-7 };
00048   double EPS_REL[] = { 0.0, 1.0e-14, 1.0e-11 }; 
00049   int eMresult;
00050   /*  use rkck method and stringent tolerance  */
00051   eMresult = exactM(r*1000.0,&alpha,&strainrate,EPS_ABS[0],EPS_REL[0],1);
00052   if (eMresult != 0) {
00053     printf("\n\nFAILURE in evaluatine exactM() !!!!\n\n\n");
00054   }
00055   
00056   printf("Results from Test M:\n");
00057   printf("     alpha = %8.5f (m/a),  D_rr = alpha' = %11.8f (1/a)\n", 
00058          alpha*secpera, strainrate*secpera);
00059   return 0;
00060 }
00061 
 All Classes Namespaces Files Functions Variables Typedefs Friends Defines