SICOPOLIS V3.0
 All Classes Files Functions Variables Macros
output3.F90
Go to the documentation of this file.
1 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 !
3 ! Subroutine : o u t p u t 3
4 !
5 !> @file
6 !!
7 !! Writing of time-series data of the ice thickness field on file
8 !! in ASCII format.
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 !> Writing of time-series data of the ice thickness field on file
35 !! in ASCII format.
36 !<------------------------------------------------------------------------------
37 
38 subroutine output3(time, delta_ts, glac_index, z_sl)
39 
40 use sico_types
42 
43 implicit none
44 integer(i4b) :: i, j
45 real(dp) :: time, delta_ts, glac_index, z_sl
46 real(dp) :: time_val, delta_ts_val, glac_index_val, z_sl_val
47 real(dp) :: h_val(0:jmax,0:imax)
48 
49 !-------- Conversion --------
50 
51 #if ( !defined(OUT_TIMES) || OUT_TIMES==1 )
52 time_val = time /year_sec ! s -> a
53 #elif OUT_TIMES == 2
54 time_val = (time+year_zero) /year_sec ! s -> a
55 #else
56 stop ' output3: OUT_TIMES must be either 1 or 2!'
57 #endif
58 
59 delta_ts_val = delta_ts ! in deg C
60 glac_index_val = glac_index
61 z_sl_val = z_sl ! in m
62 
63 h_val = h_c + h_t ! in m
64 
65 !-------- Write data on time-series file --------
66 
67 if (forcing_flag == 1) then
68  write(13,1011) time_val, delta_ts_val, z_sl_val
69 else if (forcing_flag == 2) then
70  write(13,1011) time_val, glac_index_val, z_sl_val
71 else if (forcing_flag == 3) then
72  write(13,1011) time_val, 1.11e+11_dp, z_sl_val
73 end if
74 
75 do j=jmax, 0, -1
76  write(13,1012) (h_val(j,i), i=0,imax)
77 end do
78 
79  1011 format(/,1pe13.6,2(1pe13.4),/)
80  1012 format(imax(f8.1),f8.1)
81 
82 end subroutine output3
83 !