PISM, A Parallel Ice Sheet Model  stable v0.5
src/verif/tests/simpleO.c
Go to the documentation of this file.
00001 /*
00002    Copyright (C) 2011 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 $ ./simpleO
00024 Enter z in m (0 <= z < 3000 for ice and -1000 < z < 0 for bedrock):  3000
00025 Results from Test O:
00026    T(z)  = 223.150 (K)          [absolute temperature]
00027    T_m   = 271.034 (K)          [pressure-melting (abs.) temperature at base]
00028    q_i   = 0.033519 (W m-2)     [upward heat flux in ice]
00029    q_bed = 0.042000 (W m-2)     [        "        in bedrock]
00030    bmelt = 8.80550e-04 (m a-1)
00031          = 0.88055 (mm a-1)     [ice-equivalent basal melt rate]
00032 
00033 */
00034 
00035 #include <stdio.h>
00036 #include "exactTestO.h"
00037 
00038 int main() {
00039 
00040   double       z, TT, Tm, qice, qbed, bmelt;
00041   int          scanret;
00042   const double secpera = 31556926.0;  /* seconds per year; 365.2422 days */
00043   const double H0 = 3000.0, B0 = -1000.0; 
00044  
00045   printf("Enter z in m (0 <= z < %4.0f for ice and %5.0f < z < 0 for bedrock):  ",
00046          H0,B0);
00047   scanret = scanf("%lf",&z);
00048   if (scanret != 1) {
00049     printf("... input error; exiting\n"); 
00050     return 1;
00051   }
00052 
00053   exactO(z, &TT, &Tm, &qice, &qbed, &bmelt);
00054 
00055   printf("Results from Test O:\n");
00056   printf("   T(z)  = %.3f (K)          [absolute temperature]\n",TT);
00057   printf("   T_m   = %.3f (K)          [pressure-melting (abs.) temperature at base]\n",Tm);
00058   printf("   q_i   = %f (W m-2)     [upward heat flux in ice]\n",qice);
00059   printf("   q_bed = %f (W m-2)     [        \"        in bedrock]\n",qbed);
00060   printf("   bmelt = %.5e (m a-1)\n"
00061          "         = %.5f (mm a-1)     [ice-equivalent basal melt rate]\n",
00062          bmelt*secpera,1000.0*bmelt*secpera);
00063 
00064   return 0;
00065 }
00066 
 All Classes Namespaces Files Functions Variables Typedefs Friends Defines