Skip to content

Commit

Permalink
Add id to write_restart()
Browse files Browse the repository at this point in the history
- Add id (as id_cnt,id_ij) to restart files (not yet used when reading).
  • Loading branch information
adcroft committed Jun 17, 2017
1 parent 22bb2a0 commit df4e43a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions icebergs_io.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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, &
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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, &
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -312,6 +321,8 @@ subroutine write_restart(bergs)
ine, &
jne, &
iceberg_num, &
id_cnt, &
id_ij, &
start_year )

call nullify_domain()
Expand Down

0 comments on commit df4e43a

Please sign in to comment.