From 273ca2262cee05c76585b74125c60c03f23c3af9 Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Sat, 16 Jun 2018 21:42:10 -0500 Subject: [PATCH 1/2] Move num_dim determination futher up" --- src/2d/valout.f90 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/2d/valout.f90 b/src/2d/valout.f90 index 9769aae5a..be3c0fc62 100644 --- a/src/2d/valout.f90 +++ b/src/2d/valout.f90 @@ -78,6 +78,13 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux) ! Output timing call system_clock(clock_start,clock_rate) call cpu_time(cpu_start) + + ! Handle special case of using 2D AMR to do 1D AMR + if (num_cells(2) > 1) then + num_dim = 2 + else + num_dim = 1 + end if ! Count how many aux components requested output_aux_num = 0 @@ -351,13 +358,6 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux) ! Write fort.t file open(unit=out_unit, file=file_name(2), status='unknown', form='formatted') - ! Handle special case of using 2D AMR to do 1D AMR - if (num_cells(2) > 1) then - num_dim = 2 - else - num_dim = 1 - end if - ! Note: We need to print out num_ghost too in order to strip ghost cells ! from q array when reading in pyclaw.io.binary write(out_unit, t_file_format) time, num_eqn, num_grids, num_aux, num_dim, & From 7379a0d93171cda11030c19d16f14c3d0414e767 Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Sun, 17 Jun 2018 13:19:07 -0500 Subject: [PATCH 2/2] Remove old 1D output support all together --- src/2d/valout.f90 | 50 ++++++++++++++--------------------------------- 1 file changed, 15 insertions(+), 35 deletions(-) diff --git a/src/2d/valout.f90 b/src/2d/valout.f90 index be3c0fc62..fdeedbc81 100644 --- a/src/2d/valout.f90 +++ b/src/2d/valout.f90 @@ -27,7 +27,7 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux) ! Locals integer, parameter :: out_unit = 50 - integer :: i, j, m, level, output_aux_num, num_stop, digit, num_dim + integer :: i, j, m, level, output_aux_num, num_stop, digit integer :: grid_ptr, num_cells(2), num_grids, q_loc, aux_loc real(kind=8) :: lower_corner(2), delta(2) logical :: out_aux @@ -79,13 +79,6 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux) call system_clock(clock_start,clock_rate) call cpu_time(cpu_start) - ! Handle special case of using 2D AMR to do 1D AMR - if (num_cells(2) > 1) then - num_dim = 2 - else - num_dim = 1 - end if - ! Count how many aux components requested output_aux_num = 0 do i=1, num_aux @@ -151,19 +144,13 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux) lower_corner = [rnode(cornxlo, grid_ptr), rnode(cornylo, grid_ptr)] ! Write out header data - if (num_dim == 1) then - write(out_unit, header_format_1d) grid_ptr, level, & - num_cells(1), & - lower_corner(1), & - delta(1) - else - write(out_unit, header_format_2d) grid_ptr, level, & - num_cells(1), & - num_cells(2), & - lower_corner(1), & - lower_corner(2), & - delta(1), delta(2) - end if + write(out_unit, header_format_2d) grid_ptr, level, & + num_cells(1), & + num_cells(2), & + lower_corner(1), & + lower_corner(2), & + delta(1), delta(2) + ! Output grids select case(output_format) @@ -270,19 +257,12 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux) ! We only output header info for aux data if writing ! ASCII data - if (num_dim == 1) then - write(out_unit, header_format_1d) grid_ptr, level, & - num_cells(1), & - lower_corner(1), & - delta(1) - else - write(out_unit, header_format_2d) grid_ptr, level, & - num_cells(1), & - num_cells(2), & - lower_corner(1), & - lower_corner(2), & - delta(1), delta(2) - end if + write(out_unit, header_format_2d) grid_ptr, level, & + num_cells(1), & + num_cells(2), & + lower_corner(1), & + lower_corner(2), & + delta(1), delta(2) ! Round off if nearly zero forall (m = 1:num_aux, & @@ -360,7 +340,7 @@ subroutine valout(level_begin, level_end, time, num_eqn, num_aux) ! Note: We need to print out num_ghost too in order to strip ghost cells ! from q array when reading in pyclaw.io.binary - write(out_unit, t_file_format) time, num_eqn, num_grids, num_aux, num_dim, & + write(out_unit, t_file_format) time, num_eqn, num_grids, num_aux, 2, & num_ghost close(out_unit)