Skip to content

Commit

Permalink
some minor edits to budgets. Added SST as nml parameter in the driver
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-huth committed Apr 9, 2021
1 parent 1003d75 commit 81f5b84
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
15 changes: 8 additions & 7 deletions driver/icebergs_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,14 @@ program icebergs_driver
real :: ibui=0.0
real :: ibvi=0.0
real :: gridres=1.e3
real :: bump_deptht=0
real :: bump_depth=0
real :: sst=-2
integer :: ibhrs=2
integer :: nmax = 2000000000 !<max number of iteration
integer :: write_time_inc=1
namelist /icebergs_driver_nml/ debug, ni, nj, halo, ibhrs, ibdt, ibuo, ibvo, nmax, &
saverestart,ibui,ibvi,collision_test,chaotic_test,grounding_test,&
gridres,write_time_inc,bump_depth
gridres,write_time_inc,bump_depth, sst
! For loops
integer :: isc !< Start of i-index for computational domain (used for loops)
integer :: iec !< End of i-index for computational domain (used for loops)
Expand Down Expand Up @@ -104,7 +105,7 @@ program icebergs_driver
real, dimension(:,:), allocatable :: ui,vi !<zonal and meridonal ice velocities (m/s)
real, dimension(:,:), allocatable :: tauxa,tauya !< Zonal and meridonal wind stress (Pa)
real, dimension(:,:), allocatable :: ssh !< Effective sea-surface height (m)
real, dimension(:,:), allocatable :: sst !< Sea-surface temperature (C or K)
real, dimension(:,:), allocatable :: sstemp !< Sea-surface temperature (C or K)
real, dimension(:,:), allocatable :: cn !< Sea-ice concentration (nondim)
real, dimension(:,:), allocatable :: hi !< Sea-ice thickness (m)
real, dimension(:,:), allocatable :: calving_hflx !< Calving heat flux (W/m2)
Expand Down Expand Up @@ -244,7 +245,7 @@ program icebergs_driver
allocate( tauxa(isd:ied,jsd:jed) )
allocate( tauya(isd:ied,jsd:jed) )
allocate( ssh(isd:ied,jsd:jed) )
allocate( sst(isd:ied,jsd:jed) )
allocate( sstemp(isd:ied,jsd:jed) )
allocate( cn(isd:ied,jsd:jed) )
allocate( hi(isd:ied,jsd:jed) )
allocate( calving_hflx(isd:ied,jsd:jed) )
Expand All @@ -257,7 +258,7 @@ program icebergs_driver
tauxa = 0.0 !zonal wind stress (Pa)
tauya = 0.0 !meridonal wind stress (Pa)
ssh = 0.0 !eff sea-surf height
sst = -2.0 !sea surface temperature (C or K; if K, will automatically adjust to C)
sstemp = sst !sea surface temperature (C or K; if K, will automatically adjust to C)
cn = 0.0 !sea-ice concentration (nondim)
hi = 0.0 !sea-ice thickness (m)
calving_hflx = 0.0 !calving heat flux (W/m2)
Expand Down Expand Up @@ -344,12 +345,12 @@ program icebergs_driver
uo(isc-1:iec+1,jsc-1:jec+1), vo(isc-1:iec+1,jsc-1:jec+1), &
ui(isc-1:iec+1,jsc-1:jec+1), vi(isc-1:iec+1,jsc-1:jec+1), &
tauxa(isc:iec,jsc:jec), tauya(isc:iec,jsc:jec), &
ssh(isc-1:iec+1,jsc-1:jec+1), sst(isc:iec,jsc:jec), &
ssh(isc-1:iec+1,jsc-1:jec+1), sstemp(isc:iec,jsc:jec), &
calving_hflx(isc:iec,jsc:jec), &
cn(isc-1:iec+1,jsc-1:jec+1), hi(isc-1:iec+1,jsc-1:jec+1))

