SICOPOLIS V3.2
 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-2016 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 use sico_vars
43 
44 implicit none
45 
46 real(dp), intent(in) :: time, delta_ts, glac_index, z_sl
47 
48 integer(i4b) :: i, j
49 real(dp) :: time_val, delta_ts_val, glac_index_val, z_sl_val
50 real(dp) :: h_val(0:jmax,0:imax)
51 
52 character(len= 8) :: ch_imax
53 character(len=128) :: fmt5, fmt6
54 
55 fmt5 = '(/,1pe13.6,2(1pe13.4),/)'
56 
57 write(ch_imax, fmt='(i8)') imax
58 write(fmt6, fmt='(a)') '('//trim(adjustl(ch_imax))//'(f8.1),f8.1)'
59 
60 !-------- Conversion --------
61 
62 #if ( !defined(OUT_TIMES) || OUT_TIMES==1 )
63 time_val = time /year_sec ! s -> a
64 #elif OUT_TIMES == 2
65 time_val = (time+year_zero) /year_sec ! s -> a
66 #else
67 stop ' output3: OUT_TIMES must be either 1 or 2!'
68 #endif
69 
70 delta_ts_val = delta_ts ! in deg C
71 glac_index_val = glac_index
72 z_sl_val = z_sl ! in m
73 
74 h_val = h_c + h_t ! in m
75 
76 !-------- Write data on time-series file --------
77 
78 if (forcing_flag == 1) then
79  write(unit=13, fmt=trim(fmt5)) time_val, delta_ts_val, z_sl_val
80 else if (forcing_flag == 2) then
81  write(unit=13, fmt=trim(fmt5)) time_val, glac_index_val, z_sl_val
82 else if (forcing_flag == 3) then
83  write(unit=13, fmt=trim(fmt5)) time_val, 1.11e+11_dp, z_sl_val
84 end if
85 
86 do j=jmax, 0, -1
87  write(unit=13, fmt=trim(fmt6)) (h_val(j,i), i=0,imax)
88 end do
89 
90 end subroutine output3
91 !
Declarations of kind types for SICOPOLIS.
Definition: sico_types.F90:35
subroutine output3(time, delta_ts, glac_index, z_sl)
Writing of time-series data of the ice thickness field on file in ASCII format.
Definition: output3.F90:38
Declarations of global variables for SICOPOLIS (for the ANT domain).
Definition: sico_vars.F90:35
Declarations of global variables for SICOPOLIS.