diff --git a/icebergs_framework.F90 b/icebergs_framework.F90 index c17afe1..e11ad07 100644 --- a/icebergs_framework.F90 +++ b/icebergs_framework.F90 @@ -266,8 +266,9 @@ subroutine ice_bergs_framework_init(bergs, & real :: speed_limit=0. ! CFL speed limit for a berg real :: grounding_fraction=0. ! Fraction of water column depth at which grounding occurs logical :: do_unit_tests=.false. ! Conduct some unit tests +logical :: input_freq_distribution=.false. ! Alon: flag to show if input distribution is freq or mass dist (=1 if input is a freq dist, =0 to use an input mass dist) real, dimension(nclasses) :: initial_mass=(/8.8e7, 4.1e8, 3.3e9, 1.8e10, 3.8e10, 7.5e10, 1.2e11, 2.2e11, 3.9e11, 7.4e11/) ! Mass thresholds between iceberg classes (kg) -real, dimension(nclasses) :: distribution=(/0.24, 0.12, 0.15, 0.18, 0.12, 0.07, 0.03, 0.03, 0.03, 0.02/) ! Fraction of calving to apply to this class (non-dim) +real, dimension(nclasses) :: distribution=(/0.24, 0.12, 0.15, 0.18, 0.12, 0.07, 0.03, 0.03, 0.03, 0.02/) ! Fraction of calving to apply to this class (non-dim) , real, dimension(nclasses) :: mass_scaling=(/2000, 200, 50, 20, 10, 5, 2, 1, 1, 1/) ! Ratio between effective and real iceberg mass (non-dim) real, dimension(nclasses) :: initial_thickness=(/40., 67., 133., 175., 250., 250., 250., 250., 250., 250./) ! Total thickness of newly calved bergs (m) namelist /icebergs_nml/ verbose, budget, halo, traj_sample_hrs, traj_write_hrs, initial_mass, & @@ -275,7 +276,7 @@ subroutine ice_bergs_framework_init(bergs, & rho_bergs, LoW_ratio, debug, really_debug, use_operator_splitting, bergy_bit_erosion_fraction, & parallel_reprod, use_slow_find, sicn_shift, add_weight_to_ocean, passive_mode, ignore_ij_restart, & time_average_weight, generate_test_icebergs, speed_limit, fix_restart_dates, use_roundoff_fix, & - old_bug_rotated_weights, make_calving_reproduce,restart_input_dir, orig_read, old_bug_bilin,do_unit_tests,grounding_fraction + old_bug_rotated_weights, make_calving_reproduce,restart_input_dir, orig_read, old_bug_bilin,do_unit_tests,grounding_fraction, input_freq_distribution ! Local variables integer :: ierr, iunit, i, j, id_class, axes3d(3), is,ie,js,je,np @@ -283,6 +284,7 @@ subroutine ice_bergs_framework_init(bergs, & real :: minl logical :: lerr integer :: stdlogunit, stderrunit +real :: Total_mass !Added by Alon ! Get the stderr and stdlog unit numbers stderrunit=stderr() @@ -493,6 +495,21 @@ subroutine ice_bergs_framework_init(bergs, & ! enddo !endif + +!Added by Alon - If a freq distribution is input, we have to convert the freq distribution to a mass flux distribution) +if (input_freq_distribution) then + Total_mass=0. + do j=1,nclasses + Total_mass=Total_mass+(distribution(j)*initial_mass(j)) + enddo + do j=1,nclasses + distribution(j)=(distribution(j)*initial_mass(j))/Total_mass + enddo +endif + + + + ! Parameters bergs%dt=dt bergs%traj_sample_hrs=traj_sample_hrs