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 stop
' sico_init: GRID==0 or 1 not allowed for the Tibet application!'
204 if ( (abs(dlambda-1.0_dp/3.0_dp) < eps) &
205 .and.(abs(dphi- 1.0_dp/3.0_dp) < eps) )
then
207 if ((imax /= 135).or.(jmax /= 51))
then
208 stop
' sico_init: IMAX and/or JMAX wrong!'
211 else if ( (abs(dlambda-1.0_dp/6.0_dp) < eps) &
212 .and.(abs(dphi -1.0_dp/6.0_dp) < eps) )
then
214 if ((imax /= 270).or.(jmax /= 102))
then
215 stop
' sico_init: IMAX and/or JMAX wrong!'
218 else if ( (abs(dlambda-1.0_dp/12.0_dp) < eps) &
219 .and.(abs(dphi -1.0_dp/12.0_dp) < eps) )
then
221 if ((imax /= 540).or.(jmax /= 204))
then
222 stop
' sico_init: IMAX and/or JMAX wrong!'
226 stop
' sico_init: DLAMBDA / DPHI wrong!'
235 #if (CALCMOD==0 || CALCMOD==2 || CALCMOD==3 || CALCMOD==-1)
238 write(6, fmt=
'(a)')
' sico_init: For options CALCMOD==0, 2, 3 or -1,'
239 write(6, fmt=
'(a)')
' the separate kt domain is redundant.'
240 write(6, fmt=
'(a)')
' Therefore, consider setting KTMAX to 1.'
241 write(6, fmt=
'(a)')
' '
250 #if ((TSURFACE == 5) && (ACCSURFACE != 5))
251 stop
' sico_init: Options TSURFACE==5 and ACCSURFACE==5 must be used together!'
254 #if ((TSURFACE != 5) && (ACCSURFACE == 5))
255 stop
' sico_init: Options TSURFACE==5 and ACCSURFACE==5 must be used together!'
262 stop
' sico_init: Option ADV_HOR==1 (central differences) not defined!'
270 #if ((MARGIN==3 && DYNAMICS==1) || DYNAMICS==2) /* requires SSA or SStA */
272 write(6, fmt=
'(a)')
' sico_init: Distortion correction not implemented'
273 write(6, fmt=
'(a)')
' for the shallow shelf approximation (SSA)'
274 write(6, fmt=
'(a)')
' or the shelfy stream approximation (SStA)'
275 write(6, fmt=
'(a)')
' -> GRID==0 required!'
286 #elif (TSURFACE == 5)
295 dtime_temp0 = dtime_temp0
297 dtime_wss0 = dtime_wss0
302 dzeta_c = 1.0_dp/
real(kcmax,dp)
303 dzeta_t = 1.0_dp/
real(ktmax,dp)
304 dzeta_r = 1.0_dp/
real(krmax,dp)
313 if (deform >= eps)
then
315 flag_aa_nonzero = .true.
323 eaz_c_quotient(kc) = 0.0_dp
326 zeta_c(kc) = kc*dzeta_c
327 eaz_c(kc) = exp(aa*zeta_c(kc))
328 eaz_c_quotient(kc) = (eaz_c(kc)-1.0_dp)/(ea-1.0_dp)
334 eaz_c_quotient(kc) = 1.0_dp
338 flag_aa_nonzero = .false.
346 eaz_c_quotient(kc) = 0.0_dp
349 zeta_c(kc) = kc*dzeta_c
351 eaz_c_quotient(kc) = zeta_c(kc)
357 eaz_c_quotient(kc) = 1.0_dp
367 zeta_t(kt) = kt*dzeta_t
379 zeta_r(kr) = kr*dzeta_r
393 if ((i <= imax).and.(j <= jmax))
then
405 anfdatname = anfdatname
407 #if defined(YEAR_ZERO)
408 year_zero = year_zero
410 year_zero = 2000.0_dp
413 time_init0 = time_init0
414 time_end0 = time_end0
415 dtime_ser0 = dtime_ser0
417 #if ( OUTPUT==1 || OUTPUT==3 )
418 dtime_out0 = dtime_out0
421 #if ( OUTPUT==2 || OUTPUT==3 )
423 time_output0( 1) = time_out0_01
424 time_output0( 2) = time_out0_02
425 time_output0( 3) = time_out0_03
426 time_output0( 4) = time_out0_04
427 time_output0( 5) = time_out0_05
428 time_output0( 6) = time_out0_06
429 time_output0( 7) = time_out0_07
430 time_output0( 8) = time_out0_08
431 time_output0( 9) = time_out0_09
432 time_output0(10) = time_out0_10
433 time_output0(11) = time_out0_11
434 time_output0(12) = time_out0_12
435 time_output0(13) = time_out0_13
436 time_output0(14) = time_out0_14
437 time_output0(15) = time_out0_15
438 time_output0(16) = time_out0_16
439 time_output0(17) = time_out0_17
440 time_output0(18) = time_out0_18
441 time_output0(19) = time_out0_19
442 time_output0(20) = time_out0_20
447 shell_command =
'if [ ! -d'
448 shell_command = trim(shell_command)//
' '//outpath
449 shell_command = trim(shell_command)//
' '//
'] ; then mkdir'
450 shell_command = trim(shell_command)//
' '//outpath
451 shell_command = trim(shell_command)//
' '//
'; fi'
452 call system(trim(shell_command))
455 open(10, iostat=ios, &
456 file=outpath//
'/'//trim(runname)//
'.log', &
459 stop
' sico_init: Error when opening the log file!'
461 write(10, fmt=trim(fmt1))
'Computational domain:'
462 write(10, fmt=trim(fmt1)) trim(ch_domain_long)
463 write(10, fmt=trim(fmt1))
' '
465 write(10, fmt=trim(fmt2))
'imax =', imax
466 write(10, fmt=trim(fmt2))
'jmax =', jmax
467 write(10, fmt=trim(fmt2))
'kcmax =', kcmax
468 write(10, fmt=trim(fmt2))
'ktmax =', ktmax
469 write(10, fmt=trim(fmt2))
'krmax =', krmax
470 write(10, fmt=trim(fmt1))
' '
472 write(10, fmt=trim(fmt3))
'a =', aa
473 write(10, fmt=trim(fmt1))
' '
475 #if (GRID==0 || GRID==1)
476 stop
' sico_init: GRID==0 or 1 not allowed for this application!'
478 write(10, fmt=trim(fmt3))
'lambda0 =', lambda_0
479 write(10, fmt=trim(fmt3))
'phi0 =', phi_0
480 write(10, fmt=trim(fmt3))
'dlambda =', dlambda
481 write(10, fmt=trim(fmt3))
'dphi =', dphi
483 write(10, fmt=trim(fmt1))
' '
485 write(10, fmt=trim(fmt3))
'year_zero =', year_zero
486 write(10, fmt=trim(fmt3))
'time_init =', time_init0
487 write(10, fmt=trim(fmt3))
'time_end =', time_end0
488 write(10, fmt=trim(fmt3))
'dtime =', dtime0
489 write(10, fmt=trim(fmt3))
'dtime_temp =', dtime_temp0
491 write(10, fmt=trim(fmt3))
'dtime_wss =', dtime_wss0
493 #if ( OUTPUT==1 || OUTPUT==3 )
494 write(10, fmt=trim(fmt3))
'dtime_out =', dtime_out0
496 write(10, fmt=trim(fmt3))
'dtime_ser =', dtime_ser0
497 write(10, fmt=trim(fmt1))
' '
499 write(10, fmt=trim(fmt2))
'ANF_DAT =', anf_dat
500 write(10, fmt=trim(fmt1))
'zs_present file = '//zs_present_file
502 write(10, fmt=trim(fmt1))
'zl_present file = '//zl_present_file
504 write(10, fmt=trim(fmt1))
'zl0 file = '//zl0_file
505 write(10, fmt=trim(fmt1))
'mask_present file = '//mask_present_file
506 #if (ANF_DAT==1 && defined(TEMP_INIT))
507 write(10, fmt=trim(fmt2))
'TEMP_INIT =', temp_init
510 write(10, fmt=trim(fmt1))
'Initial-value file = '//anfdatname
511 write(10, fmt=trim(fmt1))
'Path to initial-value file = '//anfdatpath
513 write(10, fmt=trim(fmt1))
' '
515 write(10, fmt=trim(fmt1))
'Physical-parameter file = '//phys_para_file
516 write(10, fmt=trim(fmt1))
' '
518 #if (CALCZS==3 || CALCZS==4)
519 write(10, fmt=trim(fmt3))
'ovi_weight =', ovi_weight
521 write(10, fmt=trim(fmt3))
'omega_sor =', omega_sor
523 write(10, fmt=trim(fmt1))
' '
526 write(10, fmt=trim(fmt1))
'temp_mm_present file = '//temp_mm_present_file
528 write(10, fmt=trim(fmt3))
'delta_ts0 =', delta_ts0
530 write(10, fmt=trim(fmt3))
'sine_amplit =', sine_amplit
531 write(10, fmt=trim(fmt3))
'sine_period =', sine_period
533 write(10, fmt=trim(fmt1))
'GRIP file = '//grip_temp_file
534 write(10, fmt=trim(fmt3))
'grip_temp_fact =', grip_temp_fact
536 write(10, fmt=trim(fmt1))
'Glacial-index file = '//glac_ind_file
537 write(10, fmt=trim(fmt1))
'temp_mm_anom file = '//temp_mm_anom_file
538 write(10, fmt=trim(fmt3))
'temp_mm_anom fact = ', temp_mm_anom_fact
541 write(10, fmt=trim(fmt1))
'precip_mm_present file = '//precip_mm_present_file
543 write(10, fmt=trim(fmt3))
'accfact =', accfact
544 #elif ( ACCSURFACE==2 || ACCSURFACE==3 )
545 write(10, fmt=trim(fmt3))
'gamma_s =', gamma_s
546 #elif ( ACCSURFACE==5 )
547 write(10, fmt=trim(fmt1))
'precip_mm_anom file = '//precip_mm_anom_file
548 write(10, fmt=trim(fmt3))
'precip_mm_anom fact = ', precip_mm_anom_fact
550 #if (ACCSURFACE <= 3)
551 write(10, fmt=trim(fmt2))
'ELEV_DESERT =', elev_desert
552 #if (ELEV_DESERT == 1)
553 write(10, fmt=trim(fmt3))
'gamma_p =', gamma_p
554 write(10, fmt=trim(fmt3))
'zs_thresh =', zs_thresh
559 write(10, fmt=trim(fmt3))
'lambda_lti =', lambda_lti
560 write(10, fmt=trim(fmt3))
'temp_lti =', temp_lti
564 write(10, fmt=trim(fmt3))
'z_sl0 =', z_sl0
566 write(10, fmt=trim(fmt1))
'sea-level file = '//sea_level_file
568 write(10, fmt=trim(fmt1))
' '
571 #if ( MARINE_ICE_CALVING==2 || MARINE_ICE_CALVING==3 )
572 write(10, fmt=trim(fmt3))
'z_mar =', z_mar
573 write(10, fmt=trim(fmt1))
' '
574 #elif ( MARINE_ICE_CALVING==4 || MARINE_ICE_CALVING==5 \
575 || marine_ice_calving==6 || marine_ice_calving==7 )
576 write(10, fmt=trim(fmt3))
'fact_z_mar =', fact_z_mar
577 write(10, fmt=trim(fmt1))
' '
578 #elif ( ( MARINE_ICE_FORMATION==2 ) && ( MARINE_ICE_CALVING==9 ) )
579 write(10, fmt=trim(fmt3))
'calv_uw_coeff =', calv_uw_coeff
580 write(10, fmt=trim(fmt3))
'r1_calv_uw =', r1_calv_uw
581 write(10, fmt=trim(fmt3))
'r2_calv_uw =', r2_calv_uw
582 write(10, fmt=trim(fmt1))
' '
585 #if ICE_SHELF_CALVING==2
586 write(10, fmt=trim(fmt3))
'H_calv =', h_calv
587 write(10, fmt=trim(fmt1))
' '
591 write(10, fmt=trim(fmt3))
'c_slide =', c_slide
592 write(10, fmt=trim(fmt3))
'gamma_slide =', gamma_slide
593 write(10, fmt=trim(fmt2))
'p_weert =', p_weert
594 write(10, fmt=trim(fmt2))
'q_weert =', q_weert
596 write(10, fmt=trim(fmt3))
'red_pres_limit_fact =', red_pres_limit_fact
598 write(10, fmt=trim(fmt1))
' '
601 write(10, fmt=trim(fmt3))
'q_geo =', q_geo
603 write(10, fmt=trim(fmt1))
'q_geo file = '//q_geo_file
605 write(10, fmt=trim(fmt1))
' '
607 #if (defined(MARINE_ICE_BASAL_MELTING))
608 write(10, fmt=trim(fmt2))
'MARINE_ICE_BASAL_MELTING =', marine_ice_basal_melting
609 #if (MARINE_ICE_BASAL_MELTING==2 || MARINE_ICE_BASAL_MELTING==3)
610 write(10, fmt=trim(fmt3))
'qbm_marine =', qbm_marine
612 write(10, fmt=trim(fmt1))
' '
615 write(10, fmt=trim(fmt2))
'REBOUND =', rebound
617 write(10, fmt=trim(fmt3))
'frac_llra =', frac_llra
619 #if (REBOUND==1 || REBOUND==2)
620 write(10, fmt=trim(fmt2))
'TIME_LAG_MOD =', time_lag_mod
621 #if (TIME_LAG_MOD==1)
622 write(10, fmt=trim(fmt3))
'time_lag =', time_lag
623 #elif (TIME_LAG_MOD==2)
624 write(10, fmt=trim(fmt1))
'time_lag_file = '//time_lag_file
626 stop
' sico_init: TIME_LAG_MOD must be either 1 or 2!'
630 write(10, fmt=trim(fmt2))
'FLEX_RIG_MOD =', flex_rig_mod
631 #if (FLEX_RIG_MOD==1)
632 write(10, fmt=trim(fmt3))
'flex_rig =', flex_rig
633 #elif (FLEX_RIG_MOD==2)
634 write(10, fmt=trim(fmt1))
'flex_rig_file = '//flex_rig_file
636 stop
' sico_init: FLEX_RIG_MOD must be either 1 or 2!'
639 write(10, fmt=trim(fmt2))
'Q_LITHO =', q_litho
640 write(10, fmt=trim(fmt1))
' '
643 write(10, fmt=trim(fmt3))
'gr_size =', gr_size
644 write(10, fmt=trim(fmt1))
' '
647 write(10, fmt=trim(fmt3))
'sigma_res =', sigma_res
648 write(10, fmt=trim(fmt1))
' '
651 write(10, fmt=trim(fmt2))
'ENHMOD =', enhmod
652 #if (ENHMOD==1 || ENHMOD==2 || ENHMOD==3)
653 write(10, fmt=trim(fmt3))
'enh_fact =', enh_fact
655 #if (ENHMOD==2 || ENHMOD==3)
656 write(10, fmt=trim(fmt3))
'enh_intg =', enh_intg
659 write(10, fmt=trim(fmt3))
'age_trans =', age_trans_0
662 write(10, fmt=trim(fmt3))
'date_trans1 =', date_trans1_0
663 write(10, fmt=trim(fmt3))
'date_trans2 =', date_trans2_0
664 write(10, fmt=trim(fmt3))
'date_trans3 =', date_trans3_0
666 #if (ENHMOD==4 || ENHMOD==5)
667 write(10, fmt=trim(fmt3))
'enh_compr =', enh_compr
668 write(10, fmt=trim(fmt3))
'enh_shear =', enh_shear
670 #if ((ENHMOD==1 || ENHMOD==2 || ENHMOD==3 || ENHMOD==4) && MARGIN==3)
671 write(10, fmt=trim(fmt3))
'enh_shelf =', enh_shelf
673 write(10, fmt=trim(fmt1))
' '
675 write(10, fmt=trim(fmt3))
'numdiff_H_t =', numdiff_h_t
676 write(10, fmt=trim(fmt3))
'tau_cts =', tau_cts
677 write(10, fmt=trim(fmt3))
'H_min =', h_min
678 write(10, fmt=trim(fmt3))
'vh_max =', vh_max
679 write(10, fmt=trim(fmt3))
'hd_min =', hd_min
680 write(10, fmt=trim(fmt3))
'hd_max =', hd_max
682 write(10, fmt=trim(fmt3))
'qbm_min =', qbm_min
683 #elif defined(QB_MIN) /* obsolete */
684 write(10, fmt=trim(fmt3))
'qb_min =', qb_min
687 write(10, fmt=trim(fmt3))
'qbm_max =', qbm_max
688 #elif defined(QB_MAX) /* obsolete */
689 write(10, fmt=trim(fmt3))
'qb_max =', qb_max
691 write(10, fmt=trim(fmt3))
'age_min =', age_min
692 write(10, fmt=trim(fmt3))
'age_max =', age_max
693 write(10, fmt=trim(fmt3))
'mean_accum =', mean_accum
695 write(10, fmt=trim(fmt3))
'age_diff =', agediff
697 write(10, fmt=trim(fmt1))
' '
699 write(10, fmt=trim(fmt2))
'GRID =', grid
700 write(10, fmt=trim(fmt2))
'DYNAMICS =', dynamics
701 #if (DYNAMICS==2 && defined(RATIO_SL_THRESH))
702 write(10, fmt=trim(fmt3))
'ratio_sl_thresh =', ratio_sl_thresh
704 write(10, fmt=trim(fmt2))
'CALCMOD =', calcmod
705 #if ( CALCMOD==-1 && defined(TEMP_CONST) )
706 write(10, fmt=trim(fmt3))
'TEMP_CONST =', temp_const
708 #if ( CALCMOD==-1 && defined(AGE_CONST) )
709 write(10, fmt=trim(fmt3))
'AGE_CONST =', age_const
711 #if ( CALCMOD==1 && defined(CTS_MELTING_FREEZING) )
712 write(10, fmt=trim(fmt2))
'CTS_MELTING_FREEZING =', cts_melting_freezing
714 write(10, fmt=trim(fmt2))
'FLOW_LAW =', flow_law
715 write(10, fmt=trim(fmt2))
'FIN_VISC =', fin_visc
716 write(10, fmt=trim(fmt2))
'MARGIN =', margin
718 write(10, fmt=trim(fmt2))
'MARINE_ICE_FORMATION =', marine_ice_formation
719 write(10, fmt=trim(fmt2))
'MARINE_ICE_CALVING =', marine_ice_calving
721 write(10, fmt=trim(fmt2))
'ICE_SHELF_CALVING =', ice_shelf_calving
723 write(10, fmt=trim(fmt2))
'ZS_EVOL =', zs_evol
724 write(10, fmt=trim(fmt2))
'CALCZS =', calczs
725 write(10, fmt=trim(fmt2))
'ADV_HOR =', adv_hor
726 write(10, fmt=trim(fmt2))
'ADV_VERT =', adv_vert
727 write(10, fmt=trim(fmt2))
'TOPOGRAD =', topograd
728 write(10, fmt=trim(fmt2))
'TSURFACE =', tsurface
729 write(10, fmt=trim(fmt2))
'ACCSURFACE =', accsurface
731 write(10, fmt=trim(fmt2))
'PRECIP_ANOM_INTERPOL =', precip_anom_interpol
733 write(10, fmt=trim(fmt2))
'SOLID_PRECIP =', solid_precip
734 write(10, fmt=trim(fmt2))
'ABLSURFACE =', ablsurface
735 write(10, fmt=trim(fmt2))
'SEA_LEVEL =', sea_level
736 write(10, fmt=trim(fmt2))
'SLIDE_LAW =', slide_law
737 write(10, fmt=trim(fmt2))
'Q_GEO_MOD =', q_geo_mod
738 write(10, fmt=trim(fmt1))
' '
740 #if defined(OUT_TIMES)
741 write(10, fmt=trim(fmt2))
'OUT_TIMES =', out_times
743 write(10, fmt=trim(fmt2))
'OUTPUT =', output
744 write(10, fmt=trim(fmt2))
'OUTSER =', outser
745 #if defined(OUTSER_V_A)
746 write(10, fmt=trim(fmt2))
'OUTSER_V_A =', outser_v_a
748 #if ( OUTPUT==1 || OUTPUT==2 )
749 write(10, fmt=trim(fmt2))
'ERGDAT =', ergdat
751 write(10, fmt=trim(fmt2))
'NETCDF =', netcdf
752 write(10, fmt=trim(fmt1))
' '
753 #if ( OUTPUT==2 || OUTPUT==3 )
754 write(10, fmt=trim(fmt2))
'n_output =', n_output
756 write(10, fmt=trim(fmt3))
'time_output =', time_output0(n)
758 write(10, fmt=trim(fmt1))
' '
761 write(10, fmt=trim(fmt1))
'Program version and date: '//version//
' / '//date
763 close(10, status=
'keep')
767 year_zero = year_zero*year_sec
768 time_init = time_init0*year_sec
769 time_end = time_end0*year_sec
770 dtime = dtime0*year_sec
771 dtime_temp = dtime_temp0*year_sec
773 dtime_wss = dtime_wss0*year_sec
775 dtime_ser = dtime_ser0*year_sec
776 #if ( OUTPUT==1 || OUTPUT==3 )
777 dtime_out = dtime_out0*year_sec
779 #if ( OUTPUT==2 || OUTPUT==3 )
781 time_output(n) = time_output0(n)*year_sec
785 if (abs(dtime_temp/dtime-nint(dtime_temp/dtime)) > eps) &
786 stop
' sico_init: dtime_temp must be a multiple of dtime!'
789 if (abs(dtime_wss/dtime-nint(dtime_wss/dtime)) > eps) &
790 stop
' sico_init: dtime_wss must be a multiple of dtime!'
797 #if (GRID==0 || GRID==1)
799 stop
' sico_init: GRID==0 or 1 not allowed for the Tibet application!'
803 open(21, iostat=ios, &
804 file=inpath//
'/'//trim(ch_domain_short)//
'/'//precip_mm_present_file, &
805 recl=16384, status=
'old')
809 if (ios /= 0) stop
' sico_init: Error when opening the precipitation file!'
811 do m=1, 6;
read(21, fmt=
'(a)') ch_dummy;
end do
814 do m=1, 3;
read(21, fmt=
'(a)') ch_dummy;
end do
816 read(21, fmt=*) (precip_present(j,i,n), i=0,imax)
820 close(21, status=
'keep')
824 precip_present = precip_present *(1.0e-03_dp/year_sec)*(rho_w/rho)
833 open(21, iostat=ios, &
834 file=inpath//
'/'//trim(ch_domain_short)//
'/'//precip_mm_anom_file, &
835 recl=16384, status=
'old')
839 if (ios /= 0) stop
' sico_init: Error when opening the precip anomaly file!'
841 do m=1, 6;
read(21, fmt=
'(a)') ch_dummy;
end do
844 do m=1, 3;
read(21, fmt=
'(a)') ch_dummy;
end do
846 read(21, fmt=*) (precip_lgm_anom(j,i,n), i=0,imax)
850 close(21, status=
'keep')
852 precip_lgm_anom = precip_lgm_anom * precip_mm_anom_fact
857 #if (PRECIP_ANOM_INTERPOL==1)
859 gamma_precip_lgm_anom(j,i,n) = 0.0_dp
861 #elif (PRECIP_ANOM_INTERPOL==2)
863 gamma_precip_lgm_anom(j,i,n) = -log(precip_lgm_anom(j,i,n))
866 stop
' sico_init: Wrong value of switch PRECIP_ANOM_INTERPOL!'
876 mean_accum = mean_accum*(1.0e-03_dp/year_sec)*(rho_w/rho)
881 #if (GRID==0 || GRID==1)
883 stop
' sico_init: GRID==0 or 1 not allowed for the Tibet application!'
887 open(24, iostat=ios, &
888 file=inpath//
'/'//trim(ch_domain_short)//
'/'//mask_present_file, &
889 recl=2048, status=
'old')
894 stop
' sico_init: Error when opening the mask file!'
896 do m=1, 6;
read(24, fmt=
'(a)') ch_dummy;
end do
899 read(24, fmt=trim(fmt4)) (maske_help(j,i), i=0,imax)
902 close(24, status=
'keep')
908 open(21, iostat=ios, &
909 file=inpath//
'/'//trim(ch_domain_short)//
'/'//temp_mm_present_file, &
910 recl=16384, status=
'old')
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')
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 stop
' sico_init: GRID==0 or 1 not allowed for the Tibet application!'
965 open(21, iostat=ios, &
966 file=inpath//
'/'//trim(ch_domain_short)//
'/'//zs_present_file, &
967 recl=8192, status=
'old')
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 Tibet 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!'
1343 dist_dxdy(jr,ir) = sqrt( (sq_g11_g(jmax/2,imax/2)*
real(ir,dp)*dxi)**2 &
1344 + (sq_g22_g(jmax/2,imax/2)*
real(jr,dp)*deta)**2 )
1358 #if (DYNAMICS==1 || DYNAMICS==2)
1363 #if (MARGIN==3 || DYNAMICS==2)
1364 call
calc_vxy_ssa(z_sl, dxi, deta, dzeta_c, dzeta_t, ii, jj, nn)
1379 stop
' sico_init: DYNAMICS must be either 0, 1 or 2!'
1382 call
calc_dxyz(dxi, deta, dzeta_c, dzeta_t)
1386 #if (CALCMOD==0 || CALCMOD==-1)
1396 enth_t(kt,j,i) = enth_c(0,j,i)
1411 if ( (maske(j,i) == 0_i2b).and.(n_cts(j,i) == 1_i2b) )
then
1417 enth_t(kt,j,i) = enth_c(0,j,i)
1424 #elif (CALCMOD==2 || CALCMOD==3)
1434 enth_t(kt,j,i) = enth_c(0,j,i)
1442 stop
' sico_init: Parameter CALCMOD must be either -1, 0, 1, 2 or 3!'
1450 open(12, iostat=ios, &
1451 file=outpath//
'/'//trim(runname)//
'.ser', &
1454 stop
' sico_init: Error when opening the ser file!'
1456 if (forcing_flag == 1)
then
1461 #if ( !defined(OUTSER_V_A) || OUTSER_V_A==1 )
1463 1102
format(
' t(a) D_Ts(deg C) z_sl(m)',/, &
1464 ' H_max(m) zs_max(m) V_g(m^3)', &
1465 ' V_t(m^3) V_fw(m^3/a) V_sle(m)',/, &
1466 ' A_g(m^2) A_t(m^2) V_bm(m^3/a)', &
1467 ' V_tld(m^3/a) H_t_max(m) vs_max(m/a)')
1468 1103
format(
'----------------------------------------------------', &
1469 '---------------------------------------')
1473 1102
format(
' t(a) D_Ts(deg C) z_sl(m)',/, &
1474 ' V(m^3) V_g(m^3) V_f(m^3)', &
1475 ' A(m^2) A_g(m^2) A_f(m^2)',/, &
1476 ' H_max(m) zs_max(m)', &
1477 ' V_t(m^3) V_fw(m^3/a) V_sle(m)',/, &
1478 ' A_t(m^2) V_bm(m^3/a)', &
1479 ' V_tld(m^3/a) H_t_max(m) vs_max(m/a)')
1480 1103
format(
'----------------------------------------------------', &
1481 '---------------------------------------')
1484 stop
' sico_init: OUTSER_V_A must be either 1 or 2!'
1487 else if (forcing_flag == 2)
then
1492 #if ( !defined(OUTSER_V_A) || OUTSER_V_A==1 )
1494 1112
format(
' t(a) glac_ind(1) z_sl(m)',/, &
1495 ' H_max(m) zs_max(m) V_g(m^3)', &
1496 ' V_t(m^3) V_fw(m^3/a) V_sle(m)',/, &
1497 ' A_g(m^2) A_t(m^2) V_bm(m^3/a)', &
1498 ' V_tld(m^3/a) H_t_max(m) vs_max(m/a)')
1499 1113
format(
'----------------------------------------------------', &
1500 '---------------------------------------')
1504 1112
format(
' t(a) glac_ind(1) z_sl(m)',/, &
1505 ' V(m^3) V_g(m^3) V_f(m^3)', &
1506 ' A(m^2) A_g(m^2) A_f(m^2)',/, &
1507 ' H_max(m) zs_max(m)', &
1508 ' V_t(m^3) V_fw(m^3/a) V_sle(m)',/, &
1509 ' A_t(m^2) V_bm(m^3/a)', &
1510 ' V_tld(m^3/a) H_t_max(m) vs_max(m/a)')
1511 1113
format(
'----------------------------------------------------', &
1512 '---------------------------------------')
1515 stop
' sico_init: OUTSER_V_A must be either 1 or 2!'
1524 open(13, iostat=ios, &
1525 file=outpath//
'/'//trim(runname)//
'.thk', &
1527 if (ios /= 0) stop
' sico_init: Error when opening the thk file!'
1529 if (forcing_flag == 1)
then
1534 1104
format(
' t(a) D_Ts(deg C) z_sl(m)',/, &
1535 ' H(m): JMAX+1 records [j = JMAX (-1) 0] with',/, &
1536 ' IMAX+1 values [i = 0 (1) IMAX] in each record')
1537 1105
format(
'----------------------------------------------------')
1539 else if (forcing_flag == 2)
then
1544 1114
format(
' t(a) glac_ind(1) z_sl(m)',/, &
1545 ' H(m): JMAX+1 records [j = JMAX (-1) 0] with',/, &
1546 ' IMAX+1 values [i = 0 (1) IMAX] in each record')
1547 1115
format(
'----------------------------------------------------')
1558 flag_3d_output = .false.
1560 flag_3d_output = .true.
1562 stop
' sico_init: ERGDAT must be either 0 or 1!'
1566 call
output1(runname, time_init, delta_ts, glac_index, z_sl, &
1567 flag_3d_output, ndat2d, ndat3d)
1569 call
output_nc(runname, time_init, delta_ts, glac_index, z_sl, &
1570 flag_3d_output, ndat2d, ndat3d)
1572 stop
' sico_init: Parameter NETCDF must be either 1 or 2!'
1577 if (time_output(1) <= time_init+eps)
then
1580 flag_3d_output = .false.
1582 flag_3d_output = .true.
1584 stop
' sico_init: ERGDAT must be either 0 or 1!'
1588 call
output1(runname, time_init, delta_ts, glac_index, z_sl, &
1589 flag_3d_output, ndat2d, ndat3d)
1591 call
output_nc(runname, time_init, delta_ts, glac_index, z_sl, &
1592 flag_3d_output, ndat2d, ndat3d)
1594 stop
' sico_init: Parameter NETCDF must be either 1 or 2!'
1601 flag_3d_output = .false.
1604 call
output1(runname, time_init, delta_ts, glac_index, z_sl, &
1605 flag_3d_output, ndat2d, ndat3d)
1607 call
output_nc(runname, time_init, delta_ts, glac_index, z_sl, &
1608 flag_3d_output, ndat2d, ndat3d)
1610 stop
' sico_init: Parameter NETCDF must be either 1 or 2!'
1613 if (time_output(1) <= time_init+eps)
then
1615 flag_3d_output = .true.
1618 call
output1(runname, time_init, delta_ts, glac_index, z_sl, &
1619 flag_3d_output, ndat2d, ndat3d)
1621 call
output_nc(runname, time_init, delta_ts, glac_index, z_sl, &
1622 flag_3d_output, ndat2d, ndat3d)
1624 stop
' sico_init: Parameter NETCDF must be either 1 or 2!'
1630 stop
' sico_init: OUTPUT must be either 1, 2 or 3!'
1633 call
output2(time_init, dxi, deta, delta_ts, glac_index, z_sl)
1635 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.