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, &
54 integer(i4b),
intent(out) :: ii((imax+1)*(jmax+1)), &
55 jj((imax+1)*(jmax+1)), &
57 integer(i4b),
intent(out) :: ndat2d, ndat3d
58 integer(i4b),
intent(out) :: n_output
59 real(dp),
intent(out) :: delta_ts, glac_index
60 real(dp),
intent(out) :: mean_accum
61 real(dp),
intent(out) :: dtime, dtime_temp, dtime_wss, &
63 real(dp),
intent(out) :: time, time_init, time_end, time_output(100)
64 real(dp),
intent(out) :: dxi, deta, dzeta_c, dzeta_t, dzeta_r
65 real(dp),
intent(out) :: z_sl, dzsl_dtau, z_mar
66 character(len=100),
intent(out) :: runname
68 integer(i4b) :: i, j, kc, kt, kr, m, n, ir, jr
71 real(dp) :: dtime0, dtime_temp0, dtime_wss0, dtime_out0, dtime_ser0
72 real(dp) :: time_init0, time_end0, time_output0(100)
74 character (len=100) :: anfdatname
75 character (len=256) :: shell_command
77 logical :: flag_3d_output
79 character(len=64),
parameter :: fmt1 =
'(a)', &
83 character(len= 8) :: ch_imax
84 character(len=128) :: fmt4
86 write(ch_imax, fmt=
'(i8)') imax
87 write(fmt4, fmt=
'(a)')
'('//trim(adjustl(ch_imax))//
'(i1),i1)'
92 ch_domain_long =
'Antarctica'
93 ch_domain_short =
'ant'
96 ch_domain_long =
'Austfonna'
97 ch_domain_short =
'asf'
99 #elif defined(EMTP2SGE)
100 ch_domain_long =
'EISMINT Phase 2 Simplified Geometry Experiment'
101 ch_domain_short =
'emtp2sge'
104 ch_domain_long =
'Greenland'
105 ch_domain_short =
'grl'
108 ch_domain_long =
'Northern hemisphere'
109 ch_domain_short =
'nhem'
112 ch_domain_long =
'Scandinavia and Eurasia'
113 ch_domain_short =
'scand'
116 ch_domain_long =
'Tibet'
117 ch_domain_short =
'tibet'
120 ch_domain_long =
'North polar cap of Mars'
121 ch_domain_short =
'nmars'
124 ch_domain_long =
'South polar cap of Mars'
125 ch_domain_short =
'smars'
128 ch_domain_long =
'XYZ'
129 ch_domain_short =
'xyz'
131 ch_domain_long = trim(ch_domain_long)//
'/ISMIP HEINO'
135 stop
' sico_init: No valid domain specified!'
156 #if (CALCZS==4 || MARGIN==3 || DYNAMICS==2)
159 call lis_initialize(ierr)
176 if ( trim(version) /= trim(sico_version) ) &
177 stop
' sico_init: SICOPOLIS version not compatible with header file!'
181 #if ( !defined(DYNAMICS) )
182 stop
' sico_init: DYNAMICS not defined in the header file!'
185 #if ( !defined(CALCMOD) )
186 stop
' sico_init: CALCMOD not defined in the header file!'
189 #if ( defined(ENTHMOD) )
190 write(6, fmt=
'(a)')
' sico_init: ENTHMOD must not be defined any more.'
191 write(6, fmt=
'(a)')
' Please update your header file!'
198 #if (GRID==0 || GRID==1)
200 if (abs(dx-40.0_dp) < eps)
then
202 if ((imax /= 150).or.(jmax /= 70))
then
203 stop
' sico_init: IMAX and/or JMAX wrong!'
206 else if (abs(dx-20.0_dp) < eps)
then
208 if ((imax /= 300).or.(jmax /= 140))
then
209 stop
' sico_init: IMAX and/or JMAX wrong!'
212 else if (abs(dx-10.0_dp) < eps)
then
214 if ((imax /= 600).or.(jmax /= 280))
then
215 stop
' sico_init: IMAX and/or JMAX wrong!'
219 stop
' sico_init: DX wrong!'
224 stop
' sico_init: GRID==2 not allowed for the Scandinavia application!'
232 #if (CALCMOD==0 || CALCMOD==2 || CALCMOD==3 || CALCMOD==-1)
235 write(6, fmt=
'(a)')
' sico_init: For options CALCMOD==0, 2, 3 or -1,'
236 write(6, fmt=
'(a)')
' the separate kt domain is redundant.'
237 write(6, fmt=
'(a)')
' Therefore, consider setting KTMAX to 1.'
238 write(6, fmt=
'(a)')
' '
247 #if ((TSURFACE == 5) && (ACCSURFACE != 5))
248 stop
' sico_init: Options TSURFACE==5 and ACCSURFACE==5 must be used together!'
251 #if ((TSURFACE != 5) && (ACCSURFACE == 5))
252 stop
' sico_init: Options TSURFACE==5 and ACCSURFACE==5 must be used together!'
259 stop
' sico_init: Option ADV_HOR==1 (central differences) not defined!'
267 #if ((MARGIN==3 && DYNAMICS==1) || DYNAMICS==2) /* requires SSA or SStA */
269 write(6, fmt=
'(a)')
' sico_init: Distortion correction not implemented'
270 write(6, fmt=
'(a)')
' for the shallow shelf approximation (SSA)'
271 write(6, fmt=
'(a)')
' or the shelfy stream approximation (SStA)'
272 write(6, fmt=
'(a)')
' -> GRID==0 required!'
283 #elif (TSURFACE == 5)
292 dtime_temp0 = dtime_temp0
294 dtime_wss0 = dtime_wss0
299 dzeta_c = 1.0_dp/
real(kcmax,dp)
300 dzeta_t = 1.0_dp/
real(ktmax,dp)
301 dzeta_r = 1.0_dp/
real(krmax,dp)
310 if (deform >= eps)
then
312 flag_aa_nonzero = .true.
320 eaz_c_quotient(kc) = 0.0_dp
323 zeta_c(kc) = kc*dzeta_c
324 eaz_c(kc) = exp(aa*zeta_c(kc))
325 eaz_c_quotient(kc) = (eaz_c(kc)-1.0_dp)/(ea-1.0_dp)
331 eaz_c_quotient(kc) = 1.0_dp
335 flag_aa_nonzero = .false.
343 eaz_c_quotient(kc) = 0.0_dp
346 zeta_c(kc) = kc*dzeta_c
348 eaz_c_quotient(kc) = zeta_c(kc)
354 eaz_c_quotient(kc) = 1.0_dp
364 zeta_t(kt) = kt*dzeta_t
376 zeta_r(kr) = kr*dzeta_r
390 if ((i <= imax).and.(j <= jmax))
then
402 anfdatname = anfdatname
404 #if defined(YEAR_ZERO)
405 year_zero = year_zero
407 year_zero = 2000.0_dp
410 time_init0 = time_init0
411 time_end0 = time_end0
412 dtime_ser0 = dtime_ser0
414 #if ( OUTPUT==1 || OUTPUT==3 )
415 dtime_out0 = dtime_out0
418 #if ( OUTPUT==2 || OUTPUT==3 )
420 time_output0( 1) = time_out0_01
421 time_output0( 2) = time_out0_02
422 time_output0( 3) = time_out0_03
423 time_output0( 4) = time_out0_04
424 time_output0( 5) = time_out0_05
425 time_output0( 6) = time_out0_06
426 time_output0( 7) = time_out0_07
427 time_output0( 8) = time_out0_08
428 time_output0( 9) = time_out0_09
429 time_output0(10) = time_out0_10
430 time_output0(11) = time_out0_11
431 time_output0(12) = time_out0_12
432 time_output0(13) = time_out0_13
433 time_output0(14) = time_out0_14
434 time_output0(15) = time_out0_15
435 time_output0(16) = time_out0_16
436 time_output0(17) = time_out0_17
437 time_output0(18) = time_out0_18
438 time_output0(19) = time_out0_19
439 time_output0(20) = time_out0_20
444 shell_command =
'if [ ! -d'
445 shell_command = trim(shell_command)//
' '//outpath
446 shell_command = trim(shell_command)//
' '//
'] ; then mkdir'
447 shell_command = trim(shell_command)//
' '//outpath
448 shell_command = trim(shell_command)//
' '//
'; fi'
449 call system(trim(shell_command))
452 open(10, iostat=ios, &
453 file=outpath//
'/'//trim(runname)//
'.log', &
456 stop
'Error when opening the log file!'
458 write(10, fmt=trim(fmt1))
'Computational domain:'
459 write(10, fmt=trim(fmt1)) trim(ch_domain_long)
460 write(10, fmt=trim(fmt1))
' '
462 write(10, fmt=trim(fmt2))
'imax =', imax
463 write(10, fmt=trim(fmt2))
'jmax =', jmax
464 write(10, fmt=trim(fmt2))
'kcmax =', kcmax
465 write(10, fmt=trim(fmt2))
'ktmax =', ktmax
466 write(10, fmt=trim(fmt2))
'krmax =', krmax
467 write(10, fmt=trim(fmt1))
' '
469 write(10, fmt=trim(fmt3))
'a =', aa
470 write(10, fmt=trim(fmt1))
' '
472 #if (GRID==0 || GRID==1)
473 write(10, fmt=trim(fmt3))
'x0 =', x0
474 write(10, fmt=trim(fmt3))
'y0 =', y0
475 write(10, fmt=trim(fmt3))
'dx =', dx
477 stop
' sico_init: GRID==2 not allowed for this application!'
479 write(10, fmt=trim(fmt1))
' '
481 write(10, fmt=trim(fmt3))
'year_zero =', year_zero
482 write(10, fmt=trim(fmt3))
'time_init =', time_init0
483 write(10, fmt=trim(fmt3))
'time_end =', time_end0
484 write(10, fmt=trim(fmt3))
'dtime =', dtime0
485 write(10, fmt=trim(fmt3))
'dtime_temp =', dtime_temp0
487 write(10, fmt=trim(fmt3))
'dtime_wss =', dtime_wss0
489 #if ( OUTPUT==1 || OUTPUT==3 )
490 write(10, fmt=trim(fmt3))
'dtime_out =', dtime_out0
492 write(10, fmt=trim(fmt3))
'dtime_ser =', dtime_ser0
493 write(10, fmt=trim(fmt1))
' '
495 write(10, fmt=trim(fmt2))
'ANF_DAT =', anf_dat
496 write(10, fmt=trim(fmt1))
'zs_present file = '//zs_present_file
498 write(10, fmt=trim(fmt1))
'zl_present file = '//zl_present_file
500 write(10, fmt=trim(fmt1))
'zl0 file = '//zl0_file
501 write(10, fmt=trim(fmt1))
'mask_present file = '//mask_present_file
502 #if (ANF_DAT==1 && defined(TEMP_INIT))
503 write(10, fmt=trim(fmt2))
'TEMP_INIT =', temp_init
506 write(10, fmt=trim(fmt1))
'Initial-value file = '//anfdatname
507 write(10, fmt=trim(fmt1))
'Path to initial-value file = '//anfdatpath
509 write(10, fmt=trim(fmt1))
' '
511 write(10, fmt=trim(fmt1))
'Physical-parameter file = '//phys_para_file
512 write(10, fmt=trim(fmt1))
' '
514 #if (CALCZS==3 || CALCZS==4)
515 write(10, fmt=trim(fmt3))
'ovi_weight =', ovi_weight
517 write(10, fmt=trim(fmt3))
'omega_sor =', omega_sor
519 write(10, fmt=trim(fmt1))
' '
522 write(10, fmt=trim(fmt1))
'temp_mm_present file = '//temp_mm_present_file
524 write(10, fmt=trim(fmt3))
'delta_ts0 =', delta_ts0
526 write(10, fmt=trim(fmt3))
'sine_amplit =', sine_amplit
527 write(10, fmt=trim(fmt3))
'sine_period =', sine_period
529 write(10, fmt=trim(fmt1))
'GRIP file = '//grip_temp_file
530 write(10, fmt=trim(fmt3))
'grip_temp_fact =', grip_temp_fact
532 write(10, fmt=trim(fmt1))
'Glacial-index file = '//glac_ind_file
533 write(10, fmt=trim(fmt1))
'temp_mm_anom file = '//temp_mm_anom_file
534 write(10, fmt=trim(fmt3))
'temp_mm_anom fact = ', temp_mm_anom_fact
537 write(10, fmt=trim(fmt1))
'precip_mm_present file = '//precip_mm_present_file
539 write(10, fmt=trim(fmt3))
'accfact =', accfact
540 #elif ( ACCSURFACE==2 || ACCSURFACE==3 )
541 write(10, fmt=trim(fmt3))
'gamma_s =', gamma_s
542 #elif ( ACCSURFACE==5 )
543 write(10, fmt=trim(fmt1))
'precip_mm_anom file = '//precip_mm_anom_file
544 write(10, fmt=trim(fmt3))
'precip_mm_anom fact = ', precip_mm_anom_fact
546 #if (ACCSURFACE <= 3)
547 write(10, fmt=trim(fmt2))
'ELEV_DESERT =', elev_desert
548 #if (ELEV_DESERT == 1)
549 write(10, fmt=trim(fmt3))
'gamma_p =', gamma_p
550 write(10, fmt=trim(fmt3))
'zs_thresh =', zs_thresh
555 write(10, fmt=trim(fmt3))
'lambda_lti =', lambda_lti
556 write(10, fmt=trim(fmt3))
'temp_lti =', temp_lti
560 write(10, fmt=trim(fmt3))
'z_sl0 =', z_sl0
562 write(10, fmt=trim(fmt1))
'sea-level file = '//sea_level_file
564 write(10, fmt=trim(fmt1))
' '
567 #if ( MARINE_ICE_CALVING==2 || MARINE_ICE_CALVING==3 )
568 write(10, fmt=trim(fmt3))
'z_mar =', z_mar
569 write(10, fmt=trim(fmt1))
' '
570 #elif ( MARINE_ICE_CALVING==4 || MARINE_ICE_CALVING==5 \
571 || marine_ice_calving==6 || marine_ice_calving==7 )
572 write(10, fmt=trim(fmt3))
'fact_z_mar =', fact_z_mar
573 write(10, fmt=trim(fmt1))
' '
574 #elif ( ( MARINE_ICE_FORMATION==2 ) && ( MARINE_ICE_CALVING==9 ) )
575 write(10, fmt=trim(fmt3))
'calv_uw_coeff =', calv_uw_coeff
576 write(10, fmt=trim(fmt3))
'r1_calv_uw =', r1_calv_uw
577 write(10, fmt=trim(fmt3))
'r2_calv_uw =', r2_calv_uw
578 write(10, fmt=trim(fmt1))
' '
581 #if ICE_SHELF_CALVING==2
582 write(10, fmt=trim(fmt3))
'H_calv =', h_calv
583 write(10, fmt=trim(fmt1))
' '
587 write(10, fmt=trim(fmt3))
'c_slide =', c_slide
588 write(10, fmt=trim(fmt3))
'gamma_slide =', gamma_slide
589 write(10, fmt=trim(fmt2))
'p_weert =', p_weert
590 write(10, fmt=trim(fmt2))
'q_weert =', q_weert
592 write(10, fmt=trim(fmt3))
'red_pres_limit_fact =', red_pres_limit_fact
594 write(10, fmt=trim(fmt1))
' '
597 write(10, fmt=trim(fmt3))
'q_geo =', q_geo
599 write(10, fmt=trim(fmt1))
'q_geo file = '//q_geo_file
601 write(10, fmt=trim(fmt1))
' '
603 #if (defined(MARINE_ICE_BASAL_MELTING))
604 write(10, fmt=trim(fmt2))
'MARINE_ICE_BASAL_MELTING =', marine_ice_basal_melting
605 #if (MARINE_ICE_BASAL_MELTING==2 || MARINE_ICE_BASAL_MELTING==3)
606 write(10, fmt=trim(fmt3))
'qbm_marine =', qbm_marine
608 write(10, fmt=trim(fmt1))
' '
611 write(10, fmt=trim(fmt2))
'REBOUND =', rebound
613 write(10, fmt=trim(fmt3))
'frac_llra =', frac_llra
615 #if (REBOUND==1 || REBOUND==2)
616 write(10, fmt=trim(fmt2))
'TIME_LAG_MOD =', time_lag_mod
617 #if (TIME_LAG_MOD==1)
618 write(10, fmt=trim(fmt3))
'time_lag =', time_lag
619 #elif (TIME_LAG_MOD==2)
620 write(10, fmt=trim(fmt1))
'time_lag_file = '//time_lag_file
622 stop
' sico_init: TIME_LAG_MOD must be either 1 or 2!'
626 write(10, fmt=trim(fmt2))
'FLEX_RIG_MOD =', flex_rig_mod
627 #if (FLEX_RIG_MOD==1)
628 write(10, fmt=trim(fmt3))
'flex_rig =', flex_rig
629 #elif (FLEX_RIG_MOD==2)
630 write(10, fmt=trim(fmt1))
'flex_rig_file = '//flex_rig_file
632 stop
' sico_init: FLEX_RIG_MOD must be either 1 or 2!'
635 write(10, fmt=trim(fmt2))
'Q_LITHO =', q_litho
636 write(10, fmt=trim(fmt1))
' '
639 write(10, fmt=trim(fmt3))
'gr_size =', gr_size
640 write(10, fmt=trim(fmt1))
' '
643 write(10, fmt=trim(fmt3))
'sigma_res =', sigma_res
644 write(10, fmt=trim(fmt1))
' '
647 write(10, fmt=trim(fmt2))
'ENHMOD =', enhmod
648 #if (ENHMOD==1 || ENHMOD==2 || ENHMOD==3)
649 write(10, fmt=trim(fmt3))
'enh_fact =', enh_fact
651 #if (ENHMOD==2 || ENHMOD==3)
652 write(10, fmt=trim(fmt3))
'enh_intg =', enh_intg
655 write(10, fmt=trim(fmt3))
'age_trans =', age_trans_0
658 write(10, fmt=trim(fmt3))
'date_trans1 =', date_trans1_0
659 write(10, fmt=trim(fmt3))
'date_trans2 =', date_trans2_0
660 write(10, fmt=trim(fmt3))
'date_trans3 =', date_trans3_0
662 #if (ENHMOD==4 || ENHMOD==5)
663 write(10, fmt=trim(fmt3))
'enh_compr =', enh_compr
664 write(10, fmt=trim(fmt3))
'enh_shear =', enh_shear
666 #if ((ENHMOD==1 || ENHMOD==2 || ENHMOD==3 || ENHMOD==4) && MARGIN==3)
667 write(10, fmt=trim(fmt3))
'enh_shelf =', enh_shelf
669 write(10, fmt=trim(fmt1))
' '
671 write(10, fmt=trim(fmt3))
'numdiff_H_t =', numdiff_h_t
672 write(10, fmt=trim(fmt3))
'tau_cts =', tau_cts
673 write(10, fmt=trim(fmt3))
'H_min =', h_min
674 write(10, fmt=trim(fmt3))
'vh_max =', vh_max
675 write(10, fmt=trim(fmt3))
'hd_min =', hd_min
676 write(10, fmt=trim(fmt3))
'hd_max =', hd_max
678 write(10, fmt=trim(fmt3))
'qbm_min =', qbm_min
679 #elif defined(QB_MIN) /* obsolete */
680 write(10, fmt=trim(fmt3))
'qb_min =', qb_min
683 write(10, fmt=trim(fmt3))
'qbm_max =', qbm_max
684 #elif defined(QB_MAX) /* obsolete */
685 write(10, fmt=trim(fmt3))
'qb_max =', qb_max
687 write(10, fmt=trim(fmt3))
'age_min =', age_min
688 write(10, fmt=trim(fmt3))
'age_max =', age_max
689 write(10, fmt=trim(fmt3))
'mean_accum =', mean_accum
691 write(10, fmt=trim(fmt3))
'age_diff =', agediff
693 write(10, fmt=trim(fmt1))
' '
695 write(10, fmt=trim(fmt2))
'GRID =', grid
696 write(10, fmt=trim(fmt2))
'DYNAMICS =', dynamics
697 #if (DYNAMICS==2 && defined(RATIO_SL_THRESH))
698 write(10, fmt=trim(fmt3))
'ratio_sl_thresh =', ratio_sl_thresh
700 write(10, fmt=trim(fmt2))
'CALCMOD =', calcmod
701 #if ( CALCMOD==-1 && defined(TEMP_CONST) )
702 write(10, fmt=trim(fmt3))
'TEMP_CONST =', temp_const
704 #if ( CALCMOD==-1 && defined(AGE_CONST) )
705 write(10, fmt=trim(fmt3))
'AGE_CONST =', age_const
707 #if ( CALCMOD==1 && defined(CTS_MELTING_FREEZING) )
708 write(10, fmt=trim(fmt2))
'CTS_MELTING_FREEZING =', cts_melting_freezing
710 write(10, fmt=trim(fmt2))
'FLOW_LAW =', flow_law
711 write(10, fmt=trim(fmt2))
'FIN_VISC =', fin_visc
712 write(10, fmt=trim(fmt2))
'MARGIN =', margin
714 write(10, fmt=trim(fmt2))
'MARINE_ICE_FORMATION =', marine_ice_formation
715 write(10, fmt=trim(fmt2))
'MARINE_ICE_CALVING =', marine_ice_calving
717 write(10, fmt=trim(fmt2))
'ICE_SHELF_CALVING =', ice_shelf_calving
719 write(10, fmt=trim(fmt2))
'ZS_EVOL =', zs_evol
720 write(10, fmt=trim(fmt2))
'CALCZS =', calczs
721 write(10, fmt=trim(fmt2))
'ADV_HOR =', adv_hor
722 write(10, fmt=trim(fmt2))
'ADV_VERT =', adv_vert
723 write(10, fmt=trim(fmt2))
'TOPOGRAD =', topograd
724 write(10, fmt=trim(fmt2))
'TSURFACE =', tsurface
725 write(10, fmt=trim(fmt2))
'ACCSURFACE =', accsurface
727 write(10, fmt=trim(fmt2))
'PRECIP_ANOM_INTERPOL =', precip_anom_interpol
729 write(10, fmt=trim(fmt2))
'SOLID_PRECIP =', solid_precip
730 write(10, fmt=trim(fmt2))
'ABLSURFACE =', ablsurface
731 write(10, fmt=trim(fmt2))
'SEA_LEVEL =', sea_level
732 write(10, fmt=trim(fmt2))
'SLIDE_LAW =', slide_law
733 write(10, fmt=trim(fmt2))
'Q_GEO_MOD =', q_geo_mod
734 write(10, fmt=trim(fmt1))
' '
736 #if defined(OUT_TIMES)
737 write(10, fmt=trim(fmt2))
'OUT_TIMES =', out_times
739 write(10, fmt=trim(fmt2))
'OUTPUT =', output
740 write(10, fmt=trim(fmt2))
'OUTSER =', outser
741 #if defined(OUTSER_V_A)
742 write(10, fmt=trim(fmt2))
'OUTSER_V_A =', outser_v_a
744 #if ( OUTPUT==1 || OUTPUT==2 )
745 write(10, fmt=trim(fmt2))
'ERGDAT =', ergdat
747 write(10, fmt=trim(fmt2))
'NETCDF =', netcdf
748 write(10, fmt=trim(fmt1))
' '
749 #if ( OUTPUT==2 || OUTPUT==3 )
750 write(10, fmt=trim(fmt2))
'n_output =', n_output
752 write(10, fmt=trim(fmt3))
'time_output =', time_output0(n)
754 write(10, fmt=trim(fmt1))
' '
757 write(10, fmt=trim(fmt1))
'Program version and date: '//version//
' / '//date
759 close(10, status=
'keep')
763 year_zero = year_zero*year_sec
764 time_init = time_init0*year_sec
765 time_end = time_end0*year_sec
766 dtime = dtime0*year_sec
767 dtime_temp = dtime_temp0*year_sec
769 dtime_wss = dtime_wss0*year_sec
771 dtime_ser = dtime_ser0*year_sec
772 #if ( OUTPUT==1 || OUTPUT==3 )
773 dtime_out = dtime_out0*year_sec
775 #if ( OUTPUT==2 || OUTPUT==3 )
777 time_output(n) = time_output0(n)*year_sec
781 if (abs(dtime_temp/dtime-nint(dtime_temp/dtime)) > eps) &
782 stop
' sico_init: dtime_temp must be a multiple of dtime!'
785 if (abs(dtime_wss/dtime-nint(dtime_wss/dtime)) > eps) &
786 stop
' sico_init: dtime_wss must be a multiple of dtime!'
793 #if (GRID==0 || GRID==1)
795 open(21, iostat=ios, &
796 file=inpath//
'/'//trim(ch_domain_short)//
'/'//precip_mm_present_file, &
797 recl=16384, status=
'old')
801 stop
' sico_init: GRID==2 not allowed for the Scandinavia application!'
805 if (ios /= 0) stop
' sico_init: Error when opening the precipitation file!'
807 do m=1, 6;
read(21, fmt=
'(a)') ch_dummy;
end do
810 do m=1, 3;
read(21, fmt=
'(a)') ch_dummy;
end do
812 read(21, fmt=*) (precip_present(j,i,n), i=0,imax)
816 close(21, status=
'keep')
820 precip_present = precip_present *(1.0e-03_dp/year_sec)*(rho_w/rho)
827 #if (GRID==0 || GRID==1)
829 open(21, iostat=ios, &
830 file=inpath//
'/'//trim(ch_domain_short)//
'/'//precip_mm_anom_file, &
831 recl=16384, status=
'old')
835 if (ios /= 0) stop
' sico_init: Error when opening the precip anomaly file!'
837 do m=1, 6;
read(21, fmt=
'(a)') ch_dummy;
end do
840 do m=1, 3;
read(21, fmt=
'(a)') ch_dummy;
end do
842 read(21, fmt=*) (precip_lgm_anom(j,i,n), i=0,imax)
846 close(21, status=
'keep')
848 precip_lgm_anom = precip_lgm_anom * precip_mm_anom_fact
853 #if (PRECIP_ANOM_INTERPOL==1)
855 gamma_precip_lgm_anom(j,i,n) = 0.0_dp
857 #elif (PRECIP_ANOM_INTERPOL==2)
859 gamma_precip_lgm_anom(j,i,n) = -log(precip_lgm_anom(j,i,n))
862 stop
' sico_init: Wrong value of switch PRECIP_ANOM_INTERPOL!'
872 mean_accum = mean_accum*(1.0e-03_dp/year_sec)*(rho_w/rho)
877 #if (GRID==0 || GRID==1)
879 open(24, iostat=ios, &
880 file=inpath//
'/'//trim(ch_domain_short)//
'/'//mask_present_file, &
881 recl=2048, status=
'old')
885 stop
' sico_init: GRID==2 not allowed for the Scandinavia application!'
890 stop
' sico_init: Error when opening the mask file!'
892 do m=1, 6;
read(24, fmt=
'(a)') ch_dummy;
end do
895 read(24, fmt=trim(fmt4)) (maske_help(j,i), i=0,imax)
898 close(24, status=
'keep')
902 #if (GRID==0 || GRID==1)
904 open(21, iostat=ios, &
905 file=inpath//
'/'//trim(ch_domain_short)//
'/'//temp_mm_present_file, &
906 recl=16384, status=
'old')
910 stop
' sico_init: GRID==2 not allowed for the Scandinavia application!'
914 if (ios /= 0) stop
' sico_init: Error when opening the temperature file!'
916 do m=1, 6;
read(21, fmt=
'(a)') ch_dummy;
end do
919 do m=1, 3;
read(21, fmt=
'(a)') ch_dummy;
end do
921 read(21, fmt=*) (temp_mm_present(j,i,n), i=0,imax)
925 close(21, status=
'keep')
931 #if (GRID==0 || GRID==1)
933 open(21, iostat=ios, &
934 file=inpath//
'/'//trim(ch_domain_short)//
'/'//temp_mm_anom_file, &
935 recl=16384, status=
'old')
939 if (ios /= 0) stop
' sico_init: Error when opening the temperature anomaly file!'
941 do m=1, 6;
read(21, fmt=
'(a)') ch_dummy;
end do
944 do m=1, 3;
read(21, fmt=
'(a)') ch_dummy;
end do
946 read(21, fmt=*) (temp_mm_lgm_anom(j,i,n), i=0,imax)
950 close(21, status=
'keep')
952 temp_mm_lgm_anom = temp_mm_lgm_anom * temp_mm_anom_fact
959 #if (GRID==0 || GRID==1)
961 open(21, iostat=ios, &
962 file=inpath//
'/'//trim(ch_domain_short)//
'/'//zs_present_file, &
963 recl=8192, status=
'old')
967 stop
' sico_init: GRID==2 not allowed for the Scandinavia application!'
971 if (ios /= 0) stop
' sico_init: Error when opening the zs file!'
973 do m=1, 6;
read(21, fmt=
'(a)') ch_dummy;
end do
976 read(21, fmt=*) (zs_ref(j,i), i=0,imax)
979 close(21, status=
'keep')
986 if (maske_help(j,i) >= 2) zs_ref(j,i) = 0.0_dp
994 open(21, iostat=ios, &
995 file=inpath//
'/general/'//grip_temp_file, &
998 stop
' sico_init: Error when opening the data file for delta_ts!'
1000 read(21, fmt=*) ch_dummy, grip_time_min, grip_time_stp, grip_time_max
1002 if (ch_dummy /=
'#')
then
1003 write(6, fmt=*)
' sico_init: grip_time_min, grip_time_stp, grip_time_max'
1004 write(6, fmt=*)
' not defined in data file for delta_ts!'
1008 ndata_grip = (grip_time_max-grip_time_min)/grip_time_stp
1010 allocate(griptemp(0:ndata_grip))
1013 read(21, fmt=*) d_dummy, griptemp(n)
1016 close(21, status=
'keep')
1024 open(21, iostat=ios, &
1025 file=inpath//
'/general/'//glac_ind_file, status=
'old')
1026 if (ios /= 0) stop
' sico_init: Error when opening the glacial-index file!'
1028 read(21, fmt=*) ch_dummy, gi_time_min, gi_time_stp, gi_time_max
1030 if (ch_dummy /=
'#')
then
1031 write(6, fmt=*)
' sico_init: gi_time_min, gi_time_stp, gi_time_max'
1032 write(6, fmt=*)
' not defined in glacial-index file!'
1036 ndata_gi = (gi_time_max-gi_time_min)/gi_time_stp
1038 allocate(glacial_index(0:ndata_gi))
1041 read(21, fmt=*) d_dummy, glacial_index(n)
1044 close(21, status=
'keep')
1052 open(21, iostat=ios, &
1053 file=inpath//
'/general/'//sea_level_file, &
1056 stop
' sico_init: Error when opening the data file for z_sl!'
1058 read(21, fmt=*) ch_dummy, specmap_time_min, specmap_time_stp, specmap_time_max
1060 if (ch_dummy /=
'#')
then
1061 write(6, fmt=*)
' sico_init: specmap_time_min, specmap_time_stp, specmap_time_max'
1062 write(6, fmt=*)
' not defined in data file for z_sl!'
1066 ndata_specmap = (specmap_time_max-specmap_time_min)/specmap_time_stp
1068 allocate(specmap_zsl(0:ndata_specmap))
1070 do n=0, ndata_specmap
1071 read(21, fmt=*) d_dummy, specmap_zsl(n)
1074 close(21, status=
'keep')
1086 q_geo(j,i) = q_geo *1.0e-03_dp
1094 open(21, iostat=ios, &
1095 file=inpath//
'/'//trim(ch_domain_short)//
'/'//q_geo_file, &
1096 recl=8192, status=
'old')
1098 if (ios /= 0) stop
' sico_init: Error when opening the qgeo file!'
1100 do m=1, 6;
read(21, fmt=
'(a)') ch_dummy;
end do
1103 read(21, fmt=*) (q_geo(j,i), i=0,imax)
1106 close(21, status=
'keep')
1110 q_geo(j,i) = q_geo(j,i) *1.0e-03_dp
1118 #if (REBOUND==0 || REBOUND==1)
1120 kei = 0.0_dp; n_data_kei = 0; kei_r_max = 0.0_dp; kei_r_incr = 0.0_dp
1131 #if (REBOUND==1 || REBOUND==2)
1133 #if (TIME_LAG_MOD==1)
1135 time_lag_asth = time_lag*year_sec
1137 #elif (TIME_LAG_MOD==2)
1139 open(29, iostat=ios, &
1140 file=inpath//
'/'//trim(ch_domain_short)//
'/'//time_lag_file, &
1141 recl=8192, status=
'old')
1143 if (ios /= 0) stop
' sico_init: Error when opening the time-lag file!'
1145 do n=1, 6;
read(29, fmt=
'(a)') ch_dummy;
end do
1148 read(29, fmt=*) (time_lag_asth(j,i), i=0,imax)
1151 close(29, status=
'keep')
1153 time_lag_asth = time_lag_asth*year_sec
1159 time_lag_asth = 0.0_dp
1167 #if (FLEX_RIG_MOD==1)
1169 flex_rig_lith = flex_rig
1171 #elif (FLEX_RIG_MOD==2)
1173 open(29, iostat=ios, &
1174 file=inpath//
'/'//trim(ch_domain_short)//
'/'//flex_rig_file, &
1175 recl=8192, status=
'old')
1177 if (ios /= 0) stop
' sico_init: Error when opening the flex-rig file!'
1179 do n=1, 6;
read(29, fmt=
'(a)') ch_dummy;
end do
1182 read(29, fmt=*) (flex_rig_lith(j,i), i=0,imax)
1185 close(29, status=
'keep')
1189 #elif (REBOUND==0 || REBOUND==1)
1191 flex_rig_lith = 0.0_dp
1201 stop
' sico_init: ANF_DAT==1 not allowed for scand application!'
1211 call
boundary(time_init, dtime, dxi, deta, &
1212 delta_ts, glac_index, z_sl, dzsl_dtau, z_mar)
1234 stop
' sico_init: Parameter NETCDF must be either 1 or 2!'
1237 call
boundary(time_init, dtime, dxi, deta, &
1238 delta_ts, glac_index, z_sl, dzsl_dtau, z_mar)
1240 q_b_tot = q_bm + q_tld
1246 flag_grounding_line_1 = .false.
1247 flag_grounding_line_2 = .false.
1249 flag_calving_front_1 = .false.
1250 flag_calving_front_2 = .false.
1252 #if (MARGIN==1 || MARGIN==2)
1261 if ( (maske(j,i)==0_i2b) &
1263 ( (maske(j,i+1)==3_i2b) &
1264 .or.(maske(j,i-1)==3_i2b) &
1265 .or.(maske(j+1,i)==3_i2b) &
1266 .or.(maske(j-1,i)==3_i2b) ) &
1268 flag_grounding_line_1(j,i) = .true.
1270 if ( (maske(j,i)==3_i2b) &
1272 ( (maske(j,i+1)==0_i2b) &
1273 .or.(maske(j,i-1)==0_i2b) &
1274 .or.(maske(j+1,i)==0_i2b) &
1275 .or.(maske(j-1,i)==0_i2b) ) &
1277 flag_grounding_line_2(j,i) = .true.
1279 if ( (maske(j,i)==3_i2b) &
1281 ( (maske(j,i+1)==2_i2b) &
1282 .or.(maske(j,i-1)==2_i2b) &
1283 .or.(maske(j+1,i)==2_i2b) &
1284 .or.(maske(j-1,i)==2_i2b) ) &
1286 flag_calving_front_1(j,i) = .true.
1288 if ( (maske(j,i)==2_i2b) &
1290 ( (maske(j,i+1)==3_i2b) &
1291 .or.(maske(j,i-1)==3_i2b) &
1292 .or.(maske(j+1,i)==3_i2b) &
1293 .or.(maske(j-1,i)==3_i2b) ) &
1295 flag_calving_front_2(j,i) = .true.
1303 if ( (maske(j,i)==2_i2b) &
1304 .and. (maske(j+1,i)==3_i2b) &
1306 flag_calving_front_2(j,i) = .true.
1309 if ( (maske(j,i)==2_i2b) &
1310 .and. (maske(j-1,i)==3_i2b) &
1312 flag_calving_front_2(j,i) = .true.
1319 if ( (maske(j,i)==2_i2b) &
1320 .and. (maske(j,i+1)==3_i2b) &
1322 flag_calving_front_2(j,i) = .true.
1325 if ( (maske(j,i)==2_i2b) &
1326 .and. (maske(j,i-1)==3_i2b) &
1328 flag_calving_front_2(j,i) = .true.
1333 stop
' sico_init: MARGIN must be either 1, 2 or 3!'
1338 #if (GRID==0 || GRID==1)
1342 dist_dxdy(jr,ir) = sqrt( (
real(ir,dp)*dxi)**2 + (
real(jr,dp)*deta)**2 )
1353 #if (DYNAMICS==1 || DYNAMICS==2)
1358 #if (MARGIN==3 || DYNAMICS==2)
1359 call
calc_vxy_ssa(z_sl, dxi, deta, dzeta_c, dzeta_t, ii, jj, nn)
1374 stop
' sico_init: DYNAMICS must be either 0, 1 or 2!'
1377 call
calc_dxyz(dxi, deta, dzeta_c, dzeta_t)
1381 #if (CALCMOD==0 || CALCMOD==-1)
1391 enth_t(kt,j,i) = enth_c(0,j,i)
1406 if ( (maske(j,i) == 0_i2b).and.(n_cts(j,i) == 1_i2b) )
then
1412 enth_t(kt,j,i) = enth_c(0,j,i)
1419 #elif (CALCMOD==2 || CALCMOD==3)
1429 enth_t(kt,j,i) = enth_c(0,j,i)
1437 stop
' sico_init: Parameter CALCMOD must be either -1, 0, 1, 2 or 3!'
1445 open(12, iostat=ios, &
1446 file=outpath//
'/'//trim(runname)//
'.ser', &
1449 stop
' sico_init: Error when opening the ser file!'
1451 if (forcing_flag == 1)
then
1456 #if ( !defined(OUTSER_V_A) || OUTSER_V_A==1 )
1458 1102
format(
' t(a) D_Ts(deg C) z_sl(m)',/, &
1459 ' H_max(m) zs_max(m) V_g(m^3)', &
1460 ' V_t(m^3) V_fw(m^3/a) V_sle(m)',/, &
1461 ' A_g(m^2) A_t(m^2) V_bm(m^3/a)', &
1462 ' V_tld(m^3/a) H_t_max(m) vs_max(m/a)')
1463 1103
format(
'----------------------------------------------------', &
1464 '---------------------------------------')
1468 1102
format(
' t(a) D_Ts(deg C) z_sl(m)',/, &
1469 ' V(m^3) V_g(m^3) V_f(m^3)', &
1470 ' A(m^2) A_g(m^2) A_f(m^2)',/, &
1471 ' H_max(m) zs_max(m)', &
1472 ' V_t(m^3) V_fw(m^3/a) V_sle(m)',/, &
1473 ' A_t(m^2) V_bm(m^3/a)', &
1474 ' V_tld(m^3/a) H_t_max(m) vs_max(m/a)')
1475 1103
format(
'----------------------------------------------------', &
1476 '---------------------------------------')
1479 stop
' sico_init: OUTSER_V_A must be either 1 or 2!'
1482 else if (forcing_flag == 2)
then
1487 #if ( !defined(OUTSER_V_A) || OUTSER_V_A==1 )
1489 1112
format(
' t(a) glac_ind(1) z_sl(m)',/, &
1490 ' H_max(m) zs_max(m) V_g(m^3)', &
1491 ' V_t(m^3) V_fw(m^3/a) V_sle(m)',/, &
1492 ' A_g(m^2) A_t(m^2) V_bm(m^3/a)', &
1493 ' V_tld(m^3/a) H_t_max(m) vs_max(m/a)')
1494 1113
format(
'----------------------------------------------------', &
1495 '---------------------------------------')
1499 1112
format(
' t(a) glac_ind(1) z_sl(m)',/, &
1500 ' V(m^3) V_g(m^3) V_f(m^3)', &
1501 ' A(m^2) A_g(m^2) A_f(m^2)',/, &
1502 ' H_max(m) zs_max(m)', &
1503 ' V_t(m^3) V_fw(m^3/a) V_sle(m)',/, &
1504 ' A_t(m^2) V_bm(m^3/a)', &
1505 ' V_tld(m^3/a) H_t_max(m) vs_max(m/a)')
1506 1113
format(
'----------------------------------------------------', &
1507 '---------------------------------------')
1510 stop
' sico_init: OUTSER_V_A must be either 1 or 2!'
1519 open(13, iostat=ios, &
1520 file=outpath//
'/'//trim(runname)//
'.thk', &
1522 if (ios /= 0) stop
' sico_init: Error when opening the thk file!'
1524 if (forcing_flag == 1)
then
1529 1104
format(
' t(a) D_Ts(deg C) z_sl(m)',/, &
1530 ' H(m): JMAX+1 records [j = JMAX (-1) 0] with',/, &
1531 ' IMAX+1 values [i = 0 (1) IMAX] in each record')
1532 1105
format(
'----------------------------------------------------')
1534 else if (forcing_flag == 2)
then
1539 1114
format(
' t(a) glac_ind(1) z_sl(m)',/, &
1540 ' H(m): JMAX+1 records [j = JMAX (-1) 0] with',/, &
1541 ' IMAX+1 values [i = 0 (1) IMAX] in each record')
1542 1115
format(
'----------------------------------------------------')
1553 flag_3d_output = .false.
1555 flag_3d_output = .true.
1557 stop
' sico_init: ERGDAT must be either 0 or 1!'
1561 call
output1(runname, time_init, delta_ts, glac_index, z_sl, &
1562 flag_3d_output, ndat2d, ndat3d)
1564 call
output_nc(runname, time_init, delta_ts, glac_index, z_sl, &
1565 flag_3d_output, ndat2d, ndat3d)
1567 stop
' sico_init: Parameter NETCDF must be either 1 or 2!'
1572 if (time_output(1) <= time_init+eps)
then
1575 flag_3d_output = .false.
1577 flag_3d_output = .true.
1579 stop
' sico_init: ERGDAT must be either 0 or 1!'
1583 call
output1(runname, time_init, delta_ts, glac_index, z_sl, &
1584 flag_3d_output, ndat2d, ndat3d)
1586 call
output_nc(runname, time_init, delta_ts, glac_index, z_sl, &
1587 flag_3d_output, ndat2d, ndat3d)
1589 stop
' sico_init: Parameter NETCDF must be either 1 or 2!'
1596 flag_3d_output = .false.
1599 call
output1(runname, time_init, delta_ts, glac_index, z_sl, &
1600 flag_3d_output, ndat2d, ndat3d)
1602 call
output_nc(runname, time_init, delta_ts, glac_index, z_sl, &
1603 flag_3d_output, ndat2d, ndat3d)
1605 stop
' sico_init: Parameter NETCDF must be either 1 or 2!'
1608 if (time_output(1) <= time_init+eps)
then
1610 flag_3d_output = .true.
1613 call
output1(runname, time_init, delta_ts, glac_index, z_sl, &
1614 flag_3d_output, ndat2d, ndat3d)
1616 call
output_nc(runname, time_init, delta_ts, glac_index, z_sl, &
1617 flag_3d_output, ndat2d, ndat3d)
1619 stop
' sico_init: Parameter NETCDF must be either 1 or 2!'
1625 stop
' sico_init: OUTPUT must be either 1, 2 or 3!'
1628 call
output2(time_init, dxi, deta, delta_ts, glac_index, z_sl)
1630 call
output3(time_init, delta_ts, glac_index, z_sl)
subroutine calc_vz_ssa(z_sl, dxi, deta, dzeta_c)
Computation of the vertical velocity vz in the shallow shelf approximation.
subroutine calc_vxy_static()
Computation of the horizontal velocity vx, vy, the horizontal volume flux qx, qy etc. for static ice.
subroutine calc_vxy_sia(dzeta_c, dzeta_t)
Computation of the shear stresses txz, tyz, the effective shear stress sigma, the depth-averaged flui...
subroutine, public ice_mat_eqs_pars(RF_table, R_T_val, KAPPA_table, C_table, n_temp_min, n_temp_max, RHO_I_val, RHO_C_val, KAPPA_C_val, C_C_val)
Setting of required physical parameters.
subroutine output2(time, dxi, deta, delta_ts, glac_index, z_sl)
Writing of time-series data on file in ASCII format.
subroutine phys_para()
Reading of physical parameters.
Declarations of kind types for SICOPOLIS.
subroutine topography3(dxi, deta, z_sl, anfdatname)
Definition of the initial surface and bedrock topography (including gradients) and of the horizontal ...
subroutine output3(time, delta_ts, glac_index, z_sl)
Writing of time-series data of the ice thickness field on file in ASCII format.
subroutine topography3_nc(dxi, deta, z_sl, anfdatname)
Definition of the initial surface and bedrock topography (including gradients) and of the horizontal ...
subroutine calc_temp_melt()
Computation of the melting temperatures.
subroutine output_nc(runname, time, delta_ts, glac_index, z_sl, flag_3d_output, ndat2d, ndat3d)
Writing of time-slice files in NetCDF format.
subroutine calc_vxy_ssa(z_sl, dxi, deta, dzeta_c, dzeta_t, ii, jj, nn)
Computation of the horizontal velocity vx, vy, the horizontal volume flux qx, qy and the flux across ...
Declarations of global variables for SICOPOLIS (for the ANT domain).
subroutine topography2(dxi, deta)
Definition of the initial surface and bedrock topography (including gradients) and of the horizontal ...
subroutine calc_vz_static()
Computation of the vertical velocity vz for static ice.
subroutine calc_dxyz(dxi, deta, dzeta_c, dzeta_t)
Computation of all components of the strain-rate tensor, the full effective strain rate and the shear...
subroutine calc_enhance(time)
Computation of the flow enhancement factor.
subroutine, public calc_c_int_table(c_table, n_tmp_min, n_tmp_max, L_val)
Computation of the temperature integral of the specific heat of ice as a table (c_int_table). Further, definition of the latent heat of ice.
subroutine calc_vxy_b_sia(time, z_sl)
Computation of the basal horizontal velocity vx_b, vy_b in the shallow ice approximation.
subroutine sico_init(delta_ts, glac_index, mean_accum, dtime, dtime_temp, dtime_wss, dtime_out, dtime_ser, time, time_init, time_end, time_output, dxi, deta, dzeta_c, dzeta_t, dzeta_r, z_sl, dzsl_dtau, z_mar, ii, jj, nn, ndat2d, ndat3d, n_output, runname)
Initialisations for SICOPOLIS.
subroutine boundary(time, dtime, dxi, deta, delta_ts, glac_index, z_sl, dzsl_dtau, z_mar)
Computation of the surface temperature (must be less than 0 deg C!) and of the accumulation-ablation ...
subroutine read_kei()
Reading of the tabulated kei function.
subroutine init_temp_water_age()
Initial temperature, water content and age.
Material quantities of ice: Rate factor, heat conductivity, specific heat (heat capacity).
Declarations of global variables for SICOPOLIS.
subroutine, public calc_c_int_inv_table()
Computation of the inverse of the temperature integral of the specific heat of ice as a table (c_int_...
Conversion from temperature (temp) and water content (omega) to enthalpy (enth) and vice versa...
subroutine calc_vz_sia(dxi, deta, dzeta_c, dzeta_t)
Computation of the vertical velocity vz in the shallow ice approximation.
subroutine output1(runname, time, delta_ts, glac_index, z_sl, flag_3d_output, ndat2d, ndat3d)
Writing of time-slice files in binary format.
real(dp) function, public enth_fct_temp_omega(temp_val, omega_val)
Enthalpy as a function of temperature and water content.