|
PISM, A Parallel Ice Sheet Model
stable v0.5
|
00001 /* 00002 Copyright (C) 2010 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: a point near the ELA: 00022 00023 $ ./simpleN 00024 Enter x (in km; 0.0 <= x <= 500.0): 300.0 00025 Results from Test N: 00026 H = ice thickness = 1920.00000 (m) 00027 h_x = surface slope = -7.20000e-03 00028 u = ice velocity = 300.00000 (m a-1) 00029 M = surface mass balance = -24.00000 (cm a-1) 00030 B = ice hardness = 1.36989e+08 (Pa s^(1/3)) 00031 beta = ice hardness = 1.29813e+10 (Pa s m-1) 00032 */ 00033 00034 00035 #include <stdio.h> 00036 #include "exactTestN.h" 00037 00038 int main() { 00039 00040 double H0, L0, xc, a, Hela, k, Hc, Tc, x, 00041 H, hx, u, M, B, beta; 00042 const double secpera=31556926.0; /* seconds per year; 365.2422 days */ 00043 int scanret, retvalN; 00044 00045 params_exactN(&H0, &L0, &xc, &a, &Hela, &k, &Hc, &Tc); 00046 00047 printf("Enter x (in km; 0.0 <= x <= %5.1f): ", L0 / 1000.0); 00048 scanret = scanf("%lf",&x); 00049 if (scanret != 1) { 00050 printf("... input error; exiting\n"); 00051 return 1; 00052 } 00053 00054 x = x * 1000.0; 00055 00056 retvalN = exactN(x, &H, &hx, &u, &M, &B, &beta); 00057 00058 if (retvalN) { 00059 printf("SIMPLEN ERROR: x out of allowed domain 0.0 <= x <= %5.1f km\n" 00060 " ... ending ...\n", L0 / 1000.0); 00061 return 1; 00062 } 00063 if (x > xc) { 00064 printf("WARNING: x = %5.1f km is past the calving front at xc = %5.1f km\n", 00065 x / 1000.0, xc / 1000.0); 00066 } 00067 00068 printf("Results from Test N:\n"); 00069 printf( 00070 " H = ice thickness = %12.5f (m)\n" 00071 " h_x = surface slope = %12.5e\n" 00072 " u = ice velocity = %12.5f (m a-1)\n" 00073 " M = surface mass balance = %12.5f (cm a-1)\n" 00074 " B = ice hardness = %12.5e (Pa s^(1/3))\n" 00075 " beta = ice hardness = %12.5e (Pa s m-1)\n", 00076 H, hx, u * secpera, M * secpera * 100.0, B, beta); 00077 return 0; 00078 } 00079
1.7.5.1