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 if (abs(dx-40.0_dp) < eps)
then
95 if ((imax /= 150).or.(jmax /= 70))
then
96 stop
' sico_init: IMAX and/or JMAX wrong!'
99 else if (abs(dx-20.0_dp) < eps)
then
101 if ((imax /= 300).or.(jmax /= 140))
then
102 stop
' sico_init: IMAX and/or JMAX wrong!'
105 else if (abs(dx-10.0_dp) < eps)
then
107 if ((imax /= 600).or.(jmax /= 280))
then
108 stop
' sico_init: IMAX and/or JMAX wrong!'
112 stop
' sico_init: DX wrong!'
117 stop
' sico_init: GRID==2 not allowed for the Scandinavia application!'
125 #if ((TSURFACE == 5) && (ACCSURFACE != 5))
126 stop
' sico_init: Options TSURFACE==5 and ACCSURFACE==5 must be used together!'
129 #if ((TSURFACE != 5) && (ACCSURFACE == 5))
130 stop
' sico_init: Options TSURFACE==5 and ACCSURFACE==5 must be used together!'
137 stop
' sico_init: Option ADV_HOR==1 (central differences) not defined!'
140 #if ((ADV_HOR == 3) && (ADV_VERT != 3))
141 stop
' sico_init: Options ADV_HOR==3 and ADV_VERT==3 must be used together!'
144 #if ((ADV_HOR != 3) && (ADV_VERT == 3))
145 stop
' sico_init: Options ADV_HOR==3 and ADV_VERT==3 must be used together!'
154 #elif (TSURFACE == 5)
163 dtime_temp0 = dtime_temp0
165 dtime_wss0 = dtime_wss0
170 dzeta_c = 1.0_dp/
real(kcmax,dp)
171 dzeta_t = 1.0_dp/
real(ktmax,dp)
172 dzeta_r = 1.0_dp/
real(krmax,dp)
185 if ((i.le.imax).and.(j.le.jmax))
then
197 anfdatname = anfdatname
199 #if defined(YEAR_ZERO)
200 year_zero = year_zero
202 year_zero = 2000.0_dp
205 time_init0 = time_init0
206 time_end0 = time_end0
207 dtime_ser0 = dtime_ser0
209 #if ( OUTPUT==1 || OUTPUT==3 )
210 dtime_out0 = dtime_out0
213 #if ( OUTPUT==2 || OUTPUT==3 )
215 time_output0( 1) = time_out0_01
216 time_output0( 2) = time_out0_02
217 time_output0( 3) = time_out0_03
218 time_output0( 4) = time_out0_04
219 time_output0( 5) = time_out0_05
220 time_output0( 6) = time_out0_06
221 time_output0( 7) = time_out0_07
222 time_output0( 8) = time_out0_08
223 time_output0( 9) = time_out0_09
224 time_output0(10) = time_out0_10
225 time_output0(11) = time_out0_11
226 time_output0(12) = time_out0_12
227 time_output0(13) = time_out0_13
228 time_output0(14) = time_out0_14
229 time_output0(15) = time_out0_15
230 time_output0(16) = time_out0_16
231 time_output0(17) = time_out0_17
232 time_output0(18) = time_out0_18
233 time_output0(19) = time_out0_19
234 time_output0(20) = time_out0_20
239 shell_command =
'if [ ! -d'
240 shell_command = trim(shell_command)//
' '//outpath
241 shell_command = trim(shell_command)//
' '//
'] ; then mkdir'
242 shell_command = trim(shell_command)//
' '//outpath
243 shell_command = trim(shell_command)//
' '//
'; fi'
244 call system(trim(shell_command))
247 open(10, iostat=ios, &
248 file=outpath//
'/'//trim(runname)//
'.log', &
251 stop
'Error when opening the log file!'
253 write(10,1000)
'Computational domain:'
255 write(10,1000)
'Antarctica'
257 write(10,1000)
'Greenland'
259 write(10,1000)
'Scandinavia and Eurasia'
261 write(10,1000)
'Northern hemisphere'
262 #elif defined(EMTP2SGE)
263 write(10,1000)
'EISMINT Phase 2 Simplified Geometry Experiment'
265 write(10,1000)
'North polar cap of Mars'
267 write(10,1000)
'South polar cap of Mars'
269 stop
' sico_init: Subroutine sico_init: No valid domain specified!'
273 write(10,1001)
'imax =', imax
274 write(10,1001)
'jmax =', jmax
275 write(10,1001)
'kcmax =', kcmax
276 write(10,1001)
'ktmax =', ktmax
277 write(10,1001)
'krmax =', krmax
280 write(10,1002)
'a =', deform
283 #if (GRID==0 || GRID==1)
284 write(10,1002)
'x0 =', x0
285 write(10,1002)
'y0 =', y0
286 write(10,1002)
'dx =', dx
288 stop
' sico_init: GRID==2 not allowed for this application!'
292 write(10,1002)
'year_zero =', year_zero
293 write(10,1002)
'time_init =', time_init0
294 write(10,1002)
'time_end =', time_end0
295 write(10,1002)
'dtime =', dtime0
296 write(10,1002)
'dtime_temp =', dtime_temp0
298 write(10,1002)
'dtime_wss =', dtime_wss0
300 #if ( OUTPUT==1 || OUTPUT==3 )
301 write(10,1002)
'dtime_out =', dtime_out0
303 write(10,1002)
'dtime_ser =', dtime_ser0
306 write(10,1000)
'zs_present file = '//zs_present_file
308 write(10,1000)
'zl_present file = '//zl_present_file
310 write(10,1000)
'zl0 file = '//zl0_file
311 write(10,1000)
'mask_present file = '//mask_present_file
314 write(10,1000)
'Physical-parameter file = '//phys_para_file
317 #if (CALCZS==3 || CALCZS==4)
318 write(10,1002)
'ovi_weight =', ovi_weight
320 write(10,1002)
'omega_sor =', omega_sor
325 write(10,1000)
'temp_mm_present file = '//temp_mm_present_file
327 write(10,1002)
'delta_ts0 =', delta_ts0
329 write(10,1002)
'sine_amplit =', sine_amplit
330 write(10,1002)
'sine_period =', sine_period
332 write(10,1000)
'GRIP file = '//grip_temp_file
333 write(10,1002)
'grip_temp_fact =', grip_temp_fact
335 write(10,1000)
'Glacial-index file = '//glac_ind_file
336 write(10,1000)
'temp_mm_anom file = '//temp_mm_anom_file
337 write(10,1002)
'temp_mm_anom fact = ', temp_mm_anom_fact
340 write(10,1000)
'precip_mm_present file = '//precip_mm_present_file
342 write(10,1002)
'accfact =', accfact
343 #elif ( ACCSURFACE==2 || ACCSURFACE==3 )
344 write(10,1002)
'gamma_s =', gamma_s
345 #elif ( ACCSURFACE==5 )
346 write(10,1000)
'precip_mm_anom file = '//precip_mm_anom_file
347 write(10,1002)
'precip_mm_anom fact = ', precip_mm_anom_fact
349 #if (ACCSURFACE <= 3)
350 write(10,1001)
'ELEV_DESERT =', elev_desert
351 #if (ELEV_DESERT == 1)
352 write(10,1002)
'gamma_p =', gamma_p
353 write(10,1002)
'zs_thresh =', zs_thresh
358 write(10,1002)
'lambda_lti =', lambda_lti
359 write(10,1002)
'temp_lti =', temp_lti
363 write(10,1002)
'z_sl0 =', z_sl0
365 write(10,1000)
'sea-level file = '//sea_level_file
370 #if ( MARINE_ICE_CALVING==2 || MARINE_ICE_CALVING==3 )
371 write(10,1002)
'z_mar =', z_mar
373 #elif ( MARINE_ICE_CALVING==4 || MARINE_ICE_CALVING==5 \
374 || marine_ice_calving==6 || marine_ice_calving==7 )
375 write(10,1002)
'fact_z_mar =', fact_z_mar
377 #elif ( ( MARINE_ICE_FORMATION==2 ) && ( MARINE_ICE_CALVING==9 ) )
378 write(10,1002)
'calv_uw_coeff =', calv_uw_coeff
379 write(10,1002)
'r1_calv_uw =', r1_calv_uw
380 write(10,1002)
'r2_calv_uw =', r2_calv_uw
384 #if ICE_SHELF_CALVING==2
385 write(10,1002)
'H_calv =', h_calv
390 write(10,1002)
'c_slide =', c_slide
391 write(10,1002)
'gamma_slide =', gamma_slide
392 write(10,1001)
'p_weert =', p_weert
393 write(10,1001)
'q_weert =', q_weert
395 write(10,1002)
'red_pres_limit_fact =', red_pres_limit_fact
400 write(10,1002)
'q_geo =', q_geo
402 write(10,1000)
'q_geo file = '//q_geo_file
406 #if defined(MARINE_ICE_BASAL_MELTING)
407 write(10,1001)
'MARINE_ICE_BASAL_MELTING =', marine_ice_basal_melting
408 #if ( MARINE_ICE_BASAL_MELTING==2 || MARINE_ICE_BASAL_MELTING==3 )
409 write(10,1002)
'qbm_marine =', qbm_marine
415 write(10,1002)
'frac_llra =', frac_llra
420 write(10,1002)
'gr_size =', gr_size
424 write(10,1002)
'sigma_res =', sigma_res
428 write(10,1001)
'ENHMOD =', enhmod
429 write(10,1002)
'enh_fact =', enh_fact
430 #if ( ENHMOD==2 || ENHMOD==3 )
431 write(10,1002)
'enh_intg =', enh_intg
434 write(10,1002)
'age_trans =', age_trans_0
437 write(10,1002)
'date_trans1 =', date_trans1_0
438 write(10,1002)
'date_trans2 =', date_trans2_0
439 write(10,1002)
'date_trans3 =', date_trans3_0
442 write(10,1002)
'enh_shelf =', enh_shelf
446 write(10,1002)
'numdiff_H_t =', numdiff_h_t
447 write(10,1002)
'tau_cts =', tau_cts
448 write(10,1002)
'H_min =', h_min
449 write(10,1002)
'vh_max =', vh_max
450 write(10,1002)
'hd_min =', hd_min
451 write(10,1002)
'hd_max =', hd_max
453 write(10,1002)
'qbm_min =', qbm_min
454 #elif defined(QB_MIN) /* obsolete */
455 write(10,1002)
'qb_min =', qb_min
458 write(10,1002)
'qbm_max =', qbm_max
459 #elif defined(QB_MAX) /* obsolete */
460 write(10,1002)
'qb_max =', qb_max
462 write(10,1002)
'age_min =', age_min
463 write(10,1002)
'age_max =', age_max
464 write(10,1002)
'mean_accum =', mean_accum
466 write(10,1002)
'age_diff =', agediff
467 write(10,1002)
'm_age =', m_age
471 write(10,1001)
'GRID =', grid
472 write(10,1001)
'CALCMOD =', calcmod
473 write(10,1001)
'FLOW_LAW =', flow_law
474 write(10,1001)
'FIN_VISC =', fin_visc
475 write(10,1001)
'MARGIN =', margin
477 write(10,1001)
'MARINE_ICE_FORMATION =', marine_ice_formation
478 write(10,1001)
'MARINE_ICE_CALVING =', marine_ice_calving
480 write(10,1001)
'ICE_SHELF_CALVING =', ice_shelf_calving
482 write(10,1001)
'ANF_DAT =', anf_dat
483 write(10,1001)
'REBOUND =', rebound
484 write(10,1001)
'Q_LITHO =', q_litho
485 write(10,1001)
'ZS_EVOL =', zs_evol
486 write(10,1001)
'CALCZS =', calczs
487 write(10,1001)
'ADV_HOR =', adv_hor
488 write(10,1001)
'ADV_VERT =', adv_vert
489 write(10,1001)
'TOPOGRAD =', topograd
490 write(10,1001)
'TSURFACE =', tsurface
491 write(10,1001)
'ACCSURFACE =', accsurface
493 write(10,1001)
'PRECIP_ANOM_INTERPOL =', precip_anom_interpol
495 write(10,1001)
'SOLID_PRECIP =', solid_precip
496 write(10,1001)
'ABLSURFACE =', ablsurface
497 write(10,1001)
'SEA_LEVEL =', sea_level
498 write(10,1001)
'SLIDE_LAW =', slide_law
499 write(10,1001)
'Q_GEO_MOD =', q_geo_mod
502 #if defined(OUT_TIMES)
503 write(10,1001)
'OUT_TIMES =', out_times
505 write(10,1001)
'OUTPUT =', output
506 write(10,1001)
'OUTSER =', outser
507 #if defined(OUTSER_V_A)
508 write(10,1001)
'OUTSER_V_A =', outser_v_a
510 #if ( OUTPUT==1 || OUTPUT==2 )
511 write(10,1001)
'ERGDAT =', ergdat
513 write(10,1001)
'NETCDF =', netcdf
515 #if ( OUTPUT==2 || OUTPUT==3 )
516 write(10,1001)
'n_output =', n_output
518 write(10,1002)
'time_output =', time_output0(n)
523 write(10,1000)
'Program version and date: '//version//
' / '//date
527 1002 format(a,es12.4)
529 close(10, status=
'keep')
533 year_zero = year_zero*year_sec
534 time_init = time_init0*year_sec
535 time_end = time_end0*year_sec
536 dtime = dtime0*year_sec
537 dtime_temp = dtime_temp0*year_sec
539 dtime_wss = dtime_wss0*year_sec
541 dtime_ser = dtime_ser0*year_sec
542 #if ( OUTPUT==1 || OUTPUT==3 )
543 dtime_out = dtime_out0*year_sec
545 #if ( OUTPUT==2 || OUTPUT==3 )
547 time_output(n) = time_output0(n)*year_sec
551 if (abs(dtime_temp/dtime-nint(dtime_temp/dtime)) > eps) &
552 stop
' sico_init: dtime_temp must be a multiple of dtime!'
555 if (abs(dtime_wss/dtime-nint(dtime_wss/dtime)) > eps) &
556 stop
' sico_init: dtime_wss must be a multiple of dtime!'
561 #if (GRID==0 || GRID==1)
563 open(21, iostat=ios, &
564 file=inpath//
'/scand/'//precip_mm_present_file, &
565 recl=8192, status=
'old')
569 stop
' sico_init: GRID==2 not allowed for the Scandinavia application!'
573 if (ios /= 0) stop
' sico_init: Error when opening the precipitation file!'
575 do m=1, 6;
read(21,
'(a)') ch_dummy;
end do
578 do m=1, 3;
read(21,
'(a)') ch_dummy;
end do
580 read(21,*) (precip_present(j,i,n), i=0,imax)
584 close(21, status=
'keep')
588 precip_present = precip_present *(1.0e-03_dp/year_sec)*(rho_w/rho)
595 #if (GRID==0 || GRID==1)
597 open(21, iostat=ios, &
598 file=inpath//
'/scand/'//precip_mm_anom_file, &
599 recl=8192, status=
'old')
603 if (ios /= 0) stop
' sico_init: Error when opening the precip anomaly file!'
605 do m=1, 6;
read(21,
'(a)') ch_dummy;
end do
608 do m=1, 3;
read(21,
'(a)') ch_dummy;
end do
610 read(21,*) (precip_lgm_anom(j,i,n), i=0,imax)
614 close(21, status=
'keep')
616 precip_lgm_anom = precip_lgm_anom * precip_mm_anom_fact
621 #if (PRECIP_ANOM_INTERPOL==1)
623 gamma_precip_lgm_anom(j,i,n) = 0.0_dp
625 #elif (PRECIP_ANOM_INTERPOL==2)
627 gamma_precip_lgm_anom(j,i,n) = -log(precip_lgm_anom(j,i,n))
630 stop
' sico_init: Wrong value of switch PRECIP_ANOM_INTERPOL!'
640 mean_accum = mean_accum*(1.0e-03_dp/year_sec)*(rho_w/rho)
643 mean_accum_inv = 1.0_dp/mean_accum
647 #if (GRID==0 || GRID==1)
649 open(24, iostat=ios, &
650 file=inpath//
'/scand/'//mask_present_file, &
655 stop
' sico_init: GRID==2 not allowed for the Scandinavia application!'
660 stop
' sico_init: Error when opening the mask file!'
662 do m=1, 6;
read(24,
'(a)') ch_dummy;
end do
665 read(24,2300) (maske_help(j,i), i=0,imax)
668 close(24, status=
'keep')
670 2300 format(imax(i1),i1)
674 #if (GRID==0 || GRID==1)
676 open(21, iostat=ios, &
677 file=inpath//
'/scand/'//temp_mm_present_file, &
678 recl=8192, status=
'old')
682 stop
' sico_init: GRID==2 not allowed for the Scandinavia application!'
686 if (ios /= 0) stop
' sico_init: Error when opening the temperature file!'
688 do m=1, 6;
read(21,
'(a)') ch_dummy;
end do
691 do m=1, 3;
read(21,
'(a)') ch_dummy;
end do
693 read(21,*) (temp_mm_present(j,i,n), i=0,imax)
697 close(21, status=
'keep')
703 #if (GRID==0 || GRID==1)
705 open(21, iostat=ios, &
706 file=inpath//
'/scand/'//temp_mm_anom_file, &
707 recl=8192, status=
'old')
711 if (ios /= 0) stop
' sico_init: Error when opening the temperature anomaly file!'
713 do m=1, 6;
read(21,
'(a)') ch_dummy;
end do
716 do m=1, 3;
read(21,
'(a)') ch_dummy;
end do
718 read(21,*) (temp_mm_lgm_anom(j,i,n), i=0,imax)
722 close(21, status=
'keep')
724 temp_mm_lgm_anom = temp_mm_lgm_anom * temp_mm_anom_fact
731 #if (GRID==0 || GRID==1)
733 open(21, iostat=ios, &
734 file=inpath//
'/scand/'//zs_present_file, &
735 recl=8192, status=
'old')
739 stop
' sico_init: GRID==2 not allowed for the Scandinavia application!'
743 if (ios /= 0) stop
' sico_init: Error when opening the zs file!'
745 do m=1, 6;
read(21,
'(a)') ch_dummy;
end do
748 read(21,*) (zs_ref(j,i), i=0,imax)
751 close(21, status=
'keep')
758 if (maske_help(j,i).ge.2) zs_ref(j,i) = 0.0_dp
766 open(21, iostat=ios, &
767 file=inpath//
'/general/'//grip_temp_file, &
770 stop
' sico_init: Error when opening the data file for delta_ts!'
772 read(21,*) ch_dummy, grip_time_min, grip_time_stp, grip_time_max
774 if (ch_dummy /=
'#')
then
775 write(6,*)
' sico_init: grip_time_min, grip_time_stp, grip_time_max'
776 write(6,*)
' not defined in data file for delta_ts!'
780 ndata_grip = (grip_time_max-grip_time_min)/grip_time_stp
782 allocate(griptemp(0:ndata_grip))
785 read(21,*) d_dummy, griptemp(n)
788 close(21, status=
'keep')
796 open(21, iostat=ios, &
797 file=inpath//
'/general/'//glac_ind_file, status=
'old')
798 if (ios /= 0) stop
' sico_init: Error when opening the glacial-index file!'
800 read(21,*) ch_dummy, gi_time_min, gi_time_stp, gi_time_max
802 if (ch_dummy /=
'#')
then
803 write(6,*)
' sico_init: gi_time_min, gi_time_stp, gi_time_max'
804 write(6,*)
' not defined in glacial-index file!'
808 ndata_gi = (gi_time_max-gi_time_min)/gi_time_stp
810 allocate(glacial_index(0:ndata_gi))
813 read(21,*) d_dummy, glacial_index(n)
816 close(21, status=
'keep')
824 open(21, iostat=ios, &
825 file=inpath//
'/general/'//sea_level_file, &
828 stop
' sico_init: Error when opening the data file for z_sl!'
830 read(21,*) ch_dummy, specmap_time_min, specmap_time_stp, specmap_time_max
832 if (ch_dummy /=
'#')
then
833 write(6,*)
' sico_init: specmap_time_min, specmap_time_stp, specmap_time_max'
834 write(6,*)
' not defined in data file for z_sl!'
838 ndata_specmap = (specmap_time_max-specmap_time_min)/specmap_time_stp
840 allocate(specmap_zsl(0:ndata_specmap))
842 do n=0, ndata_specmap
843 read(21,*) d_dummy, specmap_zsl(n)
846 close(21, status=
'keep')
858 q_geo(j,i) = q_geo *1.0e-03_dp
866 open(21, iostat=ios, &
867 file=inpath//
'/scand/'//q_geo_file, &
868 recl=8192, status=
'old')
870 if (ios /= 0) stop
' sico_init: Error when opening the qgeo file!'
872 do m=1, 6;
read(21,
'(a)') ch_dummy;
end do
875 read(21,*) (q_geo(j,i), i=0,imax)
878 close(21, status=
'keep')
882 q_geo(j,i) = q_geo(j,i) *1.0e-03_dp
890 #if (REBOUND==0 || REBOUND==1)
892 kei = 0.0_dp; n_data_kei = 0; kei_r_max = 0.0_dp; kei_r_incr = 0.0_dp
906 stop
' sico_init: ANF_DAT==1 not allowed for scand application!'
916 call
boundary(time_init, dtime, dxi, deta, &
917 delta_ts, glac_index, z_sl, dzsl_dtau, z_mar)
924 q_b_tot(j,i) = 0.0_dp
930 temp_c(kc,j,i) = temp_s(j,i)
931 age_c(kc,j,i) = 15000.0_dp*year_sec
935 omega_t(kt,j,i) = 0.0_dp
936 age_t(kt,j,i) = 15000.0_dp*year_sec
940 temp_r(kr,j,i) = temp_s(j,i)+q_geo(j,i)*h_r/kappa_r &
941 *(1.0_dp-
real(kr,dp)/
real(krmax,dp))
960 stop
' sico_init: Parameter NETCDF must be either 1 or 2!'
963 call
boundary(time_init, dtime, dxi, deta, &
964 delta_ts, glac_index, z_sl, dzsl_dtau, z_mar)
966 q_b_tot = q_bm + q_tld
974 #if (GRID==0 || GRID==1)
978 dist_dxdy(jr,ir) = sqrt( (
real(ir,dp)*dxi)**2 + (
real(jr,dp)*deta)**2 )
990 zeta_c(kc) = kc*dzeta_c
991 eaz_c(kc) = exp(deform*zeta_c(kc))
992 eaz_c_quotient(kc) = (eaz_c(kc)-1.0_dp)/(ea-1.0_dp)
996 zeta_t(kt) = kt*dzeta_t
1007 call
calc_vxy_ssa(z_sl, dxi, deta, dzeta_c, ii, jj, nn)
1020 open(12, iostat=ios, &
1021 file=outpath//
'/'//trim(runname)//
'.ser', &
1024 stop
' sico_init: Error when opening the ser file!'
1026 if (forcing_flag == 1)
then
1031 #if ( !defined(OUTSER_V_A) || OUTSER_V_A==1 )
1033 1102 format(
' t(a) D_Ts(deg C) z_sl(m)',/, &
1034 ' H_max(m) zs_max(m) V_g(m^3)', &
1035 ' V_t(m^3) V_fw(m^3/a) V_sle(m)',/, &
1036 ' A_g(m^2) A_t(m^2) V_bm(m^3/a)', &
1037 ' V_tld(m^3/a) H_t_max(m) vs_max(m/a)')
1038 1103 format(
'----------------------------------------------------', &
1039 '---------------------------------------')
1043 1102 format(
' t(a) D_Ts(deg C) z_sl(m)',/, &
1044 ' V(m^3) V_g(m^3) V_f(m^3)', &
1045 ' A(m^2) A_g(m^2) A_f(m^2)',/, &
1046 ' H_max(m) zs_max(m)', &
1047 ' V_t(m^3) V_fw(m^3/a) V_sle(m)',/, &
1048 ' A_t(m^2) V_bm(m^3/a)', &
1049 ' V_tld(m^3/a) H_t_max(m) vs_max(m/a)')
1050 1103 format(
'----------------------------------------------------', &
1051 '---------------------------------------')
1054 stop
' sico_init: OUTSER_V_A must be either 1 or 2!'
1057 else if (forcing_flag == 2)
then
1062 #if ( !defined(OUTSER_V_A) || OUTSER_V_A==1 )
1064 1112 format(
' t(a) glac_ind(1) z_sl(m)',/, &
1065 ' H_max(m) zs_max(m) V_g(m^3)', &
1066 ' V_t(m^3) V_fw(m^3/a) V_sle(m)',/, &
1067 ' A_g(m^2) A_t(m^2) V_bm(m^3/a)', &
1068 ' V_tld(m^3/a) H_t_max(m) vs_max(m/a)')
1069 1113 format(
'----------------------------------------------------', &
1070 '---------------------------------------')
1074 1112 format(
' t(a) glac_ind(1) z_sl(m)',/, &
1075 ' V(m^3) V_g(m^3) V_f(m^3)', &
1076 ' A(m^2) A_g(m^2) A_f(m^2)',/, &
1077 ' H_max(m) zs_max(m)', &
1078 ' V_t(m^3) V_fw(m^3/a) V_sle(m)',/, &
1079 ' A_t(m^2) V_bm(m^3/a)', &
1080 ' V_tld(m^3/a) H_t_max(m) vs_max(m/a)')
1081 1113 format(
'----------------------------------------------------', &
1082 '---------------------------------------')
1085 stop
' sico_init: OUTSER_V_A must be either 1 or 2!'
1094 open(13, iostat=ios, &
1095 file=outpath//
'/'//trim(runname)//
'.thk', &
1097 if (ios /= 0) stop
' sico_init: Error when opening the thk file!'
1099 if (forcing_flag == 1)
then
1104 1104 format(
' t(a) D_Ts(deg C) z_sl(m)',/, &
1105 ' H(m): JMAX+1 records [j = JMAX (-1) 0] with',/, &
1106 ' IMAX+1 values [i = 0 (1) IMAX] in each record')
1107 1105 format(
'----------------------------------------------------')
1109 else if (forcing_flag == 2)
then
1114 1114 format(
' t(a) glac_ind(1) z_sl(m)',/, &
1115 ' H(m): JMAX+1 records [j = JMAX (-1) 0] with',/, &
1116 ' IMAX+1 values [i = 0 (1) IMAX] in each record')
1117 1115 format(
'----------------------------------------------------')
1128 flag_3d_output = .false.
1130 flag_3d_output = .true.
1132 stop
' sico_init: ERGDAT must be either 0 or 1!'
1136 call
output1(runname, time_init, delta_ts, glac_index, z_sl, &
1137 flag_3d_output, ndat2d, ndat3d)
1139 call
output_nc(runname, time_init, delta_ts, glac_index, z_sl, &
1140 flag_3d_output, ndat2d, ndat3d)
1142 stop
' sico_init: Parameter NETCDF must be either 1 or 2!'
1147 if (time_output(1) <= time_init+eps)
then
1150 flag_3d_output = .false.
1152 flag_3d_output = .true.
1154 stop
' sico_init: ERGDAT must be either 0 or 1!'
1158 call
output1(runname, time_init, delta_ts, glac_index, z_sl, &
1159 flag_3d_output, ndat2d, ndat3d)
1161 call
output_nc(runname, time_init, delta_ts, glac_index, z_sl, &
1162 flag_3d_output, ndat2d, ndat3d)
1164 stop
' sico_init: Parameter NETCDF must be either 1 or 2!'
1171 flag_3d_output = .false.
1174 call
output1(runname, time_init, delta_ts, glac_index, z_sl, &
1175 flag_3d_output, ndat2d, ndat3d)
1177 call
output_nc(runname, time_init, delta_ts, glac_index, z_sl, &
1178 flag_3d_output, ndat2d, ndat3d)
1180 stop
' sico_init: Parameter NETCDF must be either 1 or 2!'
1183 if (time_output(1) <= time_init+eps)
then
1185 flag_3d_output = .true.
1188 call
output1(runname, time_init, delta_ts, glac_index, z_sl, &
1189 flag_3d_output, ndat2d, ndat3d)
1191 call
output_nc(runname, time_init, delta_ts, glac_index, z_sl, &
1192 flag_3d_output, ndat2d, ndat3d)
1194 stop
' sico_init: Parameter NETCDF must be either 1 or 2!'
1200 stop
' sico_init: OUTPUT must be either 1, 2 or 3!'
1203 call
output2(time_init, dxi, deta, delta_ts, glac_index, z_sl)
1205 call
output3(time_init, delta_ts, glac_index, z_sl)