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, &
49 integer(i4b) :: i, j, kc, kt, kr, m, n, ir, jr
51 integer(i4b) :: ndat2d, ndat3d
52 integer(i4b) :: n_output
54 integer(i4b) :: ii((imax+1)*(jmax+1)), jj((imax+1)*(jmax+1)), nn(0:jmax,0:imax)
55 real(dp) :: delta_ts, glac_index
56 real(dp) :: sum_accum, mean_accum, mean_accum_inv
57 real(dp) :: dtime0, dtime_temp0, dtime_wss0, dtime_out0, dtime_ser0
58 real(dp) :: dtime, dtime_temp, dtime_wss, dtime_out, dtime_ser
59 real(dp) :: time_init0, time_end0, time_output0(100)
60 real(dp) :: time, time_init, time_end, time_output(100)
61 real(dp) :: dxi, deta, dzeta_c, dzeta_t, dzeta_r
62 real(dp) :: z_sl, dzsl_dtau, z_mar
64 character (len=100) :: runname, anfdatname
65 character (len=256) :: shell_command
67 logical :: flag_3d_output
72 #if (CALCZS==4 || MARGIN==3)
75 call lis_initialize(ierr)
85 if ( trim(version) /= trim(sico_version) ) &
86 stop
' sico_init: SICOPOLIS version not compatible with header file!'
91 #if (GRID==0 || GRID==1)
93 stop
' sico_init: GRID==0 or 1 not allowed for the Tibet application!'
97 if ( (abs(dlambda-1.0_dp/3.0_dp) < eps) &
98 .and.(abs(dphi- 1.0_dp/3.0_dp) < eps) )
then
100 if ((imax /= 135).or.(jmax /= 51))
then
101 stop
' sico_init: IMAX and/or JMAX wrong!'
104 else if ( (abs(dlambda-1.0_dp/6.0_dp) < eps) &
105 .and.(abs(dphi -1.0_dp/6.0_dp) < eps) )
then
107 if ((imax /= 270).or.(jmax /= 102))
then
108 stop
' sico_init: IMAX and/or JMAX wrong!'
111 else if ( (abs(dlambda-1.0_dp/12.0_dp) < eps) &
112 .and.(abs(dphi -1.0_dp/12.0_dp) < eps) )
then
114 if ((imax /= 540).or.(jmax /= 204))
then
115 stop
' sico_init: IMAX and/or JMAX wrong!'
119 stop
' sico_init: DLAMBDA / DPHI wrong!'
128 #if ((TSURFACE == 5) && (ACCSURFACE != 5))
129 stop
' sico_init: Options TSURFACE==5 and ACCSURFACE==5 must be used together!'
132 #if ((TSURFACE != 5) && (ACCSURFACE == 5))
133 stop
' sico_init: Options TSURFACE==5 and ACCSURFACE==5 must be used together!'
140 stop
' sico_init: Option ADV_HOR==1 (central differences) not defined!'
143 #if ((ADV_HOR == 3) && (ADV_VERT != 3))
144 stop
' sico_init: Options ADV_HOR==3 and ADV_VERT==3 must be used together!'
147 #if ((ADV_HOR != 3) && (ADV_VERT == 3))
148 stop
' sico_init: Options ADV_HOR==3 and ADV_VERT==3 must be used together!'
157 #elif (TSURFACE == 5)
166 dtime_temp0 = dtime_temp0
168 dtime_wss0 = dtime_wss0
173 dzeta_c = 1.0_dp/
real(kcmax,dp)
174 dzeta_t = 1.0_dp/
real(ktmax,dp)
175 dzeta_r = 1.0_dp/
real(krmax,dp)
188 if ((i.le.imax).and.(j.le.jmax))
then
200 anfdatname = anfdatname
202 #if defined(YEAR_ZERO)
203 year_zero = year_zero
205 year_zero = 2000.0_dp
208 time_init0 = time_init0
209 time_end0 = time_end0
210 dtime_ser0 = dtime_ser0
212 #if ( OUTPUT==1 || OUTPUT==3 )
213 dtime_out0 = dtime_out0
216 #if ( OUTPUT==2 || OUTPUT==3 )
218 time_output0( 1) = time_out0_01
219 time_output0( 2) = time_out0_02
220 time_output0( 3) = time_out0_03
221 time_output0( 4) = time_out0_04
222 time_output0( 5) = time_out0_05
223 time_output0( 6) = time_out0_06
224 time_output0( 7) = time_out0_07
225 time_output0( 8) = time_out0_08
226 time_output0( 9) = time_out0_09
227 time_output0(10) = time_out0_10
228 time_output0(11) = time_out0_11
229 time_output0(12) = time_out0_12
230 time_output0(13) = time_out0_13
231 time_output0(14) = time_out0_14
232 time_output0(15) = time_out0_15
233 time_output0(16) = time_out0_16
234 time_output0(17) = time_out0_17
235 time_output0(18) = time_out0_18
236 time_output0(19) = time_out0_19
237 time_output0(20) = time_out0_20
242 shell_command =
'if [ ! -d'
243 shell_command = trim(shell_command)//
' '//outpath
244 shell_command = trim(shell_command)//
' '//
'] ; then mkdir'
245 shell_command = trim(shell_command)//
' '//outpath
246 shell_command = trim(shell_command)//
' '//
'; fi'
247 call system(trim(shell_command))
250 open(10, iostat=ios, &
251 file=outpath//
'/'//trim(runname)//
'.log', &
254 stop
' sico_init: Error when opening the log file!'
256 write(10,1000)
'Computational domain:'
258 write(10,1000)
'Antarctica'
260 write(10,1000)
'Greenland'
262 write(10,1000)
'Scandinavia and Eurasia'
264 write(10,1000)
'Northern hemisphere'
266 write(10,1000)
'Tibet'
267 #elif defined(EMTP2SGE)
268 write(10,1000)
'EISMINT Phase 2 Simplified Geometry Experiment'
270 write(10,1000)
'North polar cap of Mars'
272 write(10,1000)
'South polar cap of Mars'
274 stop
' sico_init: No valid domain specified!'
278 write(10,1001)
'imax =', imax
279 write(10,1001)
'jmax =', jmax
280 write(10,1001)
'kcmax =', kcmax
281 write(10,1001)
'ktmax =', ktmax
282 write(10,1001)
'krmax =', krmax
285 write(10,1002)
'a =', deform
288 #if (GRID==0 || GRID==1)
289 stop
' sico_init: GRID==0 or 1 not allowed for this application!'
291 write(10,1002)
'lambda0 =', lambda_0
292 write(10,1002)
'phi0 =', phi_0
293 write(10,1002)
'dlambda =', dlambda
294 write(10,1002)
'dphi =', dphi
298 write(10,1002)
'year_zero =', year_zero
299 write(10,1002)
'time_init =', time_init0
300 write(10,1002)
'time_end =', time_end0
301 write(10,1002)
'dtime =', dtime0
302 write(10,1002)
'dtime_temp =', dtime_temp0
304 write(10,1002)
'dtime_wss =', dtime_wss0
306 #if ( OUTPUT==1 || OUTPUT==3 )
307 write(10,1002)
'dtime_out =', dtime_out0
309 write(10,1002)
'dtime_ser =', dtime_ser0
312 write(10,1000)
'zs_present file = '//zs_present_file
314 write(10,1000)
'zl_present file = '//zl_present_file
316 write(10,1000)
'zl0 file = '//zl0_file
317 write(10,1000)
'mask_present file = '//mask_present_file
320 write(10,1000)
'Physical-parameter file = '//phys_para_file
323 #if (CALCZS==3 || CALCZS==4)
324 write(10,1002)
'ovi_weight =', ovi_weight
326 write(10,1002)
'omega_sor =', omega_sor
331 write(10,1000)
'temp_mm_present file = '//temp_mm_present_file
333 write(10,1002)
'delta_ts0 =', delta_ts0
335 write(10,1002)
'sine_amplit =', sine_amplit
336 write(10,1002)
'sine_period =', sine_period
338 write(10,1000)
'GRIP file = '//grip_temp_file
339 write(10,1002)
'grip_temp_fact =', grip_temp_fact
341 write(10,1000)
'Glacial-index file = '//glac_ind_file
342 write(10,1000)
'temp_mm_anom file = '//temp_mm_anom_file
343 write(10,1002)
'temp_mm_anom fact = ', temp_mm_anom_fact
346 write(10,1000)
'precip_mm_present file = '//precip_mm_present_file
348 write(10,1002)
'accfact =', accfact
349 #elif ( ACCSURFACE==2 || ACCSURFACE==3 )
350 write(10,1002)
'gamma_s =', gamma_s
351 #elif ( ACCSURFACE==5 )
352 write(10,1000)
'precip_mm_anom file = '//precip_mm_anom_file
353 write(10,1002)
'precip_mm_anom fact = ', precip_mm_anom_fact
355 #if (ACCSURFACE <= 3)
356 write(10,1001)
'ELEV_DESERT =', elev_desert
357 #if (ELEV_DESERT == 1)
358 write(10,1002)
'gamma_p =', gamma_p
359 write(10,1002)
'zs_thresh =', zs_thresh
364 write(10,1002)
'lambda_lti =', lambda_lti
365 write(10,1002)
'temp_lti =', temp_lti
369 write(10,1002)
'z_sl0 =', z_sl0
371 write(10,1000)
'sea-level file = '//sea_level_file
376 #if ( MARINE_ICE_CALVING==2 || MARINE_ICE_CALVING==3 )
377 write(10,1002)
'z_mar =', z_mar
379 #elif ( MARINE_ICE_CALVING==4 || MARINE_ICE_CALVING==5 \
380 || marine_ice_calving==6 || marine_ice_calving==7 )
381 write(10,1002)
'fact_z_mar =', fact_z_mar
383 #elif ( ( MARINE_ICE_FORMATION==2 ) && ( MARINE_ICE_CALVING==9 ) )
384 write(10,1002)
'calv_uw_coeff =', calv_uw_coeff
385 write(10,1002)
'r1_calv_uw =', r1_calv_uw
386 write(10,1002)
'r2_calv_uw =', r2_calv_uw
390 #if ICE_SHELF_CALVING==2
391 write(10,1002)
'H_calv =', h_calv
396 write(10,1002)
'c_slide =', c_slide
397 write(10,1002)
'gamma_slide =', gamma_slide
398 write(10,1001)
'p_weert =', p_weert
399 write(10,1001)
'q_weert =', q_weert
401 write(10,1002)
'red_pres_limit_fact =', red_pres_limit_fact
406 write(10,1002)
'q_geo =', q_geo
408 write(10,1000)
'q_geo file = '//q_geo_file
412 #if defined(MARINE_ICE_BASAL_MELTING)
413 write(10,1001)
'MARINE_ICE_BASAL_MELTING =', marine_ice_basal_melting
414 #if ( MARINE_ICE_BASAL_MELTING==2 || MARINE_ICE_BASAL_MELTING==3 )
415 write(10,1002)
'qbm_marine =', qbm_marine
421 write(10,1002)
'frac_llra =', frac_llra
426 write(10,1002)
'gr_size =', gr_size
430 write(10,1002)
'sigma_res =', sigma_res
434 write(10,1001)
'ENHMOD =', enhmod
435 write(10,1002)
'enh_fact =', enh_fact
436 #if ( ENHMOD==2 || ENHMOD==3 )
437 write(10,1002)
'enh_intg =', enh_intg
440 write(10,1002)
'age_trans =', age_trans_0
443 write(10,1002)
'date_trans1 =', date_trans1_0
444 write(10,1002)
'date_trans2 =', date_trans2_0
445 write(10,1002)
'date_trans3 =', date_trans3_0
448 write(10,1002)
'enh_shelf =', enh_shelf
452 write(10,1002)
'numdiff_H_t =', numdiff_h_t
453 write(10,1002)
'tau_cts =', tau_cts
454 write(10,1002)
'H_min =', h_min
455 write(10,1002)
'vh_max =', vh_max
456 write(10,1002)
'hd_min =', hd_min
457 write(10,1002)
'hd_max =', hd_max
459 write(10,1002)
'qbm_min =', qbm_min
460 #elif defined(QB_MIN) /* obsolete */
461 write(10,1002)
'qb_min =', qb_min
464 write(10,1002)
'qbm_max =', qbm_max
465 #elif defined(QB_MAX) /* obsolete */
466 write(10,1002)
'qb_max =', qb_max
468 write(10,1002)
'age_min =', age_min
469 write(10,1002)
'age_max =', age_max
470 write(10,1002)
'mean_accum =', mean_accum
472 write(10,1002)
'age_diff =', agediff
473 write(10,1002)
'm_age =', m_age
477 write(10,1001)
'GRID =', grid
478 write(10,1001)
'CALCMOD =', calcmod
479 write(10,1001)
'FLOW_LAW =', flow_law
480 write(10,1001)
'FIN_VISC =', fin_visc
481 write(10,1001)
'MARGIN =', margin
483 write(10,1001)
'MARINE_ICE_FORMATION =', marine_ice_formation
484 write(10,1001)
'MARINE_ICE_CALVING =', marine_ice_calving
486 write(10,1001)
'ICE_SHELF_CALVING =', ice_shelf_calving
488 write(10,1001)
'ANF_DAT =', anf_dat
489 write(10,1001)
'REBOUND =', rebound
490 write(10,1001)
'Q_LITHO =', q_litho
491 write(10,1001)
'ZS_EVOL =', zs_evol
492 write(10,1001)
'CALCZS =', calczs
493 write(10,1001)
'ADV_HOR =', adv_hor
494 write(10,1001)
'ADV_VERT =', adv_vert
495 write(10,1001)
'TOPOGRAD =', topograd
496 write(10,1001)
'TSURFACE =', tsurface
497 write(10,1001)
'ACCSURFACE =', accsurface
499 write(10,1001)
'PRECIP_ANOM_INTERPOL =', precip_anom_interpol
501 write(10,1001)
'SOLID_PRECIP =', solid_precip
502 write(10,1001)
'ABLSURFACE =', ablsurface
503 write(10,1001)
'SEA_LEVEL =', sea_level
504 write(10,1001)
'SLIDE_LAW =', slide_law
505 write(10,1001)
'Q_GEO_MOD =', q_geo_mod
508 #if defined(OUT_TIMES)
509 write(10,1001)
'OUT_TIMES =', out_times
511 write(10,1001)
'OUTPUT =', output
512 write(10,1001)
'OUTSER =', outser
513 #if defined(OUTSER_V_A)
514 write(10,1001)
'OUTSER_V_A =', outser_v_a
516 #if ( OUTPUT==1 || OUTPUT==2 )
517 write(10,1001)
'ERGDAT =', ergdat
519 write(10,1001)
'NETCDF =', netcdf
521 #if ( OUTPUT==2 || OUTPUT==3 )
522 write(10,1001)
'n_output =', n_output
524 write(10,1002)
'time_output =', time_output0(n)
529 write(10,1000)
'Program version and date: '//version//
' / '//date
533 1002 format(a,es12.4)
535 close(10, status=
'keep')
539 year_zero = year_zero*year_sec
540 time_init = time_init0*year_sec
541 time_end = time_end0*year_sec
542 dtime = dtime0*year_sec
543 dtime_temp = dtime_temp0*year_sec
545 dtime_wss = dtime_wss0*year_sec
547 dtime_ser = dtime_ser0*year_sec
548 #if ( OUTPUT==1 || OUTPUT==3 )
549 dtime_out = dtime_out0*year_sec
551 #if ( OUTPUT==2 || OUTPUT==3 )
553 time_output(n) = time_output0(n)*year_sec
557 if (abs(dtime_temp/dtime-nint(dtime_temp/dtime)) > eps) &
558 stop
' sico_init: dtime_temp must be a multiple of dtime!'
561 if (abs(dtime_wss/dtime-nint(dtime_wss/dtime)) > eps) &
562 stop
' sico_init: dtime_wss must be a multiple of dtime!'
567 #if (GRID==0 || GRID==1)
569 stop
' sico_init: GRID==0 or 1 not allowed for the Tibet application!'
573 open(21, iostat=ios, &
574 file=inpath//
'/tibet/'//precip_mm_present_file, &
575 recl=16384, status=
'old')
579 if (ios /= 0) stop
' sico_init: Error when opening the precipitation file!'
581 do m=1, 6;
read(21,
'(a)') ch_dummy;
end do
584 do m=1, 3;
read(21,
'(a)') ch_dummy;
end do
586 read(21,*) (precip_present(j,i,n), i=0,imax)
590 close(21, status=
'keep')
594 precip_present = precip_present *(1.0e-03_dp/year_sec)*(rho_w/rho)
603 open(21, iostat=ios, &
604 file=inpath//
'/tibet/'//precip_mm_anom_file, &
605 recl=16384, status=
'old')
609 if (ios /= 0) stop
' sico_init: Error when opening the precip anomaly file!'
611 do m=1, 6;
read(21,
'(a)') ch_dummy;
end do
614 do m=1, 3;
read(21,
'(a)') ch_dummy;
end do
616 read(21,*) (precip_lgm_anom(j,i,n), i=0,imax)
620 close(21, status=
'keep')
622 precip_lgm_anom = precip_lgm_anom * precip_mm_anom_fact
627 #if (PRECIP_ANOM_INTERPOL==1)
629 gamma_precip_lgm_anom(j,i,n) = 0.0_dp
631 #elif (PRECIP_ANOM_INTERPOL==2)
633 gamma_precip_lgm_anom(j,i,n) = -log(precip_lgm_anom(j,i,n))
636 stop
' sico_init: Wrong value of switch PRECIP_ANOM_INTERPOL!'
646 mean_accum = mean_accum*(1.0e-03_dp/year_sec)*(rho_w/rho)
649 mean_accum_inv = 1.0_dp/mean_accum
653 #if (GRID==0 || GRID==1)
655 stop
' sico_init: GRID==0 or 1 not allowed for the Tibet application!'
659 open(24, iostat=ios, &
660 file=inpath//
'/tibet/'//mask_present_file, &
661 recl=1024, status=
'old')
666 stop
' sico_init: Error when opening the mask file!'
668 do m=1, 6;
read(24,
'(a)') ch_dummy;
end do
671 read(24,2300) (maske_help(j,i), i=0,imax)
674 close(24, status=
'keep')
676 2300 format(imax(i1),i1)
682 open(21, iostat=ios, &
683 file=inpath//
'/tibet/'//temp_mm_present_file, &
684 recl=16384, status=
'old')
688 if (ios /= 0) stop
' sico_init: Error when opening the temperature file!'
690 do m=1, 6;
read(21,
'(a)') ch_dummy;
end do
693 do m=1, 3;
read(21,
'(a)') ch_dummy;
end do
695 read(21,*) (temp_mm_present(j,i,n), i=0,imax)
699 close(21, status=
'keep')
707 open(21, iostat=ios, &
708 file=inpath//
'/tibet/'//temp_mm_anom_file, &
709 recl=16384, status=
'old')
713 if (ios /= 0) stop
' sico_init: Error when opening the temperature anomaly file!'
715 do m=1, 6;
read(21,
'(a)') ch_dummy;
end do
718 do m=1, 3;
read(21,
'(a)') ch_dummy;
end do
720 read(21,*) (temp_mm_lgm_anom(j,i,n), i=0,imax)
724 close(21, status=
'keep')
726 temp_mm_lgm_anom = temp_mm_lgm_anom * temp_mm_anom_fact
733 #if (GRID==0 || GRID==1)
735 stop
' sico_init: GRID==0 or 1 not allowed for the Tibet application!'
739 open(21, iostat=ios, &
740 file=inpath//
'/tibet/'//zs_present_file, &
741 recl=16384, status=
'old')
745 if (ios /= 0) stop
' sico_init: Error when opening the zs file!'
747 do m=1, 6;
read(21,
'(a)') ch_dummy;
end do
750 read(21,*) (zs_ref(j,i), i=0,imax)
753 close(21, status=
'keep')
760 if (maske_help(j,i).ge.2) zs_ref(j,i) = 0.0_dp
768 open(21, iostat=ios, &
769 file=inpath//
'/general/'//grip_temp_file, &
772 stop
' sico_init: Error when opening the data file for delta_ts!'
774 read(21,*) ch_dummy, grip_time_min, grip_time_stp, grip_time_max
776 if (ch_dummy /=
'#')
then
777 write(6,*)
' sico_init: grip_time_min, grip_time_stp, grip_time_max'
778 write(6,*)
' not defined in data file for delta_ts!'
782 ndata_grip = (grip_time_max-grip_time_min)/grip_time_stp
784 allocate(griptemp(0:ndata_grip))
787 read(21,*) d_dummy, griptemp(n)
790 close(21, status=
'keep')
798 open(21, iostat=ios, &
799 file=inpath//
'/general/'//glac_ind_file, status=
'old')
800 if (ios /= 0) stop
' sico_init: Error when opening the glacial-index file!'
802 read(21,*) ch_dummy, gi_time_min, gi_time_stp, gi_time_max
804 if (ch_dummy /=
'#')
then
805 write(6,*)
' sico_init: gi_time_min, gi_time_stp, gi_time_max'
806 write(6,*)
' not defined in glacial-index file!'
810 ndata_gi = (gi_time_max-gi_time_min)/gi_time_stp
812 allocate(glacial_index(0:ndata_gi))
815 read(21,*) d_dummy, glacial_index(n)
818 close(21, status=
'keep')
826 open(21, iostat=ios, &
827 file=inpath//
'/general/'//sea_level_file, &
830 stop
' sico_init: Error when opening the data file for z_sl!'
832 read(21,*) ch_dummy, specmap_time_min, specmap_time_stp, specmap_time_max
834 if (ch_dummy /=
'#')
then
835 write(6,*)
' sico_init: specmap_time_min, specmap_time_stp, specmap_time_max'
836 write(6,*)
' not defined in data file for z_sl!'
840 ndata_specmap = (specmap_time_max-specmap_time_min)/specmap_time_stp
842 allocate(specmap_zsl(0:ndata_specmap))
844 do n=0, ndata_specmap
845 read(21,*) d_dummy, specmap_zsl(n)
848 close(21, status=
'keep')
860 q_geo(j,i) = q_geo *1.0e-03_dp
868 open(21, iostat=ios, &
869 file=inpath//
'/tibet/'//q_geo_file, &
870 recl=16384, status=
'old')
872 if (ios /= 0) stop
' sico_init: Error when opening the qgeo file!'
874 do m=1, 6;
read(21,
'(a)') ch_dummy;
end do
877 read(21,*) (q_geo(j,i), i=0,imax)
880 close(21, status=
'keep')
884 q_geo(j,i) = q_geo(j,i) *1.0e-03_dp
892 #if (REBOUND==0 || REBOUND==1)
894 kei = 0.0_dp; n_data_kei = 0; kei_r_max = 0.0_dp; kei_r_incr = 0.0_dp
908 stop
' sico_init: ANF_DAT==1 not allowed for Tibet application!'
918 call
boundary(time_init, dtime, dxi, deta, &
919 delta_ts, glac_index, z_sl, dzsl_dtau, z_mar)
926 q_b_tot(j,i) = 0.0_dp
932 temp_c(kc,j,i) = temp_s(j,i)
933 age_c(kc,j,i) = 15000.0_dp*year_sec
937 omega_t(kt,j,i) = 0.0_dp
938 age_t(kt,j,i) = 15000.0_dp*year_sec
942 temp_r(kr,j,i) = temp_s(j,i)+q_geo(j,i)*h_r/kappa_r &
943 *(1.0_dp-
real(kr,dp)/
real(krmax,dp))
962 stop
' sico_init: Parameter NETCDF must be either 1 or 2!'
965 call
boundary(time_init, dtime, dxi, deta, &
966 delta_ts, glac_index, z_sl, dzsl_dtau, z_mar)
968 q_b_tot = q_bm + q_tld
981 dist_dxdy(jr,ir) = sqrt( (sq_g11_g(jmax/2,imax/2)*
real(ir,dp)*dxi)**2 &
982 + (sq_g22_g(jmax/2,imax/2)*
real(jr,dp)*deta)**2 )
997 zeta_c(kc) = kc*dzeta_c
998 eaz_c(kc) = exp(deform*zeta_c(kc))
999 eaz_c_quotient(kc) = (eaz_c(kc)-1.0_dp)/(ea-1.0_dp)
1003 zeta_t(kt) = kt*dzeta_t
1014 call
calc_vxy_ssa(z_sl, dxi, deta, dzeta_c, ii, jj, nn)
1027 open(12, iostat=ios, &
1028 file=outpath//
'/'//trim(runname)//
'.ser', &
1031 stop
' sico_init: Error when opening the ser file!'
1033 if (forcing_flag == 1)
then
1038 #if ( !defined(OUTSER_V_A) || OUTSER_V_A==1 )
1040 1102 format(
' t(a) D_Ts(deg C) z_sl(m)',/, &
1041 ' H_max(m) zs_max(m) V_g(m^3)', &
1042 ' V_t(m^3) V_fw(m^3/a) V_sle(m)',/, &
1043 ' A_g(m^2) A_t(m^2) V_bm(m^3/a)', &
1044 ' V_tld(m^3/a) H_t_max(m) vs_max(m/a)')
1045 1103 format(
'----------------------------------------------------', &
1046 '---------------------------------------')
1050 1102 format(
' t(a) D_Ts(deg C) z_sl(m)',/, &
1051 ' V(m^3) V_g(m^3) V_f(m^3)', &
1052 ' A(m^2) A_g(m^2) A_f(m^2)',/, &
1053 ' H_max(m) zs_max(m)', &
1054 ' V_t(m^3) V_fw(m^3/a) V_sle(m)',/, &
1055 ' A_t(m^2) V_bm(m^3/a)', &
1056 ' V_tld(m^3/a) H_t_max(m) vs_max(m/a)')
1057 1103 format(
'----------------------------------------------------', &
1058 '---------------------------------------')
1061 stop
' sico_init: OUTSER_V_A must be either 1 or 2!'
1064 else if (forcing_flag == 2)
then
1069 #if ( !defined(OUTSER_V_A) || OUTSER_V_A==1 )
1071 1112 format(
' t(a) glac_ind(1) z_sl(m)',/, &
1072 ' H_max(m) zs_max(m) V_g(m^3)', &
1073 ' V_t(m^3) V_fw(m^3/a) V_sle(m)',/, &
1074 ' A_g(m^2) A_t(m^2) V_bm(m^3/a)', &
1075 ' V_tld(m^3/a) H_t_max(m) vs_max(m/a)')
1076 1113 format(
'----------------------------------------------------', &
1077 '---------------------------------------')
1081 1112 format(
' t(a) glac_ind(1) z_sl(m)',/, &
1082 ' V(m^3) V_g(m^3) V_f(m^3)', &
1083 ' A(m^2) A_g(m^2) A_f(m^2)',/, &
1084 ' H_max(m) zs_max(m)', &
1085 ' V_t(m^3) V_fw(m^3/a) V_sle(m)',/, &
1086 ' A_t(m^2) V_bm(m^3/a)', &
1087 ' V_tld(m^3/a) H_t_max(m) vs_max(m/a)')
1088 1113 format(
'----------------------------------------------------', &
1089 '---------------------------------------')
1092 stop
' sico_init: OUTSER_V_A must be either 1 or 2!'
1101 open(13, iostat=ios, &
1102 file=outpath//
'/'//trim(runname)//
'.thk', &
1104 if (ios /= 0) stop
' sico_init: Error when opening the thk file!'
1106 if (forcing_flag == 1)
then
1111 1104 format(
' t(a) D_Ts(deg C) z_sl(m)',/, &
1112 ' H(m): JMAX+1 records [j = JMAX (-1) 0] with',/, &
1113 ' IMAX+1 values [i = 0 (1) IMAX] in each record')
1114 1105 format(
'----------------------------------------------------')
1116 else if (forcing_flag == 2)
then
1121 1114 format(
' t(a) glac_ind(1) z_sl(m)',/, &
1122 ' H(m): JMAX+1 records [j = JMAX (-1) 0] with',/, &
1123 ' IMAX+1 values [i = 0 (1) IMAX] in each record')
1124 1115 format(
'----------------------------------------------------')
1135 flag_3d_output = .false.
1137 flag_3d_output = .true.
1139 stop
' sico_init: ERGDAT must be either 0 or 1!'
1143 call
output1(runname, time_init, delta_ts, glac_index, z_sl, &
1144 flag_3d_output, ndat2d, ndat3d)
1146 call
output_nc(runname, time_init, delta_ts, glac_index, z_sl, &
1147 flag_3d_output, ndat2d, ndat3d)
1149 stop
' sico_init: Parameter NETCDF must be either 1 or 2!'
1154 if (time_output(1) <= time_init+eps)
then
1157 flag_3d_output = .false.
1159 flag_3d_output = .true.
1161 stop
' sico_init: ERGDAT must be either 0 or 1!'
1165 call
output1(runname, time_init, delta_ts, glac_index, z_sl, &
1166 flag_3d_output, ndat2d, ndat3d)
1168 call
output_nc(runname, time_init, delta_ts, glac_index, z_sl, &
1169 flag_3d_output, ndat2d, ndat3d)
1171 stop
' sico_init: Parameter NETCDF must be either 1 or 2!'
1178 flag_3d_output = .false.
1181 call
output1(runname, time_init, delta_ts, glac_index, z_sl, &
1182 flag_3d_output, ndat2d, ndat3d)
1184 call
output_nc(runname, time_init, delta_ts, glac_index, z_sl, &
1185 flag_3d_output, ndat2d, ndat3d)
1187 stop
' sico_init: Parameter NETCDF must be either 1 or 2!'
1190 if (time_output(1) <= time_init+eps)
then
1192 flag_3d_output = .true.
1195 call
output1(runname, time_init, delta_ts, glac_index, z_sl, &
1196 flag_3d_output, ndat2d, ndat3d)
1198 call
output_nc(runname, time_init, delta_ts, glac_index, z_sl, &
1199 flag_3d_output, ndat2d, ndat3d)
1201 stop
' sico_init: Parameter NETCDF must be either 1 or 2!'
1207 stop
' sico_init: OUTPUT must be either 1, 2 or 3!'
1210 call
output2(time_init, dxi, deta, delta_ts, glac_index, z_sl)
1212 call
output3(time_init, delta_ts, glac_index, z_sl)