53 integer(i4b),
private :: disc
54 integer(i4b),
private :: n_discharge_call, iter_mar_coa
55 real(dp),
private :: c_dis_0, s_dis, c_dis_fac
56 real(dp),
private :: t_sub_pd, alpha_sub, alpha_o, m_h, m_d, r_mar_eff
57 real(dp),
private :: t_sea_freeze
60 integer(i2b),
dimension(0:JMAX,0:IMAX),
public ::
mask_mar 61 real(dp),
dimension(0:JMAX,0:IMAX),
private :: c_dis
63 real(dp),
dimension(0:JMAX,0:IMAX),
public ::
dis_perp 84 real(dp),
intent(in) :: dtime
86 real(dp) :: dtime_mar_coa
96 r_mar_eff = r_mar_eff *1000.0_dp
104 #if (defined(ALPHA_SUB)) 105 alpha_sub = alpha_sub
110 #if (defined(ALPHA_O)) 118 n_discharge_call = -1
120 #if (defined(DTIME_MAR_COA0)) 121 dtime_mar_coa = dtime_mar_coa0*year_sec
123 stop
' >>> disc_param: DTIME_MAR_COA0 not defined in header file!' 126 if (.not.approx_integer_multiple(dtime_mar_coa, dtime,
eps_sp_dp)) &
127 stop
' >>> disc_param: dtime_mar_coa must be a multiple of dtime!' 129 iter_mar_coa = nint(dtime_mar_coa/dtime)
132 stop
' >>> disc_param: GRID==2 not allowed for this application!' 135 #if (ANF_DAT != 1 && defined(EXEC_MAKE_C_DIS_0)) 136 stop
' >>> disc_param: EXEC_MAKE_C_DIS_0 defined requires ANF_DAT==1!' 165 real(dp),
intent(in) :: dxi, deta
168 real(dp) :: disc_target, disc_tot, dT_sub
172 disc_target = 350.0_dp
183 n_discharge_call = -1
209 disc_tot = disc_tot *year_sec *(
rho/
rho_w)
212 disc_target = disc_target*1.0e+12_dp/
rho_w 214 write(6, fmt=
'(a)')
' ' 215 write(6, fmt=
'(a)')
' * * * * * * * * * * * * * * * * * * * * * * * * * * * * ' 217 write(6, fmt=
'(a)')
' ' 218 write(6, fmt=
'(3x,a,es12.4)')
'c_dis_0_init = ', c_dis_0
220 c_dis_0 = c_dis_0 * disc_target/disc_tot
222 write(6, fmt=
'(a)')
' ' 223 write(6, fmt=
'(3x,a,es12.4)')
'disc_target = ', disc_target
224 write(6, fmt=
'(3x,a,es12.4)')
'disc_tot = ', disc_tot
226 write(6, fmt=
'(a)')
' ' 227 write(6, fmt=
'(3x,a,es12.4)')
'--> c_dis_0 = ', c_dis_0
250 real(dp) :: delta_phi=25.0_dp
253 c_dis = c_dis_0*c_dis_fac &
256 c_dis = max(c_dis, 0.0_dp)
275 real(dp),
intent(in) :: dxi, deta
277 real(dp),
parameter :: alpha_tc=60.0_dp
280 n_discharge_call = n_discharge_call + 1
282 cos_tc=dcos(alpha_tc*
pi_180)
284 if ((mod(n_discharge_call, iter_mar_coa)==0).or.(n_discharge_call==1))
then 285 write(6, fmt=
'(10x,a)')
'Computation of mask_mar, cst_dist, cos_grad_tc' 286 call marginal_ring(dxi, deta)
287 call coastal_distance(dxi, deta)
302 else if(disc.eq.0)
then 312 subroutine coastal_distance(dxi, deta)
329 real(dp),
intent(in) :: dxi, deta
332 real(dp),
parameter :: grid_dist=5000.0_dp
333 real(dp),
parameter :: c_smooth=0.2_dp
334 integer(i4b),
parameter :: i_search=2
336 integer(i4b) :: i, j, i_pos, j_pos, l, l_e, d_l
337 real(dp) :: dxi_inv, deta_inv
338 real(dp) :: cst_dist_tmp, qrt_1, qrt_2
339 logical :: leave_loop
341 real(dp),
allocatable,
dimension(:,:) :: zs_tmp, grad_zs_x, grad_zs_y, &
342 grad_dist_x, grad_dist_y
344 allocate(zs_tmp(0:jmax,0:imax), grad_zs_x(0:jmax,0:imax), grad_zs_y(0:jmax,0:imax), &
345 grad_dist_x(0:jmax,0:imax), grad_dist_y(0:jmax,0:imax))
347 select case (i_search)
354 if(
maske(j_pos,i_pos).ne.2)
then 358 if(
maske(j,i).eq.2)
then 359 cst_dist_tmp=sqrt((
xi(i_pos)-
xi(i))**2+(
eta(j_pos)-
eta(j))**2)
360 if(cst_dist_tmp.le.
cst_dist(j_pos,i_pos))
then 376 if(
maske(j_pos,i_pos).ne.2)
then 379 do l=1, max(imax,jmax)
380 do i=max(i_pos-l,0), min(i_pos+l,imax)
381 j=max(j_pos-l,0); j=min(j,jmax)
382 if(
maske(j,i).eq.2)
then 384 cst_dist_tmp=sqrt((
xi(i_pos)-
xi(i))**2+(
eta(j_pos)-
eta(j))**2)
385 if(cst_dist_tmp.le.
cst_dist(j_pos,i_pos))
then 390 if(
maske(j,i).eq.2)
then 392 cst_dist_tmp=sqrt((
xi(i_pos)-
xi(i))**2+(
eta(j_pos)-
eta(j))**2)
393 if(cst_dist_tmp.le.
cst_dist(j_pos,i_pos))
then 398 do j=max(j_pos-l+1,0), min(j_pos+l-1,jmax)
399 i=max(i_pos-l,0); i=min(i,imax)
400 if(
maske(j,i).eq.2)
then 402 cst_dist_tmp=sqrt((
xi(i_pos)-
xi(i))**2+(
eta(j_pos)-
eta(j))**2)
403 if(cst_dist_tmp.le.
cst_dist(j_pos,i_pos))
then 408 if(
maske(j,i).eq.2)
then 410 cst_dist_tmp=sqrt((
xi(i_pos)-
xi(i))**2+(
eta(j_pos)-
eta(j))**2)
411 if(cst_dist_tmp.le.
cst_dist(j_pos,i_pos))
then 418 d_l=ceiling(l_e*sqrt(2.0_dp)+0.001_dp)
423 do i=max(i_pos-(l_e+d_l),0),min(i_pos-(l_e-1),imax)
424 do j=max(j_pos-l_e,0),min(j_pos+l_e,jmax)
425 if(
maske(j,i).eq.2)
then 426 cst_dist_tmp=sqrt((
xi(i_pos)-
xi(i))**2+(
eta(j_pos)-
eta(j))**2)
427 if(cst_dist_tmp.le.
cst_dist(j_pos,i_pos))
then 434 do i=max(i_pos+l_e+1,0),min(i_pos+l_e+d_l,imax)
435 do j=max(j_pos-l_e,0),min(j_pos+l_e,jmax)
436 if(
maske(j,i).eq.2)
then 437 cst_dist_tmp=sqrt((
xi(i_pos)-
xi(i))**2+(
eta(j_pos)-
eta(j))**2)
438 if(cst_dist_tmp.le.
cst_dist(j_pos,i_pos))
then 445 do i=max(i_pos-l_e,0),min(i_pos+l_e,imax)
446 do j=max(j_pos-(l_e+d_l),0),min(j_pos-(l_e-1),jmax)
447 if(
maske(j,i).eq.2)
then 448 cst_dist_tmp=sqrt((
xi(i_pos)-
xi(i))**2+(
eta(j_pos)-
eta(j))**2)
449 if(cst_dist_tmp.le.
cst_dist(j_pos,i_pos))
then 456 do i=max(i_pos-l_e,0),min(i_pos+l_e,imax)
457 do j=max(j_pos+l_e+1,0),min(j_pos+l_e+d_l,jmax)
458 if(
maske(j,i).eq.2)
then 459 cst_dist_tmp=sqrt((
xi(i_pos)-
xi(i))**2+(
eta(j_pos)-
eta(j))**2)
460 if(cst_dist_tmp.le.
cst_dist(j_pos,i_pos))
then 479 if(
xi(i).le.-350000.0_dp &
480 .and.-2800000.0_dp.le.
eta(j) &
481 .and.
eta(j).le.-2250000.0_dp &
483 xi(i).ge.100000.0_dp &
484 .and.-2280000.0_dp.le.
eta(j) &
485 .and.
eta(j).le.-1880000.0_dp &
487 eta(j).ge.-1250000.0_dp &
488 .and.0.0_dp.le.
xi(i) &
489 .and.
xi(i).le.230000.0_dp)
then 510 zs_tmp(j,i) = c_smooth*(
zs(j,i-1)+
zs(j,i+1)+
zs(j-1,i)+
zs(j+1,i)) &
511 +(1.0_dp-4.0_dp*c_smooth)*
zs(j,i)
518 deta_inv = 1.0_dp/deta
524 grad_zs_x(j,i) = (zs_tmp(j,i+1)-zs_tmp(j,i-1))*0.5_dp*dxi_inv*
insq_g11_g(j,i)
530 grad_zs_x(j,0) = (zs_tmp(j,1)-zs_tmp(j,0))*dxi_inv*
insq_g11_g(j,0)
531 grad_zs_x(j,imax) = (zs_tmp(j,imax)-zs_tmp(j,imax-1))*dxi_inv*
insq_g11_g(j,imax)
540 grad_zs_y(j,i) = (zs_tmp(j+1,i)-zs_tmp(j-1,i))*0.5_dp*deta_inv*
insq_g22_g(j,i)
546 grad_zs_y(0,i) = (zs_tmp(1,i)-zs_tmp(0,i))*deta_inv*
insq_g22_g(0,i)
547 grad_zs_y(jmax,i) = (zs_tmp(jmax,i)-zs_tmp(jmax-1,i))*deta_inv*
insq_g22_g(jmax,i)
556 qrt_1=grad_zs_x(j,i)*grad_zs_x(j,i)+grad_zs_y(j,i)*grad_zs_y(j,i)
557 qrt_2=grad_dist_x(j,i)*grad_dist_x(j,i)+grad_dist_y(j,i)*grad_dist_y(j,i)
558 if(qrt_1.ne.0.0_dp.and.qrt_2.ne.0.0_dp)
then 562 cos_grad_tc(j,i)= (grad_zs_x(j,i)*grad_dist_x(j,i)+grad_zs_y(j,i)*grad_dist_y(j,i))/ &
563 (sqrt(qrt_1)*sqrt(qrt_2))
570 deallocate(zs_tmp, grad_zs_x, grad_zs_y, grad_dist_x, grad_dist_y)
572 end subroutine coastal_distance
578 subroutine marginal_ring(dxi, deta)
594 real(dp),
intent(in) :: dxi, deta
596 integer(i4b) :: i, j, i_pos, j_pos, di_eff, dj_eff
597 integer(i4b) :: count_tmp
600 if(r_mar_eff.le.1.0e6_dp)
then 604 if((
maske(j_pos,i_pos).eq.1.or.
maske(j_pos,i_pos).eq.2).and. &
605 .not.(
maske(j_pos,i_pos).eq.1.and.
maske(j_pos,i_pos-1).eq.0 &
606 .and.
maske(j_pos,i_pos+1).eq.0.or. &
607 maske(j_pos,i_pos).eq.1.and.
maske(j_pos-1,i_pos).eq.0 &
608 .and.
maske(j_pos+1,i_pos).eq.0.or. &
609 maske(j_pos,i_pos).eq.1.and.
maske(j_pos,i_pos-1).eq.3 &
610 .and.
maske(j_pos,i_pos+1).eq.3.or. &
611 maske(j_pos,i_pos).eq.1.and.
maske(j_pos-1,i_pos).eq.3 &
612 .and.
maske(j_pos+1,i_pos).eq.3.or. &
613 maske(j_pos,i_pos).eq.1.and.
maske(j_pos,i_pos-1).eq.3 &
614 .and.
maske(j_pos,i_pos+1).eq.0.or. &
615 maske(j_pos,i_pos).eq.1.and.
maske(j_pos-1,i_pos).eq.0 &
616 .and.
maske(j_pos+1,i_pos).eq.3))
then 617 di_eff=int(r_mar_eff/dxi)+1; dj_eff=int(r_mar_eff/deta)+1
618 do i=max(i_pos-di_eff,0), min(i_pos+di_eff,imax)
619 do j=max(j_pos-dj_eff,0), min(j_pos+dj_eff,jmax)
620 r_p=sqrt((
xi(i_pos)-
xi(i))**2+(
eta(j_pos)-
eta(j))**2)
621 if(r_p.le.r_mar_eff.and.(
maske(j,i).eq.0.or.
maske(j,i).eq.3))
then 636 end subroutine marginal_ring
642 subroutine calc_sub_oc_dt(T_sub_PD, dT_glann, dT_sub)
653 real(dp),
intent(in) :: T_sub_PD, dT_glann
654 real(dp),
intent(out) :: dT_sub
658 dt_sub=alpha_o*dt_glann
659 t_sub=max(t_sea_freeze, t_sub_pd)+dt_sub
660 t_sub=max(t_sea_freeze, t_sub)
662 dt_sub=t_sub-t_sub_pd
664 end subroutine calc_sub_oc_dt
integer(i2b), dimension(0:jmax, 0:imax), public mask_mar
real(dp) delta_tm_sw
DELTA_TM_SW: Melting point depression of sea water due to its average salinity.
real(dp), dimension(0:jmax, 0:imax) phi
phi(j,i): Geographic latitude of grid point (i,j)
real(dp), dimension(0:jmax, 0:imax), public cos_grad_tc
real(dp) rho_w
RHO_W: Density of pure water.
real(dp), dimension(0:jmax, 0:imax) insq_g22_g
insq_g22_g(j,i): Inverse square root of g22 on grid point (i,j)
integer(i2b), dimension(0:jmax, 0:imax) maske
maske(j,i): Ice-land-ocean mask. 0: grounded ice, 1: ice-free land, 2: ocean, 3: floating ice ...
real(dp), dimension(0:jmax, 0:imax) area
area(j,i): Area of grid cell associated with grid point (i,j)
subroutine, public calc_c_dis_0(dxi, deta)
Constant in ice discharge parameterization (Greenland). [Determine (amount of magnitude of) constant ...
real(dp), dimension(0:jmax, 0:imax), public cst_dist
real(dp), parameter pi_180_inv
pi_180_inv: 180 divided by pi (-> rad to deg)
Declarations of global variables for SICOPOLIS (for the ANT domain).
subroutine, public disc_param(dtime)
Ice discharge parameters (Greenland). [Assign ice discharge parameters.].
real(dp), parameter pi_180
pi_180: pi divided by 180 (-> deg to rad)
real(dp), dimension(0:jmax, 0:imax), public dis_perp
Declarations of kind types for SICOPOLIS.
real(dp), dimension(0:jmax, 0:imax) zs
zs(j,i): Coordinate z of the surface topography
real(dp), dimension(0:jmax, 0:imax) h_c
H_c(j,i): Thickness of ice in the upper (kc) domain (thickness of the cold-ice layer for POLY...
subroutine, public disc_fields()
Dependence of ice discharge coefficient on latitude (Greenland). [Determine dependence of ice dischar...
Comparison of single- or double-precision floating-point numbers.
real(dp), public dt_glann
subroutine, public discharge(dxi, deta)
Ice discharge parameterization main formula, controler (general). [Compute ice discharge via a parame...
real(dp), dimension(0:jmax) eta
eta(j): Coordinate eta (= y) of grid point j
real(dp), dimension(0:jmax, 0:imax) insq_g11_g
insq_g11_g(j,i): Inverse square root of g11 on grid point (i,j)
real(dp), dimension(0:imax) xi
xi(i): Coordinate xi (= x) of grid point i
real(dp), parameter eps_sp_dp
eps_sp_dp: Small number to single-precision accuracy in double precision
Ice discharge parameterization for the Greenland ice sheet.
real(dp) rho
RHO: Density of ice.
real(dp), dimension(0:jmax, 0:imax) zb
zb(j,i): Coordinate z of the ice base
real(dp), dimension(0:jmax, 0:imax) h_t
H_t(j,i): Thickness of ice in the lower (kt) domain (thickness of the temperate layer for POLY...
Declarations of global variables for SICOPOLIS.