Skip to content

Commit

Permalink
Fix data copy in map projection controls
Browse files Browse the repository at this point in the history
  • Loading branch information
hiromatsui committed Jun 19, 2023
1 parent b77c712 commit ed1ab88
Show file tree
Hide file tree
Showing 13 changed files with 66 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ subroutine write_single_section_ctl &
integer(kind = kint), intent(inout) :: level
!
!
if(psf_ctls%num_psf_ctl .gt. 0) return
if(psf_ctls%num_psf_ctl .le. 0) return
call sel_write_control_4_psf_file(id_control, hd_section, &
& psf_ctls%fname_psf_ctl(1), psf_ctls%psf_ctl_struct(1), level)
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ bcast_maps_control_data.o: $(MAP_RENDERING_DIR)/bcast_maps_control_data.f90 m_pr
$(F90) -c $(F90OPTFLAGS) $<
ctl_data_map_rendering_IO.o: $(MAP_RENDERING_DIR)/ctl_data_map_rendering_IO.f90 m_precision.o m_constants.o m_machine_parameter.o skip_comment_f.o t_read_control_elements.o t_control_array_real.o t_control_array_character.o t_control_array_charareal.o t_control_data_4_map.o t_ctl_data_pvr_section.o calypso_mpi.o t_ctl_data_pvr_colormap_bar.o ctl_file_pvr_modelview_IO.o ctl_data_pvr_section_IO.o write_control_elements.o
$(F90) -c $(F90OPTFLAGS) $<
ctl_file_map_renderings_IO.o: $(MAP_RENDERING_DIR)/ctl_file_map_renderings_IO.f90 m_precision.o m_machine_parameter.o t_control_data_4_map.o t_control_data_maps.o t_read_control_elements.o ctl_data_section_IO.o skip_comment_f.o ctl_data_map_rendering_IO.o write_control_elements.o
ctl_file_map_renderings_IO.o: $(MAP_RENDERING_DIR)/ctl_file_map_renderings_IO.f90 m_precision.o m_machine_parameter.o t_control_data_4_map.o t_control_data_maps.o t_read_control_elements.o ctl_data_section_IO.o skip_comment_f.o write_control_elements.o ctl_data_map_rendering_IO.o
$(F90) -c $(F90OPTFLAGS) $<
draw_aitoff_map.o: $(MAP_RENDERING_DIR)/draw_aitoff_map.f90 m_precision.o m_constants.o t_geometry_data.o t_phys_data.o t_pvr_image_array.o t_map_rendering_data.o t_map_patch_from_1patch.o map_patch_from_1patch.o draw_pixels_on_map.o set_color_4_pvr.o draw_isoline_in_triangle.o
$(F90) -c $(F90OPTFLAGS) $<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,13 @@ subroutine s_read_map_control_data &
if(check_end_flag(c_buf, hd_block)) exit
!
call sel_read_ctl_modelview_file(id_control, hd_map_projection, &
& map_c%fname_mat_ctl, map_c%mat, c_buf)
& izero, map_c%fname_mat_ctl, map_c%mat, c_buf)
call sel_read_ctl_pvr_colormap_file &
& (id_control, hd_map_colormap_file, map_c%fname_cmap_cbar_c, &
& map_c%cmap_cbar_c, c_buf)
!
call read_pvr_section_ctl(id_control, hd_section_ctl, &
& map_c%map_define_ctl, c_buf)
& izero, map_c%map_define_ctl, c_buf)
!
call read_chara_ctl_type(c_buf, hd_map_image_prefix, &
& map_c%map_image_prefix_ctl)
Expand Down Expand Up @@ -280,6 +280,7 @@ subroutine write_map_control_data &
maxlen = max(maxlen, len_trim(hd_map_isoline_field))
maxlen = max(maxlen, len_trim(hd_map_isoline_comp))
!
level = write_begin_flag_for_ctl(id_control, level, hd_block)
call write_chara_ctl_type(id_control, level, maxlen, &
& hd_map_image_prefix, map_c%map_image_prefix_ctl)
call write_chara_ctl_type(id_control, level, maxlen, &
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
!! & (id_control, hd_block, map_ctls, c_buf)
!! subroutine sel_read_control_4_map_file(id_control, hd_block, &
!! & file_name, map_ctl_struct, c_buf)
!! subroutine read_control_4_map_file(id_control, file_name, &
!! & hd_block, map_ctl_struct)
!! integer(kind = kint), intent(in) :: id_control
!! character(len=kchara), intent(in) :: hd_block
!! character(len = kchara), intent(inout) :: file_name
Expand Down Expand Up @@ -52,6 +50,8 @@ module ctl_file_map_renderings_IO
!
character(len=kchara), parameter, private &
& :: hd_map_rendering = 'map_rendering_ctl'
!
private :: read_control_4_map_file
!
! --------------------------------------------------------------------
!
Expand All @@ -65,12 +65,14 @@ subroutine read_files_4_map_ctl &
use t_read_control_elements
use ctl_data_section_IO
use skip_comment_f
use write_control_elements
!
integer(kind = kint), intent(in) :: id_control
character(len=kchara), intent(in) :: hd_block
type(map_rendering_controls), intent(inout) :: map_ctls
type(buffer_for_control), intent(inout) :: c_buf
!
integer :: i
!
if(check_array_flag(c_buf, hd_block) .eqv. .FALSE.) return
if(allocated(map_ctls%map_ctl_struct)) return
Expand All @@ -85,8 +87,9 @@ subroutine read_files_4_map_ctl &
if(check_file_flag(c_buf, hd_block) &
& .or. check_begin_flag(c_buf, hd_block)) then
call append_new_map_render_control(map_ctls)
write(*,'(3a,i4)', ADVANCE='NO') 'Control for ', &
& trim(hd_block), ' No. ', map_ctls%num_map_ctl
!
call write_multi_ctl_file_message &
& (hd_block, map_ctls%num_map_ctl, c_buf%level)
call sel_read_control_4_map_file(id_control, hd_block, &
& map_ctls%fname_map_ctl(map_ctls%num_map_ctl), &
& map_ctls%map_ctl_struct(map_ctls%num_map_ctl), c_buf)
Expand Down Expand Up @@ -114,13 +117,13 @@ subroutine sel_read_control_4_map_file(id_control, hd_block, &
if(check_file_flag(c_buf, hd_block)) then
file_name = third_word(c_buf)
!
write(*,'(a)', ADVANCE='NO') ' is read file from ... '
write(*,'(2a)') ' is read file from ... ', trim(file_name)
call read_control_4_map_file((id_control+2), file_name, &
& hd_block, map_ctl_struct)
& hd_block, map_ctl_struct, c_buf)
else if(check_begin_flag(c_buf, hd_block)) then
file_name = 'NO_FILE'
!
write(*,*) ' is included'
write(*,'(a)') ' is included.'
call s_read_map_control_data(id_control, hd_block, &
& map_ctl_struct, c_buf)
end if
Expand All @@ -130,7 +133,7 @@ end subroutine sel_read_control_4_map_file
! --------------------------------------------------------------------
!
subroutine read_control_4_map_file(id_control, file_name, &
& hd_block, map_ctl_struct)
& hd_block, map_ctl_struct, c_buf)
!
use t_read_control_elements
use t_control_data_4_map
Expand All @@ -141,24 +144,24 @@ subroutine read_control_4_map_file(id_control, file_name, &
character(len = kchara), intent(in) :: file_name
character(len=kchara), intent(in) :: hd_block
type(map_ctl), intent(inout) :: map_ctl_struct
!
type(buffer_for_control) :: c_buf1
type(buffer_for_control), intent(inout) :: c_buf
!
!
write(*,'(a)') trim(file_name)
c_buf%level = c_buf%level + 1
open(id_control, file=file_name, status='old')
!
do
call load_one_line_from_control(id_control, hd_block, c_buf1)
if(c_buf1%iend .gt. 0) exit
call load_one_line_from_control(id_control, hd_block, c_buf)
if(c_buf%iend .gt. 0) exit
!
call s_read_map_control_data(id_control, hd_block, &
& map_ctl_struct, c_buf1)
& map_ctl_struct, c_buf)
call s_read_map_control_data(id_control, hd_map_rendering, &
& map_ctl_struct, c_buf1)
& map_ctl_struct, c_buf)
if(map_ctl_struct%i_map_ctl .gt. 0) exit
end do
close(id_control)
c_buf%level = c_buf%level - 1
!
end subroutine read_control_4_map_file
!
Expand All @@ -177,6 +180,8 @@ subroutine write_files_4_map_ctl &
!
integer(kind = kint) :: i
!
!
if(map_ctls%num_map_ctl .le. 0) return
level = write_array_flag_for_ctl(id_control, level, hd_block)
do i = 1, map_ctls%num_map_ctl
write(*,'(3a,i4)', ADVANCE='NO') '! ', trim(hd_block), &
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,12 @@ module t_control_data_4_map
type(read_character_item) :: isoline_comp_ctl
!
!> file name for modelview matrix
character(len=kchara) :: fname_mat_ctl
character(len=kchara) :: fname_mat_ctl = 'NO_FILE'
!> Structure for modelview marices
type(modeview_ctl) :: mat
!
!> file name for colormap and colorbar
character(len=kchara) :: fname_cmap_cbar_c
character(len=kchara) :: fname_cmap_cbar_c = 'NO_FILE'
!> Structure for colormap and colorbar
type(pvr_colormap_bar_ctl) :: cmap_cbar_c
!
Expand Down Expand Up @@ -240,6 +240,9 @@ subroutine dealloc_cont_dat_4_map(map_c)
map_c%map_comp_ctl%iflag = 0
map_c%isoline_field_ctl%iflag = 0
map_c%isoline_comp_ctl%iflag = 0
!
map_c%fname_mat_ctl = 'NO_FILE'
map_c%fname_cmap_cbar_c = 'NO_FILE'
!
map_c%i_map_ctl = 0
map_c%i_output_field = 0
Expand Down Expand Up @@ -272,6 +275,9 @@ subroutine dup_control_4_map(org_map_c, new_map_c)
& new_map_c%isoline_field_ctl)
call copy_chara_ctl(org_map_c%isoline_comp_ctl, &
& new_map_c%isoline_comp_ctl)
!
new_map_c%fname_mat_ctl = org_map_c%fname_mat_ctl
new_map_c%fname_cmap_cbar_c = org_map_c%fname_cmap_cbar_c
!
new_map_c%i_map_ctl = org_map_c%i_map_ctl
new_map_c%i_output_field = org_map_c%i_output_field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ ctl_file_each_pvr_IO.o: $(PVR_DIR)/ctl_file_each_pvr_IO.f90 m_precision.o calyps
$(F90) -c $(F90OPTFLAGS) $<
ctl_file_pvr_light_IO.o: $(PVR_DIR)/ctl_file_pvr_light_IO.f90 m_precision.o m_constants.o m_machine_parameter.o t_ctl_data_pvr_light.o t_read_control_elements.o write_control_elements.o ctl_data_view_transfer_IO.o skip_comment_f.o
$(F90) -c $(F90OPTFLAGS) $<
ctl_file_pvr_modelview_IO.o: $(PVR_DIR)/ctl_file_pvr_modelview_IO.f90 m_precision.o m_constants.o m_machine_parameter.o t_ctl_data_4_view_transfer.o t_read_control_elements.o ctl_data_view_transfer_IO.o skip_comment_f.o write_control_elements.o
ctl_file_pvr_modelview_IO.o: $(PVR_DIR)/ctl_file_pvr_modelview_IO.f90 m_precision.o m_constants.o m_machine_parameter.o t_ctl_data_4_view_transfer.o t_read_control_elements.o ctl_data_view_transfer_IO.o write_control_elements.o skip_comment_f.o
$(F90) -c $(F90OPTFLAGS) $<
draw_pvr_colorbar.o: $(PVR_DIR)/draw_pvr_colorbar.f90 m_precision.o m_constants.o t_pvr_colormap_parameter.o draw_pvr_colorbar_nums.o set_color_4_pvr.o set_rgba_4_each_pixel.o
$(F90) -c $(F90OPTFLAGS) $<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ subroutine read_pvr_ctl(id_control, hd_block, pvr_ctl, c_buf)
use ctl_file_pvr_modelview_IO
use ctl_file_pvr_light_IO
use ctl_data_pvr_movie_IO
use write_control_elements
!
integer(kind = kint), intent(in) :: id_control
character(len=kchara), intent(in) :: hd_block
Expand All @@ -203,15 +202,8 @@ subroutine read_pvr_ctl(id_control, hd_block, pvr_ctl, c_buf)
if(check_end_flag(c_buf, hd_block)) exit
!
!
if(check_file_flag(c_buf, hd_view_transform) &
& .or. check_begin_flag(c_buf, hd_view_transform)) then
call write_multi_ctl_file_message &
& (hd_view_transform, izero, c_buf%level)
call sel_read_ctl_modelview_file(id_control, &
& hd_view_transform, pvr_ctl%fname_mat_ctl, &
& pvr_ctl%mat, c_buf)
end if
!
call sel_read_ctl_modelview_file(id_control, hd_view_transform, &
& izero, pvr_ctl%fname_mat_ctl, pvr_ctl%mat, c_buf)
call sel_read_ctl_pvr_colormap_file &
& (id_control, hd_colormap_file, pvr_ctl%fname_cmap_cbar_c, &
& pvr_ctl%cmap_cbar_c, c_buf)
Expand Down Expand Up @@ -345,7 +337,6 @@ subroutine write_pvr_ctl &
call write_chara_ctl_type(id_control, level, maxlen, &
& hd_output_comp_def, pvr_ctl%pvr_comp_ctl)
!
write(*,'(2a)', ADVANCE='NO') '! ', trim(hd_view_transform)
call sel_write_ctl_modelview_file(id_control, hd_view_transform, &
& pvr_ctl%fname_mat_ctl, pvr_ctl%mat, level)
call write_pvr_render_area_ctl(id_control, hd_plot_area, &
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,25 +132,12 @@ subroutine read_pvr_rotation_ctl &
if(c_buf%iend .gt. 0) exit
if(check_end_flag(c_buf, hd_block)) exit
!
!
if(check_file_flag(c_buf, hd_start_view_control) &
& .or. check_begin_flag(c_buf, hd_start_view_control)) then
call write_multi_ctl_file_message &
& (hd_start_view_control, izero, c_buf%level)
call sel_read_ctl_modelview_file &
& (id_control, hd_start_view_control, &
& movie%fname_view_start_ctl, movie%view_start_ctl, c_buf)
end if
!
if(check_file_flag(c_buf, hd_end_view_control) &
& .or. check_begin_flag(c_buf, hd_end_view_control)) then
call write_multi_ctl_file_message &
& (hd_end_view_control, izero, c_buf%level)
call sel_read_ctl_modelview_file &
& (id_control, hd_end_view_control, &
& movie%fname_view_end_ctl, movie%view_end_ctl, c_buf)
end if
!
call sel_read_ctl_modelview_file &
& (id_control, hd_start_view_control, izero, &
& movie%fname_view_start_ctl, movie%view_start_ctl, c_buf)
call sel_read_ctl_modelview_file &
& (id_control, hd_end_view_control, izero, &
& movie%fname_view_end_ctl, movie%view_end_ctl, c_buf)
!
call read_chara_ctl_type(c_buf, hd_movie_mode, &
& movie%movie_mode_ctl)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
!!
!!@verbatim
!! subroutine read_pvr_section_ctl &
!! & (id_control, hd_block, pvr_sect_ctl, c_buf)
!! & (id_control, hd_block, icou, pvr_sect_ctl, c_buf)
!! integer(kind = kint), intent(in) :: id_control
!! character(len=kchara), intent(in) :: hd_block
!! type(pvr_section_ctl), intent(inout) :: pvr_sect_ctl
Expand Down Expand Up @@ -98,11 +98,12 @@ module ctl_data_pvr_section_IO
! -----------------------------------------------------------------------
!
subroutine read_pvr_section_ctl &
& (id_control, hd_block, pvr_sect_ctl, c_buf)
& (id_control, hd_block, icou, pvr_sect_ctl, c_buf)
!
use ctl_file_section_def_IO
use write_control_elements
!
integer(kind = kint), intent(in) :: id_control
integer(kind = kint), intent(in) :: id_control, icou
character(len=kchara), intent(in) :: hd_block
type(pvr_section_ctl), intent(inout) :: pvr_sect_ctl
type(buffer_for_control), intent(inout) :: c_buf
Expand All @@ -117,6 +118,8 @@ subroutine read_pvr_section_ctl &
!
if(check_file_flag(c_buf, hd_surface_define) &
& .or. check_begin_flag(c_buf, hd_surface_define)) then
call write_multi_ctl_file_message &
& (hd_block, icou, c_buf%level)
call sel_read_ctl_pvr_section_def(id_control, &
& hd_surface_define, pvr_sect_ctl%fname_sect_ctl, &
& pvr_sect_ctl%psf_def_c, c_buf)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
!!
!!@verbatim
!! subroutine sel_read_ctl_modelview_file &
!! & (id_control, hd_block, file_name, mat, c_buf)
!! & (id_control, hd_block, icou, file_name, mat, c_buf)
!! subroutine sel_write_ctl_modelview_file &
!! & (id_control, hd_block, file_name, mat, level)
!! integer(kind = kint), intent(in) :: id_control
Expand Down Expand Up @@ -132,11 +132,12 @@ module ctl_file_pvr_modelview_IO
! ---------------------------------------------------------------------
!
subroutine sel_read_ctl_modelview_file &
& (id_control, hd_block, file_name, mat, c_buf)
& (id_control, hd_block, icou, file_name, mat, c_buf)
!
use ctl_data_view_transfer_IO
use write_control_elements
!
integer(kind = kint), intent(in) :: id_control
integer(kind = kint), intent(in) :: id_control, icou
character(len=kchara), intent(in) :: hd_block
character(len = kchara), intent(inout) :: file_name
type(modeview_ctl), intent(inout) :: mat
Expand All @@ -146,6 +147,7 @@ subroutine sel_read_ctl_modelview_file &
if(check_file_flag(c_buf, hd_block)) then
file_name = third_word(c_buf)
!
call write_multi_ctl_file_message(hd_block, icou, c_buf%level)
write(*,'(2a)') ' is read from ... ', trim(file_name)
call read_control_modelview_file(id_control+1, file_name, &
& hd_block, mat, c_buf)
Expand Down Expand Up @@ -175,7 +177,7 @@ subroutine sel_write_ctl_modelview_file &
!
!
if(cmp_no_case(file_name, 'NO_FILE')) then
write(*,*) ' is included'
write(*,'(3a)') '! ', trim(hd_block), ' is included'
call write_view_transfer_ctl(id_control, hd_block, mat, level)
else if(id_control .eq. id_monitor) then
write(*,'(4a)') '! ', trim(hd_block), &
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,17 @@ module t_control_data_4_pvr
!> Structure of control data for PVR rendering
type pvr_parameter_ctl
!> file name for modelview matrix
character(len=kchara) :: fname_mat_ctl
character(len=kchara) :: fname_mat_ctl = 'NO_FILE'
!> Structure for modelview marices
type(modeview_ctl) :: mat
!
!> file name for lighting parameter
character(len=kchara) :: fname_pvr_light_c
character(len=kchara) :: fname_pvr_light_c = 'NO_FILE'
!> Structure for lighting
type(pvr_light_ctl) :: light
!
!> file name for colormap and colorbar
character(len=kchara) :: fname_cmap_cbar_c
character(len=kchara) :: fname_cmap_cbar_c = 'NO_FILE'
!> Structure for colormap and colorbar
type(pvr_colormap_bar_ctl) :: cmap_cbar_c
!
Expand Down Expand Up @@ -180,6 +180,10 @@ subroutine deallocate_cont_dat_pvr(pvr_ctl)
pvr_ctl%anaglyph_ctl%iflag = 0
pvr_ctl%pvr_field_ctl%iflag = 0
pvr_ctl%pvr_comp_ctl%iflag = 0
!
pvr_ctl%fname_mat_ctl = 'NO_FILE'
pvr_ctl%fname_pvr_light_c = 'NO_FILE'
pvr_ctl%fname_cmap_cbar_c = 'NO_FILE'
!
pvr_ctl%i_pvr_ctl = 0
!
Expand Down
Loading

0 comments on commit ed1ab88

Please sign in to comment.