10 use regrid_interp,
only : nr_iterations, nr_tolerance, degree_max
12 implicit none ;
private
28 real :: compressibility_fraction
32 real :: rho_ml_avg_depth
35 real :: nlay_ml_offset
38 integer :: nz_fixed_surface = 2
45 logical :: fix_haloclines = .false.
49 real :: halocline_filter_length
52 real :: halocline_strat_tol
55 real,
allocatable,
dimension(:) :: target_density
58 real,
allocatable,
dimension(:) :: max_interface_depths
61 real,
allocatable,
dimension(:) :: max_layer_thickness
67 public init_coord_slight, set_slight_params, build_slight_column, end_coord_slight
72 subroutine init_coord_slight(CS, nk, ref_pressure, target_density, interp_CS, m_to_H)
74 integer,
intent(in) :: nk
75 real,
intent(in) :: ref_pressure
76 real,
dimension(:),
intent(in) :: target_density
78 real,
optional,
intent(in) :: m_to_h
80 real :: m_to_h_rescale
82 if (
associated(cs))
call mom_error(fatal,
"init_coord_slight: CS already associated!")
84 allocate(cs%target_density(nk+1))
86 m_to_h_rescale = 1.0 ;
if (
present(m_to_h)) m_to_h_rescale = m_to_h
89 cs%ref_pressure = ref_pressure
90 cs%target_density(:) = target_density(:)
91 cs%interp_CS = interp_cs
94 cs%compressibility_fraction = 0.
95 cs%Rho_ML_avg_depth = 1.0 * m_to_h_rescale
96 cs%nlay_ml_offset = 2.0
97 cs%dz_ml_min = 1.0 * m_to_h_rescale
98 cs%halocline_filter_length = 2.0 * m_to_h_rescale
99 cs%halocline_strat_tol = 0.25
101 end subroutine init_coord_slight
104 subroutine end_coord_slight(CS)
108 if (.not.
associated(cs))
return
109 deallocate(cs%target_density)
111 end subroutine end_coord_slight
114 subroutine set_slight_params(CS, max_interface_depths, max_layer_thickness, &
115 min_thickness, compressibility_fraction, dz_ml_min, &
116 nz_fixed_surface, Rho_ML_avg_depth, nlay_ML_offset, fix_haloclines, &
117 halocline_filter_length, halocline_strat_tol, interp_CS)
119 real,
dimension(:), &
120 optional,
intent(in) :: max_interface_depths
121 real,
dimension(:), &
122 optional,
intent(in) :: max_layer_thickness
123 real,
optional,
intent(in) :: min_thickness
125 real,
optional,
intent(in) :: compressibility_fraction
128 real,
optional,
intent(in) :: dz_ml_min
130 integer,
optional,
intent(in) :: nz_fixed_surface
132 real,
optional,
intent(in) :: rho_ml_avg_depth
134 real,
optional,
intent(in) :: nlay_ml_offset
136 logical,
optional,
intent(in) :: fix_haloclines
138 real,
optional,
intent(in) :: halocline_filter_length
140 real,
optional,
intent(in) :: halocline_strat_tol
143 optional,
intent(in) :: interp_cs
145 if (.not.
associated(cs))
call mom_error(fatal,
"set_slight_params: CS not associated")
147 if (
present(max_interface_depths))
then
148 if (
size(max_interface_depths) /= cs%nk+1) &
149 call mom_error(fatal,
"set_slight_params: max_interface_depths inconsistent size")
150 allocate(cs%max_interface_depths(cs%nk+1))
151 cs%max_interface_depths(:) = max_interface_depths(:)
154 if (
present(max_layer_thickness))
then
155 if (
size(max_layer_thickness) /= cs%nk) &
156 call mom_error(fatal,
"set_slight_params: max_layer_thickness inconsistent size")
157 allocate(cs%max_layer_thickness(cs%nk))
158 cs%max_layer_thickness(:) = max_layer_thickness(:)
161 if (
present(min_thickness)) cs%min_thickness = min_thickness
162 if (
present(compressibility_fraction)) cs%compressibility_fraction = compressibility_fraction
164 if (
present(dz_ml_min)) cs%dz_ml_min = dz_ml_min
165 if (
present(nz_fixed_surface)) cs%nz_fixed_surface = nz_fixed_surface
166 if (
present(rho_ml_avg_depth)) cs%Rho_ML_avg_depth = rho_ml_avg_depth
167 if (
present(nlay_ml_offset)) cs%nlay_ML_offset = nlay_ml_offset
168 if (
present(fix_haloclines)) cs%fix_haloclines = fix_haloclines
169 if (
present(halocline_filter_length)) cs%halocline_filter_length = halocline_filter_length
170 if (
present(halocline_strat_tol))
then
171 if (halocline_strat_tol > 1.0)
call mom_error(fatal,
"set_slight_params: "//&
172 "HALOCLINE_STRAT_TOL must not exceed 1.0.")
173 cs%halocline_strat_tol = halocline_strat_tol
176 if (
present(interp_cs)) cs%interp_CS = interp_cs
177 end subroutine set_slight_params
180 subroutine build_slight_column(CS, eqn_of_state, H_to_Pa, H_subroundoff, &
181 nz, depth, h_col, T_col, S_col, p_col, z_col, z_col_new, &
182 h_neglect, h_neglect_edge)
184 type(
eos_type),
pointer :: eqn_of_state
185 real,
intent(in) :: h_to_pa
186 real,
intent(in) :: h_subroundoff
187 integer,
intent(in) :: nz
188 real,
intent(in) :: depth
189 real,
dimension(nz),
intent(in) :: t_col
190 real,
dimension(nz),
intent(in) :: s_col
191 real,
dimension(nz),
intent(in) :: h_col
192 real,
dimension(nz),
intent(in) :: p_col
193 real,
dimension(nz+1),
intent(in) :: z_col
194 real,
dimension(nz+1),
intent(inout) :: z_col_new
195 real,
optional,
intent(in) :: h_neglect
197 real,
optional,
intent(in) :: h_neglect_edge
200 real,
dimension(nz) :: rho_col
201 real,
dimension(nz) :: t_f, s_f
202 logical,
dimension(nz+1) :: reliable
203 real,
dimension(nz+1) :: t_int, s_int
204 real,
dimension(nz+1) :: rho_tmp, drho_dp, p_is, p_r
205 real,
dimension(nz+1) :: drhois_dt, drhois_ds
206 real,
dimension(nz+1) :: drhor_dt, drhor_ds
207 real,
dimension(nz+1) :: strat_rat
209 real :: dris, drr, fn_now, i_hstol, fn_zero_val
225 logical :: maximum_depths_set
226 logical :: maximum_h_set
227 real :: k2_used, k2here, dz_sum, z_max
229 real :: h_tr, b_denom_1, b1, d1
230 real,
dimension(nz) :: c1
231 integer :: kur1, kur2
233 integer :: i, j, k, nkml
235 maximum_depths_set =
allocated(cs%max_interface_depths)
236 maximum_h_set =
allocated(cs%max_layer_thickness)
238 if (z_col(nz+1) - z_col(1) < nz*cs%min_thickness)
then
240 dz = (z_col(nz+1) - z_col(1)) / real(nz)
241 do k=2,nz ; z_col_new(k) = z_col(1) + dz*real(k-1) ;
enddo
248 call rho_interfaces_col(rho_col, h_col, z_col, cs%target_density, nz, &
249 z_col_new, cs, reliable, debug=.true., &
250 h_neglect=h_neglect, h_neglect_edge=h_neglect_edge)
253 if (cs%min_thickness > 0.0)
then
255 do k=2,nz ;
if (z_col_new(k) < z_col_new(k-1) + cs%min_thickness)
then
256 z_col_new(k) = z_col_new(k-1) + cs%min_thickness
259 do k=nz,2,-1 ;
if (z_col_new(k) > z_col_new(k+1) - cs%min_thickness)
then
260 z_col_new(k) = z_col_new(k+1) - cs%min_thickness
271 do k=kur_ss,nz ;
if (.not.reliable(k))
then
277 do k=kur1+1,nz+1 ;
if (reliable(k))
then
278 kur2 = k-1 ; kur_ss = k ;
exit
280 if (kur2 < kur1)
call mom_error(fatal,
"Bad unreliable range.")
282 dz_ur = z_col_new(kur2+1) - z_col_new(kur1-1)
286 wgt = 1.0 ; cowgt = 0.0
288 z_col_new(k) = cowgt*z_col_new(k) + &
289 wgt * (z_col_new(kur1-1) + dz_ur*(k - (kur1-1)) / ((kur2 - kur1) + 2))
295 z_wt = 0.0 ; rho_x_z = 0.0
296 h_ml_av = cs%Rho_ml_avg_depth
298 if (z_wt + h_col(k) >= h_ml_av)
then
299 rho_x_z = rho_x_z + rho_col(k) * (h_ml_av - z_wt)
303 rho_x_z = rho_x_z + rho_col(k) * h_col(k)
304 z_wt = z_wt + h_col(k)
307 if (z_wt > 0.0) rho_ml_av = rho_x_z / z_wt
309 nkml = cs%nz_fixed_surface
311 if (rho_ml_av <= cs%target_density(nkml))
then
312 k_interior = cs%nlay_ml_offset + real(nkml)
313 elseif (rho_ml_av > cs%target_density(nz+1))
then
314 k_interior = real(nz+1)
316 if ((rho_ml_av >= cs%target_density(k)) .and. &
317 (rho_ml_av < cs%target_density(k+1)))
then
318 k_interior = (cs%nlay_ml_offset + k) + &
319 (rho_ml_av - cs%target_density(k)) / &
320 (cs%target_density(k+1) - cs%target_density(k))
324 if (k_interior > real(nz+1)) k_interior = real(nz+1)
327 k = int(ceiling(k_interior))
328 z_interior = (k-k_interior)*z_col_new(k-1) + (1.0+(k_interior-k))*z_col_new(k)
330 if (cs%fix_haloclines)
then
336 if (cs%halocline_filter_length > 0.0)
then
337 lfilt = cs%halocline_filter_length
340 h_tr = h_col(1) + h_subroundoff
341 b1 = 1.0 / (h_tr + lfilt) ; d1 = h_tr * b1
342 t_f(1) = (b1*h_tr)*t_col(1) ; s_f(1) = (b1*h_tr)*s_col(1)
345 h_tr = h_col(k) + h_subroundoff ; b_denom_1 = h_tr + d1*lfilt
346 b1 = 1.0 / (b_denom_1 + lfilt) ; d1 = b_denom_1 * b1
347 t_f(k) = b1 * (h_tr*t_col(k) + lfilt*t_f(k-1))
348 s_f(k) = b1 * (h_tr*s_col(k) + lfilt*s_f(k-1))
351 t_f(k) = t_f(k) + c1(k+1)*t_f(k+1) ; s_f(k) = s_f(k) + c1(k+1)*s_f(k+1)
354 do k=1,nz ; t_f(k) = t_col(k) ; s_f(k) = s_col(k) ;
enddo
357 t_int(1) = t_f(1) ; s_int(1) = s_f(1)
359 t_int(k) = 0.5*(t_f(k-1) + t_f(k)) ; s_int(k) = 0.5*(s_f(k-1) + s_f(k))
360 p_is(k) = z_col(k) * h_to_pa
361 p_r(k) = cs%ref_pressure + cs%compressibility_fraction * ( p_is(k) - cs%ref_pressure )
363 t_int(nz+1) = t_f(nz) ; s_int(nz+1) = s_f(nz)
364 p_is(nz+1) = z_col(nz+1) * h_to_pa
369 if (cs%compressibility_fraction > 0.0)
then
370 call calculate_compress(t_int, s_int, p_r, rho_tmp, drho_dp, 2, nz-1, &
373 do k=2,nz ; drho_dp(k) = 0.0 ;
enddo
376 h_to_cpa = cs%compressibility_fraction*h_to_pa
379 dris = drhois_dt(k) * (t_f(k) - t_f(k-1)) + &
380 drhois_ds(k) * (s_f(k) - s_f(k-1))
381 drr = (drhor_dt(k) * (t_f(k) - t_f(k-1)) + &
382 drhor_ds(k) * (s_f(k) - s_f(k-1))) + &
383 drho_dp(k) * (h_to_cpa*0.5*(h_col(k) + h_col(k-1)))
385 if (dris <= 0.0)
then
388 strat_rat(k) = 2.0*max(drr,0.0) / (dris + abs(drr))
391 strat_rat(nz+1) = 1.0
393 z_int_unst = 0.0 ; fn_now = 0.0
394 fn_zero_val = min(2.0*cs%halocline_strat_tol, &
395 0.5*(1.0 + cs%halocline_strat_tol))
396 if (cs%halocline_strat_tol > 0.0)
then
398 i_hstol = 0.0 ;
if (fn_zero_val - cs%halocline_strat_tol > 0.0) &
399 i_hstol = 1.0 / (fn_zero_val - cs%halocline_strat_tol)
400 do k=nz,1,-1 ;
if (cs%ref_pressure > p_is(k+1))
then
401 z_int_unst = z_int_unst + fn_now * h_col(k)
402 if (strat_rat(k) <= fn_zero_val)
then
403 if (strat_rat(k) <= cs%halocline_strat_tol)
then ; fn_now = 1.0
405 fn_now = max(fn_now, (fn_zero_val - strat_rat(k)) * i_hstol)
410 do k=nz,1,-1 ;
if (cs%ref_pressure > p_is(k+1))
then
411 z_int_unst = z_int_unst + fn_now * h_col(k)
412 if (strat_rat(k) <= cs%halocline_strat_tol) fn_now = 1.0
416 if (z_interior < z_int_unst)
then
418 kur1 = max(int(ceiling(k_interior)),2)
419 if (z_col_new(kur1-1) < z_interior)
then
421 do k = kur1,nz+1 ;
if (z_col_new(k) >= z_int_unst)
then
423 if (z_col_new(k-1) >= z_int_unst) &
424 call mom_error(fatal,
"build_grid_SLight, bad halocline structure.")
425 k_int2 = real(k-1) + (z_int_unst - z_col_new(k-1)) / &
426 (z_col_new(k) - z_col_new(k-1))
429 if (z_col_new(nz+1) < z_int_unst)
then
431 z_int_unst = z_col_new(nz+1) ; k_int2 = real(nz+1)
435 if (k_int2 > k_interior)
then
436 k_interior = k_int2 ; z_interior = z_int_unst
444 z_col_new(k) = min((k-1)*cs%dz_ml_min, &
445 z_col_new(nz+1) - cs%min_thickness*(nz+1-k))
447 z_ml_fix = z_col_new(nkml+1)
448 if (z_interior > z_ml_fix)
then
449 dz_dk = (z_interior - z_ml_fix) / (k_interior - (nkml+1))
450 do k=nkml+2,int(floor(k_interior))
451 z_col_new(k) = z_ml_fix + dz_dk * (k - (nkml+1))
455 if (z_col_new(k) <= z_col_new(cs%nz_fixed_surface+1))
then
456 z_col_new(k) = z_col_new(cs%nz_fixed_surface+1)
461 if (maximum_depths_set .and. maximum_h_set)
then ;
do k=2,nz
464 z_col_new(k) = min(z_col_new(k), cs%max_interface_depths(k), &
465 z_col_new(k-1) + cs%max_layer_thickness(k-1))
466 enddo ;
elseif (maximum_depths_set)
then ;
do k=2,nz
467 z_col_new(k) = min(z_col_new(k), cs%max_interface_depths(k))
468 enddo ;
elseif (maximum_h_set)
then ;
do k=2,nz
469 z_col_new(k) = min(z_col_new(k), z_col_new(k-1) + cs%max_layer_thickness(k-1))
474 end subroutine build_slight_column
478 subroutine rho_interfaces_col(rho_col, h_col, z_col, rho_tgt, nz, z_col_new, &
479 CS, reliable, debug, h_neglect, h_neglect_edge)
480 integer,
intent(in) :: nz
481 real,
dimension(nz),
intent(in) :: rho_col
482 real,
dimension(nz),
intent(in) :: h_col
483 real,
dimension(nz+1),
intent(in) :: z_col
484 real,
dimension(nz+1),
intent(in) :: rho_tgt
485 real,
dimension(nz+1),
intent(inout) :: z_col_new
487 logical,
dimension(nz+1),
intent(inout) :: reliable
489 logical,
optional,
intent(in) :: debug
490 real,
optional,
intent(in) :: h_neglect
493 real,
optional,
intent(in) :: h_neglect_edge
497 real,
dimension(nz+1) :: ru_max_int
498 real,
dimension(nz+1) :: ru_min_int
499 real,
dimension(nz) :: ru_max_lay
500 real,
dimension(nz) :: ru_min_lay
501 real,
dimension(nz,2) :: ppoly_i_E
502 real,
dimension(nz,2) :: ppoly_i_S
503 real,
dimension(nz,DEGREE_MAX+1) :: ppoly_i_coefficients
504 logical,
dimension(nz) :: unstable_lay
505 logical,
dimension(nz+1) :: unstable_int
510 real :: zf1, zf2, rfn1, rfn2
511 real :: drfn_dzf, sgn, delta_zf, zf_prev
515 integer :: ppoly_degree
516 integer :: k, k1, k1_min, itt, max_itt, m
521 debugging = .false. ;
if (
present(debug)) debugging = debug
522 max_itt = nr_iterations
525 z_sgn = 1.0 ;
if ( z_col(1) > z_col(nz+1) ) z_sgn = -1.0
528 if (abs((z_col(k+1) - z_col(k)) - z_sgn*h_col(k)) > &
529 1.0e-14*(abs(z_col(k+1)) + abs(z_col(k)) + abs(h_col(k))) ) &
530 call mom_error(fatal,
"rho_interfaces_col: Inconsistent z_col and h_col")
534 if ( z_col(1) == z_col(nz+1) )
then
536 do k=1,nz+1 ; z_col_new(k) = z_col(1) ; reliable(k) = .true. ;
enddo
541 call regridding_set_ppolys(cs%interp_CS, rho_col, nz, h_col, ppoly_i_e, ppoly_i_s, &
542 ppoly_i_coefficients, ppoly_degree, h_neglect, h_neglect_edge)
548 unstable_int(1) = .false.
549 ru_max_int(1) = ppoly_i_e(1,1)
551 unstable_lay(1) = (ppoly_i_e(1,1) > ppoly_i_e(1,2))
552 ru_max_lay(1) = max(ppoly_i_e(1,1), ppoly_i_e(1,2))
555 unstable_int(k) = (ppoly_i_e(k-1,2) > ppoly_i_e(k,1))
556 ru_max_int(k) = max(ppoly_i_e(k-1,2), ppoly_i_e(k,1))
557 ru_min_int(k) = min(ppoly_i_e(k-1,2), ppoly_i_e(k,1))
558 if (unstable_int(k) .and. unstable_lay(k-1)) &
559 ru_max_int(k) = max(ru_max_lay(k-1), ru_max_int(k))
561 unstable_lay(k) = (ppoly_i_e(k,1) > ppoly_i_e(k,2))
562 ru_max_lay(k) = max(ppoly_i_e(k,1), ppoly_i_e(k,2))
563 ru_min_lay(k) = min(ppoly_i_e(k,1), ppoly_i_e(k,2))
564 if (unstable_lay(k) .and. unstable_int(k)) &
565 ru_max_lay(k) = max(ru_max_int(k), ru_max_lay(k))
567 unstable_int(nz+1) = .false.
568 ru_min_int(nz+1) = ppoly_i_e(nz,2)
571 if (unstable_lay(k) .and. unstable_int(k+1)) &
572 ru_min_lay(k) = min(ru_min_int(k+1), ru_min_lay(k))
574 if (unstable_int(k) .and. unstable_lay(k)) &
575 ru_min_int(k) = min(ru_min_lay(k), ru_min_int(k))
578 z_col_new(1) = z_col(1) ; reliable(1) = .true.
586 if (rt <= ppoly_i_e(k1_min,1))
then
587 z_col_new(k) = z_col(k1_min)
590 elseif (k1_min == nz+1)
then
591 z_col_new(k) = z_col(nz+1)
594 if (unstable_int(k) .and. (rt >= ru_min_int(k)) .and. (rt <= ru_max_int(k)))
then
596 z_col_new(k) = z_col(k) ; reliable(k) = .false.
597 k1_min = k ; k_found = .true.
598 elseif ((rt >= ppoly_i_e(k-1,2)) .and. (rt <= ppoly_i_e(k,1)))
then
600 z_col_new(k) = z_col(k) ; reliable(k) = .true.
601 k1_min = k ; k_found = .true.
602 elseif (rt < ppoly_i_e(k-1,2))
then
605 if ((rt < ppoly_i_e(k1,2)) .and. (rt > ppoly_i_e(k1,1)))
then
608 k1_min = k1 ; k_found = .true. ;
exit
609 elseif (unstable_lay(k1) .and. (rt >= ru_min_lay(k1)) .and. (rt <= ru_max_lay(k1)))
then
612 z_col_new(k) = z_col(k1+1) ; reliable(k) = .false.
613 k1_min = k1 ; k_found = .true. ;
exit
616 if (k1 > 1)
then ;
if ((rt <= ppoly_i_e(k1,1)) .and. (rt >= ppoly_i_e(k1-1,2)))
then
618 z_col_new(k) = z_col(k1) ; reliable(k) = .true.
619 k1_min = k1 ; k_found = .true. ;
exit
620 elseif (unstable_int(k1) .and. (rt >= ru_min_int(k1)) .and. (rt <= ru_max_int(k1)))
then
623 z_col_new(k) = z_col(k1) ; reliable(k) = .false.
624 k1_min = k1 ; k_found = .true. ;
exit
628 if (.not.k_found)
then
631 z_col_new(k) = z_col(k1_min)
633 z_col_new(k) = z_col(k1_min)
639 if ((rt < ppoly_i_e(k1,2)) .and. (rt > ppoly_i_e(k1,1)))
then
642 k1_min = k1 ; k_found = .true. ;
exit
643 elseif (unstable_lay(k1) .and. (rt >= ru_min_lay(k1)) .and. (rt <= ru_max_lay(k1)))
then
646 z_col_new(k) = z_col(k1)
647 reliable(k) = .false.
648 k1_min = k1 ; k_found = .true. ;
exit
650 if (k1 < nz)
then ;
if ((rt <= ppoly_i_e(k1+1,1)) .and. (rt >= ppoly_i_e(k1,2)))
then
653 z_col_new(k) = z_col(k1+1) ; reliable(k) = .true.
654 k1_min = k1+1 ; k_found = .true. ;
exit
655 elseif (unstable_int(k1+1) .and. (rt >= ru_min_int(k1+1)) .and. (rt <= ru_max_int(k1+1)))
then
658 z_col_new(k) = z_col(k1+1)
659 reliable(k) = .false.
660 k1_min = k1+1 ; k_found = .true. ;
exit
663 if (.not.k_found)
then
664 z_col_new(k) = z_col(nz+1)
665 if (rt >= ppoly_i_e(nz,2))
then
668 reliable(k) = .false.
673 if (k_layer > 0)
then
675 if (.not.(ppoly_i_e(k1,2) > ppoly_i_e(k1,1)))
call mom_error(fatal, &
676 "build_grid_SLight: Erroneously searching for an interface in an unstratified layer.")
679 zf = (rt - ppoly_i_e(k1,1)) / (ppoly_i_e(k1,2) - ppoly_i_e(k1,1))
681 if (ppoly_degree > 1)
then
682 a(:) = 0.0 ; a(1) = ppoly_i_coefficients(k_layer,1) - rt
683 do m=2,ppoly_degree+1 ; a(m) = ppoly_i_coefficients(k_layer,m) ;
enddo
685 zf1 = 0.0 ; rfn1 = a(1)
686 zf2 = 1.0 ; rfn2 = a(1) + (a(2) + (a(3) + (a(4) + a(5))))
687 if (rfn1 * rfn2 > 0.0)
call mom_error(fatal,
"build_grid_SLight: Bad bracketing.")
690 rfn = a(1) + zf*(a(2) + zf*(a(3) + zf*(a(4) + zf*a(5))))
692 if (rfn * rfn1 > 0.0)
then
693 zf1 = zf ; rfn1 = rfn
695 zf2 = zf ; rfn2 = rfn
697 if (rfn1 == rfn2)
exit
699 drfn_dzf = (a(2) + zf*(2.0*a(3) + zf*(3.0*a(4) + zf*4.0*a(5))))
700 sgn = 1.0 ;
if (drfn_dzf < 0.0) sgn = -1.0
702 if ((sgn*(zf - rfn) >= zf1 * abs(drfn_dzf)) .and. &
703 (sgn*(zf - rfn) <= zf2 * abs(drfn_dzf)))
then
704 delta_zf = -rfn / drfn_dzf
708 zf = ( rfn2 * zf1 - rfn1 * zf2 ) / (rfn2 - rfn1)
709 delta_zf = zf - zf_prev
712 if (abs(delta_zf) < tol)
exit
715 z_col_new(k) = z_col(k_layer) + zf * z_sgn * h_col(k_layer)
722 z_col_new(nz+1) = z_col(nz+1) ; reliable(nz+1) = .true.
724 end subroutine rho_interfaces_col