SICOPOLIS V3.0
 All Classes Files Functions Variables Macros
boundary.F90
Go to the documentation of this file.
1 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 !
3 ! Subroutine : b o u n d a r y
4 !
5 !> @file
6 !!
7 !! Computation of the surface temperature (must be less than 0 deg C!)
8 !! and of the accumulation-ablation function.
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 !> Computation of the surface temperature (must be less than 0 deg C!)
35 !! and of the accumulation-ablation function.
36 !<------------------------------------------------------------------------------
37 subroutine boundary(time, dtime, dxi, deta, &
38  delta_ts, glac_index, z_sl, dzsl_dtau, z_mar)
39 
40 use sico_types
42 
43 implicit none
44 
45 real(dp), intent(in) :: time, dtime, dxi, deta
46 
47 real(dp), intent(out) :: delta_ts, glac_index, dzsl_dtau, z_mar
48 real(dp), intent(inout) :: z_sl
49 
50 ! Further return variables
51 ! (defined as global variables in module sico_variables):
52 !
53 ! accum(j,i), as_perp(j,i), temp_s(j,i)
54 
55 integer(i2b) :: mask_update
56 integer(i4b) :: i, j
57 integer(i4b) :: i_gr, i_kl
58 real(dp) :: z_sl_old
59 real(dp) :: z_sl_min, t1, t2, t3, t4, t5, t6
60 real(dp) :: time_gr, time_kl
61 real(dp), dimension(0:JMAX,0:IMAX) :: dist
62 real(dp) :: rad_inv
63 logical, dimension(0:JMAX,0:IMAX) :: check_point
64 
65 !-------- Initialization of intent(out) variables --------
66 
67 z_sl_old = z_sl
68 
69 delta_ts = 0.0_dp
70 glac_index = 0.0_dp
71 z_sl = 0.0_dp
72 dzsl_dtau = 0.0_dp
73 z_mar = 0.0_dp
74 
75 !-------- Surface-temperature deviation from present values --------
76 
77 #if TSURFACE==1
78 delta_ts = delta_ts0
79 ! ! Steady state with prescribed constant
80 ! ! air-temperature deviation
81 #elif TSURFACE==3
82 delta_ts = sine_amplit &
83  *cos(2.0_dp*pi*time/(sine_period*year_sec)) &
84  -sine_amplit
85 ! ! Sinusoidal air-temperature forcing
86 #elif TSURFACE==4
87 
88 ! ------ delta_ts from the GRIP record
89 
90 if (time/year_sec.lt.real(grip_time_min,dp)) then
91  delta_ts = griptemp(0)
92 else if (time/year_sec.lt.real(grip_time_max,dp)) then
93 
94  i_kl = floor(((time/year_sec) &
95  -real(grip_time_min,dp))/real(grip_time_stp,dp))
96  i_kl = max(i_kl, 0)
97 
98  i_gr = ceiling(((time/year_sec) &
99  -real(grip_time_min,dp))/real(grip_time_stp,dp))
100  i_gr = min(i_gr, ndata_grip)
101 
102  if (i_kl.eq.i_gr) then
103 
104  delta_ts = griptemp(i_kl)
105 
106  else
107 
108  time_kl = (grip_time_min + i_kl*grip_time_stp) *year_sec
109  time_gr = (grip_time_min + i_gr*grip_time_stp) *year_sec
110 
111  delta_ts = griptemp(i_kl) &
112  +(griptemp(i_gr)-griptemp(i_kl)) &
113  *(time-time_kl)/(time_gr-time_kl)
114  ! linear interpolation of the ice-core data
115 
116  end if
117 
118 else
119  delta_ts = griptemp(ndata_grip)
120 end if
121 
122 delta_ts = delta_ts * grip_temp_fact
123 ! ! modification by constant factor
124 
125 #elif TSURFACE==5
126 ! Enter here delta_ts scenario:
127 
128 #endif
129 
130 !-------- Sea level --------
131 
132 #if SEA_LEVEL==1
133 ! ------ constant sea level
134 z_sl = z_sl0
135 
136 #elif SEA_LEVEL==2
137 ! ------ saw-tooth-shaped palaeoclimatic sea-level forcing
138 
139 z_sl_min = -130.0_dp
140 
141 t1 = -250000.0_dp *year_sec
142 t2 = -140000.0_dp *year_sec
143 t3 = -125000.0_dp *year_sec
144 t4 = -21000.0_dp *year_sec
145 t5 = -8000.0_dp *year_sec
146 t6 = 0.0_dp *year_sec
147 
148 if (time.lt.t1) then
149  z_sl = 0.0_dp
150 else if (time.lt.t2) then
151  z_sl = z_sl_min*(time-t1)/(t2-t1)
152 else if (time.lt.t3) then
153  z_sl = -z_sl_min*(time-t3)/(t3-t2)
154 else if (time.lt.t4) then
155  z_sl = z_sl_min*(time-t3)/(t4-t3)
156 else if (time.lt.t5) then
157  z_sl = -z_sl_min*(time-t5)/(t5-t4)
158 else if (time.lt.t6) then
159  z_sl = 0.0_dp
160 else
161  z_sl = 0.0_dp
162 end if
163 
164 #elif SEA_LEVEL==3
165 
166 ! ------ z_sl from the SPECMAP record
167 
168 if (time/year_sec.lt.real(specmap_time_min,dp)) then
169  z_sl = specmap_zsl(0)
170 else if (time/year_sec.lt.real(specmap_time_max,dp)) then
171 
172  i_kl = floor(((time/year_sec) &
173  -real(specmap_time_min,dp))/real(specmap_time_stp,dp))
174  i_kl = max(i_kl, 0)
175 
176  i_gr = ceiling(((time/year_sec) &
177  -real(specmap_time_min,dp))/real(specmap_time_stp,dp))
178  i_gr = min(i_gr, ndata_specmap)
179 
180  if (i_kl.eq.i_gr) then
181 
182  z_sl = specmap_zsl(i_kl)
183 
184  else
185 
186  time_kl = (specmap_time_min + i_kl*specmap_time_stp) *year_sec
187  time_gr = (specmap_time_min + i_gr*specmap_time_stp) *year_sec
188 
189  z_sl = specmap_zsl(i_kl) &
190  +(specmap_zsl(i_gr)-specmap_zsl(i_kl)) &
191  *(time-time_kl)/(time_gr-time_kl)
192  ! linear interpolation of the sea-level data
193 
194  end if
195 
196 else
197  z_sl = specmap_zsl(ndata_specmap)
198 end if
199 
200 #endif
201 
202 ! ------ Time derivative of the sea level
203 
204 if ( z_sl_old > -999999.9_dp ) then
205  dzsl_dtau = (z_sl-z_sl_old)/dtime
206 else ! only dummy value for z_sl_old available
207  dzsl_dtau = 0.0_dp
208 end if
209 
210 ! ------ Minimum bedrock elevation for extent of marine ice
211 
212 #if MARGIN==2
213 
214 #if ( MARINE_ICE_CALVING==2 || MARINE_ICE_CALVING==3 )
215 z_mar = z_mar
216 #elif ( MARINE_ICE_CALVING==4 || MARINE_ICE_CALVING==5 )
217 z_mar = fact_z_mar*z_sl
218 #elif ( MARINE_ICE_CALVING==6 || MARINE_ICE_CALVING==7 )
219 if (z_sl >= -80.0_dp) then
220  z_mar = 2.5_dp*z_sl
221 else
222  z_mar = 10.25_dp*(z_sl+80.0_dp)-200.0_dp
223 end if
224 z_mar = fact_z_mar*z_mar
225 #endif
226 
227 #endif
228 
229 ! ------ Update of the mask according to the sea level
230 
231 ! ---- Check all sea and floating-ice points and their direct
232 ! neighbours
233 
234 do i=0, imax
235 do j=0, jmax
236  check_point(j,i) = .false.
237 end do
238 end do
239 
240 do i=1, imax-1
241 do j=1, jmax-1
242  if (maske(j,i).ge.2) then
243  check_point(j ,i ) = .true.
244  check_point(j ,i+1) = .true.
245  check_point(j ,i-1) = .true.
246  check_point(j+1,i ) = .true.
247  check_point(j-1,i ) = .true.
248  end if
249 end do
250 end do
251 
252 do i=1, imax-1
253 do j=1, jmax-1
254  if (check_point(j,i)) then
255  maske_neu(j,i) = mask_update(z_sl, i, j)
256  end if
257 end do
258 end do
259 
260 ! ---- Assign new values of the mask
261 
262 do i=1, imax-1
263 do j=1, jmax-1
264  if (check_point(j,i)) then
265  maske(j,i) = maske_neu(j,i)
266  end if
267 end do
268 end do
269 
270 !-------- Surface air temperature and accumulation-ablation function --------
271 
272 do i=0, imax
273 do j=0, jmax
274  dist(j,i) = sqrt( (xi(i)-x_hat)**2 + (eta(j)-y_hat)**2 )
275 end do
276 end do
277 
278 rad_inv = 1.0_dp/rad
279 
280 do i=0, imax
281 do j=0, jmax
282 
283  temp_s(j,i) = temp_min + s_t*dist(j,i)**3
284  temp_s(j,i) = temp_s(j,i) + delta_ts
285  ! Correction with temperature deviation delta_ts
286  if (temp_s(j,i) > -0.001_dp) temp_s(j,i) = -0.001_dp
287  ! Cut-off of positive air temperatures
288 
289  accum_present(j,i) = b_min + (b_max-b_min)*rad_inv*dist(j,i)
290  accum(j,i) = accum_present(j,i)
291 
292  as_perp(j,i) = accum(j,i)
293 
294 end do
295 end do
296 
297 end subroutine boundary
298 !