From df4e43a3120e38c3d60ba49e8400f0265a3af0eb Mon Sep 17 00:00:00 2001 From: Alistair Adcroft Date: Sat, 17 Jun 2017 19:23:17 -0400 Subject: [PATCH] Add id to write_restart() - Add id (as id_cnt,id_ij) to restart files (not yet used when reading). --- icebergs_io.F90 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/icebergs_io.F90 b/icebergs_io.F90 index 3370702..1ea8a7d 100644 --- a/icebergs_io.F90 +++ b/icebergs_io.F90 @@ -142,6 +142,8 @@ subroutine write_restart(bergs) integer, allocatable, dimension(:) :: ine, & jne, & iceberg_num, & + id_cnt, & + id_ij, & start_year, & first_id_cnt, & other_id_cnt, & @@ -197,6 +199,8 @@ subroutine write_restart(bergs) allocate(jne(nbergs)) allocate(start_year(nbergs)) allocate(iceberg_num(nbergs)) + allocate(id_cnt(nbergs)) + allocate(id_ij(nbergs)) call get_instance_filename("icebergs.res.nc", filename) @@ -233,6 +237,10 @@ subroutine write_restart(bergs) longname='calendar year of calving event', units='years') id = register_restart_field(bergs_restart,filename,'iceberg_num',iceberg_num, & longname='identification of the iceberg', units='dimensionless') + id = register_restart_field(bergs_restart,filename,'id_cnt',id_cnt, & + longname='counter component of iceberg id', units='dimensionless') + id = register_restart_field(bergs_restart,filename,'id_ij',id_ij, & + longname='position component of iceberg id', units='dimensionless') id = register_restart_field(bergs_restart,filename,'start_day',start_day, & longname='year day of calving event',units='days') id = register_restart_field(bergs_restart,filename,'start_mass',start_mass, & @@ -277,6 +285,7 @@ subroutine write_restart(bergs) start_mass(i) = this%start_mass; mass_scaling(i) = this%mass_scaling static_berg(i) = this%static_berg iceberg_num(i) = this%iceberg_num + call split_id(this%id, id_cnt(i), id_ij(i)) mass_of_bits(i) = this%mass_of_bits; heat_density(i) = this%heat_density this=>this%next enddo @@ -312,6 +321,8 @@ subroutine write_restart(bergs) ine, & jne, & iceberg_num, & + id_cnt, & + id_ij, & start_year ) call nullify_domain()