SICOPOLIS V3.1
 All Classes Files Functions Variables Macros
c_val.F90
Go to the documentation of this file.
1 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 !
3 ! Function : c _ v a l
4 !
5 !> @file
6 !!
7 !! Specific heat of ice:
8 !! Linear interpolation of tabulated values in C(.).
9 !!
10 !! @section Copyright
11 !!
12 !! Copyright 2009-2013 Ralf Greve
13 !!
14 !! @section License
15 !!
16 !! This file is part of SICOPOLIS.
17 !!
18 !! SICOPOLIS is free software: you can redistribute it and/or modify
19 !! it under the terms of the GNU General Public License as published by
20 !! the Free Software Foundation, either version 3 of the License, or
21 !! (at your option) any later version.
22 !!
23 !! SICOPOLIS is distributed in the hope that it will be useful,
24 !! but WITHOUT ANY WARRANTY; without even the implied warranty of
25 !! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 !! GNU General Public License for more details.
27 !!
28 !! You should have received a copy of the GNU General Public License
29 !! along with SICOPOLIS. If not, see <http://www.gnu.org/licenses/>.
30 !<
31 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
32 
33 !-------------------------------------------------------------------------------
34 !> Specific heat of ice:
35 !! Linear interpolation of tabulated values in C(.).
36 !<------------------------------------------------------------------------------
37 function c_val(temp_val)
38 
39 use sico_types
41 
42 implicit none
43 real(dp) :: c_val
44 real(dp), intent(in) :: temp_val
45 
46 real(dp) :: c_ice
47 
48 !-------- Specific heat of pure ice --------
49 
50 #if defined(FRAC_DUST)
51 c_ice = c(floor(temp_val)) &
52  +(c(floor(temp_val)+1)-c(floor(temp_val))) &
53  *(temp_val-real(floor(temp_val),dp))
54 #else
55 c_val = c(floor(temp_val)) &
56  +(c(floor(temp_val)+1)-c(floor(temp_val))) &
57  *(temp_val-real(floor(temp_val),dp))
58 #endif
59 
60 !-------- If dust is present (polar caps of Mars):
61 ! Specific heat of ice-dust mixture --------
62 
63 #if defined(FRAC_DUST)
64 c_val = rho_inv * ( (1.0_dp-frac_dust)*rho_i*c_ice + frac_dust*rho_c*c_c )
65 #endif
66 
67 end function c_val
68 !