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-80.0_dp) < eps)
then
105 if ( (imax /= 70).or.(jmax /= 60) &
107 stop
' sico_init: IMAX and/or JMAX wrong!'
110 else if (abs(dx-40.0_dp) < eps)
then
112 if ( ( (imax /= 140).or.(jmax /= 120) ) &
114 ( (imax /= 150).or.(jmax /= 150) ) &
116 stop
' sico_init: IMAX and/or JMAX wrong!'
119 else if (abs(dx-20.0_dp) < eps)
then
121 if ( ( (imax /= 280).or.(jmax /= 240) ) &
123 ( (imax /= 300).or.(jmax /= 300) ) &
125 stop
' sico_init: IMAX and/or JMAX wrong!'
128 else if (abs(dx-10.0_dp) < eps)
then
130 if ( (imax /= 600).or.(jmax /= 600) &
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!'
199 #if ( MARGIN == 3 && GRID != 0 )
200 write(6,
'(a)')
' sico_init: Option MARGIN==3 requires GRID==0'
201 write(6,
'(a)')
' because distortion correction is not'
202 write(6,
'(a)')
' implemented for the shallow shelf approximation!'
212 #elif (TSURFACE == 5)
216 #elif (TSURFACE == 6)
226 dtime_temp0 = dtime_temp0
228 dtime_wss0 = dtime_wss0
233 dzeta_c = 1.0_dp/
real(kcmax,dp)
234 dzeta_t = 1.0_dp/
real(ktmax,dp)
235 dzeta_r = 1.0_dp/
real(krmax,dp)
248 if ((i.le.imax).and.(j.le.jmax))
then
260 anfdatname = anfdatname
262 #if defined(YEAR_ZERO)
263 year_zero = year_zero
265 year_zero = 2000.0_dp
268 time_init0 = time_init0
269 time_end0 = time_end0
270 dtime_ser0 = dtime_ser0
272 #if ( OUTPUT==1 || OUTPUT==3 )
273 dtime_out0 = dtime_out0
276 #if ( OUTPUT==2 || OUTPUT==3 )
278 time_output0( 1) = time_out0_01
279 time_output0( 2) = time_out0_02
280 time_output0( 3) = time_out0_03
281 time_output0( 4) = time_out0_04
282 time_output0( 5) = time_out0_05
283 time_output0( 6) = time_out0_06
284 time_output0( 7) = time_out0_07
285 time_output0( 8) = time_out0_08
286 time_output0( 9) = time_out0_09
287 time_output0(10) = time_out0_10
288 time_output0(11) = time_out0_11
289 time_output0(12) = time_out0_12
290 time_output0(13) = time_out0_13
291 time_output0(14) = time_out0_14
292 time_output0(15) = time_out0_15
293 time_output0(16) = time_out0_16
294 time_output0(17) = time_out0_17
295 time_output0(18) = time_out0_18
296 time_output0(19) = time_out0_19
297 time_output0(20) = time_out0_20
302 shell_command =
'if [ ! -d'
303 shell_command = trim(shell_command)//
' '//outpath
304 shell_command = trim(shell_command)//
' '//
'] ; then mkdir'
305 shell_command = trim(shell_command)//
' '//outpath
306 shell_command = trim(shell_command)//
' '//
'; fi'
307 call system(trim(shell_command))
310 open(10, iostat=ios, &
311 file=outpath//
'/'//trim(runname)//
'.log', &
314 stop
' sico_init: Error when opening the log file!'
316 write(10,1000)
'Computational domain:'
318 write(10,1000)
'Antarctica'
320 write(10,1000)
'Greenland'
322 write(10,1000)
'Scandinavia and Eurasia'
324 write(10,1000)
'Northern hemisphere'
325 #elif defined(EMTP2SGE)
326 write(10,1000)
'EISMINT Phase 2 Simplified Geometry Experiment'
328 write(10,1000)
'North polar cap of Mars'
330 write(10,1000)
'South polar cap of Mars'
332 stop
' sico_init: No valid domain specified!'
336 write(10,1001)
'imax =', imax
337 write(10,1001)
'jmax =', jmax
338 write(10,1001)
'kcmax =', kcmax
339 write(10,1001)
'ktmax =', ktmax
340 write(10,1001)
'krmax =', krmax
343 write(10,1002)
'a =', deform
346 #if (GRID==0 || GRID==1)
347 write(10,1002)
'x0 =', x0
348 write(10,1002)
'y0 =', y0
349 write(10,1002)
'dx =', dx
351 stop
' sico_init: GRID==2 not allowed for this application!'
355 write(10,1002)
'year_zero =', year_zero
356 write(10,1002)
'time_init =', time_init0
357 write(10,1002)
'time_end =', time_end0
358 write(10,1002)
'dtime =', dtime0
359 write(10,1002)
'dtime_temp =', dtime_temp0
361 write(10,1002)
'dtime_wss =', dtime_wss0
363 #if ( OUTPUT==1 || OUTPUT==3 )
364 write(10,1002)
'dtime_out =', dtime_out0
366 write(10,1002)
'dtime_ser =', dtime_ser0
369 write(10,1000)
'zs_present file = '//zs_present_file
371 write(10,1000)
'zl_present file = '//zl_present_file
373 write(10,1000)
'zl0 file = '//zl0_file
374 write(10,1000)
'mask_present file = '//mask_present_file
376 write(10,1000)
'Initial-value file = '//anfdatname
377 write(10,1000)
'Path to initial-value file = '//anfdatpath
382 write(10,1002)
'time_target_topo_init =', time_target_topo_init0
383 write(10,1002)
'time_target_topo_final =', time_target_topo_final0
384 write(10,1000)
'Target-topography file = '//target_topo_dat_name
385 write(10,1000)
'Path to target-topography file = '//target_topo_dat_path
390 write(10,1000)
'Maximum ice extent mask file = '//mask_maxextent_file
394 write(10,1000)
'Physical-parameter file = '//phys_para_file
397 #if (CALCZS==3 || CALCZS==4)
398 write(10,1002)
'ovi_weight =', ovi_weight
400 write(10,1002)
'omega_sor =', omega_sor
406 write(10,1002)
'delta_ts0 =', delta_ts0
408 write(10,1002)
'sine_amplit =', sine_amplit
409 write(10,1002)
'sine_period =', sine_period
411 write(10,1000)
'GRIP file = '//grip_temp_file
412 write(10,1002)
'grip_temp_fact =', grip_temp_fact
414 write(10,1000)
'Glacial-index file = '//glac_ind_file
415 write(10,1000)
'temp_ma_anom file = '//temp_ma_anom_file
416 write(10,1002)
'temp_ma_anom fact = ', temp_ma_anom_fact
417 write(10,1000)
'temp_mj_anom file = '//temp_mj_anom_file
418 write(10,1002)
'temp_mj_anom fact = ', temp_mj_anom_fact
420 write(10,1000)
'temp_precip_anom file = '//temp_precip_anom_file
421 write(10,1002)
'temp_ma_anom fact = ', temp_ma_anom_fact
422 write(10,1002)
'temp_mj_anom fact = ', temp_mj_anom_fact
425 write(10,1000)
'precip_present file = '//precip_present_file
427 write(10,1002)
'accfact =', accfact
428 #elif ( ACCSURFACE==2 || ACCSURFACE==3 )
429 write(10,1002)
'gamma_s =', gamma_s
430 #elif ( ACCSURFACE==5 )
431 write(10,1000)
'precip_anom file = '//precip_anom_file
432 write(10,1002)
'precip_anom fact = ', precip_anom_fact
433 #elif ( ACCSURFACE==6 )
434 write(10,1000)
'temp_precip_anom file = '//temp_precip_anom_file
435 write(10,1002)
'precip_anom fact = ', precip_anom_fact
437 #if (ACCSURFACE <= 3)
438 write(10,1001)
'ELEV_DESERT =', elev_desert
439 #if (ELEV_DESERT == 1)
440 write(10,1002)
'gamma_p =', gamma_p
441 write(10,1002)
'zs_thresh =', zs_thresh
446 write(10,1002)
'lambda_lti =', lambda_lti
447 write(10,1002)
'temp_lti =', temp_lti
451 write(10,1002)
'z_sl0 =', z_sl0
453 write(10,1000)
'sea-level file = '//sea_level_file
458 #if ( MARINE_ICE_CALVING==2 || MARINE_ICE_CALVING==3 )
459 write(10,1002)
'z_mar =', z_mar
461 #elif ( MARINE_ICE_CALVING==4 || MARINE_ICE_CALVING==5 \
462 || marine_ice_calving==6 || marine_ice_calving==7 )
463 write(10,1002)
'fact_z_mar =', fact_z_mar
465 #elif ( ( MARINE_ICE_FORMATION==2 ) && ( MARINE_ICE_CALVING==9 ) )
466 write(10,1002)
'calv_uw_coeff =', calv_uw_coeff
467 write(10,1002)
'r1_calv_uw =', r1_calv_uw
468 write(10,1002)
'r2_calv_uw =', r2_calv_uw
472 #if ICE_SHELF_CALVING==2
473 write(10,1002)
'H_calv =', h_calv
478 write(10,1002)
'c_slide =', c_slide
479 write(10,1002)
'gamma_slide =', gamma_slide
480 write(10,1001)
'p_weert =', p_weert
481 write(10,1001)
'q_weert =', q_weert
483 write(10,1002)
'red_pres_limit_fact =', red_pres_limit_fact
487 #if ( defined(SEDI_SLIDE) && SEDI_SLIDE==2 )
488 write(10,1000)
'Sediment-mask file = '//mask_sedi_file
491 write(10,1002)
'c_slide_sedi =', c_slide_sedi
492 write(10,1002)
'gamma_slide_sedi =', gamma_slide_sedi
493 write(10,1001)
'p_weert_sedi =', p_weert_sedi
494 write(10,1001)
'q_weert_sedi =', q_weert_sedi
499 write(10,1002)
'q_geo =', q_geo
501 write(10,1000)
'q_geo file = '//q_geo_file
505 #if defined(MARINE_ICE_BASAL_MELTING)
506 write(10,1001)
'MARINE_ICE_BASAL_MELTING =', marine_ice_basal_melting
507 #if ( MARINE_ICE_BASAL_MELTING==2 || MARINE_ICE_BASAL_MELTING==3 )
508 write(10,1002)
'qbm_marine =', qbm_marine
514 write(10,1001)
'FLOATING_ICE_BASAL_MELTING =', floating_ice_basal_melting
515 #if FLOATING_ICE_BASAL_MELTING<=3
516 write(10,1002)
'qbm_float_1 =', qbm_float_1
517 write(10,1002)
'qbm_float_2 =', qbm_float_2
518 write(10,1002)
'qbm_float_3 =', qbm_float_3
519 write(10,1002)
'z_abyss =', z_abyss
525 write(10,1002)
'frac_llra =', frac_llra
530 write(10,1002)
'gr_size =', gr_size
534 write(10,1002)
'sigma_res =', sigma_res
538 write(10,1001)
'ENHMOD =', enhmod
539 write(10,1002)
'enh_fact =', enh_fact
540 #if ( ENHMOD==2 || ENHMOD==3 )
541 write(10,1002)
'enh_intg =', enh_intg
544 write(10,1002)
'age_trans =', age_trans_0
547 write(10,1002)
'date_trans1 =', date_trans1_0
548 write(10,1002)
'date_trans2 =', date_trans2_0
549 write(10,1002)
'date_trans3 =', date_trans3_0
552 write(10,1002)
'enh_shelf =', enh_shelf
556 write(10,1002)
'numdiff_H_t =', numdiff_h_t
557 write(10,1002)
'tau_cts =', tau_cts
558 write(10,1002)
'H_min =', h_min
559 write(10,1002)
'vh_max =', vh_max
560 write(10,1002)
'hd_min =', hd_min
561 write(10,1002)
'hd_max =', hd_max
563 write(10,1002)
'qbm_min =', qbm_min
564 #elif defined(QB_MIN) /* obsolete */
565 write(10,1002)
'qb_min =', qb_min
568 write(10,1002)
'qbm_max =', qbm_max
569 #elif defined(QB_MAX) /* obsolete */
570 write(10,1002)
'qb_max =', qb_max
572 write(10,1002)
'age_min =', age_min
573 write(10,1002)
'age_max =', age_max
574 write(10,1002)
'mean_accum =', mean_accum
576 write(10,1002)
'age_diff =', agediff
577 write(10,1002)
'm_age =', m_age
581 write(10,1001)
'GRID =', grid
582 write(10,1001)
'CALCMOD =', calcmod
583 write(10,1001)
'FLOW_LAW =', flow_law
584 write(10,1001)
'FIN_VISC =', fin_visc
585 write(10,1001)
'MARGIN =', margin
587 write(10,1001)
'MARINE_ICE_FORMATION =', marine_ice_formation
588 write(10,1001)
'MARINE_ICE_CALVING =', marine_ice_calving
590 write(10,1001)
'ICE_SHELF_CALVING =', ice_shelf_calving
592 write(10,1001)
'ANF_DAT =', anf_dat
593 write(10,1001)
'REBOUND =', rebound
594 write(10,1001)
'Q_LITHO =', q_litho
595 write(10,1001)
'ZS_EVOL =', zs_evol
596 write(10,1001)
'CALCZS =', calczs
597 write(10,1001)
'ADV_HOR =', adv_hor
598 write(10,1001)
'ADV_VERT =', adv_vert
599 write(10,1001)
'TOPOGRAD =', topograd
600 write(10,1001)
'TEMP_PRESENT_PARA =', temp_present_para
601 write(10,1001)
'TSURFACE =', tsurface
602 write(10,1001)
'ACCSURFACE =', accsurface
604 write(10,1001)
'PRECIP_ANOM_INTERPOL =', precip_anom_interpol
606 write(10,1001)
'SOLID_PRECIP =', solid_precip
607 write(10,1001)
'ABLSURFACE =', ablsurface
608 write(10,1001)
'SEA_LEVEL =', sea_level
609 write(10,1001)
'SLIDE_LAW =', slide_law
610 #if defined(SEDI_SLIDE)
611 write(10,1001)
'SEDI_SLIDE =', sedi_slide
613 write(10,1001)
'Q_GEO_MOD =', q_geo_mod
616 #if defined(OUT_TIMES)
617 write(10,1001)
'OUT_TIMES =', out_times
619 write(10,1001)
'OUTPUT =', output
620 write(10,1001)
'OUTSER =', outser
621 #if defined(OUTSER_V_A)
622 write(10,1001)
'OUTSER_V_A =', outser_v_a
624 #if ( OUTPUT==1 || OUTPUT==2 )
625 write(10,1001)
'ERGDAT =', ergdat
627 write(10,1001)
'NETCDF =', netcdf
629 #if ( OUTPUT==2 || OUTPUT==3 )
630 write(10,1001)
'n_output =', n_output
632 write(10,1002)
'time_output =', time_output0(n)
637 write(10,1000)
'Program version and date: '//version//
' / '//date
641 1002 format(a,es12.4)
643 close(10, status=
'keep')
647 year_zero = year_zero*year_sec
648 time_init = time_init0*year_sec
649 time_end = time_end0*year_sec
650 dtime = dtime0*year_sec
651 dtime_temp = dtime_temp0*year_sec
653 dtime_wss = dtime_wss0*year_sec
655 dtime_ser = dtime_ser0*year_sec
656 #if ( OUTPUT==1 || OUTPUT==3 )
657 dtime_out = dtime_out0*year_sec
659 #if ( OUTPUT==2 || OUTPUT==3 )
661 time_output(n) = time_output0(n)*year_sec
665 if (abs(dtime_temp/dtime-nint(dtime_temp/dtime)) > eps) &
666 stop
' sico_init: dtime_temp must be a multiple of dtime!'
669 if (abs(dtime_wss/dtime-nint(dtime_wss/dtime)) > eps) &
670 stop
' sico_init: dtime_wss must be a multiple of dtime!'
674 time_target_topo_init = time_target_topo_init0 *year_sec
675 time_target_topo_final = time_target_topo_final0*year_sec
680 #if (GRID==0 || GRID==1)
682 open(21, iostat=ios, &
683 file=inpath//
'/ant/'//precip_present_file, &
684 recl=8192, status=
'old')
688 stop
' sico_init: GRID==2 not allowed for this application!'
692 if (ios /= 0) stop
' sico_init: Error when opening the precip file!'
694 do n=1, 6;
read(21,
'(a)') ch_dummy;
end do
697 read(21,*) (precip_ma_present(j,i), i=0,imax)
700 close(21, status=
'keep')
702 precip_ma_present = precip_ma_present *(1.0e-03_dp/year_sec)*(rho_w/rho)
711 precip_present(j,i,n) = precip_ma_present(j,i)
720 #if (GRID==0 || GRID==1)
722 open(21, iostat=ios, &
723 file=inpath//
'/ant/'//precip_anom_file, &
724 recl=8192, status=
'old')
728 if (ios /= 0) stop
' sico_init: Error when opening the precip anomaly file!'
730 do n=1, 6;
read(21,
'(a)') ch_dummy;
end do
733 read(21,*) (precip_ma_lgm_anom(j,i), i=0,imax)
736 close(21, status=
'keep')
738 precip_ma_lgm_anom = precip_ma_lgm_anom * precip_anom_fact
747 precip_lgm_anom(j,i,n) = max(precip_ma_lgm_anom(j,i), eps)
750 #if (PRECIP_ANOM_INTERPOL==1)
751 gamma_precip_lgm_anom(j,i,n) = 0.0_dp
752 #elif (PRECIP_ANOM_INTERPOL==2)
753 gamma_precip_lgm_anom(j,i,n) = -log(precip_lgm_anom(j,i,n))
755 stop
' sico_init: Wrong value of switch PRECIP_ANOM_INTERPOL!'
766 mean_accum = mean_accum*(1.0e-03_dp/year_sec)*(rho_w/rho)
769 mean_accum_inv = 1.0_dp/mean_accum
773 #if (GRID==0 || GRID==1)
775 open(24, iostat=ios, &
776 file=inpath//
'/ant/'//mask_present_file, &
781 stop
' sico_init: GRID==2 not allowed for this application!'
785 if (ios /= 0) stop
' sico_init: Error when opening the mask file!'
787 do n=1, 6;
read(24,
'(a)') ch_dummy;
end do
790 read(24,2300) (maske_help(j,i), i=0,imax)
793 close(24, status=
'keep')
795 2300 format(imax(i1),i1)
799 #if ( defined(SEDI_SLIDE) && SEDI_SLIDE==2 )
801 open(24, iostat=ios, &
802 file=inpath//
'/ant/'//mask_sedi_file, &
803 recl=8192, status=
'old')
805 if (ios /= 0) stop
' sico_init: Error when opening the rock/sediment mask file!'
807 do n=1, 6;
read(24,
'(a)') ch_dummy;
end do
810 read(24,2300) (maske_sedi(j,i), i=0,imax)
813 close(24, status=
'keep')
819 #if (GRID==0 || GRID==1)
821 open(21, iostat=ios, &
822 file=inpath//
'/ant/'//zs_present_file, &
823 recl=8192, status=
'old')
827 stop
' sico_init: GRID==2 not allowed for this application!'
831 if (ios /= 0) stop
' sico_init: Error when opening the zs file!'
833 do n=1, 6;
read(21,
'(a)') ch_dummy;
end do
836 read(21,*) (zs_ref(j,i), i=0,imax)
839 close(21, status=
'keep')
846 if (maske_help(j,i) >= 2) zs_ref(j,i) = 0.0_dp
854 target_topo_dat_name = trim(target_topo_dat_name)
857 write(6,
'(a)')
' sico_init: Reading of target topography'
858 write(6,
'(a)')
' only implemented for NetCDF files (NETCDF==2)!'
863 stop
' sico_init: Parameter NETCDF must be either 1 or 2!'
872 #if (GRID==0 || GRID==1)
874 open(24, iostat=ios, &
875 file=inpath//
'/ant/'//mask_maxextent_file, &
876 recl=8192, status=
'old')
880 stop
' sico_init: GRID==2 not allowed for this application!'
885 stop
' sico_init: Error when opening the maximum ice extent mask file!'
887 do n=1, 6;
read(24,
'(a)') ch_dummy;
end do
890 read(24,2300) (maske_maxextent(j,i), i=0,imax)
893 close(24, status=
'keep')
902 #if (GRID==0 || GRID==1)
904 open(21, iostat=ios, &
905 file=inpath//
'/ant/'//temp_ma_anom_file, &
906 recl=8192, status=
'old')
910 if (ios /= 0) stop
' sico_init: Error when opening the temp_ma anomaly file!'
912 #if (GRID==0 || GRID==1)
914 open(22, iostat=ios, &
915 file=inpath//
'/ant/'//temp_mj_anom_file, &
916 recl=8192, status=
'old')
920 if (ios /= 0) stop
' sico_init: Error when opening the temp_mj anomaly file!'
922 do n=1, 6;
read(21,
'(a)') ch_dummy;
end do
923 do n=1, 6;
read(22,
'(a)') ch_dummy;
end do
926 read(21,*) (temp_ma_lgm_anom(j,i), i=0,imax)
927 read(22,*) (temp_mj_lgm_anom(j,i), i=0,imax)
930 close(21, status=
'keep')
931 close(22, status=
'keep')
933 temp_ma_lgm_anom = temp_ma_lgm_anom * temp_ma_anom_fact
934 temp_mj_lgm_anom = temp_mj_lgm_anom * temp_mj_anom_fact
942 open(21, iostat=ios, &
943 file=inpath//
'/general/'//grip_temp_file, &
946 stop
' sico_init: Error when opening the data file for delta_ts!'
948 read(21,*) ch_dummy, grip_time_min, grip_time_stp, grip_time_max
950 if (ch_dummy /=
'#')
then
951 write(6,*)
' sico_init: grip_time_min, grip_time_stp, grip_time_max'
952 write(6,*)
' not defined in data file for delta_ts!'
956 ndata_grip = (grip_time_max-grip_time_min)/grip_time_stp
958 allocate(griptemp(0:ndata_grip))
961 read(21,*) d_dummy, griptemp(n)
964 close(21, status=
'keep')
972 open(21, iostat=ios, &
973 file=inpath//
'/general/'//glac_ind_file, status=
'old')
974 if (ios /= 0) stop
' sico_init: Error when opening the glacial-index file!'
976 read(21,*) ch_dummy, gi_time_min, gi_time_stp, gi_time_max
978 if (ch_dummy /=
'#')
then
979 write(6,*)
' sico_init: gi_time_min, gi_time_stp, gi_time_max'
980 write(6,*)
' not defined in glacial-index file!'
984 ndata_gi = (gi_time_max-gi_time_min)/gi_time_stp
986 allocate(glacial_index(0:ndata_gi))
989 read(21,*) d_dummy, glacial_index(n)
992 close(21, status=
'keep')
999 #if ( (TSURFACE==6) && (ACCSURFACE==6) )
1001 call
check( nf90_open(inpath//
'/ant/'//temp_precip_anom_file, &
1002 nf90_nowrite, ncid_temp_precip) )
1004 call
check( nf90_inquire(ncid_temp_precip, unlimiteddimid = dimid) )
1006 call
check( nf90_inquire_dimension(ncid_temp_precip, dimid, &
1007 len = ndata_temp_precip) )
1009 ndata_temp_precip = ndata_temp_precip-1
1011 allocate(temp_precip_time(0:ndata_temp_precip))
1013 call
check( nf90_inq_varid(ncid_temp_precip,
'time', ncv) )
1014 call
check( nf90_get_var(ncid_temp_precip, ncv, temp_precip_time) )
1016 temp_precip_time_min = temp_precip_time(0)
1017 temp_precip_time_stp = temp_precip_time(1)-temp_precip_time(0)
1019 temp_precip_time_max = temp_precip_time(ndata_temp_precip)
1027 open(21, iostat=ios, &
1028 file=inpath//
'/general/'//sea_level_file, &
1031 stop
' sico_init: Error when opening the data file for z_sl!'
1033 read(21,*) ch_dummy, specmap_time_min, specmap_time_stp, specmap_time_max
1035 if (ch_dummy /=
'#')
then
1036 write(6,*)
' sico_init: specmap_time_min, specmap_time_stp, specmap_time_max'
1037 write(6,*)
' not defined in data file for z_sl!'
1041 ndata_specmap = (specmap_time_max-specmap_time_min)/specmap_time_stp
1043 allocate(specmap_zsl(0:ndata_specmap))
1045 do n=0, ndata_specmap
1046 read(21,*) d_dummy, specmap_zsl(n)
1049 close(21, status=
'keep')
1061 q_geo(j,i) = q_geo *1.0e-03_dp
1069 open(21, iostat=ios, &
1070 file=inpath//
'/ant/'//q_geo_file, &
1071 recl=8192, status=
'old')
1073 if (ios /= 0) stop
' sico_init: Error when opening the qgeo file!'
1075 do n=1, 6;
read(21,
'(a)') ch_dummy;
end do
1078 read(21,*) (q_geo(j,i), i=0,imax)
1081 close(21, status=
'keep')
1085 q_geo(j,i) = q_geo(j,i) *1.0e-03_dp
1093 #if (REBOUND==0 || REBOUND==1)
1095 kei = 0.0_dp; n_data_kei = 0; kei_r_max = 0.0_dp; kei_r_incr = 0.0_dp
1113 call
boundary(time_init, dtime, dxi, deta, &
1114 delta_ts, glac_index, z_sl, dzsl_dtau, z_mar)
1121 q_b_tot(j,i) = 0.0_dp
1127 temp_c(kc,j,i) = -10.0_dp
1128 age_c(kc,j,i) = 15000.0_dp*year_sec
1132 omega_t(kt,j,i) = 0.0_dp
1133 age_t(kt,j,i) = 15000.0_dp*year_sec
1137 temp_r(kr,j,i) = -10.0_dp+q_geo(j,i)*h_r/kappa_r &
1138 *(1.0_dp-
real(kr,dp)/
real(krmax,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) = temp_s(j,i)
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) = temp_s(j,i)+q_geo(j,i)*h_r/kappa_r &
1181 *(1.0_dp-
real(kr,dp)/
real(krmax,dp))
1200 stop
' sico_init: Parameter NETCDF must be either 1 or 2!'
1203 call
boundary(time_init, dtime, dxi, deta, &
1204 delta_ts, glac_index, z_sl, dzsl_dtau, z_mar)
1206 q_b_tot = q_bm + q_tld
1214 #if (GRID==0 || GRID==1)
1218 dist_dxdy(jr,ir) = sqrt( (
real(ir,dp)*dxi)**2 + (
real(jr,dp)*deta)**2 )
1230 zeta_c(kc) = kc*dzeta_c
1231 eaz_c(kc) = exp(deform*zeta_c(kc))
1232 eaz_c_quotient(kc) = (eaz_c(kc)-1.0_dp)/(ea-1.0_dp)
1236 zeta_t(kt) = kt*dzeta_t
1247 call
calc_vxy_ssa(z_sl, dxi, deta, dzeta_c, ii, jj, nn)
1260 open(12, iostat=ios, &
1261 file=outpath//
'/'//trim(runname)//
'.ser', &
1264 stop
' sico_init: Error when opening the ser file!'
1266 if (forcing_flag == 1)
then
1271 #if ( !defined(OUTSER_V_A) || OUTSER_V_A==1 )
1273 1102 format(
' t(a) D_Ts(deg C) z_sl(m)',/, &
1274 ' H_max(m) zs_max(m) V_g(m^3)', &
1275 ' V_t(m^3) V_fw(m^3/a) V_sle(m)',/, &
1276 ' A_g(m^2) A_t(m^2) V_bm(m^3/a)', &
1277 ' V_tld(m^3/a) H_t_max(m) vs_max(m/a)')
1278 1103 format(
'----------------------------------------------------', &
1279 '---------------------------------------')
1283 1102 format(
' t(a) D_Ts(deg C) z_sl(m)',/, &
1284 ' V(m^3) V_g(m^3) V_f(m^3)', &
1285 ' A(m^2) A_g(m^2) A_f(m^2)',/, &
1286 ' H_max(m) zs_max(m)', &
1287 ' V_t(m^3) V_fw(m^3/a) V_sle(m)',/, &
1288 ' A_t(m^2) V_bm(m^3/a)', &
1289 ' V_tld(m^3/a) H_t_max(m) vs_max(m/a)')
1290 1103 format(
'----------------------------------------------------', &
1291 '---------------------------------------')
1294 stop
' sico_init: OUTSER_V_A must be either 1 or 2!'
1297 else if (forcing_flag == 2)
then
1302 #if ( !defined(OUTSER_V_A) || OUTSER_V_A==1 )
1304 1112 format(
' t(a) glac_ind(1) z_sl(m)',/, &
1305 ' H_max(m) zs_max(m) V_g(m^3)', &
1306 ' V_t(m^3) V_fw(m^3/a) V_sle(m)',/, &
1307 ' A_g(m^2) A_t(m^2) V_bm(m^3/a)', &
1308 ' V_tld(m^3/a) H_t_max(m) vs_max(m/a)')
1309 1113 format(
'----------------------------------------------------', &
1310 '---------------------------------------')
1314 1112 format(
' t(a) glac_ind(1) z_sl(m)',/, &
1315 ' V(m^3) V_g(m^3) V_f(m^3)', &
1316 ' A(m^2) A_g(m^2) A_f(m^2)',/, &
1317 ' H_max(m) zs_max(m)', &
1318 ' V_t(m^3) V_fw(m^3/a) V_sle(m)',/, &
1319 ' A_t(m^2) V_bm(m^3/a)', &
1320 ' V_tld(m^3/a) H_t_max(m) vs_max(m/a)')
1321 1113 format(
'----------------------------------------------------', &
1322 '---------------------------------------')
1325 stop
' sico_init: OUTSER_V_A must be either 1 or 2!'
1328 else if (forcing_flag == 3)
then
1333 #if ( !defined(OUTSER_V_A) || OUTSER_V_A==1 )
1335 1122 format(
' t(a) (Dummy)(1) z_sl(m)',/, &
1336 ' H_max(m) zs_max(m) V_g(m^3)', &
1337 ' V_t(m^3) V_fw(m^3/a) V_sle(m)',/, &
1338 ' A_g(m^2) A_t(m^2) V_bm(m^3/a)', &
1339 ' V_tld(m^3/a) H_t_max(m) vs_max(m/a)')
1340 1123 format(
'----------------------------------------------------', &
1341 '---------------------------------------')
1345 1122 format(
' t(a) (Dummy)(1) z_sl(m)',/, &
1346 ' V(m^3) V_g(m^3) V_f(m^3)', &
1347 ' A(m^2) A_g(m^2) A_f(m^2)',/, &
1348 ' H_max(m) zs_max(m)', &
1349 ' V_t(m^3) V_fw(m^3/a) V_sle(m)',/, &
1350 ' A_t(m^2) V_bm(m^3/a)', &
1351 ' V_tld(m^3/a) H_t_max(m) vs_max(m/a)')
1352 1123 format(
'----------------------------------------------------', &
1353 '---------------------------------------')
1356 stop
' sico_init: OUTSER_V_A must be either 1 or 2!'
1365 open(13, iostat=ios, &
1366 file=outpath//
'/'//trim(runname)//
'.thk', &
1368 if (ios /= 0) stop
' sico_init: Error when opening the thk file!'
1370 if (forcing_flag == 1)
then
1375 1104 format(
' t(a) D_Ts(deg C) z_sl(m)',/, &
1376 ' H(m): JMAX+1 records [j = JMAX (-1) 0] with',/, &
1377 ' IMAX+1 values [i = 0 (1) IMAX] in each record')
1378 1105 format(
'----------------------------------------------------')
1380 else if (forcing_flag == 2)
then
1385 1114 format(
' t(a) glac_ind(1) z_sl(m)',/, &
1386 ' H(m): JMAX+1 records [j = JMAX (-1) 0] with',/, &
1387 ' IMAX+1 values [i = 0 (1) IMAX] in each record')
1388 1115 format(
'----------------------------------------------------')
1390 else if (forcing_flag == 3)
then
1395 1124 format(
' t(a) (Dummy)(1) z_sl(m)',/, &
1396 ' H(m): JMAX+1 records [j = JMAX (-1) 0] with',/, &
1397 ' IMAX+1 values [i = 0 (1) IMAX] in each record')
1398 1125 format(
'----------------------------------------------------')
1410 allocate(lambda_core(n_core), phi_core(n_core), &
1411 x_core(n_core), y_core(n_core))
1413 phi_core(1) = -78.467_dp *pi_180
1414 lambda_core(1) = 106.8_dp *pi_180
1415 call
num_coord(lambda_core(1), phi_core(1), x_core(1), y_core(1))
1417 phi_core(2) = -80.367_dp *pi_180
1418 lambda_core(2) = 77.35_dp *pi_180
1419 call
num_coord(lambda_core(2), phi_core(2), x_core(2), y_core(2))
1421 phi_core(3) = -75.1_dp *pi_180
1422 lambda_core(3) = 123.4_dp *pi_180
1423 call
num_coord(lambda_core(3), phi_core(3), x_core(3), y_core(3))
1425 phi_core(4) = -77.317_dp *pi_180
1426 lambda_core(4) = 39.7_dp *pi_180
1427 call
num_coord(lambda_core(4), phi_core(4), x_core(4), y_core(4))
1429 phi_core(5) = -75.0_dp *pi_180
1430 lambda_core(5) = 0.067_dp *pi_180
1431 call
num_coord(lambda_core(5), phi_core(5), x_core(5), y_core(5))
1433 phi_core(6) = -80.017_dp *pi_180
1434 lambda_core(6) = -119.517_dp *pi_180
1435 call
num_coord(lambda_core(6), phi_core(6), x_core(6), y_core(6))
1437 open(14, iostat=ios, &
1438 file=outpath//
'/'//trim(runname)//
'.core', &
1440 if (ios /= 0) stop
' sico_init: Error when opening the core file!'
1442 if (forcing_flag == 1)
then
1447 1106 format(
' t(a) D_Ts(C) z_sl(m)',/, &
1448 ' H_Vo(m) H_DA(m) H_DC(m)', &
1449 ' H_DF(m) H_Ko(m) H_By(m)',/, &
1450 ' v_Vo(m/a) v_DA(m/a) v_DC(m/a)', &
1451 ' v_DF(m/a) v_Ko(m/a) v_By(m/a)',/, &
1452 ' T_Vo(C) T_DA(C) T_DC(C)', &
1453 ' T_DF(C) T_Ko(C) T_By(C)',/, &
1454 ' Rb_Vo(W/m2) Rb_DA(W/m2) Rb_DC(W/m2)', &
1455 ' Rb_DF(W/m2) Rb_Ko(W/m2) Rb_By(W/m2)')
1456 1107 format(
'----------------------------------------------------', &
1457 '---------------------------------------')
1459 else if (forcing_flag == 2)
then
1464 1116 format(
' t(a) glac_ind(1) z_sl(m)',/, &
1465 ' H_Vo(m) H_DA(m) H_DC(m)', &
1466 ' H_DF(m) H_Ko(m) H_By(m)',/, &
1467 ' v_Vo(m/a) v_DA(m/a) v_DC(m/a)', &
1468 ' v_DF(m/a) v_Ko(m/a) v_By(m/a)',/, &
1469 ' T_Vo(C) T_DA(C) T_DC(C)', &
1470 ' T_DF(C) T_Ko(C) T_By(C)',/, &
1471 ' Rb_Vo(W/m2) Rb_DA(W/m2) Rb_DC(W/m2)', &
1472 ' Rb_DF(W/m2) Rb_Ko(W/m2) Rb_By(W/m2)')
1473 1117 format(
'----------------------------------------------------', &
1474 '---------------------------------------')
1476 else if (forcing_flag == 3)
then
1481 1126 format(
' t(a) (Dummy)(1) z_sl(m)',/, &
1482 ' H_Vo(m) H_DA(m) H_DC(m)', &
1483 ' H_DF(m) H_Ko(m) H_By(m)',/, &
1484 ' v_Vo(m/a) v_DA(m/a) v_DC(m/a)', &
1485 ' v_DF(m/a) v_Ko(m/a) v_By(m/a)',/, &
1486 ' T_Vo(C) T_DA(C) T_DC(C)', &
1487 ' T_DF(C) T_Ko(C) T_By(C)',/, &
1488 ' Rb_Vo(W/m2) Rb_DA(W/m2) Rb_DC(W/m2)', &
1489 ' Rb_DF(W/m2) Rb_Ko(W/m2) Rb_By(W/m2)')
1490 1127 format(
'----------------------------------------------------', &
1491 '---------------------------------------')
1502 flag_3d_output = .false.
1504 flag_3d_output = .true.
1506 stop
' sico_init: ERGDAT must be either 0 or 1!'
1510 call
output1(runname, time_init, delta_ts, glac_index, z_sl, &
1511 flag_3d_output, ndat2d, ndat3d)
1513 call
output_nc(runname, time_init, delta_ts, glac_index, z_sl, &
1514 flag_3d_output, ndat2d, ndat3d)
1516 stop
' sico_init: Parameter NETCDF must be either 1 or 2!'
1521 if (time_output(1) <= time_init+eps)
then
1524 flag_3d_output = .false.
1526 flag_3d_output = .true.
1528 stop
' sico_init: ERGDAT must be either 0 or 1!'
1532 call
output1(runname, time_init, delta_ts, glac_index, z_sl, &
1533 flag_3d_output, ndat2d, ndat3d)
1535 call
output_nc(runname, time_init, delta_ts, glac_index, z_sl, &
1536 flag_3d_output, ndat2d, ndat3d)
1538 stop
' sico_init: Parameter NETCDF must be either 1 or 2!'
1545 flag_3d_output = .false.
1548 call
output1(runname, time_init, delta_ts, glac_index, z_sl, &
1549 flag_3d_output, ndat2d, ndat3d)
1551 call
output_nc(runname, time_init, delta_ts, glac_index, z_sl, &
1552 flag_3d_output, ndat2d, ndat3d)
1554 stop
' sico_init: Parameter NETCDF must be either 1 or 2!'
1557 if (time_output(1) <= time_init+eps)
then
1559 flag_3d_output = .true.
1562 call
output1(runname, time_init, delta_ts, glac_index, z_sl, &
1563 flag_3d_output, ndat2d, ndat3d)
1565 call
output_nc(runname, time_init, delta_ts, glac_index, z_sl, &
1566 flag_3d_output, ndat2d, ndat3d)
1568 stop
' sico_init: Parameter NETCDF must be either 1 or 2!'
1574 stop
' sico_init: OUTPUT must be either 1, 2 or 3!'
1577 call
output2(time_init, dxi, deta, delta_ts, glac_index, z_sl)
1579 call
output3(time_init, delta_ts, glac_index, z_sl)
1582 call
output4(time_init, dxi, deta, delta_ts, glac_index, z_sl)