SICOPOLIS V3.2
 All Classes Files Functions Variables Macros
output5.F90
Go to the documentation of this file.
1 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 !
3 ! Subroutine : o u t p u t 5
4 !
5 !> @file
6 !!
7 !! Writing of time-series data for all defined surface points on file
8 !! in ASCII format. Modification of Tolly's output7 by Thorben Dunse.
9 !!
10 !! @section Copyright
11 !!
12 !! Copyright 2009-2016 Thorben Dunse, 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 for all defined surface points on file
35 !! in ASCII format. Modification of Tolly's output7 by Thorben Dunse.
36 !<------------------------------------------------------------------------------
37 subroutine output5(time, dxi, deta, delta_ts, glac_index, z_sl)
38 
39 use sico_types
41 use sico_vars
42 
43 implicit none
44 real(dp), intent(in) :: time, dxi, deta, delta_ts, glac_index, z_sl
45 
46 integer(i4b) :: n, k
47 real(dp) :: time_val
48 real(dp), dimension(0:JMAX,0:IMAX) :: field
49 real(dp), dimension(:), allocatable :: zl_surf, zs_surf, &
50  accum_surf, as_perp_surf, &
51  snowfall_surf, rainfall_surf, runoff_surf, &
52  vx_surf, vy_surf, vz_surf, &
53  vx_base, vy_base, vz_base, &
54  temp_base_pmp
55 
56 allocate(zl_surf(n_surf), zs_surf(n_surf), &
57  accum_surf(n_surf), &
58  as_perp_surf(n_surf), snowfall_surf(n_surf), &
59  rainfall_surf(n_surf), runoff_surf(n_surf), &
60  vx_surf(n_surf), vy_surf(n_surf), vz_surf(n_surf), &
61  vx_base(n_surf), vy_base(n_surf), vz_base(n_surf), &
62  temp_base_pmp(n_surf))
63 
64 !-------- Determination of ice-core data --------
65 
66 do n=1, n_surf
67 
68 ! ------ Bedrock elevation
69 
70  field = zl
71  call borehole(field, x_surf(n), y_surf(n), dxi, deta, &
72  'grid', zl_surf(n))
73 
74 ! ------ Surface elevation
75 
76  field = zs
77  call borehole(field, x_surf(n), y_surf(n), dxi, deta, &
78  'grid', zs_surf(n))
79 
80 
81 ! ------ Accumulation
82 
83  field = accum
84  call borehole(field, x_surf(n), y_surf(n), dxi, deta, &
85  'grid', accum_surf(n))
86 
87 ! ------ Surface mass balance
88 
89  field = as_perp
90  call borehole(field, x_surf(n), y_surf(n), dxi, deta, &
91  'grid', as_perp_surf(n))
92 
93 ! ------ Snowfall
94 
95  field = snowfall
96  call borehole(field, x_surf(n), y_surf(n), dxi, deta, &
97  'grid', snowfall_surf(n))
98 
99 ! ------ Rainfall
100 
101  field = rainfall
102  call borehole(field, x_surf(n), y_surf(n), dxi, deta, &
103  'grid', rainfall_surf(n))
104 
105 ! ------ Runoff
106 
107  field = runoff
108  call borehole(field, x_surf(n), y_surf(n), dxi, deta, &
109  'grid', runoff_surf(n))
110 
111 ! ------ Surface velocities
112 
113  field = vx_s_g
114  call borehole(field, x_surf(n), y_surf(n), dxi, deta, &
115  'grid', vx_surf(n))
116 
117  field = vy_s_g
118  call borehole(field, x_surf(n), y_surf(n), dxi, deta, &
119  'grid', vy_surf(n))
120 
121  field = vz_s
122  call borehole(field, x_surf(n), y_surf(n), dxi, deta, &
123  'grid', vz_surf(n))
124 
125 ! ------ Basal velocities
126 
127  field = vx_b_g
128  call borehole(field, x_surf(n), y_surf(n), dxi, deta, &
129  'grid', vx_base(n))
130 
131  field = vy_b_g
132  call borehole(field, x_surf(n), y_surf(n), dxi, deta, &
133  'grid', vy_base(n))
134 
135  field = vz_b
136  call borehole(field, x_surf(n), y_surf(n), dxi, deta, &
137  'grid', vz_base(n))
138 
139 ! ------ Basal temperature relative to pressure melting point
140 
141  field = temph_b
142  call borehole(field, x_surf(n), y_surf(n), dxi, deta, &
143  'grid', temp_base_pmp(n))
144 
145 
146 end do
147 
148 ! ------ Conversion
149 
150 #if ( !defined(OUT_TIMES) || OUT_TIMES==1 )
151 time_val = time /year_sec ! s -> a
152 #elif OUT_TIMES == 2
153 time_val = (time+year_zero) /year_sec ! s -> a
154 #else
155 stop ' output5: OUT_TIMES must be either 1 or 2!'
156 #endif
157 
158 do n=1, n_surf
159  accum_surf(n) = accum_surf(n) *year_sec ! m/s -> m/a
160  as_perp_surf(n) = as_perp_surf(n) *year_sec ! m/s -> m/a
161  snowfall_surf(n) = snowfall_surf(n) *year_sec ! m/s -> m/a
162  rainfall_surf(n) = rainfall_surf(n) *year_sec ! m/s -> m/a
163  runoff_surf(n) = runoff_surf(n) *year_sec ! m/s -> m/a
164  vx_surf(n) = vx_surf(n) *year_sec ! m/s -> m/a
165  vy_surf(n) = vy_surf(n) *year_sec ! m/s -> m/a
166  vz_surf(n) = vz_surf(n) *year_sec ! m/s -> m/a
167  vx_base(n) = vx_base(n) *year_sec ! m/s -> m/a
168  vy_base(n) = vy_base(n) *year_sec ! m/s -> m/a
169  vz_base(n) = vz_base(n) *year_sec ! m/s -> m/a
170 end do
171 
172 !-------- Writing of data on file --------
173 
174 if (forcing_flag == 1) then
175  write(41,'(1pe13.6,2(1pe13.4))') time_val, delta_ts, z_sl
176  write(42,'(1pe13.6,2(1pe13.4))') time_val, delta_ts, z_sl
177  write(43,'(1pe13.6,2(1pe13.4))') time_val, delta_ts, z_sl
178  write(44,'(1pe13.6,2(1pe13.4))') time_val, delta_ts, z_sl
179  write(45,'(1pe13.6,2(1pe13.4))') time_val, delta_ts, z_sl
180  write(46,'(1pe13.6,2(1pe13.4))') time_val, delta_ts, z_sl
181  write(47,'(1pe13.6,2(1pe13.4))') time_val, delta_ts, z_sl
182  write(48,'(1pe13.6,2(1pe13.4))') time_val, delta_ts, z_sl
183  write(49,'(1pe13.6,2(1pe13.4))') time_val, delta_ts, z_sl
184  write(50,'(1pe13.6,2(1pe13.4))') time_val, delta_ts, z_sl
185  write(51,'(1pe13.6,2(1pe13.4))') time_val, delta_ts, z_sl
186  write(52,'(1pe13.6,2(1pe13.4))') time_val, delta_ts, z_sl
187  write(53,'(1pe13.6,2(1pe13.4))') time_val, delta_ts, z_sl
188  write(54,'(1pe13.6,2(1pe13.4))') time_val, delta_ts, z_sl
189 else if (forcing_flag == 2) then
190  write(41,'(1pe13.6,2(1pe13.4))') time_val, glac_index, z_sl
191  write(42,'(1pe13.6,2(1pe13.4))') time_val, glac_index, z_sl
192  write(43,'(1pe13.6,2(1pe13.4))') time_val, glac_index, z_sl
193  write(44,'(1pe13.6,2(1pe13.4))') time_val, glac_index, z_sl
194  write(45,'(1pe13.6,2(1pe13.4))') time_val, glac_index, z_sl
195  write(46,'(1pe13.6,2(1pe13.4))') time_val, glac_index, z_sl
196  write(47,'(1pe13.6,2(1pe13.4))') time_val, glac_index, z_sl
197  write(48,'(1pe13.6,2(1pe13.4))') time_val, glac_index, z_sl
198  write(49,'(1pe13.6,2(1pe13.4))') time_val, glac_index, z_sl
199  write(50,'(1pe13.6,2(1pe13.4))') time_val, glac_index, z_sl
200  write(51,'(1pe13.6,2(1pe13.4))') time_val, glac_index, z_sl
201  write(52,'(1pe13.6,2(1pe13.4))') time_val, glac_index, z_sl
202  write(53,'(1pe13.6,2(1pe13.4))') time_val, glac_index, z_sl
203  write(54,'(1pe13.6,2(1pe13.4))') time_val, glac_index, z_sl
204 end if
205 
206 do n=1, n_surf-1
207  write(41,'(1pe13.4)',advance='no') zl_surf(n)
208  write(42,'(1pe13.4)',advance='no') zs_surf(n)
209  write(43,'(1pe13.4)',advance='no') accum_surf(n)
210  write(44,'(1pe13.4)',advance='no') as_perp_surf(n)
211  write(45,'(1pe13.4)',advance='no') snowfall_surf(n)
212  write(46,'(1pe13.4)',advance='no') rainfall_surf(n)
213  write(47,'(1pe13.4)',advance='no') runoff_surf(n)
214  write(48,'(1pe13.4)',advance='no') vx_surf(n)
215  write(49,'(1pe13.4)',advance='no') vy_surf(n)
216  write(50,'(1pe13.4)',advance='no') vz_surf(n)
217  write(51,'(1pe13.4)',advance='no') vx_base(n)
218  write(52,'(1pe13.4)',advance='no') vy_base(n)
219  write(53,'(1pe13.4)',advance='no') vz_base(n)
220  write(54,'(1pe13.4)',advance='no') temp_base_pmp(n)
221 end do
222 
223 n=n_surf
224  write(41,'(1pe13.4)') zl_surf(n)
225  write(42,'(1pe13.4)') zs_surf(n)
226  write(43,'(1pe13.4)') accum_surf(n)
227  write(44,'(1pe13.4)') as_perp_surf(n)
228  write(45,'(1pe13.4)') snowfall_surf(n)
229  write(46,'(1pe13.4)') rainfall_surf(n)
230  write(47,'(1pe13.4)') runoff_surf(n)
231  write(48,'(1pe13.4)') vx_surf(n)
232  write(49,'(1pe13.4)') vy_surf(n)
233  write(50,'(1pe13.4)') vz_surf(n)
234  write(51,'(1pe13.4)') vx_base(n)
235  write(52,'(1pe13.4)') vy_base(n)
236  write(53,'(1pe13.4)') vz_base(n)
237  write(54,'(1pe13.4)') temp_base_pmp(n)
238 
239 deallocate(zl_surf, zs_surf, accum_surf, as_perp_surf, &
240  snowfall_surf, rainfall_surf, runoff_surf, &
241  vx_surf, vy_surf, vz_surf, &
242  vx_base, vy_base, vz_base,temp_base_pmp)
243 
244 end subroutine output5
245 !
subroutine borehole(field, x_pos, y_pos, dxi, deta, ch_grid, field_val)
Computation of an arbitrary field quantity for a given borehole position x_pos, y_pos by weighed aver...
Definition: borehole.F90:39
Declarations of kind types for SICOPOLIS.
Definition: sico_types.F90:35
Declarations of global variables for SICOPOLIS (for the ANT domain).
Definition: sico_vars.F90:35
subroutine output5(time, dxi, deta, delta_ts, glac_index, z_sl)
Writing of time-series data for all defined surface points on file in ASCII format. Modification of Tolly&#39;s output7 by Thorben Dunse.
Definition: output5.F90:37
Declarations of global variables for SICOPOLIS.