Skip to content

Commit

Permalink
Removed last vestiges of %iceberg_num
Browse files Browse the repository at this point in the history
- iceberg_num now only appears when reading an old restart with the
  32-bit reperesentation of iceberg_num.
  • Loading branch information
adcroft committed Jun 18, 2017
1 parent be47643 commit f7988fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
1 change: 0 additions & 1 deletion icebergs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -4043,7 +4043,6 @@ subroutine calve_icebergs(bergs)
newberg%start_lon=newberg%lon
newberg%start_lat=newberg%lat
newberg%start_year=bergs%current_year
newberg%iceberg_num=((iNg*jNg)*grd%iceberg_counter_grd(i,j))+(i+(iNg*(j-1))) ! unique number for each iceberg
newberg%id = generate_id(grd, i, j)
newberg%start_day=bergs%current_yearday+ddt/86400.
newberg%start_mass=bergs%initial_mass(k)
Expand Down
14 changes: 5 additions & 9 deletions icebergs_framework.F90
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module ice_bergs_framework

implicit none ; private

integer :: buffer_width=29 ! This should be a parameter
integer :: buffer_width=28 ! This should be a parameter
integer :: buffer_width_traj=32 ! This should be a parameter
integer, parameter :: nclasses=10 ! Number of ice bergs classes

Expand Down Expand Up @@ -251,7 +251,6 @@ module ice_bergs_framework
real :: halo_berg ! Equal to zero for bergs on computational domain, and =1 for bergs on the halo
real :: static_berg ! Equal to 1 for icebergs which are static (not allowed to move). Might be extended to grounding later.
integer :: start_year !< Year that berg was created (years)
integer :: iceberg_num !< Iceberg identifier
integer(kind=8) :: id !< Iceberg identifier
integer :: ine !< Nearest i-index in NE direction (for convenience)
integer :: jne !< Nearest j-index in NE direction (for convenience)
Expand Down Expand Up @@ -1845,7 +1844,6 @@ subroutine pack_berg_into_buffer2(berg, buff, n, max_bonds_in)
call push_buffer_value(buff%data(:,n), counter, berg%ayn)
call push_buffer_value(buff%data(:,n), counter, berg%bxn)
call push_buffer_value(buff%data(:,n), counter, berg%byn)
call push_buffer_value(buff%data(:,n), counter, berg%iceberg_num)
call push_buffer_value(buff%data(:,n), counter, berg%halo_berg)
call push_buffer_value(buff%data(:,n), counter, berg%static_berg)
call split_id(berg%id, id_cnt, id_ij)
Expand Down Expand Up @@ -1976,7 +1974,7 @@ subroutine unpack_berg_from_buffer2(bergs, buff, n, grd, force_append, max_bonds
logical :: lres
type(iceberg) :: localberg
type(iceberg), pointer :: this
integer :: other_berg_num, other_berg_ine, other_berg_jne
integer :: other_berg_ine, other_berg_jne
integer :: counter, k, max_bonds, id_cnt, id_ij
integer(kind=8) :: id
integer :: stderrunit
Expand Down Expand Up @@ -2018,7 +2016,6 @@ subroutine unpack_berg_from_buffer2(bergs, buff, n, grd, force_append, max_bonds
call pull_buffer_value(buff%data(:,n), counter, localberg%ayn)
call pull_buffer_value(buff%data(:,n), counter, localberg%bxn)
call pull_buffer_value(buff%data(:,n), counter, localberg%byn)
call pull_buffer_value(buff%data(:,n), counter, localberg%iceberg_num)
call pull_buffer_value(buff%data(:,n), counter, localberg%halo_berg)
call pull_buffer_value(buff%data(:,n), counter, localberg%static_berg)
call pull_buffer_value(buff%data(:,n), counter, id_cnt)
Expand Down Expand Up @@ -4499,7 +4496,7 @@ integer function berg_chksum(berg)
type(iceberg), pointer :: berg !< An iceberg
! Local variables
real :: rtmp(36)
integer :: itmp(36+8), i8=0, ichk1, ichk2, ichk3
integer :: itmp(36+7), i8=0, ichk1, ichk2, ichk3
integer :: i

rtmp(:)=0.
Expand Down Expand Up @@ -4544,11 +4541,10 @@ integer function berg_chksum(berg)
itmp(39)=berg%start_year
itmp(40)=berg%ine
itmp(41)=berg%jne
itmp(42)=berg%iceberg_num
call split_id( berg%id, itmp(43), itmp(44) )
call split_id( berg%id, itmp(42), itmp(43) )

ichk1=0; ichk2=0; ichk3=0
do i=1,36+8
do i=1,36+7
ichk1=ichk1+itmp(i)
ichk2=ichk2+itmp(i)*i
ichk3=ichk3+itmp(i)*i*i
Expand Down

0 comments on commit f7988fe

Please sign in to comment.