! full form, with optional vars:
! call icebergs_run(bergs, time, calving, uo, vo, ui, vi, tauxa, tauya, ssh, sst, &
! call icebergs_run(bergs, time, calving, uo, vo, ui, vi, tauxa, tauya, ssh, sstemp, &
! calving_hflx, cn, hi,stagger, stress_stagger, sss, mass_berg, ustar_berg, area_berg)

Time = Time + real_to_time_type(dt)
Expand Down
4 changes: 2 additions & 2 deletions src/icebergs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2906,7 +2906,7 @@ subroutine thermodynamics(bergs)

! Add melting to the grid and field diagnostics
if (grd%area(i,j).ne.0.) then
melt=(dM-(dMbitsE-dMbitsM))/bergs%dt ! kg/s
melt=(dM+dMfl-(dMbitsE-dMbitsM))/bergs%dt ! kg/s
grd%floating_melt(i,j)=grd%floating_melt(i,j)+melt/grd%area(i,j)*this%mass_scaling ! kg/m2/s
melt=melt*this%heat_density ! kg/s x J/kg = J/s
grd%calving_hflx(i,j)=grd%calving_hflx(i,j)+melt/grd%area(i,j)*this%mass_scaling ! W/m2
Expand Down Expand Up @@ -5381,7 +5381,7 @@ subroutine icebergs_run(bergs, time, calving, uo, vo, ui, vi, tauxa, tauya, ssh,
'bergs',bergs%net_melt, &
'stored mass',bergs%floating_mass_start,bergs%floating_mass_end)
call report_budget('berg mass','kg','calving',bergs%net_calving_to_bergs, &
'melt+eros',bergs%berg_melt, &
'melt+eros+fl',bergs%berg_melt+bergs%fl_bits_src, &
'berg mass',bergs%icebergs_mass_start,bergs%icebergs_mass_end)
call report_budget('bits mass','kg','eros used',bergs%bergy_src, &
'bergs',bergs%bergy_melt, &
Expand Down
7 changes: 4 additions & 3 deletions tests/footloose_no_bond_test/input.nml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
halo=3
debug=.false.
gridres=1000.
sst=-2
collision_test=.false. !specific to the current test, must be true here
/

Expand All @@ -29,7 +30,7 @@

fl_r=4 !(4) average number of footloose bergs to calve per fl_r_s seconds
fl_r_s=86400 !(86400) time in s over which to calve, on average, fl_r footloose bergs
displace_fl_bergs=.true. !(T) randomly assign FL berg positions to sides of parent berg
displace_fl_bergs=.false. !(T) randomly assign FL berg positions to sides of parent berg
fl_style='fl_bits' !('new_bergs'). Can also group FL bergs into 'fl_bits'
fl_melt_as_bergy_bits=.false.!true. !(F) If fl_style==fl_bits, melt the fl_bits as bergy bits

Expand Down Expand Up @@ -64,7 +65,7 @@
const_gamma=.false. ! (T) 'T' = constant heat transfer coeff, used to calc salt transfer
use_operator_splitting=.true. ! (T) Use 1st order operator splitting for thermodynamics
add_weight_to_ocean=.false. ! (T) Add weight of icebergs + bits to ocean
passive_mode=.false. ! (F) Add weight of icebergs + bits to ocean
passive_mode=.true. ! (F) Add weight of icebergs + bits to ocean
time_average_weight=.false. ! (F) Time average the weight on the ocean
speed_limit=0. ! (0.) CFL speed limit for a berg
tau_calving=0. ! (0.) Time scale (yrs) for smoothing out calving field
Expand Down Expand Up @@ -93,7 +94,7 @@
set_melt_rates_to_zero=.true.!(F)For testing, thermodyn is run, but all melt rates=0

iceberg_bonds_on=.true. ! (F) True=Allow icebergs to have bonds, False=don't allow.
interactive_icebergs_on=.true.!.false. ! (F) Turn on/off interactions between icebergs
interactive_icebergs_on=.false.!.true.!.false. ! (F) Turn on/off interactions between icebergs
only_interactive_forces=.false. !(F)Bergs only feel interactive forces, not ocean, wind...
use_new_predictive_corrective =.true. ! (F) Flag to use Bob's pred-corr berg scheme
input_freq_distribution=.false. !(F)input dist is: 'T' freq dist or 'F' mass dist
Expand Down

0 comments on commit 81f5b84

Please sign in to comment.