|
PISM, A Parallel Ice Sheet Model
stable v0.5
|
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 $ ./simpleH 00024 Enter f, t, and r separated by spaces (or newline) 00025 (in pure, yrs, and km, resp.; note f = rho_ice/rho_bedrock; 00026 e.g. input 0.28 40000 500): 00027 0.28 40000 500 00028 Results for Test H: 00029 H = 2356.058308 (m) M = 0.294507 (m/a) b = -659.696326 (m) 00030 00031 */ 00032 00033 #include <stdio.h> 00034 #include "exactTestH.h" 00035 00036 int main() { 00037 00038 const double SperA=31556926.0; /* seconds per year; 365.2422 days */ 00039 00040 double f, year, r, H, M, b; 00041 int scanret; 00042 00043 printf("Enter f, t, and r separated by spaces (or newline)\n"); 00044 printf(" (in pure, yrs, and km, resp.; note f = rho_ice/rho_bedrock;\n"); 00045 printf(" e.g. input 0.28 40000 500):\n"); 00046 scanret = scanf("%lf",&f); 00047 if (scanret != 1) { 00048 printf("... input error; exiting\n"); 00049 return 1; 00050 } 00051 scanret = scanf("%lf",&year); 00052 if (scanret != 1) { 00053 printf("... input error; exiting\n"); 00054 return 1; 00055 } 00056 scanret = scanf("%lf",&r); 00057 if (scanret != 1) { 00058 printf("... input error; exiting\n"); 00059 return 1; 00060 } 00061 00062 exactH(f, year*SperA, r*1000.0, &H, &M); 00063 b = -f * H; 00064 00065 printf("Results for Test H:\n"); 00066 printf(" H = %12.6f (m) M = %12.6f (m/a) b = %12.6f (m)\n",H,M*SperA,b); 00067 00068 return 0; 00069 }
1.7.5.1