7 !! Writing of time-series data of the deep ice cores on file in ASCII format.
11 !! Copyright 2009-2013 Ralf Greve
15 !! This file is part of SICOPOLIS.
17 !! SICOPOLIS is free software: you can redistribute it and/or modify
18 !! it under the terms of the GNU General Public License as published by
19 !! the Free Software Foundation, either version 3 of the License, or
20 !! (at your option) any later version.
22 !! SICOPOLIS is distributed in the hope that it will be useful,
23 !! but WITHOUT ANY WARRANTY; without even the implied warranty of
24 !! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 !! GNU General Public License for more details.
27 !! You should have received a copy of the GNU General Public License
28 !! along with SICOPOLIS. If not, see <http://www.gnu.org/licenses/>.
30 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
33 !> Writing of time-series data of the deep ice cores on file in ASCII format.
34 !<------------------------------------------------------------------------------
35 subroutine output4(time, dxi, deta, delta_ts, glac_index, z_sl)
41 real(dp),
intent(in) :: time, dxi, deta, delta_ts, glac_index, z_sl
43 integer(i4b) :: i, j, n
45 real(dp),
dimension(0:JMAX,0:IMAX) :: field
46 real(dp),
dimension(:),
allocatable :: h_core, temp_core, &
47 vx_core, vy_core, v_core, &
48 rbx_core, rby_core, rb_core
50 allocate(h_core(n_core), temp_core(n_core), &
51 vx_core(n_core), vy_core(n_core), v_core(n_core), &
52 rbx_core(n_core), rby_core(n_core), rb_core(n_core))
61 call
borehole(field, x_core(n), y_core(n), dxi, deta,
'grid', h_core(n))
67 field(j,i) = vx_c(kcmax,j,i)
71 call
borehole(field, x_core(n), y_core(n), dxi, deta,
'sg_x', vx_core(n))
75 field(j,i) = vy_c(kcmax,j,i)
79 call
borehole(field, x_core(n), y_core(n), dxi, deta,
'sg_y', vy_core(n))
81 v_core(n) = sqrt(vx_core(n)**2+vy_core(n)**2)
87 field(j,i) = temp_r(krmax,j,i)
91 call
borehole(field, x_core(n), y_core(n), dxi, deta,
'grid', temp_core(n))
97 field(j,i) = vx_t(0,j,i)*txz_t(0,j,i)
101 call
borehole(field, x_core(n), y_core(n), dxi, deta,
'sg_x', rbx_core(n))
105 field(j,i) = vy_t(0,j,i)*tyz_t(0,j,i)
109 call
borehole(field, x_core(n), y_core(n), dxi, deta,
'sg_y', rby_core(n))
111 rb_core(n) = rbx_core(n) + rby_core(n)
117 #if ( !defined(OUT_TIMES) || OUT_TIMES==1 )
118 time_val = time /year_sec
120 time_val = (time+year_zero) /year_sec
122 stop
' output4: OUT_TIMES must be either 1 or 2!'
126 v_core(n) = v_core(n) *year_sec
131 if (forcing_flag == 1)
then
132 write(14,
'(1pe13.6,2(1pe13.4))') time_val, delta_ts, z_sl
133 else if (forcing_flag == 2)
then
134 write(14,
'(1pe13.6,2(1pe13.4))') time_val, glac_index, z_sl
135 else if (forcing_flag == 3)
then
136 write(14,
'(1pe13.6,2(1pe13.4))') time_val, 1.11e+11_dp, z_sl
140 write(14,
'(13x,1pe13.4)',advance=
'no') h_core(n)
142 write(14,
'(1pe13.4)',advance=
'no') h_core(n)
145 write(14,
'(1pe13.4)') h_core(n)
148 write(14,
'(13x,1pe13.4)',advance=
'no') v_core(n)
150 write(14,
'(1pe13.4)',advance=
'no') v_core(n)
153 write(14,
'(1pe13.4)') v_core(n)
156 write(14,
'(13x,1pe13.4)',advance=
'no') temp_core(n)
158 write(14,
'(1pe13.4)',advance=
'no') temp_core(n)
161 write(14,
'(1pe13.4)') temp_core(n)
164 write(14,
'(13x,1pe13.4)',advance=
'no') rb_core(n)
166 write(14,
'(1pe13.4)',advance=
'no') rb_core(n)
169 write(14,
'(1pe13.4,/)') rb_core(n)
171 deallocate(h_core, vx_core, vy_core, v_core, temp_core, &
172 rbx_core, rby_core, rb_core)