SICOPOLIS V3.1
 All Classes Files Functions Variables Macros
sicopolis.F90
Go to the documentation of this file.
1 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 !
3 ! Program : s i c o p o l i s . F 9 0
4 ! (SImulation COde for POLythermal Ice Sheets)
5 #define VERSION '3.1'
6 #define DATE '2013-09-10'
7 !
8 !> @mainpage
9 !!
10 !! @section Description
11 !!
12 !! SICOPOLIS (SImulation COde for POLythermal Ice Sheets) is a 3-d
13 !! dynamic/thermodynamic model which simulates the evolution of large ice
14 !! sheets. It was originally created as a part of the doctoral thesis by
15 !! Greve (1995) in a version for the Greenland ice sheet. Since then,
16 !! SICOPOLIS has been developed continuously and applied to problems of
17 !! past, present and future glaciation of Greenland, Antarctica, the
18 !! entire northern hemisphere and also the polar ice caps of the planet
19 !! Mars.
20 !!
21 !! The model is based on the shallow ice approximation for grounded ice
22 !! and the shallow shelf approximation for floating ice (e.g., Greve and
23 !! Blatter 2009). It is coded in Fortran 90 and uses finite-difference
24 !! discretization on a staggered grid, the velocity components being
25 !! taken between grid points. Its particularity is the detailed treatment
26 !! of basal temperate layers (that is, regions with a temperature at the
27 !! pressure melting point), which are positioned by fulfilling a
28 !! Stefan-type jump condition at the interface to the cold ice
29 !! regions. Within the temperate layers, the water content is computed,
30 !! and its influence on the ice viscosity is taken into account.
31 !!
32 !! Required model forcing:
33 !! @li Surface mass balance (precipitation, evaporation, runoff).
34 !! @li Mean annual air temperature above the ice.
35 !! @li Eustatic sea level.
36 !! @li Geothermal heat flux.
37 !!
38 !! Output (as functions of position and time):
39 !! @li Extent and thickness of the ice sheet.
40 !! @li Velocity field.
41 !! @li Temperature field.
42 !! @li Water-content field (temperate regions).
43 !! @li Age of the ice.
44 !! @li Isostatic displacement and temperature of the lithosphere.\n
45 !!
46 !! References:
47 !! @li Greve, R. 1995.\n
48 !! Thermomechanisches Verhalten polythermer Eisschilde - Theorie, Analytik,
49 !! Numerik.\n
50 !! Doctoral thesis, Department of Mechanics, Darmstadt University of
51 !! Technology, Germany, 226 pp.\n
52 !! ISBN: 3-8265-0999-4.
53 !! @li Greve, R. and H. Blatter. 2009.\n
54 !! Dynamics of Ice Sheets and Glaciers.\n
55 !! Springer, Berlin, Germany etc., 287 pp. ISBN: 978-3-642-03414-5.
56 !! @li SICOPOLIS website: http://sicopolis.greveweb.net/
57 !!
58 !! @section Copyright
59 !!
60 !! Copyright 2009-2013 Ralf Greve\n
61 !! (with contributions by Reinhard Calov, Thorben Dunse, Thomas Goelles,
62 !! Philipp Hancke, Nina Kirchner, Sascha Knell, Alex Robinson, Tatsuru Sato,
63 !! Malte Thoma)
64 !!
65 !! @section License
66 !!
67 !! SICOPOLIS is free software: you can redistribute it and/or modify
68 !! it under the terms of the GNU General Public License as published by
69 !! the Free Software Foundation, either version 3 of the License, or
70 !! (at your option) any later version.
71 !!
72 !! SICOPOLIS is distributed in the hope that it will be useful,
73 !! but WITHOUT ANY WARRANTY; without even the implied warranty of
74 !! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
75 !! GNU General Public License for more details.
76 !!
77 !! You should have received a copy of the GNU General Public License
78 !! along with SICOPOLIS. If not, see <http://www.gnu.org/licenses/>.
79 !!
80 !! @file
81 !!
82 !! Main program file of SICOPOLIS.
83 !!
84 !! @section Copyright
85 !!
86 !! Copyright 2009-2013 Ralf Greve
87 !!
88 !! @section License
89 !!
90 !! This file is part of SICOPOLIS.
91 !!
92 !! SICOPOLIS is free software: you can redistribute it and/or modify
93 !! it under the terms of the GNU General Public License as published by
94 !! the Free Software Foundation, either version 3 of the License, or
95 !! (at your option) any later version.
96 !!
97 !! SICOPOLIS is distributed in the hope that it will be useful,
98 !! but WITHOUT ANY WARRANTY; without even the implied warranty of
99 !! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
100 !! GNU General Public License for more details.
101 !!
102 !! You should have received a copy of the GNU General Public License
103 !! along with SICOPOLIS. If not, see <http://www.gnu.org/licenses/>.
104 !!
105 !<
106 ! *****************************************************************
107 ! Version history:
108 ! *****************************************************************
109 ! V1.0: Modular version of SICOPOLIS, applicable to any
110 ! ice sheet.
111 ! -----------------------------------------------------------
112 ! Based on sicopolis_nhem.F95 V4.0
113 ! (northern-hemisphere version of SICOPOLIS).
114 ! -----------------------------------------------------------------
115 ! V1.1: Optional new boundary conditions for the ice
116 ! surface at the margin of the computational domain
117 ! (parameter BC_MARG).
118 ! -----------------------------------------------------------------
119 ! V1.2: Optional first-order-upstream discretization
120 ! of vertical advection terms without artificial
121 ! diffusion in the age equation
122 ! (parameter ADV_VERT).
123 ! -----------------------------------------------------------
124 ! Optional exponential coupling between accumulation
125 ! and delta_ts (parameter ACCSURFACE==3).
126 ! -----------------------------------------------------------------
127 ! V1.3: New module for the southern hemisphere included
128 ! (parameter DOMAIN==4).
129 ! -----------------------------------------------------------
130 ! Improved reading of ice-core-temperature and
131 ! sea-level data, no longer restricted to the
132 ! interval from 250 kyr BP to today.
133 ! -----------------------------------------------------------
134 ! New model domain for Scandinavia included
135 ! (parameter DOMAIN==2).
136 ! -----------------------------------------------------------------
137 ! V1.4: New module for Antarctica included.
138 ! -----------------------------------------------------------
139 ! Bugfix in subroutines sico_init
140 ! (for grl, shem, nmars):
141 ! Parameter list in calls of subroutine boundary
142 ! for parameter ANF_DAT==3 corrected.
143 ! -----------------------------------------------------------
144 ! Mars module: Degree-day model replaced by simpler
145 ! accumulation-ablation parameterization.
146 ! -----------------------------------------------------------------
147 ! V2.0: All file extensions changed from '.F95' to '.F90'.
148 ! -----------------------------------------------------------
149 ! COMMON blocks in input file 'sico.common' replaced
150 ! by module 'sico_variables'.
151 ! -----------------------------------------------------------
152 ! Character variable 'runname' (name of current run)
153 ! can have an arbitrary length of less than
154 ! 100 characters.
155 ! -----------------------------------------------------------
156 ! Variables d_help_c, d_help_t, h_diff,
157 ! maske, maske_help, n_cts, n_cts_neu, kc_cts,
158 ! as_perp, temp_s
159 ! now declared globally in module 'sico_variables'.
160 ! -----------------------------------------------------------
161 ! The header file 'sicoheader.F95' does no longer
162 ! exist; however, 'sicopolis.F90' is compiled
163 ! directly.
164 ! -----------------------------------------------------------
165 ! Header file with simulation specifications must
166 ! be called 'sico_specs.h'.
167 ! -----------------------------------------------------------
168 ! Explicit definition of paths INPATH (for input
169 ! files), OUTPATH (for output files), ANFDATPATH
170 ! (for initial-value file) and Z_SLE_PATH (for
171 ! previously computed time-series file with
172 ! sea-level equivalents) in specifications file.
173 ! -----------------------------------------------------------
174 ! Parameter DOMAIN removed. Instead, the
175 ! computational domain is now defined by a macro
176 ! ANT, GRL, SCAND, NHEM, SHEM, EMTP2SGE or NMARS.
177 ! -----------------------------------------------------------
178 ! Parameter BC_MARG (see version 1.1) removed, back
179 ! to zero-thickness boundary condition at the margin
180 ! of the numerical domain as the only possibility.
181 ! -----------------------------------------------------------
182 ! Geothermal heat flux (Q_GEO), flow-enhancement factor
183 ! (ENH) and minimum ice thickness interpreted as glaciation
184 ! (H_MIN) now defined in header file sico_specs.h.
185 ! -----------------------------------------------------------
186 ! Physical parameters now read from a file by the
187 ! new subroutine 'phys_para'.
188 ! -----------------------------------------------------------
189 ! Indexing of arrays RF(T), KAPPA(T) and C(T)
190 ! changed such that the index T now corresponds to
191 ! the temperature in deg C.
192 ! -----------------------------------------------------------
193 ! Computation of the horizontal volume flux qx, qy
194 ! moved from subroutine 'calc_top' to subroutine
195 ! 'calc_vxy'.
196 ! -----------------------------------------------------------
197 ! Forcing quantities delta_ts and z_sl added to
198 ! the output for the time-slice files produced by
199 ! subroutine 'output1'.
200 ! -----------------------------------------------------------
201 ! Bugfix in subroutine 'calc_top':
202 ! In the diffusive smoothing scheme for zs_neu, the
203 ! denominator of the correction factor 'korrfakt'
204 ! can no longer become zero due to the insertion
205 ! of a volume offset eps_vol.
206 ! -----------------------------------------------------------------
207 ! V2.0.1: Maximum surface velocity now written to the time-series
208 ! files.
209 ! -----------------------------------------------------------------
210 ! V2.0.2: Module for the southern hemisphere deleted.
211 ! ---------------------------------------------------------
212 ! New Greenland topography data based on Letreguilly and
213 ! ETOPO5 with slightly smoothed relaxed bedrock used.
214 ! -----------------------------------------------------------------
215 ! V2.0.3: Limitation of the computed horizontal velocities to an
216 ! interval [-VH_MAX, VH_MAX] to be prescribed in the
217 ! header file.
218 ! -----------------------------------------------------------------
219 ! V2.0.4: Implementation of alternative flow laws
220 ! (Goldsby-Kohlstedt, Durham) in addition to the usual
221 ! Glen's flow law (parameter FLOW_LAW).
222 ! ---------------------------------------------------------
223 ! For the north polar cap of Mars, the average dust content
224 ! of the ice can be specified (parameter FRAC_DUST).
225 ! -----------------------------------------------------------------
226 ! V2.1: Spatially variable geothermal heat flux implemented, can
227 ! be chosen by new parameter Q_GEO_MOD.
228 ! -----------------------------------------------------------
229 ! Output of time-series file for ice-core locations
230 ! prescribed in subroutine sico_init implemented
231 ! (parameter OUTSER==3).
232 ! -----------------------------------------------------------
233 ! New module for the south-polar cap of Mars included
234 ! (macro SMARS).
235 ! -----------------------------------------------------------
236 ! For the Martian ice caps (NMARS, SMARS), the mass balance
237 ! is now converted from water equiv. to (ice+dust) equiv.
238 ! (previously the dust was ignored).
239 ! -----------------------------------------------------------------
240 ! V2.2: Sub-melt basal sliding implemented (parameter GAMMA_SLIDE
241 ! in phys_para file; 0: no sub-melt sliding).
242 ! -----------------------------------------------------------
243 ! Greenland:
244 ! - New Bamber topography implemented, horizontal resolution
245 ! 40, 20 or 10 km.
246 ! - Surface temperatures (mean annual, mean July)
247 ! parameterised by Ritz et al. (1997).
248 ! - Precipitation instead of solid accumulation used as
249 ! input.
250 ! - Reeh's degree day model with statistical fluctuations,
251 ! supplemented by explicit consideration of rainfall
252 ! and different ice/snow degree-day factors for warm
253 ! and cold conditions (parameters BETA1_LT_0, BETA1_HT_0,
254 ! BETA2_LT_0, BETA2_HT_0 in phys_para file).
255 ! - Net surface mass balance computed as precipitation minus
256 ! runoff (previously solid accumulation minus melting).
257 ! - Optional climate forcing by glacial index and prescribed
258 ! LGM anomalies for surface temperature and precipitation
259 ! (parameters TSURFACE==5 and ACCSURFACE==5).
260 ! -----------------------------------------------------------
261 ! Martian ice caps (NMARS, SMARS):
262 ! - Accumulation input either in water equiv.
263 ! or in (ice+dust) equiv. (parameter ACC_UNIT).
264 ! - Lower limit of -125/-128 deg C (sublimation temperature
265 ! of CO2 over the NPC/SPC) introduced for the ice surface
266 ! temperature.
267 ! -----------------------------------------------------------------
268 ! V2.3: Implementation of Bjoern Grieger's surface-temperature
269 ! parameterisation for the Martian ice caps (parameter
270 ! TSURFACE==6).
271 ! -----------------------------------------------------------
272 ! Greenland: Optional linear or exponential interpolation
273 ! function for glacial-index-based precipitation forcing
274 ! (parameter PRECIP_ANOM_INTERPOL).
275 ! -----------------------------------------------------------------
276 ! V2.4: Implementation of an elastic lithosphere (ELRA model),
277 ! based on Sascha Knell's diploma thesis
278 ! (parameter REBOUND==2)
279 ! -----------------------------------------------------------
280 ! Implementation of Bernd Muegge's conservative first-order
281 ! upstream scheme for the age equation
282 ! (parameters ADV_HOR==3 and ADV_VERT==3).
283 ! -----------------------------------------------------------
284 ! Antarctica, Scandinavia (Greenland see V2.2):
285 ! - Precipitation instead of solid accumulation used as
286 ! input.
287 ! - Reeh's degree day model with statistical fluctuations,
288 ! supplemented by explicit consideration of rainfall.
289 ! - Net surface mass balance computed as precipitation minus
290 ! runoff (previously solid accumulation minus melting).
291 ! - Optional climate forcing by glacial index and prescribed
292 ! LGM anomalies for surface temperature and precipitation
293 ! (parameters TSURFACE==5 and ACCSURFACE==5).
294 ! -----------------------------------------------------------
295 ! Northern-hemisphere module no longer up-to-date, therefore
296 ! deleted for the time being.
297 ! -----------------------------------------------------------
298 ! Compatibility check between version number of SICOPOLIS
299 ! and version number in header file.
300 ! -----------------------------------------------------------------
301 ! V2.4.1: Antarctica, Scandinavia, Greenland:
302 ! - Optional computation of surface melting (ablation)
303 ! by the positive-degree-day (PDD) method
304 ! or the linear-temperature-index (LTI) method
305 ! (parameter ABLSURFACE).
306 ! - Computation of positive degree days (subroutine pdd)
307 ! changed from annual sinus cycle of the surface
308 ! temperature to direct use of monthly-mean temperatures.
309 ! ---------------------------------------------------------
310 ! Scandinavia:
311 ! - Climate input (surface temperature, precipitation)
312 ! changed from seasonal to monthly-mean values.
313 ! - Optional horizontal resolutions 40, 20 or 10 km.
314 ! -----------------------------------------------------------------
315 ! V2.5: Basal sliding now computed in new subroutine calc_vxy_b.
316 ! Parameters of sliding law are set in the header file
317 ! (previously in phys_para file). New options: Weertman
318 ! exponents can be chosen freely, alternative use of
319 ! full or reduced pressure in sliding law.
320 ! -----------------------------------------------------------
321 ! Antarctica, Greenland, Scandinavia:
322 ! Two variants of PDD, either with instantaneous runoff of
323 ! rainfall (ABLSURFACE==1), or with contribution of rainfall
324 ! to formation of superimposed ice (ABLSURFACE==2).
325 ! Linear-temperature-index (LTI) method is now chosen by
326 ! ABLSURFACE==3.
327 ! -----------------------------------------------------------
328 ! North- and south-polar cap of Mars:
329 ! In addition to the density and the heat conductivity,
330 ! now the specific heat is also computed as a
331 ! volume-fraction-weighed mean of the ice and dust values,
332 ! respectively. Function c_val changed accordingly.
333 ! -----------------------------------------------------------
334 ! EISMINT Phase 2 Simplified Geometry Experiment:
335 ! Input file surf_para_emtp2sge.dat and subroutine surf_para
336 ! deleted. Parameters now defined in header file.
337 ! -----------------------------------------------------------
338 ! Minimum bedrock elevation for extent of marine ice
339 ! defined by new variable z_mar. Can be chosen as a constant
340 ! (MARGIN==2, old option), as proportional to the sea-level
341 ! stand (MARGIN==3, new option) or as a piecewise linear
342 ! function of sea level (MARGIN==4, new option; as proposed
343 ! by Zweck and Huybrechts, 2005).
344 ! -----------------------------------------------------------------
345 ! V2.6: New module for ISMIP HEINO included (defined by macro
346 ! HEINO).
347 ! -----------------------------------------------------------
348 ! Additional output of the basal frictional heating in the
349 ! time-series file for the ice-core locations.
350 ! -----------------------------------------------------------
351 ! All constants throughout the program defined consistently
352 ! as double-precision constants.
353 ! -----------------------------------------------------------
354 ! New global parameters pi, pi_inv, pi_180, pi_180_inv, eps.
355 ! -----------------------------------------------------------------
356 ! V2.7: Special treatment for the chasms of the Martian NPC (Chasma
357 ! Borealis) and SPC (Chasma Australis) implemented (optional,
358 ! parameter CHASM==2). Chasm regions defined in additional
359 ! mask file -> larger geothermal heat flux and wind erosion
360 ! rate active within prescribed time interval (specified in
361 ! header file).
362 ! -----------------------------------------------------------
363 ! ISMIP HEINO: Time-series output for the sediment region
364 ! ("Hudson Bay, Hudson Strait") in new file runname.sed.
365 ! -----------------------------------------------------------
366 ! Improved restart: Time derivatives dzs_dtau, dzm_dtau,
367 ! dzb_dtau, dH_c_dtau and dH_t_dtau written to time-slice
368 ! files and read by restart routine topography3. Further,
369 ! Q_b_tot is computed as the sum of Q_bm and Q_tld in
370 ! initialization routine sico_init.
371 ! -----------------------------------------------------------
372 ! In addition to Q_b_tot (formerly called Q_mean), now also
373 ! limitations of Q_bm and Q_tld with the same lower and upper
374 ! limits, QB_MIN and QB_MAX, respectively.
375 ! -----------------------------------------------------------
376 ! In subroutine output2 Reinhard Calov's method for computing
377 ! the ice equivalent of the water volume below the sea level
378 ! (V_ges_redu) implemented.
379 ! -----------------------------------------------------------------
380 ! V2.7.1: Martian ice caps (NMARS, SMARS):
381 ! New topography inputs based on the MOLA MEGDR data with
382 ! 64 pix/deg resolution. Optional horizontal resolutions
383 ! 20, 10 or 5 km.
384 ! -----------------------------------------------------------------
385 ! V2.7.2: x and y coordinates of the origin point (i,j) = (0,0)
386 ! now defined in header file as X0 and Y0.
387 ! ---------------------------------------------------------
388 ! Optional computation of the evolution of the free
389 ! surface as usual (parameter ZS_EVOL==1),
390 ! or keeping the free surface fixed on the initial
391 ! topography (parameter ZS_EVOL==0).
392 ! ---------------------------------------------------------
393 ! Greenland:
394 ! Update of the ice-core positions according to Dahl-Jensen
395 ! (pers. comm. 2006) and inclusion of the planned NEEM
396 ! core.
397 ! ---------------------------------------------------------
398 ! Martian ice caps (NMARS, SMARS):
399 ! New version of module instemp for the LIT scheme
400 ! implemented.
401 ! -----------------------------------------------------------------
402 ! V2.8: Greenland:
403 ! Optional special sliding law for the North-East Greenland
404 ! Ice Stream NEGIS (parameter ICE_STREAM==2).
405 ! Surface meltwater effect on basal sliding implemented.
406 ! -----------------------------------------------------------
407 ! ISMIP HEINO:
408 ! Optional 25-km resolution implemented (in addition to the
409 ! standard resolution of 50 km).
410 ! -----------------------------------------------------------
411 ! Antarctica:
412 ! Re-formatting and re-naming of the input data (now same
413 ! style and units like for Greenland). Topography input newly
414 ! created from RAMPDEM V2 and BEDMAP data-sets, with an
415 ! additional 20-km resolution implemented.
416 ! -----------------------------------------------------------------
417 ! V2.8.1: Northern-hemisphere module reintroduced, topography
418 ! files newly created for horizontal resolutions of
419 ! 80, 40 and 20 km.
420 ! ---------------------------------------------------------
421 ! Explicit introduction of the evaporation (variable evap).
422 ! In the modules for the terrestrial ice sheets, evap is
423 ! set to zero, whereas in the modules for the Martian
424 ! ice caps, evap accounts for the entire ablation.
425 ! ---------------------------------------------------------
426 ! ISMIP HEINO:
427 ! Introduction of the option ANF_DAT==1, which defines the
428 ! initial topography as a thin ice layer (with a thickness
429 ! of 2*H_MIN) everywhere on the land area.
430 ! -----------------------------------------------------------------
431 ! V2.9: New module for Tibet included (defined by macro TIBET).
432 ! -----------------------------------------------------------
433 ! Greenland:
434 ! Parameterization for the surface meltwater effect on basal
435 ! sliding changed; additional dependence on ice thickness
436 ! and possible nonlinear dependence on runoff.
437 ! -----------------------------------------------------------
438 ! Topography files (for zs, zb, zb0, mask) can now be
439 ! specified in the header file.
440 ! -----------------------------------------------------------------
441 ! V3.0: Handling of ice shelf and marine ice dynamics.
442 ! -----------------------------------------------------------
443 ! SeaRISE set-up implemented.
444 ! -----------------------------------------------------------
445 ! Changing water load now considered for the LLRA model
446 ! (REBOUND==1) in the same way as for the ELRA model.
447 ! -----------------------------------------------------------
448 ! Optional output of time-slice files in NetCDF format
449 ! (controlled by parameter NETCDF).
450 ! -----------------------------------------------------------
451 ! Name of the physical-parameter file is now specified in
452 ! the header file.
453 ! -----------------------------------------------------------
454 ! New module 'sico_types' for declarations of kind types
455 ! introduced.
456 ! -----------------------------------------------------------
457 ! Subroutine 'calc_top':
458 ! Diffusive smoothing scheme for zs_neu deleted.
459 ! -----------------------------------------------------------
460 ! Introduction of module Austfonna (ASF) available at 1, 2
461 ! and 4 km horizontal resolution - Thorben Dunse.
462 ! Output5.F90 writes time-series data at specific surface
463 ! points.
464 ! -----------------------------------------------------------
465 ! Stereographic projection changed from a spherical planet
466 ! to an ellipsoidal planet.
467 ! -----------------------------------------------------------------
468 ! V3.1: Discretisation of the horizontal and vertical advection
469 ! terms in the 3-d temperature and age equations:
470 ! Improved upwind scheme implemented that uses interpolated
471 ! velocities on the main grid (ADV_HOR==3, ADV_VERT==3).
472 ! -----------------------------------------------------------
473 ! Slightly improved boundary and transition conditions for
474 ! the computation of the age.
475 ! -----------------------------------------------------------
476 ! Index order of 2-d and 3-d arrays in the time-slice output
477 ! files *.nc (netCDF) and *.erg (native binary) changed:
478 ! (j,i) -> (i,j), (kc/t/r,j,i) -> (i,j,kc/t/r).
479 ! Output time units changed from seconds to years.
480 ! -----------------------------------------------------------
481 ! Routines that use Lis changed such that they are compatible
482 ! with Lis version 1.4.13 and newer.
483 ! -----------------------------------------------------------
484 ! Solvers for systems of linear equations assembled in the
485 ! new module sico_sle_solvers.
486 ! -----------------------------------------------------------
487 ! All subroutines and functions are now included in the main
488 ! program sicopolis following a 'contains' statement.
489 ! -----------------------------------------------------------
490 ! Intent attributes inserted in all subroutines and
491 ! functions.
492 ! -----------------------------------------------------------
493 ! New topography input data for Antarctica (BEDMAP2) and
494 ! Greenland (Bamber Version 2).
495 ! -----------------------------------------------------------
496 ! New input data for the geothermal heat flux for Antarctica
497 ! and Greenland [Michael Purucker (pers. comm. 2012), based
498 ! on Fox Maule et al., (2005)].
499 ! *****************************************************************
500 !
501 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
502 
503 !-------- Include specification header --------
504 
505 #include "sico_specs.h"
506 
507 !-------- Include kind-type and global-variable modules --------
508 
509 #include "subroutines/general/sico_types.F90"
510 #include "subroutines/general/sico_variables.F90"
511 
512 !-------- Include module that contains the solvers for systems
513 ! of linear equations --------
514 
515 #include "subroutines/general/sico_sle_solvers.F90"
516 
517 !-------- Include NetCDF error capturing module --------
518 
519 #if (NETCDF > 1)
520 #include "subroutines/general/nc_check.F90"
521 #endif
522 
523 !-------- Include Bjoern Grieger's module for the surface-temperature
524 ! parameterisation for the Martian ice caps --------
525 
526 #if defined(NMARS)
527 #include "subroutines/nmars/instemp.f90"
528 #elif defined(SMARS)
529 #include "subroutines/smars/instemp.f90"
530 #endif
531 
532 !-------------------------------------------------------------------------------
533 !> Main program of SICOPOLIS.
534 !<------------------------------------------------------------------------------
535 program sicopolis
536 
537 !-------- Description of variables declared locally --------
538 
539 ! i : Index for coordinate xi
540 ! j : Index for coordinate eta
541 ! kc : Index for coordinate zeta_c
542 ! kt : Index for coordinate zeta_t
543 ! kr : Index for coordinate zeta_r
544 ! (in the bedrock)
545 ! ios : IOSTAT variable for files
546 ! itercount : Counter for the time steps
547 ! ndat2d/3d : Counters for the time-slice files
548 ! n_output : For OUTPUT==2 number of time-slice files
549 ! to be produced
550 ! dH_t_smooth(j,i) : Amount of smoothing of H_t
551 ! delta_ts : Time-dependent surface-temperature variation
552 ! glac_index : Time-dependent glacial index
553 ! forcing_flag : 1 - forcing by delta_ts, 2 - forcing by glac_index
554 ! z_sl : Sea level
555 ! dzsl_dtau : Derivative of z_sl by tau (time)
556 ! precip_mam_present(j,i) : Measured present spring precipitation
557 ! precip_jja_present(j,i) : Measured present summer precipitation
558 ! precip_son_present(j,i) : Measured present autumn precipitation
559 ! precip_djf_present(j,i) : Measured present winter precipitation
560 ! temp_mam_present(j,i) : Present spring surface temperature
561 ! from data
562 ! temp_jja_present(j,i) : Present summer surface temperature
563 ! from data
564 ! temp_son_present(j,i) : Present autumn surface temperature
565 ! from data
566 ! temp_djf_present(j,i) : Present winter surface temperature
567 ! from data
568 ! mean_accum : Mean present accumulation over land
569 ! mean_accum_inv : Inverse of mean_accum
570 ! time : Current time of simulation
571 ! time_init : Initial time of simulation
572 ! time_end : Final time of simulation
573 ! dtime : Time step for computation of velocity and
574 ! topography
575 ! dtime_temp : Time step for computation of temperature,
576 ! water content and age of the ice
577 ! dtime_wss : Time step for computation of isostatic steady-state
578 ! displacement of the lithosphere (ELRA model)
579 ! dtime_out : Time step for output of time-slice files
580 ! dtime_ser : Time step for writing of data in time-series
581 ! file
582 ! time_output(n) : For OUTPUT==2 specified times for output of
583 ! time-slice files
584 ! (.)0 : Quantity (.) before its conversion to MKS units
585 ! dxi : Grid spacing in x-direction
586 ! deta : Grid spacing in y-direction
587 ! dzeta_c : Grid spacing in z-direction in cold ice
588 ! (in sigma-coordinate zeta_c)
589 ! dzeta_t : Grid spacing in z-direction in temperate ice
590 ! (in sigma-coordinate zeta_t)
591 ! dzeta_r : Grid spacing in z-direction in the bedrock
592 ! (in sigma-coordinate zeta_r)
593 ! runname : Name of simulation
594 ! anfdatname : Name of initial-value file
595 ! (only for ANF_DAT==3)
596 ! datname : Auxiliary string for generation of file names
597 
598 !-------- Declaration of variables --------
599 
600 use sico_types
601 use sico_variables
602 
603 implicit none
604 
605 integer(i4b) :: ndat2d, ndat3d
606 integer(i4b) :: n_output
607 integer(i4b), dimension((IMAX+1)*(JMAX+1)) :: ii, jj
608 integer(i4b), dimension(0:JMAX,0:IMAX) :: nn
609 real(dp) :: delta_ts, glac_index
610 real(dp) :: mean_accum, mean_accum_inv
611 real(dp) :: dtime, dtime_temp, dtime_wss, dtime_out, dtime_ser
612 real(dp) :: time, time_init, time_end
613 real(dp), dimension(100) :: time_output
614 real(dp) :: dxi, deta, dzeta_c, dzeta_t, dzeta_r
615 real(dp) :: z_sl, dzsl_dtau, z_mar
616 character(len=100) :: runname
617 
618 !-------- Initialisations --------
619 
620 call sico_init(delta_ts, glac_index, &
621  mean_accum, mean_accum_inv, &
622  dtime, dtime_temp, dtime_wss, dtime_out, dtime_ser, &
623  time, time_init, time_end, time_output, &
624  dxi, deta, dzeta_c, dzeta_t, dzeta_r, &
625  z_sl, dzsl_dtau, z_mar, &
626  ii, jj, nn, &
627  ndat2d, ndat3d, n_output, &
628  runname)
629 
630 !-------- Main loop --------
631 
632 call sico_main_loop(delta_ts, glac_index, &
633  mean_accum, mean_accum_inv, &
634  dtime, dtime_temp, dtime_wss, dtime_out, dtime_ser, &
635  time, time_init, time_end, time_output, &
636  dxi, deta, dzeta_c, dzeta_t, dzeta_r, &
637  z_sl, dzsl_dtau, z_mar, &
638  ii, jj, nn, &
639  ndat2d, ndat3d, n_output, &
640  runname)
641 
642 !-------- Endings --------
643 
644 call sico_end()
645 
646 !-------- Include subroutines --------
647 
648 contains
649 
650 #if defined(NHEM)
651 #include "subroutines/nhem/sico_init.F90"
652 #elif defined(SCAND)
653 #include "subroutines/scand/sico_init.F90"
654 #elif defined(GRL)
655 #include "subroutines/grl/sico_init.F90"
656 #elif defined(NMARS)
657 #include "subroutines/nmars/sico_init.F90"
658 #elif defined(SMARS)
659 #include "subroutines/smars/sico_init.F90"
660 #elif defined(EMTP2SGE)
661 #include "subroutines/emtp2sge/sico_init.F90"
662 #elif defined(HEINO)
663 #include "subroutines/heino/sico_init.F90"
664 #elif defined(ANT)
665 #include "subroutines/ant/sico_init.F90"
666 #elif defined(TIBET)
667 #include "subroutines/tibet/sico_init.F90"
668 #elif defined(ASF)
669 #include "subroutines/asf/sico_init.F90"
670 #endif
671 
672 #include "subroutines/general/sico_main_loop.F90"
673 #include "subroutines/general/sico_end.F90"
674 
675 #if defined(NHEM)
676 #include "subroutines/nhem/phys_para.F90"
677 #elif defined(SCAND)
678 #include "subroutines/scand/phys_para.F90"
679 #elif defined(GRL)
680 #include "subroutines/grl/phys_para.F90"
681 #elif defined(NMARS)
682 #include "subroutines/nmars/phys_para.F90"
683 #elif defined(SMARS)
684 #include "subroutines/smars/phys_para.F90"
685 #elif defined(EMTP2SGE)
686 #include "subroutines/emtp2sge/phys_para.F90"
687 #elif defined(HEINO)
688 #include "subroutines/heino/phys_para.F90"
689 #elif defined(ANT)
690 #include "subroutines/ant/phys_para.F90"
691 #elif defined(TIBET)
692 #include "subroutines/tibet/phys_para.F90"
693 #elif defined(ASF)
694 #include "subroutines/asf/phys_para.F90"
695 #endif
696 
697 #include "subroutines/general/read_phys_para_value.F90"
698 #include "subroutines/general/read_kei.F90"
699 
700 #if defined(NHEM)
701 #include "subroutines/nhem/topography2.F90"
702 #include "subroutines/nhem/topography3.F90"
703 #if (NETCDF > 1)
704 #include "subroutines/nhem/topography3_nc.F90"
705 #endif
706 #elif defined(SCAND)
707 #include "subroutines/scand/topography2.F90"
708 #include "subroutines/scand/topography3.F90"
709 #if (NETCDF > 1)
710 #include "subroutines/scand/topography3_nc.F90"
711 #endif
712 #elif defined(GRL)
713 #include "subroutines/grl/topography1.F90"
714 #include "subroutines/grl/topography2.F90"
715 #include "subroutines/grl/topography3.F90"
716 #if (NETCDF > 1)
717 #include "subroutines/grl/topography3_nc.F90"
718 #if (ZS_EVOL==2)
719 #include "subroutines/grl/read_target_topo_nc.F90"
720 #endif
721 #endif
722 #elif defined(NMARS)
723 #include "subroutines/nmars/topography1.F90"
724 #include "subroutines/nmars/topography2.F90"
725 #include "subroutines/nmars/topography3.F90"
726 #if (NETCDF > 1)
727 #include "subroutines/nmars/topography3_nc.F90"
728 #endif
729 #elif defined(SMARS)
730 #include "subroutines/smars/topography1.F90"
731 #include "subroutines/smars/topography2.F90"
732 #include "subroutines/smars/topography3.F90"
733 #if (NETCDF > 1)
734 #include "subroutines/smars/topography3_nc.F90"
735 #endif
736 #elif defined(EMTP2SGE)
737 #include "subroutines/emtp2sge/topography2.F90"
738 #include "subroutines/emtp2sge/topography3.F90"
739 #if (NETCDF > 1)
740 #include "subroutines/emtp2sge/topography3_nc.F90"
741 #endif
742 #elif defined(HEINO)
743 #include "subroutines/heino/topography1.F90"
744 #include "subroutines/heino/topography2.F90"
745 #include "subroutines/heino/topography3.F90"
746 #if (NETCDF > 1)
747 #include "subroutines/heino/topography3_nc.F90"
748 #endif
749 #elif defined(ANT)
750 #include "subroutines/ant/topography1.F90"
751 #include "subroutines/ant/topography2.F90"
752 #include "subroutines/ant/topography3.F90"
753 #if (NETCDF > 1)
754 #include "subroutines/ant/topography3_nc.F90"
755 #if (ZS_EVOL==2)
756 #include "subroutines/ant/read_target_topo_nc.F90"
757 #endif
758 #endif
759 #elif defined(TIBET)
760 #include "subroutines/tibet/topography2.F90"
761 #include "subroutines/tibet/topography3.F90"
762 #if (NETCDF > 1)
763 #include "subroutines/tibet/topography3_nc.F90"
764 #endif
765 #elif defined(ASF)
766 #include "subroutines/asf/topography1.F90"
767 #include "subroutines/asf/topography2.F90"
768 #include "subroutines/asf/topography3.F90"
769 #if (NETCDF > 1)
770 #include "subroutines/asf/topography3_nc.F90"
771 #endif
772 #endif
773 
774 #if defined(NHEM)
775 #include "subroutines/nhem/boundary.F90"
776 #elif defined(SCAND)
777 #include "subroutines/scand/boundary.F90"
778 #elif defined(GRL)
779 #include "subroutines/grl/boundary.F90"
780 #elif defined(NMARS)
781 #include "subroutines/nmars/boundary.F90"
782 #elif defined(SMARS)
783 #include "subroutines/smars/boundary.F90"
784 #elif defined(EMTP2SGE)
785 #include "subroutines/emtp2sge/boundary.F90"
786 #elif defined(HEINO)
787 #include "subroutines/heino/boundary.F90"
788 #elif defined(ANT)
789 #include "subroutines/ant/boundary.F90"
790 #elif defined(TIBET)
791 #include "subroutines/tibet/boundary.F90"
792 #elif defined(ASF)
793 #include "subroutines/asf/boundary.F90"
794 #endif
795 
796 #include "subroutines/general/mask_update.F90"
797 #include "subroutines/general/pdd.F90"
798 #include "subroutines/general/erfcc.F90"
799 #include "subroutines/general/calc_temp_poly.F90"
800 #include "subroutines/general/calc_temp_cold.F90"
801 #include "subroutines/general/calc_temp1.F90"
802 #include "subroutines/general/calc_temp2.F90"
803 #include "subroutines/general/calc_temp3.F90"
804 #include "subroutines/general/calc_temp_r.F90"
805 #include "subroutines/general/shift_cts_upward.F90"
806 #include "subroutines/general/shift_cts_downward.F90"
807 #include "subroutines/general/calc_enhance.F90"
808 #include "subroutines/general/calc_vxy_b_sia.F90"
809 #include "subroutines/general/calc_vxy_sia.F90"
810 #include "subroutines/general/calc_vz_sia.F90"
811 #if MARGIN==3
812 #include "subroutines/general/calc_temp_ssa.F90"
813 #include "subroutines/general/calc_vxy_ssa.F90"
814 #include "subroutines/general/calc_vxy_ssa_matrix.F90"
815 #include "subroutines/general/calc_vis_ssa.F90"
816 #include "subroutines/general/calc_vz_ssa.F90"
817 #include "subroutines/general/viscosity.F90"
818 #endif
819 #include "subroutines/general/calc_qbm.F90"
820 #include "subroutines/general/calc_water_bas.F90"
821 #include "subroutines/general/calc_top.F90"
822 #include "subroutines/general/calc_elra.F90"
823 #include "subroutines/general/topograd_1.F90"
824 #include "subroutines/general/topograd_2.F90"
825 #include "subroutines/general/calc_temp_melt.F90"
826 #include "subroutines/general/calc_temp_bas.F90"
827 #include "subroutines/general/creep.F90"
828 #include "subroutines/general/ratefac.F90"
829 #include "subroutines/general/ratefac_t.F90"
830 #include "subroutines/general/kappa_val.F90"
831 #include "subroutines/general/c_val.F90"
832 #include "subroutines/general/metric.F90"
833 #include "subroutines/general/geo_coord.F90"
834 #include "subroutines/general/num_coord.F90"
835 #include "subroutines/general/output1.F90"
836 #include "subroutines/general/output2.F90"
837 #include "subroutines/general/output3.F90"
838 #include "subroutines/general/output4.F90"
839 
840 #if defined(ASF)
841 #include "subroutines/asf/output5.F90"
842 #endif
843 
844 #if (NETCDF > 1)
845 #include "subroutines/general/output_nc.F90"
846 #endif
847 
848 #include "subroutines/general/borehole.F90"
849 
850 !-------- End of program --------
851 
852 end program sicopolis
853 
854 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
855 ! End of sicopolis.F90
856 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
857 !