Skip to content

Commit

Permalink
Merge branch 'sternalon-Calving_flux_input' into dev/master
Browse files Browse the repository at this point in the history
  • Loading branch information
adcroft committed Jul 16, 2015
2 parents a3913a7 + 1558d14 commit 074a75c
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions icebergs_framework.F90
Original file line number Diff line number Diff line change
Expand Up @@ -266,23 +266,25 @@ 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, &
distribution, mass_scaling, initial_thickness, verbose_hrs, &
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
type(icebergs_gridded), pointer :: grd
real :: minl
logical :: lerr
integer :: stdlogunit, stderrunit
real :: Total_mass !Added by Alon

! Get the stderr and stdlog unit numbers
stderrunit=stderr()
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 074a75c

Please sign in to comment.