7 !! Initialisations for SICOPOLIS.
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 !> Initialisations for SICOPOLIS.
34 !<------------------------------------------------------------------------------
36 sum_accum, mean_accum, mean_accum_inv, &
37 dtime, dtime_temp, dtime_wss, dtime_out, dtime_ser, &
38 time, time_init, time_end, time_output, &
39 dxi, deta, dzeta_c, dzeta_t, dzeta_r, &
40 z_sl, dzsl_dtau, z_mar, &
42 ndat2d, ndat3d, n_output, &
52 integer(i4b) :: i, j, kc, kt, kr, m, n, ir, jr
53 integer(i4b) :: ios, ios1, ios2, ios3, ios4
54 integer(i4b) :: ndat2d, ndat3d
55 integer(i4b) :: n_output
57 integer(i4b) :: ii((imax+1)*(jmax+1)), jj((imax+1)*(jmax+1)), nn(0:jmax,0:imax)
58 real(dp) :: delta_ts, glac_index
59 real(dp) :: sum_accum, mean_accum, mean_accum_inv
60 real(dp) :: dtime0, dtime_temp0, dtime_wss0, dtime_out0, dtime_ser0
61 real(dp) :: dtime, dtime_temp, dtime_wss, dtime_out, dtime_ser
62 real(dp) :: time_init0, time_end0, time_output0(100)
63 real(dp) :: time, time_init, time_end, time_output(100)
64 real(dp) :: dxi, deta, dzeta_c, dzeta_t, dzeta_r
65 real(dp) :: z_sl, dzsl_dtau, z_mar
67 character (len=100) :: runname, anfdatname, target_topo_dat_name
68 character (len=256) :: shell_command
70 logical :: flag_3d_output
82 #if (CALCZS==4 || MARGIN==3)
85 call lis_initialize(ierr)
95 if ( trim(version) /= trim(sico_version) ) &
96 stop
' sico_init: SICOPOLIS version not compatible with header file!'
101 #if (GRID==0 || GRID==1)
103 if (abs(dx-40.0_dp) < eps)
then
105 if ( (imax /= 41).or.(jmax /= 70) &
107 stop
' sico_init: IMAX and/or JMAX wrong!'
110 else if (abs(dx-20.0_dp) < eps)
then
112 if ( ( (imax /= 82).or.(jmax /= 140) ) &
114 ( (imax /= 75).or.(jmax /= 140) ) &
116 stop
' sico_init: IMAX and/or JMAX wrong!'
119 else if (abs(dx-10.0_dp) < eps)
then
121 if ( ( (imax /= 164).or.(jmax /= 280) ) &
123 ( (imax /= 150).or.(jmax /= 280) ) &
125 stop
' sico_init: IMAX and/or JMAX wrong!'
128 else if (abs(dx-5.0_dp) < eps)
then
130 if ( (imax /= 300).or.(jmax /= 560) &
132 stop
' sico_init: IMAX and/or JMAX wrong!'
136 stop
' sico_init: DX wrong!'
141 stop
' sico_init: GRID==2 not allowed for this application!'
148 #if ((TSURFACE == 5) && (ACCSURFACE != 5))
149 stop
' sico_init: Options TSURFACE==5 and ACCSURFACE==5 must be used together!'
152 #if ((TSURFACE != 5) && (ACCSURFACE == 5))
153 stop
' sico_init: Options TSURFACE==5 and ACCSURFACE==5 must be used together!'
157 #if (ACCSURFACE != 6)
158 write(6,
'(a)')
' sico_init: Options TSURFACE==6, ACCSURFACE==6'
159 write(6,
'(a)')
' and NETCDF==2 must be used together!'
162 write(6,
'(a)')
' sico_init: Options TSURFACE==6, ACCSURFACE==6'
163 write(6,
'(a)')
' and NETCDF==2 must be used together!'
168 #if (ACCSURFACE == 6)
170 write(6,
'(a)')
' sico_init: Options TSURFACE==6, ACCSURFACE==6'
171 write(6,
'(a)')
' and NETCDF==2 must be used together!'
174 write(6,
'(a)')
' sico_init: Options TSURFACE==6, ACCSURFACE==6'
175 write(6,
'(a)')
' and NETCDF==2 must be used together!'
184 stop
' sico_init: Option ADV_HOR==1 (central differences) not defined!'
187 #if ((ADV_HOR == 3) && (ADV_VERT != 3))
188 stop
' sico_init: Options ADV_HOR==3 and ADV_VERT==3 must be used together!'
191 #if ((ADV_HOR != 3) && (ADV_VERT == 3))
192 stop
' sico_init: Options ADV_HOR==3 and ADV_VERT==3 must be used together!'
201 #elif (TSURFACE == 5)
205 #elif (TSURFACE == 6)
215 dtime_temp0 = dtime_temp0
217 dtime_wss0 = dtime_wss0
222 dzeta_c = 1.0_dp/
real(kcmax,dp)
223 dzeta_t = 1.0_dp/
real(ktmax,dp)
224 dzeta_r = 1.0_dp/
real(krmax,dp)
237 if ((i <= imax).and.(j <= jmax))
then
249 anfdatname = anfdatname
251 #if defined(YEAR_ZERO)
252 year_zero = year_zero
254 year_zero = 2000.0_dp
257 time_init0 = time_init0
258 time_end0 = time_end0
259 dtime_ser0 = dtime_ser0
261 #if ( OUTPUT==1 || OUTPUT==3 )
262 dtime_out0 = dtime_out0
265 #if ( OUTPUT==2 || OUTPUT==3 )
267 time_output0( 1) = time_out0_01
268 time_output0( 2) = time_out0_02
269 time_output0( 3) = time_out0_03
270 time_output0( 4) = time_out0_04
271 time_output0( 5) = time_out0_05
272 time_output0( 6) = time_out0_06
273 time_output0( 7) = time_out0_07
274 time_output0( 8) = time_out0_08
275 time_output0( 9) = time_out0_09
276 time_output0(10) = time_out0_10
277 time_output0(11) = time_out0_11
278 time_output0(12) = time_out0_12
279 time_output0(13) = time_out0_13
280 time_output0(14) = time_out0_14
281 time_output0(15) = time_out0_15
282 time_output0(16) = time_out0_16
283 time_output0(17) = time_out0_17
284 time_output0(18) = time_out0_18
285 time_output0(19) = time_out0_19
286 time_output0(20) = time_out0_20
291 shell_command =
'if [ ! -d'
292 shell_command = trim(shell_command)//
' '//outpath
293 shell_command = trim(shell_command)//
' '//
'] ; then mkdir'
294 shell_command = trim(shell_command)//
' '//outpath
295 shell_command = trim(shell_command)//
' '//
'; fi'
296 call system(trim(shell_command))
299 open(10, iostat=ios, &
300 file=outpath//
'/'//trim(runname)//
'.log', &
303 stop
' sico_init: Error when opening the log file!'
305 write(10,1000)
'Computational domain:'
307 write(10,1000)
'Antarctica'
309 write(10,1000)
'Greenland'
311 write(10,1000)
'Scandinavia and Eurasia'
313 write(10,1000)
'Northern hemisphere'
314 #elif defined(EMTP2SGE)
315 write(10,1000)
'EISMINT Phase 2 Simplified Geometry Experiment'
317 write(10,1000)
'North polar cap of Mars'
319 write(10,1000)
'South polar cap of Mars'
321 stop
' sico_init: No valid domain specified!'
325 write(10,1001)
'imax =', imax
326 write(10,1001)
'jmax =', jmax
327 write(10,1001)
'kcmax =', kcmax
328 write(10,1001)
'ktmax =', ktmax
329 write(10,1001)
'krmax =', krmax
332 write(10,1002)
'a =', deform
335 #if (GRID==0 || GRID==1)
336 write(10,1002)
'x0 =', x0
337 write(10,1002)
'y0 =', y0
338 write(10,1002)
'dx =', dx
340 stop
' sico_init: GRID==2 not allowed for this application!'
344 write(10,1002)
'year_zero =', year_zero
345 write(10,1002)
'time_init =', time_init0
346 write(10,1002)
'time_end =', time_end0
347 write(10,1002)
'dtime =', dtime0
348 write(10,1002)
'dtime_temp =', dtime_temp0
350 write(10,1002)
'dtime_wss =', dtime_wss0
352 #if ( OUTPUT==1 || OUTPUT==3 )
353 write(10,1002)
'dtime_out =', dtime_out0
355 write(10,1002)
'dtime_ser =', dtime_ser0
358 write(10,1000)
'zs_present file = '//zs_present_file
360 write(10,1000)
'zl_present file = '//zl_present_file
362 write(10,1000)
'zl0 file = '//zl0_file
363 write(10,1000)
'mask_present file = '//mask_present_file
365 write(10,1000)
'Initial-value file = '//anfdatname
366 write(10,1000)
'Path to initial-value file = '//anfdatpath
371 write(10,1002)
'time_target_topo_init =', time_target_topo_init0
372 write(10,1002)
'time_target_topo_final =', time_target_topo_final0
373 write(10,1000)
'Target-topography file = '//target_topo_dat_name
374 write(10,1000)
'Path to target-topography file = '//target_topo_dat_path
379 write(10,1000)
'Maximum ice extent mask file = '//mask_maxextent_file
383 write(10,1000)
'Physical-parameter file = '//phys_para_file
386 #if (CALCZS==3 || CALCZS==4)
387 write(10,1002)
'ovi_weight =', ovi_weight
389 write(10,1002)
'omega_sor =', omega_sor
395 write(10,1002)
'delta_ts0 =', delta_ts0
397 write(10,1002)
'sine_amplit =', sine_amplit
398 write(10,1002)
'sine_period =', sine_period
400 write(10,1000)
'GRIP file = '//grip_temp_file
401 write(10,1002)
'grip_temp_fact =', grip_temp_fact
403 write(10,1000)
'Glacial-index file = '//glac_ind_file
404 write(10,1000)
'temp_ma_anom file = '//temp_ma_anom_file
405 write(10,1002)
'temp_ma_anom fact = ', temp_ma_anom_fact
406 write(10,1000)
'temp_mj_anom file = '//temp_mj_anom_file
407 write(10,1002)
'temp_mj_anom fact = ', temp_mj_anom_fact
409 write(10,1000)
'temp_precip_anom file = '//temp_precip_anom_file
410 write(10,1002)
'temp_ma_anom fact = ', temp_ma_anom_fact
411 write(10,1002)
'temp_mj_anom fact = ', temp_mj_anom_fact
414 write(10,1000)
'precip_present file = '//precip_present_file
416 write(10,1002)
'accfact =', accfact
417 #elif ( ACCSURFACE==2 || ACCSURFACE==3 )
418 write(10,1002)
'gamma_s =', gamma_s
419 #elif ( ACCSURFACE==5 )
420 write(10,1000)
'precip_anom file = '//precip_anom_file
421 write(10,1002)
'precip_anom fact = ', precip_anom_fact
422 #elif ( ACCSURFACE==6 )
423 write(10,1000)
'temp_precip_anom file = '//temp_precip_anom_file
424 write(10,1002)
'precip_anom fact = ', precip_anom_fact
426 #if (ACCSURFACE <= 3)
427 write(10,1001)
'ELEV_DESERT =', elev_desert
428 #if (ELEV_DESERT == 1)
429 write(10,1002)
'gamma_p =', gamma_p
430 write(10,1002)
'zs_thresh =', zs_thresh
435 write(10,1002)
'lambda_lti =', lambda_lti
436 write(10,1002)
'temp_lti =', temp_lti
440 write(10,1002)
'z_sl0 =', z_sl0
442 write(10,1000)
'sea-level file = '//sea_level_file
447 #if ( MARINE_ICE_CALVING==2 || MARINE_ICE_CALVING==3 )
448 write(10,1002)
'z_mar =', z_mar
450 #elif ( MARINE_ICE_CALVING==4 || MARINE_ICE_CALVING==5 \
451 || marine_ice_calving==6 || marine_ice_calving==7 )
452 write(10,1002)
'fact_z_mar =', fact_z_mar
454 #elif ( ( MARINE_ICE_FORMATION==2 ) && ( MARINE_ICE_CALVING==9 ) )
455 write(10,1002)
'calv_uw_coeff =', calv_uw_coeff
456 write(10,1002)
'r1_calv_uw =', r1_calv_uw
457 write(10,1002)
'r2_calv_uw =', r2_calv_uw
461 #if ICE_SHELF_CALVING==2
462 write(10,1002)
'H_calv =', h_calv
467 write(10,1002)
'c_slide =', c_slide
468 write(10,1002)
'smw_coeff =', smw_coeff
469 write(10,1001)
'r_smw =', r_smw
470 write(10,1001)
's_smw =', s_smw
471 write(10,1002)
'gamma_slide =', gamma_slide
472 write(10,1001)
'p_weert =', p_weert
473 write(10,1001)
'q_weert =', q_weert
475 write(10,1002)
'red_pres_limit_fact =', red_pres_limit_fact
480 write(10,1000)
'Sediment-mask file = '//mask_sedi_file
483 write(10,1002)
'c_slide_sedi =', c_slide_sedi
484 write(10,1002)
'smw_coeff_sedi =', smw_coeff_sedi
485 write(10,1001)
'r_smw_sedi =', r_smw_sedi
486 write(10,1001)
's_smw_sedi =', s_smw_sedi
487 write(10,1002)
'gamma_slide_sedi =', gamma_slide_sedi
488 write(10,1001)
'p_weert_sedi =', p_weert_sedi
489 write(10,1001)
'q_weert_sedi =', q_weert_sedi
494 write(10,1002)
'q_geo =', q_geo
496 write(10,1000)
'q_geo file = '//q_geo_file
500 #if defined(MARINE_ICE_BASAL_MELTING)
501 write(10,1001)
'MARINE_ICE_BASAL_MELTING =', marine_ice_basal_melting
502 #if ( MARINE_ICE_BASAL_MELTING==2 || MARINE_ICE_BASAL_MELTING==3 )
503 write(10,1002)
'qbm_marine =', qbm_marine
509 write(10,1002)
'frac_llra =', frac_llra
514 write(10,1002)
'gr_size =', gr_size
518 write(10,1002)
'sigma_res =', sigma_res
522 write(10,1001)
'ENHMOD =', enhmod
523 write(10,1002)
'enh_fact =', enh_fact
524 #if ( ENHMOD==2 || ENHMOD==3 )
525 write(10,1002)
'enh_intg =', enh_intg
528 write(10,1002)
'age_trans =', age_trans_0
531 write(10,1002)
'date_trans1 =', date_trans1_0
532 write(10,1002)
'date_trans2 =', date_trans2_0
533 write(10,1002)
'date_trans3 =', date_trans3_0
536 write(10,1002)
'enh_shelf =', enh_shelf
540 write(10,1002)
'numdiff_H_t =', numdiff_h_t
541 write(10,1002)
'tau_cts =', tau_cts
542 write(10,1002)
'H_min =', h_min
543 write(10,1002)
'vh_max =', vh_max
544 write(10,1002)
'hd_min =', hd_min
545 write(10,1002)
'hd_max =', hd_max
547 write(10,1002)
'qbm_min =', qbm_min
548 #elif defined(QB_MIN) /* obsolete */
549 write(10,1002)
'qb_min =', qb_min
552 write(10,1002)
'qbm_max =', qbm_max
553 #elif defined(QB_MAX) /* obsolete */
554 write(10,1002)
'qb_max =', qb_max
556 write(10,1002)
'age_min =', age_min
557 write(10,1002)
'age_max =', age_max
558 write(10,1002)
'mean_accum =', mean_accum
560 write(10,1002)
'age_diff =', agediff
561 write(10,1002)
'm_age =', m_age
565 write(10,1001)
'GRID =', grid
566 write(10,1001)
'CALCMOD =', calcmod
567 write(10,1001)
'FLOW_LAW =', flow_law
568 write(10,1001)
'FIN_VISC =', fin_visc
569 write(10,1001)
'MARGIN =', margin
571 write(10,1001)
'MARINE_ICE_FORMATION =', marine_ice_formation
572 write(10,1001)
'MARINE_ICE_CALVING =', marine_ice_calving
574 write(10,1001)
'ICE_SHELF_CALVING =', ice_shelf_calving
576 write(10,1001)
'ANF_DAT =', anf_dat
577 write(10,1001)
'REBOUND =', rebound
578 write(10,1001)
'Q_LITHO =', q_litho
579 write(10,1001)
'ZS_EVOL =', zs_evol
580 write(10,1001)
'CALCZS =', calczs
581 write(10,1001)
'ADV_HOR =', adv_hor
582 write(10,1001)
'ADV_VERT =', adv_vert
583 write(10,1001)
'TOPOGRAD =', topograd
585 write(10,1001)
'TEMP_PRESENT_PARA =', temp_present_para
586 write(10,1001)
'TSURFACE =', tsurface
587 write(10,1001)
'ACCSURFACE =', accsurface
589 write(10,1001)
'PRECIP_ANOM_INTERPOL =', precip_anom_interpol
591 write(10,1001)
'SOLID_PRECIP =', solid_precip
592 write(10,1001)
'ABLSURFACE =', ablsurface
593 #if ( ABLSURFACE==1 || ABLSURFACE==2 )
594 write(10,1001)
'PDD_MODIFIER =', pdd_modifier
596 write(10,1001)
'N_PDD_MOD =', n_pdd_mod
597 write(10,1002)
'LON_W_E_SEP =', lon_w_e_sep
600 write(10,1002)
'PDD_MOD_LAT_01 =', pdd_mod_lat_01
601 write(10,1002)
'PDD_MOD_FAC_W_01 =', pdd_mod_fac_w_01
602 write(10,1002)
'PDD_MOD_FAC_E_01 =', pdd_mod_fac_e_01
605 write(10,1002)
'PDD_MOD_LAT_02 =', pdd_mod_lat_02
606 write(10,1002)
'PDD_MOD_FAC_W_02 =', pdd_mod_fac_w_02
607 write(10,1002)
'PDD_MOD_FAC_E_02 =', pdd_mod_fac_e_02
610 write(10,1002)
'PDD_MOD_LAT_03 =', pdd_mod_lat_03
611 write(10,1002)
'PDD_MOD_FAC_W_03 =', pdd_mod_fac_w_03
612 write(10,1002)
'PDD_MOD_FAC_E_03 =', pdd_mod_fac_e_03
615 write(10,1002)
'PDD_MOD_LAT_04 =', pdd_mod_lat_04
616 write(10,1002)
'PDD_MOD_FAC_W_04 =', pdd_mod_fac_w_04
617 write(10,1002)
'PDD_MOD_FAC_E_04 =', pdd_mod_fac_e_04
620 write(10,1002)
'PDD_MOD_LAT_05 =', pdd_mod_lat_05
621 write(10,1002)
'PDD_MOD_FAC_W_05 =', pdd_mod_fac_w_05
622 write(10,1002)
'PDD_MOD_FAC_E_05 =', pdd_mod_fac_e_05
625 write(10,1002)
'PDD_MOD_LAT_06 =', pdd_mod_lat_06
626 write(10,1002)
'PDD_MOD_FAC_W_06 =', pdd_mod_fac_w_06
627 write(10,1002)
'PDD_MOD_FAC_E_06 =', pdd_mod_fac_e_06
630 write(10,1002)
'PDD_MOD_LAT_07 =', pdd_mod_lat_07
631 write(10,1002)
'PDD_MOD_FAC_W_07 =', pdd_mod_fac_w_07
632 write(10,1002)
'PDD_MOD_FAC_E_07 =', pdd_mod_fac_e_07
635 write(10,1002)
'PDD_MOD_LAT_08 =', pdd_mod_lat_08
636 write(10,1002)
'PDD_MOD_FAC_W_08 =', pdd_mod_fac_w_08
637 write(10,1002)
'PDD_MOD_FAC_E_08 =', pdd_mod_fac_e_08
640 write(10,1002)
'PDD_MOD_LAT_09 =', pdd_mod_lat_09
641 write(10,1002)
'PDD_MOD_FAC_W_09 =', pdd_mod_fac_w_09
642 write(10,1002)
'PDD_MOD_FAC_E_09 =', pdd_mod_fac_e_09
645 write(10,1002)
'PDD_MOD_LAT_10 =', pdd_mod_lat_10
646 write(10,1002)
'PDD_MOD_FAC_W_10 =', pdd_mod_fac_w_10
647 write(10,1002)
'PDD_MOD_FAC_E_10 =', pdd_mod_fac_e_10
653 write(10,1001)
'SEA_LEVEL =', sea_level
654 write(10,1001)
'SLIDE_LAW =', slide_law
655 write(10,1001)
'ICE_STREAM =', ice_stream
656 write(10,1001)
'Q_GEO_MOD =', q_geo_mod
659 #if defined(OUT_TIMES)
660 write(10,1001)
'OUT_TIMES =', out_times
662 write(10,1001)
'OUTPUT =', output
663 write(10,1001)
'OUTSER =', outser
664 #if defined(OUTSER_V_A)
665 write(10,1001)
'OUTSER_V_A =', outser_v_a
667 #if ( OUTPUT==1 || OUTPUT==2 )
668 write(10,1001)
'ERGDAT =', ergdat
670 write(10,1001)
'NETCDF =', netcdf
672 #if ( OUTPUT==2 || OUTPUT==3 )
673 write(10,1001)
'n_output =', n_output
675 write(10,1002)
'time_output =', time_output0(n)
680 write(10,1000)
'Program version and date: '//version//
' / '//date
684 1002 format(a,es12.4)
686 close(10, status=
'keep')
690 year_zero = year_zero*year_sec
691 time_init = time_init0*year_sec
692 time_end = time_end0*year_sec
693 dtime = dtime0*year_sec
694 dtime_temp = dtime_temp0*year_sec
696 dtime_wss = dtime_wss0*year_sec
698 dtime_ser = dtime_ser0*year_sec
699 #if ( OUTPUT==1 || OUTPUT==3 )
700 dtime_out = dtime_out0*year_sec
702 #if ( OUTPUT==2 || OUTPUT==3 )
704 time_output(n) = time_output0(n)*year_sec
708 if (abs(dtime_temp/dtime-nint(dtime_temp/dtime)) > eps) &
709 stop
' sico_init: dtime_temp must be a multiple of dtime!'
712 if (abs(dtime_wss/dtime-nint(dtime_wss/dtime)) > eps) &
713 stop
' sico_init: dtime_wss must be a multiple of dtime!'
717 time_target_topo_init = time_target_topo_init0 *year_sec
718 time_target_topo_final = time_target_topo_final0*year_sec
723 #if (GRID==0 || GRID==1)
725 open(21, iostat=ios, &
726 file=inpath//
'/grl/'//precip_present_file, &
727 recl=8192, status=
'old')
731 stop
' sico_init: GRID==2 not allowed for this application!'
735 if (ios /= 0) stop
' sico_init: Error when opening the precip file!'
737 do n=1, 6;
read(21,
'(a)') ch_dummy;
end do
740 read(21,*) (precip_ma_present(j,i), i=0,imax)
743 close(21, status=
'keep')
745 precip_ma_present = precip_ma_present *(1.0e-03_dp/year_sec)*(rho_w/rho)
754 precip_present(j,i,n) = precip_ma_present(j,i)
763 #if (GRID==0 || GRID==1)
765 open(21, iostat=ios, &
766 file=inpath//
'/grl/'//precip_anom_file, &
767 recl=8192, status=
'old')
771 if (ios /= 0) stop
' sico_init: Error when opening the precip anomaly file!'
773 do n=1, 6;
read(21,
'(a)') ch_dummy;
end do
776 read(21,*) (precip_ma_lgm_anom(j,i), i=0,imax)
779 close(21, status=
'keep')
781 precip_ma_lgm_anom = precip_ma_lgm_anom * precip_anom_fact
790 precip_lgm_anom(j,i,n) = max(precip_ma_lgm_anom(j,i), eps)
793 #if (PRECIP_ANOM_INTERPOL==1)
794 gamma_precip_lgm_anom(j,i,n) = 0.0_dp
795 #elif (PRECIP_ANOM_INTERPOL==2)
796 gamma_precip_lgm_anom(j,i,n) = -log(precip_lgm_anom(j,i,n))
798 stop
' sico_init: Wrong value of switch PRECIP_ANOM_INTERPOL!'
809 mean_accum = mean_accum*(1.0e-03_dp/year_sec)*(rho_w/rho)
812 mean_accum_inv = 1.0_dp/mean_accum
816 #if (GRID==0 || GRID==1)
818 open(24, iostat=ios, &
819 file=inpath//
'/grl/'//mask_present_file, &
820 recl=8192, status=
'old')
824 stop
' sico_init: GRID==2 not allowed for this application!'
828 if (ios /= 0) stop
' sico_init: Error when opening the mask file!'
830 do n=1, 6;
read(24,
'(a)') ch_dummy;
end do
833 read(24,2300) (maske_help(j,i), i=0,imax)
836 close(24, status=
'keep')
838 2300 format(imax(i1),i1)
844 open(24, iostat=ios, &
845 file=inpath//
'/grl/'//mask_sedi_file, &
846 recl=8192, status=
'old')
848 if (ios /= 0) stop
' sico_init: Error when opening the rock/sediment mask file!'
850 do n=1, 6;
read(24,
'(a)') ch_dummy;
end do
853 read(24,2300) (maske_sedi(j,i), i=0,imax)
856 close(24, status=
'keep')
862 #if (GRID==0 || GRID==1)
864 open(21, iostat=ios, &
865 file=inpath//
'/grl/'//zs_present_file, &
866 recl=8192, status=
'old')
870 stop
' sico_init: GRID==2 not allowed for this application!'
874 if (ios /= 0) stop
' sico_init: Error when opening the zs file!'
876 do n=1, 6;
read(21,
'(a)') ch_dummy;
end do
879 read(21,*) (zs_ref(j,i), i=0,imax)
882 close(21, status=
'keep')
889 if (maske_help(j,i) >= 2) zs_ref(j,i) = 0.0_dp
897 target_topo_dat_name = trim(target_topo_dat_name)
900 write(6,
'(a)')
' sico_init: Reading of target topography'
901 write(6,
'(a)')
' only implemented for NetCDF files (NETCDF==2)!'
906 stop
' sico_init: Parameter NETCDF must be either 1 or 2!'
915 #if (GRID==0 || GRID==1)
917 open(24, iostat=ios, &
918 file=inpath//
'/grl/'//mask_maxextent_file, &
919 recl=8192, status=
'old')
923 stop
' sico_init: GRID==2 not allowed for this application!'
928 stop
' sico_init: Error when opening the maximum ice extent mask file!'
930 do n=1, 6;
read(24,
'(a)') ch_dummy;
end do
933 read(24,2300) (maske_maxextent(j,i), i=0,imax)
936 close(24, status=
'keep')
945 #if (GRID==0 || GRID==1)
947 open(21, iostat=ios, &
948 file=inpath//
'/grl/'//temp_ma_anom_file, &
949 recl=8192, status=
'old')
953 if (ios /= 0) stop
' sico_init: Error when opening the temp_ma anomaly file!'
955 #if (GRID==0 || GRID==1)
957 open(22, iostat=ios, &
958 file=inpath//
'/grl/'//temp_mj_anom_file, &
959 recl=8192, status=
'old')
963 if (ios /= 0) stop
' sico_init: Error when opening the temp_mj anomaly file!'
965 do n=1, 6;
read(21,
'(a)') ch_dummy;
end do
966 do n=1, 6;
read(22,
'(a)') ch_dummy;
end do
969 read(21,*) (temp_ma_lgm_anom(j,i), i=0,imax)
970 read(22,*) (temp_mj_lgm_anom(j,i), i=0,imax)
973 close(21, status=
'keep')
974 close(22, status=
'keep')
976 temp_ma_lgm_anom = temp_ma_lgm_anom * temp_ma_anom_fact
977 temp_mj_lgm_anom = temp_mj_lgm_anom * temp_mj_anom_fact
985 open(21, iostat=ios, &
986 file=inpath//
'/general/'//grip_temp_file, &
989 stop
' sico_init: Error when opening the data file for delta_ts!'
991 read(21,*) ch_dummy, grip_time_min, grip_time_stp, grip_time_max
993 if (ch_dummy /=
'#')
then
994 write(6,*)
' sico_init: grip_time_min, grip_time_stp, grip_time_max'
995 write(6,*)
' not defined in data file for delta_ts!'
999 ndata_grip = (grip_time_max-grip_time_min)/grip_time_stp
1001 allocate(griptemp(0:ndata_grip))
1004 read(21,*) d_dummy, griptemp(n)
1007 close(21, status=
'keep')
1015 open(21, iostat=ios, &
1016 file=inpath//
'/general/'//glac_ind_file, status=
'old')
1017 if (ios /= 0) stop
' sico_init: Error when opening the glacial-index file!'
1019 read(21,*) ch_dummy, gi_time_min, gi_time_stp, gi_time_max
1021 if (ch_dummy /=
'#')
then
1022 write(6,*)
' sico_init: gi_time_min, gi_time_stp, gi_time_max'
1023 write(6,*)
' not defined in glacial-index file!'
1027 ndata_gi = (gi_time_max-gi_time_min)/gi_time_stp
1029 allocate(glacial_index(0:ndata_gi))
1032 read(21,*) d_dummy, glacial_index(n)
1035 close(21, status=
'keep')
1042 #if ( (TSURFACE==6) && (ACCSURFACE==6) )
1044 call
check( nf90_open(inpath//
'/grl/'//temp_precip_anom_file, &
1045 nf90_nowrite, ncid_temp_precip) )
1047 call
check( nf90_inquire(ncid_temp_precip, unlimiteddimid = dimid) )
1049 call
check( nf90_inquire_dimension(ncid_temp_precip, dimid, &
1050 len = ndata_temp_precip) )
1052 ndata_temp_precip = ndata_temp_precip-1
1054 allocate(temp_precip_time(0:ndata_temp_precip))
1056 call
check( nf90_inq_varid(ncid_temp_precip,
'time', ncv) )
1057 call
check( nf90_get_var(ncid_temp_precip, ncv, temp_precip_time) )
1059 temp_precip_time_min = temp_precip_time(0)
1060 temp_precip_time_stp = temp_precip_time(1)-temp_precip_time(0)
1062 temp_precip_time_max = temp_precip_time(ndata_temp_precip)
1070 open(21, iostat=ios, &
1071 file=inpath//
'/general/'//sea_level_file, &
1074 stop
' sico_init: Error when opening the data file for z_sl!'
1076 read(21,*) ch_dummy, specmap_time_min, specmap_time_stp, specmap_time_max
1078 if (ch_dummy /=
'#')
then
1079 write(6,*)
' sico_init: specmap_time_min, specmap_time_stp, specmap_time_max'
1080 write(6,*)
' not defined in data file for z_sl!'
1084 ndata_specmap = (specmap_time_max-specmap_time_min)/specmap_time_stp
1086 allocate(specmap_zsl(0:ndata_specmap))
1088 do n=0, ndata_specmap
1089 read(21,*) d_dummy, specmap_zsl(n)
1092 close(21, status=
'keep')
1104 q_geo(j,i) = q_geo *1.0e-03_dp
1112 open(21, iostat=ios, &
1113 file=inpath//
'/grl/'//q_geo_file, &
1114 recl=8192, status=
'old')
1116 if (ios /= 0) stop
' sico_init: Error when opening the qgeo file!'
1118 do n=1, 6;
read(21,
'(a)') ch_dummy;
end do
1121 read(21,*) (q_geo(j,i), i=0,imax)
1124 close(21, status=
'keep')
1128 q_geo(j,i) = q_geo(j,i) *1.0e-03_dp
1136 #if (REBOUND==0 || REBOUND==1)
1138 kei = 0.0_dp; n_data_kei = 0; kei_r_max = 0.0_dp; kei_r_incr = 0.0_dp
1156 call
boundary(time_init, dtime, dxi, deta, &
1157 delta_ts, glac_index, z_sl, dzsl_dtau, z_mar)
1164 q_b_tot(j,i) = 0.0_dp
1170 temp_c(kc,j,i) = -10.0_dp
1171 age_c(kc,j,i) = 15000.0_dp*year_sec
1175 omega_t(kt,j,i) = 0.0_dp
1176 age_t(kt,j,i) = 15000.0_dp*year_sec
1180 temp_r(kr,j,i) = -10.0_dp+q_geo(j,i)*h_r/kappa_r &
1181 *(1.0_dp-
real(kr,dp)/
real(krmax,dp))
1199 call
boundary(time_init, dtime, dxi, deta, &
1200 delta_ts, glac_index, z_sl, dzsl_dtau, z_mar)
1207 q_b_tot(j,i) = 0.0_dp
1213 temp_c(kc,j,i) = temp_s(j,i)
1214 age_c(kc,j,i) = 15000.0_dp*year_sec
1218 omega_t(kt,j,i) = 0.0_dp
1219 age_t(kt,j,i) = 15000.0_dp*year_sec
1223 temp_r(kr,j,i) = temp_s(j,i)+q_geo(j,i)*h_r/kappa_r &
1224 *(1.0_dp-
real(kr,dp)/
real(krmax,dp))
1243 stop
' sico_init: Parameter NETCDF must be either 1 or 2!'
1246 call
boundary(time_init, dtime, dxi, deta, &
1247 delta_ts, glac_index, z_sl, dzsl_dtau, z_mar)
1249 q_b_tot = q_bm + q_tld
1257 #if (GRID==0 || GRID==1)
1261 dist_dxdy(jr,ir) = sqrt( (
real(ir,dp)*dxi)**2 + (
real(jr,dp)*deta)**2 )
1273 zeta_c(kc) = kc*dzeta_c
1274 eaz_c(kc) = exp(deform*zeta_c(kc))
1275 eaz_c_quotient(kc) = (eaz_c(kc)-1.0_dp)/(ea-1.0_dp)
1279 zeta_t(kt) = kt*dzeta_t
1290 call
calc_vxy_ssa(z_sl, dxi, deta, dzeta_c, ii, jj, nn)
1303 open(12, iostat=ios, &
1304 file=outpath//
'/'//trim(runname)//
'.ser', &
1307 stop
' sico_init: Error when opening the ser file!'
1309 if (forcing_flag == 1)
then
1314 #if ( !defined(OUTSER_V_A) || OUTSER_V_A==1 )
1316 1102 format(
' t(a) D_Ts(deg C) z_sl(m)',/, &
1317 ' H_max(m) zs_max(m) V_g(m^3)', &
1318 ' V_t(m^3) V_fw(m^3/a) V_sle(m)',/, &
1319 ' A_g(m^2) A_t(m^2) V_bm(m^3/a)', &
1320 ' V_tld(m^3/a) H_t_max(m) vs_max(m/a)')
1321 1103 format(
'----------------------------------------------------', &
1322 '---------------------------------------')
1326 1102 format(
' t(a) D_Ts(deg C) z_sl(m)',/, &
1327 ' V(m^3) V_g(m^3) V_f(m^3)', &
1328 ' A(m^2) A_g(m^2) A_f(m^2)',/, &
1329 ' H_max(m) zs_max(m)', &
1330 ' V_t(m^3) V_fw(m^3/a) V_sle(m)',/, &
1331 ' A_t(m^2) V_bm(m^3/a)', &
1332 ' V_tld(m^3/a) H_t_max(m) vs_max(m/a)')
1333 1103 format(
'----------------------------------------------------', &
1334 '---------------------------------------')
1337 stop
' sico_init: OUTSER_V_A must be either 1 or 2!'
1340 else if (forcing_flag == 2)
then
1345 #if ( !defined(OUTSER_V_A) || OUTSER_V_A==1 )
1347 1112 format(
' t(a) glac_ind(1) z_sl(m)',/, &
1348 ' H_max(m) zs_max(m) V_g(m^3)', &
1349 ' V_t(m^3) V_fw(m^3/a) V_sle(m)',/, &
1350 ' A_g(m^2) A_t(m^2) V_bm(m^3/a)', &
1351 ' V_tld(m^3/a) H_t_max(m) vs_max(m/a)')
1352 1113 format(
'----------------------------------------------------', &
1353 '---------------------------------------')
1357 1112 format(
' t(a) glac_ind(1) z_sl(m)',/, &
1358 ' V(m^3) V_g(m^3) V_f(m^3)', &
1359 ' A(m^2) A_g(m^2) A_f(m^2)',/, &
1360 ' H_max(m) zs_max(m)', &
1361 ' V_t(m^3) V_fw(m^3/a) V_sle(m)',/, &
1362 ' A_t(m^2) V_bm(m^3/a)', &
1363 ' V_tld(m^3/a) H_t_max(m) vs_max(m/a)')
1364 1113 format(
'----------------------------------------------------', &
1365 '---------------------------------------')
1368 stop
' sico_init: OUTSER_V_A must be either 1 or 2!'
1371 else if (forcing_flag == 3)
then
1376 #if ( !defined(OUTSER_V_A) || OUTSER_V_A==1 )
1378 1122 format(
' t(a) (Dummy)(1) z_sl(m)',/, &
1379 ' H_max(m) zs_max(m) V_g(m^3)', &
1380 ' V_t(m^3) V_fw(m^3/a) V_sle(m)',/, &
1381 ' A_g(m^2) A_t(m^2) V_bm(m^3/a)', &
1382 ' V_tld(m^3/a) H_t_max(m) vs_max(m/a)')
1383 1123 format(
'----------------------------------------------------', &
1384 '---------------------------------------')
1388 1122 format(
' t(a) (Dummy)(1) z_sl(m)',/, &
1389 ' V(m^3) V_g(m^3) V_f(m^3)', &
1390 ' A(m^2) A_g(m^2) A_f(m^2)',/, &
1391 ' H_max(m) zs_max(m)', &
1392 ' V_t(m^3) V_fw(m^3/a) V_sle(m)',/, &
1393 ' A_t(m^2) V_bm(m^3/a)', &
1394 ' V_tld(m^3/a) H_t_max(m) vs_max(m/a)')
1395 1123 format(
'----------------------------------------------------', &
1396 '---------------------------------------')
1399 stop
' sico_init: OUTSER_V_A must be either 1 or 2!'
1408 open(13, iostat=ios, &
1409 file=outpath//
'/'//trim(runname)//
'.thk', &
1411 if (ios /= 0) stop
' sico_init: Error when opening the thk file!'
1413 if (forcing_flag == 1)
then
1418 1104 format(
' t(a) D_Ts(deg C) z_sl(m)',/, &
1419 ' H(m): JMAX+1 records [j = JMAX (-1) 0] with',/, &
1420 ' IMAX+1 values [i = 0 (1) IMAX] in each record')
1421 1105 format(
'----------------------------------------------------')
1423 else if (forcing_flag == 2)
then
1428 1114 format(
' t(a) glac_ind(1) z_sl(m)',/, &
1429 ' H(m): JMAX+1 records [j = JMAX (-1) 0] with',/, &
1430 ' IMAX+1 values [i = 0 (1) IMAX] in each record')
1431 1115 format(
'----------------------------------------------------')
1433 else if (forcing_flag == 3)
then
1438 1124 format(
' t(a) (Dummy)(1) z_sl(m)',/, &
1439 ' H(m): JMAX+1 records [j = JMAX (-1) 0] with',/, &
1440 ' IMAX+1 values [i = 0 (1) IMAX] in each record')
1441 1125 format(
'----------------------------------------------------')
1453 allocate(lambda_core(n_core), phi_core(n_core), &
1454 x_core(n_core), y_core(n_core))
1456 phi_core(1) = 72.58722_dp *pi_180
1457 lambda_core(1) = -37.64222_dp *pi_180
1458 call
num_coord(lambda_core(1), phi_core(1), x_core(1), y_core(1))
1460 phi_core(2) = 72.58833_dp *pi_180
1461 lambda_core(2) = -38.45750_dp *pi_180
1462 call
num_coord(lambda_core(2), phi_core(2), x_core(2), y_core(2))
1464 phi_core(3) = 65.15139_dp *pi_180
1465 lambda_core(3) = -43.81722_dp *pi_180
1466 call
num_coord(lambda_core(3), phi_core(3), x_core(3), y_core(3))
1468 phi_core(4) = 77.17970_dp *pi_180
1469 lambda_core(4) = -61.10975_dp *pi_180
1470 call
num_coord(lambda_core(4), phi_core(4), x_core(4), y_core(4))
1472 phi_core(5) = 75.09694_dp *pi_180
1473 lambda_core(5) = -42.31956_dp *pi_180
1474 call
num_coord(lambda_core(5), phi_core(5), x_core(5), y_core(5))
1476 phi_core(6) = 77.5_dp *pi_180
1477 lambda_core(6) = -50.9_dp *pi_180
1478 call
num_coord(lambda_core(6), phi_core(6), x_core(6), y_core(6))
1480 open(14, iostat=ios, &
1481 file=outpath//
'/'//trim(runname)//
'.core', &
1483 if (ios /= 0) stop
' sico_init: Error when opening the core file!'
1485 if (forcing_flag == 1)
then
1490 1106 format(
' t(a) D_Ts(C) z_sl(m)',/, &
1491 ' H_GR(m) H_G2(m) H_D3(m)', &
1492 ' H_CC(m) H_NG(m) H_NE(m)',/, &
1493 ' v_GR(m/a) v_G2(m/a) v_D3(m/a)', &
1494 ' v_CC(m/a) v_NG(m/a) v_NE(m/a)',/, &
1495 ' T_GR(C) T_G2(C) T_D3(C)', &
1496 ' T_CC(C) T_NG(C) T_NE(C)',/, &
1497 ' Rb_GR(W/m2) Rb_G2(W/m2) Rb_D3(W/m2)', &
1498 ' Rb_CC(W/m2) Rb_NG(W/m2) Rb_NE(W/m2)')
1499 1107 format(
'----------------------------------------------------', &
1500 '---------------------------------------')
1502 else if (forcing_flag == 2)
then
1507 1116 format(
' t(a) glac_ind(1) z_sl(m)',/, &
1508 ' H_GR(m) H_G2(m) H_D3(m)', &
1509 ' H_CC(m) H_NG(m) H_NE(m)',/, &
1510 ' v_GR(m/a) v_G2(m/a) v_D3(m/a)', &
1511 ' v_CC(m/a) v_NG(m/a) v_NE(m/a)',/, &
1512 ' T_GR(C) T_G2(C) T_D3(C)', &
1513 ' T_CC(C) T_NG(C) T_NE(C)',/, &
1514 ' Rb_GR(W/m2) Rb_G2(W/m2) Rb_D3(W/m2)', &
1515 ' Rb_CC(W/m2) Rb_NG(W/m2) Rb_NE(W/m2)')
1516 1117 format(
'----------------------------------------------------', &
1517 '---------------------------------------')
1519 else if (forcing_flag == 3)
then
1524 1126 format(
' t(a) (Dummy)(1) z_sl(m)',/, &
1525 ' H_GR(m) H_G2(m) H_D3(m)', &
1526 ' H_CC(m) H_NG(m) H_NE(m)',/, &
1527 ' v_GR(m/a) v_G2(m/a) v_D3(m/a)', &
1528 ' v_CC(m/a) v_NG(m/a) v_NE(m/a)',/, &
1529 ' T_GR(C) T_G2(C) T_D3(C)', &
1530 ' T_CC(C) T_NG(C) T_NE(C)',/, &
1531 ' Rb_GR(W/m2) Rb_G2(W/m2) Rb_D3(W/m2)', &
1532 ' Rb_CC(W/m2) Rb_NG(W/m2) Rb_NE(W/m2)')
1533 1127 format(
'----------------------------------------------------', &
1534 '---------------------------------------')
1545 flag_3d_output = .false.
1547 flag_3d_output = .true.
1549 stop
' sico_init: ERGDAT must be either 0 or 1!'
1553 call
output1(runname, time_init, delta_ts, glac_index, z_sl, &
1554 flag_3d_output, ndat2d, ndat3d)
1556 call
output_nc(runname, time_init, delta_ts, glac_index, z_sl, &
1557 flag_3d_output, ndat2d, ndat3d)
1559 stop
' sico_init: Parameter NETCDF must be either 1 or 2!'
1564 if (time_output(1) <= time_init+eps)
then
1567 flag_3d_output = .false.
1569 flag_3d_output = .true.
1571 stop
' sico_init: ERGDAT must be either 0 or 1!'
1575 call
output1(runname, time_init, delta_ts, glac_index, z_sl, &
1576 flag_3d_output, ndat2d, ndat3d)
1578 call
output_nc(runname, time_init, delta_ts, glac_index, z_sl, &
1579 flag_3d_output, ndat2d, ndat3d)
1581 stop
' sico_init: Parameter NETCDF must be either 1 or 2!'
1588 flag_3d_output = .false.
1591 call
output1(runname, time_init, delta_ts, glac_index, z_sl, &
1592 flag_3d_output, ndat2d, ndat3d)
1594 call
output_nc(runname, time_init, delta_ts, glac_index, z_sl, &
1595 flag_3d_output, ndat2d, ndat3d)
1597 stop
' sico_init: Parameter NETCDF must be either 1 or 2!'
1600 if (time_output(1) <= time_init+eps)
then
1602 flag_3d_output = .true.
1605 call
output1(runname, time_init, delta_ts, glac_index, z_sl, &
1606 flag_3d_output, ndat2d, ndat3d)
1608 call
output_nc(runname, time_init, delta_ts, glac_index, z_sl, &
1609 flag_3d_output, ndat2d, ndat3d)
1611 stop
' sico_init: Parameter NETCDF must be either 1 or 2!'
1617 stop
' sico_init: OUTPUT must be either 1, 2 or 3!'
1620 call
output2(time_init, dxi, deta, delta_ts, glac_index, z_sl)
1622 call
output3(time_init, delta_ts, glac_index, z_sl)
1625 call
output4(time_init, dxi, deta, delta_ts, glac_index, z_sl)