From 143fc3cd8008f27757eef321084fbc62ada37dd6 Mon Sep 17 00:00:00 2001 From: Hiroaki Matsui Date: Mon, 25 Nov 2024 13:47:25 -0800 Subject: [PATCH] Add controls for radial variations --- .../MHD_src/IO/Makefile.depends | 16 +- .../MHD_src/IO/add_nodal_fields_4_MHD.f90 | 6 +- .../MHD_src/IO/add_sph_MHD_fields_2_ctl.f90 | 10 +- .../MHD_src/IO/bcast_ctl_MHD_model.f90 | 61 ++++ .../MHD_src/IO/ctl_data_MHD_model_IO.f90 | 54 ++- .../MHD_src/IO/init_sph_MHD_elapsed_label.F90 | 4 - .../MHD_src/IO/output_viz_file_control.f90 | 21 +- .../MHD_src/IO/set_control_4_MHD_coefs.f90 | 12 +- .../MHD_src/IO/set_control_4_force.f90 | 83 ++--- .../MHD_src/IO/sph_mhd_rst_IO_control.f90 | 30 +- .../MHD_src/IO/t_ctl_data_MHD_model.f90 | 22 ++ .../IO/t_ctl_data_valuable_density.f90 | 275 ++++++++++++++ .../IO/t_ctl_data_valuable_diffuse.f90 | 218 +++++++++++ .../MHD_src/IO/t_ctl_param_val_diffusion.f90 | 140 ++++++++ src/Fortran_libraries/MHD_src/Makefile | 2 + .../MHD_src/radial_FDM/Makefile | 35 ++ .../MHD_src/radial_FDM/Makefile.depends | 21 ++ .../t_coef_fdm3_n2e_free_vp_CMB.f90 | 146 ++++++++ .../t_coef_fdm3_n2e_free_vp_ICB.f90 | 149 ++++++++ .../t_coef_fdm3_n2e_zero_vp_CMB.f90 | 195 ++++++++++ .../t_coef_fdm3_n2e_zero_vp_CTR.f90 | 192 ++++++++++ .../t_coef_fdm3_n2e_zero_vp_ICB.f90 | 196 ++++++++++ .../radial_FDM/t_coef_fdm4_free_vpol_CMB.f90 | 265 ++++++++++++++ .../radial_FDM/t_coef_fdm4_free_vpol_ICB.f90 | 266 ++++++++++++++ .../radial_FDM/t_coef_fdm4_vpol_centre.f90 | 180 ++++++++++ .../radial_FDM/t_coef_fdm4_zero_vpol_CMB.f90 | 249 +++++++++++++ .../radial_FDM/t_coef_fdm4_zero_vpol_ICB.f90 | 255 +++++++++++++ .../MHD_src/sph_MHD/FEM_analyzer_sph_MHD.f90 | 8 +- .../MHD_src/sph_MHD/Makefile.depends | 40 ++- .../sph_MHD/add_base_field_4_sph_trns.f90 | 10 +- .../sph_MHD/add_base_force_4_sph_trns.f90 | 8 +- .../MHD_src/sph_MHD/cal_coriolis_rlm.f90 | 296 +++++++++++++++ .../MHD_src/sph_MHD/cal_div_of_forces.f90 | 70 ++-- .../MHD_src/sph_MHD/cal_heat_source_Nu.f90 | 1 - .../MHD_src/sph_MHD/cal_nonlinear.f90 | 51 ++- .../MHD_src/sph_MHD/cal_nonlinear_sph_MHD.f90 | 2 +- .../sph_MHD/cal_self_buoyancies_sph.f90 | 129 +++---- .../sph_MHD/cal_sph_divergence_of_force.f90 | 24 +- .../sph_MHD/cal_vorticity_terms_adams.f90 | 75 ++-- .../sph_MHD/check_dependency_for_MHD.f90 | 6 +- .../MHD_src/sph_MHD/coef_fdm2_free_CMB.f90 | 38 +- .../MHD_src/sph_MHD/coef_fdm2_free_ICB.f90 | 36 +- .../sph_MHD/const_r_mat_4_vector_sph.f90 | 8 +- .../sph_MHD/const_radial_forces_on_bc.f90 | 8 +- .../sph_MHD/construct_MHD_coefficient.f90 | 2 +- .../sph_MHD/div_self_buoyancies_sph.f90 | 16 +- .../sph_MHD/init_radial_infos_sph_mhd.f90 | 84 ++--- .../sph_MHD/init_sph_radius_variations.f90 | 287 +++++++++++++++ .../MHD_src/sph_MHD/input_control_sph_MHD.f90 | 6 +- .../MHD_src/sph_MHD/interact_coriolis_rlm.f90 | 2 +- .../sph_MHD/interpolate_reference_data.f90 | 10 +- .../MHD_src/sph_MHD/lead_fields_4_sph_mhd.f90 | 30 +- .../sph_MHD/m_elapsed_labels_4_MHD.f90 | 15 +- .../MHD_src/sph_MHD/material_property.f90 | 22 +- .../sph_MHD/radial_reference_field_IO.f90 | 3 +- .../sph_MHD/rot_self_buoyancies_sph.f90 | 126 ++----- .../sph_MHD/self_buoyancy_on_sphere.f90 | 16 +- .../MHD_src/sph_MHD/set_bc_sph_mhd.f90 | 221 +++++------- .../MHD_src/sph_MHD/set_control_sph_mhd.f90 | 72 +++- .../sph_MHD/set_initial_sph_dynamo.f90 | 8 +- .../MHD_src/sph_MHD/set_sph_bc_magne_sph.f90 | 143 ++++++++ .../sph_MHD/set_sph_radial_variations.f90 | 324 +++++++++++++++++ .../MHD_src/sph_MHD/sph_trans_w_coriols.f90 | 55 +-- .../MHD_src/sph_MHD/sph_transforms_4_MHD.f90 | 20 +- .../sph_MHD/sum_coriolis_terms_rlm.f90 | 54 +-- .../sph_MHD/sum_rot_coriolis_terms_rlm.f90 | 71 ++-- .../sph_MHD/sum_rotation_of_forces.f90 | 115 +++--- .../MHD_src/sph_MHD/t_MHD_step_parameter.f90 | 14 +- .../MHD_src/sph_MHD/t_SPH_MHD_model_data.f90 | 4 + .../sph_MHD/t_SPH_MHD_zmean_sections.f90 | 71 ++-- .../sph_MHD/t_boundary_data_sph_MHD.f90 | 33 +- .../sph_MHD/t_coef_fdm2_MHD_boundaries.f90 | 68 +++- .../sph_MHD/t_coef_fdm4_MHD_boundaries.f90 | 185 ---------- .../MHD_src/sph_MHD/t_control_parameter.f90 | 22 ++ .../MHD_src/sph_MHD/t_coriolis_terms_rlm.f90 | 200 +---------- .../sph_MHD/t_ctl_param_val_density.f90 | 160 +++++++++ .../sph_MHD/t_flex_delta_t_parameter.f90 | 10 +- .../MHD_src/sph_MHD/t_physical_property.f90 | 46 ++- .../MHD_src/sph_MHD/t_work_SPH_MHD.f90 | 6 +- .../sph_MHD/test_legendre_transforms.F90 | 6 +- .../COMM_src/bcast_4_time_step_ctl.f90 | 2 + .../COMM_src/const_element_comm_tables.f90 | 4 +- .../COMM_src/m_elapsed_labels_SEND_RECV.f90 | 2 +- .../COMM_src/m_sph_communicators.f90 | 26 +- .../PARALLEL_src/COMM_src/m_work_time.f90 | 7 + .../COMM_src/t_element_double_number.f90 | 2 +- .../COMM_src/t_para_double_numbering.f90 | 22 +- .../PARALLEL_src/COMM_src/t_work_time.f90 | 1 + .../PARALLEL_src/MPI_IO/MPI_edge_data_IO.f90 | 2 - .../MPI_IO/MPI_edge_data_IO_b.f90 | 4 +- .../MPI_IO/MPI_element_connect_IO.f90 | 3 +- .../MPI_IO/MPI_element_connect_IO_b.f90 | 1 + .../MPI_IO/MPI_element_file_IO.f90 | 1 - .../MPI_IO/MPI_element_file_IO_b.f90 | 1 - .../PARALLEL_src/MPI_IO/MPI_mesh_data_IO.f90 | 33 +- .../MPI_IO/MPI_mesh_data_IO_b.f90 | 43 +-- .../PARALLEL_src/MPI_IO/MPI_mesh_file_IO.f90 | 17 +- .../MPI_IO/MPI_mesh_file_IO_b.f90 | 20 +- .../MPI_IO/MPI_node_geometry_IO.f90 | 1 + .../MPI_IO/MPI_node_geometry_IO_b.f90 | 1 + .../MPI_IO/MPI_surface_data_IO.f90 | 2 - .../MPI_IO/MPI_surface_data_IO_b.f90 | 4 +- .../PARALLEL_src/MPI_IO/Makefile.depends | 2 +- .../PARALLEL_src/MPI_IO/field_IO_select.F90 | 2 +- .../MPI_IO/field_block_MPI_IO_b.f90 | 30 +- .../MPI_IO/field_file_MPI_IO_b.f90 | 15 +- .../MPI_IO/ucd_field_MPI_IO_b.f90 | 15 +- .../MPI_ZLIB_IO/gz_MPI_edge_data_IO.f90 | 1 - .../MPI_ZLIB_IO/gz_MPI_edge_data_IO_b.f90 | 2 - .../gz_MPI_element_connect_IO_b.f90 | 2 + .../MPI_ZLIB_IO/gz_MPI_element_file_IO.f90 | 1 - .../MPI_ZLIB_IO/gz_MPI_element_file_IO_b.f90 | 1 - .../MPI_ZLIB_IO/gz_MPI_mesh_data_IO.f90 | 31 +- .../MPI_ZLIB_IO/gz_MPI_mesh_data_IO_b.f90 | 37 +- .../MPI_ZLIB_IO/gz_MPI_mesh_file_IO.f90 | 16 +- .../MPI_ZLIB_IO/gz_MPI_mesh_file_IO_b.f90 | 8 +- .../MPI_ZLIB_IO/gz_MPI_node_geometry_IO.f90 | 1 + .../MPI_ZLIB_IO/gz_MPI_node_geometry_IO_b.f90 | 1 + .../MPI_ZLIB_IO/gz_MPI_surface_data_IO.f90 | 1 - .../MPI_ZLIB_IO/gz_MPI_surface_data_IO_b.f90 | 2 - .../SPH_SHELL_src/init_rms_4_sph_spectr.f90 | 2 +- .../init_sph_spec_radial_param.f90 | 5 +- .../parallel_load_data_4_sph.f90 | 8 +- .../SPH_SHELL_src/radial_interpolation.f90 | 12 +- .../SPH_SHELL_src/t_sph_matrices.f90 | 27 +- .../BASE/cvt_xyz_tensor_2_cyl_smp.f90 | 112 +++--- .../SERIAL_src/BASE/t_time_data.f90 | 4 + .../IO/ctl_data_4_time_steps_IO.f90 | 47 ++- .../SERIAL_src/IO/edge_data_IO.f90 | 6 +- .../SERIAL_src/IO/element_connect_IO.f90 | 8 +- .../SERIAL_src/IO/element_data_IO.f90 | 3 +- .../SERIAL_src/IO/field_data_IO_b.f90 | 27 +- .../SERIAL_src/IO/field_file_IO_b.f90 | 12 +- .../SERIAL_src/IO/gz_field_data_IO_b.f90 | 34 +- .../SERIAL_src/IO/gz_field_file_IO_b.f90 | 21 +- .../SERIAL_src/IO/mesh_data_IO.f90 | 59 +-- .../SERIAL_src/IO/mesh_file_IO.f90 | 23 +- .../SERIAL_src/IO/node_geometry_IO.f90 | 11 +- .../SERIAL_src/IO/set_ucd_file_names.f90 | 43 --- .../SERIAL_src/IO/surface_data_IO.f90 | 9 +- .../SERIAL_src/IO/t_ctl_data_4_time_steps.f90 | 5 + .../SERIAL_src/IO/ucd_data_to_buffer.f90 | 7 +- .../SERIAL_src/IO/ucd_field_file_IO_b.f90 | 20 +- .../SERIAL_src/IO/vtk_data_to_buffer.f90 | 10 +- .../IO/write_pick_sph_spectr_data.F90 | 3 + .../SERIAL_src/IO_ZLIB/Makefile.depends | 2 +- .../IO_ZLIB/cal_buoyancies_sph_MHD.f90 | 52 ++- .../SERIAL_src/IO_ZLIB/gz_edge_data_IO.f90 | 1 - .../SERIAL_src/IO_ZLIB/gz_edge_data_IO_b.f90 | 5 - .../IO_ZLIB/gz_element_connect_IO_b.f90 | 2 + .../SERIAL_src/IO_ZLIB/gz_element_file_IO.f90 | 1 - .../IO_ZLIB/gz_element_file_IO_b.f90 | 3 - .../IO_ZLIB/gz_layer_spectr_monitor_IO.F90 | 2 + .../SERIAL_src/IO_ZLIB/gz_mesh_data_IO.f90 | 54 +-- .../SERIAL_src/IO_ZLIB/gz_mesh_data_IO_b.f90 | 56 +-- .../SERIAL_src/IO_ZLIB/gz_mesh_file_IO.f90 | 21 +- .../SERIAL_src/IO_ZLIB/gz_mesh_file_IO_b.f90 | 20 +- .../IO_ZLIB/gz_node_geometry_IO.f90 | 1 + .../IO_ZLIB/gz_node_geometry_IO_b.f90 | 3 + .../SERIAL_src/IO_ZLIB/gz_surface_data_IO.f90 | 4 - .../IO_ZLIB/gz_surface_data_IO_b.f90 | 5 - .../IO_ZLIB/gz_ucd_field_file_IO_b.f90 | 14 +- .../IO_ZLIB/gz_volume_spectr_monitor_IO.F90 | 2 + .../SPH_SPECTR_src/Makefile.depends | 4 + .../SPH_SPECTR_src/first_fdm_ele_to_node.f90 | 209 +++++++++++ .../SPH_SPECTR_src/second_fdm_node_coefs.f90 | 2 +- .../set_radius_4_sph_dynamo.f90 | 6 +- .../SERIAL_src/SPH_SPECTR_src/t_fdm_coefs.f90 | 21 +- .../SPH_SPECTR_src/third_fdm_node_to_ele.f90 | 251 +++++++++++++ .../direct_solver/m_ludcmp_band.f90 | 3 +- .../UTILS_src/MESH/Makefile.depends | 6 +- .../UTILS_src/MESH/const_mesh_information.f90 | 22 +- .../UTILS_src/MESH/m_27quad_2_8x8linear.f90 | 214 +++++++++++ .../UTILS_src/MESH/m_connect_hexa_2_tetra.f90 | 115 ++++++ .../UTILS_src/MESH/m_geometry_constants.f90 | 3 + .../MESH/nod_and_ele_derived_info.f90 | 8 +- .../UTILS_src/MESH/t_surface_data.f90 | 38 +- .../VIZ_src/surfacing/FEM_to_PSF_bridge.f90 | 11 +- .../VIZ_src/surfacing/Makefile.depends | 16 +- .../surfacing/convert_components_4_viz.f90 | 11 +- .../surfacing/elapsed_labels_4_PSF.f90 | 108 ++++++ .../surfacing/m_elapsed_labels_4_VIZ.f90 | 338 ------------------ .../VIZ_src/surfacing/output_4_psf.f90 | 1 - .../VIZ_src/surfacing/set_area_4_viz.f90 | 42 ++- .../VIZ_src/surfacing/set_fields_for_psf.f90 | 6 +- .../surfacing/t_VIZ_step_parameter.f90 | 16 + .../surfacing/t_control_data_4_fld_on_psf.f90 | 2 +- .../surfacing/t_control_params_4_psf.f90 | 6 +- .../VIZ_src/surfacing/t_cross_section.f90 | 51 +-- .../surfacing/t_ctl_params_viz_fields.f90 | 233 ++++++++++++ .../surfacing/t_elapsed_labels_4_SECTIONS.f90 | 137 +++++++ .../VIZ_src/surfacing/t_isosurface.f90 | 28 +- .../VIZ_src/surfacing/t_viz_sections.f90 | 50 ++- src/programs/SPH_MHD/Makefile.depends | 2 +- src/programs/SPH_MHD/SPH_analyzer_MHD.f90 | 6 +- .../SPH_MHD/analyzer_sph_MHD_w_psf.f90 | 28 +- src/programs/SPH_MHD/control_MHD | 47 +++ .../SPH_analyzer_add_initial.f90 | 9 +- .../SPH_analyzer_const_initial.f90 | 6 +- .../const_sph_initial_spectr.f90 | 29 +- .../SNAPSHOT_MHD/Makefile.depends | 2 +- .../SNAPSHOT_MHD/SPH_analyzer_snap_w_vizs.f90 | 12 +- .../SNAPSHOT_MHD/analyzer_sph_snap_w_psf.f90 | 21 +- .../count_monitor_time_series.f90 | 2 +- .../data_utilities/VIZ_only/Makefile.depends | 6 +- .../VIZ_only/analyzer_VTK_convert.f90 | 14 +- .../data_utilities/VIZ_only/analyzer_psf.f90 | 13 +- .../VIZ_only/t_viz_VTK_convert.f90 | 18 +- 208 files changed, 7317 insertions(+), 2429 deletions(-) create mode 100644 src/Fortran_libraries/MHD_src/IO/t_ctl_data_valuable_density.f90 create mode 100644 src/Fortran_libraries/MHD_src/IO/t_ctl_data_valuable_diffuse.f90 create mode 100644 src/Fortran_libraries/MHD_src/IO/t_ctl_param_val_diffusion.f90 create mode 100644 src/Fortran_libraries/MHD_src/radial_FDM/Makefile create mode 100644 src/Fortran_libraries/MHD_src/radial_FDM/Makefile.depends create mode 100644 src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm3_n2e_free_vp_CMB.f90 create mode 100644 src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm3_n2e_free_vp_ICB.f90 create mode 100644 src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm3_n2e_zero_vp_CMB.f90 create mode 100644 src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm3_n2e_zero_vp_CTR.f90 create mode 100644 src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm3_n2e_zero_vp_ICB.f90 create mode 100644 src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm4_free_vpol_CMB.f90 create mode 100644 src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm4_free_vpol_ICB.f90 create mode 100644 src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm4_vpol_centre.f90 create mode 100644 src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm4_zero_vpol_CMB.f90 create mode 100644 src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm4_zero_vpol_ICB.f90 create mode 100644 src/Fortran_libraries/MHD_src/sph_MHD/cal_coriolis_rlm.f90 create mode 100644 src/Fortran_libraries/MHD_src/sph_MHD/init_sph_radius_variations.f90 create mode 100644 src/Fortran_libraries/MHD_src/sph_MHD/set_sph_bc_magne_sph.f90 create mode 100644 src/Fortran_libraries/MHD_src/sph_MHD/set_sph_radial_variations.f90 delete mode 100644 src/Fortran_libraries/MHD_src/sph_MHD/t_coef_fdm4_MHD_boundaries.f90 create mode 100644 src/Fortran_libraries/MHD_src/sph_MHD/t_ctl_param_val_density.f90 create mode 100644 src/Fortran_libraries/SERIAL_src/SPH_SPECTR_src/first_fdm_ele_to_node.f90 create mode 100644 src/Fortran_libraries/SERIAL_src/SPH_SPECTR_src/third_fdm_node_to_ele.f90 create mode 100644 src/Fortran_libraries/UTILS_src/MESH/m_27quad_2_8x8linear.f90 create mode 100644 src/Fortran_libraries/UTILS_src/MESH/m_connect_hexa_2_tetra.f90 create mode 100644 src/Fortran_libraries/VIZ_src/surfacing/elapsed_labels_4_PSF.f90 delete mode 100644 src/Fortran_libraries/VIZ_src/surfacing/m_elapsed_labels_4_VIZ.f90 create mode 100644 src/Fortran_libraries/VIZ_src/surfacing/t_ctl_params_viz_fields.f90 create mode 100644 src/Fortran_libraries/VIZ_src/surfacing/t_elapsed_labels_4_SECTIONS.f90 diff --git a/src/Fortran_libraries/MHD_src/IO/Makefile.depends b/src/Fortran_libraries/MHD_src/IO/Makefile.depends index aea2f639..02268ab6 100644 --- a/src/Fortran_libraries/MHD_src/IO/Makefile.depends +++ b/src/Fortran_libraries/MHD_src/IO/Makefile.depends @@ -4,7 +4,7 @@ add_sph_MHD_fields_2_ctl.o: $(MHD_IO_DIR)/add_sph_MHD_fields_2_ctl.f90 m_precisi $(F90) -c $(F90OPTFLAGS) $< bcast_control_sph_MHD.o: $(MHD_IO_DIR)/bcast_control_sph_MHD.f90 m_precision.o calypso_mpi.o m_machine_parameter.o t_ctl_data_MHD.o t_ctl_data_sph_MHD_w_psf.o calypso_mpi_int.o calypso_mpi_char.o transfer_to_long_integers.o bcast_4_platform_ctl.o bcast_4_field_ctl.o bcast_4_sph_monitor_ctl.o bcast_4_sphere_ctl.o bcast_ctl_MHD_model.o bcast_monitor_data_ctl.o t_ctl_data_SPH_MHD_control.o bcast_4_time_step_ctl.o bcast_ctl_data_mhd_time_rst.o t_ctl_data_crust_filter.o bcast_control_arrays.o $(F90) -c $(F90OPTFLAGS) $< -bcast_ctl_MHD_model.o: $(MHD_IO_DIR)/bcast_ctl_MHD_model.f90 m_precision.o m_machine_parameter.o calypso_mpi.o t_ctl_data_MHD_model.o calypso_mpi_char.o calypso_mpi_int.o bcast_4_field_ctl.o bcast_ctl_data_mhd_evo.o bcast_ctl_data_mhd_forces.o transfer_to_long_integers.o t_ctl_data_dimless_numbers.o bcast_control_arrays.o t_ctl_data_mhd_normalize.o t_ctl_data_termal_norm.o t_ctl_data_momentum_norm.o t_ctl_data_induct_norm.o +bcast_ctl_MHD_model.o: $(MHD_IO_DIR)/bcast_ctl_MHD_model.f90 m_precision.o m_machine_parameter.o calypso_mpi.o t_ctl_data_MHD_model.o calypso_mpi_char.o calypso_mpi_int.o bcast_4_field_ctl.o bcast_ctl_data_mhd_evo.o bcast_ctl_data_mhd_forces.o transfer_to_long_integers.o t_ctl_data_dimless_numbers.o bcast_control_arrays.o t_ctl_data_mhd_normalize.o t_ctl_data_termal_norm.o t_ctl_data_momentum_norm.o t_ctl_data_induct_norm.o t_ctl_data_valuable_density.o t_ctl_data_valuable_diffuse.o $(F90) -c $(F90OPTFLAGS) $< bcast_ctl_data_mhd_evo.o: $(MHD_IO_DIR)/bcast_ctl_data_mhd_evo.f90 m_precision.o m_machine_parameter.o calypso_mpi.o t_ctl_data_mhd_evolution.o calypso_mpi_int.o calypso_mpi_char.o transfer_to_long_integers.o bcast_control_arrays.o t_ctl_data_mhd_evo_area.o t_ctl_data_node_boundary.o t_ctl_data_surf_boundary.o $(F90) -c $(F90OPTFLAGS) $< @@ -18,7 +18,7 @@ bcast_monitor_data_ctl.o: $(MHD_IO_DIR)/bcast_monitor_data_ctl.f90 m_precision.o $(F90) -c $(F90OPTFLAGS) $< check_read_bc_file.o: $(MHD_IO_DIR)/check_read_bc_file.f90 m_precision.o t_bc_data_list.o t_control_parameter.o calypso_mpi.o t_physical_property.o $(F90) -c $(F90OPTFLAGS) $< -ctl_data_MHD_model_IO.o: $(MHD_IO_DIR)/ctl_data_MHD_model_IO.f90 m_precision.o m_machine_parameter.o t_read_control_elements.o t_ctl_data_4_fields.o t_ctl_data_mhd_evolution.o t_ctl_data_mhd_evo_area.o t_ctl_data_node_boundary.o t_ctl_data_surf_boundary.o t_ctl_data_mhd_normalize.o t_ctl_data_mhd_forces.o t_ctl_data_coriolis_force.o t_ctl_data_gravity.o t_ctl_data_mhd_magne.o t_ctl_data_magnetic_scale.o t_ctl_data_temp_model.o t_ctl_data_dimless_numbers.o t_ctl_data_MHD_model.o skip_comment_f.o write_control_elements.o ctl_data_node_boundary_IO.o ctl_data_surf_boundary_IO.o ctl_data_temp_model_IO.o ctl_data_comp_model_IO.o +ctl_data_MHD_model_IO.o: $(MHD_IO_DIR)/ctl_data_MHD_model_IO.f90 m_precision.o m_machine_parameter.o t_read_control_elements.o t_ctl_data_4_fields.o t_ctl_data_mhd_evolution.o t_ctl_data_mhd_evo_area.o t_ctl_data_node_boundary.o t_ctl_data_surf_boundary.o t_ctl_data_mhd_normalize.o t_ctl_data_mhd_forces.o t_ctl_data_coriolis_force.o t_ctl_data_gravity.o t_ctl_data_mhd_magne.o t_ctl_data_magnetic_scale.o t_ctl_data_temp_model.o t_ctl_data_dimless_numbers.o t_ctl_data_MHD_model.o t_ctl_data_valuable_diffuse.o t_ctl_data_valuable_density.o skip_comment_f.o write_control_elements.o ctl_data_node_boundary_IO.o ctl_data_surf_boundary_IO.o ctl_data_temp_model_IO.o ctl_data_comp_model_IO.o $(F90) -c $(F90OPTFLAGS) $< ctl_data_comp_model_IO.o: $(MHD_IO_DIR)/ctl_data_comp_model_IO.f90 m_precision.o m_machine_parameter.o t_read_control_elements.o t_control_array_character.o t_control_array_real.o t_ctl_data_temp_model.o skip_comment_f.o write_control_elements.o $(F90) -c $(F90OPTFLAGS) $< @@ -30,7 +30,7 @@ ctl_data_surf_boundary_IO.o: $(MHD_IO_DIR)/ctl_data_surf_boundary_IO.f90 m_preci $(F90) -c $(F90OPTFLAGS) $< ctl_data_temp_model_IO.o: $(MHD_IO_DIR)/ctl_data_temp_model_IO.f90 m_precision.o m_machine_parameter.o t_read_control_elements.o t_control_array_character.o t_control_array_real.o t_ctl_data_temp_model.o skip_comment_f.o write_control_elements.o $(F90) -c $(F90OPTFLAGS) $< -init_sph_MHD_elapsed_label.o: $(MHD_IO_DIR)/init_sph_MHD_elapsed_label.F90 m_precision.o m_work_time.o m_elapsed_labels_SEND_RECV.o m_elapsed_labels_SPH_TRNS.o m_elapsed_labels_4_MHD.o m_elapsed_labels_4_VIZ.o m_elapsed_labels_gen_SPH.o calypso_mpi.o t_spheric_parameter.o calypso_mpi_int.o transfer_to_long_integers.o set_parallel_file_name.o +init_sph_MHD_elapsed_label.o: $(MHD_IO_DIR)/init_sph_MHD_elapsed_label.F90 m_precision.o m_work_time.o m_elapsed_labels_SEND_RECV.o m_elapsed_labels_SPH_TRNS.o m_elapsed_labels_4_MHD.o m_elapsed_labels_gen_SPH.o calypso_mpi.o t_spheric_parameter.o calypso_mpi_int.o transfer_to_long_integers.o set_parallel_file_name.o $(F90) -c $(F90OPTFLAGS) $(F90CPPFLAGS) $< m_boundary_condition_IDs.o: $(MHD_IO_DIR)/m_boundary_condition_IDs.f90 m_precision.o $(F90) -c $(F90OPTFLAGS) $< @@ -46,7 +46,7 @@ set_control_4_MHD_coefs.o: $(MHD_IO_DIR)/set_control_4_MHD_coefs.f90 m_precision $(F90) -c $(F90OPTFLAGS) $< set_control_4_composition.o: $(MHD_IO_DIR)/set_control_4_composition.f90 m_precision.o calypso_mpi.o m_machine_parameter.o m_sph_node_group_types.o t_physical_property.o t_control_array_chara2real.o t_bc_data_list.o m_fem_node_group_types.o set_surface_group_types.o $(F90) -c $(F90OPTFLAGS) $< -set_control_4_force.o: $(MHD_IO_DIR)/set_control_4_force.f90 m_precision.o m_constants.o m_error_IDs.o m_machine_parameter.o m_force_control_labels.o t_control_parameter.o t_ctl_data_mhd_forces.o t_ctl_data_mhd_magne.o t_ctl_data_gravity.o t_ctl_data_coriolis_force.o skip_comment_f.o t_physical_property.o calypso_mpi.o +set_control_4_force.o: $(MHD_IO_DIR)/set_control_4_force.f90 m_precision.o m_constants.o m_error_IDs.o m_machine_parameter.o m_force_control_labels.o t_control_parameter.o t_ctl_data_MHD_model.o skip_comment_f.o t_physical_property.o t_ctl_data_mhd_forces.o calypso_mpi.o t_ctl_data_gravity.o t_ctl_data_coriolis_force.o t_ctl_data_mhd_magne.o $(F90) -c $(F90OPTFLAGS) $< set_control_4_magne.o: $(MHD_IO_DIR)/set_control_4_magne.f90 m_precision.o m_machine_parameter.o m_sph_node_group_types.o calypso_mpi.o t_physical_property.o t_control_array_chara2real.o t_bc_data_list.o m_fem_node_group_types.o set_surface_group_types.o $(F90) -c $(F90OPTFLAGS) $< @@ -70,7 +70,7 @@ t_control_data_dynamo_sects.o: $(MHD_IO_DIR)/t_control_data_dynamo_sects.f90 m_p $(F90) -c $(F90OPTFLAGS) $< t_ctl_data_MHD.o: $(MHD_IO_DIR)/t_ctl_data_MHD.f90 m_precision.o m_machine_parameter.o t_read_control_elements.o t_ctl_data_4_platforms.o t_ctl_data_MHD_model.o t_ctl_data_SPH_MHD_control.o t_ctl_data_4_sph_monitor.o t_ctl_data_node_monitor.o t_ctl_data_gen_sph_shell.o delete_data_files.o ctl_data_platforms_IO.o ctl_data_sph_monitor_IO.o ctl_data_MHD_model_IO.o ctl_file_gen_sph_shell_IO.o write_control_elements.o $(F90) -c $(F90OPTFLAGS) $< -t_ctl_data_MHD_model.o: $(MHD_IO_DIR)/t_ctl_data_MHD_model.f90 m_precision.o m_machine_parameter.o t_read_control_elements.o t_ctl_data_4_fields.o t_ctl_data_mhd_evolution.o t_ctl_data_mhd_evo_area.o t_ctl_data_node_boundary.o t_ctl_data_surf_boundary.o t_ctl_data_mhd_normalize.o t_ctl_data_mhd_forces.o t_ctl_data_coriolis_force.o t_ctl_data_gravity.o t_ctl_data_mhd_magne.o t_ctl_data_magnetic_scale.o t_ctl_data_temp_model.o t_ctl_data_dimless_numbers.o skip_comment_f.o +t_ctl_data_MHD_model.o: $(MHD_IO_DIR)/t_ctl_data_MHD_model.f90 m_precision.o m_machine_parameter.o t_read_control_elements.o t_ctl_data_4_fields.o t_ctl_data_mhd_evolution.o t_ctl_data_mhd_evo_area.o t_ctl_data_node_boundary.o t_ctl_data_surf_boundary.o t_ctl_data_mhd_normalize.o t_ctl_data_mhd_forces.o t_ctl_data_coriolis_force.o t_ctl_data_gravity.o t_ctl_data_mhd_magne.o t_ctl_data_magnetic_scale.o t_ctl_data_temp_model.o t_ctl_data_dimless_numbers.o t_ctl_data_valuable_diffuse.o t_ctl_data_valuable_density.o skip_comment_f.o $(F90) -c $(F90OPTFLAGS) $< t_ctl_data_SPH_MHD_control.o: $(MHD_IO_DIR)/t_ctl_data_SPH_MHD_control.f90 m_precision.o m_machine_parameter.o t_read_control_elements.o t_ctl_data_4_time_steps.o t_ctl_data_mhd_evo_scheme.o t_ctl_data_mhd_restart.o skip_comment_f.o ctl_data_4_time_steps_IO.o ctl_data_mhd_evo_scheme_IO.o write_control_elements.o $(F90) -c $(F90OPTFLAGS) $< @@ -114,6 +114,12 @@ t_ctl_data_temp_model.o: $(MHD_IO_DIR)/t_ctl_data_temp_model.f90 m_precision.o m $(F90) -c $(F90OPTFLAGS) $< t_ctl_data_termal_norm.o: $(MHD_IO_DIR)/t_ctl_data_termal_norm.f90 m_precision.o m_machine_parameter.o t_control_array_charareal.o t_read_control_elements.o skip_comment_f.o write_control_elements.o $(F90) -c $(F90OPTFLAGS) $< +t_ctl_data_valuable_density.o: $(MHD_IO_DIR)/t_ctl_data_valuable_density.f90 m_precision.o m_machine_parameter.o t_read_control_elements.o t_control_array_character.o t_control_array_real.o t_control_array_real2.o skip_comment_f.o write_control_elements.o + $(F90) -c $(F90OPTFLAGS) $< +t_ctl_data_valuable_diffuse.o: $(MHD_IO_DIR)/t_ctl_data_valuable_diffuse.f90 m_precision.o m_machine_parameter.o t_read_control_elements.o t_control_array_character.o t_control_array_real2.o skip_comment_f.o write_control_elements.o + $(F90) -c $(F90OPTFLAGS) $< +t_ctl_param_val_diffusion.o: $(MHD_IO_DIR)/t_ctl_param_val_diffusion.f90 m_precision.o m_constants.o t_ctl_data_valuable_diffuse.o skip_comment_f.o + $(F90) -c $(F90OPTFLAGS) $< t_node_monitor_IO.o: $(MHD_IO_DIR)/t_node_monitor_IO.f90 m_precision.o t_time_data.o t_mesh_data.o t_phys_data.o t_IO_step_parameter.o t_ctl_data_node_monitor.o calypso_mpi.o m_machine_parameter.o set_parallel_file_name.o $(F90) -c $(F90OPTFLAGS) $< t_sph_boundary_input_data.o: $(MHD_IO_DIR)/t_sph_boundary_input_data.f90 m_precision.o t_spheric_rj_data.o t_each_sph_boundary_IO_data.o calypso_mpi_int.o calypso_mpi.o m_machine_parameter.o skip_comment_f.o diff --git a/src/Fortran_libraries/MHD_src/IO/add_nodal_fields_4_MHD.f90 b/src/Fortran_libraries/MHD_src/IO/add_nodal_fields_4_MHD.f90 index 9b9c87ce..3a11dccb 100644 --- a/src/Fortran_libraries/MHD_src/IO/add_nodal_fields_4_MHD.f90 +++ b/src/Fortran_libraries/MHD_src/IO/add_nodal_fields_4_MHD.f90 @@ -208,13 +208,13 @@ subroutine add_ctl_4_forces & call add_phys_name_ctl(perturbation_composition, field_ctl) end if ! - if(fl_prop%iflag_4_coriolis) & + if(fl_prop%flag_coriolis) & & call add_phys_name_ctl(Coriolis_force, field_ctl) ! if(fl_prop%iflag_FEM_gravity .eq. id_FORCE_at_node) then - if(fl_prop%iflag_4_gravity) & + if(fl_prop%flag_thermal_buoyancy) & & call add_phys_name_ctl(buoyancy, field_ctl) - if(fl_prop%iflag_4_composit_buo) & + if(fl_prop%flag_comp_buoyancy) & & call add_phys_name_ctl(composite_buoyancy, field_ctl) end if ! diff --git a/src/Fortran_libraries/MHD_src/IO/add_sph_MHD_fields_2_ctl.f90 b/src/Fortran_libraries/MHD_src/IO/add_sph_MHD_fields_2_ctl.f90 index 82343d82..64cffaff 100644 --- a/src/Fortran_libraries/MHD_src/IO/add_sph_MHD_fields_2_ctl.f90 +++ b/src/Fortran_libraries/MHD_src/IO/add_sph_MHD_fields_2_ctl.f90 @@ -58,7 +58,7 @@ subroutine add_field_name_4_sph_mhd & end if ! magnetic field flag if(cd_prop%iflag_Bevo_scheme .gt. id_no_evolution & - & .or. fl_prop%iflag_4_lorentz) then + & .or. fl_prop%flag_lorentz) then call add_phys_name_ctl(magnetic_field, field_ctl) call add_phys_name_ctl(current_density, field_ctl) end if @@ -90,25 +90,25 @@ subroutine add_field_name_4_sph_mhd & call add_phys_name_ctl(div_inertia, field_ctl) ! ! Coriolis flag - if(fl_prop%iflag_4_coriolis) then + if(fl_prop%flag_coriolis) then call add_phys_name_ctl(Coriolis_force, field_ctl) call add_phys_name_ctl(rot_Coriolis_force, field_ctl) call add_phys_name_ctl(div_Coriolis_force, field_ctl) end if ! Lorentz flag - if(fl_prop%iflag_4_lorentz) then + if(fl_prop%flag_lorentz) then call add_phys_name_ctl(Lorentz_force, field_ctl) call add_phys_name_ctl(rot_Lorentz_force, field_ctl) call add_phys_name_ctl(div_Lorentz_force, field_ctl) end if ! thermal buoyancy flag - if(fl_prop%iflag_4_gravity) then + if(fl_prop%flag_thermal_buoyancy) then call add_phys_name_ctl(buoyancy, field_ctl) call add_phys_name_ctl(rot_buoyancy, field_ctl) call add_phys_name_ctl(div_buoyancy, field_ctl) end if ! compositional buoyancy flag - if(fl_prop%iflag_4_composit_buo) then + if(fl_prop%flag_comp_buoyancy) then call add_phys_name_ctl(composite_buoyancy, field_ctl) call add_phys_name_ctl(div_composite_buoyancy, field_ctl) call add_phys_name_ctl(rot_composite_buoyancy, field_ctl) diff --git a/src/Fortran_libraries/MHD_src/IO/bcast_ctl_MHD_model.f90 b/src/Fortran_libraries/MHD_src/IO/bcast_ctl_MHD_model.f90 index 50e84588..3d2eef97 100644 --- a/src/Fortran_libraries/MHD_src/IO/bcast_ctl_MHD_model.f90 +++ b/src/Fortran_libraries/MHD_src/IO/bcast_ctl_MHD_model.f90 @@ -38,6 +38,7 @@ module bcast_ctl_MHD_model private :: bcast_dimless_ctl, bcast_coef_term_ctl private :: bcast_thermal_ctl, bcast_momentum_ctl private :: bcast_induction_ctl + private :: bcast_val_density_ctl, bcast_val_diffuse_ctl ! ! ---------------------------------------------------------------------- ! @@ -72,8 +73,16 @@ subroutine bcast_ctl_data_mhd_model(model_ctl) call bcast_coriolis_ctl(model_ctl%cor_ctl) call bcast_magneto_ctl(model_ctl%mcv_ctl) call bcast_magnetic_scale_ctl(model_ctl%bscale_ctl) +! call bcast_ref_scalar_ctl(model_ctl%reft_ctl) call bcast_ref_scalar_ctl(model_ctl%refc_ctl) +! + call bcast_val_density_ctl(model_ctl%polytrope_c) +! + call bcast_val_diffuse_ctl(model_ctl%val_viscous_c) + call bcast_val_diffuse_ctl(model_ctl%val_mag_diffuse_c) + call bcast_val_diffuse_ctl(model_ctl%val_thermal_diffuse_c) + call bcast_val_diffuse_ctl(model_ctl%val_comp_diffuse_c) ! call calypso_mpi_bcast_character & & (model_ctl%block_name, cast_long(kchara), 0) @@ -201,5 +210,57 @@ subroutine bcast_induction_ctl(induct_ctl) end subroutine bcast_induction_ctl ! ! -------------------------------------------------------------------- +! -------------------------------------------------------------------- +! + subroutine bcast_val_density_ctl(polytrope_c) +! + use t_ctl_data_valuable_density + use transfer_to_long_integers + use calypso_mpi_char + use calypso_mpi_int + use bcast_control_arrays +! + type(val_density_ctl), intent(inout) :: polytrope_c +! + call bcast_ctl_type_c1(polytrope_c%r_variation_ctl) + call bcast_ctl_type_c1(polytrope_c%variation_file_name) +! + call bcast_ctl_type_r2(polytrope_c%bottom_density_ctl) + call bcast_ctl_type_r2(polytrope_c%top_density_ctl) + call bcast_ctl_type_r1(polytrope_c%polytrope_index_ctl) +! + call bcast_ctl_array_r2(polytrope_c%density_list_ctl) +! + call calypso_mpi_bcast_character & + & (polytrope_c%block_name, cast_long(kchara), 0) + call calypso_mpi_bcast_one_int(polytrope_c%i_val_density, 0) +! + end subroutine bcast_val_density_ctl +! +! -------------------------------------------------------------------- +! -------------------------------------------------------------------- +! + subroutine bcast_val_diffuse_ctl(vdiffuse_ctl) +! + use t_ctl_data_valuable_diffuse + use transfer_to_long_integers + use calypso_mpi_char + use calypso_mpi_int + use bcast_control_arrays +! + type(val_diffuse_ctl), intent(inout) :: vdiffuse_ctl +! + call bcast_ctl_type_c1(vdiffuse_ctl%r_variation_ctl) + call bcast_ctl_type_c1(vdiffuse_ctl%variation_file_name) +! + call bcast_ctl_array_r2(vdiffuse_ctl%diffusivity_list_ctl) +! + call calypso_mpi_bcast_character & + & (vdiffuse_ctl%block_name, cast_long(kchara), 0) + call calypso_mpi_bcast_one_int(vdiffuse_ctl%i_val_diffuse, 0) +! + end subroutine bcast_val_diffuse_ctl +! +! -------------------------------------------------------------------- ! end module bcast_ctl_MHD_model diff --git a/src/Fortran_libraries/MHD_src/IO/ctl_data_MHD_model_IO.f90 b/src/Fortran_libraries/MHD_src/IO/ctl_data_MHD_model_IO.f90 index 791282f5..385b3ff2 100644 --- a/src/Fortran_libraries/MHD_src/IO/ctl_data_MHD_model_IO.f90 +++ b/src/Fortran_libraries/MHD_src/IO/ctl_data_MHD_model_IO.f90 @@ -50,6 +50,8 @@ module ctl_data_MHD_model_IO use t_ctl_data_temp_model use t_ctl_data_dimless_numbers use t_ctl_data_MHD_model + use t_ctl_data_valuable_diffuse + use t_ctl_data_valuable_density ! use skip_comment_f ! @@ -96,6 +98,18 @@ module ctl_data_MHD_model_IO & :: hd_temp_def = 'temperature_define' character(len=kchara), parameter, private & & :: hd_comp_def = 'composition_define' +! + character(len=kchara), parameter, private & + & :: hd_polytrope_ctl = 'polytrope_ctl' +! + character(len=kchara), parameter, private & + & :: hd_viscosity_ctl = 'viscosity_ctl' + character(len=kchara), parameter, private & + & :: hd_mag_diffusion_ctl = 'magnetic_diffusion_ctl' + character(len=kchara), parameter, private & + & :: hd_thrm_diffusion_ctl = 'thermal_diffusion_ctl' + character(len=kchara), parameter, private & + & :: hd_comp_diffusion_ctl = 'composition_diffusion_ctl' ! ! ---------------------------------------------------------------------- ! @@ -183,11 +197,22 @@ subroutine init_sph_mhd_model_label(hd_block, model_ctl) & model_ctl%bscale_ctl) call init_temp_model_ctl_label(hd_temp_def, model_ctl%reft_ctl) call init_comp_model_ctl_label(hd_comp_def, model_ctl%refc_ctl) +! + call init_val_density_ctl_label(hd_polytrope_ctl, & + & model_ctl%polytrope_c) +! + call init_val_diffuse_ctl_label(hd_viscosity_ctl, & + & model_ctl%val_viscous_c) + call init_val_diffuse_ctl_label(hd_mag_diffusion_ctl, & + & model_ctl%val_mag_diffuse_c) + call init_val_diffuse_ctl_label(hd_thrm_diffusion_ctl, & + & model_ctl%val_thermal_diffuse_c) + call init_val_diffuse_ctl_label(hd_comp_diffusion_ctl, & + & model_ctl%val_comp_diffuse_c) ! end subroutine init_sph_mhd_model_label ! ! -------------------------------------------------------------------- -! ! subroutine read_sph_mhd_model_items(id_control, model_ctl, c_buf) ! @@ -236,6 +261,21 @@ subroutine read_sph_mhd_model_items(id_control, model_ctl, c_buf) & (id_control, hd_temp_def, model_ctl%reft_ctl, c_buf) call read_comp_model_ctl & & (id_control, hd_comp_def, model_ctl%refc_ctl, c_buf) +! + call read_val_density_ctl_data & + & (id_control, hd_polytrope_ctl, model_ctl%polytrope_c, c_buf) +! + call read_val_diffuse_ctl_data(id_control, hd_viscosity_ctl, & + & model_ctl%val_viscous_c, c_buf) + call read_val_diffuse_ctl_data & + & (id_control, hd_mag_diffusion_ctl, & + & model_ctl%val_mag_diffuse_c, c_buf) + call read_val_diffuse_ctl_data & + & (id_control, hd_thrm_diffusion_ctl, & + & model_ctl%val_thermal_diffuse_c, c_buf) + call read_val_diffuse_ctl_data & + & (id_control, hd_comp_diffusion_ctl, & + & model_ctl%val_comp_diffuse_c, c_buf) ! call read_magneto_cv_ctl & & (id_control, hd_induction_ctl, model_ctl%mcv_ctl, c_buf) @@ -287,6 +327,18 @@ subroutine write_sph_mhd_model_items & & (id_control, hd_temp_def, model_ctl%reft_ctl, level) call write_comp_model_ctl & & (id_control, hd_comp_def, model_ctl%refc_ctl, level) +! + call write_val_density_ctl_data & + & (id_control, model_ctl%polytrope_c, level) +! + call write_val_diffuse_ctl_data & + & (id_control, model_ctl%val_viscous_c, level) + call write_val_diffuse_ctl_data & + & (id_control, model_ctl%val_mag_diffuse_c, level) + call write_val_diffuse_ctl_data & + & (id_control, model_ctl%val_thermal_diffuse_c, level) + call write_val_diffuse_ctl_data & + & (id_control, model_ctl%val_comp_diffuse_c, level) ! end subroutine write_sph_mhd_model_items ! diff --git a/src/Fortran_libraries/MHD_src/IO/init_sph_MHD_elapsed_label.F90 b/src/Fortran_libraries/MHD_src/IO/init_sph_MHD_elapsed_label.F90 index 3b6fa276..25275721 100644 --- a/src/Fortran_libraries/MHD_src/IO/init_sph_MHD_elapsed_label.F90 +++ b/src/Fortran_libraries/MHD_src/IO/init_sph_MHD_elapsed_label.F90 @@ -33,7 +33,6 @@ subroutine set_sph_MHD_elapsed_label use m_elapsed_labels_SEND_RECV use m_elapsed_labels_SPH_TRNS use m_elapsed_labels_4_MHD - use m_elapsed_labels_4_VIZ use m_elapsed_labels_gen_SPH ! use m_work_time_4_sleeve_extend ! @@ -48,7 +47,6 @@ subroutine set_sph_MHD_elapsed_label call elpsed_label_calypso_send_recv ! call elapsed_label_4_Legendre_trans ! - call elpsed_label_4_VIZ call elapsed_label_4_SGS_model ! call elapsed_label_4_ele_comm_tbl ! call elpsed_label_4_sleeve_ext @@ -65,7 +63,6 @@ subroutine reset_elapse_4_init_sph_mhd use m_elapsed_labels_SEND_RECV use m_elapsed_labels_SPH_TRNS use m_elapsed_labels_4_MHD - use m_elapsed_labels_4_VIZ ! ! call reset_elapse_after_init_SPH @@ -76,7 +73,6 @@ subroutine reset_elapse_4_init_sph_mhd call reset_elapse_after_init_SPH_MHD call reset_elapse_after_init_SGS call reset_elapse_after_init_LEG - call reset_elapse_after_init_VIZ ! end subroutine reset_elapse_4_init_sph_mhd ! diff --git a/src/Fortran_libraries/MHD_src/IO/output_viz_file_control.f90 b/src/Fortran_libraries/MHD_src/IO/output_viz_file_control.f90 index 34057268..bb62104b 100644 --- a/src/Fortran_libraries/MHD_src/IO/output_viz_file_control.f90 +++ b/src/Fortran_libraries/MHD_src/IO/output_viz_file_control.f90 @@ -4,6 +4,11 @@ ! programmed by H. Matsui ! modified by H. Matsui on Aug., 2007 ! +!! logical function iflag_viz_output & +!! & (flag_flex_step, i_step_fix, time_d, IO_step) +!! integer(kind = kint) function viz_time_step & +!! & (flag_flex_step, i_step_fix, time_d, IO_step) +!! !! logical function lead_field_data_flag(i_step, MHD_step) !! type(MHD_step_param), intent(in) :: MHD_step !! logical function MHD_viz_routine_flag(flex_p, time_d, viz_step) @@ -66,7 +71,7 @@ logical function MHD_viz_routine_flag(flex_p, time_d, viz_step) type(VIZ_step_params), intent(inout) :: viz_step ! ! - if(flex_p%iflag_flexible_step .eq. iflag_flex_step) then + if(time_d%flag_flex_step) then MHD_viz_routine_flag = iflag_vizs_w_flex_step(time_d, viz_step) else MHD_viz_routine_flag & @@ -86,7 +91,7 @@ subroutine MHD_viz_routine_step(flex_p, time_d, viz_step) type(VIZ_step_params), intent(inout) :: viz_step ! ! - if(flex_p%iflag_flexible_step .eq. iflag_flex_step) then + if(time_d%flag_flex_step) then call istep_viz_w_flex_dt(time_d, viz_step) else call istep_viz_w_fix_dt(flex_p%istep_max_dt, viz_step) @@ -98,19 +103,19 @@ end subroutine MHD_viz_routine_step !----------------------------------------------------------------------- ! logical function iflag_viz_output & - & (iflag_flexible_step, i_step_fix, time_d, IO_step) + & (flag_flex_step, i_step_fix, time_d, IO_step) ! use t_time_data use t_flex_delta_t_parameter ! - integer(kind = kint), intent(in) :: iflag_flexible_step + logical, intent(in) :: flag_flex_step integer(kind = kint), intent(in) :: i_step_fix type(time_data), intent(in) :: time_d type(IO_step_param), intent(in) :: IO_step ! ! iflag_viz_output = .FALSE. - if(iflag_flexible_step .eq. iflag_flex_step) then + if(flag_flex_step) then iflag_viz_output = iflag_viz_flex_step(time_d, IO_step) else iflag_viz_output = output_IO_flag(i_step_fix, IO_step) @@ -121,18 +126,18 @@ end function iflag_viz_output ! ----------------------------------------------------------------------- ! integer(kind = kint) function viz_time_step & - & (iflag_flexible_step, i_step_fix, time_d, IO_step) + & (flag_flex_step, i_step_fix, time_d, IO_step) ! use t_time_data use t_flex_delta_t_parameter ! - integer(kind = kint), intent(in) :: iflag_flexible_step + logical, intent(in) :: flag_flex_step integer(kind = kint), intent(in) :: i_step_fix type(time_data), intent(in) :: time_d type(IO_step_param), intent(in) :: IO_step ! ! - if(iflag_flexible_step .eq. iflag_flex_step) then + if(flag_flex_step) then viz_time_step = istep_file_w_flex_dt(time_d, IO_step) else viz_time_step = istep_file_w_fix_dt(i_step_fix, IO_step) diff --git a/src/Fortran_libraries/MHD_src/IO/set_control_4_MHD_coefs.f90 b/src/Fortran_libraries/MHD_src/IO/set_control_4_MHD_coefs.f90 index 48ce46cf..71d51aee 100644 --- a/src/Fortran_libraries/MHD_src/IO/set_control_4_MHD_coefs.f90 +++ b/src/Fortran_libraries/MHD_src/IO/set_control_4_MHD_coefs.f90 @@ -145,8 +145,8 @@ subroutine set_coefs_4_momentum_eq(fl_prop, mom_ctl, & coefs_v_diffuse%num = mom_ctl%coef_4_viscous%num end if ! - if((fl_prop%iflag_4_gravity .eqv. .FALSE.) & - & .and. (fl_prop%iflag_4_filter_gravity .eqv. .FALSE.)) then + if((fl_prop%flag_thermal_buoyancy .eqv. .FALSE.) & + & .and. (fl_prop%flag_filter_gravity .eqv. .FALSE.)) then coefs_buoyancy%num = 0 else if (mom_ctl%coef_4_termal_buo%icou .eq. 0) then @@ -157,8 +157,8 @@ subroutine set_coefs_4_momentum_eq(fl_prop, mom_ctl, & end if end if ! - if((fl_prop%iflag_4_composit_buo .eqv. .FALSE.) & - & .and. (fl_prop%iflag_4_filter_comp_buo .eqv. .FALSE.)) then + if((fl_prop%flag_comp_buoyancy .eqv. .FALSE.) & + & .and. (fl_prop%flag_filter_comp_buo .eqv. .FALSE.)) then coefs_comp_buo%num = 0 else if(mom_ctl%coef_4_comp_buo%icou .eq. 0) then @@ -169,7 +169,7 @@ subroutine set_coefs_4_momentum_eq(fl_prop, mom_ctl, & end if end if ! - if (fl_prop%iflag_4_coriolis .eqv. .FALSE.) then + if (fl_prop%flag_coriolis .eqv. .FALSE.) then coefs_Coriolis%num = 0 else if(mom_ctl%coef_4_Coriolis%icou .eq. 0) then @@ -180,7 +180,7 @@ subroutine set_coefs_4_momentum_eq(fl_prop, mom_ctl, & end if end if ! - if (fl_prop%iflag_4_lorentz .eqv. .FALSE.) then + if (fl_prop%flag_lorentz .eqv. .FALSE.) then coefs_Lorentz%num = 0 else if(mom_ctl%coef_4_Lorentz%icou .eq. 0) then diff --git a/src/Fortran_libraries/MHD_src/IO/set_control_4_force.f90 b/src/Fortran_libraries/MHD_src/IO/set_control_4_force.f90 index e43873cb..30ae75bf 100644 --- a/src/Fortran_libraries/MHD_src/IO/set_control_4_force.f90 +++ b/src/Fortran_libraries/MHD_src/IO/set_control_4_force.f90 @@ -7,12 +7,8 @@ !> @brief Set parameters for forces from control data !! !!@verbatim -!! subroutine s_set_control_4_force & -!! & (frc_ctl, g_ctl, cor_ctl, mcv_ctl, MHD_prop) -!! type(forces_control), intent(in) :: frc_ctl -!! type(gravity_control), intent(in) :: g_ctl -!! type(coriolis_control), intent(in) :: cor_ctl -!! type(magneto_convection_control), intent(in) :: mcv_ctl +!! subroutine s_set_control_4_force(model_ctl, MHD_prop) +!! type(mhd_model_control), intent(in) :: model_ctl !! type(MHD_evolution_param), intent(inout) :: MHD_prop !!@endverbatim ! @@ -35,34 +31,27 @@ module set_control_4_force ! ! ----------------------------------------------------------------------- ! - subroutine s_set_control_4_force & - & (frc_ctl, g_ctl, cor_ctl, mcv_ctl, MHD_prop) + subroutine s_set_control_4_force(model_ctl, MHD_prop) ! use t_control_parameter - use t_ctl_data_mhd_forces - use t_ctl_data_mhd_magne - use t_ctl_data_gravity - use t_ctl_data_coriolis_force + use t_ctl_data_MHD_model use skip_comment_f ! - type(forces_control), intent(in) :: frc_ctl - type(gravity_control), intent(in) :: g_ctl - type(coriolis_control), intent(in) :: cor_ctl - type(magneto_convection_control), intent(in) :: mcv_ctl -! + type(mhd_model_control), intent(in) :: model_ctl type(MHD_evolution_param), intent(inout) :: MHD_prop ! ! - call set_control_force_flags(frc_ctl, MHD_prop%fl_prop) + call set_control_force_flags(model_ctl%frc_ctl, MHD_prop%fl_prop) ! ! direction of gravity - call set_control_4_gravity(g_ctl, MHD_prop%fl_prop) + call set_control_4_gravity(model_ctl%g_ctl, MHD_prop%fl_prop) ! ! Set Corilis force settings - call set_control_4_Coriolis_force(cor_ctl, MHD_prop%fl_prop) + call set_control_4_Coriolis_force(model_ctl%cor_ctl, & + & MHD_prop%fl_prop) ! ! setting for external mangnetic field - call set_control_4_induction(mcv_ctl, MHD_prop%cd_prop) + call set_control_4_induction(model_ctl%mcv_ctl, MHD_prop%cd_prop) ! end subroutine s_set_control_4_force ! @@ -83,19 +72,19 @@ subroutine set_control_force_flags(frc_ctl, fl_prop) character(len=kchara) :: tmpchara ! ! - fl_prop%iflag_4_inertia = .TRUE. - fl_prop%iflag_4_gravity = .FALSE. - fl_prop%iflag_4_coriolis = .FALSE. - fl_prop%iflag_4_lorentz = .FALSE. - fl_prop%iflag_4_composit_buo = .FALSE. + fl_prop%flag_inertia = .TRUE. + fl_prop%flag_thermal_buoyancy = .FALSE. + fl_prop%flag_coriolis = .FALSE. + fl_prop%flag_lorentz = .FALSE. + fl_prop%flag_comp_buoyancy = .FALSE. ! - fl_prop%iflag_4_filter_gravity = .FALSE. - fl_prop%iflag_4_filter_comp_buo = .FALSE. - fl_prop%iflag_4_filter_lorentz = .FALSE. + fl_prop%flag_filter_gravity = .FALSE. + fl_prop%flag_filter_comp_buo = .FALSE. + fl_prop%flag_filter_lorentz = .FALSE. ! if (fl_prop%iflag_scheme .eq. id_no_evolution) then fl_prop%num_force = 0 - fl_prop%iflag_4_inertia = .FALSE. + fl_prop%flag_inertia = .FALSE. else if (frc_ctl%force_names%icou .gt. 0) then fl_prop%num_force = frc_ctl%force_names%num @@ -116,34 +105,34 @@ subroutine set_control_force_flags(frc_ctl, fl_prop) & .or. cmp_no_case(tmpchara, gravity_e1) & & .or. cmp_no_case(tmpchara, gravity_e2) & & .or. cmp_no_case(tmpchara, gravity_e5) & - & ) fl_prop%iflag_4_gravity = .TRUE. + & ) fl_prop%flag_thermal_buoyancy = .TRUE. ! if( cmp_no_case(tmpchara, comp_gravity_label) & & .or. cmp_no_case(tmpchara, comp_gravity_e1) & & .or. cmp_no_case(tmpchara, comp_gravity_e5) & & .or. cmp_no_case(tmpchara, comp_gravity_e6) & - & ) fl_prop%iflag_4_composit_buo = .TRUE. + & ) fl_prop%flag_comp_buoyancy = .TRUE. ! if( cmp_no_case(tmpchara, Filtered_gravity_label) & & .or. cmp_no_case(tmpchara, Filtered_gravity_e1) & - & ) fl_prop%iflag_4_filter_gravity = .TRUE. + & ) fl_prop%flag_filter_gravity = .TRUE. ! if( cmp_no_case(tmpchara, Filtered_comp_gravity_label) & & .or. cmp_no_case(tmpchara, Filtered_comp_gravity_e1) & - & ) fl_prop%iflag_4_filter_comp_buo = .TRUE. + & ) fl_prop%flag_filter_comp_buo = .TRUE. ! if (cmp_no_case(tmpchara, coriolis_e1) & - & ) fl_prop%iflag_4_coriolis = .TRUE. + & ) fl_prop%flag_coriolis = .TRUE. ! if(cmp_no_case(tmpchara, hd_filtered_inertia)) then - fl_prop%iflag_4_filter_inertia = .TRUE. - fl_prop%iflag_4_inertia = .FALSE. + fl_prop%flag_filter_inertia = .TRUE. + fl_prop%flag_inertia = .FALSE. end if ! if(cmp_no_case(tmpchara, lorentz_label)) then - fl_prop%iflag_4_lorentz = .TRUE. + fl_prop%flag_lorentz = .TRUE. else if(cmp_no_case(tmpchara, hd_filtered_Lorentz)) then - fl_prop%iflag_4_filter_lorentz = .TRUE. + fl_prop%flag_filter_lorentz = .TRUE. end if ! end do @@ -177,10 +166,10 @@ subroutine set_control_4_gravity(g_ctl, fl_prop) ! direction of gravity ! fl_prop%i_grav = iflag_no_gravity - if( fl_prop%iflag_4_gravity & - & .or. fl_prop%iflag_4_composit_buo & - & .or. fl_prop%iflag_4_filter_gravity & - & .or. fl_prop%iflag_4_filter_comp_buo) then + if( fl_prop%flag_thermal_buoyancy & + & .or. fl_prop%flag_comp_buoyancy & + & .or. fl_prop%flag_filter_gravity & + & .or. fl_prop%flag_filter_comp_buo) then if(g_ctl%FEM_gravity_model%iflag .gt. 0 & & .and. cmp_no_case(g_ctl%FEM_gravity_model%charavalue,'node') & & .and. fl_prop%iflag_scheme .ne. id_Crank_nicolson_cmass) then @@ -250,7 +239,7 @@ subroutine set_control_4_Coriolis_force(cor_ctl, fl_prop) fl_prop%sys_rot(1:2) = zero fl_prop%sys_rot(3) = one ! - if(fl_prop%iflag_4_coriolis .eqv. .FALSE.) return + if(fl_prop%flag_coriolis .eqv. .FALSE.) return if(cor_ctl%FEM_coriolis_model%iflag .gt. 0 & & .and. cmp_no_case(cor_ctl%FEM_coriolis_model%charavalue,'node') & & .and. fl_prop%iflag_scheme .ne. id_Crank_nicolson_cmass) then @@ -258,7 +247,7 @@ subroutine set_control_4_Coriolis_force(cor_ctl, fl_prop) end if ! if(fl_prop%iflag_scheme .gt. id_Crank_nicolson & - & .and. fl_prop%iflag_4_coriolis & + & .and. fl_prop%flag_coriolis & & .and. cor_ctl%FEM_coriolis_implicit%iflag .gt. 0 & & .and. yes_flag(cor_ctl%FEM_coriolis_implicit%charavalue)) then fl_prop%iflag_coriolis_implicit = .TRUE. @@ -276,8 +265,8 @@ subroutine set_control_4_Coriolis_force(cor_ctl, fl_prop) end if ! if (iflag_debug .ge. iflag_routine_msg) then - write(*,*) 'iflag_4_coriolis', fl_prop%iflag_4_coriolis - if(fl_prop%iflag_4_coriolis) then + write(*,*) 'flag_coriolis', fl_prop%flag_coriolis + if(fl_prop%flag_coriolis) then write(*,'(a, 1p3E25.15e3)') 'rotation:', fl_prop%sys_rot(1:3) end if end if diff --git a/src/Fortran_libraries/MHD_src/IO/sph_mhd_rst_IO_control.f90 b/src/Fortran_libraries/MHD_src/IO/sph_mhd_rst_IO_control.f90 index a5750a98..500422c5 100644 --- a/src/Fortran_libraries/MHD_src/IO/sph_mhd_rst_IO_control.f90 +++ b/src/Fortran_libraries/MHD_src/IO/sph_mhd_rst_IO_control.f90 @@ -16,8 +16,9 @@ !! type(field_IO), intent(in) :: sph_fst_IO !! !! subroutine read_alloc_sph_restart_data & -!! & (fst_file_IO, init_d, rj_fld, rst_step) -!! type(time_data), intent(inout) :: init_d +!! & (fst_file_IO, init_d, time_d, rj_fld, rst_step) +!! type(time_data), intent(in) :: init_d +!! type(time_data), intent(inout) :: time_d !! type(phys_data), intent(inout) :: rj_fld !! type(IO_step_param), intent(inout) :: rst_step !! @@ -67,9 +68,6 @@ module sph_mhd_rst_IO_control ! implicit none ! -! - type(time_data), save, private :: sph_time_IO -! ! ----------------------------------------------------------------------- ! contains @@ -88,6 +86,7 @@ subroutine output_sph_restart_control(i_step, fst_file_IO, & type(IO_step_param), intent(in) :: rst_step type(field_IO), intent(inout) :: sph_fst_IO ! + type(time_data) :: sph_time_IO integer(kind = kint) :: istep_rst ! ! @@ -105,27 +104,29 @@ end subroutine output_sph_restart_control ! ----------------------------------------------------------------------- ! subroutine read_alloc_sph_restart_data & - & (fst_file_IO, init_d, rj_fld, rst_step) + & (fst_file_IO, init_d, time_d, rj_fld, rst_step) ! use set_sph_restart_IO ! type(field_IO_params), intent(in) :: fst_file_IO + type(time_data), intent(in) :: init_d ! - type(time_data), intent(inout) :: init_d + type(time_data), intent(inout) :: time_d type(phys_data), intent(inout) :: rj_fld type(IO_step_param), intent(inout) :: rst_step ! integer(kind = kint) :: istep_rst + type(time_data) :: rst_file_time_IO type(field_IO) :: sph_fst_IO ! ! istep_rst = set_IO_step(init_d%i_time_step, rst_step) ! call sel_read_alloc_step_SPH_file(nprocs, my_rank, & - & istep_rst, fst_file_IO, sph_time_IO, sph_fst_IO) + & istep_rst, fst_file_IO, rst_file_time_IO, sph_fst_IO) ! call set_sph_restart_from_IO(sph_fst_IO, rj_fld) - call copy_time_step_data(sph_time_IO, init_d) + call copy_time_step_data(rst_file_time_IO, time_d) ! call dealloc_phys_data_IO(sph_fst_IO) call dealloc_phys_name_IO(sph_fst_IO) @@ -179,15 +180,16 @@ subroutine read_alloc_sph_rst_4_snap(i_step, rj_file_param, & type(time_data), intent(inout) :: time_d type(sph_radial_interpolate), intent(inout) :: r_itp ! + type(time_data) :: rst_file_time_IO type(field_IO) :: sph_fst_IO integer(kind = kint) :: istep_rst ! ! istep_rst = set_IO_step(i_step, rst_step) call sel_read_alloc_step_SPH_file(nprocs, my_rank, & - & istep_rst, fst_file_IO, sph_time_IO, sph_fst_IO) + & istep_rst, fst_file_IO, rst_file_time_IO, sph_fst_IO) ! - call copy_time_step_data(sph_time_IO, time_d) + call copy_time_step_data(rst_file_time_IO, time_d) ! if(rj_file_param%iflag_IO .eq. 0) then if (iflag_debug.gt.0) write(*,*) 'set_sph_restart_from_IO' @@ -218,6 +220,7 @@ subroutine output_spectr_4_snap(i_step, time_d, & integer(kind = kint), intent(in) :: i_step type(IO_step_param), intent(in) :: ucd_step ! + type(time_data) :: sph_time_IO type(field_IO) :: sph_out_IO integer(kind = kint) :: istep_udt ! @@ -268,15 +271,16 @@ subroutine read_alloc_sph_spectr & type(phys_data), intent(inout) :: rj_fld type(sph_radial_interpolate), intent(inout) :: r_itp ! + type(time_data) :: rst_file_time_IO type(field_IO) :: sph_out_IO integer(kind = kint) :: istep_udt ! ! istep_udt = set_IO_step(i_step, ucd_step) call sel_read_alloc_step_SPH_file(nprocs, my_rank, & - & istep_udt, sph_file_IO, sph_time_IO, sph_out_IO) + & istep_udt, sph_file_IO, rst_file_time_IO, sph_out_IO) ! - call copy_time_step_data(sph_time_IO, time_d) + call copy_time_step_data(rst_file_time_IO, time_d) ! if(rj_file_param%iflag_IO .eq. 0) then if (iflag_debug.gt.0) write(*,*) 'set_rj_phys_data_from_IO' diff --git a/src/Fortran_libraries/MHD_src/IO/t_ctl_data_MHD_model.f90 b/src/Fortran_libraries/MHD_src/IO/t_ctl_data_MHD_model.f90 index fda56656..91dbdcfc 100644 --- a/src/Fortran_libraries/MHD_src/IO/t_ctl_data_MHD_model.f90 +++ b/src/Fortran_libraries/MHD_src/IO/t_ctl_data_MHD_model.f90 @@ -34,6 +34,8 @@ module t_ctl_data_MHD_model use t_ctl_data_magnetic_scale use t_ctl_data_temp_model use t_ctl_data_dimless_numbers + use t_ctl_data_valuable_diffuse + use t_ctl_data_valuable_density ! use skip_comment_f ! @@ -76,6 +78,18 @@ module t_ctl_data_MHD_model type(reference_temperature_ctl) :: reft_ctl !> Structures for reference composition type(reference_temperature_ctl) :: refc_ctl +! +!> Block for compositional diffusivity definision + type(val_density_ctl) :: polytrope_c +! +!> Block for compositional diffusivity definision + type(val_diffuse_ctl) :: val_viscous_c +!> Block for compositional diffusivity definision + type(val_diffuse_ctl) :: val_mag_diffuse_c +!> Block for compositional diffusivity definision + type(val_diffuse_ctl) :: val_thermal_diffuse_c +!> Block for compositional diffusivity definision + type(val_diffuse_ctl) :: val_comp_diffuse_c ! integer (kind=kint) :: i_model = 0 end type mhd_model_control @@ -105,6 +119,14 @@ subroutine dealloc_sph_mhd_model(model_ctl) call dealloc_coriolis_ctl(model_ctl%cor_ctl) call dealloc_magneto_ctl(model_ctl%mcv_ctl) call dealloc_magnetic_scale_ctl(model_ctl%bscale_ctl) +! + call dealloc_val_density_ctl_data(model_ctl%polytrope_c) +! + call dealloc_val_diffuse_ctl_data(model_ctl%val_viscous_c) + call dealloc_val_diffuse_ctl_data(model_ctl%val_mag_diffuse_c) + call dealloc_val_diffuse_ctl_data & + & (model_ctl%val_thermal_diffuse_c) + call dealloc_val_diffuse_ctl_data(model_ctl%val_comp_diffuse_c) ! model_ctl%i_model = 0 ! diff --git a/src/Fortran_libraries/MHD_src/IO/t_ctl_data_valuable_density.f90 b/src/Fortran_libraries/MHD_src/IO/t_ctl_data_valuable_density.f90 new file mode 100644 index 00000000..06b81049 --- /dev/null +++ b/src/Fortran_libraries/MHD_src/IO/t_ctl_data_valuable_density.f90 @@ -0,0 +1,275 @@ +!>@file t_ctl_data_valuable_density.f90 +!!@brief module t_ctl_data_valuable_density +!! +!!@author H. Matsui +!!@date Programmed in 2006 +! +!> @brief Control data for valuable density +!! +!!@verbatim +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! subroutine init_val_density_ctl_label(hd_block, polytrope_c) +!! subroutine read_val_density_ctl_data & +!! & (id_control, hd_block, polytrope_c, c_buf) +!! integer(kind = kint), intent(in) :: id_control +!! character(len = kchara), intent(in) :: hd_block +!! ` type(val_density_ctl), intent(inout) :: polytrope_c +!! type(buffer_for_control), intent(inout) :: c_buf +!! subroutine write_val_density_ctl_data & +!! & (id_control, polytrope_c, level) +!! integer(kind = kint), intent(in) :: id_control +!! type(val_density_ctl), intent(in) :: polytrope_c +!! integer(kind = kint), intent(inout) :: level +!! +!! subroutine dealloc_val_density_ctl_data(polytrope_c) +!! type(val_density_ctl), intent(inout) :: polytrope_c +!! +!! subroutine dup_val_density_ctl_data(polytrope_c, & +!! & new_polytrope_c) +!! type(val_density_ctl), intent(in) :: polytrope_c +!! type(val_density_ctl), intent(inout) :: new_polytrope_c +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! begin polytrope_ctl +!! density_variation_ctl ON +!! density_file_name 'density_variation' +!! +!! bottom_density_ctl 0.53846 2.0 +!! top_density_ctl 1.53846 1.0 +!! polytrope_index_ctl 1.0 +!! +!! array density_list_ctl +!! density_list_ctl 0.53846 1.2 +!! density_list_ctl 1.03846 1.05 +!! density_list_ctl 1.53846 1.0 +!! end array density_list_ctl +!! end polytrope_ctl +!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!@endverbatim +! + module t_ctl_data_valuable_density +! + use m_precision +! + use m_machine_parameter + use t_read_control_elements + use t_control_array_character + use t_control_array_real + use t_control_array_real2 + use skip_comment_f +! + implicit none +! +! +!> Block for polytorope definision + type val_density_ctl +!> Block name + character(len=kchara) :: block_name = 'polytrope_ctl' +!> Density variation flag + type(read_character_item) :: r_variation_ctl +!> Density variation data file name + type(read_character_item) :: variation_file_name +! +!> Botton radius and density to define + type(read_real2_item) :: bottom_density_ctl +!> Top radius and density to define + type(read_real2_item) :: top_density_ctl +!> Polytrope index + type(read_real_item) :: polytrope_index_ctl +! +!> list of density + type(ctl_array_r2) :: density_list_ctl +! +!> loaded flag + integer (kind=kint) :: i_val_density = 0 + end type val_density_ctl +! +! 4th level for masking +! + character(len=kchara), parameter, private & + & :: hd_r_variation = 'density_variation_ctl' + character(len=kchara), parameter, private & + & :: hd_val_file_name = 'density_file_name' +! + character(len=kchara), parameter, private & + & :: hd_bottom_density = 'bottom_density_ctl' + character(len=kchara), parameter, private & + & :: hd_top_density = 'top_density_ctl' + character(len=kchara), parameter, private & + & :: hd_polytrope_index = 'polytrope_index_ctl' +! + character(len=kchara), parameter, private & + & :: hd_density_list = 'density_list_ctl' +! +! --------------------------------------------------------------------- +! + contains +! +! --------------------------------------------------------------------- +! + subroutine read_val_density_ctl_data & + & (id_control, hd_block, polytrope_c, c_buf) +! + integer(kind = kint), intent(in) :: id_control + character(len = kchara), intent(in) :: hd_block +! + type(val_density_ctl), intent(inout) :: polytrope_c + type(buffer_for_control), intent(inout) :: c_buf +! +! + if(check_begin_flag(c_buf, hd_block) .eqv. .FALSE.) return + if(polytrope_c%i_val_density .gt. 0) return + do + call load_one_line_from_control(id_control, hd_block, c_buf) + if(c_buf%iend .gt. 0) exit + if(check_end_flag(c_buf, hd_block)) exit +! +! + call read_chara_ctl_type(c_buf, hd_r_variation, & + & polytrope_c%r_variation_ctl) + call read_chara_ctl_type(c_buf, hd_val_file_name, & + & polytrope_c%variation_file_name) +! + call read_real2_ctl_type(c_buf, hd_bottom_density, & + & polytrope_c%bottom_density_ctl) + call read_real2_ctl_type(c_buf, hd_top_density, & + & polytrope_c%top_density_ctl) + call read_real_ctl_type(c_buf, hd_polytrope_index, & + & polytrope_c%polytrope_index_ctl) +! + call read_control_array_r2(id_control, hd_density_list, & + & polytrope_c%density_list_ctl, c_buf) + end do + polytrope_c%i_val_density = 1 +! + end subroutine read_val_density_ctl_data +! +! --------------------------------------------------------------------- +! + subroutine write_val_density_ctl_data & + & (id_control, polytrope_c, level) +! + use write_control_elements +! + integer(kind = kint), intent(in) :: id_control + type(val_density_ctl), intent(in) :: polytrope_c +! + integer(kind = kint), intent(inout) :: level +! + integer(kind = kint) :: maxlen = 0 +! +! + if(polytrope_c%i_val_density .le. 0) return +! + maxlen = len_trim(hd_r_variation) + maxlen = max(maxlen, len_trim(hd_val_file_name)) + maxlen = max(maxlen, len_trim(hd_bottom_density)) + maxlen = max(maxlen, len_trim(hd_top_density)) + maxlen = max(maxlen, len_trim(hd_polytrope_index)) +! + level = write_begin_flag_for_ctl(id_control, level, & + & polytrope_c%block_name) + call write_chara_ctl_type(id_control, level, maxlen, & + & polytrope_c%r_variation_ctl) + call write_chara_ctl_type(id_control, level, maxlen, & + & polytrope_c%variation_file_name) +! + call write_real2_ctl_type(id_control, level, maxlen, & + & polytrope_c%bottom_density_ctl) + call write_real2_ctl_type(id_control, level, maxlen, & + & polytrope_c%top_density_ctl) + call write_real_ctl_type(id_control, level, maxlen, & + & polytrope_c%polytrope_index_ctl) +! + call write_control_array_r2(id_control, level, & + & polytrope_c%density_list_ctl) + level = write_end_flag_for_ctl(id_control, level, & + & polytrope_c%block_name) +! + end subroutine write_val_density_ctl_data +! +! --------------------------------------------------------------------- +! + subroutine init_val_density_ctl_label(hd_block, polytrope_c) +! + character(len = kchara), intent(in) :: hd_block + type(val_density_ctl), intent(inout) :: polytrope_c +! +! + polytrope_c%block_name = hd_block +! + call init_chara_ctl_item_label & + & (hd_r_variation, polytrope_c%r_variation_ctl) + call init_chara_ctl_item_label & + & (hd_val_file_name, polytrope_c%variation_file_name) +! + call init_real2_ctl_item_label & + & (hd_bottom_density, polytrope_c%bottom_density_ctl) + call init_real2_ctl_item_label & + & (hd_top_density, polytrope_c%top_density_ctl) + call init_real_ctl_item_label & + & (hd_polytrope_index, polytrope_c%polytrope_index_ctl) +! + call init_r2_ctl_array_label & + & (hd_density_list, polytrope_c%density_list_ctl) +! + end subroutine init_val_density_ctl_label +! +! --------------------------------------------------------------------- +! --------------------------------------------------------------------- +! + subroutine dealloc_val_density_ctl_data(polytrope_c) +! + type(val_density_ctl), intent(inout) :: polytrope_c +! +! + polytrope_c%r_variation_ctl%iflag = 0 +! + polytrope_c%variation_file_name%iflag = 0 +! + polytrope_c%bottom_density_ctl%iflag = 0 + polytrope_c%top_density_ctl%iflag = 0 + polytrope_c%polytrope_index_ctl%iflag = 0 +! + call dealloc_control_array_r2 & + & (polytrope_c%density_list_ctl) + polytrope_c%density_list_ctl%num = 0 + polytrope_c%density_list_ctl%icou = 0 +! + polytrope_c%i_val_density = 0 +! + end subroutine dealloc_val_density_ctl_data +! +! --------------------------------------------------------------------- +! --------------------------------------------------------------------- +! + subroutine dup_val_density_ctl_data(polytrope_c, & + & new_polytrope_c) +! + type(val_density_ctl), intent(in) :: polytrope_c + type(val_density_ctl), intent(inout) :: new_polytrope_c +! +! + new_polytrope_c%block_name = polytrope_c%block_name + new_polytrope_c%i_val_density = polytrope_c%i_val_density +! + call copy_chara_ctl(polytrope_c%r_variation_ctl, & + & new_polytrope_c%r_variation_ctl) + call copy_chara_ctl(polytrope_c%variation_file_name, & + & new_polytrope_c%variation_file_name) +! + call copy_real2_ctl(polytrope_c%bottom_density_ctl, & + & new_polytrope_c%bottom_density_ctl) + call copy_real2_ctl(polytrope_c%top_density_ctl, & + & new_polytrope_c%top_density_ctl) + call copy_real_ctl(polytrope_c%polytrope_index_ctl, & + & new_polytrope_c%polytrope_index_ctl) +! + call dup_control_array_r2(polytrope_c%density_list_ctl, & + & new_polytrope_c%density_list_ctl) +! + end subroutine dup_val_density_ctl_data +! +! --------------------------------------------------------------------- +! + end module t_ctl_data_valuable_density diff --git a/src/Fortran_libraries/MHD_src/IO/t_ctl_data_valuable_diffuse.f90 b/src/Fortran_libraries/MHD_src/IO/t_ctl_data_valuable_diffuse.f90 new file mode 100644 index 00000000..1b87444b --- /dev/null +++ b/src/Fortran_libraries/MHD_src/IO/t_ctl_data_valuable_diffuse.f90 @@ -0,0 +1,218 @@ +!>@file t_ctl_data_valuable_diffuse.f90 +!!@brief module t_ctl_data_valuable_diffuse +!! +!!@author H. Matsui +!!@date Programmed in 2006 +! +!> @brief Control data for valuable diffusivity +!! +!!@verbatim +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! subroutine init_val_diffuse_ctl_label(hd_block, vdiffuse_ctl) +!! subroutine read_val_diffuse_ctl_data & +!! & (id_control, hd_block, vdiffuse_ctl, c_buf) +!! integer(kind = kint), intent(in) :: id_control +!! character(len = kchara), intent(in) :: hd_block +!! ` type(val_diffuse_ctl), intent(inout) :: vdiffuse_ctl +!! type(buffer_for_control), intent(inout) :: c_buf +!! subroutine write_val_diffuse_ctl_data & +!! & (id_control, vdiffuse_ctl, level) +!! integer(kind = kint), intent(in) :: id_control +!! type(val_diffuse_ctl), intent(in) :: vdiffuse_ctl +!! integer(kind = kint), intent(inout) :: level +!! +!! subroutine dealloc_val_diffuse_ctl_data(vdiffuse_ctl) +!! type(val_diffuse_ctl), intent(inout) :: vdiffuse_ctl +!! +!! subroutine dup_val_diffuse_ctl_data(vdiffuse_c, new_vdiffuse_c) +!! type(val_diffuse_ctl), intent(in) :: vdiffuse_c +!! type(val_diffuse_ctl), intent(inout) :: new_vdiffuse_c +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! begin viscosity_ctl +!! radial_variation_ctl ON +!! variation_file_name 'viscous_variation.dat' +!!! +!! array diffusivity_list_ctl +!! diffusivity_list_ctl 0.53846 1.2 +!! diffusivity_list_ctl 1.03846 1.05 +!! diffusivity_list_ctl 1.53846 1.0 +!! end array diffusivity_list_ctl +!! end viscosity_ctl +!! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!!@endverbatim +! + module t_ctl_data_valuable_diffuse +! + use m_precision +! + use m_machine_parameter + use t_read_control_elements + use t_control_array_character + use t_control_array_real2 + use skip_comment_f +! + implicit none +! +! +!> Block for diffusivity definision + type val_diffuse_ctl +!> Block name + character(len=kchara) :: block_name = 'diffusion_control' +! +!> Diffusivity variation flag + type(read_character_item) :: r_variation_ctl +!> Diffusivity variation data file name + type(read_character_item) :: variation_file_name +!> list of diffusivity + type(ctl_array_r2) :: diffusivity_list_ctl +! +!> loaded flag + integer (kind=kint) :: i_val_diffuse = 0 + end type val_diffuse_ctl +! +! 4th level for masking +! + character(len=kchara), parameter, private & + & :: hd_r_variation = 'radial_variation_ctl' + character(len=kchara), parameter, private & + & :: hd_val_file_name = 'variation_file_name' +! + character(len=kchara), parameter, private & + & :: hd_diffusivity_list = 'diffusivity_list_ctl' +! +! --------------------------------------------------------------------- +! + contains +! +! --------------------------------------------------------------------- +! + subroutine read_val_diffuse_ctl_data & + & (id_control, hd_block, vdiffuse_ctl, c_buf) +! + integer(kind = kint), intent(in) :: id_control + character(len = kchara), intent(in) :: hd_block +! + type(val_diffuse_ctl), intent(inout) :: vdiffuse_ctl + type(buffer_for_control), intent(inout) :: c_buf +! +! + if(check_begin_flag(c_buf, hd_block) .eqv. .FALSE.) return + if(vdiffuse_ctl%i_val_diffuse .gt. 0) return + do + call load_one_line_from_control(id_control, hd_block, c_buf) + if(c_buf%iend .gt. 0) exit + if(check_end_flag(c_buf, hd_block)) exit +! +! + call read_chara_ctl_type(c_buf, hd_r_variation, & + & vdiffuse_ctl%r_variation_ctl) + call read_chara_ctl_type(c_buf, hd_val_file_name, & + & vdiffuse_ctl%variation_file_name) +! + call read_control_array_r2(id_control, hd_diffusivity_list, & + & vdiffuse_ctl%diffusivity_list_ctl, c_buf) + end do + vdiffuse_ctl%i_val_diffuse = 1 +! + end subroutine read_val_diffuse_ctl_data +! +! --------------------------------------------------------------------- +! + subroutine write_val_diffuse_ctl_data & + & (id_control, vdiffuse_ctl, level) +! + use write_control_elements +! + integer(kind = kint), intent(in) :: id_control + type(val_diffuse_ctl), intent(in) :: vdiffuse_ctl +! + integer(kind = kint), intent(inout) :: level +! + integer(kind = kint) :: maxlen = 0 +! +! + if(vdiffuse_ctl%i_val_diffuse .le. 0) return +! + maxlen = len_trim(hd_r_variation) + maxlen = max(maxlen, len_trim(hd_val_file_name)) +! + level = write_begin_flag_for_ctl(id_control, level, & + & vdiffuse_ctl%block_name) + call write_chara_ctl_type(id_control, level, maxlen, & + & vdiffuse_ctl%r_variation_ctl) + call write_chara_ctl_type(id_control, level, maxlen, & + & vdiffuse_ctl%variation_file_name) +! + call write_control_array_r2(id_control, level, & + & vdiffuse_ctl%diffusivity_list_ctl) + level = write_end_flag_for_ctl(id_control, level, & + & vdiffuse_ctl%block_name) +! + end subroutine write_val_diffuse_ctl_data +! +! --------------------------------------------------------------------- +! + subroutine init_val_diffuse_ctl_label(hd_block, vdiffuse_ctl) +! + character(len = kchara), intent(in) :: hd_block + type(val_diffuse_ctl), intent(inout) :: vdiffuse_ctl +! +! + vdiffuse_ctl%block_name = hd_block +! + call init_chara_ctl_item_label & + & (hd_r_variation, vdiffuse_ctl%r_variation_ctl) + call init_chara_ctl_item_label & + & (hd_val_file_name, vdiffuse_ctl%variation_file_name) +! + call init_r2_ctl_array_label & + & (hd_diffusivity_list, vdiffuse_ctl%diffusivity_list_ctl) +! + end subroutine init_val_diffuse_ctl_label +! +! --------------------------------------------------------------------- +! --------------------------------------------------------------------- +! + subroutine dealloc_val_diffuse_ctl_data(vdiffuse_ctl) +! + type(val_diffuse_ctl), intent(inout) :: vdiffuse_ctl +! +! + vdiffuse_ctl%r_variation_ctl%iflag = 0 + vdiffuse_ctl%variation_file_name%iflag = 0 +! + call dealloc_control_array_r2 & + & (vdiffuse_ctl%diffusivity_list_ctl) + vdiffuse_ctl%diffusivity_list_ctl%num = 0 + vdiffuse_ctl%diffusivity_list_ctl%icou = 0 +! + vdiffuse_ctl%i_val_diffuse = 0 +! + end subroutine dealloc_val_diffuse_ctl_data +! +! --------------------------------------------------------------------- +! --------------------------------------------------------------------- +! + subroutine dup_val_diffuse_ctl_data(vdiffuse_c, new_vdiffuse_c) +! + type(val_diffuse_ctl), intent(in) :: vdiffuse_c + type(val_diffuse_ctl), intent(inout) :: new_vdiffuse_c +! +! + new_vdiffuse_c%block_name = vdiffuse_c%block_name + new_vdiffuse_c%i_val_diffuse = vdiffuse_c%i_val_diffuse +! + call copy_chara_ctl(vdiffuse_c%r_variation_ctl, & + & new_vdiffuse_c%r_variation_ctl) + call copy_chara_ctl(vdiffuse_c%variation_file_name, & + & new_vdiffuse_c%variation_file_name) +! + call dup_control_array_r2(vdiffuse_c%diffusivity_list_ctl, & + & new_vdiffuse_c%diffusivity_list_ctl) +! + end subroutine dup_val_diffuse_ctl_data +! +! --------------------------------------------------------------------- +! + end module t_ctl_data_valuable_diffuse diff --git a/src/Fortran_libraries/MHD_src/IO/t_ctl_param_val_diffusion.f90 b/src/Fortran_libraries/MHD_src/IO/t_ctl_param_val_diffusion.f90 new file mode 100644 index 00000000..0043db8a --- /dev/null +++ b/src/Fortran_libraries/MHD_src/IO/t_ctl_param_val_diffusion.f90 @@ -0,0 +1,140 @@ +!>@file t_ctl_param_val_diffusion.f90 +!!@brief module t_ctl_param_val_diffusion +!! +!!@author H. Matsui +!!@date Programmed in 2006 +! +!> @brief Control parameter for polytrope +!! +!!@verbatim +!! subroutine dealloc_val_diffuse_parameters(v_diffuse_param) +!! type(val_diffuse_parameters), intent(inout) :: v_diffuse_param +!! subroutine set_valuable_diffusion_ctl(my_rank, val_diffuse_c, & +!! & v_diffuse_param, flag_val_diffuse) +!! integer, intent(in) :: my_rank +!! type(val_diffuse_ctl), intent(in) :: val_diffuse_c +!! type(val_diffuse_parameters), intent(inout) :: v_diffuse_param +!! logical, intent(inout) :: flag_val_diffuse +!! +!! subroutine check_val_diffuse_parameters(v_diffuse_param) +!! type(val_diffuse_parameters), intent(in) :: v_diffuse_param +!!@endverbatim +! + module t_ctl_param_val_diffusion +! + use m_precision + use m_constants +! +!> Block for polytorope definision + type val_diffuse_parameters +!> Stepped variation flag + logical :: flag_stepped = .FALSE. +! +!> Density file name + character(len = kchara) :: diffuse_file_name +! +!> Number of list + integer(kind = kint) :: num_diffusion_list = 0 +!> Polytrope index + real(kind = kreal), allocatable :: diffusion_radius(:) +!> Polytrope index + real(kind = kreal), allocatable :: diffusion_list(:) + end type val_diffuse_parameters +! +! ---------------------------------------------------------------------- +! + contains +! +! ---------------------------------------------------------------------- +! + subroutine alloc_val_diffuse_parameters(num, v_diffuse_param) +! + integer(kind = kint), intent(in) :: num + type(val_diffuse_parameters), intent(inout) :: v_diffuse_param +! + v_diffuse_param%num_diffusion_list = num + allocate(v_diffuse_param%diffusion_radius(num)) + allocate(v_diffuse_param%diffusion_list(num)) +! + if(num .le. 0) return + v_diffuse_param%diffusion_radius(1:num) = zero + v_diffuse_param%diffusion_list(1:num) = zero +! + end subroutine alloc_val_diffuse_parameters +! +! ---------------------------------------------------------------------- +! + subroutine dealloc_val_diffuse_parameters(v_diffuse_param) +! + type(val_diffuse_parameters), intent(inout) :: v_diffuse_param +! + deallocate(v_diffuse_param%diffusion_radius) + deallocate(v_diffuse_param%diffusion_list) +! + end subroutine dealloc_val_diffuse_parameters +! +! ---------------------------------------------------------------------- +! + subroutine set_valuable_diffusion_ctl(my_rank, val_diffuse_c, & + & v_diffuse_param, flag_val_diffuse) +! + use t_ctl_data_valuable_diffuse + use skip_comment_f +! + integer, intent(in) :: my_rank + type(val_diffuse_ctl), intent(in) :: val_diffuse_c + type(val_diffuse_parameters), intent(inout) :: v_diffuse_param + logical, intent(inout) :: flag_val_diffuse +! +! + flag_val_diffuse = .FALSE. + if(val_diffuse_c%r_variation_ctl%iflag .gt. 0) then + flag_val_diffuse & + & = yes_flag(val_diffuse_c%r_variation_ctl%charavalue) + end if + if(flag_val_diffuse .eqv. .FALSE.) return +! + if(val_diffuse_c%variation_file_name%iflag .gt. 0) then + v_diffuse_param%diffuse_file_name & + & = val_diffuse_c%variation_file_name%charavalue + v_diffuse_param%num_diffusion_list = -1 +! + else if(val_diffuse_c%diffusivity_list_ctl%num .gt. 0) then + call alloc_val_diffuse_parameters & + & (val_diffuse_c%diffusivity_list_ctl%num, v_diffuse_param) +! + do i = 1, v_diffuse_param%num_diffusion_list + v_diffuse_param%diffusion_radius(i) & + & = val_diffuse_c%diffusivity_list_ctl%vec1(i) + v_diffuse_param%diffusion_list(i) & + & = val_diffuse_c%diffusivity_list_ctl%vec2(i) + end do + else + if(my_rank .eq. 0) write(*,*) 'Set density variation controls' + flag_val_diffuse = .FALSE. + end if +! + end subroutine set_valuable_diffusion_ctl +! +! ---------------------------------------------------------------------- +! + subroutine check_val_diffuse_parameters(v_diffuse_param) +! + type(val_diffuse_parameters), intent(in) :: v_diffuse_param +! +! + write(*,*) 'flag_stepped', v_diffuse_param%flag_stepped +! + write(*,*) 'num_diffusion_list', & + & v_diffuse_param%num_diffusion_list + do i = 1, v_diffuse_param%num_diffusion_list + write(*,*) i, v_diffuse_param%diffusion_radius(i), & + & v_diffuse_param%diffusion_list(i) + end do +! + end subroutine check_val_diffuse_parameters +! +! ---------------------------------------------------------------------- +! + end module t_ctl_param_val_diffusion + diff --git a/src/Fortran_libraries/MHD_src/Makefile b/src/Fortran_libraries/MHD_src/Makefile index 847d5b6e..c251ce23 100644 --- a/src/Fortran_libraries/MHD_src/Makefile +++ b/src/Fortran_libraries/MHD_src/Makefile @@ -9,6 +9,7 @@ LIB_MHD_FILE= libcalypso_MHD.a SUBDIRS = \ IO \ +radial_FDM \ sph_MHD # @@ -53,6 +54,7 @@ lib_archve: mod_list: @echo MOD_MHD= \\ >> $(MAKENAME) @echo '$$(MOD_MHD_IO)' \\ >> $(MAKENAME) + @echo '$$(MOD_SPH_MHD_FDM)' \\ >> $(MAKENAME) @echo '$$(MOD_SPH_MHD)' \\ >> $(MAKENAME) @echo '$$(MOD_SPH_SNAPSHOT)' \\ >> $(MAKENAME) @echo >> $(MAKENAME) diff --git a/src/Fortran_libraries/MHD_src/radial_FDM/Makefile b/src/Fortran_libraries/MHD_src/radial_FDM/Makefile new file mode 100644 index 00000000..c4531982 --- /dev/null +++ b/src/Fortran_libraries/MHD_src/radial_FDM/Makefile @@ -0,0 +1,35 @@ +# +# +# + +MHD_FDM_DIR = $$(MHD_SRCDIR)/radial_FDM +SOURCES = $(shell ls *.f90) +MOD_SPH_MHD_FDM = $(addsuffix .o,$(basename $(SOURCES)) ) + +# +# ------------------------------------------------------------------------- +# + +dir_list: + @echo 'MHD_FDM_DIR = $(MHD_FDM_DIR)' >> $(MAKENAME) + +libtarget: + +lib_archve: libtarget + @echo ' $$(AR) $$(ARFLUGS) rcsv $$@ $$(MOD_SPH_MHD_FDM)' \ + >> $(MAKENAME) + +mod_list: + @echo MOD_SPH_MHD_FDM= \\ >> $(MAKENAME) + @echo $(MOD_SPH_MHD_FDM) >> $(MAKENAME) + @echo '#' >> $(MAKENAME) + + +module: + @cat Makefile.depends >> $(MAKENAME) + +depends: + @$(MAKE_MOD_DEP) Makefile.depends '$$(MHD_FDM_DIR)' $(SOURCES) + +clean: + rm -f *.o *.mod *~ *.par *.diag *.a diff --git a/src/Fortran_libraries/MHD_src/radial_FDM/Makefile.depends b/src/Fortran_libraries/MHD_src/radial_FDM/Makefile.depends new file mode 100644 index 00000000..be07a956 --- /dev/null +++ b/src/Fortran_libraries/MHD_src/radial_FDM/Makefile.depends @@ -0,0 +1,21 @@ +t_coef_fdm3_n2e_free_vp_CMB.o: $(MHD_FDM_DIR)/t_coef_fdm3_n2e_free_vp_CMB.f90 m_precision.o m_constants.o t_coef_fdm2_MHD_boundaries.o t_coef_fdm3_n2e_zero_vp_CMB.o + $(F90) -c $(F90OPTFLAGS) $< +t_coef_fdm3_n2e_free_vp_ICB.o: $(MHD_FDM_DIR)/t_coef_fdm3_n2e_free_vp_ICB.f90 m_precision.o m_constants.o t_coef_fdm2_MHD_boundaries.o t_coef_fdm3_n2e_zero_vp_ICB.o + $(F90) -c $(F90OPTFLAGS) $< +t_coef_fdm3_n2e_zero_vp_CMB.o: $(MHD_FDM_DIR)/t_coef_fdm3_n2e_zero_vp_CMB.f90 m_precision.o m_constants.o cal_inverse_small_matrix.o + $(F90) -c $(F90OPTFLAGS) $< +t_coef_fdm3_n2e_zero_vp_CTR.o: $(MHD_FDM_DIR)/t_coef_fdm3_n2e_zero_vp_CTR.f90 m_precision.o m_constants.o cal_inverse_small_matrix.o + $(F90) -c $(F90OPTFLAGS) $< +t_coef_fdm3_n2e_zero_vp_ICB.o: $(MHD_FDM_DIR)/t_coef_fdm3_n2e_zero_vp_ICB.f90 m_precision.o m_constants.o cal_inverse_small_matrix.o + $(F90) -c $(F90OPTFLAGS) $< +t_coef_fdm4_free_vpol_CMB.o: $(MHD_FDM_DIR)/t_coef_fdm4_free_vpol_CMB.f90 m_precision.o m_constants.o cal_inverse_small_matrix.o + $(F90) -c $(F90OPTFLAGS) $< +t_coef_fdm4_free_vpol_ICB.o: $(MHD_FDM_DIR)/t_coef_fdm4_free_vpol_ICB.f90 m_precision.o m_constants.o + $(F90) -c $(F90OPTFLAGS) $< +t_coef_fdm4_vpol_centre.o: $(MHD_FDM_DIR)/t_coef_fdm4_vpol_centre.f90 m_precision.o m_constants.o t_fdm_coefs.o cal_inverse_small_matrix.o + $(F90) -c $(F90OPTFLAGS) $< +t_coef_fdm4_zero_vpol_CMB.o: $(MHD_FDM_DIR)/t_coef_fdm4_zero_vpol_CMB.f90 m_precision.o m_constants.o + $(F90) -c $(F90OPTFLAGS) $< +t_coef_fdm4_zero_vpol_ICB.o: $(MHD_FDM_DIR)/t_coef_fdm4_zero_vpol_ICB.f90 m_precision.o m_constants.o cal_inverse_small_matrix.o + $(F90) -c $(F90OPTFLAGS) $< + diff --git a/src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm3_n2e_free_vp_CMB.f90 b/src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm3_n2e_free_vp_CMB.f90 new file mode 100644 index 00000000..997c7a04 --- /dev/null +++ b/src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm3_n2e_free_vp_CMB.f90 @@ -0,0 +1,146 @@ +!>@file t_coef_fdm3_n2e_free_vp_CMB.f90 +!!@brief module t_coef_fdm3_n2e_free_vp_CMB +!! +!!@author H. Matsui +!!@date Programmed in May., 2013 +! +!>@brief Matrix to evaluate radial derivative for non-slip at CMB +!! +!!@verbatim +!! subroutine check_fdm3_n2e_CMB_free_vpol(id_file, fdm3e_free_CMB) +!! integer(kind = kint), intent(in) :: id_file +!! type(fdm3_n2e_CMB_free_vpol), intent(in) :: fdm3e_free_CMB +!! +!! subroutine cal_fdm3e_CMB_free_hdiv_vp & +!! & (dmat_vp_free_CMB, fdm3e_vp0_CMB, fdm3e_free_CMB) +!! real(kind = kreal), intent(in) :: dmat_vp_free_CMB(-1:1,3) +!! type(fdm3_n2e_CMB_zero_vpol), intent(in) :: fdm3e_vp0_CMB +!! type(fdm3_n2e_CMB_free_vpol), intent(inout) :: fdm3e_free_CMB +!! subroutine cal_fdm3_free_vp_CMB_ele(i_th, kr_out, nnod_rj, jmax,& +!! & fdm3e_free_CMB, d_rj, dfdr_rj, dele_bc) +!! type(fdm3_n2e_CMB_free_vpol), intent(in) :: fdm3e_free_CMB +!! integer(kind = kint), intent(in) :: i_th, kr_out +!! integer(kind = kint), intent(in) :: nnod_rj, jmax +!! real(kind = kreal), intent(in) :: d_rj(nnod_rj) +!! real(kind = kreal), intent(in) :: dfdr_rj(nnod_rj) +!! real(kind = kreal), intent(inout) :: dele_bc(nnod_rj) +!! +!! Matrix for poloidal velocity with horizontal divergence at CMB +!! d_ele = fdm3e_free_CMB%dmat_vp0(-2,1) * d_rj(CMB-2) +!! + fdm3e_free_CMB%dmat_vp0(-1,1) * d_rj(CMB-1) +!! + fdm3e_free_CMB%dmat_vp0( 0,1) * d_rj(CMB ) +!! + fdm3e_free_CMB%dmat_vp0( 1,1) * dfdr(CMB ) +!! dfdr = fdm3e_free_CMB%dmat_vp0(-2,2) * d_rj(CMB-3) +!! + fdm3e_free_CMB%dmat_vp0(-1,2) * d_rj(CMB-2) +!! + fdm3e_free_CMB%dmat_vp0( 0,2) * d_rj(CMB-1) +!! + fdm3e_free_CMB%dmat_vp0( 1,2) * dfdr(CMB ) +!! d2fdr2 = fdm3e_free_CMB%dmat_vp0(-2,3) * d_rj(CMB-3) +!! + fdm3e_free_CMB%dmat_vp0(-1,3) * d_rj(CMB-2) +!! + fdm3e_free_CMB%dmat_vp0( 0,3) * d_rj(CMB-1) +!! + fdm3e_free_CMB%dmat_vp0( 1,3) * dfdr(CMB ) +!! d3fdr3 = fdm3e_free_CMB%dmat_vp0(-2,4) * d_rj(CMB-3) +!! + fdm3e_free_CMB%dmat_vp0(-1,4) * d_rj(CMB-2) +!! + fdm3e_free_CMB%dmat_vp0( 0,4) * d_rj(CMB-1) +!! + fdm3e_free_CMB%dmat_vp0( 1,4) * dfdr(CMB ) +!!@endverbatim +!! +!!@n @param r_from_ICB(0:3) radius to three next points of ICB +!! + module t_coef_fdm3_n2e_free_vp_CMB +! + use m_precision +! + use m_constants +! + implicit none +! +! + type fdm3_n2e_CMB_free_vpol +!> Matrix to evaluate radial derivative at Boundary + real(kind = kreal) :: dmat_vp0(-2:1,4) + end type fdm3_n2e_CMB_free_vpol +! +! ----------------------------------------------------------------------- +! + contains +! +! ----------------------------------------------------------------------- +! + subroutine check_fdm3_n2e_CMB_free_vpol(id_file, fdm3e_free_CMB) +! + integer(kind = kint), intent(in) :: id_file + type(fdm3_n2e_CMB_free_vpol), intent(in) :: fdm3e_free_CMB +! +! + write(id_file,*) ' free slip at CMB' + write(id_file,*) ' fdm3e_free_CMB%dmat_vp0' + write(id_file,*) 'matrix for Interpolation' + write(id_file,'(1p9E25.15e3)') fdm3e_free_CMB%dmat_vp0(-2:1,1) + write(id_file,*) 'matrix for dfdr' + write(id_file,'(1p9E25.15e3)') fdm3e_free_CMB%dmat_vp0(-2:1,2) + write(id_file,*) 'matrix for d2fdr2' + write(id_file,'(1p9E25.15e3)') fdm3e_free_CMB%dmat_vp0(-2:1,3) + write(id_file,*) 'matrix for d3fdr3' + write(id_file,'(1p9E25.15e3)') fdm3e_free_CMB%dmat_vp0(-2:1,4) +! + end subroutine check_fdm3_n2e_CMB_free_vpol +! +! ----------------------------------------------------------------------- +! + subroutine cal_fdm3e_CMB_free_hdiv_vp & + & (dmat_vp_free_CMB, fdm3e_vp0_CMB, fdm3e_free_CMB) +! + use t_coef_fdm2_MHD_boundaries + use t_coef_fdm3_n2e_zero_vp_CMB +! + real(kind = kreal), intent(in) :: dmat_vp_free_CMB(-1:1,3) + type(fdm3_n2e_CMB_zero_vpol), intent(in) :: fdm3e_vp0_CMB +! + type(fdm3_n2e_CMB_free_vpol), intent(inout) :: fdm3e_free_CMB +! +! + fdm3e_free_CMB%dmat_vp0(-2,1:4) = fdm3e_vp0_CMB%dmat_vp0(-2,1:4) + fdm3e_free_CMB%dmat_vp0(-1,1:4) = fdm3e_vp0_CMB%dmat_vp0(-1,1:4) & + & + fdm3e_vp0_CMB%dmat_vp0( 1,1:4) * dmat_vp_free_CMB(-1,2) +! fdm3e_free_CMB%dmat_vp0( 0,1:4) = fdm3e_vp0_CMB%dmat_vp0( 0,1:4) & +! & + fdm3e_vp0_CMB%dmat_vp0( 1,1:4) * dmat_vp_free_CMB( 0,2) + fdm3e_free_CMB%dmat_vp0( 0,1:4) = zero + fdm3e_free_CMB%dmat_vp0( 1,1:4) = zero +! + end subroutine cal_fdm3e_CMB_free_hdiv_vp +! +! ----------------------------------------------------------------------- +! + subroutine cal_fdm3_free_vp_CMB_ele(i_th, kr_out, nnod_rj, jmax, & + & fdm3e_free_CMB, d_rj, dfdr_rj, dele_bc) +! + type(fdm3_n2e_CMB_free_vpol), intent(in) :: fdm3e_free_CMB + integer(kind = kint), intent(in) :: i_th, kr_out + integer(kind = kint), intent(in) :: nnod_rj, jmax + real(kind = kreal), intent(in) :: d_rj(nnod_rj) + real(kind = kreal), intent(in) :: dfdr_rj(nnod_rj) +! + real(kind = kreal), intent(inout) :: dele_bc(nnod_rj) +! + integer(kind = kint) :: inod, i_n2, i_n1, j +! +! +!$omp parallel do private(inod,i_n2,i_n1,j) + do j = 1, jmax + inod = j + (kr_out-1) * jmax + i_n1 = j + (kr_out-2) * jmax + i_n2 = j + (kr_out-3) * jmax +! + dele_bc(inod) = fdm3e_free_CMB%dmat_vp0(-2,i_th+1) * d_rj(i_n2) & + & + fdm3e_free_CMB%dmat_vp0(-1,i_th+1) * d_rj(i_n1) & + & + fdm3e_free_CMB%dmat_vp0( 0,i_th+1) * d_rj(inod) & + & + fdm3e_free_CMB%dmat_vp0( 1,i_th+1) & + & * dfdr_rj(inod) + end do +!$omp end parallel do +! + end subroutine cal_fdm3_free_vp_CMB_ele +! +! ----------------------------------------------------------------------- +! + end module t_coef_fdm3_n2e_free_vp_CMB diff --git a/src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm3_n2e_free_vp_ICB.f90 b/src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm3_n2e_free_vp_ICB.f90 new file mode 100644 index 00000000..c9737d2a --- /dev/null +++ b/src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm3_n2e_free_vp_ICB.f90 @@ -0,0 +1,149 @@ +!>@file t_coef_fdm3_n2e_free_vp_ICB.f90 +!!@brief module t_coef_fdm3_n2e_free_vp_ICB +!! +!!@author H. Matsui +!!@date Programmed in May., 2013 +! +!>@brief Matrix to evaluate radial derivative for non-slip at ICB +!! +!!@verbatim +!! subroutine check_fdm3_n2e_ICB_free_vpol(id_file, fdm3e_free_ICB) +!! integer(kind = kint), intent(in) :: id_file +!! type(fdm3_n2e_ICB_free_vpol), intent(in) :: fdm3e_free_ICB +!! +!! subroutine cal_fdm3e_ICB_free_hdiv_vp & +!! & (dmat_vp_free_ICB, fdm3e_vp0_ICB, fdm3e_free_ICB) +!! real(kind = kreal), intent(in) :: dmat_vp_free_ICB(-1:1,3) +!! type(fdm3_n2e_ICB_zero_vpol), intent(in) :: fdm3e_vp0_ICB +!! type(fdm3_n2e_ICB_free_vpol), intent(inout) :: fdm3e_free_ICB +!! subroutine cal_fdm3_free_vp_ICB_ele(i_th, kr_in, nnod_rj, jmax, & +!! & fdm3e_free_ICB, d_rj, dfdr_rj, dele_bc) +!! type(fdm3_n2e_ICB_free_vpol), intent(in) :: fdm3e_free_ICB +!! integer(kind = kint), intent(in) :: i_th, kr_in +!! integer(kind = kint), intent(in) :: nnod_rj, jmax +!! real(kind = kreal), intent(in) :: d_rj(nnod_rj) +!! real(kind = kreal), intent(in) :: dfdr_rj(nnod_rj) +!! real(kind = kreal), intent(inout) :: dele_bc(nnod_rj) +!! +!! Matrix for poloidal velocity with horizontal divergence at CMB +!! dfdr_ICB = dmat_vp_free_ICB(0,2) * d_rj(ICB) +!! + dmat_vp_free_ICB(1,2) * d_rj(ICB+1) +!! dnfdr_e(0:3) = fdm3e_ICB%dmat_vp0(-2,1:4) * dfdr_ICB & +!! & + fdm3e_ICB%dmat_vp0(-1,1:4) * d_rj(ICB ) & +!! & + fdm3e_ICB%dmat_vp0( 0,1:4) * d_rj(ICB+1) & +!! & + fdm3e_ICB%dmat_vp0( 1,1:4) * d_rj(ICB+2) +!! = fdm3e_ICB%dmat_vp0(-2,1:4) & +!! & * (dmat_vp_free_ICB(0,2) * d_rj(ICB) & +!! + dmat_vp_free_ICB(1,2) * d_rj(ICB+1)) & +!! & + fdm3e_ICB%dmat_vp0(-1,1:4) * d_rj(ICB ) & +!! & + fdm3e_ICB%dmat_vp0( 0,1:4) * d_rj(ICB+1) & +!! & + fdm3e_ICB%dmat_vp0( 1,1:4) * d_rj(ICB+2) +!! = (fdm3e_ICB%dmat_vp0(-1,1:4) & +!! & + fdm3e_ICB%dmat_vp0(-2,1:4) & +!! & * dmat_vp_free_ICB(0,2)) * d_rj(ICB ) & +!! & + (fdm3e_ICB%dmat_vp0( 0,1:4) & +!! & + fdm3e_ICB%dmat_vp0(-2,1:4) & +!! & * dmat_vp_free_ICB(1,2)) * d_rj(ICB+1) +!! & + fdm3e_ICB%dmat_vp0( 1,1:4) * d_rj(ICB+2) +!!@endverbatim +!! +!!@n @param r_from_ICB(0:3) radius to three next points of ICB +!! + module t_coef_fdm3_n2e_free_vp_ICB +! + use m_precision +! + use m_constants +! + implicit none +! +! + type fdm3_n2e_ICB_free_vpol +!> Matrix to evaluate radial derivative at Boundary + real(kind = kreal) :: dmat_vp0(-2:1,4) + end type fdm3_n2e_ICB_free_vpol +! +! ----------------------------------------------------------------------- +! + contains +! +! ----------------------------------------------------------------------- +! + subroutine check_fdm3_n2e_ICB_free_vpol(id_file, fdm3e_free_ICB) +! + integer(kind = kint), intent(in) :: id_file + type(fdm3_n2e_ICB_free_vpol), intent(in) :: fdm3e_free_ICB +! +! + write(id_file,*) ' free slip at CMB' + write(id_file,*) ' fdm3e_free_ICB%dmat_vp0' + write(id_file,*) 'matrix for Interpolation' + write(id_file,'(1p9E25.15e3)') fdm3e_free_ICB%dmat_vp0(-2:1,1) + write(id_file,*) 'matrix for dfdr' + write(id_file,'(1p9E25.15e3)') fdm3e_free_ICB%dmat_vp0(-2:1,2) + write(id_file,*) 'matrix for d2fdr2' + write(id_file,'(1p9E25.15e3)') fdm3e_free_ICB%dmat_vp0(-2:1,3) + write(id_file,*) 'matrix for d3fdr3' + write(id_file,'(1p9E25.15e3)') fdm3e_free_ICB%dmat_vp0(-2:1,4) +! + end subroutine check_fdm3_n2e_ICB_free_vpol +! +! ----------------------------------------------------------------------- +! + subroutine cal_fdm3e_ICB_free_hdiv_vp & + & (dmat_vp_free_ICB, fdm3e_vp0_ICB, fdm3e_free_ICB) +! + use t_coef_fdm2_MHD_boundaries + use t_coef_fdm3_n2e_zero_vp_ICB +! + real(kind = kreal), intent(in) :: dmat_vp_free_ICB(-1:1,3) + type(fdm3_n2e_ICB_zero_vpol), intent(in) :: fdm3e_vp0_ICB +! + type(fdm3_n2e_ICB_free_vpol), intent(inout) :: fdm3e_free_ICB +! +! + fdm3e_free_ICB%dmat_vp0(-2,1:4) = zero + fdm3e_free_ICB%dmat_vp0(-1,1:4) = zero +! fdm3e_free_ICB%dmat_vp0(-1,1:4) = fdm3e_vp0_ICB%dmat_vp0(-1,1:4) & +! & + fdm3e_vp0_ICB%dmat_vp0(-2,1:4) * dmat_vp_free_ICB(0,2) + fdm3e_free_ICB%dmat_vp0( 0,1:4) = fdm3e_vp0_ICB%dmat_vp0( 0,1:4) & + & + fdm3e_vp0_ICB%dmat_vp0(-2,1:4) * dmat_vp_free_ICB(1,2) + fdm3e_free_ICB%dmat_vp0( 1,1:4) = fdm3e_vp0_ICB%dmat_vp0( 1,1:4) +! + end subroutine cal_fdm3e_ICB_free_hdiv_vp +! +! ----------------------------------------------------------------------- +! + subroutine cal_fdm3_free_vp_ICB_ele(i_th, kr_in, nnod_rj, jmax, & + & fdm3e_free_ICB, d_rj, dfdr_rj, dele_bc) +! + type(fdm3_n2e_ICB_free_vpol), intent(in) :: fdm3e_free_ICB + integer(kind = kint), intent(in) :: i_th, kr_in + integer(kind = kint), intent(in) :: nnod_rj, jmax + real(kind = kreal), intent(in) :: d_rj(nnod_rj) + real(kind = kreal), intent(in) :: dfdr_rj(nnod_rj) +! + real(kind = kreal), intent(inout) :: dele_bc(nnod_rj) +! + integer(kind = kint) :: inod, i_p1, i_p2, j +! +! +!$omp parallel do private(inod,i_p1,i_p2,j) + do j = 1, jmax + inod = j + (kr_in-1) * jmax + i_p1 = j + (kr_in ) * jmax + i_p2 = j + (kr_in+1) * jmax +! + dele_bc(inod) = fdm3e_free_ICB%dmat_vp0( 1,i_th+1) * d_rj(i_p2) & + & + fdm3e_free_ICB%dmat_vp0( 0,i_th+1) * d_rj(i_p1) & + & + fdm3e_free_ICB%dmat_vp0(-1,i_th+1) * d_rj(inod) & + & + fdm3e_free_ICB%dmat_vp0(-2,i_th+1) & + & * dfdr_rj(inod) + end do +!$omp end parallel do +! + end subroutine cal_fdm3_free_vp_ICB_ele +! +! ----------------------------------------------------------------------- +! + end module t_coef_fdm3_n2e_free_vp_ICB diff --git a/src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm3_n2e_zero_vp_CMB.f90 b/src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm3_n2e_zero_vp_CMB.f90 new file mode 100644 index 00000000..ee792e29 --- /dev/null +++ b/src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm3_n2e_zero_vp_CMB.f90 @@ -0,0 +1,195 @@ +!>@file t_coef_fdm3_n2e_zero_vp_CMB.f90 +!!@brief module t_coef_fdm3_n2e_zero_vp_CMB +!! +!!@author H. Matsui +!!@date Programmed in May., 2013 +! +!>@brief Matrix to evaluate radial derivative for non-slip at CMB +!! +!!@verbatim +!! subroutine check_fdm3_n2e_CMB_zero_vpol(id_file, fdm3e_vp0_CMB) +!! integer(kind = kint), intent(in) :: id_file +!! type(fdm3_n2e_CMB_zero_vpol), intent(in) :: fdm3e_vp0_CMB +!! +!! subroutine cal_fdm3e_CMB_hdiv_vp(r_from_CMB, fdm3e_vp0_CMB) +!! real(kind = kreal), intent(in) :: r_from_CMB(-2:0) +!! type(fdm3_n2e_CMB_zero_vpol), intent(inout) :: fdm3e_vp0_CMB +!! +!! subroutine cal_fdm3_zero_vp_CMB_ele(i_th, kr_out, nnod_rj, jmax,& +!! & fdm3e_vp0_CMB, d_rj, dfdr_rj, dele_bc) +!! type(fdm3_n2e_CMB_zero_vpol), intent(in) :: fdm3e_vp0_CMB +!! integer(kind = kint), intent(in) :: i_th, kr_out +!! integer(kind = kint), intent(in) :: nnod_rj, jmax +!! real(kind = kreal), intent(in) :: d_rj(nnod_rj) +!! real(kind = kreal), intent(in) :: dfdr_rj(nnod_rj) +!! real(kind = kreal), intent(inout) :: dele_bc(nnod_rj) +!! +!! Matrix for poloidal velocity with horizontal divergence at CMB +!! d_ele = fdm3e_vp0_CMB%dmat_vp0(-2,1) * d_rj(CMB-2) +!! + fdm3e_vp0_CMB%dmat_vp0(-1,1) * d_rj(CMB-1) +!! + fdm3e_vp0_CMB%dmat_vp0( 0,1) * d_rj(CMB ) +!! + fdm3e_vp0_CMB%dmat_vp0( 1,1) * dfdr(CMB ) +!! dfdr = fdm3e_vp0_CMB%dmat_vp0(-2,2) * d_rj(CMB-3) +!! + fdm3e_vp0_CMB%dmat_vp0(-1,2) * d_rj(CMB-2) +!! + fdm3e_vp0_CMB%dmat_vp0( 0,2) * d_rj(CMB-1) +!! + fdm3e_vp0_CMB%dmat_vp0( 1,2) * dfdr(CMB ) +!! d2fdr2 = fdm3e_vp0_CMB%dmat_vp0(-2,3) * d_rj(CMB-3) +!! + fdm3e_vp0_CMB%dmat_vp0(-1,3) * d_rj(CMB-2) +!! + fdm3e_vp0_CMB%dmat_vp0( 0,3) * d_rj(CMB-1) +!! + fdm3e_vp0_CMB%dmat_vp0( 1,3) * dfdr(CMB ) +!! d3fdr3 = fdm3e_vp0_CMB%dmat_vp0(-2,4) * d_rj(CMB-3) +!! + fdm3e_vp0_CMB%dmat_vp0(-1,4) * d_rj(CMB-2) +!! + fdm3e_vp0_CMB%dmat_vp0( 0,4) * d_rj(CMB-1) +!! + fdm3e_vp0_CMB%dmat_vp0( 1,4) * dfdr(CMB ) +!!@endverbatim +!! + module t_coef_fdm3_n2e_zero_vp_CMB +! + use m_precision + use m_constants +! + implicit none +! +! + type fdm3_n2e_CMB_zero_vpol +!> Matrix to evaluate radial derivative at Boundary + real(kind = kreal) :: dmat_vp0(-2:1,4) + end type fdm3_n2e_CMB_zero_vpol +! +! ----------------------------------------------------------------------- +! + contains +! +! ----------------------------------------------------------------------- +! + subroutine check_fdm3_n2e_CMB_zero_vpol(id_file, fdm3e_vp0_CMB) +! + integer(kind = kint), intent(in) :: id_file + type(fdm3_n2e_CMB_zero_vpol), intent(in) :: fdm3e_vp0_CMB +! +! + write(id_file,*) ' zero poloidal at CMB' + write(id_file,*) ' fdm3e_vp0_CMB%dmat_vp0' + write(id_file,*) 'matrix for Interpolation' + write(id_file,'(1p9E25.15e3)') fdm3e_vp0_CMB%dmat_vp0(-2:1,1) + write(id_file,*) 'matrix for dfdr' + write(id_file,'(1p9E25.15e3)') fdm3e_vp0_CMB%dmat_vp0(-2:1,2) + write(id_file,*) 'matrix for d2fdr2' + write(id_file,'(1p9E25.15e3)') fdm3e_vp0_CMB%dmat_vp0(-2:1,3) + write(id_file,*) 'matrix for d3fdr3' + write(id_file,'(1p9E25.15e3)') fdm3e_vp0_CMB%dmat_vp0(-2:1,4) +! + end subroutine check_fdm3_n2e_CMB_zero_vpol +! +! ----------------------------------------------------------------------- +! ----------------------------------------------------------------------- +! + subroutine cal_fdm3e_CMB_hdiv_vp(r_from_CMB, fdm3e_vp0_CMB) +! + use cal_inverse_small_matrix +! + real(kind = kreal), intent(in) :: r_from_CMB(-2:0) + type(fdm3_n2e_CMB_zero_vpol), intent(inout) :: fdm3e_vp0_CMB +! +!> Work matrix to evaluate fdm3e_vp0_CMB%dmat_vp0 +!!@verbatim +!! d_rj(CMB ) = mat_taylor_3e(1,1) * d_ele +!! + mat_taylor_3e(1,2) * dfdr +!! + mat_taylor_3e(1,3) * d2fdr2 +!! + mat_taylor_3e(1,4) * d3fdr3 +!! d_rj(CMB-1) = mat_taylor_3e(2,1) * d_ele +!! + mat_taylor_3e(2,2) * dfdr +!! + mat_taylor_3e(2,3) * d2fdr2 +!! + mat_taylor_3e(2,4) * d3fdr3 +!! d_rj(CMB-2) = mat_taylor_3e(3,1) * d_ele +!! + mat_taylor_3e(3,2) * dfdr +!! + mat_taylor_3e(3,3) * d2fdr2 +!! + mat_taylor_3e(3,4) * d3fdr3 +!! dfdr(CMB ) = mat_taylor_3e(4,1) * d_ele +!! + mat_taylor_3e(4,2) * dfdr +!! + mat_taylor_3e(4,3) * d2fdr2 +!! + mat_taylor_3e(4,4) * d3fdr3 +!! mat_fdm4_CMB1_free_vp = (mat_taylor_3e)^-1 +!!@endverbatim + real(kind = kreal) :: mat_fdm3e_CMB_hdiv_vp(4,4) +! + integer(kind = kint) :: ierr + real(kind = kreal) :: mat_taylor_3e(4,4) + real(kind = kreal) :: dr_p1, dr_n1, dr_n2 +! +! + dr_p1 = half * (r_from_CMB(0) - r_from_CMB(-1)) + dr_n1 = half * (r_from_CMB(0) - r_from_CMB(-1)) + dr_n2 = r_from_CMB(0) - half * (r_from_CMB(-1) + r_from_CMB(-2)) +! + mat_taylor_3e(1,1) = one + mat_taylor_3e(1,2) = dr_p1 + mat_taylor_3e(1,3) = half * dr_p1*dr_p1 + mat_taylor_3e(1,4) = dr_p1*dr_p1*dr_p1 / six +! + mat_taylor_3e(2,1) = one + mat_taylor_3e(2,2) = -dr_n1 + mat_taylor_3e(2,3) = half * dr_n1*dr_n1 + mat_taylor_3e(2,4) = -dr_n1*dr_n1*dr_n1 / six +! + mat_taylor_3e(3,1) = one + mat_taylor_3e(3,2) = -dr_n2 + mat_taylor_3e(3,3) = half * dr_n2*dr_n2 + mat_taylor_3e(3,4) = -dr_n2*dr_n2*dr_n2 / six +! + mat_taylor_3e(4,1) = zero + mat_taylor_3e(4,2) = one + mat_taylor_3e(4,3) = dr_p1 + mat_taylor_3e(4,4) = half * dr_p1*dr_p1 +! + call cal_inverse_44_matrix(mat_taylor_3e, & + & mat_fdm3e_CMB_hdiv_vp, ierr) +! + if(ierr .eq. 1) then + write(*,*) 'singular matrix cal_fdm3e_CMB_hdiv_vp ', & + & r_from_CMB(0) + end if +! + fdm3e_vp0_CMB%dmat_vp0( 0,1:4) = mat_fdm3e_CMB_hdiv_vp(1:4,1) + fdm3e_vp0_CMB%dmat_vp0(-1,1:4) = mat_fdm3e_CMB_hdiv_vp(1:4,2) + fdm3e_vp0_CMB%dmat_vp0(-2,1:4) = mat_fdm3e_CMB_hdiv_vp(1:4,3) + fdm3e_vp0_CMB%dmat_vp0( 1,1:4) = mat_fdm3e_CMB_hdiv_vp(1:4,4) +! + end subroutine cal_fdm3e_CMB_hdiv_vp +! +! ----------------------------------------------------------------------- +! ----------------------------------------------------------------------- +! + subroutine cal_fdm3_zero_vp_CMB_ele(i_th, kr_out, nnod_rj, jmax, & + & fdm3e_vp0_CMB, d_rj, dfdr_rj, dele_bc) +! + type(fdm3_n2e_CMB_zero_vpol), intent(in) :: fdm3e_vp0_CMB + integer(kind = kint), intent(in) :: i_th, kr_out + integer(kind = kint), intent(in) :: nnod_rj, jmax + real(kind = kreal), intent(in) :: d_rj(nnod_rj) + real(kind = kreal), intent(in) :: dfdr_rj(nnod_rj) +! + real(kind = kreal), intent(inout) :: dele_bc(nnod_rj) +! + integer(kind = kint) :: inod, i_n2, i_n1, j +! +! +!$omp parallel do private(inod,i_n2,i_n1,j) + do j = 1, jmax + inod = j + (kr_out-1) * jmax + i_n1 = j + (kr_out-2) * jmax + i_n2 = j + (kr_out-3) * jmax +! + dele_bc(inod) = fdm3e_vp0_CMB%dmat_vp0(-2,i_th+1) * d_rj(i_n2) & + & + fdm3e_vp0_CMB%dmat_vp0(-1,i_th+1) * d_rj(i_n1) & + & + fdm3e_vp0_CMB%dmat_vp0( 0,i_th+1) * d_rj(inod) & + & + fdm3e_vp0_CMB%dmat_vp0( 1,i_th+1) & + & * dfdr_rj(inod) + end do +!$omp end parallel do +! + end subroutine cal_fdm3_zero_vp_CMB_ele +! +! ----------------------------------------------------------------------- +! + end module t_coef_fdm3_n2e_zero_vp_CMB diff --git a/src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm3_n2e_zero_vp_CTR.f90 b/src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm3_n2e_zero_vp_CTR.f90 new file mode 100644 index 00000000..5ef9a11e --- /dev/null +++ b/src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm3_n2e_zero_vp_CTR.f90 @@ -0,0 +1,192 @@ +!>@file t_coef_fdm3_n2e_zero_vp_CTR.f90 +!!@brief module t_coef_fdm3_n2e_zero_vp_CTR +!! +!!@author H. Matsui +!!@date Programmed in May., 2013 +! +!>@brief Matrix to evaluate radial derivative for non-slip at Center +!! +!!@verbatim +!! subroutine check_fdm3_n2e_CTR_zero_vpol(id_file, fdm3e_CTR) +!! integer(kind = kint), intent(in) :: id_file +!! type(fdm3_n2e_CTR_vpol), intent(in) :: fdm3e_CTR +!! subroutine cal_fdm3e_CTR_hdiv_vp(r_from_ICB, fdm3e_CTR) +!! real(kind = kreal), intent(in) :: r_from_ICB(0:2) +!! type(fdm3_n2e_CTR_vpol), intent(inout) :: fdm3e_CTR +!! +!! subroutine cal_third_fdm_CTR_ele(i_th, kr_in, nnod_rj, jmax, & +!! & fdm3e_CTR, d_rj, dfdr_rj, dele_bc) +!! integer(kind = kint), intent(in) :: nnod_rj, jmax +!! type(fdm3_n2e_CTR_vpol), intent(in) :: fdm3e_CTR +!! integer(kind = kint), intent(in) :: i_th, kr_in +!! real(kind = kreal), intent(in) :: d_rj(nnod_rj) +!! real(kind = kreal), intent(in) :: dfdr_rj(nnod_rj) +!! real(kind = kreal), intent(inout) :: dele_bc(nnod_rj) +!! +!! Matrix for poloidal velocity with horizontal divergence at CENTER +!! d_ele = fdm3e_ICB%dmat_vp0(-2,0) * dfdr(0) +!! + fdm3e_ICB%dmat_vp0(-1,0) * d_rj(0) +!! + fdm3e_ICB%dmat_vp0( 0,0) * d_rj(1) +!! + fdm3e_ICB%dmat_vp0( 1,0) * d_rj(2) +!! dfdr = fdm3e_ICB%dmat_vp0(-2,1) * dfdr(0) +!! + fdm3e_ICB%dmat_vp0(-1,1) * d_rj(0) +!! + fdm3e_ICB%dmat_vp0( 0,1) * d_rj(1) +!! + fdm3e_ICB%dmat_vp0( 1,1) * d_rj(2) +!! d2fdr2 = fdm3e_ICB%dmat_vp0(-2,2) * dfdr(0) +!! + fdm3e_ICB%dmat_vp0(-1,2) * d_rj(0) +!! + fdm3e_ICB%dmat_vp0( 0,2) * d_rj(1) +!! + fdm3e_ICB%dmat_vp0( 1,2) * d_rj(2) +!! d3fdr3 = fdm3e_ICB%dmat_vp0(-2,3) * dfdr(0) +!! + fdm3e_ICB%dmat_vp0(-1,3) * d_rj(0) +!! + fdm3e_ICB%dmat_vp0( 0,3) * d_rj(1) +!! + fdm3e_ICB%dmat_vp0( 1,3) * dfdr(2) +!!@endverbatim +!! + module t_coef_fdm3_n2e_zero_vp_CTR +! + use m_precision + use m_constants +! + implicit none +! +! + type fdm3_n2e_CTR_vpol +!> Matrix to evaluate radial derivative at Boundary + real(kind = kreal) :: dmat_vp0(-2:1,4) + end type fdm3_n2e_CTR_vpol +! +! ----------------------------------------------------------------------- +! + contains +! +! ----------------------------------------------------------------------- +! + subroutine check_fdm3_n2e_CTR_zero_vpol(id_file, fdm3e_CTR) +! + integer(kind = kint), intent(in) :: id_file + type(fdm3_n2e_CTR_vpol), intent(in) :: fdm3e_CTR +! +! + write(id_file,*) ' fdm3e_CTR%dmat_vp0' + write(id_file,*) 'matrix for Interpolation' + write(id_file,'(1p9E25.15e3)') fdm3e_CTR%dmat_vp0(-2:1,1) + write(id_file,*) 'matrix for dfdr' + write(id_file,'(1p9E25.15e3)') fdm3e_CTR%dmat_vp0(-2:1,2) + write(id_file,*) 'matrix for d2fdr2' + write(id_file,'(1p9E25.15e3)') fdm3e_CTR%dmat_vp0(-2:1,3) + write(id_file,*) 'matrix for d3fdr3' + write(id_file,'(1p9E25.15e3)') fdm3e_CTR%dmat_vp0(-2:1,4) +! + end subroutine check_fdm3_n2e_CTR_zero_vpol +! +! ----------------------------------------------------------------------- +! ----------------------------------------------------------------------- +! + subroutine cal_fdm3e_CTR_hdiv_vp(r_from_CTR, fdm3e_CTR) +! + use cal_inverse_small_matrix +! + real(kind = kreal), intent(in) :: r_from_CTR(3) + type(fdm3_n2e_CTR_vpol), intent(inout) :: fdm3e_CTR +! +!> Work matrix to evaluate fdm3e_ICB%dmat_vp0 +!!@verbatim +!! d_rj(ICB ) = mat_taylor_3e(1,1) * d_ele +!! + mat_taylor_3e(1,2) * dfdr +!! + mat_taylor_3e(1,3) * d2fdr2 +!! + mat_taylor_3e(1,4) * d3fdr3 +!! d_rj(ICB+1) = mat_taylor_3e(2,1) * d_ele +!! + mat_taylor_3e(2,2) * dfdr +!! + mat_taylor_3e(2,3) * d2fdr2 +!! + mat_taylor_3e(2,4) * d3fdr3 +!! d_rj(ICB+2) = mat_taylor_3e(3,1) * d_ele +!! + mat_taylor_3e(3,2) * dfdr +!! + mat_taylor_3e(3,3) * d2fdr2 +!! + mat_taylor_3e(3,4) * d3fdr3 +!! dfdr(ICB ) = mat_taylor_3e(4,1) * d_ele +!! + mat_taylor_3e(4,2) * dfdr +!! + mat_taylor_3e(4,3) * d2fdr2 +!! + mat_taylor_3e(4,4) * d3fdr3 +!! mat_fdm4_CMB1_free_vp = (mat_taylor_3e)^-1 +!!@endverbatim + real(kind = kreal) :: mat_fdm3e_ICB_hdiv_vp(4,4) +! + real(kind = kreal) :: dr_p1, dr_n1, dr_p2 + integer(kind = kint) :: ierr + real(kind = kreal) :: mat_taylor_3e(4,4) +! +! + dr_n1 = half * r_from_CTR(1) + dr_p1 = half * (r_from_CTR(2) - r_from_CTR(1)) + dr_p2 = half * (r_from_CTR(3) + r_from_CTR(2)) - r_from_CTR(1) +! + mat_taylor_3e(1,1) = one + mat_taylor_3e(1,2) = -dr_n1 + mat_taylor_3e(1,3) = half * dr_n1*dr_n1 + mat_taylor_3e(1,4) = -dr_n1*dr_n1*dr_n1 / six +! + mat_taylor_3e(2,1) = one + mat_taylor_3e(2,2) = dr_p1 + mat_taylor_3e(2,3) = half * dr_p1*dr_p1 + mat_taylor_3e(2,4) = dr_p1*dr_p1*dr_p1 / six +! + mat_taylor_3e(3,1) = one + mat_taylor_3e(3,2) = dr_p2 + mat_taylor_3e(3,3) = half * dr_p2*dr_p2 + mat_taylor_3e(3,4) = dr_p2*dr_p2*dr_p2 / six +! + mat_taylor_3e(4,1) = zero + mat_taylor_3e(4,2) = one + mat_taylor_3e(4,3) = -dr_n1 + mat_taylor_3e(4,4) = half * dr_n1*dr_n1 +! + call cal_inverse_44_matrix(mat_taylor_3e, & + & mat_fdm3e_ICB_hdiv_vp, ierr) +! + if(ierr .eq. 1) then + write(*,*) 'singular matrix cal_fdm3e_inner_hdiv_vp ', & + & dr_p1, dr_n1, dr_p2 + end if +! + fdm3e_CTR%dmat_vp0(-1,1:4) = mat_fdm3e_ICB_hdiv_vp(1:4,1) + fdm3e_CTR%dmat_vp0( 0,1:4) = mat_fdm3e_ICB_hdiv_vp(1:4,2) + fdm3e_CTR%dmat_vp0( 1,1:4) = mat_fdm3e_ICB_hdiv_vp(1:4,3) + fdm3e_CTR%dmat_vp0(-2,1:4) = mat_fdm3e_ICB_hdiv_vp(1:4,4) +! + end subroutine cal_fdm3e_CTR_hdiv_vp +! +! ----------------------------------------------------------------------- +! ----------------------------------------------------------------------- +! + subroutine cal_third_fdm_CTR_ele(i_th, kr_in, nnod_rj, jmax, & + & fdm3e_CTR, d_rj, dfdr_rj, dele_bc) +! + integer(kind = kint), intent(in) :: nnod_rj, jmax + type(fdm3_n2e_CTR_vpol), intent(in) :: fdm3e_CTR + integer(kind = kint), intent(in) :: i_th, kr_in + real(kind = kreal), intent(in) :: d_rj(nnod_rj) + real(kind = kreal), intent(in) :: dfdr_rj(nnod_rj) +! + real(kind = kreal), intent(inout) :: dele_bc(nnod_rj) +! + integer(kind = kint) :: inod, i_p2, i_n1, i_p1, j +! +! +!$omp parallel do private(inod,i_n1,i_p1,i_p2,j) + do j = 1, jmax + inod = j + (kr_in-1) * jmax + i_p1 = j + (kr_in ) * jmax + i_p2 = j + (kr_in+1) * jmax +! + dele_bc(inod) = fdm3e_CTR%dmat_vp0( 1,i_th+1) * d_rj(i_p2) & + & + fdm3e_CTR%dmat_vp0( 0,i_th+1) * d_rj(i_p1) & + & + fdm3e_CTR%dmat_vp0(-1,i_th+1) * d_rj(inod) & + & + fdm3e_CTR%dmat_vp0(-2,i_th+1) * dfdr_rj(inod) + end do +!$omp end parallel do +! + end subroutine cal_third_fdm_CTR_ele +! +! ----------------------------------------------------------------------- +! + end module t_coef_fdm3_n2e_zero_vp_CTR diff --git a/src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm3_n2e_zero_vp_ICB.f90 b/src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm3_n2e_zero_vp_ICB.f90 new file mode 100644 index 00000000..7f87fa07 --- /dev/null +++ b/src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm3_n2e_zero_vp_ICB.f90 @@ -0,0 +1,196 @@ +!>@file t_coef_fdm3_n2e_zero_vp_ICB.f90 +!!@brief module t_coef_fdm3_n2e_zero_vp_ICB +!! +!!@author H. Matsui +!!@date Programmed in May., 2013 +! +!>@brief Matrix to evaluate radial derivative for non-slip at ICB +!! +!!@verbatim +!! subroutine check_fdm3_n2e_ICB_zero_vpol(id_file, fdm3e_vp0_ICB) +!! integer(kind = kint), intent(in) :: id_file +!! type(fdm3_n2e_ICB_zero_vpol), intent(in) :: fdm3e_vp0_ICB +!! subroutine cal_fdm3e_ICB_hdiv_vp(r_from_ICB, fdm3e_vp0_ICB) +!! real(kind = kreal), intent(in) :: r_from_ICB(0:2) +!! type(fdm3_n2e_ICB_zero_vpol), intent(inout) :: fdm3e_vp0_ICB +!! +!! subroutine cal_third_fdm_ICB_ele(i_th, kr_in, nnod_rj, jmax, & +!! & fdm3e_vp0_ICB, d_rj, dfdr_rj, dele_bc) +!! integer(kind = kint), intent(in) :: nnod_rj, jmax +!! type(fdm3_n2e_ICB_zero_vpol), intent(in) :: fdm3e_vp0_ICB +!! integer(kind = kint), intent(in) :: i_th, kr_in +!! real(kind = kreal), intent(in) :: d_rj(nnod_rj) +!! real(kind = kreal), intent(in) :: dfdr_rj(nnod_rj) +!! real(kind = kreal), intent(inout) :: dele_bc(nnod_rj) +!! +!! Matrix for poloidal velocity with horizontal divergence at ICB +!! d_ele = fdm3e_vp0_ICB%dmat_vp0(-2,0) * dfdr(ICB ) +!! + fdm3e_vp0_ICB%dmat_vp0(-1,0) * d_rj(ICB ) +!! + fdm3e_vp0_ICB%dmat_vp0( 0,0) * d_rj(ICB+1) +!! + fdm3e_vp0_ICB%dmat_vp0( 1,0) * d_rj(ICB+2) +!! dfdr = fdm3e_vp0_ICB%dmat_vp0(-2,1) * dfdr(ICB ) +!! + fdm3e_vp0_ICB%dmat_vp0(-1,1) * d_rj(ICB ) +!! + fdm3e_vp0_ICB%dmat_vp0( 0,1) * d_rj(ICB+1) +!! + fdm3e_vp0_ICB%dmat_vp0( 1,1) * d_rj(ICB+2) +!! d2fdr2 = fdm3e_vp0_ICB%dmat_vp0(-2,2) * dfdr(ICB ) +!! + fdm3e_vp0_ICB%dmat_vp0(-1,2) * d_rj(ICB ) +!! + fdm3e_vp0_ICB%dmat_vp0( 0,2) * d_rj(ICB+1) +!! + fdm3e_vp0_ICB%dmat_vp0( 1,2) * d_rj(ICB+2) +!! d3fdr3 = fdm3e_vp0_ICB%dmat_vp0(-2,3) * dfdr(ICB ) +!! + fdm3e_vp0_ICB%dmat_vp0(-1,3) * d_rj(ICB ) +!! + fdm3e_vp0_ICB%dmat_vp0( 0,3) * d_rj(ICB+1) +!! + fdm3e_vp0_ICB%dmat_vp0( 1,3) * dfdr(ICB+2) +!! +!!@endverbatim +!! + module t_coef_fdm3_n2e_zero_vp_ICB +! + use m_precision + use m_constants +! + implicit none +! +! + type fdm3_n2e_ICB_zero_vpol +!> Matrix to evaluate radial derivative at next of center + real(kind = kreal) :: dmat_vp0(-2:1,4) +!> Matrix to evaluate radial derivative at 2nd next of center + real(kind = kreal) :: dmat_vp1(-2:1,4) + end type fdm3_n2e_ICB_zero_vpol +! +! ----------------------------------------------------------------------- +! + contains +! +! ----------------------------------------------------------------------- +! + subroutine check_fdm3_n2e_ICB_zero_vpol(id_file, fdm3e_vp0_ICB) +! + integer(kind = kint), intent(in) :: id_file + type(fdm3_n2e_ICB_zero_vpol), intent(in) :: fdm3e_vp0_ICB +! +! + write(id_file,*) ' fdm3e_vp0_ICB%dmat_vp0' + write(id_file,*) 'matrix for Interpolation' + write(id_file,'(1p9E25.15e3)') fdm3e_vp0_ICB%dmat_vp0(-2:1,1) + write(id_file,*) 'matrix for dfdr' + write(id_file,'(1p9E25.15e3)') fdm3e_vp0_ICB%dmat_vp0(-2:1,2) + write(id_file,*) 'matrix for d2fdr2' + write(id_file,'(1p9E25.15e3)') fdm3e_vp0_ICB%dmat_vp0(-2:1,3) + write(id_file,*) 'matrix for d3fdr3' + write(id_file,'(1p9E25.15e3)') fdm3e_vp0_ICB%dmat_vp0(-2:1,4) +! + end subroutine check_fdm3_n2e_ICB_zero_vpol +! +! ----------------------------------------------------------------------- +! ----------------------------------------------------------------------- +! + subroutine cal_fdm3e_ICB_hdiv_vp(r_from_ICB, fdm3e_vp0_ICB) +! + use cal_inverse_small_matrix +! + real(kind = kreal), intent(in) :: r_from_ICB(0:2) + type(fdm3_n2e_ICB_zero_vpol), intent(inout) :: fdm3e_vp0_ICB +! +!> Work matrix to evaluate fdm3e_vp0_ICB%dmat_vp0 +!!@verbatim +!! d_rj(ICB ) = mat_taylor_3e(1,1) * d_ele +!! + mat_taylor_3e(1,2) * dfdr +!! + mat_taylor_3e(1,3) * d2fdr2 +!! + mat_taylor_3e(1,4) * d3fdr3 +!! d_rj(ICB+1) = mat_taylor_3e(2,1) * d_ele +!! + mat_taylor_3e(2,2) * dfdr +!! + mat_taylor_3e(2,3) * d2fdr2 +!! + mat_taylor_3e(2,4) * d3fdr3 +!! d_rj(ICB+2) = mat_taylor_3e(3,1) * d_ele +!! + mat_taylor_3e(3,2) * dfdr +!! + mat_taylor_3e(3,3) * d2fdr2 +!! + mat_taylor_3e(3,4) * d3fdr3 +!! dfdr(ICB ) = mat_taylor_3e(4,1) * d_ele +!! + mat_taylor_3e(4,2) * dfdr +!! + mat_taylor_3e(4,3) * d2fdr2 +!! + mat_taylor_3e(4,4) * d3fdr3 +!! mat_fdm4_CMB1_free_vp = (mat_taylor_3e)^-1 +!!@endverbatim + real(kind = kreal) :: mat_fdm3e_ICB_hdiv_vp(4,4) +! + integer(kind = kint) :: ierr + real(kind = kreal) :: dr_p1, dr_n1, dr_p2 + real(kind = kreal) :: mat_taylor_3e(4,4) +! +! + dr_n1 = half * (r_from_ICB(1) - r_from_ICB(0)) + dr_p1 = half * (r_from_ICB(1) - r_from_ICB(0)) + dr_p2 = half * (r_from_ICB(2) + r_from_ICB(1)) - r_from_ICB(0) +! + mat_taylor_3e(1,1) = one + mat_taylor_3e(1,2) = -dr_n1 + mat_taylor_3e(1,3) = half * dr_n1*dr_n1 + mat_taylor_3e(1,4) = -dr_n1*dr_n1*dr_n1 / six +! + mat_taylor_3e(2,1) = one + mat_taylor_3e(2,2) = dr_p1 + mat_taylor_3e(2,3) = half * dr_p1*dr_p1 + mat_taylor_3e(2,4) = dr_p1*dr_p1*dr_p1 / six +! + mat_taylor_3e(3,1) = one + mat_taylor_3e(3,2) = dr_p2 + mat_taylor_3e(3,3) = half * dr_p2*dr_p2 + mat_taylor_3e(3,4) = dr_p2*dr_p2*dr_p2 / six +! + mat_taylor_3e(4,1) = zero + mat_taylor_3e(4,2) = one + mat_taylor_3e(4,3) = -dr_n1 + mat_taylor_3e(4,4) = half * dr_n1*dr_n1 +! + call cal_inverse_44_matrix(mat_taylor_3e, & + & mat_fdm3e_ICB_hdiv_vp, ierr) +! + if(ierr .eq. 1) then + write(*,*) 'singular matrix cal_fdm3e_inner_hdiv_vp ', & + & dr_p1, dr_n1, dr_p2 + end if +! + fdm3e_vp0_ICB%dmat_vp0(-1,1:4) = mat_fdm3e_ICB_hdiv_vp(1:4,1) + fdm3e_vp0_ICB%dmat_vp0( 0,1:4) = mat_fdm3e_ICB_hdiv_vp(1:4,2) + fdm3e_vp0_ICB%dmat_vp0( 1,1:4) = mat_fdm3e_ICB_hdiv_vp(1:4,3) + fdm3e_vp0_ICB%dmat_vp0(-2,1:4) = mat_fdm3e_ICB_hdiv_vp(1:4,4) +! + end subroutine cal_fdm3e_ICB_hdiv_vp +! +! ----------------------------------------------------------------------- +! ----------------------------------------------------------------------- +! + subroutine cal_third_fdm_ICB_ele(i_th, kr_in, nnod_rj, jmax, & + & fdm3e_vp0_ICB, d_rj, dfdr_rj, dele_bc) +! + integer(kind = kint), intent(in) :: nnod_rj, jmax + type(fdm3_n2e_ICB_zero_vpol), intent(in) :: fdm3e_vp0_ICB + integer(kind = kint), intent(in) :: i_th, kr_in + real(kind = kreal), intent(in) :: d_rj(nnod_rj) + real(kind = kreal), intent(in) :: dfdr_rj(nnod_rj) +! + real(kind = kreal), intent(inout) :: dele_bc(nnod_rj) +! + integer(kind = kint) :: inod, i_p2, i_n1, i_p1, j +! +! +!$omp parallel do private(inod,i_n1,i_p1,i_p2,j) + do j = 1, jmax + inod = j + (kr_in-1) * jmax + i_p1 = j + (kr_in ) * jmax + i_p2 = j + (kr_in+1) * jmax +! + dele_bc(inod) = fdm3e_vp0_ICB%dmat_vp0( 1,i_th+1) * d_rj(i_p2) & + & + fdm3e_vp0_ICB%dmat_vp0( 0,i_th+1) * d_rj(i_p1) & + & + fdm3e_vp0_ICB%dmat_vp0(-1,i_th+1) * d_rj(inod) & + & + fdm3e_vp0_ICB%dmat_vp0(-2,i_th+1) & + & * dfdr_rj(inod) + end do +!$omp end parallel do +! + end subroutine cal_third_fdm_ICB_ele +! +! ----------------------------------------------------------------------- +! + end module t_coef_fdm3_n2e_zero_vp_ICB diff --git a/src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm4_free_vpol_CMB.f90 b/src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm4_free_vpol_CMB.f90 new file mode 100644 index 00000000..efc303bd --- /dev/null +++ b/src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm4_free_vpol_CMB.f90 @@ -0,0 +1,265 @@ +!>@file t_coef_fdm4_free_vpol_CMB.f90 +!!@brief module t_coef_fdm4_free_vpol_CMB +!! +!!@author H. Matsui +!!@date Programmed in May., 2013 +! +!>@brief Matrix to evaluate radial derivative for non-slip at ICB +!! +!!@verbatim +!! subroutine check_4th_CMB_free_vp_fdm(fdm4_free_vp_CMB) +!! type(fdm4_CMB_free_vpol), intent(in) :: fdm4_free_vp_CMB +!! subroutine cal_fdm4_CMB0_free_vp(r_from_CMB, fdm4_free_vp_CMB) +!! subroutine cal_fdm4_CMB1_free_vp(r_from_CMB, fdm4_free_vp_CMB) +!! real(kind = kreal), intent(in) :: r_from_CMB(-3:0) +!! type(fdm4_CMB_free_vpol), intent(inout) :: fdm4_free_vp_CMB +!! +!! Matrix for poloidal velocity with free-slip boundary at CMB +!! dfdr = fdm4_free_vp_CMB%dmat_vp0(-2,2) * d_rj(CMB-2) +!! + fdm4_free_vp_CMB%dmat_vp0(-1,2) * d_rj(CMB-1) +!! + fdm4_free_vp_CMB%dmat_vp0( 0,2) * d_rj(CMB ) +!! d2fdr2 = fdm4_free_vp_CMB%dmat_vp0(-2,3) * d_rj(CMB-2) +!! + fdm4_free_vp_CMB%dmat_vp0(-1,3) * d_rj(CMB-1) +!! + fdm4_free_vp_CMB%dmat_vp0( 0,3) * d_rj(CMB ) +!! d3fdr3 = fdm4_free_vp_CMB%dmat_vp0(-2,4) * d_rj(CMB-2) +!! + fdm4_free_vp_CMB%dmat_vp0(-1,4) * d_rj(CMB-1) +!! + fdm4_free_vp_CMB%dmat_vp0( 0,4) * d_rj(CMB ) +!! d4fdr4 = fdm4_free_vp_CMB%dmat_vp0(-2,5) * d_rj(CMB-2) +!! + fdm4_free_vp_CMB%dmat_vp0(-1,5) * d_rj(CMB-1) +!! + fdm4_free_vp_CMB%dmat_vp0( 0,5) * d_rj(CMB ) +!! +!! Matrix for poloidal velocity with free-slip boundary at next of CMB +!! dfdr = fdm4_free_vp_CMB%dmat_vp1(-2,2) * d_rj(CMB-3) +!! + fdm4_free_vp_CMB%dmat_vp1(-1,2) * d_rj(CMB-2) +!! + fdm4_free_vp_CMB%dmat_vp1( 0,2) * d_rj(CMB-1) +!! + fdm4_free_vp_CMB%dmat_vp1( 1,2) * d_rj(CMB ) +!! d2fdr2 = fdm4_free_vp_CMB%dmat_vp1(-2,3) * d_rj(CMB-3) +!! + fdm4_free_vp_CMB%dmat_vp1(-1,3) * d_rj(CMB-2) +!! + fdm4_free_vp_CMB%dmat_vp1( 0,3) * d_rj(CMB-1) +!! + fdm4_free_vp_CMB%dmat_vp1( 1,3) * d_rj(CMB ) +!! d3fdr3 = fdm4_free_vp_CMB%dmat_vp1(-2,4) * d_rj(CMB-3) +!! + fdm4_free_vp_CMB%dmat_vp1(-1,4) * d_rj(CMB-2) +!! + fdm4_free_vp_CMB%dmat_vp1( 0,4) * d_rj(CMB-1) +!! + fdm4_free_vp_CMB%dmat_vp1( 1,4) * d_rj(CMB ) +!! d4fdr4 = fdm4_free_vp_CMB%dmat_vp1(-2,5) * d_rj(CMB-3) +!! + fdm4_free_vp_CMB%dmat_vp1(-1,5) * d_rj(CMB-2) +!! + fdm4_free_vp_CMB%dmat_vp1( 0,5) * d_rj(CMB-1) +!! + fdm4_free_vp_CMB%dmat_vp1(-1,5) * d_rj(CMB ) +!!@endverbatim +!! + module t_coef_fdm4_free_vpol_CMB +! + use m_precision + use m_constants +! + implicit none +! + type fdm4_CMB_free_vpol +!> Matrix to evaluate radial derivative at CMB + real(kind = kreal) :: dmat_vp0(-2:2,1:5) +!> Matrix to evaluate radial derivative at next of CMB + real(kind = kreal) :: dmat_vp1(-2:2,1:5) + end type fdm4_CMB_free_vpol +! +! ----------------------------------------------------------------------- +! + contains +! +! ----------------------------------------------------------------------- +! + subroutine check_4th_CMB_free_vp_fdm(fdm4_free_vp_CMB) +! + type(fdm4_CMB_free_vpol), intent(in) :: fdm4_free_vp_CMB +! +! + write(50,*) ' free slip boundary' + write(50,*) ' fdm4_free_vp_CMB%dmat_vp0' + write(50,*) 'matrix for dfdr' + write(50,'(1p9E25.15e3)') fdm4_free_vp_CMB%dmat_vp0(-2:0,2) + write(50,*) 'matrix for d3fdr3' + write(50,'(1p9E25.15e3)') fdm4_free_vp_CMB%dmat_vp0(-2:0,3) + write(50,*) 'matrix for d3fdr3' + write(50,'(1p9E25.15e3)') fdm4_free_vp_CMB%dmat_vp0(-2:0,4) +! + write(50,*) ' fdm4_free_vp_CMB%dmat_vp1' + write(50,*) 'matrix for dfdr' + write(50,'(1p9E25.15e3)') fdm4_free_vp_CMB%dmat_vp1(-2:1,2) + write(50,*) 'matrix for d2fdr2' + write(50,'(1p9E25.15e3)') fdm4_free_vp_CMB%dmat_vp1(-2:1,3) + write(50,*) 'matrix for d3fdr3' + write(50,'(1p9E25.15e3)') fdm4_free_vp_CMB%dmat_vp1(-2:1,4) + write(50,*) 'matrix for d4fdr4' + write(50,'(1p9E25.15e3)') fdm4_free_vp_CMB%dmat_vp1(-2:1,5) +! + end subroutine check_4th_CMB_free_vp_fdm +! +! ----------------------------------------------------------------------- +! + subroutine cal_fdm4_CMB0_free_vp(r_from_CMB, fdm4_free_vp_CMB) +! + use cal_inverse_small_matrix +! + real(kind = kreal), intent(in) :: r_from_CMB(-3:0) + type(fdm4_CMB_free_vpol), intent(inout) :: fdm4_free_vp_CMB +! +!> Work matrix to evaluate fdm4_free_vp_CMB%dmat_vp0 +!!@verbatim +!! dfdr = mat_fdm4_CMB_free_vp(2,4) * d_rj(CMB-2) +!! + mat_fdm4_CMB_free_vp(2,3) * d_rj(CMB-1) +!! + mat_fdm4_CMB_free_vp(2,1) * d_rj(CMB ) +!! + mat_fdm4_CMB_free_vp(2,2) * B.C. (=0) +!! d2fdr2 = mat_fdm4_CMB_free_vp(2,4) * d_rj(CMB-2) +!! + mat_fdm4_CMB_free_vp(2,3) * d_rj(CMB-1) +!! + mat_fdm4_CMB_free_vp(2,1) * d_rj(CMB ) +!! + mat_fdm4_CMB_free_vp(2,2) * B.C. (=0) +!! d3fdr3 = mat_fdm4_CMB_free_vp(4,4) * d_rj(CMB-2) +!! + mat_fdm4_CMB_free_vp(4,3) * d_rj(CMB-1) +!! + mat_fdm4_CMB_free_vp(4,1) * d_rj(CMB ) +!! + mat_fdm4_CMB_free_vp(4,2) * B.C. (=0) +!!@endverbatim + real(kind = kreal) :: mat_fdm4_CMB_free_vp(4,4) +! + integer(kind = kint) :: ierr + real(kind = kreal) :: mat_taylor_4(4,4) + real(kind = kreal) :: dr_n1, dr_n2, r0 +! +! + r0 = r_from_CMB(0) + dr_n1 = r_from_CMB(0) - r_from_CMB(-1) + dr_n2 = r_from_CMB(0) - r_from_CMB(-2) +! + mat_taylor_4(1,1) = one + mat_taylor_4(1,2) = zero + mat_taylor_4(1,3) = zero + mat_taylor_4(1,4) = zero +! + mat_taylor_4(2,1) = one + mat_taylor_4(2,2) = -r0 + mat_taylor_4(2,3) = half * r0*r0 + mat_taylor_4(2,4) = zero +! + mat_taylor_4(3,1) = one + mat_taylor_4(3,2) = -dr_n1 + mat_taylor_4(3,3) = dr_n1*dr_n1 / two + mat_taylor_4(3,4) = -dr_n1**3 / six +! + mat_taylor_4(4,1) = one + mat_taylor_4(4,2) = -dr_n2 + mat_taylor_4(4,3) = dr_n2*dr_n2 / two + mat_taylor_4(4,4) = -dr_n2**3 / six +! + call cal_inverse_44_matrix(mat_taylor_4, & + & mat_fdm4_CMB_free_vp, ierr) +! + if(ierr .eq. 1) then + write(*,*) 'singular matrix cal_fdm4_CMB0_free_vp ', & + & r_from_CMB(0) + end if +! + fdm4_free_vp_CMB%dmat_vp1(-2,5) = zero + fdm4_free_vp_CMB%dmat_vp1(-1,5) = zero + fdm4_free_vp_CMB%dmat_vp1( 0,5) = zero + fdm4_free_vp_CMB%dmat_vp0(-2,1:4) = mat_fdm4_CMB_free_vp(1:4,4) + fdm4_free_vp_CMB%dmat_vp0(-1,1:4) = mat_fdm4_CMB_free_vp(1:4,3) + fdm4_free_vp_CMB%dmat_vp0( 0,1:4) = mat_fdm4_CMB_free_vp(1:4,1) + fdm4_free_vp_CMB%dmat_vp1( 1,1:5) = zero + fdm4_free_vp_CMB%dmat_vp1( 2,1:5) = zero +! + end subroutine cal_fdm4_CMB0_free_vp +! +! ----------------------------------------------------------------------- +! + subroutine cal_fdm4_CMB1_free_vp(r_from_CMB, fdm4_free_vp_CMB) +! + use cal_inverse_small_matrix +! + real(kind = kreal), intent(in) :: r_from_CMB(-3:0) + type(fdm4_CMB_free_vpol), intent(inout) :: fdm4_free_vp_CMB +! +!> Work matrix to evaluate fdm4_free_vp_CMB%dmat_vp1(-1:1,3) +!!@verbatim +!! dfdr = mat_fdm4_CMB1_free_vp(2,5) * d_rj(CMB-3) +!! + mat_fdm4_CMB1_free_vp(2,4) * d_rj(CMB-2) +!! + mat_fdm4_CMB1_free_vp(2,1) * d_rj(CMB-1) +!! + mat_fdm4_CMB1_free_vp(2,3) * d_rj(CMB ) +!! + mat_fdm4_CMB1_free_vp(2,2) * B.C. (=0) +!! d2fdr2 = mat_fdm4_CMB1_free_vp(3,5) * d_rj(CMB-3) +!! + mat_fdm4_CMB1_free_vp(3,4) * d_rj(CMB-2) +!! + mat_fdm4_CMB1_free_vp(3,1) * d_rj(CMB-1) +!! + mat_fdm4_CMB1_free_vp(3,3) * d_rj(CMB ) +!! + mat_fdm4_CMB1_free_vp(3,2) * B.C. (=0) +!! d3fdr3 = mat_fdm4_CMB1_free_vp(4,5) * d_rj(CMB-3) +!! + mat_fdm4_CMB1_free_vp(4,4) * d_rj(CMB-2) +!! + mat_fdm4_CMB1_free_vp(4,1) * d_rj(CMB-1) +!! + mat_fdm4_CMB1_free_vp(4,3) * d_rj(CMB ) +!! + mat_fdm4_CMB1_free_vp(4,2) * B.C. (=0) +!! d4fdr4 = mat_fdm4_CMB1_free_vp(5,5) * d_rj(CMB-3) +!! + mat_fdm4_CMB1_free_vp(5,4) * d_rj(CMB-2) +!! + mat_fdm4_CMB1_free_vp(5,1) * d_rj(CMB-1) +!! + mat_fdm4_CMB1_free_vp(5,3) * d_rj(CMB ) +!! + mat_fdm4_CMB1_free_vp(5,2) * B.C. (=0) +!!@endverbatim + real(kind = kreal) :: mat_fdm4_CMB1_free_vp(5,5) +! + integer(kind = kint) :: ierr + real(kind = kreal) :: mat_taylor_5(5,5) + real(kind = kreal) :: dr_p1, dr_n1, dr_n2, r0 +! +! + r0 = r_from_CMB(0) + dr_p1 = r_from_CMB( 0) - r_from_CMB(-1) + dr_n1 = r_from_CMB(-1) - r_from_CMB(-2) + dr_n2 = r_from_CMB(-1) - r_from_CMB(-3) +! + mat_taylor_5(1,1) = one + mat_taylor_5(1,2) = zero + mat_taylor_5(1,3) = zero + mat_taylor_5(1,4) = zero + mat_taylor_5(1,5) = zero +! + mat_taylor_5(2,1) = one + mat_taylor_5(2,2) = dr_p1 - r0 + mat_taylor_5(2,3) = dr_p1*dr_p1 / two - r0*dr_p1 & + & + half*r0*r0 + mat_taylor_5(2,4) = dr_p1**3 / six - r0*dr_p1*dr_p1 / two & + & + half*r0*r0 * dr_p1 + mat_taylor_5(2,5) = dr_p1**4 / (six*four) - r0*dr_p1**3 / six & + & + half*r0*r0 * dr_p1*dr_p1 / two +! + mat_taylor_5(3,1) = one + mat_taylor_5(3,2) = dr_p1 + mat_taylor_5(3,3) = dr_p1*dr_p1 / two + mat_taylor_5(3,4) = dr_p1**3 / six + mat_taylor_5(3,5) = dr_p1**4 / (six*four) +! + mat_taylor_5(4,1) = one + mat_taylor_5(4,2) =-dr_n1 + mat_taylor_5(4,3) = dr_n1*dr_n1 / two + mat_taylor_5(4,4) =-dr_n1**3 / six + mat_taylor_5(4,5) = dr_n1**4 / (six*four) +! + mat_taylor_5(5,1) = one + mat_taylor_5(5,2) =-dr_n2 + mat_taylor_5(5,3) = dr_n2*dr_n2 / two + mat_taylor_5(5,4) =-dr_n2**3 / six + mat_taylor_5(5,5) = dr_n2**4 / (six*four) +! + call cal_inverse_nn_matrix(ifive, mat_taylor_5, & + & mat_fdm4_CMB1_free_vp, ierr) +! + if(ierr .eq. 1) then + write(*,*) 'singular matrix mat_fdm4_CMB1_free_vp ', & + & r_from_CMB(0) + end if +! + fdm4_free_vp_CMB%dmat_vp1(-2,1:5) = mat_fdm4_CMB1_free_vp(1:5,5) + fdm4_free_vp_CMB%dmat_vp1(-1,1:5) = mat_fdm4_CMB1_free_vp(1:5,4) + fdm4_free_vp_CMB%dmat_vp1( 0,1:5) = mat_fdm4_CMB1_free_vp(1:5,1) + fdm4_free_vp_CMB%dmat_vp1( 1,1:5) = mat_fdm4_CMB1_free_vp(1:5,3) + fdm4_free_vp_CMB%dmat_vp1( 2,1:5) = zero +! + end subroutine cal_fdm4_CMB1_free_vp +! +! ----------------------------------------------------------------------- +! + end module t_coef_fdm4_free_vpol_CMB diff --git a/src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm4_free_vpol_ICB.f90 b/src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm4_free_vpol_ICB.f90 new file mode 100644 index 00000000..49ef701e --- /dev/null +++ b/src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm4_free_vpol_ICB.f90 @@ -0,0 +1,266 @@ +!>@file t_coef_fdm4_free_vpol_ICB.f90 +!!@brief module t_coef_fdm4_free_vpol_ICB +!! +!!@author H. Matsui +!!@date Programmed in May., 2013 +! +!>@brief Matrix to evaluate radial derivative for non-slip at ICB +!! +!!@verbatim +!! subroutine check_4th_ICB_free_vp_fdm(fdm4_free_ICB) +!! type(fdm4_ICB_free_vpol), intent(in) :: fdm4_free_ICB +!! subroutine cal_fdm4_ICB0_free_vp(h_rho, r_from_ICB, & +!! & fdm4_free_ICB) +!! real(kind = kreal), intent(in) :: h_rho +!! real(kind = kreal), intent(in) :: r_from_ICB(0:2) +!! type(fdm4_ICB_free_vpol), intent(inout) :: fdm4_free_ICB +!! subroutine cal_fdm4_ICB1_free_vp(r_from_ICB, fdm4_free_ICB) +!! real(kind = kreal), intent(in) :: r_from_ICB(0:3) +!! type(fdm4_ICB_free_vpol), intent(inout) :: fdm4_free_ICB +!! +!! Matrix for poloidal velocity with free-slip boundary at ICB +!! dfdr = fdm4_free_ICB%dmat_vp1( 2,2) * d_rj(3) +!! + fdm4_free_ICB%dmat_vp1( 1,2) * d_rj(2) +!! + fdm4_free_ICB%dmat_vp1( 0,2) * d_rj(1) +!! d2fdr2 = fdm4_free_ICB%dmat_vp1( 2,3) * d_rj(3) +!! + fdm4_free_ICB%dmat_vp1( 1,3) * d_rj(2) +!! + fdm4_free_ICB%dmat_vp1( 0,3) * d_rj(1) +!! d3fdr3 = fdm4_free_ICB%dmat_vp1( 2,4) * d_rj(3) +!! + fdm4_free_ICB%dmat_vp1( 1,4) * d_rj(2) +!! + fdm4_free_ICB%dmat_vp1( 0,4) * d_rj(1) +!! d4fdr4 = fdm4_free_ICB%dmat_vp1( 2,5) * d_rj(3) +!! + fdm4_free_ICB%dmat_vp1( 1,5) * d_rj(2) +!! + fdm4_free_ICB%dmat_vp1( 0,5) * d_rj(1) +!! +!! Matrix for poloidal velocity with free-slip boundary at next of ICB +!! dfdr = fdm4_free_ICB%dmat_vp1( 2,2) * d_rj(ICB+3) +!! + fdm4_free_ICB%dmat_vp1( 1,2) * d_rj(ICB+2) +!! + fdm4_free_ICB%dmat_vp1( 0,2) * d_rj(ICB+1) +!! + fdm4_free_ICB%dmat_vp1(-1,2) * d_rj(ICB ) +!! d2fdr2 = fdm4_free_ICB%dmat_vp1( 2,3) * d_rj(ICB+3) +!! + fdm4_free_ICB%dmat_vp1( 1,3) * d_rj(ICB+2) +!! + fdm4_free_ICB%dmat_vp1( 0,3) * d_rj(ICB+1) +!! + fdm4_free_ICB%dmat_vp1(-1,3) * d_rj(ICB ) +!! d3fdr3 = fdm4_free_ICB%dmat_vp1( 2,4) * d_rj(ICB+3) +!! + fdm4_free_ICB%dmat_vp1( 1,4) * d_rj(ICB+2) +!! + fdm4_free_ICB%dmat_vp1( 0,4) * d_rj(ICB+1) +!! + fdm4_free_ICB%dmat_vp1(-1,4) * d_rj(ICB ) +!! d4fdr4 = fdm4_free_ICB%dmat_vp1( 2,5) * d_rj(ICB+3) +!! + fdm4_free_ICB%dmat_vp1( 1,5) * d_rj(ICB+2) +!! + fdm4_free_ICB%dmat_vp1( 0,5) * d_rj(ICB+1) +!! + fdm4_free_ICB%dmat_vp1(-1,5) * d_rj(ICB ) +!!@endverbatim +!! + module t_coef_fdm4_free_vpol_ICB +! + use m_precision + use m_constants +! + implicit none +! + type fdm4_ICB_free_vpol +!> Matrix to evaluate radial derivative at ICB + real(kind = kreal) :: dmat_vp0(-2:2,1:5) +!> Matrix to evaluate radial derivative at next of ICB + real(kind = kreal) :: dmat_vp1(-2:2,1:5) + end type fdm4_ICB_free_vpol +! +! ----------------------------------------------------------------------- +! + contains +! +! ----------------------------------------------------------------------- +! + subroutine check_4th_ICB_free_vp_fdm(fdm4_free_ICB) +! + type(fdm4_ICB_free_vpol), intent(in) :: fdm4_free_ICB +! +! + write(50,*) ' free slip boundary at ICB' + write(50,*) ' fdm4_free_ICB%dmat_vp0' + write(50,*) 'matrix for dfdr' + write(50,'(1p9E25.15e3)') fdm4_free_ICB%dmat_vp0(0:2,2) + write(50,*) 'matrix for d2fdr2' + write(50,'(1p9E25.15e3)') fdm4_free_ICB%dmat_vp0(0:2,3) + write(50,*) 'matrix for d3fdr3' + write(50,'(1p9E25.15e3)') fdm4_free_ICB%dmat_vp0(0:2,4) +! + write(50,*) ' fdm4_free_ICB%dmat_vp1' + write(50,*) 'matrix for dfdr' + write(50,'(1p9E25.15e3)') fdm4_free_ICB%dmat_vp1(-1:2,2) + write(50,*) 'matrix for d2fdr2' + write(50,'(1p9E25.15e3)') fdm4_free_ICB%dmat_vp1(-1:2,3) + write(50,*) 'matrix for d3fdr3' + write(50,'(1p9E25.15e3)') fdm4_free_ICB%dmat_vp1(-1:2,4) + write(50,*) 'matrix for d4fdr4' + write(50,'(1p9E25.15e3)') fdm4_free_ICB%dmat_vp1(-1:2,5) +! + end subroutine check_4th_ICB_free_vp_fdm +! +! ----------------------------------------------------------------------- +! ----------------------------------------------------------------------- +! + subroutine cal_fdm4_ICB0_free_vp(h_rho, r_from_ICB, & + & fdm4_free_ICB) +! + real(kind = kreal), intent(in) :: h_rho + real(kind = kreal), intent(in) :: r_from_ICB(0:2) + type(fdm4_ICB_free_vpol), intent(inout) :: fdm4_free_ICB +! +!> Work matrix to evaluate fdm4_free_ICB%dmat_vp0(0:2,2:4) +!!@verbatim +!! dfdr = mat_fdm4_ICB_free_vp(2,4) * d_rj(ICB+2) +!! + mat_fdm4_ICB_free_vp(2,3) * d_rj(ICB+1) +!! + mat_fdm4_ICB_free_vp(2,1) * d_rj(ICB ) +!! + mat_fdm4_ICB_free_vp(2,2) * B.C. (=0) +!! d2fdr2 = mat_fdm4_ICB_free_vp(3,4) * d_rj(ICB+2) +!! + mat_fdm4_ICB_free_vp(3,3) * d_rj(ICB+1) +!! + mat_fdm4_ICB_free_vp(3,1) * d_rj(ICB ) +!! + mat_fdm4_ICB_free_vp(3,2) * B.C. (=0) +!! d3fdr3 = mat_fdm4_ICB_free_vp(4,4) * d_rj(ICB+2) +!! + mat_fdm4_ICB_free_vp(4,3) * d_rj(ICB+1) +!! + mat_fdm4_ICB_free_vp(4,1) * d_rj(ICB ) +!! + mat_fdm4_ICB_free_vp(4,2) * B.C. (=0) +!!@endverbatim + real(kind = kreal) :: mat_fdm4_ICB_free_vp(4,4) +! + integer(kind = kint) :: ierr + real(kind = kreal) :: mat_taylor_4(4,4) + real(kind = kreal) :: dr_p1, dr_p2, r0 +! +! + r0 = r_from_ICB(0) + dr_p1 = r_from_ICB(1) - r_from_ICB(0) + dr_p2 = r_from_ICB(2) - r_from_ICB(0) +! + mat_taylor_4(1,1) = one + mat_taylor_4(1,2) = zero + mat_taylor_4(1,3) = zero + mat_taylor_4(1,4) = zero +! + mat_taylor_4(2,1) = zero + mat_taylor_4(2,2) = -(two / r0 + h_rho) + mat_taylor_4(2,3) = one + mat_taylor_4(2,4) = zero +! + mat_taylor_4(3,1) = one + mat_taylor_4(3,2) = dr_p1 + mat_taylor_4(3,3) = half * dr_p1*dr_p1 + mat_taylor_4(3,4) = (one/six) * dr_p1**3 +! + mat_taylor_4(4,1) = one + mat_taylor_4(4,2) = dr_p2 + mat_taylor_4(4,3) = half * dr_p2*dr_p2 + mat_taylor_4(4,4) = (one/six) * dr_p2**3 +! + call cal_inverse_44_matrix(mat_taylor_4, mat_fdm4_ICB_free_vp, & + & ierr) +! + if(ierr .eq. 1) then + write(*,*) 'singular matrix cal_fdm4_ICB0_free_vp ', & + & r_from_ICB(0) + end if +! + fdm4_free_ICB%dmat_vp0(-2,1:4) = zero + fdm4_free_ICB%dmat_vp0(-1,1:4) = zero + fdm4_free_ICB%dmat_vp0( 0,1:4) = mat_fdm4_ICB_free_vp(1:4,1) + fdm4_free_ICB%dmat_vp0( 1,1:4) = mat_fdm4_ICB_free_vp(1:4,3) + fdm4_free_ICB%dmat_vp0( 2,1:4) = mat_fdm4_ICB_free_vp(1:4,4) + fdm4_free_ICB%dmat_vp0(-2:2,5) = zero +! + end subroutine cal_fdm4_ICB0_free_vp +! +! ----------------------------------------------------------------------- +! + subroutine cal_fdm4_ICB1_free_vp(r_from_ICB, fdm4_free_ICB) +! + real(kind = kreal), intent(in) :: r_from_ICB(0:3) + type(fdm4_ICB_free_vpol), intent(inout) :: fdm4_free_ICB +! +!> Work matrix to evaluate fdm4_free_ICB%dmat_vp1(-1:1,5) +!!@verbatim +!! dfdr = mat_fdm4_ICB1_free_vp(2,5) * d_rj(ICB+3) +!! + mat_fdm4_ICB1_free_vp(2,4) * d_rj(ICB+2) +!! + mat_fdm4_ICB1_free_vp(2,1) * d_rj(ICB+1) +!! + mat_fdm4_ICB1_free_vp(2,3) * d_rj(ICB ) +!! + mat_fdm4_ICB1_free_vp(2,2) * B.C. (=0) +!! d2fdr2 = mat_fdm4_ICB1_free_vp(3,5) * d_rj(ICB+3) +!! + mat_fdm4_ICB1_free_vp(3,4) * d_rj(ICB+2) +!! + mat_fdm4_ICB1_free_vp(3,1) * d_rj(ICB+1) +!! + mat_fdm4_ICB1_free_vp(3,3) * d_rj(ICB ) +!! + mat_fdm4_ICB1_free_vp(3,2) * B.C. (=0) +!! d3fdr3 = mat_fdm4_ICB1_free_vp(4,5) * d_rj(ICB+3) +!! + mat_fdm4_ICB1_free_vp(4,4) * d_rj(ICB+2) +!! + mat_fdm4_ICB1_free_vp(4,1) * d_rj(ICB+1) +!! + mat_fdm4_ICB1_free_vp(4,3) * d_rj(ICB ) +!! + mat_fdm4_ICB1_free_vp(4,2) * B.C. (=0) +!! d4fdr4 = mat_fdm4_ICB1_free_vp(5,5) * d_rj(ICB+3) +!! + mat_fdm4_ICB1_free_vp(5,4) * d_rj(ICB+2) +!! + mat_fdm4_ICB1_free_vp(5,1) * d_rj(ICB+1) +!! + mat_fdm4_ICB1_free_vp(5,3) * d_rj(ICB ) +!! + mat_fdm4_ICB1_free_vp(5,2) * B.C. (=0) +!!@endverbatim + real(kind = kreal) :: mat_fdm4_ICB1_free_vp(5,5) +! + integer(kind = kint) :: ierr + real(kind = kreal) :: mat_taylor_5(5,5) + real(kind = kreal) :: dr_p1, dr_n1, dr_p2, r0 +! +! + r0 = r_from_ICB(0) + dr_n1 = r_from_ICB(1) - r_from_ICB(0) + dr_p1 = r_from_ICB(2) - r_from_ICB(1) + dr_p2 = r_from_ICB(3) - r_from_ICB(1) +! + mat_taylor_5(1,1) = one + mat_taylor_5(1,2) = zero + mat_taylor_5(1,3) = zero + mat_taylor_5(1,4) = zero + mat_taylor_5(1,5) = zero +! + mat_taylor_5(2,1) = one + mat_taylor_5(2,2) =-dr_n1 - r0 + mat_taylor_5(2,3) = dr_n1*dr_n1 / two + r0*dr_n1 & + & + half*r0*r0 + mat_taylor_5(2,4) =-dr_n1**3 / six - r0*dr_n1*dr_n1 / two & + & - half*r0*r0*dr_n1 + mat_taylor_5(2,5) = dr_n1**4 / (six*four) + r0*dr_n1**3 / six & + & + half*r0*r0*dr_n1*dr_n1 / two +! + mat_taylor_5(3,1) = one + mat_taylor_5(3,2) =-dr_n1 + mat_taylor_5(3,3) = dr_n1*dr_n1 / two + mat_taylor_5(3,4) =-dr_n1**3 / six + mat_taylor_5(3,5) = dr_n1**4 / (six*four) +! + mat_taylor_5(4,1) = one + mat_taylor_5(4,2) = dr_p1 + mat_taylor_5(4,3) = dr_p1*dr_p1 / two + mat_taylor_5(4,4) = dr_p1**3 / six + mat_taylor_5(4,5) = dr_p1**4 / (six*four) +! + mat_taylor_5(5,1) = one + mat_taylor_5(5,2) = dr_p2 + mat_taylor_5(5,3) = dr_p2*dr_p2 / two + mat_taylor_5(5,4) = dr_p2**3 / six + mat_taylor_5(5,5) = dr_p2**4 / (six*four) +! + call cal_inverse_nn_matrix(ifive, mat_taylor_5, & + & mat_fdm4_ICB1_free_vp, ierr) +! + if(ierr .eq. 1) then + write(*,*) 'singular matrix cal_fdm4_ICB1_free_vp ', & + & r_from_ICB(0) + end if +! + fdm4_free_ICB%dmat_vp1( 2,1:5) = mat_fdm4_ICB1_free_vp(1:5,5) + fdm4_free_ICB%dmat_vp1( 1,1:5) = mat_fdm4_ICB1_free_vp(1:5,4) + fdm4_free_ICB%dmat_vp1( 0,1:5) = mat_fdm4_ICB1_free_vp(1:5,1) + fdm4_free_ICB%dmat_vp1(-1,1:5) = mat_fdm4_ICB1_free_vp(1:5,3) + fdm4_free_ICB%dmat_vp1(-2,1:5) = 0.0 +! + end subroutine cal_fdm4_ICB1_free_vp +! +! ----------------------------------------------------------------------- +! + end module t_coef_fdm4_free_vpol_ICB diff --git a/src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm4_vpol_centre.f90 b/src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm4_vpol_centre.f90 new file mode 100644 index 00000000..a4d03a3c --- /dev/null +++ b/src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm4_vpol_centre.f90 @@ -0,0 +1,180 @@ +!>@file t_coef_fdm4_vpol_centre.f90 +!!@brief module t_coef_fdm4_vpol_centre +!! +!!@author H. Matsui +!!@date Programmed in May., 2013 +! +!>@brief Matrix to evaluate radial derivative for next of center +!! +!!@verbatim +!! subroutine cal_coef_fdm4_vpol_centre(r, fdm4, fdm4_center) +!! real(kind = kreal), intent(in) :: r(4) +!! type(fdm_matrix), intent(in) :: fdm4(4) +!! type(fdm4_centre_vpol), intent(inout) :: fdm4_center +!! +!! Matrix for poloidal vector at inner most node +!! dfdr = fdm4_center%dmat_vp1(-2,2) * dfdr_Center +!! + fdm4_center%dmat_vp1(-1,2) * d_Center +!! + fdm4_center%dmat_vp1( 0,2) * d_rj(1) +!! + fdm4_center%dmat_vp1( 1,2) * d_rj(2) +!! + fdm4_center%dmat_vp1( 2,2) * d_rj(3) +!! d2fdr2 = fdm4_center%dmat_vp1(-2,3) * dfdr_Center +!! + fdm4_center%dmat_vp1(-1,3) * d_Center +!! + fdm4_center%dmat_vp1( 0,3) * d_rj(1) +!! + fdm4_center%dmat_vp1( 1,3) * d_rj(2) +!! + fdm4_center%dmat_vp1( 2,3) * d_rj(3) +!! d3fdr3 = fdm4_center%dmat_vp1(-2,4) * dfdr_Center +!! + fdm4_center%dmat_vp1(-1,4) * d_Center +!! + fdm4_center%dmat_vp1( 0,4) * d_rj(1) +!! + fdm4_center%dmat_vp1( 1,4) * d_rj(2) +!! + fdm4_center%dmat_vp1( 2,4) * d_rj(3) +!! d4fdr4 = fdm4_center%dmat_vp1(-2,5) * dfdr_Center +!! + fdm4_center%dmat_vp1(-1,5) * d_Center +!! + fdm4_center%dmat_vp1( 0,5) * d_rj(1) +!! + fdm4_center%dmat_vp1( 1,5) * d_rj(2) +!! + fdm4_center%dmat_vp1( 2,5) * d_rj(3) +!! +!! Matrix for poloidal vector at next of inner most node +!! dfdr = fdm4_center%dmat_vp2(-2,2) * d_Center +!! + fdm4_center%dmat_vp2(-1,2) * d_rj(1) +!! + fdm4_center%dmat_vp2( 0,2) * d_rj(2) +!! + fdm4_center%dmat_vp2( 1,2) * d_rj(3) +!! + fdm4_center%dmat_vp2( 2,2) * d_rj(4) +!! d2fdr2 = fdm4_center%dmat_vp2(-2,3) * d_Center +!! + fdm4_center%dmat_vp2(-1,3) * d_rj(1) +!! + fdm4_center%dmat_vp2( 0,3) * d_rj(2) +!! + fdm4_center%dmat_vp2( 1,3) * d_rj(3) +!! + fdm4_center%dmat_vp2( 2,3) * d_rj(4) +!! d3fdr3 = fdm4_center%dmat_vp2(-2,4) * d_Center +!! + fdm4_center%dmat_vp2(-1,4) * d_rj(1) +!! + fdm4_center%dmat_vp2( 0,4) * d_rj(2) +!! + fdm4_center%dmat_vp2( 1,4) * d_rj(3) +!! + fdm4_center%dmat_vp2( 2,4) * d_rj(4) +!! d4fdr4 = fdm4_center%dmat_vp2(-2,5) * d_Center +!! + fdm4_center%dmat_vp2(-1,5) * d_rj(1) +!! + fdm4_center%dmat_vp2( 0,5) * d_rj(2) +!! + fdm4_center%dmat_vp2( 1,5) * d_rj(3) +!! + fdm4_center%dmat_vp2( 2,5) * d_rj(4) +!!@endverbatim +!! + module t_coef_fdm4_vpol_centre +! + use m_precision + use m_constants +! + implicit none +! + type fdm4_centre_vpol +!> FDM matrix at innermost node + real(kind = kreal) :: dmat_vp1(-2:2,5) +!> FDM matrix at the next of innermost node + real(kind = kreal) :: dmat_vp2(-2:2,5) + end type fdm4_centre_vpol +! + private :: set_forth_taylor_expand_CTR1 + private :: order_each_center_fdm4 +! +! ----------------------------------------------------------------------- +! + contains +! +! ----------------------------------------------------------------------- +! + subroutine cal_coef_fdm4_vpol_centre(r, fdm4, fdm4_center) +! + use t_fdm_coefs + use cal_inverse_small_matrix +! + real(kind = kreal), intent(in) :: r(4) + type(fdm_matrix), intent(in) :: fdm4(4) +! + type(fdm4_centre_vpol), intent(inout) :: fdm4_center +! + integer(kind = kint) :: ierr, i + real(kind = kreal) :: mat_fdm(5,5) +! +! + mat_fdm(1:5,1:5) = 0.0d0 +! + call set_forth_taylor_expand_CTR1(r(1), mat_fdm) + call cal_inverse_nn_matrix & + & (ifive, mat_fdm, mat_fdm(1,1), ierr) + call order_each_center_fdm4(mat_fdm, fdm4_center%dmat_vp1) +! + fdm4_center%dmat_vp2(-2:2,1) = zero + fdm4_center%dmat_vp2(0, 1) = one +!$omp parallel do private(i) + do i = 1, 4 + fdm4_center%dmat_vp2(-2:2,i+1) = fdm4(i)%dmat(2,-2:2) + end do +!$omp end parallel do +! + end subroutine cal_coef_fdm4_vpol_centre +! +! ----------------------------------------------------------------------- +! + subroutine set_forth_taylor_expand_CTR1(r, mat_taylor_5) +! + real(kind = kreal), intent(in) :: r(3) + real(kind = kreal), intent(inout) :: mat_taylor_5(5,5) +! + real(kind = kreal) :: dr_n1, dr_p1, dr_p2 + real(kind = kreal), parameter :: asix = 1.0d0 / 6.0d0 + real(kind = kreal), parameter :: a24 = 1.0d0 / 24.0d0 +! +! + dr_n1 = r(1) + dr_p1 = r(2) - r(1) + dr_p2 = r(3) - r(1) +! + mat_taylor_5(1,1) = one + mat_taylor_5(1,2) = zero + mat_taylor_5(1,3) = zero + mat_taylor_5(1,4) = zero + mat_taylor_5(1,5) = zero +! + mat_taylor_5(2,1) = one + mat_taylor_5(2,2) = -dr_n1 + mat_taylor_5(2,3) = half * dr_n1**2 + mat_taylor_5(2,4) = -asix * dr_n1**3 + mat_taylor_5(2,5) = a24 * dr_n1**4 +! + mat_taylor_5(3,1) = one + mat_taylor_5(3,2) = dr_p1 + mat_taylor_5(3,3) = half * dr_p1**2 + mat_taylor_5(3,4) = asix * dr_p1**3 + mat_taylor_5(3,5) = a24 * dr_p1**4 +! + mat_taylor_5(4,1) = zero + mat_taylor_5(4,2) = one + mat_taylor_5(4,3) = -dr_n1 + mat_taylor_5(4,4) = half * dr_n1**2 + mat_taylor_5(4,5) = -asix * dr_n1**3 +! + mat_taylor_5(5,1) = one + mat_taylor_5(5,2) = dr_p2 + mat_taylor_5(5,3) = half * dr_p2**2 + mat_taylor_5(5,4) = asix * dr_p2**3 + mat_taylor_5(5,5) = a24 * dr_p2**4 +! + end subroutine set_forth_taylor_expand_CTR1 +! +! ----------------------------------------------------------------------- +! + subroutine order_each_center_fdm4(mat_fdm, dmat) +! + real(kind = kreal), intent(in) :: mat_fdm(5,5) + real(kind = kreal), intent(inout) :: dmat(-2:2,5) +! +! + dmat(-2,1:5) = mat_fdm(1:5,4) + dmat(-1,1:5) = mat_fdm(1:5,2) + dmat( 0,1:5) = mat_fdm(1:5,1) + dmat( 1,1:5) = mat_fdm(1:5,3) + dmat( 2,1:5) = mat_fdm(1:5,5) +! + end subroutine order_each_center_fdm4 +! +! ----------------------------------------------------------------------- +! + end module t_coef_fdm4_vpol_centre diff --git a/src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm4_zero_vpol_CMB.f90 b/src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm4_zero_vpol_CMB.f90 new file mode 100644 index 00000000..420f63bd --- /dev/null +++ b/src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm4_zero_vpol_CMB.f90 @@ -0,0 +1,249 @@ +!>@file t_coef_fdm4_zero_vpol_CMB.f90 +!!@brief module t_coef_fdm4_zero_vpol_CMB +!! +!!@author H. Matsui +!!@date Programmed in May., 2013 +! +!>@brief Matrix to evaluate radial derivative for non-slip at CMB +!! +!!@verbatim +!! subroutine check_4th_CMB_nonslip_vp_fdm(fdm4_noslip_CMB) +!! type(fdm4_CMB_zero_vpol), intent(in) :: fdm4_noslip_CMB +!! subroutine cal_fdm4_CMB0_nonslip_vp(r_from_CMB, fdm4_noslip_CMB) +!! subroutine cal_fdm4_CMB1_nonslip_vp(r_from_CMB, fdm4_noslip_CMB) +!! type(fdm4_CMB_zero_vpol), intent(inout) :: fdm4_noslip_CMB +!! +!! Matrix for poloidal velocity with non-slip boundary at CMB +!! dfdr = 0.0 +!! d2fdr2 = fdm4_noslip_CMB%dmat_vp0(-2,3) * d_rj(CMB-2) +!! + fdm4_noslip_CMB%dmat_vp0(-1,3) * d_rj(CMB-1) +!! + fdm4_noslip_CMB%dmat_vp0( 0,3) * d_rj(CMB ) +!! d3fdr3 = fdm4_noslip_CMB%dmat_vp0(-2,4) * d_rj(CMB-2) +!! + fdm4_noslip_CMB%dmat_vp0(-1,4) * d_rj(CMB-1) +!! + fdm4_noslip_CMB%dmat_vp0( 0,4) * d_rj(CMB ) +!! +!! Matrix for poloidal velocity with non-slip boundary at next of CMB +!! dfdr = fdm4_noslip_CMB%dmat_vp1(-2,2) * d_rj(CMB-3) +!! + fdm4_noslip_CMB%dmat_vp1(-1,2) * d_rj(CMB-2) +!! + fdm4_noslip_CMB%dmat_vp1( 0,2) * d_rj(CMB-1) +!! + fdm4_noslip_CMB%dmat_vp1( 1,2) * d_rj(CMB ) +!! d2fdr2 = fdm4_noslip_CMB%dmat_vp1(-2,3) * d_rj(CMB-3) +!! + fdm4_noslip_CMB%dmat_vp1(-1,3) * d_rj(CMB-2) +!! + fdm4_noslip_CMB%dmat_vp1( 0,3) * d_rj(CMB-1) +!! + fdm4_noslip_CMB%dmat_vp1( 1,3) * d_rj(CMB ) +!! d3fdr3 = fdm4_noslip_CMB%dmat_vp1(-2,4) * d_rj(CMB-3) +!! + fdm4_noslip_CMB%dmat_vp1(-1,4) * d_rj(CMB-2) +!! + fdm4_noslip_CMB%dmat_vp1( 0,4) * d_rj(CMB-1) +!! + fdm4_noslip_CMB%dmat_vp1( 1,4) * d_rj(CMB ) +!! d4fdr4 = fdm4_noslip_CMB%dmat_vp1(-2,5) * d_rj(CMB-3) +!! + fdm4_noslip_CMB%dmat_vp1(-1,5) * d_rj(CMB-2) +!! + fdm4_noslip_CMB%dmat_vp1( 0,5) * d_rj(CMB-1) +!! + fdm4_noslip_CMB%dmat_vp1( 1,5) * d_rj(CMB ) +!!@endverbatim +!! +!!@n @param r_from_ICB(0:3) radius to three next points of ICB +!! + module t_coef_fdm4_zero_vpol_CMB +! + use m_precision + use m_constants +! + implicit none +! + type fdm4_CMB_zero_vpol +!> Matrix to evaluate radial derivative at CMB + real(kind = kreal) :: dmat_vp0(-2:2,1:5) +!> Matrix to evaluate radial derivative at next of CMB + real(kind = kreal) :: dmat_vp1(-2:2,1:5) + end type fdm4_CMB_zero_vpol +! +! ----------------------------------------------------------------------- +! + contains +! +! ----------------------------------------------------------------------- +! + subroutine check_4th_CMB_nonslip_vp_fdm(fdm4_noslip_CMB) +! + type(fdm4_CMB_zero_vpol), intent(in) :: fdm4_noslip_CMB +! +! + write(50,*) ' zero poloidal at CMB' + write(50,*) ' fdm4_noslip_CMB%dmat_vp0' + write(50,*) 'matrix for dfdr' + write(50,'(1p9E25.15e3)') fdm4_noslip_CMB%dmat_vp0(-2:0,2) + write(50,*) 'matrix for d3fdr3' + write(50,'(1p9E25.15e3)') fdm4_noslip_CMB%dmat_vp0(-2:0,3) + write(50,*) 'matrix for d3fdr3' + write(50,'(1p9E25.15e3)') fdm4_noslip_CMB%dmat_vp0(-2:0,4) +! + write(50,*) ' fdm4_noslip_CMB%dmat_vp1' + write(50,*) 'matrix for dfdr' + write(50,'(1p9E25.15e3)') fdm4_noslip_CMB%dmat_vp1(-2:1,2) + write(50,*) 'matrix for d2fdr2' + write(50,'(1p9E25.15e3)') fdm4_noslip_CMB%dmat_vp1(-2:1,3) + write(50,*) 'matrix for d3fdr3' + write(50,'(1p9E25.15e3)') fdm4_noslip_CMB%dmat_vp1(-2:1,4) + write(50,*) 'matrix for d4fdr4' + write(50,'(1p9E25.15e3)') fdm4_noslip_CMB%dmat_vp1(-2:1,5) +! + end subroutine check_4th_CMB_nonslip_vp_fdm +! +! ----------------------------------------------------------------------- +! + subroutine cal_fdm4_CMB0_nonslip_vp(r_from_CMB, fdm4_noslip_CMB) +! + real(kind = kreal), intent(in) :: r_from_CMB(-3:0) + type(fdm4_CMB_zero_vpol), intent(inout) :: fdm4_noslip_CMB +! +!> Work matrix to evaluate fdm4_noslip_CMB%dmat_vp0 +!!@verbatim +!! d2fdr2 = mat_fdm_noslip_CMB_4(3,4) * d_rj(CMB-2) +!! + mat_fdm_noslip_CMB_4(3,3) * d_rj(CMB-1) +!! + mat_fdm_noslip_CMB_4(3,1) * d_rj(CMB ) +!! + mat_fdm_noslip_CMB_4(3,2) * dfdr(CMB) +!! d3fdr3 = mat_fdm_noslip_CMB_4(4,4) * d_rj(CMB-2) +!! + mat_fdm_noslip_CMB_4(4,3) * d_rj(CMB-1) +!! + mat_fdm_noslip_CMB_4(4,1) * d_rj(CMB ) +!! + mat_fdm_noslip_CMB_4(4,2) * dfdr(CMB) +!! d4fdr4 = mat_fdm_noslip_CMB_4(5,4) * d_rj(CMB-2) +!! + mat_fdm_noslip_CMB_4(5,3) * d_rj(CMB-1) +!! + mat_fdm_noslip_CMB_4(5,1) * d_rj(CMB ) +!! + mat_fdm_noslip_CMB_4(5,2) * dfdr(CMB) +!!@endverbatim + real(kind = kreal) :: mat_fdm_noslip_CMB_4(4,4) +! + integer(kind = kint) :: ierr + real(kind = kreal) :: mat_taylor_4(4,4) + real(kind = kreal) :: dr_n1, dr_n2, dr_n3 +! +! + dr_n1 = r_from_CMB(0) - r_from_CMB(-1) + dr_n2 = r_from_CMB(0) - r_from_CMB(-2) + dr_n3 = r_from_CMB(0) - r_from_CMB(-3) +! + mat_taylor_4(1,1) = one + mat_taylor_4(1,2) = zero + mat_taylor_4(1,3) = zero + mat_taylor_4(1,4) = zero +! + mat_taylor_4(2,1) = zero + mat_taylor_4(2,2) = one + mat_taylor_4(2,3) = zero + mat_taylor_4(2,4) = zero +! + mat_taylor_4(3,1) = one + mat_taylor_4(3,2) =-dr_n1 + mat_taylor_4(3,3) = dr_n1*dr_n1 / two + mat_taylor_4(3,4) =-dr_n1**3 / six +! + mat_taylor_4(4,1) = one + mat_taylor_4(4,2) =-dr_n2 + mat_taylor_4(4,3) = dr_n2*dr_n2 / two + mat_taylor_4(4,4) =-dr_n2**3 / six +! + call cal_inverse_44_matrix(mat_taylor_4, & + & mat_fdm_noslip_CMB_4, ierr) +! + if(ierr .eq. 1) then + write(*,*) 'singular matrix cal_fdm4_CMB0_nonslip_vp ', & + & r_from_CMB(0) + end if +! + fdm4_noslip_CMB%dmat_vp0(-2:0,2) = 0.0 +! + fdm4_noslip_CMB%dmat_vp0(-2,1:4) = mat_fdm_noslip_CMB_4(1:4,4) + fdm4_noslip_CMB%dmat_vp0(-1,1:4) = mat_fdm_noslip_CMB_4(1:4,3) + fdm4_noslip_CMB%dmat_vp0( 0,1:4) = mat_fdm_noslip_CMB_4(1:4,1) +! + end subroutine cal_fdm4_CMB0_nonslip_vp +! +! ----------------------------------------------------------------------- +! + subroutine cal_fdm4_CMB1_nonslip_vp(r_from_CMB, fdm4_noslip_CMB) +! + real(kind = kreal), intent(in) :: r_from_CMB(-3:0) + type(fdm4_CMB_zero_vpol), intent(inout) :: fdm4_noslip_CMB +! +!> Work matrix to evaluate fdm4_noslip_CMB%dmat_vp1 +!!@verbatim +!! dfdr = mat_fdm_noslip_CMB1_4(2,5) * d_rj(CMB-3) +!! + mat_fdm_noslip_CMB1_4(2,4) * d_rj(CMB-2) +!! + mat_fdm_noslip_CMB1_4(2,1) * d_rj(CMB-1) +!! + mat_fdm_noslip_CMB1_4(2,3) * d_rj(CMB ) +!! + mat_fdm_noslip_CMB1_4(2,2) * dfdr(CMB) +!! d2fdr2 = mat_fdm_noslip_CMB1_4(3,5) * d_rj(CMB-3) +!! + mat_fdm_noslip_CMB1_4(3,4) * d_rj(CMB-2) +!! + mat_fdm_noslip_CMB1_4(3,1) * d_rj(CMB-1) +!! + mat_fdm_noslip_CMB1_4(3,3) * d_rj(CMB ) +!! + mat_fdm_noslip_CMB1_4(3,2) * dfdr(CMB) +!! d3fdr3 = mat_fdm_noslip_CMB1_4(4,5) * d_rj(CMB-3) +!! + mat_fdm_noslip_CMB1_4(4,4) * d_rj(CMB-2) +!! + mat_fdm_noslip_CMB1_4(4,1) * d_rj(CMB-1) +!! + mat_fdm_noslip_CMB1_4(4,3) * d_rj(CMB ) +!! + mat_fdm_noslip_CMB1_4(4,2) * dfdr(CMB) +!! d4fdr4 = mat_fdm_noslip_CMB1_4(5,5) * d_rj(CMB-3) +!! + mat_fdm_noslip_CMB1_4(5,4) * d_rj(CMB-2) +!! + mat_fdm_noslip_CMB1_4(5,1) * d_rj(CMB-1) +!! + mat_fdm_noslip_CMB1_4(5,3) * d_rj(CMB ) +!! + mat_fdm_noslip_CMB1_4(5,2) * dfdr(CMB) +!!@endverbatim + real(kind = kreal) :: mat_fdm_noslip_CMB1_4(5,5) +! + integer(kind = kint) :: ierr + real(kind = kreal) :: mat_taylor_5(5,5) + real(kind = kreal) :: dr_p1, dr_n1, dr_n2 +! +! + dr_p1 = r_from_CMB( 0) - r_from_CMB(-1) + dr_n1 = r_from_CMB(-1) - r_from_CMB(-2) + dr_n2 = r_from_CMB(-1) - r_from_CMB(-3) +! + mat_taylor_5(1,1) = one + mat_taylor_5(1,2) = zero + mat_taylor_5(1,3) = zero + mat_taylor_5(1,4) = zero + mat_taylor_5(1,5) = zero +! + mat_taylor_5(2,1) = zero + mat_taylor_5(2,2) = one + mat_taylor_5(2,3) = dr_p1 + mat_taylor_5(2,4) = dr_p1*dr_p1 / two + mat_taylor_5(2,5) = dr_p1**3 / six +! + mat_taylor_5(3,1) = one + mat_taylor_5(3,2) = dr_p1 + mat_taylor_5(3,3) = dr_p1*dr_p1 / two + mat_taylor_5(3,4) = dr_p1**3 / six + mat_taylor_5(3,5) = dr_p1**4 / (six*four) +! + mat_taylor_5(4,1) = one + mat_taylor_5(4,2) =-dr_n1 + mat_taylor_5(4,3) = dr_n1*dr_n1 / two + mat_taylor_5(4,4) =-dr_n1**3 / six + mat_taylor_5(4,5) = dr_n1**4 / (six*four) +! + mat_taylor_5(5,1) = one + mat_taylor_5(5,2) =-dr_n2 + mat_taylor_5(5,3) = dr_n2*dr_n2 / two + mat_taylor_5(5,4) =-dr_n2**3 / six + mat_taylor_5(5,5) = dr_n2**4 / (six*four) +! + call cal_inverse_nn_matrix(ifive, mat_taylor_5, & + & mat_fdm_noslip_CMB1_4, ierr) +! + if(ierr .eq. 1) then + write(*,*) 'singular matrix mat_fdm_noslip_CMB1_4 ', & + & r_from_CMB(0) + end if +! + fdm4_noslip_CMB%dmat_vp1(-2,2:5) = mat_fdm_noslip_CMB1_4(2:5,5) + fdm4_noslip_CMB%dmat_vp1(-1,2:5) = mat_fdm_noslip_CMB1_4(2:5,4) + fdm4_noslip_CMB%dmat_vp1( 0,2:5) = mat_fdm_noslip_CMB1_4(2:5,1) + fdm4_noslip_CMB%dmat_vp1( 1,2:5) = mat_fdm_noslip_CMB1_4(2:5,3) +! + end subroutine cal_fdm4_CMB1_nonslip_vp +! +! ----------------------------------------------------------------------- +! + end module t_coef_fdm4_zero_vpol_CMB diff --git a/src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm4_zero_vpol_ICB.f90 b/src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm4_zero_vpol_ICB.f90 new file mode 100644 index 00000000..e38be809 --- /dev/null +++ b/src/Fortran_libraries/MHD_src/radial_FDM/t_coef_fdm4_zero_vpol_ICB.f90 @@ -0,0 +1,255 @@ +!>@file t_coef_fdm4_zero_vpol_ICB.f90 +!!@brief module t_coef_fdm4_zero_vpol_ICB +!! +!!@author H. Matsui +!!@date Programmed in May., 2013 +! +!>@brief Matrix to evaluate radial derivative for non-slip at ICB +!! +!!@verbatim +!! subroutine cal_fdm4_ICB0_nonslip_vp(r_from_ICB, fdm4_noslip_ICB) +!! real(kind = kreal), intent(in) :: r_from_ICB(0:3) +!! type(fdm4_ICB_zero_vpol), intent(inout) :: fdm4_noslip_ICB +!! subroutine cal_fdm4_ICB1_nonslip_vp(r_from_ICB, fdm4_noslip_ICB) +!! real(kind = kreal), intent(in) :: r_from_ICB(0:3) +!! type(fdm4_ICB_zero_vpol), intent(inout) :: fdm4_noslip_ICB +!! subroutine check_4th_ICB_nonslip_vp_fdm(fdm4_noslip_ICB) +!! type(fdm4_ICB_zero_vpol), intent(in) :: fdm4_noslip_ICB +!! +!! Matrix for poloidal velocity with non-slip boundary at ICB +!! d2fdr2 = fdm4_noslip_ICB%dmat_vp0( 2,3) * d_rj(ICB+2) +!! + fdm4_noslip_ICB%dmat_vp0( 1,3) * d_rj(ICB+1) +!! + fdm4_noslip_ICB%dmat_vp0( 0,3) * d_rj(ICB ) +!! d3fdr3 = fdm4_noslip_ICB%dmat_vp0( 2,4) * d_rj(ICB+2) +!! + fdm4_noslip_ICB%dmat_vp0( 1,4) * d_rj(ICB+1) +!! + fdm4_noslip_ICB%dmat_vp0( 0,4) * d_rj(ICB ) +!! d4fdr4 = fdm4_noslip_ICB%dmat_vp0( 2,5) * d_rj(ICB+2) +!! + fdm4_noslip_ICB%dmat_vp0( 1,5) * d_rj(ICB+1) +!! + fdm4_noslip_ICB%dmat_vp0( 0,5) * d_rj(ICB ) +!! +!! Matrix for poloidal velocity with non-slip boundary at next of ICB +!! dfdr = fdm4_noslip_ICB%dmat_vp1( 2,2) * d_rj(ICB+3) +!! + fdm4_noslip_ICB%dmat_vp1( 1,2) * d_rj(ICB+2) +!! + fdm4_noslip_ICB%dmat_vp1( 0,2) * d_rj(ICB+1) +!! + fdm4_noslip_ICB%dmat_vp1(-1,2) * d_rj(ICB ) +!! d2fdr2 = fdm4_noslip_ICB%dmat_vp1( 2,3) * d_rj(ICB+3) +!! + fdm4_noslip_ICB%dmat_vp1( 1,3) * d_rj(ICB+2) +!! + fdm4_noslip_ICB%dmat_vp1( 0,3) * d_rj(ICB+1) +!! + fdm4_noslip_ICB%dmat_vp1(-1,3) * d_rj(ICB ) +!! d3fdr3 = fdm4_noslip_ICB%dmat_vp1( 2,4) * d_rj(ICB+3) +!! + fdm4_noslip_ICB%dmat_vp1( 1,4) * d_rj(ICB+2) +!! + fdm4_noslip_ICB%dmat_vp1( 0,4) * d_rj(ICB+1) +!! + fdm4_noslip_ICB%dmat_vp1(-1,4) * d_rj(ICB ) +!! d4fdr4 = fdm4_noslip_ICB%dmat_vp1( 2,5) * d_rj(ICB+3) +!! + fdm4_noslip_ICB%dmat_vp1( 1,5) * d_rj(ICB+2) +!! + fdm4_noslip_ICB%dmat_vp1( 0,5) * d_rj(ICB+1) +!! + fdm4_noslip_ICB%dmat_vp1(-1,5) * d_rj(ICB ) +!!@endverbatim +!! + module t_coef_fdm4_zero_vpol_ICB +! + use m_precision + use m_constants +! + implicit none +! + type fdm4_ICB_zero_vpol +!> Matrix to evaluate radial derivative at ICB + real(kind = kreal) :: dmat_vp0(-2:2,1:5) +!> Matrix to evaluate radial derivative at next of ICB + real(kind = kreal) :: dmat_vp1(-2:2,1:5) + end type fdm4_ICB_zero_vpol +! +! ----------------------------------------------------------------------- +! + contains +! +! ----------------------------------------------------------------------- +! + subroutine cal_fdm4_ICB0_nonslip_vp(r_from_ICB, fdm4_noslip_ICB) +! + use cal_inverse_small_matrix +! + real(kind = kreal), intent(in) :: r_from_ICB(0:3) + type(fdm4_ICB_zero_vpol), intent(inout) :: fdm4_noslip_ICB +! +!> Work matrix to evaluate fdm4_noslip_ICB%dmat_vp0 +!!@verbatim +!! d2fdr2 = mat_fdm_noslip_ICB_4(3,4) * d_rj(ICB+2) +!! + mat_fdm_noslip_ICB_4(3,3) * d_rj(ICB+1) +!! + mat_fdm_noslip_ICB_4(3,1) * d_rj(ICB ) +!! + mat_fdm_noslip_ICB_4(3,2) * dfdr(ICB) +!! d3fdr3 = mat_fdm_noslip_ICB_4(4,4) * d_rj(ICB+2) +!! + mat_fdm_noslip_ICB_4(4,3) * d_rj(ICB+1) +!! + mat_fdm_noslip_ICB_4(4,1) * d_rj(ICB ) +!! + mat_fdm_noslip_ICB_4(4,2) * dfdr(ICB) +!!@endverbatim + real(kind = kreal) :: mat_fdm_noslip_ICB_4(4,4) +! + integer(kind = kint) :: ierr + real(kind = kreal) :: mat_taylor_4(4,4) + real(kind = kreal) :: dr_p1, dr_p2, dr_p3 +! +! + dr_p1 = r_from_ICB(1) - r_from_ICB(0) + dr_p2 = r_from_ICB(2) - r_from_ICB(0) + dr_p3 = r_from_ICB(3) - r_from_ICB(0) +! + mat_taylor_4(1,1) = one + mat_taylor_4(1,2) = zero + mat_taylor_4(1,3) = zero + mat_taylor_4(1,4) = zero +! + mat_taylor_4(2,1) = zero + mat_taylor_4(2,2) = one + mat_taylor_4(2,3) = zero + mat_taylor_4(2,4) = zero +! + mat_taylor_4(3,1) = one + mat_taylor_4(3,2) = dr_p1 + mat_taylor_4(3,3) = dr_p1*dr_p1 / two + mat_taylor_4(3,4) = dr_p1**3 / six +! + mat_taylor_4(4,1) = one + mat_taylor_4(4,2) = dr_p2 + mat_taylor_4(4,3) = dr_p2*dr_p2 / two + mat_taylor_4(4,4) = dr_p2**3 / six +! + call cal_inverse_44_matrix(mat_taylor_4, & + & mat_fdm_noslip_ICB_4, ierr) +! + if(ierr .eq. 1) then + write(*,*) 'singular matrix cal_fdm4_ICB0_nonslip_vp ', & + & r_from_ICB(0) + end if +! + fdm4_noslip_ICB%dmat_vp0( 2,1:4) = mat_fdm_noslip_ICB_4(1:4,4) + fdm4_noslip_ICB%dmat_vp0( 1,1:4) = mat_fdm_noslip_ICB_4(1:4,3) + fdm4_noslip_ICB%dmat_vp0( 0,1:4) = mat_fdm_noslip_ICB_4(1:4,1) + fdm4_noslip_ICB%dmat_vp0(-1,1:4) = zero + fdm4_noslip_ICB%dmat_vp0(-2,1:4) = zero + fdm4_noslip_ICB%dmat_vp0(-2:2,5) = zero +! + end subroutine cal_fdm4_ICB0_nonslip_vp +! +! ----------------------------------------------------------------------- +! + subroutine cal_fdm4_ICB1_nonslip_vp(r_from_ICB, fdm4_noslip_ICB) +! + use cal_inverse_small_matrix +! + real(kind = kreal), intent(in) :: r_from_ICB(0:3) + type(fdm4_ICB_zero_vpol), intent(inout) :: fdm4_noslip_ICB +! +!> Work matrix to evaluate fdm4_noslip_ICB%dmat_vp1 +!!@verbatim +!! dfdr = mat_fdm_noslip_ICB1_4(2,5) * d_rj(ICB+3) +!! + mat_fdm_noslip_ICB1_4(2,4) * d_rj(ICB+2) +!! + mat_fdm_noslip_ICB1_4(2,1) * d_rj(ICB+1) +!! + mat_fdm_noslip_ICB1_4(2,3) * d_rj(ICB ) +!! + mat_fdm_noslip_ICB1_4(2,2) * dfdr(ICB) +!! d2fdr2 = mat_fdm_noslip_ICB1_4(3,5) * d_rj(ICB+3) +!! + mat_fdm_noslip_ICB1_4(3,4) * d_rj(ICB+2) +!! + mat_fdm_noslip_ICB1_4(3,1) * d_rj(ICB+1) +!! + mat_fdm_noslip_ICB1_4(3,3) * d_rj(ICB ) +!! + mat_fdm_noslip_ICB1_4(3,2) * dfdr(ICB) +!! d3fdr3 = mat_fdm_noslip_ICB1_4(4,5) * d_rj(ICB+3) +!! + mat_fdm_noslip_ICB1_4(4,4) * d_rj(ICB+2) +!! + mat_fdm_noslip_ICB1_4(4,1) * d_rj(ICB+1) +!! + mat_fdm_noslip_ICB1_4(4,3) * d_rj(ICB ) +!! + mat_fdm_noslip_ICB1_4(4,2) * dfdr(ICB) +!! d4fdr4 = mat_fdm_noslip_ICB1_4(5,5) * d_rj(ICB+3) +!! + mat_fdm_noslip_ICB1_4(5,4) * d_rj(ICB+2) +!! + mat_fdm_noslip_ICB1_4(5,1) * d_rj(ICB+1) +!! + mat_fdm_noslip_ICB1_4(5,3) * d_rj(ICB ) +!! + mat_fdm_noslip_ICB1_4(5,2) * dfdr(ICB) +!!@endverbatim + real(kind = kreal) :: mat_fdm_noslip_ICB1_4(5,5) +! + integer(kind = kint) :: ierr + real(kind = kreal) :: mat_taylor_5(5,5) + real(kind = kreal) :: dr_n1, dr_p1, dr_p2 +! +! + dr_n1 = r_from_ICB(1) - r_from_ICB(0) + dr_p1 = r_from_ICB(2) - r_from_ICB(1) + dr_p2 = r_from_ICB(3) - r_from_ICB(1) +! + mat_taylor_5(1,1) = one + mat_taylor_5(1,2) = zero + mat_taylor_5(1,3) = zero + mat_taylor_5(1,4) = zero + mat_taylor_5(1,5) = zero +! + mat_taylor_5(2,1) = zero + mat_taylor_5(2,2) = one + mat_taylor_5(2,3) =-dr_n1 + mat_taylor_5(2,4) = dr_n1*dr_n1 / two + mat_taylor_5(2,5) =-dr_n1**3 / six +! + mat_taylor_5(3,1) = one + mat_taylor_5(3,2) =-dr_n1 + mat_taylor_5(3,3) = dr_n1*dr_n1 / two + mat_taylor_5(3,4) =-dr_n1**3 / six + mat_taylor_5(3,5) = dr_n1**4 / (six*four) +! + mat_taylor_5(4,1) = one + mat_taylor_5(4,2) = dr_p1 + mat_taylor_5(4,3) = dr_p1*dr_p1 / two + mat_taylor_5(4,4) = dr_p1**3 / six + mat_taylor_5(4,5) = dr_p1**4 / (six*four) +! + mat_taylor_5(5,1) = one + mat_taylor_5(5,2) = dr_p2 + mat_taylor_5(5,3) = dr_p2*dr_p2 / two + mat_taylor_5(5,4) = dr_p2**3 / six + mat_taylor_5(5,5) = dr_p2**4 / (six*four) +! + call cal_inverse_nn_matrix(ifive, mat_taylor_5, & + & mat_fdm_noslip_ICB1_4, ierr) +! + if(ierr .eq. 1) then + write(*,*) 'singular matrix mat_fdm_noslip_ICB1_4 ', & + & r_from_ICB(0) + end if +! + fdm4_noslip_ICB%dmat_vp1(-2,1:5) = zero + fdm4_noslip_ICB%dmat_vp1(-1,1:5) = mat_fdm_noslip_ICB1_4(1:5,3) + fdm4_noslip_ICB%dmat_vp1( 0,1:5) = mat_fdm_noslip_ICB1_4(1:5,1) + fdm4_noslip_ICB%dmat_vp1( 1,1:5) = mat_fdm_noslip_ICB1_4(1:5,4) + fdm4_noslip_ICB%dmat_vp1( 2,1:5) = mat_fdm_noslip_ICB1_4(1:5,5) +! + end subroutine cal_fdm4_ICB1_nonslip_vp +! +! ----------------------------------------------------------------------- +! ----------------------------------------------------------------------- +! + subroutine check_4th_ICB_nonslip_vp_fdm(fdm4_noslip_ICB) +! + type(fdm4_ICB_zero_vpol), intent(in) :: fdm4_noslip_ICB +! +! + write(50,*) ' non slip boundary' + write(50,*) ' fdm4_noslip_ICB%dmat_vp0' + write(50,*) 'matrix for dfdr' + write(50,'(1p9E25.15e3)') fdm4_noslip_ICB%dmat_vp0(0:2,2) + write(50,*) 'matrix for d2fdr2' + write(50,'(1p9E25.15e3)') fdm4_noslip_ICB%dmat_vp0(0:2,3) + write(50,*) 'matrix for d3fdr3' + write(50,'(1p9E25.15e3)') fdm4_noslip_ICB%dmat_vp0(0:2,4) +! + write(50,*) ' fdm4_noslip_ICB%dmat_vp1' + write(50,*) 'matrix for dfdr' + write(50,'(1p9E25.15e3)') fdm4_noslip_ICB%dmat_vp1(-1:2,2) + write(50,*) 'matrix for d2fdr2' + write(50,'(1p9E25.15e3)') fdm4_noslip_ICB%dmat_vp1(-1:2,3) + write(50,*) 'matrix for d3fdr3' + write(50,'(1p9E25.15e3)') fdm4_noslip_ICB%dmat_vp1(-1:2,4) + write(50,*) 'matrix for d4fdr4' + write(50,'(1p9E25.15e3)') fdm4_noslip_ICB%dmat_vp1(-1:2,5) +! + end subroutine check_4th_ICB_nonslip_vp_fdm +! +! ----------------------------------------------------------------------- +! + end module t_coef_fdm4_zero_vpol_ICB diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/FEM_analyzer_sph_MHD.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/FEM_analyzer_sph_MHD.f90 index 267e2360..2fa42055 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/FEM_analyzer_sph_MHD.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/FEM_analyzer_sph_MHD.f90 @@ -115,11 +115,11 @@ subroutine FEM_initialize_sph_MHD(MHD_files, MHD_step, & ! ------------------------------- ! if(iflag_debug .gt. 0) write(*,*) 'output_grd_file_4_snapshot' - if(iflag_MHD_time) call start_elapsed_time(ist_elapsed_MHD+5) + if(iflag_MHD_time) call start_elapsed_time(ist_elapsed_MHD+6) call output_grd_file_4_snapshot(MHD_files%ucd_file_IO, & & MHD_step%ucd_step, FEM_MHD%geofem%mesh, FEM_MHD%field, & & MHD_IO%ucd, m_SR%SR_sig, m_SR%SR_i) - if(iflag_MHD_time) call end_elapsed_time(ist_elapsed_MHD+5) + if(iflag_MHD_time) call end_elapsed_time(ist_elapsed_MHD+6) ! end subroutine FEM_initialize_sph_MHD ! @@ -154,11 +154,11 @@ subroutine FEM_analyze_sph_MHD(MHD_files, FEM_MHD, MHD_step, & ! !* ----------- Output volume data -------------- !* - if(iflag_MHD_time) call start_elapsed_time(ist_elapsed_MHD+5) + if(iflag_MHD_time) call start_elapsed_time(ist_elapsed_MHD+6) call s_output_ucd_file_control & & (MHD_files%ucd_file_IO, MHD_step%time_d%i_time_step, & & MHD_step%ucd_step, MHD_step%time_d, MHD_IO%ucd) - if(iflag_MHD_time) call end_elapsed_time(ist_elapsed_MHD+5) + if(iflag_MHD_time) call end_elapsed_time(ist_elapsed_MHD+6) ! end subroutine FEM_analyze_sph_MHD ! diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/Makefile.depends b/src/Fortran_libraries/MHD_src/sph_MHD/Makefile.depends index 8b73bd35..5677a970 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/Makefile.depends +++ b/src/Fortran_libraries/MHD_src/sph_MHD/Makefile.depends @@ -26,6 +26,8 @@ cal_CMB_dipolarity.o: $(MHD_SPH_DIR)/cal_CMB_dipolarity.f90 m_precision.o m_cons $(F90) -c $(F90OPTFLAGS) $< cal_buoyancy_flux_sph.o: $(MHD_SPH_DIR)/cal_buoyancy_flux_sph.f90 m_precision.o m_constants.o m_machine_parameter.o calypso_mpi.o t_phys_address.o t_spheric_rtp_data.o t_physical_property.o t_reference_scalar_param.o t_addresses_sph_transform.o t_schmidt_poly_on_rtm.o $(F90) -c $(F90OPTFLAGS) $< +cal_coriolis_rlm.o: $(MHD_SPH_DIR)/cal_coriolis_rlm.f90 m_precision.o m_machine_parameter.o m_constants.o t_spheric_rlm_data.o t_sph_trans_comm_tbl.o t_poloidal_rotation.o t_addresses_sph_transform.o t_schmidt_poly_on_rtm.o t_physical_property.o t_boundary_params_sph_MHD.o t_gaunt_coriolis_rlm.o t_coriolis_terms_rlm.o t_phys_address.o m_sph_communicators.o sel_spherical_SRs.o sum_coriolis_terms_rlm.o sum_boundary_coriolis_rlm.o sum_rot_coriolis_terms_rlm.o + $(F90) -c $(F90OPTFLAGS) $< cal_diff_adv_src_explicit.o: $(MHD_SPH_DIR)/cal_diff_adv_src_explicit.f90 m_precision.o m_constants.o m_t_step_parameter.o $(F90) -c $(F90OPTFLAGS) $< cal_div_of_forces.o: $(MHD_SPH_DIR)/cal_div_of_forces.f90 m_precision.o t_base_field_labels.o t_base_force_labels.o t_physical_property.o t_phys_data.o copy_nodal_fields.o @@ -54,11 +56,11 @@ cal_lorentz_by_dipole.o: $(MHD_SPH_DIR)/cal_lorentz_by_dipole.f90 m_precision.o $(F90) -c $(F90OPTFLAGS) $< cal_momentum_eq_explicit.o: $(MHD_SPH_DIR)/cal_momentum_eq_explicit.f90 m_precision.o t_control_parameter.o t_physical_property.o t_spheric_parameter.o t_phys_address.o t_phys_data.o t_fdm_coefs.o t_schmidt_poly_on_rtm.o t_boundary_data_sph_MHD.o t_boundary_params_sph_MHD.o cal_vorticity_terms_adams.o cal_nonlinear_sph_MHD.o cal_explicit_terms.o explicit_scalars_sph.o $(F90) -c $(F90OPTFLAGS) $< -cal_nonlinear.o: $(MHD_SPH_DIR)/cal_nonlinear.f90 m_precision.o m_constants.o m_machine_parameter.o calypso_mpi.o t_physical_property.o t_SPH_MHD_model_data.o t_SPH_mesh_field_data.o t_poloidal_rotation.o t_fdm_coefs.o t_sph_trans_arrays_MHD.o t_schmidt_poly_on_rtm.o t_work_4_sph_trans.o t_radial_reference_field.o t_legendre_trans_select.o t_sph_FFT_selector.o t_coriolis_terms_rlm.o t_gaunt_coriolis_rlm.o t_solver_SR.o cal_inner_core_rotation.o cal_nonlinear_sph_MHD.o sum_rotation_of_forces.o rot_self_buoyancies_sph.o m_work_time.o m_elapsed_labels_4_MHD.o sph_transforms_4_MHD.o cal_sph_field_by_rotation.o m_phys_constants.o copy_nodal_fields.o +cal_nonlinear.o: $(MHD_SPH_DIR)/cal_nonlinear.f90 m_precision.o m_constants.o m_machine_parameter.o calypso_mpi.o t_physical_property.o t_SPH_MHD_model_data.o t_SPH_mesh_field_data.o t_poloidal_rotation.o t_fdm_coefs.o t_sph_trans_arrays_MHD.o t_schmidt_poly_on_rtm.o t_work_4_sph_trans.o t_radial_reference_field.o t_legendre_trans_select.o t_sph_FFT_selector.o t_coriolis_terms_rlm.o t_gaunt_coriolis_rlm.o t_solver_SR.o cal_inner_core_rotation.o cal_nonlinear_sph_MHD.o sum_rotation_of_forces.o cal_self_buoyancies_sph.o rot_self_buoyancies_sph.o m_work_time.o m_elapsed_labels_4_MHD.o sph_transforms_4_MHD.o cal_sph_field_by_rotation.o m_phys_constants.o copy_nodal_fields.o $(F90) -c $(F90OPTFLAGS) $< cal_nonlinear_sph_MHD.o: $(MHD_SPH_DIR)/cal_nonlinear_sph_MHD.f90 m_precision.o m_machine_parameter.o m_constants.o t_control_parameter.o t_reference_scalar_param.o t_spheric_rj_data.o t_spheric_rtp_data.o t_base_field_labels.o t_base_force_labels.o t_phys_address.o t_phys_data.o t_schmidt_poly_on_rtm.o t_radial_reference_field.o t_boundary_data_sph_MHD.o t_addresses_sph_transform.o const_wz_coriolis_rtp.o cal_products_smp.o $(F90) -c $(F90OPTFLAGS) $< -cal_self_buoyancies_sph.o: $(MHD_SPH_DIR)/cal_self_buoyancies_sph.f90 m_precision.o m_machine_parameter.o m_constants.o t_physical_property.o t_reference_scalar_param.o t_schmidt_poly_on_rtm.o t_spheric_rj_data.o t_base_force_labels.o t_phys_data.o t_boundary_params_sph_MHD.o adjust_reference_fields.o cal_buoyancies_sph_MHD.o +cal_self_buoyancies_sph.o: $(MHD_SPH_DIR)/cal_self_buoyancies_sph.f90 m_precision.o m_machine_parameter.o m_constants.o t_physical_property.o t_reference_scalar_param.o t_schmidt_poly_on_rtm.o t_spheric_rj_data.o t_base_force_labels.o t_phys_data.o t_boundary_params_sph_MHD.o cal_buoyancies_sph_MHD.o adjust_reference_fields.o $(F90) -c $(F90OPTFLAGS) $< cal_sol_sph_MHD_crank.o: $(MHD_SPH_DIR)/cal_sol_sph_MHD_crank.f90 m_precision.o calypso_mpi.o m_machine_parameter.o const_sph_radial_grad.o const_sph_rotation.o const_sph_diffusion.o t_control_parameter.o t_physical_property.o t_spheric_rj_data.o t_phys_address.o t_phys_data.o t_fdm_coefs.o t_boundary_data_sph_MHD.o t_boundary_params_sph_MHD.o t_radial_matrices_sph_MHD.o t_coef_fdm2_MHD_boundaries.o t_work_4_sph_trans.o cal_sol_sph_fluid_crank.o sph_radial_grad_4_velocity.o sph_radial_grad_4_magne.o sph_update_after_evolution.o $(F90) -c $(F90OPTFLAGS) $< @@ -164,7 +166,9 @@ init_FFT_4_MHD.o: $(MHD_SPH_DIR)/init_FFT_4_MHD.F90 m_precision.o calypso_mpi.o $(F90) -c $(F90OPTFLAGS) $(F90CPPFLAGS) $< init_external_magne_sph.o: $(MHD_SPH_DIR)/init_external_magne_sph.f90 m_precision.o m_constants.o t_spheric_rj_data.o t_base_field_labels.o t_field_component_labels.o t_phys_data.o t_physical_property.o $(F90) -c $(F90OPTFLAGS) $< -init_radial_infos_sph_mhd.o: $(MHD_SPH_DIR)/init_radial_infos_sph_mhd.f90 m_precision.o calypso_mpi.o m_constants.o m_spheric_constants.o m_machine_parameter.o t_control_parameter.o t_spheric_parameter.o t_spheric_group.o t_poloidal_rotation.o t_radial_reference_field.o t_fdm_coefs.o t_sph_boundary_input_data.o t_bc_data_list.o t_boundary_data_sph_MHD.o t_phys_address.o t_phys_data.o t_work_4_sph_trans.o t_physical_property.o second_fdm_node_coefs.o material_property.o set_bc_sph_mhd.o set_radius_func_noequi.o sph_mhd_rst_IO_control.o reference_sources_from_d_rj.o init_reference_scalar.o init_external_magne_sph.o radial_reference_field_IO.o m_base_field_labels.o +init_radial_infos_sph_mhd.o: $(MHD_SPH_DIR)/init_radial_infos_sph_mhd.f90 m_precision.o calypso_mpi.o m_constants.o m_spheric_constants.o m_machine_parameter.o t_control_parameter.o t_spheric_parameter.o t_spheric_group.o t_poloidal_rotation.o t_radial_reference_field.o t_fdm_coefs.o t_sph_boundary_input_data.o t_bc_data_list.o t_boundary_data_sph_MHD.o t_phys_address.o t_phys_data.o t_work_4_sph_trans.o t_physical_property.o second_fdm_node_coefs.o third_fdm_node_to_ele.o first_fdm_ele_to_node.o material_property.o init_sph_radius_variations.o set_bc_sph_mhd.o set_radius_func_noequi.o sph_mhd_rst_IO_control.o reference_sources_from_d_rj.o init_reference_scalar.o init_external_magne_sph.o radial_reference_field_IO.o m_base_field_labels.o + $(F90) -c $(F90OPTFLAGS) $< +init_sph_radius_variations.o: $(MHD_SPH_DIR)/init_sph_radius_variations.f90 m_precision.o m_constants.o t_control_parameter.o t_spheric_parameter.o t_phys_data.o t_sph_radial_interpolate.o t_field_data_IO.o t_fdm_coefs.o calypso_mpi_real.o transfer_to_long_integers.o set_sph_radial_variations.o m_base_field_labels.o m_diffusion_term_labels.o calypso_mpi.o field_file_IO.o copy_rj_phys_data_4_IO.o set_sph_extensions.o $(F90) -c $(F90OPTFLAGS) $< init_sphrical_transform_MHD.o: $(MHD_SPH_DIR)/init_sphrical_transform_MHD.f90 m_precision.o m_constants.o m_machine_parameter.o m_work_time.o calypso_mpi.o t_SPH_MHD_model_data.o t_SPH_mesh_field_data.o t_sph_trans_comm_tbl.o t_poloidal_rotation.o t_sph_trans_arrays_MHD.o t_schmidt_poly_on_rtm.o t_work_4_sph_trans.o t_legendre_trans_select.o t_sph_FFT_selector.o t_const_wz_coriolis_rtp.o t_coriolis_terms_rlm.o t_gaunt_coriolis_rlm.o t_boundary_data_sph_MHD.o t_solver_SR.o set_address_sph_trans_MHD.o set_address_sph_trans_snap.o check_sph_mhd_openmp_size.o init_sph_trans.o init_FFT_4_MHD.o pole_sph_transform.o skip_comment_f.o m_legendre_transform_list.o test_legendre_transforms.o $(F90) -c $(F90OPTFLAGS) $< @@ -188,7 +192,7 @@ material_property.o: $(MHD_SPH_DIR)/material_property.f90 m_precision.o m_consta $(F90) -c $(F90OPTFLAGS) $< poynting_flux_smp.o: $(MHD_SPH_DIR)/poynting_flux_smp.f90 m_precision.o m_constants.o $(F90) -c $(F90OPTFLAGS) $< -radial_reference_field_IO.o: $(MHD_SPH_DIR)/radial_reference_field_IO.f90 m_precision.o m_constants.o t_spheric_rj_data.o t_phys_data.o t_phys_address.o t_radial_reference_field.o calypso_mpi.o t_time_data.o field_file_IO.o copy_rj_phys_data_4_IO.o set_sph_extensions.o calypso_mpi_int.o calypso_mpi_real.o t_file_IO_parameter.o interpolate_reference_data.o transfer_to_long_integers.o +radial_reference_field_IO.o: $(MHD_SPH_DIR)/radial_reference_field_IO.f90 m_precision.o m_constants.o t_spheric_rj_data.o t_phys_data.o t_phys_address.o t_radial_reference_field.o t_field_data_IO.o t_time_data.o calypso_mpi.o field_file_IO.o copy_rj_phys_data_4_IO.o set_sph_extensions.o calypso_mpi_int.o calypso_mpi_real.o t_file_IO_parameter.o interpolate_reference_data.o transfer_to_long_integers.o $(F90) -c $(F90OPTFLAGS) $< reference_sources_from_d_rj.o: $(MHD_SPH_DIR)/reference_sources_from_d_rj.f90 m_precision.o calypso_mpi.o t_spheric_parameter.o t_phys_address.o t_phys_data.o t_radial_reference_field.o calypso_mpi_real.o $(F90) -c $(F90OPTFLAGS) $< @@ -220,7 +224,7 @@ set_address_sph_trans_snap.o: $(MHD_SPH_DIR)/set_address_sph_trans_snap.f90 m_pr $(F90) -c $(F90OPTFLAGS) $< set_bc_flag_sph_velo.o: $(MHD_SPH_DIR)/set_bc_flag_sph_velo.f90 m_precision.o m_constants.o m_machine_parameter.o m_boundary_condition_IDs.o t_boundary_data_sph_MHD.o t_boundary_params_sph_MHD.o t_boundary_sph_spectr.o t_sph_boundary_input_data.o t_spheric_rj_data.o t_group_data.o t_bc_data_list.o set_bc_sph_scalars.o m_base_field_labels.o set_sph_bc_data_by_file.o $(F90) -c $(F90OPTFLAGS) $< -set_bc_sph_mhd.o: $(MHD_SPH_DIR)/set_bc_sph_mhd.f90 m_precision.o m_machine_parameter.o m_boundary_condition_IDs.o t_control_parameter.o t_physical_property.o t_spheric_parameter.o t_group_data.o t_boundary_data_sph_MHD.o t_boundary_params_sph_MHD.o t_spheric_rj_data.o t_bc_data_list.o t_sph_boundary_input_data.o m_base_field_labels.o set_bc_flag_sph_velo.o set_bc_sph_scalars.o cal_fdm_coefs_4_boundaries.o coef_fdm2_to_center.o coef_fdm2_free_ICB.o coef_fdm2_free_CMB.o set_sph_bc_data_by_file.o +set_bc_sph_mhd.o: $(MHD_SPH_DIR)/set_bc_sph_mhd.f90 m_precision.o m_machine_parameter.o m_boundary_condition_IDs.o t_control_parameter.o t_physical_property.o t_spheric_parameter.o t_group_data.o t_boundary_data_sph_MHD.o t_boundary_params_sph_MHD.o t_spheric_rj_data.o t_bc_data_list.o t_sph_boundary_input_data.o t_phys_data.o t_coef_fdm3_n2e_zero_vp_ICB.o t_coef_fdm3_n2e_free_vp_ICB.o t_coef_fdm3_n2e_zero_vp_CMB.o t_coef_fdm3_n2e_free_vp_CMB.o m_base_field_labels.o set_bc_flag_sph_velo.o set_bc_sph_scalars.o cal_fdm_coefs_4_boundaries.o coef_fdm2_to_center.o coef_fdm2_free_ICB.o coef_fdm2_free_CMB.o set_sph_bc_magne_sph.o $(F90) -c $(F90OPTFLAGS) $< set_bc_sph_scalars.o: $(MHD_SPH_DIR)/set_bc_sph_scalars.f90 m_precision.o calypso_mpi.o m_constants.o m_error_IDs.o m_machine_parameter.o m_boundary_condition_IDs.o t_spheric_rj_data.o t_group_data.o t_boundary_params_sph_MHD.o t_boundary_sph_spectr.o t_sph_boundary_input_data.o t_bc_data_list.o t_field_labels.o m_base_field_labels.o m_base_force_labels.o set_sph_bc_data_by_file.o $(F90) -c $(F90OPTFLAGS) $< @@ -232,7 +236,7 @@ set_control_SPH_MHD_w_viz.o: $(MHD_SPH_DIR)/set_control_SPH_MHD_w_viz.f90 m_prec $(F90) -c $(F90OPTFLAGS) $< set_control_sph_data_MHD.o: $(MHD_SPH_DIR)/set_control_sph_data_MHD.f90 m_precision.o calypso_mpi.o m_error_IDs.o m_machine_parameter.o t_control_parameter.o t_control_array_character3.o t_phys_data.o add_nodal_fields_4_MHD.o add_sph_MHD_fields_2_ctl.o set_control_field_data.o m_file_format_switch.o m_FFT_selector.o m_legendre_transform_list.o t_ctl_data_4_platforms.o t_ctl_data_mhd_evo_scheme.o t_field_data_IO.o t_legendre_trans_select.o t_sph_boundary_input_data.o t_work_4_sph_trans.o skip_comment_f.o sph_mhd_rst_IO_control.o sel_spherical_SRs.o $(F90) -c $(F90OPTFLAGS) $< -set_control_sph_mhd.o: $(MHD_SPH_DIR)/set_control_sph_mhd.f90 m_precision.o m_machine_parameter.o calypso_mpi.o t_control_parameter.o t_MHD_step_parameter.o t_MHD_file_parameter.o t_field_data_IO.o t_ctl_data_4_platforms.o t_ctl_data_4_FEM_mesh.o t_ctl_data_MHD_model.o t_ctl_data_SPH_MHD_control.o t_ctl_data_4_sph_monitor.o t_ctl_data_node_monitor.o t_ctl_data_gen_sph_shell.o t_ctl_data_crust_filter.o t_bc_data_list.o t_flex_delta_t_data.o t_SPH_mesh_field_data.o t_radial_reference_field.o t_field_on_circle.o t_spheric_parameter.o t_phys_data.o t_rms_4_sph_spectr.o t_sph_trans_arrays_MHD.o t_const_spherical_grid.o t_sph_boundary_input_data.o t_ctl_params_gen_sph_shell.o t_coef_parameters_list.o gen_sph_grids_modes.o set_control_platform_item.o set_control_platform_data.o set_ctl_parallel_platform.o set_control_4_model.o set_control_sph_data_MHD.o set_control_4_force.o set_ctl_4_shell_grids.o set_control_4_pickup_sph.o parallel_ucd_IO_select.o t_ctl_data_node_boundary.o t_ctl_data_surf_boundary.o set_control_4_velo.o set_control_4_press.o set_control_4_temp.o set_control_4_magne.o set_control_4_composition.o +set_control_sph_mhd.o: $(MHD_SPH_DIR)/set_control_sph_mhd.f90 m_precision.o m_machine_parameter.o calypso_mpi.o t_control_parameter.o t_MHD_step_parameter.o t_MHD_file_parameter.o t_field_data_IO.o t_ctl_data_4_platforms.o t_ctl_data_4_FEM_mesh.o t_ctl_data_MHD_model.o t_ctl_data_SPH_MHD_control.o t_ctl_data_4_sph_monitor.o t_ctl_data_node_monitor.o t_ctl_data_gen_sph_shell.o t_ctl_data_crust_filter.o t_bc_data_list.o t_flex_delta_t_data.o t_sph_grid_maker_in_sim.o t_radial_reference_field.o t_field_on_circle.o t_spheric_parameter.o t_phys_data.o t_rms_4_sph_spectr.o t_sph_trans_arrays_MHD.o t_const_spherical_grid.o t_sph_boundary_input_data.o t_ctl_params_gen_sph_shell.o t_coef_parameters_list.o t_ctl_param_val_density.o t_ctl_param_val_diffusion.o gen_sph_grids_modes.o set_control_platform_item.o set_control_platform_data.o set_ctl_parallel_platform.o set_control_4_model.o set_control_sph_data_MHD.o set_control_4_force.o set_ctl_4_shell_grids.o set_control_4_pickup_sph.o parallel_ucd_IO_select.o t_ctl_data_node_boundary.o t_ctl_data_surf_boundary.o set_control_4_velo.o set_control_4_press.o set_control_4_temp.o set_control_4_magne.o set_control_4_composition.o $(F90) -c $(F90OPTFLAGS) $< set_ctl_sph_spectr_w_dbench.o: $(MHD_SPH_DIR)/set_ctl_sph_spectr_w_dbench.f90 m_precision.o t_ctl_data_4_sph_monitor.o t_ctl_data_dynamobench.o t_field_4_dynamobench.o t_sph_circle_parameters.o t_rms_4_sph_spectr.o t_bc_data_list.o set_control_sph_spectr.o t_sph_volume_mean_square.o t_multi_flag_labels.o m_file_format_labels.o skip_comment_f.o m_boundary_condition_IDs.o $(F90) -c $(F90OPTFLAGS) $< @@ -252,6 +256,8 @@ set_scalar_boundary_sph.o: $(MHD_SPH_DIR)/set_scalar_boundary_sph.f90 m_precisio $(F90) -c $(F90OPTFLAGS) $< set_sph_bc_data_by_file.o: $(MHD_SPH_DIR)/set_sph_bc_data_by_file.f90 m_precision.o t_spheric_rj_data.o t_each_sph_boundary_IO_data.o t_sph_boundary_input_data.o t_field_labels.o skip_comment_f.o set_sph_boundary_from_file.o $(F90) -c $(F90OPTFLAGS) $< +set_sph_bc_magne_sph.o: $(MHD_SPH_DIR)/set_sph_bc_magne_sph.f90 m_precision.o m_machine_parameter.o m_boundary_condition_IDs.o t_control_parameter.o t_physical_property.o t_spheric_parameter.o t_group_data.o t_boundary_data_sph_MHD.o t_boundary_params_sph_MHD.o t_spheric_rj_data.o t_bc_data_list.o t_sph_boundary_input_data.o m_base_field_labels.o set_bc_sph_scalars.o set_sph_bc_data_by_file.o + $(F90) -c $(F90OPTFLAGS) $< set_sph_boundary_from_file.o: $(MHD_SPH_DIR)/set_sph_boundary_from_file.f90 m_precision.o t_spheric_rj_data.o t_field_labels.o m_base_field_labels.o m_base_force_labels.o skip_comment_f.o $(F90) -c $(F90OPTFLAGS) $< set_sph_exp_fix_vector_CMB.o: $(MHD_SPH_DIR)/set_sph_exp_fix_vector_CMB.f90 m_precision.o m_constants.o @@ -270,6 +276,8 @@ set_sph_exp_rigid_ICB.o: $(MHD_SPH_DIR)/set_sph_exp_rigid_ICB.f90 m_precision.o $(F90) -c $(F90OPTFLAGS) $< set_sph_magne_mat_bc.o: $(MHD_SPH_DIR)/set_sph_magne_mat_bc.f90 m_precision.o m_constants.o $(F90) -c $(F90OPTFLAGS) $< +set_sph_radial_variations.o: $(MHD_SPH_DIR)/set_sph_radial_variations.f90 m_precision.o m_constants.o t_spheric_rj_data.o t_phys_data.o t_sph_radial_interpolate.o t_field_data_IO.o t_fdm_coefs.o t_ctl_param_val_density.o radial_interpolation.o cal_sph_exp_1st_diff.o field_file_IO.o t_ctl_param_val_diffusion.o const_diffusive_profile.o + $(F90) -c $(F90OPTFLAGS) $< set_sph_restart_IO.o: $(MHD_SPH_DIR)/set_sph_restart_IO.f90 m_precision.o m_constants.o m_phys_constants.o t_phys_data.o t_field_data_IO.o calypso_mpi.o const_global_element_ids.o copy_rj_phys_data_4_IO.o m_base_field_labels.o m_explicit_term_labels.o $(F90) -c $(F90OPTFLAGS) $< set_sph_scalar_mat_bc.o: $(MHD_SPH_DIR)/set_sph_scalar_mat_bc.f90 m_precision.o m_constants.o @@ -284,7 +292,7 @@ sph_radial_grad_4_magne.o: $(MHD_SPH_DIR)/sph_radial_grad_4_magne.f90 m_precisio $(F90) -c $(F90OPTFLAGS) $< sph_radial_grad_4_velocity.o: $(MHD_SPH_DIR)/sph_radial_grad_4_velocity.f90 m_precision.o m_constants.o t_spheric_rj_data.o t_phys_data.o t_fdm_coefs.o t_boundary_data_sph_MHD.o t_boundary_sph_spectr.o t_boundary_params_sph_MHD.o t_coef_fdm2_MHD_boundaries.o cal_sph_exp_1st_diff.o cal_sph_exp_rotation.o select_exp_velocity_ICB.o select_exp_velocity_CMB.o cal_sph_exp_nod_none_bc.o t_const_wz_coriolis_rtp.o $(F90) -c $(F90OPTFLAGS) $< -sph_trans_w_coriols.o: $(MHD_SPH_DIR)/sph_trans_w_coriols.f90 m_precision.o calypso_mpi.o m_work_time.o m_elapsed_labels_SPH_TRNS.o m_elapsed_labels_4_MHD.o m_machine_parameter.o spherical_SRs_N.o t_solver_SR.o t_physical_property.o t_spheric_parameter.o t_sph_trans_comm_tbl.o t_phys_address.o t_poloidal_rotation.o t_addresses_sph_transform.o t_schmidt_poly_on_rtm.o t_work_4_sph_trans.o t_legendre_trans_select.o t_sph_FFT_selector.o t_coriolis_terms_rlm.o t_gaunt_coriolis_rlm.o t_boundary_params_sph_MHD.o +sph_trans_w_coriols.o: $(MHD_SPH_DIR)/sph_trans_w_coriols.f90 m_precision.o calypso_mpi.o m_work_time.o m_elapsed_labels_SPH_TRNS.o m_elapsed_labels_4_MHD.o m_machine_parameter.o spherical_SRs_N.o t_solver_SR.o t_physical_property.o t_spheric_parameter.o t_sph_trans_comm_tbl.o t_phys_address.o t_poloidal_rotation.o t_addresses_sph_transform.o t_schmidt_poly_on_rtm.o t_work_4_sph_trans.o t_legendre_trans_select.o t_sph_FFT_selector.o t_coriolis_terms_rlm.o t_gaunt_coriolis_rlm.o t_boundary_params_sph_MHD.o cal_coriolis_rlm.o $(F90) -c $(F90OPTFLAGS) $< sph_transforms_4_MHD.o: $(MHD_SPH_DIR)/sph_transforms_4_MHD.f90 m_precision.o m_constants.o m_machine_parameter.o m_work_time.o m_elapsed_labels_4_MHD.o m_elapsed_labels_SPH_TRNS.o m_legendre_transform_list.o calypso_mpi.o t_physical_property.o t_spheric_parameter.o t_sph_trans_comm_tbl.o t_phys_address.o t_phys_data.o t_poloidal_rotation.o t_sph_trans_arrays_MHD.o t_schmidt_poly_on_rtm.o t_work_4_sph_trans.o t_legendre_trans_select.o t_sph_FFT_selector.o t_coriolis_terms_rlm.o t_gaunt_coriolis_rlm.o t_boundary_params_sph_MHD.o t_solver_SR.o sph_trans_w_coriols.o set_address_sph_trans_MHD.o spherical_SRs_N.o spherical_transforms.o $(F90) -c $(F90OPTFLAGS) $< @@ -294,9 +302,9 @@ sph_update_after_evolution.o: $(MHD_SPH_DIR)/sph_update_after_evolution.f90 m_pr $(F90) -c $(F90OPTFLAGS) $< sum_boundary_coriolis_rlm.o: $(MHD_SPH_DIR)/sum_boundary_coriolis_rlm.f90 m_precision.o m_machine_parameter.o m_constants.o t_phys_address.o t_gaunt_coriolis_rlm.o $(F90) -c $(F90OPTFLAGS) $< -sum_coriolis_terms_rlm.o: $(MHD_SPH_DIR)/sum_coriolis_terms_rlm.f90 m_precision.o m_machine_parameter.o m_constants.o t_spheric_rlm_data.o t_phys_address.o t_poloidal_rotation.o t_gaunt_coriolis_rlm.o +sum_coriolis_terms_rlm.o: $(MHD_SPH_DIR)/sum_coriolis_terms_rlm.f90 m_precision.o m_machine_parameter.o m_constants.o t_spheric_rlm_data.o t_phys_address.o t_base_field_labels.o t_poloidal_rotation.o t_gaunt_coriolis_rlm.o $(F90) -c $(F90OPTFLAGS) $< -sum_rot_coriolis_terms_rlm.o: $(MHD_SPH_DIR)/sum_rot_coriolis_terms_rlm.f90 m_precision.o m_machine_parameter.o m_constants.o t_spheric_rlm_data.o t_phys_address.o t_poloidal_rotation.o t_schmidt_poly_on_rtm.o t_gaunt_coriolis_rlm.o +sum_rot_coriolis_terms_rlm.o: $(MHD_SPH_DIR)/sum_rot_coriolis_terms_rlm.f90 m_precision.o m_machine_parameter.o m_constants.o t_spheric_rlm_data.o t_phys_address.o t_base_field_labels.o t_poloidal_rotation.o t_schmidt_poly_on_rtm.o t_gaunt_coriolis_rlm.o $(F90) -c $(F90OPTFLAGS) $< sum_rotation_of_forces.o: $(MHD_SPH_DIR)/sum_rotation_of_forces.f90 m_precision.o m_constants.o m_machine_parameter.o calypso_mpi.o t_physical_property.o t_phys_address.o t_base_force_labels.o t_explicit_term_labels.o t_phys_data.o copy_nodal_fields.o cal_vorticity_terms_adams.o m_phys_constants.o $(F90) -c $(F90OPTFLAGS) $< @@ -310,13 +318,13 @@ t_MHD_file_parameter.o: $(MHD_SPH_DIR)/t_MHD_file_parameter.f90 m_precision.o t_ $(F90) -c $(F90OPTFLAGS) $< t_MHD_step_parameter.o: $(MHD_SPH_DIR)/t_MHD_step_parameter.f90 m_precision.o t_time_data.o t_step_parameter.o t_IO_step_parameter.o t_VIZ_step_parameter.o t_flex_delta_t_parameter.o t_ctl_data_4_time_steps.o t_ctl_data_mhd_evo_scheme.o t_ctl_data_mhd_restart.o m_initial_field_control.o cal_num_digits.o skip_comment_f.o set_time_step_params.o $(F90) -c $(F90OPTFLAGS) $< -t_SPH_MHD_model_data.o: $(MHD_SPH_DIR)/t_SPH_MHD_model_data.f90 m_precision.o t_control_parameter.o t_poloidal_rotation.o t_radial_reference_field.o t_boundary_data_sph_MHD.o t_bc_data_list.o t_sph_boundary_input_data.o +t_SPH_MHD_model_data.o: $(MHD_SPH_DIR)/t_SPH_MHD_model_data.f90 m_precision.o t_control_parameter.o t_poloidal_rotation.o t_phys_data.o t_radial_reference_field.o t_boundary_data_sph_MHD.o t_bc_data_list.o t_sph_boundary_input_data.o $(F90) -c $(F90OPTFLAGS) $< -t_SPH_MHD_zmean_sections.o: $(MHD_SPH_DIR)/t_SPH_MHD_zmean_sections.f90 m_precision.o m_machine_parameter.o m_work_time.o m_elapsed_labels_4_VIZ.o calypso_mpi.o t_time_data.o t_comm_table.o t_mesh_data.o t_phys_data.o t_spheric_parameter.o t_sph_trans_arrays_MHD.o t_cross_section.o t_mesh_SR.o t_VIZ_step_parameter.o t_control_data_dynamo_sects.o FEM_analyzer_sph_MHD.o nod_phys_send_recv.o sph_rtp_zonal_rms_data.o +t_SPH_MHD_zmean_sections.o: $(MHD_SPH_DIR)/t_SPH_MHD_zmean_sections.f90 m_precision.o m_machine_parameter.o m_work_time.o calypso_mpi.o t_time_data.o t_comm_table.o t_mesh_data.o t_phys_data.o t_spheric_parameter.o t_sph_trans_arrays_MHD.o t_cross_section.o t_mesh_SR.o t_VIZ_step_parameter.o t_elapsed_labels_4_SECTIONS.o t_control_data_dynamo_sects.o FEM_analyzer_sph_MHD.o nod_phys_send_recv.o sph_rtp_zonal_rms_data.o $(F90) -c $(F90OPTFLAGS) $< t_addresses_sph_transform.o: $(MHD_SPH_DIR)/t_addresses_sph_transform.f90 m_precision.o t_spheric_rtp_data.o $(F90) -c $(F90OPTFLAGS) $< -t_boundary_data_sph_MHD.o: $(MHD_SPH_DIR)/t_boundary_data_sph_MHD.f90 m_precision.o t_boundary_params_sph_MHD.o t_boundary_sph_spectr.o t_coef_fdm2_MHD_boundaries.o t_coef_fdm4_MHD_boundaries.o t_time_data.o t_spheric_parameter.o t_control_parameter.o set_evoluved_boundaries.o +t_boundary_data_sph_MHD.o: $(MHD_SPH_DIR)/t_boundary_data_sph_MHD.f90 m_precision.o t_boundary_params_sph_MHD.o t_boundary_sph_spectr.o t_coef_fdm2_MHD_boundaries.o t_coef_fdm4_zero_vpol_ICB.o t_coef_fdm4_free_vpol_ICB.o t_coef_fdm4_zero_vpol_CMB.o t_coef_fdm4_free_vpol_CMB.o t_coef_fdm4_vpol_centre.o t_coef_fdm3_n2e_zero_vp_ICB.o t_coef_fdm3_n2e_free_vp_ICB.o t_coef_fdm3_n2e_zero_vp_CMB.o t_coef_fdm3_n2e_free_vp_CMB.o t_coef_fdm3_n2e_zero_vp_CTR.o t_time_data.o t_spheric_parameter.o t_control_parameter.o set_evoluved_boundaries.o $(F90) -c $(F90OPTFLAGS) $< t_boundary_params_sph_MHD.o: $(MHD_SPH_DIR)/t_boundary_params_sph_MHD.f90 m_precision.o cal_fdm_coefs_4_boundaries.o $(F90) -c $(F90OPTFLAGS) $< @@ -326,15 +334,15 @@ t_cal_max_indices.o: $(MHD_SPH_DIR)/t_cal_max_indices.f90 m_precision.o t_geomet $(F90) -c $(F90OPTFLAGS) $< t_coef_fdm2_MHD_boundaries.o: $(MHD_SPH_DIR)/t_coef_fdm2_MHD_boundaries.f90 m_precision.o m_constants.o $(F90) -c $(F90OPTFLAGS) $< -t_coef_fdm4_MHD_boundaries.o: $(MHD_SPH_DIR)/t_coef_fdm4_MHD_boundaries.f90 m_precision.o m_constants.o - $(F90) -c $(F90OPTFLAGS) $< t_coef_parameters_list.o: $(MHD_SPH_DIR)/t_coef_parameters_list.f90 m_precision.o m_machine_parameter.o m_error_IDs.o t_physical_property.o t_ctl_data_mhd_normalize.o t_ctl_data_dimless_numbers.o t_powers_4_coefficients.o t_list_of_dimless_numbers.o set_control_4_MHD_coefs.o t_ctl_data_mhd_magne.o t_ctl_data_magnetic_scale.o calypso_mpi.o $(F90) -c $(F90OPTFLAGS) $< t_const_wz_coriolis_rtp.o: $(MHD_SPH_DIR)/t_const_wz_coriolis_rtp.f90 m_precision.o m_constants.o m_machine_parameter.o t_spheric_rtp_data.o t_spheric_rj_data.o calypso_mpi.o calypso_mpi_real.o overwrite_prod_const_smp.o $(F90) -c $(F90OPTFLAGS) $< -t_control_parameter.o: $(MHD_SPH_DIR)/t_control_parameter.f90 m_precision.o t_physical_property.o t_reference_scalar_param.o t_coef_parameters_list.o +t_control_parameter.o: $(MHD_SPH_DIR)/t_control_parameter.f90 m_precision.o t_physical_property.o t_reference_scalar_param.o t_coef_parameters_list.o t_ctl_param_val_density.o t_ctl_param_val_diffusion.o + $(F90) -c $(F90OPTFLAGS) $< +t_coriolis_terms_rlm.o: $(MHD_SPH_DIR)/t_coriolis_terms_rlm.f90 m_precision.o m_machine_parameter.o m_constants.o t_spheric_rlm_data.o t_poloidal_rotation.o t_addresses_sph_transform.o t_schmidt_poly_on_rtm.o t_boundary_params_sph_MHD.o t_gaunt_coriolis_rlm.o calypso_mpi.o interact_coriolis_rlm.o $(F90) -c $(F90OPTFLAGS) $< -t_coriolis_terms_rlm.o: $(MHD_SPH_DIR)/t_coriolis_terms_rlm.f90 m_precision.o m_machine_parameter.o m_constants.o t_spheric_rlm_data.o t_sph_trans_comm_tbl.o t_poloidal_rotation.o t_addresses_sph_transform.o t_schmidt_poly_on_rtm.o t_physical_property.o t_boundary_params_sph_MHD.o t_gaunt_coriolis_rlm.o calypso_mpi.o interact_coriolis_rlm.o sum_rot_coriolis_terms_rlm.o sum_boundary_coriolis_rlm.o sum_coriolis_terms_rlm.o m_sph_communicators.o sel_spherical_SRs.o +t_ctl_param_val_density.o: $(MHD_SPH_DIR)/t_ctl_param_val_density.f90 m_precision.o m_constants.o t_ctl_data_valuable_density.o skip_comment_f.o $(F90) -c $(F90OPTFLAGS) $< t_each_sph_boundary_IO_data.o: $(MHD_SPH_DIR)/t_each_sph_boundary_IO_data.f90 m_precision.o t_spheric_rj_data.o t_boundary_sph_spectr.o t_boundary_params_sph_MHD.o calypso_mpi.o calypso_mpi_int.o calypso_mpi_char.o transfer_to_long_integers.o calypso_mpi_real.o m_machine_parameter.o set_sph_boundary_from_file.o skip_comment_f.o $(F90) -c $(F90OPTFLAGS) $< diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/add_base_field_4_sph_trns.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/add_base_field_4_sph_trns.f90 index 17f8b927..1395372b 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/add_base_field_4_sph_trns.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/add_base_field_4_sph_trns.f90 @@ -62,7 +62,7 @@ subroutine add_base_vector_4_MHD_sph_trns & ! ! ! velocity flag -! if( fl_prop%iflag_4_inertia .or. cd_prop%iflag_4_induction & +! if( fl_prop%flag_inertia .or. cd_prop%iflag_4_induction & ! & .or. ht_prop%iflag_4_advection & ! & .or. cp_prop%iflag_4_advection) then call add_field_4_sph_trns_by_pol(d_rj, & @@ -70,26 +70,26 @@ subroutine add_base_vector_4_MHD_sph_trns & & trns) ! end if ! vorticity flag -! if(fl_prop%iflag_4_inertia) then +! if(fl_prop%flag_inertia) then call add_field_4_sph_trns_by_pol(d_rj, & & ipol_base%i_vort, iphys_base%i_vort, b_trns_base%i_vort, & & trns) ! end if ! magnetic field flag -! if(cd_prop%iflag_4_induction .or. fl_prop%iflag_4_lorentz) then +! if(cd_prop%iflag_4_induction .or. fl_prop%flag_lorentz) then call add_field_4_sph_trns_by_pol(d_rj, & & ipol_base%i_magne, iphys_base%i_magne, b_trns_base%i_magne, & & trns) ! end if ! current density flag -! if(fl_prop%iflag_4_lorentz) then +! if(fl_prop%flag_lorentz) then call add_field_4_sph_trns_by_pol(d_rj, & & ipol_base%i_current, iphys_base%i_current, & & b_trns_base%i_current, trns) ! end if ! ! external magnetic field flag -! if(cd_prop%iflag_4_induction .or. fl_prop%iflag_4_lorentz) then +! if(cd_prop%iflag_4_induction .or. fl_prop%flag_lorentz) then call add_field_4_sph_trns_by_pol(d_rj, & & ipol_base%i_back_B, iphys_base%i_back_B, & & b_trns_base%i_back_B, trns) diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/add_base_force_4_sph_trns.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/add_base_force_4_sph_trns.f90 index 8369c2d8..3713e134 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/add_base_force_4_sph_trns.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/add_base_force_4_sph_trns.f90 @@ -103,19 +103,19 @@ subroutine add_base_force_4_MHD_sph_trns & ! ! advection ! if(fl_prop%iflag_scheme .gt. id_no_evolution) then -! if(fl_prop%iflag_4_inertia) then +! if(fl_prop%flag_inertia) then call add_field_4_sph_trns_by_pol(d_rj, & & ipol_frc%i_m_advect, iphys_frc%i_m_advect, & & f_trns_frc%i_m_advect, trns) ! end if ! Coriolis force -! if(fl_prop%iflag_4_coriolis) then +! if(fl_prop%flag_coriolis) then call add_field_4_sph_trns_by_pol(d_rj, & & ipol_frc%i_coriolis, iphys_frc%i_coriolis, & & f_trns_frc%i_coriolis, trns) ! end if ! Lorentz force -! if(fl_prop%iflag_4_lorentz) then +! if(fl_prop%flag_lorentz) then call add_field_4_sph_trns_by_pol(d_rj, & & ipol_frc%i_lorentz, iphys_frc%i_lorentz, & & f_trns_frc%i_lorentz, trns) @@ -189,7 +189,7 @@ subroutine add_rot_coriolis_MHD_sph_trns(d_rj, & ! ! rotation of Coriolis force ! if(fl_prop%iflag_scheme .gt. id_no_evolution & -! & .and. fl_prop%iflag_4_coriolis) then +! & .and. fl_prop%flag_coriolis) then call add_field_4_sph_trns_by_pol(d_rj, & & ipol_rot_frc%i_Coriolis, iphys_rot_frc%i_Coriolis, & & f_trns_rot_frc%i_Coriolis, trns) diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/cal_coriolis_rlm.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/cal_coriolis_rlm.f90 new file mode 100644 index 00000000..bbb26527 --- /dev/null +++ b/src/Fortran_libraries/MHD_src/sph_MHD/cal_coriolis_rlm.f90 @@ -0,0 +1,296 @@ +!>@file cal_coriolis_rlm.f90 +!!@brief module cal_coriolis_rlm +!! +!!@author H. Matsui +!!@date Programmed in 1995 +!@n Modified in Dec., 2013 +! +!>@brief Evaluate Coriolis force in (r,l,m) parallelization +!! +!!@verbatim +!!************************************************ +!! subroutine s_cal_coriolis_rlm(ncomp_trans, sph_rlm, comm_rlm, & +!! & fl_prop, sph_bc_U, omega_sph, b_trns, f_trns, & +!! & leg, gt_cor, n_WR, WR, cor_rlm) +!! type(sph_rlm_grid), intent(in) :: sph_rlm +!! type(sph_comm_tbl), intent(in) :: comm_rlm +!! type(fluid_property), intent(in) :: fl_prop +!! type(sph_boundary_type), intent(in) :: sph_bc_U +!! type(sph_rotation), intent(in) :: omega_sph +!! type(phys_address), intent(in) :: b_trns, f_trns +!! type(legendre_4_sph_trans), intent(in) :: leg +!! type(gaunt_coriolis_rlm), intent(in) :: gt_cor +!! integer(kind = kint), intent(in) :: ncomp_trans, n_WR +!! real(kind = kreal), intent(in) :: WR(n_WR) +!! type(coriolis_rlm_data), intent(inout) :: cor_rlm +!! +!! subroutine copy_coriolis_terms_rlm(ncomp_trans, sph_rlm, & +!! & comm_rlm, b_trns, cor_rlm, n_WS, WS) +!! type(sph_rlm_grid), intent(in) :: sph_rlm +!! type(sph_comm_tbl), intent(in) :: comm_rlm +!! type(phys_address), intent(in) :: b_trns +!! type(coriolis_rlm_data), intent(in) :: cor_rlm +!! integer(kind = kint), intent(in) :: ncomp_trans, n_WS +!! real(kind = kreal), intent(inout) :: WS(n_WS) +!! +!!************************************************ +!! +!! Radial componenet of the Coriolis term +!! (wsr) = wsr(jc,1,j3)*dw*dusb/r**2 +!! Horizontal poloidal component of the Coriolos term +!! (wtr) = wtr(j3)*dw*wtb/r**2 +!! +!! Toroidal of componennt of the Coriolos term +!! (wss) = wss(jc,1,j3)*w*dyb/r**2 +!! + wss(jc,2,j3)*dw*yb/r**2 +!! +!!************************************************ +!! +!!************************************************ +!! +!! wss(jc,1,j3) = sw_rj(jc,1,j3) +!! wss(jc,2,j3) = sw_rj(jc,2,j3) +!! wts(jc,j3) = sw_rj(jc,3,j3) +!! wst(jc,1,j3) = tw_rj(jc,1,j3) +!! wst(jc,2,j3) = tw_rj(jc,2,j3) +!! wtt(jc,1,j3) = tw_rj(jc,3,j3) +!! wtt(jc,2,j3) = tw_rj(jc,4,j3) +!! +!! wsd(jc,1,j3) = sd_rj(jc,1,j3) +!! wsd(jc,2,j3) = sd_rj(jc,2,j3) +!! wtd(jc,j3) = td_rj(jc,j3) +!! +!! wsr(jc,j3) = sr_rj(jc,j3) +!! wtr(jc,j3) = tr_rj(jc,j3) +!! +!!************************************************ +!!@endverbatim +!! +! +! + module cal_coriolis_rlm +! + use m_precision +! + use m_machine_parameter + use m_constants +! + use t_spheric_rlm_data + use t_sph_trans_comm_tbl + use t_poloidal_rotation + use t_addresses_sph_transform + use t_schmidt_poly_on_rtm + use t_physical_property + use t_boundary_params_sph_MHD + use t_gaunt_coriolis_rlm + use t_coriolis_terms_rlm + use t_phys_address +! + implicit none +! +! +!> Address for poloidal componenet of Coriolis term + integer(kind = kint), parameter, private :: ip_rlm_coriolis = 1 +!> Address for horizontal componenet of Coriolis term + integer(kind = kint), parameter, private :: ih_rlm_coriolis = 2 +!> Address for toroidal componenet of Coriolis term + integer(kind = kint), parameter, private :: it_rlm_coriolis = 3 +! +!> Address for poloidal componenet of Coriolis term + integer(kind = kint), parameter, private :: ip_rlm_rot_cor = 4 +!> Address for horizontal componenet of Coriolis term + integer(kind = kint), parameter, private :: ih_rlm_rot_cor = 5 +!> Address for toroidal componenet of Coriolis term + integer(kind = kint), parameter, private :: it_rlm_rot_cor = 6 +! + private :: sum_coriolis_rlm, sum_rot_coriolis_rlm +! +! ----------------------------------------------------------------------- +! + contains +! +! ----------------------------------------------------------------------- +! + subroutine s_cal_coriolis_rlm(ncomp_trans, sph_rlm, comm_rlm, & + & fl_prop, sph_bc_U, omega_sph, b_trns, f_trns, & + & leg, gt_cor, n_WR, WR, cor_rlm) +! + use t_physical_property + use t_boundary_params_sph_MHD +! + type(sph_rlm_grid), intent(in) :: sph_rlm + type(sph_comm_tbl), intent(in) :: comm_rlm + type(fluid_property), intent(in) :: fl_prop + type(sph_boundary_type), intent(in) :: sph_bc_U + type(sph_rotation), intent(in) :: omega_sph + type(phys_address), intent(in) :: b_trns, f_trns + type(legendre_4_sph_trans), intent(in) :: leg +! + type(gaunt_coriolis_rlm), intent(in) :: gt_cor +! + integer(kind = kint), intent(in) :: ncomp_trans, n_WR + real(kind = kreal), intent(in) :: WR(n_WR) +! + type(coriolis_rlm_data), intent(inout) :: cor_rlm +! +! + if(fl_prop%flag_coriolis .eqv. .FALSE.) return +! +!$omp parallel workshare + cor_rlm%d_cor_rlm(1:sph_rlm%nnod_rlm, & + & 1:cor_rlm%ncomp_coriolis_rlm) = 0.0d0 +!$omp end parallel workshare +! + if(f_trns%forces%i_Coriolis .gt. izero) then + call sum_coriolis_rlm(ncomp_trans, sph_rlm, comm_rlm, & + & fl_prop, sph_bc_U, omega_sph, b_trns, & + & gt_cor, n_WR, WR, cor_rlm) + end if +! + if(f_trns%rot_forces%i_Coriolis .gt. izero) then + call sum_rot_coriolis_rlm(ncomp_trans, sph_rlm, comm_rlm, & + & fl_prop, sph_bc_U, omega_sph, b_trns, & + & leg, gt_cor,n_WR, WR, cor_rlm) + end if +! + end subroutine s_cal_coriolis_rlm +! +! ----------------------------------------------------------------------- +! + subroutine copy_coriolis_terms_rlm(ncomp_trans, sph_rlm, & + & comm_rlm, f_trns, cor_rlm, n_WS, WS) +! + use m_sph_communicators + use sel_spherical_SRs +! + type(sph_rlm_grid), intent(in) :: sph_rlm + type(sph_comm_tbl), intent(in) :: comm_rlm + type(phys_address), intent(in) :: f_trns + type(coriolis_rlm_data), intent(in) :: cor_rlm +! + integer(kind = kint), intent(in) :: ncomp_trans, n_WS + real(kind = kreal), intent(inout) :: WS(n_WS) +! +! + if(f_trns%forces%i_Coriolis .gt. izero) then + call sel_calypso_to_send_vector & + & (ncomp_trans, sph_rlm%nnod_rlm, n_WS, & + & comm_rlm%nneib_domain, comm_rlm%istack_sr, comm_rlm%item_sr, & + & cor_rlm%ncomp_coriolis_rlm, ip_rlm_coriolis, & + & f_trns%forces%i_Coriolis, cor_rlm%d_cor_rlm(1,1), WS(1)) + end if +! + if(f_trns%rot_forces%i_Coriolis .gt. izero) then + call sel_calypso_to_send_vector & + & (ncomp_trans, sph_rlm%nnod_rlm, n_WS, & + & comm_rlm%nneib_domain, comm_rlm%istack_sr, comm_rlm%item_sr, & + & cor_rlm%ncomp_coriolis_rlm, ip_rlm_rot_cor, & + & f_trns%rot_forces%i_Coriolis, cor_rlm%d_cor_rlm(1,1), WS(1)) + end if +! + end subroutine copy_coriolis_terms_rlm +! +! ----------------------------------------------------------------------- +! ----------------------------------------------------------------------- +! + subroutine sum_coriolis_rlm(ncomp_trans, sph_rlm, comm_rlm, & + & fl_prop, sph_bc_U, omega_sph, b_trns, gt_cor, & + & n_WR, WR, cor_rlm) +! + use sum_coriolis_terms_rlm + use sum_boundary_coriolis_rlm +! + type(sph_rlm_grid), intent(in) :: sph_rlm + type(sph_comm_tbl), intent(in) :: comm_rlm + type(fluid_property), intent(in) :: fl_prop + type(sph_boundary_type), intent(in) :: sph_bc_U + type(sph_rotation), intent(in) :: omega_sph + type(phys_address), intent(in) :: b_trns +! + type(gaunt_coriolis_rlm), intent(in) :: gt_cor +! + integer(kind = kint), intent(in) :: ncomp_trans, n_WR + real(kind = kreal), intent(in) :: WR(n_WR) +! + type(coriolis_rlm_data), intent(inout) :: cor_rlm +! +! + call select_sum_coriolis_rlm_10 & + & (b_trns, sph_rlm, omega_sph, gt_cor, fl_prop%coef_cor, & + & ncomp_trans, n_WR, comm_rlm%irev_sr, WR, & + & cor_rlm%d_cor_rlm(1,ip_rlm_coriolis), & + & cor_rlm%d_cor_rlm(1,ih_rlm_coriolis), & + & cor_rlm%d_cor_rlm(1,it_rlm_coriolis)) +! + if(sph_bc_U%iflag_icb .eq. iflag_rotatable_ic) then + call inner_core_rot_z_coriolis_rlm(b_trns, & + & sph_rlm%nnod_rlm, sph_rlm%nidx_rlm, sph_rlm%istep_rlm, & + & sph_rlm%radius_1d_rlm_r, omega_sph%ws_rlm, & + & fl_prop%coef_cor, ncomp_trans, n_WR, comm_rlm%irev_sr, WR, & + & cor_rlm%idx_rlm_ICB, cor_rlm%idx_rlm_degree_one, & + & cor_rlm%d_cor_rlm(1,it_rlm_coriolis)) + end if +! + end subroutine sum_coriolis_rlm +! +! ----------------------------------------------------------------------- +! + subroutine sum_rot_coriolis_rlm(ncomp_trans, sph_rlm, comm_rlm, & + & fl_prop, sph_bc_U, omega_sph, b_trns, leg, gt_cor, & + & n_WR, WR, cor_rlm) +! + use t_physical_property + use t_boundary_params_sph_MHD + use sum_rot_coriolis_terms_rlm + use sum_boundary_coriolis_rlm +! use sum_div_coriolis_terms_rlm +! + type(sph_rlm_grid), intent(in) :: sph_rlm + type(sph_comm_tbl), intent(in) :: comm_rlm + type(fluid_property), intent(in) :: fl_prop + type(sph_boundary_type), intent(in) :: sph_bc_U + type(sph_rotation), intent(in) :: omega_sph + type(phys_address), intent(in) :: b_trns + type(legendre_4_sph_trans), intent(in) :: leg +! + type(gaunt_coriolis_rlm), intent(in) :: gt_cor +! + integer(kind = kint), intent(in) :: ncomp_trans, n_WR + real(kind = kreal), intent(in) :: WR(n_WR) +! + type(coriolis_rlm_data), intent(inout) :: cor_rlm +! +! + call select_sum_rot_coriolis_rlm_10(b_trns, & + & sph_rlm, leg, omega_sph, gt_cor, fl_prop%coef_cor, & + & ncomp_trans, n_WR, comm_rlm%irev_sr, WR, & + & cor_rlm%d_cor_rlm(1,ip_rlm_rot_cor), & + & cor_rlm%d_cor_rlm(1,it_rlm_rot_cor)) +! + if(sph_bc_U%iflag_icb .eq. iflag_rotatable_ic) then + call inner_core_rot_z_coriolis_rlm(b_trns, & + & sph_rlm%nnod_rlm, sph_rlm%nidx_rlm, sph_rlm%istep_rlm, & + & sph_rlm%radius_1d_rlm_r, omega_sph%ws_rlm, & + & fl_prop%coef_cor, ncomp_trans, n_WR, comm_rlm%irev_sr, WR, & + & cor_rlm%idx_rlm_ICB, cor_rlm%idx_rlm_degree_one, & + & cor_rlm%d_cor_rlm(1,ip_rlm_rot_cor)) + end if +! +! call sum_r_coriolis_bc_rlm_10(b_trns, & +! & sph_rlm%nnod_rlm, sph_rlm%nidx_rlm, sph_rlm%idx_gl_1d_rlm_j, & +! & omega_sph%ws_rlm, fl_prop%coef_cor, & +! & gt_cor%jgi_rlm, gt_cor%jei_rlm, gt_cor%sr_rlm, gt_cor%tr_rlm,& +! & ncomp_trans, kr_in_U_rlm, n_WR, comm_rlm%irev_sr, & +! & WR, cor_rlm%d_cor_in_rlm) +! call sum_r_coriolis_bc_rlm_10(b_trns, & +! & sph_rlm%nnod_rlm, sph_rlm%nidx_rlm, sph_rlm%idx_gl_1d_rlm_j, & +! & omega_sph%ws_rlm, fl_prop%coef_cor, & +! & gt_cor%jgi_rlm, gt_cor%jei_rlm, gt_cor%sr_rlm, gt_cor%tr_rlm,& +! & ncomp_trans, kr_out_U_rlm, n_WR, comm_rlm%irev_sr, & +! & WR, cor_rlm%d_cor_out_rlm) +! + end subroutine sum_rot_coriolis_rlm +! +! ----------------------------------------------------------------------- +! + end module cal_coriolis_rlm diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/cal_div_of_forces.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/cal_div_of_forces.f90 index bef299ce..5adc4145 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/cal_div_of_forces.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/cal_div_of_forces.f90 @@ -52,79 +52,79 @@ subroutine sum_div_of_forces & ! ! !$omp parallel - if( fl_prop%iflag_4_inertia & - & .and. fl_prop%iflag_4_gravity & - & .and. fl_prop%iflag_4_composit_buo & - & .and. fl_prop%iflag_4_coriolis & - & .and. fl_prop%iflag_4_lorentz) then + if( fl_prop%flag_inertia & + & .and. fl_prop%flag_thermal_buoyancy & + & .and. fl_prop%flag_comp_buoyancy & + & .and. fl_prop%flag_coriolis & + & .and. fl_prop%flag_lorentz) then call set_DMHD_terms_to_div_force & & (ipol_base%i_press, ipol_div_frc, & & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) - else if( fl_prop%iflag_4_inertia & - & .and. fl_prop%iflag_4_gravity & - & .and. (fl_prop%iflag_4_composit_buo .eqv. .FALSE.) & - & .and. fl_prop%iflag_4_coriolis & - & .and. fl_prop%iflag_4_lorentz) then + else if( fl_prop%flag_inertia & + & .and. fl_prop%flag_thermal_buoyancy & + & .and. (fl_prop%flag_comp_buoyancy .eqv. .FALSE.) & + & .and. fl_prop%flag_coriolis & + & .and. fl_prop%flag_lorentz) then call set_MHD_terms_to_div_force & & (ipol_base%i_press, ipol_div_frc, ipol_div_frc%i_buoyancy, & & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) - else if( fl_prop%iflag_4_inertia & - & .and.(fl_prop%iflag_4_gravity .eqv. .FALSE.) & - & .and. fl_prop%iflag_4_composit_buo & - & .and. fl_prop%iflag_4_coriolis & - & .and. fl_prop%iflag_4_lorentz) then + else if( fl_prop%flag_inertia & + & .and.(fl_prop%flag_thermal_buoyancy .eqv. .FALSE.) & + & .and. fl_prop%flag_comp_buoyancy & + & .and. fl_prop%flag_coriolis & + & .and. fl_prop%flag_lorentz) then call set_MHD_terms_to_div_force & & (ipol_base%i_press, ipol_div_frc, ipol_div_frc%i_comp_buo, & & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) - else if( fl_prop%iflag_4_inertia & - & .and. fl_prop%iflag_4_gravity & - & .and. fl_prop%iflag_4_composit_buo & - & .and. fl_prop%iflag_4_coriolis & - & .and. (fl_prop%iflag_4_lorentz .eqv. .FALSE.)) then + else if( fl_prop%flag_inertia & + & .and. fl_prop%flag_thermal_buoyancy & + & .and. fl_prop%flag_comp_buoyancy & + & .and. fl_prop%flag_coriolis & + & .and. (fl_prop%flag_lorentz .eqv. .FALSE.)) then call set_div_dcv_terms_to_force & & (ipol_base%i_press, ipol_div_frc, & & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) - else if( fl_prop%iflag_4_inertia & - & .and. fl_prop%iflag_4_gravity & - & .and. (fl_prop%iflag_4_composit_buo .eqv. .FALSE.) & - & .and. fl_prop%iflag_4_coriolis & - & .and. (fl_prop%iflag_4_lorentz .eqv. .FALSE.)) then + else if( fl_prop%flag_inertia & + & .and. fl_prop%flag_thermal_buoyancy & + & .and. (fl_prop%flag_comp_buoyancy .eqv. .FALSE.) & + & .and. fl_prop%flag_coriolis & + & .and. (fl_prop%flag_lorentz .eqv. .FALSE.)) then call set_div_cv_terms_to_force & & (ipol_base%i_press, ipol_div_frc, ipol_div_frc%i_buoyancy, & & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) - else if( fl_prop%iflag_4_inertia & - & .and.(fl_prop%iflag_4_gravity .eqv. .FALSE.) & - & .and. fl_prop%iflag_4_composit_buo & - & .and. fl_prop%iflag_4_coriolis & - & .and. (fl_prop%iflag_4_lorentz .eqv. .FALSE.)) then + else if( fl_prop%flag_inertia & + & .and.(fl_prop%flag_thermal_buoyancy .eqv. .FALSE.) & + & .and. fl_prop%flag_comp_buoyancy & + & .and. fl_prop%flag_coriolis & + & .and. (fl_prop%flag_lorentz .eqv. .FALSE.)) then call set_div_cv_terms_to_force & & (ipol_base%i_press, ipol_div_frc, ipol_div_frc%i_comp_buo, & & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) else call clear_field_data(rj_fld, n_scalar, ipol_base%i_press) ! -! if(fl_prop%iflag_4_inertia) then +! if(fl_prop%flag_inertia) then ! call add_div_advection_to_force & ! & (ipol_base%i_press, ipol_div_frc%i_m_advect, & ! & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) ! end if ! - if(fl_prop%iflag_4_coriolis) then + if(fl_prop%flag_coriolis) then call add_term_to_div_force & & (ipol_base%i_press, ipol_div_frc%i_Coriolis, & & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) end if - if(fl_prop%iflag_4_lorentz) then + if(fl_prop%flag_lorentz) then call add_term_to_div_force & & (ipol_base%i_press, ipol_div_frc%i_lorentz, & & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) end if - if(fl_prop%iflag_4_gravity) then + if(fl_prop%flag_thermal_buoyancy) then call add_term_to_div_force & & (ipol_base%i_press, ipol_div_frc%i_buoyancy, & & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) end if - if(fl_prop%iflag_4_composit_buo) then + if(fl_prop%flag_comp_buoyancy) then call add_term_to_div_force & & (ipol_base%i_press, ipol_div_frc%i_comp_buo, & & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/cal_heat_source_Nu.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/cal_heat_source_Nu.f90 index f0c96838..e73adb7e 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/cal_heat_source_Nu.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/cal_heat_source_Nu.f90 @@ -7,7 +7,6 @@ !> @brief Evaluate Nusselt number without heat source !! !!@verbatim -! !! subroutine init_poisson_matrix_for_Nu & !! & (mat_name, sph, r_2nd, sc_prop, sph_bc_S, fdm2_center, & !! & band_s00_poisson_fixS, Nu_type) diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/cal_nonlinear.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/cal_nonlinear.f90 index 81846958..a8107fec 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/cal_nonlinear.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/cal_nonlinear.f90 @@ -94,6 +94,7 @@ subroutine nonlinear(r_2nd, SPH_model, trans_p, & ! use cal_nonlinear_sph_MHD use sum_rotation_of_forces + use cal_self_buoyancies_sph use rot_self_buoyancies_sph ! use m_work_time @@ -109,10 +110,18 @@ subroutine nonlinear(r_2nd, SPH_model, trans_p, & type(send_recv_real_buffer), intent(inout) :: SR_r ! ! -! ---- lead rotation of buoyancies if(SPH_model%MHD_prop%fl_prop%iflag_scheme & & .gt. id_no_evolution) then - if(iflag_debug.gt.0) write(*,*) 'sel_rot_buoyancy_sph_MHD' +! +! ---- lead buoyancies + call sel_buoyancies_sph_MHD & + & (SPH_MHD%sph%sph_rj, trans_p%leg, SPH_MHD%ipol%forces, & + & SPH_model%MHD_prop%fl_prop, SPH_model%sph_MHD_bc%sph_bc_U, & + & SPH_MHD%ipol%base%i_temp, SPH_MHD%ipol%base%i_light, & + & SPH_MHD%fld) +! +! ---- lead rotation of buoyancies + if(iflag_debug.gt.0) write(*,*) 'sel_rot_buoyancy_sph_MHD' call sel_rot_buoyancy_sph_MHD(SPH_MHD%sph%sph_rj, & & SPH_MHD%ipol%base, SPH_MHD%ipol%rot_forces, & & SPH_model%MHD_prop%fl_prop, SPH_model%sph_MHD_bc%sph_bc_U, & @@ -143,9 +152,15 @@ subroutine nonlinear(r_2nd, SPH_model, trans_p, & if(SPH_model%MHD_prop%fl_prop%iflag_scheme .eq. id_no_evolution) & & return ! - if(iflag_debug .gt. 0) write(*,*) 'sum_forces_to_explicit' - call sum_forces_to_explicit(SPH_model%MHD_prop%fl_prop, & - & SPH_MHD%ipol%exp_work, SPH_MHD%ipol%rot_forces, SPH_MHD%fld) +! if(iflag_debug .gt. 0) write(*,*) & +! & 'sum_forces_to_explicit for forces' +! call sum_forces_to_explicit(SPH_model%MHD_prop%fl_prop, & +! & SPH_MHD%ipol%exp_work, SPH_MHD%ipol%forces, SPH_MHD%fld) + if(iflag_debug .gt. 0) write(*,*) & + & 'sum_forces_to_explicit for rotation of forces' + call sum_forces_to_explicit(SPH_model%MHD_prop%fl_prop, & + & SPH_MHD%ipol%exp_work, SPH_MHD%ipol%rot_forces, & + & SPH_MHD%fld) ! end subroutine nonlinear !* @@ -187,9 +202,9 @@ subroutine nonlinear_by_pseudo_sph & if (iflag_debug.ge.1) write(*,*) 'sph_back_trans_4_MHD' call sph_back_trans_4_MHD & & (sph, comms_sph, MHD_prop%fl_prop, sph_MHD_bc%sph_bc_U, & - & omega_sph, trans_p, gt_cor, rj_fld, trns_MHD%b_trns, & - & trns_MHD%backward, WK_leg, WK_FFTs_MHD, cor_rlm, & - & SR_sig, SR_r) + & omega_sph, trans_p, gt_cor, rj_fld, & + & trns_MHD%b_trns, trns_MHD%f_trns, trns_MHD%backward, & + & WK_leg, WK_FFTs_MHD, cor_rlm, SR_sig, SR_r) if(iflag_SMHD_time) call end_elapsed_time(ist_elapsed_SMHD+9) ! if(iflag_SMHD_time) call start_elapsed_time(ist_elapsed_SMHD+10) @@ -223,6 +238,7 @@ subroutine licv_exp(refs, MHD_prop, sph_MHD_bc, & & rj_fld, SR_sig, SR_r) ! use m_phys_constants + use cal_self_buoyancies_sph use rot_self_buoyancies_sph use sph_transforms_4_MHD use copy_nodal_fields @@ -243,8 +259,15 @@ subroutine licv_exp(refs, MHD_prop, sph_MHD_bc, & type(send_recv_status), intent(inout) :: SR_sig type(send_recv_real_buffer), intent(inout) :: SR_r ! -! ---- Rotation of buoyancies +! if(MHD_prop%fl_prop%iflag_scheme .gt. id_no_evolution) then +! ---- lead rotation of buoyancies + call sel_buoyancies_sph_MHD & + & (sph%sph_rj, trans_p%leg, ipol%forces, & + & MHD_prop%fl_prop, sph_MHD_bc%sph_bc_U, & + & ipol%base%i_temp, ipol%base%i_light, rj_fld) +! +! ---- lead rotation of buoyancies if(iflag_debug.gt.0) write(*,*) 'sel_rot_buoyancy_sph_MHD' call sel_rot_buoyancy_sph_MHD & & (sph%sph_rj, ipol%base, ipol%rot_forces, & @@ -253,7 +276,7 @@ subroutine licv_exp(refs, MHD_prop, sph_MHD_bc, & !* !* ---- copy velocity for coriolis term ------------------ if(iflag_debug.eq.1) write(*,*) 'sph_transform_4_licv' - if(MHD_prop%fl_prop%iflag_4_coriolis) then + if(MHD_prop%fl_prop%flag_coriolis) then call sph_transform_4_licv & & (sph%sph_rlm, comms_sph%comm_rlm, comms_sph%comm_rj, & & MHD_prop%fl_prop, sph_MHD_bc%sph_bc_U, omega_sph, trans_p, & @@ -276,8 +299,12 @@ subroutine licv_exp(refs, MHD_prop, sph_MHD_bc, & call add_ref_advect_sph_MHD(sph%sph_rj, sph_MHD_bc, MHD_prop, & & trans_p%leg, refs, ipol, rj_fld) ! - call licv_forces_to_explicit(MHD_prop%fl_prop, & - & ipol%exp_work, ipol%rot_forces, rj_fld) +! +! call licv_forces_to_explicit(MHD_prop%fl_prop, & +! & ipol%exp_work, ipol%forces, rj_fld) + + call licv_forces_to_explicit(MHD_prop%fl_prop, & + & ipol%exp_work, ipol%rot_forces, rj_fld) ! ! end subroutine licv_exp diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/cal_nonlinear_sph_MHD.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/cal_nonlinear_sph_MHD.f90 index 460a2fb3..3650de90 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/cal_nonlinear_sph_MHD.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/cal_nonlinear_sph_MHD.f90 @@ -141,7 +141,7 @@ subroutine cal_nonlinear_pole_MHD(sph_rtp, MHD_prop, & & trns_b_snap%ncomp, trns_b_snap%fld_pole, & & trns_f_MHD%ncomp, trns_f_MHD%fld_pole) ! - if(MHD_prop%fl_prop%iflag_4_coriolis) then + if(MHD_prop%fl_prop%flag_coriolis) then call cal_wz_coriolis_pole & & (sph_rtp%nnod_pole, MHD_prop%fl_prop%coef_cor, & & trns_b_snap%fld_pole(1,b_trns_base%i_velo), & diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/cal_self_buoyancies_sph.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/cal_self_buoyancies_sph.f90 index c8c80368..9741cc30 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/cal_self_buoyancies_sph.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/cal_self_buoyancies_sph.f90 @@ -7,9 +7,12 @@ !>@brief Evaluate divergence of buoyancy for pressure evaluation !! !!@verbatim +!! subroutine sel_field_address_for_buoyancies & +!! & (ipol_base, ref_param_T, ref_param_C, & +!! & ibuo_temp, ibuo_comp) !! subroutine sel_buoyancies_sph_MHD & -!! & (sph_rj, leg, ipol_base, ipol_frc, & -!! & fl_prop, ref_param_T, ref_param_C, sph_bc_U, rj_fld) +!! & (sph_rj, leg, ipol_frc, fl_prop, sph_bc_U, & +!! & ibuo_temp, ibuo_comp, rj_fld) !! type(legendre_4_sph_trans), intent(in) :: leg !! type(fluid_property), intent(in) :: fl_prop !! type(reference_scalar_param), intent(in) :: ref_param_T @@ -39,6 +42,8 @@ module cal_self_buoyancies_sph use t_boundary_params_sph_MHD ! implicit none +! + private :: sel_buoyancies_sph_rj ! !----------------------------------------------------------------------- ! @@ -46,137 +51,97 @@ module cal_self_buoyancies_sph ! !----------------------------------------------------------------------- ! - subroutine sel_buoyancies_sph_MHD & - & (sph_rj, leg, ipol_base, ipol_frc, & - & fl_prop, ref_param_T, ref_param_C, sph_bc_U, rj_fld) -! - use adjust_reference_fields + subroutine sel_field_address_for_buoyancies & + & (ipol_base, ref_param_T, ref_param_C, & + & ibuo_temp, ibuo_comp) ! - type(legendre_4_sph_trans), intent(in) :: leg - type(fluid_property), intent(in) :: fl_prop type(reference_scalar_param), intent(in) :: ref_param_T type(reference_scalar_param), intent(in) :: ref_param_C - type(sph_rj_grid), intent(in) :: sph_rj type(base_field_address), intent(in) :: ipol_base - type(base_force_address), intent(in) :: ipol_frc - type(sph_boundary_type), intent(in) :: sph_bc_U - type(phys_data), intent(inout) :: rj_fld ! - integer(kind = kint) :: ipol_temp, ipol_comp + integer(kind = kint), intent(inout) :: ibuo_temp, ibuo_comp ! ! if(ref_param_T%flag_ref_field) then - ipol_temp = ipol_base%i_per_temp + ibuo_temp = ipol_base%i_per_temp else - ipol_temp = ipol_base%i_temp + ibuo_temp = ipol_base%i_temp end if ! if(ref_param_C%flag_ref_field) then - ipol_comp = ipol_base%i_per_light - else - ipol_comp = ipol_base%i_light - end if -! -! - if(fl_prop%i_grav .eq. iflag_radial_g) then - call sel_r_const_buoyancies_sph_MHD & - & (sph_rj, leg, ipol_temp, ipol_comp, ipol_frc, & - & fl_prop, sph_bc_U, rj_fld) + ibuo_comp = ipol_base%i_per_light else - call sel_self_buoyancies_sph_MHD & - & (sph_rj, leg, ipol_temp, ipol_comp, ipol_frc, & - & fl_prop, sph_bc_U, rj_fld) + ibuo_comp = ipol_base%i_light end if ! - end subroutine sel_buoyancies_sph_MHD + end subroutine sel_field_address_for_buoyancies ! !----------------------------------------------------------------------- +!----------------------------------------------------------------------- ! - subroutine sel_self_buoyancies_sph_MHD & - & (sph_rj, leg, ipol_temp, ipol_comp, ipol_frc, & - & fl_prop, sph_bc_U, rj_fld) -! - use cal_buoyancies_sph_MHD - use adjust_reference_fields + subroutine sel_buoyancies_sph_MHD & + & (sph_rj, leg, ipol_frc, fl_prop, sph_bc_U, & + & ibuo_temp, ibuo_comp, rj_fld) ! + type(sph_rj_grid), intent(in) :: sph_rj type(legendre_4_sph_trans), intent(in) :: leg type(fluid_property), intent(in) :: fl_prop - type(sph_rj_grid), intent(in) :: sph_rj - integer(kind = kint), intent(in) :: ipol_temp, ipol_comp type(base_force_address), intent(in) :: ipol_frc type(sph_boundary_type), intent(in) :: sph_bc_U + integer(kind = kint), intent(in) :: ibuo_temp, ibuo_comp +! type(phys_data), intent(inout) :: rj_fld ! ! - if (ipol_temp * ipol_frc%i_buoyancy .gt. 0) then - if (iflag_debug.ge.1) write(*,*) & - & 'cal_self_buoyancy_sph_MHD by pert. temperature' - call cal_self_buoyancy_sph_MHD & - & (sph_bc_U%kr_in, sph_bc_U%kr_out, leg%g_sph_rj, & - & fl_prop%coef_buo, ipol_temp, ipol_frc%i_buoyancy, & - & sph_rj%nidx_rj, sph_rj%radius_1d_rj_r, & - & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) - call delete_sphere_average & - & (ipol_frc%i_buoyancy, sph_rj, rj_fld) - end if + call sel_buoyancies_sph_rj(fl_prop%i_grav, sph_rj, leg, & + & ibuo_temp, ipol_frc%i_buoyancy, fl_prop%coef_buo, & + & sph_bc_U, rj_fld) + call sel_buoyancies_sph_rj(fl_prop%i_grav, sph_rj, leg, & + & ibuo_comp, ipol_frc%i_comp_buo, fl_prop%coef_comp_buo, & + & sph_bc_U, rj_fld) ! - if (ipol_comp * ipol_frc%i_comp_buo .gt. 0) then - if (iflag_debug.ge.1) write(*,*) & - & 'cal_self_buoyancy_sph_MHD by composition' - call cal_self_buoyancy_sph_MHD(sph_bc_U%kr_in, sph_bc_U%kr_out, & - & leg%g_sph_rj, fl_prop%coef_comp_buo, & - & ipol_comp, ipol_frc%i_comp_buo, & - & sph_rj%nidx_rj, sph_rj%radius_1d_rj_r, & - & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) - call delete_sphere_average & - & (ipol_frc%i_comp_buo, sph_rj, rj_fld) - end if -! - end subroutine sel_self_buoyancies_sph_MHD + end subroutine sel_buoyancies_sph_MHD ! !----------------------------------------------------------------------- ! - subroutine sel_r_const_buoyancies_sph_MHD & - & (sph_rj, leg, ipol_temp, ipol_comp, ipol_frc, & - & fl_prop, sph_bc_U, rj_fld) + subroutine sel_buoyancies_sph_rj(i_grav, sph_rj, leg, & + & ipol_scalar, ipol_buo, coef_buo, sph_bc_U, rj_fld) ! use cal_buoyancies_sph_MHD use adjust_reference_fields ! - type(legendre_4_sph_trans), intent(in) :: leg - type(fluid_property), intent(in) :: fl_prop + integer(kind = kint), intent(in) :: i_grav + integer(kind = kint), intent(in) :: ipol_scalar, ipol_buo type(sph_rj_grid), intent(in) :: sph_rj - integer(kind = kint), intent(in) :: ipol_temp, ipol_comp - type(base_force_address), intent(in) :: ipol_frc + type(legendre_4_sph_trans), intent(in) :: leg type(sph_boundary_type), intent(in) :: sph_bc_U + real(kind = kreal), intent(in) :: coef_buo +! type(phys_data), intent(inout) :: rj_fld ! ! - if (ipol_temp * ipol_frc%i_buoyancy .gt. 0) then + if (ipol_scalar * ipol_buo .le. 0) return +! + if(i_grav .eq. iflag_radial_g) then if (iflag_debug.ge.1) write(*,*) & & 'cal_radial_buoyancy_sph_MHD by pert. temperature' call cal_radial_buoyancy_sph_MHD & & (sph_bc_U%kr_in, sph_bc_U%kr_out, leg%g_sph_rj, & - & fl_prop%coef_buo, ipol_temp, ipol_frc%i_buoyancy, & + & coef_buo, ipol_scalar, ipol_buo, & & sph_rj%nidx_rj, sph_rj%radius_1d_rj_r, & & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) - call delete_sphere_average & - & (ipol_frc%i_buoyancy, sph_rj, rj_fld) - end if -! - if (ipol_comp * ipol_frc%i_comp_buo .gt. 0) then + else if (iflag_debug.ge.1) write(*,*) & - & 'cal_radial_buoyancy_sph_MHD by composition' - call cal_radial_buoyancy_sph_MHD & + & 'cal_self_buoyancy_sph_MHD by pert. temperature' + call cal_self_buoyancy_sph_MHD & & (sph_bc_U%kr_in, sph_bc_U%kr_out, leg%g_sph_rj, & - & fl_prop%coef_comp_buo, ipol_comp, ipol_frc%i_comp_buo, & + & coef_buo, ipol_scalar, ipol_buo, & & sph_rj%nidx_rj, sph_rj%radius_1d_rj_r, & & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) - call delete_sphere_average & - & (ipol_frc%i_comp_buo, sph_rj, rj_fld) end if + call delete_sphere_average(ipol_buo, sph_rj, rj_fld) ! - end subroutine sel_r_const_buoyancies_sph_MHD + end subroutine sel_buoyancies_sph_rj ! !----------------------------------------------------------------------- ! diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/cal_sph_divergence_of_force.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/cal_sph_divergence_of_force.f90 index a75979dc..2cc9455e 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/cal_sph_divergence_of_force.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/cal_sph_divergence_of_force.f90 @@ -21,7 +21,7 @@ !! type(phys_data), intent(inout) :: rj_fld !! !! subroutine cal_div_of_buoyancies_sph_2 & -!! & (iflag_4_gravity, iflag_4_composit_buo, & +!! & (flag_thermal_buoyancy, flag_comp_buoyancy, & !! & sph_rj, r_2nd, sph_MHD_bc, g_sph_rj, & !! & ipol_frc, ipol_div_frc, rj_fld) !! type(sph_rj_grid), intent(in) :: sph_rj @@ -80,33 +80,33 @@ subroutine cal_div_of_forces_sph_2 & type(phys_data), intent(inout) :: rj_fld ! ! - if(MHD_prop%fl_prop%iflag_4_inertia) then + if(MHD_prop%fl_prop%flag_inertia) then call const_sph_div_force & & (sph_rj, r_2nd, sph_MHD_bc%sph_bc_U, g_sph_rj, & & ipol_frc%i_m_advect, ipol_div_frc%i_m_advect, rj_fld) end if ! - if(MHD_prop%fl_prop%iflag_4_lorentz) then + if(MHD_prop%fl_prop%flag_lorentz) then call const_sph_div_force & & (sph_rj, r_2nd, sph_MHD_bc%sph_bc_U, g_sph_rj, & & ipol_frc%i_lorentz, ipol_div_frc%i_lorentz, rj_fld) end if ! - if(MHD_prop%fl_prop%iflag_4_coriolis) then + if(MHD_prop%fl_prop%flag_coriolis) then call const_sph_div_force & & (sph_rj, r_2nd, sph_MHD_bc%sph_bc_U, g_sph_rj, & & ipol_frc%i_coriolis, ipol_div_frc%i_Coriolis, rj_fld) end if ! call cal_div_of_buoyancies_sph_2 & - & (MHD_prop%fl_prop%iflag_4_gravity, & - & MHD_prop%fl_prop%iflag_4_composit_buo, & + & (MHD_prop%fl_prop%flag_thermal_buoyancy, & + & MHD_prop%fl_prop%flag_comp_buoyancy, & & sph_rj, r_2nd, sph_MHD_bc, g_sph_rj, & & ipol_frc, ipol_div_frc, rj_fld) ! ! call sel_div_buoyancies_sph_MHD & -! & (MHD_prop%fl_prop%iflag_4_gravity, & -! & MHD_prop%fl_prop%iflag_4_composit_buo, & +! & (MHD_prop%fl_prop%flag_thermal_buoyancy, & +! & MHD_prop%fl_prop%flag_comp_buoyancy, & ! & sph_rj, ipol_base, ipol_grad, ipol_div_frc, & ! & MHD_prop%fl_prop%coef_buo, MHD_prop%fl_prop%coef_comp_buo, & ! & MHD_prop%ref_param_T, MHD_prop%ref_param_C, & @@ -117,14 +117,14 @@ end subroutine cal_div_of_forces_sph_2 ! ----------------------------------------------------------------------- ! subroutine cal_div_of_buoyancies_sph_2 & - & (iflag_4_gravity, iflag_4_composit_buo, & + & (flag_thermal_buoyancy, flag_comp_buoyancy, & & sph_rj, r_2nd, sph_MHD_bc, g_sph_rj, & & ipol_frc, ipol_div_frc, rj_fld) ! use t_control_parameter use const_sph_divergence ! - logical, intent(in) :: iflag_4_gravity, iflag_4_composit_buo + logical, intent(in) :: flag_thermal_buoyancy, flag_comp_buoyancy type(sph_rj_grid), intent(in) :: sph_rj type(fdm_matrices), intent(in) :: r_2nd type(sph_MHD_boundary_data), intent(in) :: sph_MHD_bc @@ -135,13 +135,13 @@ subroutine cal_div_of_buoyancies_sph_2 & type(phys_data), intent(inout) :: rj_fld ! ! - if(iflag_4_gravity) then + if(flag_thermal_buoyancy) then call const_sph_div_force & & (sph_rj, r_2nd, sph_MHD_bc%sph_bc_U, g_sph_rj, & & ipol_frc%i_buoyancy, ipol_div_frc%i_buoyancy, rj_fld) end if ! - if(iflag_4_composit_buo) then + if(flag_comp_buoyancy) then call const_sph_div_force & & (sph_rj, r_2nd, sph_MHD_bc%sph_bc_U, g_sph_rj, & & ipol_frc%i_comp_buo, ipol_div_frc%i_comp_buo, rj_fld) diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/cal_vorticity_terms_adams.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/cal_vorticity_terms_adams.f90 index 90148d63..60a7c4f1 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/cal_vorticity_terms_adams.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/cal_vorticity_terms_adams.f90 @@ -23,18 +23,16 @@ !! subroutine set_MHD_terms_to_force & !! & (ipol_exp, ipol_rot_frc, is_rot_buo, & !! & nnod_rj, ntot_phys_rj, d_rj) -!! subroutine set_rot_cv_terms_to_force & +!! subroutine set_rotating_cv_terms_to_force & !! & (ipol_exp, ipol_rot_frc, is_rot_buo, & !! & nnod_rj, ntot_phys_rj, d_rj) !! type(explicit_term_address), intent(in) :: ipol_exp !! type(base_force_address), intent(in) :: ipol_rot_frc !! -!! subroutine add_rot_advection_to_force & -!! & (is_exp, is_rot_inertia, nnod_rj, ntot_phys_rj, d_rj) -!! subroutine add_buoyancy_to_vort_force & -!! & (is_exp, is_rot_buo, nnod_rj, ntot_phys_rj, d_rj) -!! subroutine add_each_force_to_rot_forces & -!! & (is_exp, is_rot_force, nnod_rj, ntot_phys_rj, d_rj) +!! subroutine subtract_advection_to_force & +!! & (is_exp, is_inertia, nnod_rj, ntot_phys_rj, d_rj) +!! subroutine add_each_force_to_forces & +!! & (is_exp, is_force, nnod_rj, ntot_phys_rj, d_rj) !! !! subroutine set_ini_adams_inertia & !! & (fl_prop, ipol_exp, nnod_rj, ntot_phys_rj, d_rj) @@ -169,7 +167,13 @@ subroutine set_MHD_terms_to_force & d_rj(inod,ipol_exp%i_forces ) & & = - d_rj(inod,ipol_rot_frc%i_m_advect ) & & + d_rj(inod,ipol_rot_frc%i_Coriolis ) & - & + d_rj(inod,ipol_rot_frc%i_lorentz ) + & + d_rj(inod,ipol_rot_frc%i_lorentz ) & + & + d_rj(inod,is_rot_buo ) + d_rj(inod,ipol_exp%i_forces+1) & + & = - d_rj(inod,ipol_rot_frc%i_m_advect+1) & + & + d_rj(inod,ipol_rot_frc%i_Coriolis+1) & + & + d_rj(inod,ipol_rot_frc%i_lorentz+1) & + & + d_rj(inod,is_rot_buo+1) d_rj(inod,ipol_exp%i_forces+2) & & = - d_rj(inod,ipol_rot_frc%i_m_advect+2) & & + d_rj(inod,ipol_rot_frc%i_Coriolis+2) & @@ -182,7 +186,7 @@ end subroutine set_MHD_terms_to_force ! ! ---------------------------------------------------------------------- ! - subroutine set_rot_cv_terms_to_force & + subroutine set_rotating_cv_terms_to_force & & (ipol_exp, ipol_rot_frc, is_rot_buo, & & nnod_rj, ntot_phys_rj, d_rj) ! @@ -199,7 +203,12 @@ subroutine set_rot_cv_terms_to_force & do inod = 1, nnod_rj d_rj(inod,ipol_exp%i_forces ) & & = - d_rj(inod,ipol_rot_frc%i_m_advect ) & - & + d_rj(inod,ipol_rot_frc%i_Coriolis ) + & + d_rj(inod,ipol_rot_frc%i_Coriolis ) & + & + d_rj(inod,is_rot_buo ) + d_rj(inod,ipol_exp%i_forces+1) & + & = - d_rj(inod,ipol_rot_frc%i_m_advect+1) & + & + d_rj(inod,ipol_rot_frc%i_Coriolis+1) & + & + d_rj(inod,is_rot_buo+1) d_rj(inod,ipol_exp%i_forces+2) & & = - d_rj(inod,ipol_rot_frc%i_m_advect+2) & & + d_rj(inod,ipol_rot_frc%i_Coriolis+2) & @@ -207,62 +216,50 @@ subroutine set_rot_cv_terms_to_force & end do !$omp end parallel do ! - end subroutine set_rot_cv_terms_to_force + end subroutine set_rotating_cv_terms_to_force ! ! ---------------------------------------------------------------------- ! ---------------------------------------------------------------------- ! - subroutine add_rot_advection_to_force & - & (is_exp, is_rot_inertia, nnod_rj, ntot_phys_rj, d_rj) + subroutine subtract_advection_to_force & + & (is_exp, is_inertia, nnod_rj, ntot_phys_rj, d_rj) ! - integer(kind = kint), intent(in) :: is_exp, is_rot_inertia + integer(kind = kint), intent(in) :: is_exp, is_inertia integer(kind = kint), intent(in) :: nnod_rj, ntot_phys_rj real (kind=kreal), intent(inout) :: d_rj(nnod_rj,ntot_phys_rj) ! ! !$omp workshare d_rj(1:nnod_rj,is_exp ) = d_rj(1:nnod_rj,is_exp ) & - & - d_rj(1:nnod_rj,is_rot_inertia ) - d_rj(1:nnod_rj,is_exp+2) = d_rj(1:nnod_rj,is_exp+2) & - & - d_rj(1:nnod_rj,is_rot_inertia+2) -!$omp end workshare nowait -! - end subroutine add_rot_advection_to_force -! -! ---------------------------------------------------------------------- -! - subroutine add_buoyancy_to_vort_force & - & (is_exp, is_rot_buo, nnod_rj, ntot_phys_rj, d_rj) -! - integer(kind = kint), intent(in) :: is_exp, is_rot_buo - integer(kind = kint), intent(in) :: nnod_rj, ntot_phys_rj - real (kind=kreal), intent(inout) :: d_rj(nnod_rj,ntot_phys_rj) -! -!$omp workshare + & - d_rj(1:nnod_rj,is_inertia ) + d_rj(1:nnod_rj,is_exp+1) = d_rj(1:nnod_rj,is_exp+1) & + & - d_rj(1:nnod_rj,is_inertia+1) d_rj(1:nnod_rj,is_exp+2) = d_rj(1:nnod_rj,is_exp+2) & - & + d_rj(1:nnod_rj,is_rot_buo+2) + & - d_rj(1:nnod_rj,is_inertia+2) !$omp end workshare nowait ! - end subroutine add_buoyancy_to_vort_force + end subroutine subtract_advection_to_force ! ! ---------------------------------------------------------------------- ! - subroutine add_each_force_to_rot_forces & - & (is_exp, is_rot_force, nnod_rj, ntot_phys_rj, d_rj) + subroutine add_each_force_to_forces & + & (is_exp, is_force, nnod_rj, ntot_phys_rj, d_rj) ! - integer(kind = kint), intent(in) :: is_exp, is_rot_force + integer(kind = kint), intent(in) :: is_exp, is_force integer(kind = kint), intent(in) :: nnod_rj, ntot_phys_rj real (kind=kreal), intent(inout) :: d_rj(nnod_rj,ntot_phys_rj) ! ! !$omp workshare d_rj(1:nnod_rj,is_exp ) = d_rj(1:nnod_rj,is_exp ) & - & + d_rj(1:nnod_rj,is_rot_force ) + & + d_rj(1:nnod_rj,is_force ) + d_rj(1:nnod_rj,is_exp+1) = d_rj(1:nnod_rj,is_exp+1) & + & + d_rj(1:nnod_rj,is_force+1) d_rj(1:nnod_rj,is_exp+2) = d_rj(1:nnod_rj,is_exp+2) & - & + d_rj(1:nnod_rj,is_rot_force+2) + & + d_rj(1:nnod_rj,is_force+2) !$omp end workshare nowait ! - end subroutine add_each_force_to_rot_forces + end subroutine add_each_force_to_forces ! ! ---------------------------------------------------------------------- ! ---------------------------------------------------------------------- diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/check_dependency_for_MHD.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/check_dependency_for_MHD.f90 index c05899b6..398ec371 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/check_dependency_for_MHD.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/check_dependency_for_MHD.f90 @@ -147,17 +147,17 @@ subroutine check_field_dependencies & ! ! if(fl_prop%iflag_scheme .gt. id_no_evolution) then - if(fl_prop%iflag_4_gravity) then + if(fl_prop%flag_thermal_buoyancy) then msg = 'Buoyancy needs' call check_missing_field_w_msg(fld, msg, iphys_base%i_temp) end if ! - if(fl_prop%iflag_4_composit_buo) then + if(fl_prop%flag_comp_buoyancy) then msg = 'Compositional buoyancy needs' call check_missing_field_w_msg(fld, msg, iphys_base%i_light) end if ! - if(fl_prop%iflag_4_lorentz) then + if(fl_prop%flag_lorentz) then msg = 'Lorentz force needs' call check_missing_field_w_msg(fld, msg, iphys_base%i_magne) end if diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/coef_fdm2_free_CMB.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/coef_fdm2_free_CMB.f90 index 38b156b7..8cf2b3de 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/coef_fdm2_free_CMB.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/coef_fdm2_free_CMB.f90 @@ -8,11 +8,16 @@ !! at CMB with free slip boundary !! !!@verbatim -!! subroutine cal_fdm2_CMB_free_vp(r_from_CMB, fdm2_free_CMB) -!! subroutine cal_fdm2_CMB_free_vt(r_from_CMB, fdm2_free_CMB) +!! subroutine cal_fdm2_CMB_free_vp(h_rho, r_from_CMB, & +!! & fdm2_free_CMB) +!! subroutine cal_fdm2_CMB_free_vt(h_rho, r_from_CMB, & +!! & fdm2_free_CMB) +!! real(kind = kreal), intent(in) :: h_rho +!! real(kind = kreal), intent(in) :: r_from_CMB(-1:0) !! type(fdm2_free_slip), intent(inout) :: fdm2_free_CMB !! -!! subroutine check_coef_fdm_free_CMB(fdm2_free_CMB) +!! subroutine check_coef_fdm_free_CMB(id_file, fdm2_free_CMB) +!! integer(kind = kint), intent(in) :: id_file !! type(fdm2_free_slip), intent(in) :: fdm2_free_CMB !! !! Matrix to evaluate radial derivative of poloidal velocity @@ -77,8 +82,10 @@ module coef_fdm2_free_CMB ! ! ----------------------------------------------------------------------- ! - subroutine cal_fdm2_CMB_free_vp(r_from_CMB, fdm2_free_CMB) + subroutine cal_fdm2_CMB_free_vp(h_rho, r_from_CMB, & + & fdm2_free_CMB) ! + real(kind = kreal), intent(in) :: h_rho real(kind = kreal), intent(in) :: r_from_CMB(-1:0) type(fdm2_free_slip), intent(inout) :: fdm2_free_CMB ! @@ -95,9 +102,9 @@ subroutine cal_fdm2_CMB_free_vp(r_from_CMB, fdm2_free_CMB) mat_taylor_3(1,2) = zero mat_taylor_3(1,3) = zero ! - mat_taylor_3(2,1) = one - mat_taylor_3(2,2) = -r0 - mat_taylor_3(2,3) = half * r0*r0 + mat_taylor_3(2,1) = zero + mat_taylor_3(2,2) = -two / r0 - h_rho + mat_taylor_3(2,3) = one ! mat_taylor_3(3,1) = one mat_taylor_3(3,2) =-dr_n1 @@ -125,8 +132,10 @@ end subroutine cal_fdm2_CMB_free_vp ! ! ----------------------------------------------------------------------- ! - subroutine cal_fdm2_CMB_free_vt(r_from_CMB, fdm2_free_CMB) + subroutine cal_fdm2_CMB_free_vt(h_rho, r_from_CMB, & + & fdm2_free_CMB) ! + real(kind = kreal), intent(in) :: h_rho real(kind = kreal), intent(in) :: r_from_CMB(-1:0) type(fdm2_free_slip), intent(inout) :: fdm2_free_CMB ! @@ -143,9 +152,9 @@ subroutine cal_fdm2_CMB_free_vt(r_from_CMB, fdm2_free_CMB) mat_taylor_3(1,2) = zero mat_taylor_3(1,3) = zero ! - mat_taylor_3(2,1) = two - mat_taylor_3(2,2) = -r0 - mat_taylor_3(2,3) = zero + mat_taylor_3(2,1) = two / r0 + h_rho + mat_taylor_3(2,2) = -one + mat_taylor_3(2,3) = zero ! mat_taylor_3(3,1) = one mat_taylor_3(3,2) =-dr_n1 @@ -173,13 +182,14 @@ end subroutine cal_fdm2_CMB_free_vt ! ! ----------------------------------------------------------------------- ! - subroutine check_coef_fdm_free_CMB(fdm2_free_CMB) + subroutine check_coef_fdm_free_CMB(id_file, fdm2_free_CMB) ! + integer(kind = kint), intent(in) :: id_file type(fdm2_free_slip), intent(in) :: fdm2_free_CMB ! ! - write(50,*) ' Free slip for CMB' - call check_coef_fdm_free_slip(fdm2_free_CMB) + write(id_file,*) ' Free slip for CMB' + call check_fdm_coef_free_slip_CMB(id_file, fdm2_free_CMB) ! end subroutine check_coef_fdm_free_CMB ! diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/coef_fdm2_free_ICB.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/coef_fdm2_free_ICB.f90 index 6f3e7fc8..cef4909a 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/coef_fdm2_free_ICB.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/coef_fdm2_free_ICB.f90 @@ -8,11 +8,16 @@ !! at CMB with free slip boundary !! !!@verbatim -!! subroutine cal_fdm2_ICB_free_vp(r_from_ICB, fdm2_free_ICB) -!! subroutine cal_fdm2_ICB_free_vt(r_from_ICB, fdm2_free_ICB) +!! subroutine cal_fdm2_ICB_free_vp(h_rho, r_from_ICB, & +!! & fdm2_free_ICB) +!! subroutine cal_fdm2_ICB_free_vt(h_rho, r_from_ICB, & +!! & fdm2_free_ICB) +!! real(kind = kreal), intent(in) :: h_rho +!! real(kind = kreal), intent(in) :: r_from_ICB(0:1) !! type(fdm2_free_slip), intent(inout) :: fdm2_free_ICB !! -!! subroutine check_coef_fdm_free_ICB(fdm2_free_ICB) +!! subroutine check_coef_fdm_free_ICB(id_file, fdm2_free_ICB) +!! integer(kind = kint), intent(in) :: id_file !! type(fdm2_free_slip), intent(in) :: fdm2_free_ICB !! !! Matrix to evaluate radial derivative of poloidal velocity @@ -77,8 +82,10 @@ module coef_fdm2_free_ICB ! ! ----------------------------------------------------------------------- ! - subroutine cal_fdm2_ICB_free_vp(r_from_ICB, fdm2_free_ICB) + subroutine cal_fdm2_ICB_free_vp(h_rho, r_from_ICB, & + & fdm2_free_ICB) ! + real(kind = kreal), intent(in) :: h_rho real(kind = kreal), intent(in) :: r_from_ICB(0:1) type(fdm2_free_slip), intent(inout) :: fdm2_free_ICB ! @@ -94,9 +101,9 @@ subroutine cal_fdm2_ICB_free_vp(r_from_ICB, fdm2_free_ICB) mat_taylor_3(1,2) = zero mat_taylor_3(1,3) = zero ! - mat_taylor_3(2,1) = one - mat_taylor_3(2,2) = -r0 - mat_taylor_3(2,3) = half * r0*r0 + mat_taylor_3(2,1) = zero + mat_taylor_3(2,2) = -(two / r0 + h_rho) + mat_taylor_3(2,3) = one ! mat_taylor_3(3,1) = one mat_taylor_3(3,2) = dr_p1 @@ -124,8 +131,10 @@ end subroutine cal_fdm2_ICB_free_vp ! ! ----------------------------------------------------------------------- ! - subroutine cal_fdm2_ICB_free_vt(r_from_ICB, fdm2_free_ICB) + subroutine cal_fdm2_ICB_free_vt(h_rho, r_from_ICB, & + & fdm2_free_ICB) ! + real(kind = kreal), intent(in) :: h_rho real(kind = kreal), intent(in) :: r_from_ICB(0:1) type(fdm2_free_slip), intent(inout) :: fdm2_free_ICB ! @@ -141,8 +150,8 @@ subroutine cal_fdm2_ICB_free_vt(r_from_ICB, fdm2_free_ICB) mat_taylor_3(1,2) = zero mat_taylor_3(1,3) = zero ! - mat_taylor_3(2,1) = two - mat_taylor_3(2,2) = -r0 + mat_taylor_3(2,1) = two / r0 + h_rho + mat_taylor_3(2,2) = -one mat_taylor_3(2,3) = zero ! mat_taylor_3(3,1) = one @@ -171,13 +180,14 @@ end subroutine cal_fdm2_ICB_free_vt ! ! ----------------------------------------------------------------------- ! - subroutine check_coef_fdm_free_ICB(fdm2_free_ICB) + subroutine check_coef_fdm_free_ICB(id_file, fdm2_free_ICB) ! + integer(kind = kint), intent(in) :: id_file type(fdm2_free_slip), intent(in) :: fdm2_free_ICB ! ! - write(50,*) ' Free slip for ICB' - call check_coef_fdm_free_slip(fdm2_free_ICB) + write(id_file,*) ' Free slip for ICB' + call check_fdm_coef_free_slip_ICB(id_file, fdm2_free_ICB) ! end subroutine check_coef_fdm_free_ICB ! diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/const_r_mat_4_vector_sph.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/const_r_mat_4_vector_sph.f90 index f87f8d1b..a8f56c52 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/const_r_mat_4_vector_sph.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/const_r_mat_4_vector_sph.f90 @@ -51,11 +51,13 @@ module const_r_mat_4_vector_sph implicit none ! character(len=kchara), parameter, private & - & :: vt_evo_name = 'toroidal_velocity_evolution' + & :: vt_evo_name = 'toroidal_velocity_evolution' character(len=kchara), parameter, private & - & :: wt_evo_name = 'toroidal_vorticity_evolution' + & :: wt_evo_name = 'toroidal_vorticity_evolution' character(len=kchara), parameter, private & - & :: vp_evo_name = 'poloidal_velocity_evolution' + & :: vp_evo_name = 'poloidal_velocity_evolution' + character(len=kchara), parameter, private & + & :: vsp_evo_name = 'velocity_pressure_evolution' ! character(len=kchara), parameter, private & & :: bp_evo_name = 'poloidal_magne_evolution' diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/const_radial_forces_on_bc.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/const_radial_forces_on_bc.f90 index 6baf326a..c6c0a756 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/const_radial_forces_on_bc.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/const_radial_forces_on_bc.f90 @@ -67,12 +67,12 @@ subroutine s_const_radial_forces_on_bc(sph_rj, g_sph_rj, & ! ! call r_buoyancy_on_sphere & - & (fl_prop%iflag_4_gravity, fl_prop%iflag_4_composit_buo, & + & (fl_prop%flag_thermal_buoyancy, fl_prop%flag_comp_buoyancy, & & sph_bc_U%kr_in, sph_rj, ipol_base, ipol_div_frc, & & fl_prop%coef_buo, fl_prop%coef_comp_buo, & & ref_param_T, ref_param_C, rj_fld) call r_buoyancy_on_sphere & - & (fl_prop%iflag_4_gravity, fl_prop%iflag_4_composit_buo, & + & (fl_prop%flag_thermal_buoyancy, fl_prop%flag_comp_buoyancy, & & sph_bc_U%kr_out, sph_rj, ipol_base, ipol_div_frc, & & fl_prop%coef_buo, fl_prop%coef_comp_buo, & & ref_param_T, ref_param_C, rj_fld) @@ -87,7 +87,7 @@ subroutine s_const_radial_forces_on_bc(sph_rj, g_sph_rj, & & sph_rj%nidx_rj, sph_rj%ar_1d_rj, g_sph_rj, & & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) ! - if(fl_prop%iflag_4_inertia) then + if(fl_prop%flag_inertia) then call cal_radial_force_on_sph(sph_bc_U%kr_in, & & ipol_frc%i_m_advect, ipol_div_frc%i_m_advect, & & sph_rj%nidx_rj, sph_rj%ar_1d_rj, g_sph_rj, & @@ -98,7 +98,7 @@ subroutine s_const_radial_forces_on_bc(sph_rj, g_sph_rj, & & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) end if ! - if(fl_prop%iflag_4_lorentz) then + if(fl_prop%flag_lorentz) then call cal_radial_force_on_sph(sph_bc_U%kr_in, & & ipol_frc%i_lorentz, ipol_div_frc%i_lorentz, & & sph_rj%nidx_rj, sph_rj%ar_1d_rj, g_sph_rj, & diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/construct_MHD_coefficient.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/construct_MHD_coefficient.f90 index 4f16c9a2..75a7090e 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/construct_MHD_coefficient.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/construct_MHD_coefficient.f90 @@ -4,7 +4,7 @@ !!@author H. Matsui !!@date Programmed in Sep., 2007 ! -!>@brief Subroutine to construct coeeficient from dimansionless numbers +!>@brief Subroutine to construct coefficient from dimansionless numbers !! !!@verbatim !! subroutine construct_coefficient & diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/div_self_buoyancies_sph.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/div_self_buoyancies_sph.f90 index 2a0c8e10..6711f7a9 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/div_self_buoyancies_sph.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/div_self_buoyancies_sph.f90 @@ -8,7 +8,7 @@ !! !!@verbatim !! subroutine sel_div_buoyancies_sph_MHD & -!! & (iflag_4_gravity, iflag_4_composit_buo, & +!! & (flag_thermal_buoyancy, flag_comp_buoyancy, & !! & sph_rj, ipol_base, ipol_grd, ipol_div_frc, & !! & coef_buo, coef_comp_buo, sph_bc_U, & !! & ref_param_T, ref_param_C, rj_fld) @@ -46,7 +46,7 @@ module div_self_buoyancies_sph !----------------------------------------------------------------------- ! subroutine sel_div_buoyancies_sph_MHD & - & (iflag_4_gravity, iflag_4_composit_buo, & + & (flag_thermal_buoyancy, flag_comp_buoyancy, & & sph_rj, ipol_base, ipol_grd, ipol_div_frc, & & coef_buo, coef_comp_buo, sph_bc_U, & & ref_param_T, ref_param_C, rj_fld) @@ -59,7 +59,7 @@ subroutine sel_div_buoyancies_sph_MHD & use t_phys_data use t_boundary_params_sph_MHD ! - logical, intent(in) :: iflag_4_gravity, iflag_4_composit_buo + logical, intent(in) :: flag_thermal_buoyancy, flag_comp_buoyancy real(kind = kreal), intent(in) :: coef_buo, coef_comp_buo type(reference_scalar_param), intent(in) :: ref_param_T type(reference_scalar_param), intent(in) :: ref_param_C @@ -74,7 +74,7 @@ subroutine sel_div_buoyancies_sph_MHD & integer(kind = kint) :: igrad_temp, igrad_comp ! ! - if(iflag_4_gravity) then + if(flag_thermal_buoyancy) then if(ref_param_T%flag_ref_field) then ipol_temp = ipol_base%i_per_temp igrad_temp = ipol_grd%i_grad_per_t @@ -84,7 +84,7 @@ subroutine sel_div_buoyancies_sph_MHD & end if end if ! - if(iflag_4_composit_buo) then + if(flag_comp_buoyancy) then if(ref_param_C%flag_ref_field) then ipol_comp = ipol_base%i_per_light igrad_comp = ipol_grd%i_grad_per_c @@ -94,7 +94,7 @@ subroutine sel_div_buoyancies_sph_MHD & end if end if ! - if(iflag_4_gravity .and. iflag_4_composit_buo) then + if(flag_thermal_buoyancy .and. flag_comp_buoyancy) then if (iflag_debug.ge.1) write(*,*) & & 'cal_div_double_buoyancy_sph_MHD', ipol_temp call cal_div_double_buoyancy_sph_MHD & @@ -104,7 +104,7 @@ subroutine sel_div_buoyancies_sph_MHD & & sph_rj%nidx_rj, sph_rj%radius_1d_rj_r, & & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) ! - else if(iflag_4_gravity) then + else if(flag_thermal_buoyancy) then if (iflag_debug.ge.1) write(*,*) & & 'cal_div_buoyancy_sph_MHD by pert. temperature' call cal_div_buoyancy_sph_MHD & @@ -113,7 +113,7 @@ subroutine sel_div_buoyancies_sph_MHD & & sph_rj%nidx_rj, sph_rj%radius_1d_rj_r, & & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) ! - else if(iflag_4_composit_buo) then + else if(flag_comp_buoyancy) then if (iflag_debug.ge.1) write(*,*) & & 'cal_div_buoyancy_sph_MHD by composition' call cal_div_buoyancy_sph_MHD & diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/init_radial_infos_sph_mhd.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/init_radial_infos_sph_mhd.f90 index 209423e0..dae5a704 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/init_radial_infos_sph_mhd.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/init_radial_infos_sph_mhd.f90 @@ -10,9 +10,8 @@ !! !!@verbatim !! subroutine init_r_infos_sph_mhd_evo(bc_IO, sph_grps, MHD_BC, & -!! & ipol, sph, r_2nd, omega_sph, MHD_prop, sph_MHD_bc) -!! subroutine init_r_infos_sph_mhd(bc_IO, sph_grps, MHD_BC, sph, & -!! & MHD_prop, omega_sph, sph_MHD_bc) +!! & ipol, sph, r_2nd, r_n2e_3rd, r_e2n_1st, & +!! & omega_sph, MHD_prop, radial_variation, sph_MHD_bc) !! subroutine init_reference_fields(sph, ipol, r_2nd, & !! & refs, rj_fld, MHD_prop, sph_MHD_bc) !! type(boundary_spectra), intent(in) :: bc_IO @@ -21,11 +20,17 @@ !! type(phys_address), intent(in) :: ipol !! type(sph_grids), intent(in) :: sph !! type(fdm_matrices), intent(inout) :: r_2nd +!! type(fdm_matrices), intent(inout) :: r_n2e_3rd +!! type(fdm_matrices), intent(inout) :: r_e2n_1st !! type(sph_rotation), intent(inout) :: omega_sph !! type(radial_reference_field), intent(inout) :: refs !! type(MHD_evolution_param), intent(inout) :: MHD_prop !! type(sph_MHD_boundary_data), intent(inout) :: sph_MHD_bc !! type(phys_data), intent(inout) :: rj_fld +!! +!! subroutine set_delta_r_4_sph_mhd(sph_params, sph_rj) +!! type(sph_rj_grid), intent(in) :: sph_rj +!! type(sph_shell_parameters), intent(in) :: sph_params !!@endverbatim !! !!@n @param r_hot radius at highest temperature point @@ -58,8 +63,6 @@ module init_radial_infos_sph_mhd use t_physical_property ! implicit none -! - private :: set_delta_r_4_sph_mhd ! ! ------------------------------------------------------------------- ! @@ -68,10 +71,15 @@ module init_radial_infos_sph_mhd ! ------------------------------------------------------------------- ! subroutine init_r_infos_sph_mhd_evo(bc_IO, sph_grps, MHD_BC, & - & ipol, sph, r_2nd, omega_sph, MHD_prop, sph_MHD_bc) + & ipol, sph, r_2nd, r_n2e_3rd, r_e2n_1st, & + & omega_sph, MHD_prop, radial_variation, sph_MHD_bc) ! use second_fdm_node_coefs + use third_fdm_node_to_ele + use first_fdm_ele_to_node use material_property + use init_sph_radius_variations + use set_bc_sph_mhd ! type(boundary_spectra), intent(in) :: bc_IO type(sph_group_data), intent(in) :: sph_grps @@ -80,59 +88,54 @@ subroutine init_r_infos_sph_mhd_evo(bc_IO, sph_grps, MHD_BC, & type(sph_grids), intent(in) :: sph ! type(fdm_matrices), intent(inout) :: r_2nd + type(fdm_matrices), intent(inout) :: r_n2e_3rd + type(fdm_matrices), intent(inout) :: r_e2n_1st +! type(sph_rotation), intent(inout) :: omega_sph type(MHD_evolution_param), intent(inout) :: MHD_prop + type(phys_data), intent(inout) :: radial_variation type(sph_MHD_boundary_data), intent(inout) :: sph_MHD_bc ! ! - call init_r_infos_sph_mhd(bc_IO, sph_grps, MHD_BC, sph, MHD_prop, & - & omega_sph, sph_MHD_bc) + if (iflag_debug.gt.0) write(*,*) 'set_delta_r_4_sph_mhd' + call set_delta_r_4_sph_mhd(sph%sph_params, sph%sph_rj) ! - if (iflag_debug.gt.0) write(*,*) 'const_second_fdm_coefs' - call const_second_fdm_coefs(sph%sph_params, sph%sph_rj, r_2nd) +!* ---------- rotation of earth --------------- + if(iflag_debug .ge. iflag_routine_msg) & + & write(*,*) 'set_rot_earth_4_sph' + call set_rot_earth_4_sph(sph%sph_rlm, sph%sph_rj, & + & MHD_prop%fl_prop, omega_sph) ! +!* ---------- Coefficients of each term ------- if(iflag_debug.gt.0) write(*,*)' set_material_property' call set_material_property & & (sph%sph_params%radius_CMB, sph%sph_params%radius_ICB, & & ipol, MHD_prop) ! - end subroutine init_r_infos_sph_mhd_evo -! -! ------------------------------------------------------------------- -! ------------------------------------------------------------------- -! - subroutine init_r_infos_sph_mhd(bc_IO, sph_grps, MHD_BC, sph, & - & MHD_prop, omega_sph, sph_MHD_bc) -! - use set_bc_sph_mhd -! - type(boundary_spectra), intent(in) :: bc_IO - type(sph_group_data), intent(in) :: sph_grps - type(MHD_BC_lists), intent(in) :: MHD_BC - type(sph_grids), intent(in) :: sph - type(MHD_evolution_param), intent(in) :: MHD_prop -! - type(sph_rotation), intent(inout) :: omega_sph - type(sph_MHD_boundary_data), intent(inout) :: sph_MHD_bc -! +!* ---------- Finite differnce coefficients --------------- + if (iflag_debug.gt.0) write(*,*) 'const_second_fdm_coefs' + call const_second_fdm_coefs(sph%sph_params, sph%sph_rj, r_2nd) ! - if (iflag_debug.gt.0) write(*,*) 'set_delta_r_4_sph_mhd' - call set_delta_r_4_sph_mhd(sph%sph_params, sph%sph_rj) + if (iflag_debug.gt.0) write(*,*) 'const_first_fdm_ele_to_node' + call const_first_fdm_ele_to_node(sph%sph_rj, r_e2n_1st) + if (iflag_debug.gt.0) write(*,*) 'const_third_fdm_node_to_ele' + call const_third_fdm_node_to_ele(sph%sph_rj, r_n2e_3rd) ! -!* ---------- rotation of earth --------------- -! - if (iflag_debug .ge. iflag_routine_msg) & - & write(*,*) 'set_rot_earth_4_sph' - call set_rot_earth_4_sph(sph%sph_rlm, sph%sph_rj, & - & MHD_prop%fl_prop, omega_sph) +!* ---------- Radial variations of density and diffusivities ------- + call init_radius_variations_sph_mhd(sph, r_2nd, MHD_prop, & + & radial_variation) ! !* ---------- boundary conditions --------------- if(iflag_debug.gt.0) write(*,*) 's_set_bc_sph_mhd' call s_set_bc_sph_mhd & & (bc_IO, sph%sph_params, sph%sph_rj, sph_grps%radial_rj_grp, & - & MHD_prop, MHD_BC, sph_MHD_bc) + & MHD_prop, radial_variation, MHD_BC, sph_MHD_bc) ! - end subroutine init_r_infos_sph_mhd + if(iflag_debug .ge. iflag_full_msg) then + call check_bc_sph_mhd(MHD_prop, sph_MHD_bc) + end if +! + end subroutine init_r_infos_sph_mhd_evo ! ! ------------------------------------------------------------------- ! ------------------------------------------------------------------- @@ -181,14 +184,15 @@ subroutine init_reference_fields(sph, ipol, r_2nd, & logical :: flag_write_ref ! ! - flag_write_ref = .FALSE. call init_reft_rj_data(sph%sph_rj, ipol, refs) +! call cal_ref_sources_from_d_rj(sph, ipol, rj_fld, refs) call load_sph_reference_fields(refs) call overwrite_sources_by_reference(sph%sph_rj, refs%iref_base, & & ipol%base, refs%ref_field, rj_fld) ! ! + flag_write_ref = .FALSE. call s_init_reference_scalar & & (MHD_prop%takepito_T, sph%sph_params, sph%sph_rj, & & r_2nd, MHD_prop%ht_prop, sph_MHD_bc%sph_bc_T, & diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/init_sph_radius_variations.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/init_sph_radius_variations.f90 new file mode 100644 index 00000000..34981a0b --- /dev/null +++ b/src/Fortran_libraries/MHD_src/sph_MHD/init_sph_radius_variations.f90 @@ -0,0 +1,287 @@ +!>@file init_sph_radius_variations.f90 +!!@brief module init_sph_radius_variations +!! +!!@author H. Matsui +!!@date Programmed in June., 1994 +!!@n Modified in Jan, 2010 +! +!>@brief Set radial variations for densityuy and diffusivities +!! +!!@verbatim +!! subroutine init_radius_variations_sph_mhd(sph, r_2nd, MHD_prop, & +!! & radial_variation) +!! type(sph_grids), intent(in) :: sph +!! type(fdm_matrices), intent(in) :: r_2nd +!! type(MHD_evolution_param), intent(inout) :: MHD_prop +!! type(phys_data), intent(inout) :: radial_variation +!!@endverbatim +!! +! + module init_sph_radius_variations +! + use m_precision + use m_constants + use t_control_parameter + use t_spheric_parameter + use t_phys_data + use t_sph_radial_interpolate + use t_field_data_IO + use t_fdm_coefs +! + implicit none +! + private :: count_r_variation_data + private :: set_r_variation_data_address + private :: check_r_variation_data_list +! + character(len = kchara), parameter & + & :: r_valiation_file_name = 'Radial_variations_out.dat' +! + private :: output_radial_variation +! +! ------------------------------------------------------------------- +! + contains +! +! ------------------------------------------------------------------- +! + subroutine init_radius_variations_sph_mhd(sph, r_2nd, MHD_prop, & + & radial_variation) +! + use calypso_mpi_real + use transfer_to_long_integers + use set_sph_radial_variations + use m_base_field_labels + use m_diffusion_term_labels +! + type(sph_grids), intent(in) :: sph + type(fdm_matrices), intent(in) :: r_2nd + + type(MHD_evolution_param), intent(inout) :: MHD_prop + type(phys_data), intent(inout) :: radial_variation +! + character(len=kchara), parameter :: radius_name = 'radius' + type(sph_radial_interpolate) :: r_itp + type(field_IO) :: fld_IO +! + integer(kind = kint) :: k +! +! + radial_variation%num_phys = count_r_variation_data(MHD_prop) + radial_variation%num_phys_viz = radial_variation%num_phys + radial_variation%ntot_phys = radial_variation%num_phys + call alloc_phys_name(radial_variation) + call alloc_phys_data((sph%sph_rj%nidx_rj(1)+1), radial_variation) +! + call set_r_variation_data_address(MHD_prop, radial_variation) + call check_r_variation_data_list(MHD_prop, radial_variation) +! + if(my_rank .eq. 0) then + radial_variation%d_fld(1,1) = 0.0d0 + do k = 1, sph%sph_rj%nidx_rj(1) + radial_variation%d_fld(k+1,1) = sph%sph_rj%radius_1d_rj_r(k) + end do +! + call set_sph_radial_density(my_rank, radius_name, & + & density%name, MHD_prop%fl_prop%ir_rho, & + & sph%sph_rj, r_2nd, MHD_prop%polytrope_param, & + & radial_variation, r_itp, fld_IO) + call set_sph_radial_diffusivity(my_rank, radius_name, & + & kinetic_viscosity%name, MHD_prop%fl_prop%ir_nu, & + & sph%sph_rj, r_2nd, MHD_prop%val_viscous_param, & + & radial_variation, r_itp, fld_IO) +! + call set_sph_radial_diffusivity(my_rank, radius_name, & + & magnetic_diffusivity%name, MHD_prop%cd_prop%ir_eta, & + & sph%sph_rj, r_2nd, MHD_prop%val_mag_diffuse_param, & + & radial_variation, r_itp, fld_IO) + call set_sph_radial_diffusivity(my_rank, radius_name, & + & thermal_diffusivity%name, MHD_prop%ht_prop%ir_kappa, & + & sph%sph_rj, r_2nd, MHD_prop%val_thermal_diffuse_param, & + & radial_variation, r_itp, fld_IO) + call set_sph_radial_diffusivity(my_rank, radius_name, & + & chemical_diffusivity%name, MHD_prop%cp_prop%ir_kappa, & + & sph%sph_rj, r_2nd, MHD_prop%val_comp_diffuse_param, & + & radial_variation, r_itp, fld_IO) + end if +! + do k = 1, radial_variation%ntot_phys + call calypso_mpi_bcast_real(radial_variation%d_fld(1,k), & + & cast_long(radial_variation%n_point), 0) + end do +! + call output_radial_variation & + & (r_valiation_file_name, radial_variation, fld_IO) +! + end subroutine init_radius_variations_sph_mhd +! +! ------------------------------------------------------------------- +! ------------------------------------------------------------------- +! + integer(kind = kint) function count_r_variation_data(MHD_prop) +! + type(MHD_evolution_param), intent(inout) :: MHD_prop +! + integer(kind = kint) :: icou_ref = 0 +! + icou_ref = 1 + if(MHD_prop%flag_ref_density_valiation) icou_ref = icou_ref + 3 + if(MHD_prop%flag_viscous_variation) icou_ref = icou_ref + 2 + if(MHD_prop%flag_mag_diffuse_variation) icou_ref = icou_ref + 2 + if(MHD_prop%flag_term_diffuse_variation) icou_ref = icou_ref + 2 + if(MHD_prop%flag_comp_diffuse_variation) icou_ref = icou_ref + 2 + count_r_variation_data = icou_ref +! + end function count_r_variation_data +! +! ------------------------------------------------------------------- +! + subroutine set_r_variation_data_address(MHD_prop, & + & radial_variation) +! + type(MHD_evolution_param), intent(inout) :: MHD_prop + type(phys_data), intent(inout) :: radial_variation +! + integer(kind = kint) :: i + integer(kind = kint) :: icou_ref = 0 +! +! + radial_variation%istack_component(0) = 0 + do i = 1, radial_variation%num_phys + radial_variation%num_component(i) = 1 + radial_variation%istack_component(i) = i + end do +! + icou_ref = 1 + radial_variation%phys_name(icou_ref) = 'radius' +! + if(MHD_prop%flag_ref_density_valiation) then + write(*,*) 'flag_ref_density_valiation ON' + MHD_prop%fl_prop%ir_rho = icou_ref + 1 + MHD_prop%fl_prop%ir_drho_norm = icou_ref + 2 + MHD_prop%fl_prop%ir_d2rho_norm = icou_ref + 3 + radial_variation%phys_name(MHD_prop%fl_prop%ir_rho) & + & = 'density' + radial_variation%phys_name(MHD_prop%fl_prop%ir_drho_norm) & + & = 'normalized_drho_dr' + radial_variation%phys_name(MHD_prop%fl_prop%ir_drho_norm) & + & = 'normalized_d2rho_dr2' + icou_ref = icou_ref + 3 + end if +! + if(MHD_prop%flag_viscous_variation) then + write(*,*) 'flag_ref_density_valiation ON' + MHD_prop%fl_prop%ir_nu = icou_ref + 1 + MHD_prop%fl_prop%ir_dnu_norm = icou_ref + 2 + radial_variation%phys_name(MHD_prop%fl_prop%ir_nu) & + & = 'viscousity' + radial_variation%phys_name(MHD_prop%fl_prop%ir_dnu_norm) & + & = 'normalized_dnu_dr' + icou_ref = icou_ref + 2 + end if + if(MHD_prop%flag_mag_diffuse_variation) then + write(*,*) 'flag_mag_diffuse_variation ON' + MHD_prop%cd_prop%ir_eta = icou_ref + 1 + MHD_prop%cd_prop%ir_deta_norm = icou_ref + 2 + radial_variation%phys_name(MHD_prop%cd_prop%ir_eta) & + & = 'magnetic_diffusivity' + radial_variation%phys_name(MHD_prop%cd_prop%ir_deta_norm) & + & = 'normalized_deta_dr' + icou_ref = icou_ref + 2 + end if + if(MHD_prop%flag_term_diffuse_variation) then + write(*,*) 'flag_term_diffuse_variation ON' + MHD_prop%ht_prop%ir_kappa = icou_ref + 1 + MHD_prop%ht_prop%ir_dkappa_norm = icou_ref + 2 + radial_variation%phys_name(MHD_prop%ht_prop%ir_kappa) & + & = 'thermal_diffusivity' + radial_variation%phys_name(MHD_prop%ht_prop%ir_dkappa_norm) & + & = 'normalized_dkappa_T_dr' + icou_ref = icou_ref + 2 + end if + if(MHD_prop%flag_comp_diffuse_variation) then + write(*,*) 'flag_comp_diffuse_variation ON' + MHD_prop%cp_prop%ir_kappa = icou_ref + 1 + MHD_prop%cp_prop%ir_dkappa_norm = icou_ref + 2 + radial_variation%phys_name(MHD_prop%cp_prop%ir_kappa) & + & = 'compositional_diffusivity' + radial_variation%phys_name(MHD_prop%cp_prop%ir_dkappa_norm) & + & = 'normalized_dkappa_C_dr' + icou_ref = icou_ref + 2 + end if +! + end subroutine set_r_variation_data_address +! +! ------------------------------------------------------------------- +! + subroutine output_radial_variation & + & (file_prefix, radial_variation, ref_fld_IO) +! + use calypso_mpi + use field_file_IO +! + use copy_rj_phys_data_4_IO + use set_sph_extensions +! + character(len = kchara), intent(in) :: file_prefix + type(phys_data), intent(in) :: radial_variation + type(field_IO), intent(inout) :: ref_fld_IO +! + type(time_data) :: time_IO +! +! + if(my_rank .ne. 0) return + if(radial_variation%num_phys .le. 1) return +! + time_IO%i_time_step = izero + time_IO%time = zero + time_IO%dt = zero +! + write(*,*) 'radial_variation%num_phys', radial_variation%num_phys + write(*,*) 'radial_variation%num_component', radial_variation%num_component + write(*,*) 'radial_variation%istack_component', radial_variation%istack_component +! + call copy_rj_phys_name_to_IO & + & (radial_variation%num_phys, radial_variation, ref_fld_IO) + call alloc_phys_data_IO(ref_fld_IO) + call copy_rj_phys_data_to_IO & + & (radial_variation%num_phys, radial_variation, ref_fld_IO) +! + call write_step_field_file(file_prefix, my_rank, & + & time_IO, ref_fld_IO) +! + call dealloc_phys_data_IO(ref_fld_IO) + call dealloc_phys_name_IO(ref_fld_IO) +! + end subroutine output_radial_variation +! +! ----------------------------------------------------------------------- +! + subroutine check_r_variation_data_list(MHD_prop, & + & radial_variation) +! + type(MHD_evolution_param), intent(in) :: MHD_prop + type(phys_data), intent(in) :: radial_variation + integer(kind = kint) :: icou_ref +! + write(*,*) 'ir_rho', MHD_prop%fl_prop%ir_rho + write(*,*) 'ir_drho_norm', MHD_prop%fl_prop%ir_drho_norm + write(*,*) 'ir_d2rho_norm', MHD_prop%fl_prop%ir_d2rho_norm +! + write(*,*) 'ir_nu', MHD_prop%fl_prop%ir_nu + write(*,*) 'ir_dnu_norm', MHD_prop%fl_prop%ir_dnu_norm + write(*,*) 'ir_eta', MHD_prop%cd_prop%ir_eta + write(*,*) 'ir_deta_norm', MHD_prop%cd_prop%ir_deta_norm + write(*,*) 'ir_kappa', MHD_prop%ht_prop%ir_kappa + write(*,*) 'ir_dkappa_norm', MHD_prop%ht_prop%ir_dkappa_norm + write(*,*) 'ir_kappa', MHD_prop%cp_prop%ir_kappa + write(*,*) 'ir_dkappa_norm', MHD_prop%cp_prop%ir_dkappa_norm + do icou_ref = 1, radial_variation%num_phys + write(*,*) icou_ref, trim(radial_variation%phys_name(icou_ref)) + end do +! + end subroutine check_r_variation_data_list +! +! ----------------------------------------------------------------------- +! + end module init_sph_radius_variations diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/input_control_sph_MHD.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/input_control_sph_MHD.f90 index ed54a09a..00846cc5 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/input_control_sph_MHD.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/input_control_sph_MHD.f90 @@ -167,7 +167,7 @@ subroutine input_control_SPH_MHD_psf & & MHD_ctl%model_ctl, MHD_ctl%smctl_ctl, MHD_ctl%psph_ctl, & & MHD_files, SPH_model%bc_IO, SPH_model%refs, MHD_step, & & SPH_model%MHD_prop, SPH_model%MHD_BC, SPH_WK%trans_p, & - & SPH_WK%trns_WK, SPH_MHD) + & SPH_WK%trns_WK, SPH_MHD%sph_maker) ! call s_set_control_SPH_MHD_w_viz & & (MHD_ctl%model_ctl, MHD_ctl%psph_ctl, MHD_ctl%smonitor_ctl, & @@ -225,7 +225,7 @@ subroutine input_control_4_SPH_MHD_nosnap & & MHD_ctl%model_ctl, MHD_ctl%smctl_ctl, MHD_ctl%psph_ctl, & & MHD_files, SPH_model%bc_IO, SPH_model%refs, MHD_step, & & SPH_model%MHD_prop, SPH_model%MHD_BC, SPH_WK%trans_p, & - & SPH_WK%trns_WK, SPH_MHD) + & SPH_WK%trns_WK, SPH_MHD%sph_maker) ! call s_set_control_SPH_MHD_noviz & & (MHD_ctl%model_ctl, MHD_ctl%smonitor_ctl, SPH_model%MHD_prop, & @@ -280,7 +280,7 @@ subroutine input_control_4_SPH_make_init & & MHD_ctl%smctl_ctl, MHD_ctl%psph_ctl, & & MHD_files, SPH_model%bc_IO, SPH_model%refs, MHD_step, & & SPH_model%MHD_prop, SPH_model%MHD_BC, SPH_WK%trans_p, & - & SPH_WK%trns_WK, SPH_MHD) + & SPH_WK%trns_WK, SPH_MHD%sph_maker) ! call s_set_control_SPH_MHD_w_viz & & (MHD_ctl%model_ctl, MHD_ctl%psph_ctl, MHD_ctl%smonitor_ctl, & diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/interact_coriolis_rlm.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/interact_coriolis_rlm.f90 index 99b77284..68511c97 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/interact_coriolis_rlm.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/interact_coriolis_rlm.f90 @@ -230,7 +230,7 @@ subroutine interact_rot_coriolis_rlm & ! tr_rlm(1,j3) = -(two + g_sph_rlm(j3,4) - g_sph_rlm(j3,3)) & & * gi_cor_rlm(j3,1) * g_sph_rlm(j3,17) * half - tr_rlm(2,j3) = -(two - g_sph_rlm(j3,5) + g_sph_rlm(j3,3)) & + tr_rlm(2,j3) = -(two + g_sph_rlm(j3,5) - g_sph_rlm(j3,3)) & & * gi_cor_rlm(j3,2) * g_sph_rlm(j3,17) * half !* sr_rlm(1,j3) = ei_cor_rlm(j3,1) * g_sph_rlm(j3,17) diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/interpolate_reference_data.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/interpolate_reference_data.f90 index 0589d3ec..a3ae7518 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/interpolate_reference_data.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/interpolate_reference_data.f90 @@ -260,12 +260,12 @@ subroutine interepolate_one_ref_field(radial_fld_IO, r_itp, & ! do j_fld = 1, radial_fld_IO%num_field_IO if(phys_name .eq. radial_fld_IO%fld_name(j_fld)) then - call set_org_radius_data_from_IO & + call set_org_radius_data_from_IO & & (j_fld, radial_fld_IO, r_itp%n_rj_org, r_itp%d_rj_org) - call interpolate_radial_field & - & (nri_new, r_itp%k_old2new_in, r_itp%k_old2new_out, & - & r_itp%coef_old2new_in, radial_fld_IO%num_comp_IO(j_fld), & - & r_itp%n_rj_org, r_itp%d_rj_org(1,1), d_r(1,1)) + call interpolate_radial_field & + & (nri_new, r_itp%k_old2new_in, r_itp%k_old2new_out, & + & r_itp%coef_old2new_in, radial_fld_IO%num_comp_IO(j_fld), & + & r_itp%n_rj_org, r_itp%d_rj_org(1,1), d_r(1,1)) iflag_update(1:ncomp) = 1 exit end if diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/lead_fields_4_sph_mhd.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/lead_fields_4_sph_mhd.f90 index 7482537b..e46dfcbb 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/lead_fields_4_sph_mhd.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/lead_fields_4_sph_mhd.f90 @@ -128,11 +128,16 @@ subroutine s_lead_fields_4_sph_mhd & type(send_recv_status), intent(inout) :: SR_sig type(send_recv_real_buffer), intent(inout) :: SR_r ! + integer(kind = kint) :: ibuo_temp, ibuo_comp ! - call sel_buoyancies_sph_MHD(SPH_MHD%sph%sph_rj, trans_p%leg, & - & SPH_MHD%ipol%base, SPH_MHD%ipol%forces, & - & MHD_prop%fl_prop, MHD_prop%ref_param_T, MHD_prop%ref_param_C, & - & sph_MHD_bc%sph_bc_U, SPH_MHD%fld) +! + call sel_field_address_for_buoyancies(SPH_MHD%ipol%base, & + & MHD_prop%ref_param_T, MHD_prop%ref_param_C, & + & ibuo_temp, ibuo_comp) + call sel_buoyancies_sph_MHD & + & (SPH_MHD%sph%sph_rj, trans_p%leg, SPH_MHD%ipol%forces, & + & MHD_prop%fl_prop, sph_MHD_bc%sph_bc_U, & + & ibuo_temp, ibuo_comp, SPH_MHD%fld) ! if(MHD_prop%fl_prop%iflag_scheme .gt. id_no_evolution) then call pressure_4_sph_mhd & @@ -147,14 +152,19 @@ subroutine s_lead_fields_4_sph_mhd & & SPH_MHD%ipol%base, SPH_MHD%ipol%sym_fld, & & SPH_MHD%ipol%asym_fld, SPH_MHD%fld) ! + call sel_field_address_for_buoyancies(SPH_MHD%ipol%sym_fld, & + & MHD_prop%ref_param_T, MHD_prop%ref_param_C, & + & ibuo_temp, ibuo_comp) call sel_buoyancies_sph_MHD(SPH_MHD%sph%sph_rj, trans_p%leg, & - & SPH_MHD%ipol%sym_fld, SPH_MHD%ipol%forces_by_sym_asym, & - & MHD_prop%fl_prop, MHD_prop%ref_param_T, MHD_prop%ref_param_C, & - & sph_MHD_bc%sph_bc_U, SPH_MHD%fld) + & SPH_MHD%ipol%forces_by_sym_asym, MHD_prop%fl_prop, & + & sph_MHD_bc%sph_bc_U, ibuo_temp, ibuo_comp, SPH_MHD%fld) +! + call sel_field_address_for_buoyancies(SPH_MHD%ipol%asym_fld, & + & MHD_prop%ref_param_T, MHD_prop%ref_param_C, & + & ibuo_temp, ibuo_comp) call sel_buoyancies_sph_MHD(SPH_MHD%sph%sph_rj, trans_p%leg, & - & SPH_MHD%ipol%asym_fld, SPH_MHD%ipol%forces_by_sym_sym, & - & MHD_prop%fl_prop, MHD_prop%ref_param_T, MHD_prop%ref_param_C, & - & sph_MHD_bc%sph_bc_U, SPH_MHD%fld) + & SPH_MHD%ipol%forces_by_sym_sym, MHD_prop%fl_prop, & + & sph_MHD_bc%sph_bc_U, ibuo_temp, ibuo_comp, SPH_MHD%fld) ! call lead_fields_by_sph_trans(SPH_MHD%sph, SPH_MHD%comms, & & MHD_prop, trans_p, WK%trns_MHD, WK%trns_snap, & diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/m_elapsed_labels_4_MHD.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/m_elapsed_labels_4_MHD.f90 index 9668e2e4..8b4353b5 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/m_elapsed_labels_4_MHD.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/m_elapsed_labels_4_MHD.f90 @@ -48,7 +48,7 @@ module m_elapsed_labels_4_MHD ! subroutine elapsed_label_4_MHD ! - integer(kind = kint), parameter :: num_append = 4 + integer(kind = kint), parameter :: num_append = 6 ! call append_elapsed_times & & (num_append, ist_elapsed_MHD, ied_elapsed_MHD) @@ -57,8 +57,9 @@ subroutine elapsed_label_4_MHD elps1%labels(ist_elapsed_MHD+2) = 'Time evolution loop time ' elps1%labels(ist_elapsed_MHD+3) = 'Data IO time ' elps1%labels(ist_elapsed_MHD+4) = 'Visualizatio time ' + elps1%labels(ist_elapsed_MHD+5) = 'Particle tracing time ' ! - elps1%labels(ist_elapsed_MHD+4) = 'Field data IO time ' + elps1%labels(ist_elapsed_MHD+6) = 'Field data IO time ' ! iflag_MHD_time = .TRUE. ! @@ -96,12 +97,18 @@ end subroutine elapsed_label_4_SPH_MHD ! subroutine elapsed_label_4_FEM_MHD ! - integer(kind = kint), parameter :: num_append = 1 + integer(kind = kint), parameter :: num_append = 7 ! call append_elapsed_times & & (num_append, ist_elapsed_FMHD, ied_elapsed_FMHD) ! - elps1%labels(ist_elapsed_FMHD+ 1) = 'Linear solver time ' + elps1%labels(ist_elapsed_FMHD+ 1) = 'Solver initialization time ' + elps1%labels(ist_elapsed_FMHD+ 2) = 'Solver precondition time ' + elps1%labels(ist_elapsed_FMHD+ 3) = 'Solver main time ' + elps1%labels(ist_elapsed_FMHD+ 4) = 'Solver iteration time ' + elps1%labels(ist_elapsed_FMHD+ 5) = 'Solver communication time ' + elps1%labels(ist_elapsed_FMHD+ 6) = 'Solver CG iteration time ' + elps1%labels(ist_elapsed_FMHD+ 7) = 'Solver V-cycle time ' ! iflag_FMHD_time = .TRUE. ! diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/material_property.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/material_property.f90 index 614f4542..8b1f7553 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/material_property.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/material_property.f90 @@ -108,27 +108,27 @@ subroutine set_fluid_property & fl_prop%acoef_press = one / fl_prop%coef_press fl_prop%coef_nega_v = - fl_prop%coef_velo ! - if (fl_prop%iflag_4_gravity & - & .or. fl_prop%iflag_4_filter_gravity) then + if (fl_prop%flag_thermal_buoyancy & + & .or. fl_prop%flag_filter_gravity) then call construct_coefficient(fl_prop%coef_buo, & & MHD_coef_list%dimless_list, MHD_coef_list%coefs_buoyancy, & & depth_top, depth_bottom) end if ! - if (fl_prop%iflag_4_composit_buo & - & .or. fl_prop%iflag_4_filter_comp_buo) then + if (fl_prop%flag_comp_buoyancy & + & .or. fl_prop%flag_filter_comp_buo) then call construct_coefficient(fl_prop%coef_comp_buo, & & MHD_coef_list%dimless_list, MHD_coef_list%coefs_comp_buo, & & depth_top, depth_bottom) end if ! - if (fl_prop%iflag_4_coriolis) then + if (fl_prop%flag_coriolis) then call construct_coefficient(fl_prop%coef_cor, & & MHD_coef_list%dimless_list, MHD_coef_list%coefs_Coriolis, & & depth_top, depth_bottom) end if ! - if(fl_prop%iflag_4_lorentz) then + if(fl_prop%flag_lorentz) then call construct_coefficient(fl_prop%coef_lor, & & MHD_coef_list%dimless_list, MHD_coef_list%coefs_Lorentz, & & depth_top, depth_bottom) @@ -146,16 +146,16 @@ subroutine set_fluid_property & & fl_prop%coef_press write(*,*) 'coefficient for viscous diffusion: ', & & fl_prop%coef_diffuse - if(fl_prop%iflag_4_gravity) write(*,*) & - & 'coefficient for buoyancy: ', & + if(fl_prop%flag_thermal_buoyancy) write(*,*) & + & 'coefficient for thernal buoyancy: ', & & fl_prop%coef_buo - if(fl_prop%iflag_4_composit_buo) write(*,*) & + if(fl_prop%flag_comp_buoyancy) write(*,*) & & 'coefficient for composit buoyancy: ', & & fl_prop%coef_comp_buo - if(fl_prop%iflag_4_coriolis) write(*,*) & + if(fl_prop%flag_coriolis) write(*,*) & & 'coefficient for coriolis force: ', & & fl_prop%coef_cor - if(fl_prop%iflag_4_lorentz) write(*,*) & + if(fl_prop%flag_lorentz) write(*,*) & & 'coefficient for Lorentz force: ', & & fl_prop%coef_lor end if diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/radial_reference_field_IO.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/radial_reference_field_IO.f90 index 3d03b4d2..72ab27d7 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/radial_reference_field_IO.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/radial_reference_field_IO.f90 @@ -32,6 +32,8 @@ module radial_reference_field_IO use t_phys_data use t_phys_address use t_radial_reference_field + use t_field_data_IO + use t_time_data ! implicit none ! @@ -161,7 +163,6 @@ subroutine load_sph_reference_one_field & use calypso_mpi use calypso_mpi_int use calypso_mpi_real - use t_time_data use t_file_IO_parameter use field_file_IO use interpolate_reference_data diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/rot_self_buoyancies_sph.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/rot_self_buoyancies_sph.f90 index 500999fc..867dbe42 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/rot_self_buoyancies_sph.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/rot_self_buoyancies_sph.f90 @@ -38,8 +38,7 @@ module rot_self_buoyancies_sph ! implicit none ! - private :: sel_rot_self_buoyancy_sph - private :: sel_rot_r_const_buoyancy_sph + private :: sel_rot_buoyancy_sph_rj ! !----------------------------------------------------------------------- ! @@ -58,125 +57,48 @@ subroutine sel_rot_buoyancy_sph_MHD(sph_rj, & type(phys_data), intent(inout) :: rj_fld ! ! - if(fl_prop%i_grav .eq. iflag_radial_g) then - if(iflag_debug.gt.0) write(*,*) 'sel_rot_self_buoyancy_sph' - call sel_rot_r_const_buoyancy_sph & - & (sph_rj, ipol_base, ipol_rot_frc, fl_prop, sph_bc_U, rj_fld) - else - if(iflag_debug.gt.0) write(*,*) 'sel_rot_self_buoyancy_sph' - call sel_rot_self_buoyancy_sph & - & (sph_rj, ipol_base, ipol_rot_frc, fl_prop, sph_bc_U, rj_fld) - end if + call sel_rot_buoyancy_sph_rj(fl_prop%i_grav, sph_rj, & + & ipol_base%i_temp, ipol_rot_frc%i_buoyancy, & + & fl_prop%coef_buo, sph_bc_U, rj_fld) +! + call sel_rot_buoyancy_sph_rj(fl_prop%i_grav, sph_rj, & + & ipol_base%i_light, ipol_rot_frc%i_comp_buo, & + & fl_prop%coef_comp_buo, sph_bc_U, rj_fld) ! end subroutine sel_rot_buoyancy_sph_MHD ! !----------------------------------------------------------------------- ! - subroutine sel_rot_self_buoyancy_sph(sph_rj, & - & ipol_base, ipol_rot_frc, fl_prop, sph_bc_U, rj_fld) + subroutine sel_rot_buoyancy_sph_rj(i_grav, sph_rj, & + & ipol_scalar, ipol_buo, coef_buo, sph_bc_U, rj_fld) ! use cal_buoyancies_sph_MHD ! - type(fluid_property), intent(in) :: fl_prop + integer(kind = kint), intent(in) :: i_grav + integer(kind = kint), intent(in) :: ipol_scalar, ipol_buo type(sph_rj_grid), intent(in) :: sph_rj - type(base_field_address), intent(in) :: ipol_base - type(base_force_address), intent(in) :: ipol_rot_frc type(sph_boundary_type), intent(in) :: sph_bc_U - type(phys_data), intent(inout) :: rj_fld -! - integer(kind = kint) :: it_rot_buo -! + real(kind = kreal), intent(in) :: coef_buo ! - if(fl_prop%iflag_4_gravity & - & .and. fl_prop%iflag_4_composit_buo) then -! - if (iflag_debug.eq.1) & - & write(*,*)'rot_self_dbl_buoyancy_sph_MHD', ipol_base%i_temp - it_rot_buo = ipol_rot_frc%i_buoyancy + 2 - call rot_self_dbl_buoyancy_sph_MHD & - & (sph_bc_U%kr_in, sph_bc_U%kr_out, & - & fl_prop%coef_buo, ipol_base%i_temp, fl_prop%coef_comp_buo, & - & ipol_base%i_light, it_rot_buo, & - & sph_rj%nidx_rj, sph_rj%radius_1d_rj_r, & - & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) -! - else if (fl_prop%iflag_4_gravity) then - if (iflag_debug.eq.1) write(*,*) & - & 'rot_self_buoyancy_sph_MHD', ipol_base%i_temp - it_rot_buo = ipol_rot_frc%i_buoyancy + 2 - call rot_self_buoyancy_sph_MHD & - & (sph_bc_U%kr_in, sph_bc_U%kr_out, fl_prop%coef_buo, & - & ipol_base%i_temp, it_rot_buo, & - & sph_rj%nidx_rj, sph_rj%radius_1d_rj_r, & - & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) -! - else if (fl_prop%iflag_4_composit_buo) then - if (iflag_debug.eq.1) write(*,*) & - & 'rot_self_buoyancy_sph_MHD', ipol_base%i_light - it_rot_buo = ipol_rot_frc%i_comp_buo + 2 - call rot_self_buoyancy_sph_MHD(sph_bc_U%kr_in, sph_bc_U%kr_out, & - & fl_prop%coef_comp_buo, ipol_base%i_light, it_rot_buo, & - & sph_rj%nidx_rj, sph_rj%radius_1d_rj_r, & - & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) - end if -! - end subroutine sel_rot_self_buoyancy_sph -! -!----------------------------------------------------------------------- -! - subroutine sel_rot_r_const_buoyancy_sph(sph_rj, & - & ipol_base, ipol_rot_frc, fl_prop, sph_bc_U, rj_fld) -! - use t_physical_property - use t_spheric_rj_data - use t_base_field_labels - use t_base_force_labels - use t_phys_data - use t_boundary_params_sph_MHD - use cal_buoyancies_sph_MHD -! - type(fluid_property), intent(in) :: fl_prop - type(sph_rj_grid), intent(in) :: sph_rj - type(base_field_address), intent(in) :: ipol_base - type(base_force_address), intent(in) :: ipol_rot_frc - type(sph_boundary_type), intent(in) :: sph_bc_U type(phys_data), intent(inout) :: rj_fld ! - integer(kind = kint) :: it_rot_buo ! + if(ipol_scalar*ipol_buo .le. 0) return ! - if(fl_prop%iflag_4_gravity & - & .and. fl_prop%iflag_4_composit_buo) then -! - if (iflag_debug.eq.1) & - & write(*,*)'rot_r_cst_dbl_buoyancy_sph_MHD', ipol_base%i_temp - it_rot_buo = ipol_rot_frc%i_buoyancy + 2 - call rot_r_cst_dbl_buoyancy_sph_MHD & - & (sph_bc_U%kr_in, sph_bc_U%kr_out, & - & fl_prop%coef_buo, ipol_base%i_temp, fl_prop%coef_comp_buo, & - & ipol_base%i_light, it_rot_buo, sph_rj%nidx_rj, & - & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) -! - else if (fl_prop%iflag_4_gravity) then - if (iflag_debug.eq.1) write(*,*) & - & 'rot_r_const_buoyancy_sph_MHD', ipol_base%i_temp - it_rot_buo = ipol_rot_frc%i_buoyancy + 2 + if(i_grav .eq. iflag_radial_g) then call rot_r_const_buoyancy_sph_MHD & - & (sph_bc_U%kr_in, sph_bc_U%kr_out, fl_prop%coef_buo, & - & ipol_base%i_temp, it_rot_buo, sph_rj%nidx_rj, & + & (sph_bc_U%kr_in, sph_bc_U%kr_out, coef_buo, & + & ipol_scalar, ipol_buo, sph_rj%nidx_rj, & & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) -! - else if (fl_prop%iflag_4_composit_buo) then - if (iflag_debug.eq.1) write(*,*) & - & 'rot_r_const_buoyancy_sph_MHD', ipol_base%i_light - it_rot_buo = ipol_rot_frc%i_comp_buo + 2 - call rot_r_const_buoyancy_sph_MHD & - & (sph_bc_U%kr_in, sph_bc_U%kr_out, fl_prop%coef_comp_buo, & - & ipol_base%i_light, it_rot_buo, sph_rj%nidx_rj, & + else + call rot_self_buoyancy_sph_MHD & + & (sph_bc_U%kr_in, sph_bc_U%kr_out, & + & coef_buo, ipol_scalar, ipol_buo, & + & sph_rj%nidx_rj, sph_rj%radius_1d_rj_r, & & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) end if -! - end subroutine sel_rot_r_const_buoyancy_sph +! + end subroutine sel_rot_buoyancy_sph_rj ! !----------------------------------------------------------------------- ! diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/self_buoyancy_on_sphere.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/self_buoyancy_on_sphere.f90 index 8bedc229..eb2d344f 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/self_buoyancy_on_sphere.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/self_buoyancy_on_sphere.f90 @@ -8,7 +8,7 @@ !! !!@verbatim !! subroutine r_buoyancy_on_sphere & -!! & (iflag_4_gravity, iflag_4_composit_buo, kr, sph_rj, & +!! & (flag_thermal_buoyancy, flag_comp_buoyancy, kr, sph_rj,& !! & ipol_base, ipol_div_frc, coef_buo, coef_comp_buo, & !! & ref_param_T, ref_param_C, rj_fld) !! type(fluid_property), intent(in) :: fl_prop @@ -43,7 +43,7 @@ module self_buoyancy_on_sphere !----------------------------------------------------------------------- ! subroutine r_buoyancy_on_sphere & - & (iflag_4_gravity, iflag_4_composit_buo, kr, sph_rj, & + & (flag_thermal_buoyancy, flag_comp_buoyancy, kr, sph_rj, & & ipol_base, ipol_div_frc, coef_buo, coef_comp_buo, & & ref_param_T, ref_param_C, rj_fld) ! @@ -53,7 +53,7 @@ subroutine r_buoyancy_on_sphere & use t_base_force_labels use t_phys_data ! - logical, intent(in) :: iflag_4_gravity, iflag_4_composit_buo + logical, intent(in) :: flag_thermal_buoyancy, flag_comp_buoyancy real(kind = kreal), intent(in) :: coef_buo, coef_comp_buo integer(kind= kint), intent(in) :: kr type(reference_scalar_param), intent(in) :: ref_param_T @@ -66,7 +66,7 @@ subroutine r_buoyancy_on_sphere & integer(kind = kint) :: ipol_temp, ipol_comp ! ! - if(iflag_4_gravity) then + if(flag_thermal_buoyancy) then if(ref_param_T%flag_ref_field) then ipol_temp = ipol_base%i_per_temp else @@ -74,7 +74,7 @@ subroutine r_buoyancy_on_sphere & end if end if ! - if(iflag_4_composit_buo) then + if(flag_comp_buoyancy) then if(ref_param_C%flag_ref_field) then ipol_comp = ipol_base%i_per_light else @@ -82,7 +82,7 @@ subroutine r_buoyancy_on_sphere & end if end if ! - if(iflag_4_gravity .and. iflag_4_composit_buo) then + if(flag_thermal_buoyancy .and. flag_comp_buoyancy) then if (iflag_debug.eq.1) & & write(*,*)'cal_r_double_buo_on_sphere', ipol_temp call cal_r_double_buo_on_sphere(kr, coef_buo, coef_comp_buo, & @@ -90,14 +90,14 @@ subroutine r_buoyancy_on_sphere & & sph_rj%nidx_rj, sph_rj%radius_1d_rj_r, & & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) ! - else if(iflag_4_gravity) then + else if(flag_thermal_buoyancy) then if (iflag_debug.eq.1) write(*,*) 'cal_r_buoyancy_on_sphere' call cal_r_buoyancy_on_sphere(kr, coef_buo, & & ipol_temp, ipol_div_frc%i_buoyancy, & & sph_rj%nidx_rj, sph_rj%radius_1d_rj_r, & & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) ! - else if(iflag_4_composit_buo) then + else if(flag_comp_buoyancy) then if (iflag_debug.eq.1) write(*,*) 'cal_r_buoyancy_on_sphere' call cal_r_buoyancy_on_sphere(kr, coef_comp_buo, & & ipol_comp, ipol_div_frc%i_comp_buo, & diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/set_bc_sph_mhd.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/set_bc_sph_mhd.f90 index 37b3bd5c..898b3aa2 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/set_bc_sph_mhd.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/set_bc_sph_mhd.f90 @@ -8,14 +8,19 @@ !! !!@verbatim !! subroutine s_set_bc_sph_mhd(bc_IO, sph_params, sph_rj, & -!! & radial_rj_grp, MHD_prop, MHD_BC, sph_MHD_bc) +!! & radial_rj_grp, MHD_prop, radial_variation, & +!! & MHD_BC, sph_MHD_bc) !! type(boundary_spectra), intent(in) :: bc_IO !! type(MHD_evolution_param), intent(in) :: MHD_prop +!! type(phys_data), intent(in) :: radial_variation !! type(MHD_BC_lists), intent(in) :: MHD_BC !! type(sph_shell_parameters), intent(in) :: sph_params !! type(sph_rj_grid), intent(in) :: sph_rj !! type(group_data), intent(in) :: radial_rj_grp !! type(sph_MHD_boundary_data), intent(inout) :: sph_MHD_bc +!! subroutine check_bc_sph_mhd(MHD_prop, sph_MHD_bc) +!! type(MHD_evolution_param), intent(in) :: MHD_prop +!! type(sph_MHD_boundary_data), intent(in) :: sph_MHD_bc !!@endverbatim ! module set_bc_sph_mhd @@ -36,8 +41,6 @@ module set_bc_sph_mhd use t_sph_boundary_input_data ! implicit none -! - private :: set_sph_bc_magne_sph ! ! ----------------------------------------------------------------------- ! @@ -46,8 +49,14 @@ module set_bc_sph_mhd ! ----------------------------------------------------------------------- ! subroutine s_set_bc_sph_mhd(bc_IO, sph_params, sph_rj, & - & radial_rj_grp, MHD_prop, MHD_BC, sph_MHD_bc) -! + & radial_rj_grp, MHD_prop, radial_variation, & + & MHD_BC, sph_MHD_bc) +! + use t_phys_data + use t_coef_fdm3_n2e_zero_vp_ICB + use t_coef_fdm3_n2e_free_vp_ICB + use t_coef_fdm3_n2e_zero_vp_CMB + use t_coef_fdm3_n2e_free_vp_CMB use m_base_field_labels ! use set_bc_flag_sph_velo @@ -57,6 +66,7 @@ subroutine s_set_bc_sph_mhd(bc_IO, sph_params, sph_rj, & use coef_fdm2_to_center use coef_fdm2_free_ICB use coef_fdm2_free_CMB + use set_sph_bc_magne_sph ! type(boundary_spectra), intent(in) :: bc_IO ! @@ -64,14 +74,27 @@ subroutine s_set_bc_sph_mhd(bc_IO, sph_params, sph_rj, & type(sph_rj_grid), intent(in) :: sph_rj type(group_data), intent(in) :: radial_rj_grp type(MHD_evolution_param), intent(in) :: MHD_prop + type(phys_data), intent(in) :: radial_variation type(MHD_BC_lists), intent(in) :: MHD_BC ! type(sph_MHD_boundary_data), intent(inout) :: sph_MHD_bc ! - integer(kind = kint) :: kst, ked + integer(kind = kint) :: kst, ked, icomp + real(kind = kreal) :: h_rho_in, h_rho_out +! ! + if(MHD_prop%fl_prop%iflag_scheme .gt. id_no_evolution) then + kst = sph_MHD_bc%sph_bc_U%kr_in + ked = sph_MHD_bc%sph_bc_U%kr_out + icomp = MHD_prop%fl_prop%ir_dnu_norm + if(MHD_prop%fl_prop%ir_dnu_norm .gt. 0) then + h_rho_in = radial_variation%d_fld(kst+1,icomp) + h_rho_out = radial_variation%d_fld(ked+1,icomp) + else + h_rho_in = zero + h_rho_out = zero + end if ! - if (MHD_prop%fl_prop%iflag_scheme .gt. id_no_evolution) then if(iflag_debug .gt. 0) write(*,*) 'set_sph_bc_velo_sph' call set_sph_bc_velo_sph(bc_IO, sph_rj, radial_rj_grp, & & sph_params%radius_ICB, sph_params%radius_CMB, & @@ -83,19 +106,31 @@ subroutine s_set_bc_sph_mhd(bc_IO, sph_params, sph_rj, & & (sph_rj%nidx_rj(1), sph_rj%radius_1d_rj_r, & & sph_MHD_bc%sph_bc_U) ! - kst = sph_MHD_bc%sph_bc_U%kr_in - ked = sph_MHD_bc%sph_bc_U%kr_in + 1 - call cal_fdm2_ICB_free_vp & - & (sph_rj%radius_1d_rj_r(kst:ked), sph_MHD_bc%fdm2_free_ICB) - call cal_fdm2_ICB_free_vt & - & (sph_rj%radius_1d_rj_r(kst:ked), sph_MHD_bc%fdm2_free_ICB) -! - kst = sph_MHD_bc%sph_bc_U%kr_out-1 - ked = sph_MHD_bc%sph_bc_U%kr_out - call cal_fdm2_CMB_free_vp & - & (sph_rj%radius_1d_rj_r(kst:ked), sph_MHD_bc%fdm2_free_CMB) - call cal_fdm2_CMB_free_vt & - & (sph_rj%radius_1d_rj_r(kst:ked), sph_MHD_bc%fdm2_free_CMB) + call cal_fdm2_ICB_free_vp(h_rho_in, & + & sph_rj%radius_1d_rj_r(kst), & + & sph_MHD_bc%fdm2_free_ICB) + call cal_fdm2_ICB_free_vt(h_rho_in, & + & sph_rj%radius_1d_rj_r(kst), & + & sph_MHD_bc%fdm2_free_ICB) +! + call cal_fdm3e_ICB_hdiv_vp(sph_rj%radius_1d_rj_r(kst), & + & sph_MHD_bc%fdm3e_vp0_ICB) + call cal_fdm3e_ICB_free_hdiv_vp & + & (sph_MHD_bc%fdm2_free_ICB%dmat_vp, sph_MHD_bc%fdm3e_vp0_ICB, & + & sph_MHD_bc%fdm3e_free_ICB) +! + call cal_fdm2_CMB_free_vp(h_rho_out, & + & sph_rj%radius_1d_rj_r(ked-1), & + & sph_MHD_bc%fdm2_free_CMB) + call cal_fdm2_CMB_free_vt(h_rho_out, & + & sph_rj%radius_1d_rj_r(ked-1), & + & sph_MHD_bc%fdm2_free_CMB) +! + call cal_fdm3e_CMB_hdiv_vp(sph_rj%radius_1d_rj_r(ked-2), & + & sph_MHD_bc%fdm3e_vp0_CMB) + call cal_fdm3e_CMB_free_hdiv_vp & + & (sph_MHD_bc%fdm2_free_CMB%dmat_vp, sph_MHD_bc%fdm3e_vp0_CMB, & + & sph_MHD_bc%fdm3e_free_CMB) end if ! ! @@ -110,8 +145,8 @@ subroutine s_set_bc_sph_mhd(bc_IO, sph_params, sph_rj, & end if ! if(MHD_prop%cd_prop%iflag_Bevo_scheme .gt. id_no_evolution) then - if(iflag_debug .gt. 0) write(*,*) 'set_sph_bc_magne_sph' - call set_sph_bc_magne_sph(bc_IO, sph_rj, radial_rj_grp, & + if(iflag_debug .gt. 0) write(*,*) 's_set_sph_bc_magne_sph' + call s_set_sph_bc_magne_sph(bc_IO, sph_rj, radial_rj_grp, & & CTR_nod_grp_name, CTR_sf_grp_name, & & MHD_BC%magne_BC%nod_BC, MHD_BC%magne_BC%surf_BC, & & sph_MHD_bc%sph_bc_B, sph_MHD_bc%bcs_B) @@ -133,14 +168,38 @@ subroutine s_set_bc_sph_mhd(bc_IO, sph_params, sph_rj, & ! Set FDM matrices for Center ! if(iflag_debug .gt. 0) write(*,*) 'cal_2nd_to_center_fixed_fdm' - call cal_2nd_to_center_fixed_fdm & - & (sph_rj%radius_1d_rj_r(1:2), sph_MHD_bc%fdm2_center) - call cal_2nd_center_fix_df_fdm & - & (sph_rj%radius_1d_rj_r(1), sph_MHD_bc%fdm2_center) - call cal_2nd_center_fixed_fdm & - & (sph_rj%radius_1d_rj_r(1:2), sph_MHD_bc%fdm2_center) + call cal_2nd_to_center_fixed_fdm(sph_rj%radius_1d_rj_r(1), & + & sph_MHD_bc%fdm2_center) + call cal_2nd_center_fix_df_fdm(sph_rj%radius_1d_rj_r(1), & + & sph_MHD_bc%fdm2_center) + call cal_2nd_center_fixed_fdm(sph_rj%radius_1d_rj_r(1), & + & sph_MHD_bc%fdm2_center) + call cal_fdm3e_CTR_hdiv_vp(sph_rj%radius_1d_rj_r(1), & + & sph_MHD_bc%fdm3e_center) ! ! Check data + call check_bc_sph_mhd(MHD_prop, sph_MHD_bc) +! + end subroutine s_set_bc_sph_mhd +! +! ----------------------------------------------------------------------- +! + subroutine check_bc_sph_mhd(MHD_prop, sph_MHD_bc) +! + use m_base_field_labels +! + use set_bc_flag_sph_velo + use set_bc_sph_scalars +! + use cal_fdm_coefs_4_boundaries + use coef_fdm2_to_center + use coef_fdm2_free_ICB + use coef_fdm2_free_CMB + use set_sph_bc_magne_sph +! + type(MHD_evolution_param), intent(in) :: MHD_prop + type(sph_MHD_boundary_data), intent(in) :: sph_MHD_bc +! ! if(iflag_debug .gt. 1) then write(*,*) 'sph_bc_U%iflag_icb', sph_MHD_bc%sph_bc_U%kr_in, & @@ -165,8 +224,14 @@ subroutine s_set_bc_sph_mhd(bc_IO, sph_params, sph_rj, & if (MHD_prop%fl_prop%iflag_scheme .gt. id_no_evolution) then call check_fdm_coefs_4_BC2 & & (velocity%name, sph_MHD_bc%sph_bc_U) - call check_coef_fdm_free_ICB(sph_MHD_bc%fdm2_free_ICB) - call check_coef_fdm_free_CMB(sph_MHD_bc%fdm2_free_CMB) + call check_fdm3_n2e_ICB_zero_vpol & + & (50, sph_MHD_bc%fdm3e_vp0_ICB) + call check_coef_fdm_free_ICB(50, sph_MHD_bc%fdm2_free_ICB) + call check_coef_fdm_free_CMB(50, sph_MHD_bc%fdm2_free_CMB) + call check_fdm3_n2e_ICB_free_vpol & + & (50, sph_MHD_bc%fdm3e_free_ICB) + call check_fdm3_n2e_CMB_free_vpol & + & (50, sph_MHD_bc%fdm3e_free_CMB) end if ! if(MHD_prop%cd_prop%iflag_Bevo_scheme .gt. id_no_evolution) & @@ -186,101 +251,7 @@ subroutine s_set_bc_sph_mhd(bc_IO, sph_params, sph_rj, & call check_coef_fdm_fix_dr_2ctr(sph_MHD_bc%fdm2_center) end if ! - end subroutine s_set_bc_sph_mhd -! -! ----------------------------------------------------------------------- -! - subroutine set_sph_bc_magne_sph(bc_IO, sph_rj, radial_rj_grp, & - & CTR_nod_grp_name, CTR_sf_grp_name, magne_nod, magne_surf, & - & sph_bc_B, bcs_B) -! - use m_base_field_labels - use set_bc_sph_scalars - use set_sph_bc_data_by_file -! - character(len=kchara), intent(in) :: CTR_nod_grp_name - character(len=kchara), intent(in) :: CTR_sf_grp_name - type(sph_rj_grid), intent(in) :: sph_rj - type(group_data), intent(in) :: radial_rj_grp - type(boundary_condition_list), intent(in) :: magne_nod - type(boundary_condition_list), intent(in) :: magne_surf - type(boundary_spectra), intent(in) :: bc_IO -! - type(sph_boundary_type), intent(inout) :: sph_bc_B - type(sph_vector_boundary_data), intent(inout) :: bcs_B -! - integer(kind = kint) :: i - integer(kind = kint) :: igrp_icb, igrp_cmb -! -! - call find_both_sides_of_boundaries(sph_rj, radial_rj_grp, & - & magne_nod, magne_surf, sph_bc_B, igrp_icb, igrp_cmb) -! - call alloc_sph_vector_bcs_data(sph_rj%nidx_rj(2), bcs_B) -! - sph_bc_B%iflag_icb = iflag_sph_insulator - sph_bc_B%iflag_cmb = iflag_sph_insulator -! - i = abs(igrp_icb) - if(igrp_icb .lt. 0) then - if(sph_bc_B%icb_grp_name .eq. CTR_sf_grp_name) then - if(magne_surf%ibc_type(i) .eq. iflag_sph_2_center) then - sph_bc_B%iflag_icb = iflag_sph_fill_center - else if(magne_surf%ibc_type(i) .eq. iflag_sph_clip_center) & - & then - sph_bc_B%iflag_icb = iflag_sph_fix_center - end if -! - else if(magne_surf%ibc_type(i) .eq. iflag_pseudo_vacuum) then - sph_bc_B%iflag_icb = iflag_radial_magne - end if - else - if(sph_bc_B%icb_grp_name .eq. CTR_nod_grp_name) then - if(magne_nod%ibc_type(i) .eq. iflag_sph_2_center) then - sph_bc_B%iflag_icb = iflag_sph_fill_center - else if(magne_nod%ibc_type(i) .eq. iflag_sph_clip_center) & - & then - sph_bc_B%iflag_icb = iflag_sph_fix_center - end if -! - else if(magne_nod%ibc_type(i) .eq. iflag_pseudo_vacuum) then - sph_bc_B%iflag_icb = iflag_radial_magne - else if(magne_nod%ibc_type(i) .eq. iflag_bc_file_s) then - call set_fixed_vector_bc_by_file & - & (magnetic_field, sph_rj, bc_IO, & - & sph_bc_B%icb_grp_name, sph_bc_B%iflag_icb, & - & bcs_B%ICB_Vspec) - else if(magne_nod%ibc_type(i) .eq. iflag_bc_evo_field) then - call set_evolved_vector_bc_by_file & - & (magnetic_field, sph_rj, bc_IO, & - & sph_bc_B%icb_grp_name, sph_bc_B%iflag_icb, & - & bcs_B%ICB_Vevo) - end if - end if -! -! - i = abs(igrp_cmb) - if(igrp_icb .lt. 0) then - if(magne_surf%ibc_type(i) .eq. iflag_pseudo_vacuum) then - sph_bc_B%iflag_cmb = iflag_radial_magne - end if - else - if(magne_nod%ibc_type(i) .eq. iflag_pseudo_vacuum) then - sph_bc_B%iflag_cmb = iflag_radial_magne - else if(magne_nod%ibc_type(i) .eq. iflag_bc_file_s) then - call set_fixed_vector_bc_by_file & - & (magnetic_field, sph_rj, bc_IO, & - & sph_bc_B%cmb_grp_name, sph_bc_B%iflag_cmb, & - & bcs_B%CMB_Vspec) - else if(magne_nod%ibc_type(i) .eq. iflag_bc_evo_field) then - call set_evolved_vector_bc_by_file & - & (magnetic_field, sph_rj, bc_IO, & - & sph_bc_B%cmb_grp_name, sph_bc_B%iflag_cmb, & - & bcs_B%CMB_Vevo) - end if - end if -! - end subroutine set_sph_bc_magne_sph + end subroutine check_bc_sph_mhd ! ! ----------------------------------------------------------------------- ! diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/set_control_sph_mhd.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/set_control_sph_mhd.f90 index c504f2fb..62faed80 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/set_control_sph_mhd.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/set_control_sph_mhd.f90 @@ -10,7 +10,7 @@ !! subroutine set_control_4_SPH_MHD & !! & (plt, org_plt, model_ctl, smctl_ctl, psph_ctl, & !! & MHD_files, bc_IO, refs, MHD_step, MHD_prop, MHD_BC, & -!! & trans_p, WK, SPH_MHD) +!! & trans_p, WK, sph_maker) !! type(platform_data_control), intent(in) :: plt !! type(platform_data_control), intent(in) :: org_plt !! type(mhd_model_control), intent(in) :: model_ctl @@ -29,7 +29,7 @@ !! type(MHD_BC_lists), intent(inout) :: MHD_BC !! type(parameters_4_sph_trans), intent(inout) :: trans_p !! type(works_4_sph_trans_MHD), intent(inout) :: WK -!! type(SPH_mesh_field_data), intent(inout) :: SPH_MHD +!! type(sph_grid_maker_in_sim), intent(inout) :: sph_maker !! subroutine set_control_SPH_MHD_bcs & !! & (MHD_prop, nbc_ctl, sbc_ctl, MHD_BC) !! type(MHD_evolution_param), intent(in) :: MHD_prop @@ -59,7 +59,7 @@ module set_control_sph_mhd use t_ctl_data_crust_filter use t_bc_data_list use t_flex_delta_t_data - use t_SPH_mesh_field_data + use t_sph_grid_maker_in_sim use t_radial_reference_field use t_field_on_circle ! @@ -71,21 +71,22 @@ module set_control_sph_mhd ! ! ---------------------------------------------------------------------- ! - subroutine set_control_4_SPH_MHD & - & (plt, org_plt, model_ctl, smctl_ctl, psph_ctl, & - & MHD_files, bc_IO, refs, MHD_step, MHD_prop, MHD_BC, & - & trans_p, WK, SPH_MHD) + subroutine set_control_4_SPH_MHD(plt, org_plt, & + & model_ctl, smctl_ctl, psph_ctl, MHD_files, & + & bc_IO, refs, MHD_step, MHD_prop, MHD_BC, & + & trans_p, WK, sph_maker) ! use t_spheric_parameter use t_phys_data use t_rms_4_sph_spectr - use t_SPH_mesh_field_data use t_sph_trans_arrays_MHD use t_const_spherical_grid use t_sph_boundary_input_data use t_ctl_params_gen_sph_shell use t_sph_trans_arrays_MHD use t_coef_parameters_list + use t_ctl_param_val_density + use t_ctl_param_val_diffusion ! use gen_sph_grids_modes use set_control_platform_item @@ -113,7 +114,7 @@ subroutine set_control_4_SPH_MHD & type(MHD_BC_lists), intent(inout) :: MHD_BC type(parameters_4_sph_trans), intent(inout) :: trans_p type(works_4_sph_trans_MHD), intent(inout) :: WK - type(SPH_mesh_field_data), intent(inout) :: SPH_MHD + type(sph_grid_maker_in_sim), intent(inout) :: sph_maker ! integer(kind = kint) :: ierr ! @@ -138,13 +139,12 @@ subroutine set_control_4_SPH_MHD & ! call set_ctl_4_sph_grid_maker(nprocs, psph_ctl, & & plt%sph_file_prefix, MHD_files%sph_file_param, & - & SPH_MHD%sph_maker, ierr) + & sph_maker, ierr) ! ! set forces ! if (iflag_debug.gt.0) write(*,*) 's_set_control_4_force' - call s_set_control_4_force(model_ctl%frc_ctl, model_ctl%g_ctl, & - & model_ctl%cor_ctl, model_ctl%mcv_ctl, MHD_prop) + call s_set_control_4_force(model_ctl, MHD_prop) ! ! set parameters for general information ! @@ -162,9 +162,13 @@ subroutine set_control_4_SPH_MHD & & MHD_prop%cp_prop, model_ctl%dless_ctl, model_ctl%eqs_ctl, & & MHD_prop%MHD_coef_list) ! +! Set external magnetic field scale call set_coefs_4_magnetic_scale & & (model_ctl%bscale_ctl, MHD_prop%MHD_coef_list) ! +! Set polytrope and valuable diffusivities + call set_ctl_SPH_val_diffusions(model_ctl, MHD_prop) +! ! set boundary conditions ! call set_control_SPH_MHD_bcs & @@ -241,5 +245,49 @@ subroutine set_control_SPH_MHD_bcs & end subroutine set_control_SPH_MHD_bcs ! ! ---------------------------------------------------------------------- +! + subroutine set_ctl_SPH_val_diffusions(model_ctl, MHD_prop) +! + use t_ctl_param_val_density + use t_ctl_param_val_diffusion +! + type(mhd_model_control), intent(in) :: model_ctl + type(MHD_evolution_param), intent(inout) :: MHD_prop +! + integer(kind = kint) :: ierr +! +! Set polytrope + call set_valuable_density_ctl & + & (my_rank, model_ctl%polytrope_c, MHD_prop%polytrope_param, & + & MHD_prop%flag_ref_density_valiation) + call check_polytrope_parameters(MHD_prop%polytrope_param) +! +! Set valuable diffusivities + call set_valuable_diffusion_ctl & + & (my_rank, model_ctl%val_viscous_c, & + & MHD_prop%val_viscous_param, MHD_prop%flag_viscous_variation) + call set_valuable_diffusion_ctl & + & (my_rank, model_ctl%val_mag_diffuse_c, & + & MHD_prop%val_mag_diffuse_param, & + & MHD_prop%flag_mag_diffuse_variation) + call set_valuable_diffusion_ctl & + & (my_rank, model_ctl%val_thermal_diffuse_c, & + & MHD_prop%val_thermal_diffuse_param, & + & MHD_prop%flag_term_diffuse_variation) + call set_valuable_diffusion_ctl & + & (my_rank, model_ctl%val_comp_diffuse_c, & + & MHD_prop%val_comp_diffuse_param, & + & MHD_prop%flag_comp_diffuse_variation) +! + call check_val_diffuse_parameters(MHD_prop%val_viscous_param) + call check_val_diffuse_parameters(MHD_prop%val_mag_diffuse_param) + call check_val_diffuse_parameters & + & (MHD_prop%val_thermal_diffuse_param) + call check_val_diffuse_parameters & + & (MHD_prop%val_comp_diffuse_param) +! + end subroutine set_ctl_SPH_val_diffusions +! +! ---------------------------------------------------------------------- ! end module set_control_sph_mhd diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/set_initial_sph_dynamo.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/set_initial_sph_dynamo.f90 index 48dd61fc..d9c4a33c 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/set_initial_sph_dynamo.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/set_initial_sph_dynamo.f90 @@ -78,15 +78,14 @@ subroutine read_sph_initial_data_control(MHD_files, SPH_model, & if (iflag_restart .ne. i_rst_by_file) return if(iflag_debug .gt. 0) write(*,*) 'read_alloc_sph_restart_data' call read_alloc_sph_restart_data & - & (MHD_files%fst_file_IO, MHD_step%init_d, rj_fld, & - & MHD_step%rst_step) + & (MHD_files%fst_file_IO, MHD_step%init_d, MHD_step%time_d, & + & rj_fld, MHD_step%rst_step) ! call extend_by_potential_with_j & & (sph%sph_rj, SPH_model%sph_MHD_bc%sph_bc_B, & & ipol%base%i_magne, ipol%base%i_current, rj_fld) ! if(iflag_debug .gt. 0) write(*,*) 'copy_time_step_data' - call copy_time_step_data(MHD_step%init_d, MHD_step%time_d) call set_sph_restart_num_to_IO(rj_fld, sph_fst_IO) call calypso_mpi_barrier ! @@ -116,8 +115,8 @@ subroutine sph_initial_data_control(MHD_files, SPH_model, & type(SPH_MHD_model_data), intent(in) :: SPH_model type(sph_grids), intent(in) :: sph type(phys_address), intent(in) :: ipol + type(MHD_step_param), intent(in) :: MHD_step ! - type(MHD_step_param), intent(inout) :: MHD_step type(phys_data), intent(inout) :: rj_fld type(field_IO), intent(inout) :: sph_fst_IO ! @@ -149,7 +148,6 @@ subroutine sph_initial_data_control(MHD_files, SPH_model, & & ipol%base%i_magne, ipol%base%i_current, rj_fld) ! if(iflag_debug .gt. 0) write(*,*) 'copy_time_step_data' - call copy_time_step_data(MHD_step%init_d, MHD_step%time_d) call set_sph_restart_num_to_IO(rj_fld, sph_fst_IO) ! if (iflag_restart.ne.i_rst_by_file & diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/set_sph_bc_magne_sph.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/set_sph_bc_magne_sph.f90 new file mode 100644 index 00000000..a6f37ac4 --- /dev/null +++ b/src/Fortran_libraries/MHD_src/sph_MHD/set_sph_bc_magne_sph.f90 @@ -0,0 +1,143 @@ +!>@file set_sph_bc_magne_sph.f90 +!!@brief module set_sph_bc_magne_sph +!! +!!@author H. Matsui +!!@date programmed by H.Matsui in Oct., 2009 +! +!>@brief Set boundary conditions for MHD dynamo simulation +!! +!!@verbatim +!! subroutine s_set_sph_bc_magne_sph(bc_IO, sph_rj, radial_rj_grp, & +!! & CTR_nod_grp_name, CTR_sf_grp_name, magne_nod, magne_surf,& +!! & sph_bc_B, bcs_B) +!! character(len=kchara), intent(in) :: CTR_nod_grp_name +!! character(len=kchara), intent(in) :: CTR_sf_grp_name +!! type(sph_rj_grid), intent(in) :: sph_rj +!! type(group_data), intent(in) :: radial_rj_grp +!! type(boundary_condition_list), intent(in) :: magne_nod +!! type(boundary_condition_list), intent(in) :: magne_surf +!! type(boundary_spectra), intent(in) :: bc_IO +!! type(sph_boundary_type), intent(inout) :: sph_bc_B +!! type(sph_vector_boundary_data), intent(inout) :: bcs_B +!!@endverbatim +! + module set_sph_bc_magne_sph +! + use m_precision +! + use m_machine_parameter + use m_boundary_condition_IDs +! + use t_control_parameter + use t_physical_property + use t_spheric_parameter + use t_group_data + use t_boundary_data_sph_MHD + use t_boundary_params_sph_MHD + use t_spheric_rj_data + use t_bc_data_list + use t_sph_boundary_input_data +! + implicit none +! +! ----------------------------------------------------------------------- +! + contains +! +! ----------------------------------------------------------------------- +! + subroutine s_set_sph_bc_magne_sph(bc_IO, sph_rj, radial_rj_grp, & + & CTR_nod_grp_name, CTR_sf_grp_name, magne_nod, magne_surf, & + & sph_bc_B, bcs_B) +! + use m_base_field_labels + use set_bc_sph_scalars + use set_sph_bc_data_by_file +! + character(len=kchara), intent(in) :: CTR_nod_grp_name + character(len=kchara), intent(in) :: CTR_sf_grp_name + type(sph_rj_grid), intent(in) :: sph_rj + type(group_data), intent(in) :: radial_rj_grp + type(boundary_condition_list), intent(in) :: magne_nod + type(boundary_condition_list), intent(in) :: magne_surf + type(boundary_spectra), intent(in) :: bc_IO +! + type(sph_boundary_type), intent(inout) :: sph_bc_B + type(sph_vector_boundary_data), intent(inout) :: bcs_B +! + integer(kind = kint) :: i + integer(kind = kint) :: igrp_icb, igrp_cmb +! +! + call find_both_sides_of_boundaries(sph_rj, radial_rj_grp, & + & magne_nod, magne_surf, sph_bc_B, igrp_icb, igrp_cmb) +! + call alloc_sph_vector_bcs_data(sph_rj%nidx_rj(2), bcs_B) +! + sph_bc_B%iflag_icb = iflag_sph_insulator + sph_bc_B%iflag_cmb = iflag_sph_insulator +! + i = abs(igrp_icb) + if(igrp_icb .lt. 0) then + if(sph_bc_B%icb_grp_name .eq. CTR_sf_grp_name) then + if(magne_surf%ibc_type(i) .eq. iflag_sph_2_center) then + sph_bc_B%iflag_icb = iflag_sph_fill_center + else if(magne_surf%ibc_type(i) .eq. iflag_sph_clip_center) & + & then + sph_bc_B%iflag_icb = iflag_sph_fix_center + end if +! + else if(magne_surf%ibc_type(i) .eq. iflag_pseudo_vacuum) then + sph_bc_B%iflag_icb = iflag_radial_magne + end if + else + if(sph_bc_B%icb_grp_name .eq. CTR_nod_grp_name) then + if(magne_nod%ibc_type(i) .eq. iflag_sph_2_center) then + sph_bc_B%iflag_icb = iflag_sph_fill_center + else if(magne_nod%ibc_type(i) .eq. iflag_sph_clip_center) & + & then + sph_bc_B%iflag_icb = iflag_sph_fix_center + end if +! + else if(magne_nod%ibc_type(i) .eq. iflag_pseudo_vacuum) then + sph_bc_B%iflag_icb = iflag_radial_magne + else if(magne_nod%ibc_type(i) .eq. iflag_bc_file_s) then + call set_fixed_vector_bc_by_file & + & (magnetic_field, sph_rj, bc_IO, & + & sph_bc_B%icb_grp_name, sph_bc_B%iflag_icb, & + & bcs_B%ICB_Vspec) + else if(magne_nod%ibc_type(i) .eq. iflag_bc_evo_field) then + call set_evolved_vector_bc_by_file & + & (magnetic_field, sph_rj, bc_IO, & + & sph_bc_B%icb_grp_name, sph_bc_B%iflag_icb, & + & bcs_B%ICB_Vevo) + end if + end if +! +! + i = abs(igrp_cmb) + if(igrp_icb .lt. 0) then + if(magne_surf%ibc_type(i) .eq. iflag_pseudo_vacuum) then + sph_bc_B%iflag_cmb = iflag_radial_magne + end if + else + if(magne_nod%ibc_type(i) .eq. iflag_pseudo_vacuum) then + sph_bc_B%iflag_cmb = iflag_radial_magne + else if(magne_nod%ibc_type(i) .eq. iflag_bc_file_s) then + call set_fixed_vector_bc_by_file & + & (magnetic_field, sph_rj, bc_IO, & + & sph_bc_B%cmb_grp_name, sph_bc_B%iflag_cmb, & + & bcs_B%CMB_Vspec) + else if(magne_nod%ibc_type(i) .eq. iflag_bc_evo_field) then + call set_evolved_vector_bc_by_file & + & (magnetic_field, sph_rj, bc_IO, & + & sph_bc_B%cmb_grp_name, sph_bc_B%iflag_cmb, & + & bcs_B%CMB_Vevo) + end if + end if +! + end subroutine s_set_sph_bc_magne_sph +! +! ----------------------------------------------------------------------- +! + end module set_sph_bc_magne_sph diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/set_sph_radial_variations.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/set_sph_radial_variations.f90 new file mode 100644 index 00000000..0bd9e060 --- /dev/null +++ b/src/Fortran_libraries/MHD_src/sph_MHD/set_sph_radial_variations.f90 @@ -0,0 +1,324 @@ +!>@file set_sph_radial_variations.f90 +!!@brief module set_sph_radial_variations +!! +!!@author H. Matsui +!!@date Programmed in June., 1994 +!!@n Modified in Jan, 2010 +! +!>@brief Set radial variations for densityuy and diffusivities +!! +!!@verbatim +!! subroutine set_sph_radial_density & +!! & (my_rank, radius_name, density_name, ir_density, & +!! & sph_rj, r_2nd, polytrope_param, radial_variation, & +!! & r_itp, fld_IO) +!! character(len=kchara), intent(in) :: density_name +!! integer(kind = kint), intent(in) :: ir_density +!! type(polytrope_parameters), intent(inout) :: polytrope_param +!! subroutine set_sph_radial_diffusivity & +!! & (my_rank, radius_name, diffusivity_name, ir_diffusion, & +!! & sph_rj, r_2nd, diffuse_param, radial_variation, & +!! & r_itp, fld_IO) +!! character(len=kchara), intent(in) :: diffusivity_name +!! integer(kind = kint), intent(in) :: ir_diffusion +!! integer, intent(in) :: my_rank +!! character(len=kchara), intent(in) :: radius_name +!! type(sph_rj_grid), intent(in) :: sph_rj +!! type(fdm_matrices), intent(in) :: r_2nd +!! type(val_diffuse_parameters), intent(inout) :: diffuse_param +!! type(phys_data), intent(inout) :: radial_variation +!! type(sph_radial_interpolate), intent(inout) :: r_itp +!! type(field_IO), intent(inout) :: fld_IO +!!@endverbatim +!! +! + module set_sph_radial_variations +! + use m_precision + use m_constants + use t_spheric_rj_data + use t_phys_data + use t_sph_radial_interpolate + use t_field_data_IO + use t_fdm_coefs +! + implicit none +! + private :: find_address_from_field_IO + private :: set_sph_polytrope_density + private :: sph_radial_variation_from_list +! +! ------------------------------------------------------------------- +! + contains +! +! ------------------------------------------------------------------- +! + subroutine set_sph_radial_density & + & (my_rank, radius_name, density_name, ir_density, & + & sph_rj, r_2nd, polytrope_param, radial_variation, & + & r_itp, fld_IO) +! + use t_ctl_param_val_density + use radial_interpolation + use cal_sph_exp_1st_diff + use field_file_IO +! + integer, intent(in) :: my_rank + character(len=kchara), intent(in) :: radius_name + character(len=kchara), intent(in) :: density_name + integer(kind = kint), intent(in) :: ir_density + type(sph_rj_grid), intent(in) :: sph_rj + type(fdm_matrices), intent(in) :: r_2nd + type(polytrope_parameters), intent(inout) :: polytrope_param +! + type(phys_data), intent(inout) :: radial_variation + type(sph_radial_interpolate), intent(inout) :: r_itp + type(field_IO), intent(inout) :: fld_IO +! + type(time_data) :: t_IO + integer(kind = kint) :: iend + integer(kind = kint) :: i_r, i_den, k +! +! + if(ir_density .le. 0) return + if(polytrope_param%polytrope_idx .le. 0.0d0) then + if(polytrope_param%num_density_list .le. 0) then + call read_and_alloc_step_field & + & (polytrope_param%density_file_name, & + & my_rank, t_IO, fld_IO, iend) +! + i_r = find_address_from_field_IO(radius_name, fld_IO) + i_den = find_address_from_field_IO(density_name, fld_IO) + write(*,*) 'i_den', i_den, i_r + call alloc_density_variation_list(fld_IO%nnod_IO, & + & polytrope_param) + polytrope_param%density_radius(1:fld_IO%nnod_IO) & + & = fld_IO%d_IO(1:fld_IO%nnod_IO,i_r) + polytrope_param%density_list(1:fld_IO%nnod_IO) & + & = fld_IO%d_IO(1:fld_IO%nnod_IO,i_den) + call dealloc_phys_data_IO(fld_IO) + call dealloc_phys_name_IO(fld_IO) + end if +! + call sph_radial_variation_from_list(sph_rj, r_2nd, & + & polytrope_param%num_density_list, & + & polytrope_param%density_radius, & + & polytrope_param%density_list, & + & radial_variation%n_point, radial_variation%d_fld(1,1), & + & radial_variation%d_fld(1,ir_density ), & + & radial_variation%d_fld(1,ir_density+1), r_itp) +! + call cal_sph_nod_gradient_1d(ione, sph_rj%nidx_rj(1), & + & sph_rj%nidx_rj(1), r_2nd%fdm(1)%dmat, & + & radial_variation%d_fld(2,ir_density+1), & + & radial_variation%d_fld(2,ir_density+2)) + radial_variation%d_fld(2,ir_density+1) = zero + k = sph_rj%nidx_rj(1) + 1 + radial_variation%d_fld(k,ir_density+2) = zero + else + call set_sph_polytrope_density & + & (sph_rj, polytrope_param, radial_variation%n_point, & + & radial_variation%d_fld(1,ir_density ), & + & radial_variation%d_fld(1,ir_density+1), & + & radial_variation%d_fld(1,ir_density+2)) + end if +! + end subroutine set_sph_radial_density +! +! ------------------------------------------------------------------- +! + subroutine set_sph_radial_diffusivity & + & (my_rank, radius_name, diffusivity_name, ir_diffusion, & + & sph_rj, r_2nd, diffuse_param, radial_variation, & + & r_itp, fld_IO) +! + use t_ctl_param_val_diffusion + use radial_interpolation + use const_diffusive_profile + use field_file_IO +! + integer, intent(in) :: my_rank + character(len=kchara), intent(in) :: radius_name + character(len=kchara), intent(in) :: diffusivity_name + integer(kind = kint), intent(in) :: ir_diffusion + type(sph_rj_grid), intent(in) :: sph_rj + type(fdm_matrices), intent(in) :: r_2nd + type(val_diffuse_parameters), intent(inout) :: diffuse_param +! + type(phys_data), intent(inout) :: radial_variation + type(sph_radial_interpolate), intent(inout) :: r_itp + type(field_IO), intent(inout) :: fld_IO +! + type(time_data) :: t_IO + integer(kind = kint) :: iend + integer(kind = kint) :: i_r, i_dif +! +! + if(ir_diffusion .le. 0) return + if(diffuse_param%num_diffusion_list .le. 0) then + call read_and_alloc_step_field & + & (diffuse_param%diffuse_file_name, & + & my_rank, t_IO, fld_IO, iend) +! + i_r = find_address_from_field_IO(radius_name, fld_IO) + i_dif = find_address_from_field_IO(diffusivity_name, fld_IO) + call alloc_val_diffuse_parameters(fld_IO%nnod_IO, & + & diffuse_param) + diffuse_param%diffusion_radius(1:fld_IO%nnod_IO) & + & = fld_IO%d_IO(1:fld_IO%nnod_IO,i_r) + diffuse_param%diffusion_list(1:fld_IO%nnod_IO) & + & = fld_IO%d_IO(1:fld_IO%nnod_IO,i_dif) + call dealloc_phys_data_IO(fld_IO) + call dealloc_phys_name_IO(fld_IO) + end if +! + call sph_radial_variation_from_list(sph_rj, r_2nd, & + & diffuse_param%num_diffusion_list, & + & diffuse_param%diffusion_radius, & + & diffuse_param%diffusion_list, & + & radial_variation%n_point, radial_variation%d_fld(1,1), & + & radial_variation%d_fld(1,ir_diffusion ), & + & radial_variation%d_fld(1,ir_diffusion+1), r_itp) +! + end subroutine set_sph_radial_diffusivity +! +! ------------------------------------------------------------------- +! ------------------------------------------------------------------- +! + integer(kind = kint) function find_address_from_field_IO & + & (target_name, fld_IO) +! + character(len = kchara), intent(in) :: target_name + type(field_IO), intent(in) :: fld_IO +! + integer(kind = kint) :: i_field, icou, i +! + i_field = 0 + icou = 0 + do i = 1, fld_IO%num_field_IO + if(fld_IO%fld_name(i) .eq. target_name) then + i_field = icou + 1 + exit + end if + icou = icou + fld_IO%num_comp_IO(i) + end do + if(i_field .le. 0) write(*,*) trim(target_name), & + & ' cannot be found...' + find_address_from_field_IO = i_field +! + end function find_address_from_field_IO +! +! ------------------------------------------------------------------- +! + subroutine set_sph_polytrope_density(sph_rj, polytrope_param, & + & n_point, rho_r, drho_norm, d2rho_norm) +! + use t_ctl_param_val_density +! + type(sph_rj_grid), intent(in) :: sph_rj + type(polytrope_parameters), intent(in) :: polytrope_param + integer(kind = kint), intent(in) :: n_point +! + real(kind = kreal), intent(inout) :: rho_r(n_point) + real(kind = kreal), intent(inout) :: drho_norm(n_point) + real(kind = kreal), intent(inout) :: d2rho_norm(n_point) +! + integer(kind = kint) :: k + real(kind = kreal) :: r_in, r_out, rho_in, rho_out + real(kind = kreal) :: beta, N_p, xi_0, p_idx + real(kind = kreal) :: c_0, c_1, xi_r, dxi_dr, d2xi_dr +! +! + p_idx = polytrope_param%polytrope_idx + r_in = polytrope_param%rho_bottom(1) + r_out = polytrope_param%rho_top(1) + rho_in = polytrope_param%rho_bottom(2) + rho_out = polytrope_param%rho_top(2) + beta = r_in / r_out + N_p = log(rho_in / rho_out) + xi_0 = (one + beta) / (one + beta * exp(N_p / p_idx)) + c_0 = (two * xi_0 - beta - one) / (one - beta) + c_1 = (one + beta) * (one - xi_0) / ((one - beta)**2) +! + do k = 1, sph_rj%nidx_rj(1) + xi_r = c_0 + c_1 * sph_rj%ar_1d_rj(k,1) + dxi_dr = - c_1 * sph_rj%ar_1d_rj(k,2) + d2xi_dr = two * c_1 * sph_rj%ar_1d_rj(k,2) & + & * sph_rj%ar_1d_rj(k,1) +! + rho_r(k+1) = xi_r**p_idx + drho_norm(k+1) = p_idx * dxi_dr / xi_r +! & = p_idx * xi_r**(p_idx-1.0d0) * dxi_dr / xi_r**p_idx +! + drho_norm(k+1) = p_idx * (d2xi_dr / xi_r & + & + (dxi_dr / xi_r)**2) + end do +! + end subroutine set_sph_polytrope_density +! +! ------------------------------------------------------------------- +! + subroutine sph_radial_variation_from_list & + & (sph_rj, r_2nd, n_list, radius_list, value_list, & + & n_point, radius, val_r, dval_norm, r_itp) +! + use radial_interpolation + use const_diffusive_profile + use cal_sph_exp_1st_diff +! + type(sph_rj_grid), intent(in) :: sph_rj + type(fdm_matrices), intent(in) :: r_2nd +! + integer(kind = kint), intent(in) :: n_list + real(kind = kreal), intent(in) :: radius_list(n_list) + real(kind = kreal), intent(in) :: value_list(n_list) + integer(kind = kint), intent(in) :: n_point + real(kind = kreal), intent(in) :: radius(n_point) +! + real(kind = kreal), intent(inout) :: val_r(n_point) + real(kind = kreal), intent(inout) :: dval_norm(n_point) + type(sph_radial_interpolate), intent(inout) :: r_itp +! + integer(kind = kint) :: k +! +! + call alloc_org_radius_interpolate(n_list, r_itp) + call alloc_radial_interpolate(n_point, r_itp) + call alloc_original_sph_data(n_list, r_itp) + + r_itp%source_radius(1:r_itp%nri_source) & + & = radius_list(1:r_itp%nri_source) + call cal_radial_interpolation_coef & + & (r_itp%nri_source, r_itp%source_radius, n_point, radius, & + & r_itp%kr_inner_source, r_itp%kr_outer_source, & + & r_itp%k_old2new_in, r_itp%k_old2new_out, & + & r_itp%coef_old2new_in) +! call check_sph_radial_interpolate & +! & (r_itp%nri_source, r_itp%source_radius, & +! & n_point, radius, r_itp) + call interpolate_radial_field(n_point, & + & r_itp%k_old2new_in, r_itp%k_old2new_out, & + & r_itp%coef_old2new_in, ione, & + & r_itp%nri_source, value_list(1), val_r(1)) + call dealloc_original_sph_data(r_itp) + call dealloc_radial_interpolate(r_itp) + call dealloc_org_radius_interpolate(r_itp) +! + call cal_sph_nod_gradient_1d(ione, sph_rj%nidx_rj(1), & + & sph_rj%nidx_rj(1), r_2nd%fdm(1)%dmat, val_r(2), dval_norm(2)) +! +!$omp parallel workshare + dval_norm(2:n_point-1) = dval_norm(2:n_point-1) & + & / val_r(2:n_point-1) +!$omp end parallel workshare +! + dval_norm(1) = zero + k = sph_rj%nidx_rj(1) + 1 + dval_norm(k) = zero +! + end subroutine sph_radial_variation_from_list +! +! ------------------------------------------------------------------- +! + end module set_sph_radial_variations diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/sph_trans_w_coriols.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/sph_trans_w_coriols.f90 index 705ff1c6..6199016a 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/sph_trans_w_coriols.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/sph_trans_w_coriols.f90 @@ -10,11 +10,11 @@ !! !!@verbatim !! subroutine sph_b_trans_w_coriolis & -!! & (sph, comms_sph, fl_prop, sph_bc_U, omega_sph, b_trns, & -!! & trans_p, gt_cor, trns_bwd, WK_leg, WK_FFTs_MHD, & -!! & cor_rlm, SR_sig, SR_r) +!! & (sph, comms_sph, fl_prop, sph_bc_U, omega_sph, & +!! & b_trns, f_trns, trans_p, gt_cor, trns_bwd, & +!! & WK_leg, WK_FFTs_MHD, cor_rlm, SR_sig, SR_r) !! subroutine sph_f_trans_w_coriolis & -!! & (sph, comms_sph, fl_prop, trans_p, cor_rlm, f_trns, & +!! & (sph, comms_sph, trans_p, cor_rlm, f_trns, & !! & trns_fwd, WK_leg, WK_FFTs_MHD, SR_sig, SR_r) !! type(sph_grids), intent(in) :: sph !! type(sph_comm_tables), intent(in) :: comms_sph @@ -33,9 +33,9 @@ !! !! subroutine sph_b_trans_licv(sph_rlm, comm_rlm, comm_rj, & !! & fl_prop, sph_bc_U, omega_sph, leg, gt_cor, & -!! & b_trns, trns_bwd, cor_rlm, SR_sig, SR_r) +!! & b_trns, f_trns, trns_bwd, cor_rlm, SR_sig, SR_r) !! subroutine sph_f_trans_licv(sph_rlm, comm_rlm, comm_rj, & -!! & fl_prop, cor_rlm, f_trns, trns_fwd, SR_sig, SR_r) +!! & cor_rlm, f_trns, trns_fwd, SR_sig, SR_r) !! type(sph_rlm_grid), intent(in) :: sph_rlm !! type(sph_comm_tbl), intent(in) :: comm_rlm !! type(sph_comm_tbl), intent(in) :: comm_rj @@ -107,9 +107,11 @@ module sph_trans_w_coriols ! ----------------------------------------------------------------------- ! subroutine sph_b_trans_w_coriolis & - & (sph, comms_sph, fl_prop, sph_bc_U, omega_sph, b_trns, & - & trans_p, gt_cor, trns_bwd, WK_leg, WK_FFTs_MHD, & - & cor_rlm, SR_sig, SR_r) + & (sph, comms_sph, fl_prop, sph_bc_U, omega_sph, & + & b_trns, f_trns, trans_p, gt_cor, trns_bwd, & + & WK_leg, WK_FFTs_MHD, cor_rlm, SR_sig, SR_r) +! + use cal_coriolis_rlm ! type(sph_grids), intent(in) :: sph type(sph_comm_tables), intent(in) :: comms_sph @@ -119,6 +121,7 @@ subroutine sph_b_trans_w_coriolis & type(parameters_4_sph_trans), intent(in) :: trans_p type(gaunt_coriolis_rlm), intent(in) :: gt_cor type(phys_address), intent(in) :: b_trns + type(phys_address), intent(in) :: f_trns ! type(spherical_transform_data), intent(inout) :: trns_bwd type(legendre_trns_works), intent(inout) :: WK_leg @@ -136,12 +139,12 @@ subroutine sph_b_trans_w_coriolis & if(iflag_SPH_time) call end_elapsed_time(ist_elapsed_SPH+1) if(iflag_SPH_time) call end_elapsed_time(ist_elapsed_SPH+10) ! - if(iflag_debug .gt. 0) write(*,*) 'sum_coriolis_rlm' + if(iflag_debug .gt. 0) write(*,*) 's_cal_coriolis_rlm' if(iflag_SMHD_time) call start_elapsed_time(ist_elapsed_SMHD+8) - call sum_rot_coriolis_rlm & + call s_cal_coriolis_rlm & & (trns_bwd%ncomp, sph%sph_rlm, comms_sph%comm_rlm, & - & fl_prop, sph_bc_U, omega_sph, b_trns, trans_p%leg, & - & gt_cor, SR_r%n_WR, SR_r%WR(1), cor_rlm) + & fl_prop, sph_bc_U, omega_sph, b_trns, f_trns, & + & trans_p%leg, gt_cor, SR_r%n_WR, SR_r%WR(1), cor_rlm) call finish_send_recv_sph(comms_sph%comm_rj, SR_sig) if(iflag_SMHD_time) call end_elapsed_time(ist_elapsed_SMHD+8) ! @@ -182,12 +185,13 @@ end subroutine sph_b_trans_w_coriolis ! ----------------------------------------------------------------------- ! subroutine sph_f_trans_w_coriolis & - & (sph, comms_sph, fl_prop, trans_p, cor_rlm, f_trns, & + & (sph, comms_sph, trans_p, cor_rlm, f_trns, & & trns_fwd, WK_leg, WK_FFTs_MHD, SR_sig, SR_r) +! + use cal_coriolis_rlm ! type(sph_grids), intent(in) :: sph type(sph_comm_tables), intent(in) :: comms_sph - type(fluid_property), intent(in) :: fl_prop type(parameters_4_sph_trans), intent(in) :: trans_p type(coriolis_rlm_data), intent(in) :: cor_rlm type(phys_address), intent(in) :: f_trns @@ -226,7 +230,7 @@ subroutine sph_f_trans_w_coriolis & if(iflag_debug .gt. 0) write(*,*) 'copy_coriolis_terms_rlm' if(iflag_SMHD_time) call start_elapsed_time(ist_elapsed_SMHD+8) call copy_coriolis_terms_rlm & - & (trns_fwd%ncomp, sph%sph_rlm, comms_sph%comm_rlm, fl_prop, & + & (trns_fwd%ncomp, sph%sph_rlm, comms_sph%comm_rlm, & & f_trns, cor_rlm, SR_r%n_WS, SR_r%WS(1)) if(iflag_SMHD_time) call end_elapsed_time(ist_elapsed_SMHD+8) ! @@ -245,7 +249,9 @@ end subroutine sph_f_trans_w_coriolis ! subroutine sph_b_trans_licv(sph_rlm, comm_rlm, comm_rj, & & fl_prop, sph_bc_U, omega_sph, leg, gt_cor, & - & b_trns, trns_bwd, cor_rlm, SR_sig, SR_r) + & b_trns, f_trns, trns_bwd, cor_rlm, SR_sig, SR_r) +! + use cal_coriolis_rlm ! type(sph_rlm_grid), intent(in) :: sph_rlm type(sph_comm_tbl), intent(in) :: comm_rlm @@ -256,6 +262,7 @@ subroutine sph_b_trans_licv(sph_rlm, comm_rlm, comm_rj, & type(legendre_4_sph_trans), intent(in) :: leg type(gaunt_coriolis_rlm), intent(in) :: gt_cor type(phys_address), intent(in) :: b_trns + type(phys_address), intent(in) :: f_trns type(spherical_transform_data), intent(in) :: trns_bwd ! type(coriolis_rlm_data), intent(inout) :: cor_rlm @@ -270,10 +277,10 @@ subroutine sph_b_trans_licv(sph_rlm, comm_rlm, comm_rj, & if(iflag_SPH_time) call end_elapsed_time(ist_elapsed_SPH+1) if(iflag_SPH_time) call end_elapsed_time(ist_elapsed_SPH+10) ! - if(iflag_debug .gt. 0) write(*,*) 'sum_rot_coriolis_rlm' + if(iflag_debug .gt. 0) write(*,*) 's_cal_coriolis_rlm' if(iflag_SMHD_time) call start_elapsed_time(ist_elapsed_SMHD+8) - call sum_rot_coriolis_rlm(trns_bwd%ncomp, sph_rlm, comm_rlm, & - & fl_prop, sph_bc_U, omega_sph, b_trns, leg, gt_cor, & + call s_cal_coriolis_rlm(trns_bwd%ncomp, sph_rlm, comm_rlm, & + & fl_prop, sph_bc_U, omega_sph, b_trns, f_trns, leg, gt_cor, & & SR_r%n_WR, SR_r%WR(1), cor_rlm) if(iflag_SMHD_time) call end_elapsed_time(ist_elapsed_SMHD+8) ! @@ -284,12 +291,13 @@ end subroutine sph_b_trans_licv ! ----------------------------------------------------------------------- ! subroutine sph_f_trans_licv(sph_rlm, comm_rlm, comm_rj, & - & fl_prop, cor_rlm, f_trns, trns_fwd, SR_sig, SR_r) + & cor_rlm, f_trns, trns_fwd, SR_sig, SR_r) +! + use cal_coriolis_rlm ! type(sph_rlm_grid), intent(in) :: sph_rlm type(sph_comm_tbl), intent(in) :: comm_rlm type(sph_comm_tbl), intent(in) :: comm_rj - type(fluid_property), intent(in) :: fl_prop type(coriolis_rlm_data), intent(in) :: cor_rlm type(phys_address), intent(in) :: f_trns type(spherical_transform_data), intent(in) :: trns_fwd @@ -300,8 +308,7 @@ subroutine sph_f_trans_licv(sph_rlm, comm_rlm, comm_rj, & ! if(iflag_SMHD_time) call start_elapsed_time(ist_elapsed_SMHD+8) if(iflag_debug .gt. 0) write(*,*) 'copy_coriolis_terms_rlm' - call copy_coriolis_terms_rlm & - & (trns_fwd%ncomp, sph_rlm, comm_rlm, fl_prop, & + call copy_coriolis_terms_rlm(trns_fwd%ncomp, sph_rlm, comm_rlm, & & f_trns, cor_rlm, SR_r%n_WS, SR_r%WS(1)) if(iflag_SMHD_time) call end_elapsed_time(ist_elapsed_SMHD+8) ! diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/sph_transforms_4_MHD.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/sph_transforms_4_MHD.f90 index 8a7b1e04..bb7c97f3 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/sph_transforms_4_MHD.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/sph_transforms_4_MHD.f90 @@ -9,8 +9,8 @@ !!@verbatim !! subroutine sph_back_trans_4_MHD(sph, comms_sph, fl_prop, & !! & sph_bc_U, omega_sph, trans_p, gt_cor, rj_fld, & -!! & b_trns, trns_bwd, WK_leg, WK_FFTs_MHD, cor_rlm, & -!! & SR_sig, SR_r) +!! & b_trns, f_trns, trns_bwd, WK_leg, WK_FFTs_MHD, & +!! & cor_rlm, SR_sig, SR_r) !! Input :: rj_fld !! Output :: trns_MHD, cor_rlm !! subroutine sph_pole_trans_4_MHD(sph, comms_sph, trans_p, rj_fld,& @@ -103,8 +103,8 @@ module sph_transforms_4_MHD ! subroutine sph_back_trans_4_MHD(sph, comms_sph, fl_prop, & & sph_bc_U, omega_sph, trans_p, gt_cor, rj_fld, & - & b_trns, trns_bwd, WK_leg, WK_FFTs_MHD, cor_rlm, & - & SR_sig, SR_r) + & b_trns, f_trns, trns_bwd, WK_leg, WK_FFTs_MHD, & + & cor_rlm, SR_sig, SR_r) ! use sph_trans_w_coriols use set_address_sph_trans_MHD @@ -119,6 +119,7 @@ subroutine sph_back_trans_4_MHD(sph, comms_sph, fl_prop, & type(gaunt_coriolis_rlm), intent(in) :: gt_cor type(phys_data), intent(in) :: rj_fld type(phys_address), intent(in) :: b_trns + type(phys_address), intent(in) :: f_trns ! type(spherical_transform_data), intent(inout) :: trns_bwd type(legendre_trns_works), intent(inout) :: WK_leg @@ -141,7 +142,7 @@ subroutine sph_back_trans_4_MHD(sph, comms_sph, fl_prop, & ! if(trns_bwd%ncomp .eq. 0) return call sph_b_trans_w_coriolis(sph, comms_sph, fl_prop, sph_bc_U, & - & omega_sph, b_trns, trans_p, gt_cor, & + & omega_sph, b_trns, f_trns, trans_p, gt_cor, & & trns_bwd, WK_leg, WK_FFTs_MHD, cor_rlm, SR_sig, SR_r) ! end subroutine sph_back_trans_4_MHD @@ -178,7 +179,7 @@ subroutine sph_forward_trans_4_MHD & ! if(trns_fwd%ncomp .eq. 0) return call sph_f_trans_w_coriolis & - & (sph, comms_sph, fl_prop, trans_p, cor_rlm, f_trns, trns_fwd, & + & (sph, comms_sph, trans_p, cor_rlm, f_trns, trns_fwd, & & WK_leg, WK_FFTs_MHD, SR_sig, SR_r) ! if(iflag_SPH_time) call start_elapsed_time(ist_elapsed_SPH+9) @@ -264,9 +265,10 @@ subroutine sph_transform_4_licv & ! call sph_b_trans_licv(sph_rlm, comm_rlm, comm_rj, fl_prop, & & sph_bc_U, omega_sph, trans_p%leg, gt_cor, & - & trns_MHD%b_trns, trns_MHD%backward, cor_rlm, SR_sig, SR_r) - call sph_f_trans_licv(sph_rlm, comm_rlm, comm_rj, fl_prop, & - & cor_rlm, trns_MHD%f_trns, trns_MHD%forward, SR_sig, SR_r) + & trns_MHD%b_trns, trns_MHD%f_trns, trns_MHD%backward, & + & cor_rlm, SR_sig, SR_r) + call sph_f_trans_licv(sph_rlm, comm_rlm, comm_rj, cor_rlm, & + & trns_MHD%f_trns, trns_MHD%forward, SR_sig, SR_r) ! call mhd_spectr_from_recvbuf(trans_p%iflag_SPH_recv, & & trns_MHD%forward, comm_rj, SR_r%n_WR, SR_r%WR(1), rj_fld) diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/sum_coriolis_terms_rlm.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/sum_coriolis_terms_rlm.f90 index 252c4cf0..f5a9d933 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/sum_coriolis_terms_rlm.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/sum_coriolis_terms_rlm.f90 @@ -53,6 +53,7 @@ !! (wsr) = wsr(jc,1,j3)*dw*uhb !! (wtr) = wtr(j3)*dw*utb !! +!! Horizontal componenet of the Coriolis term !! (wsh) = wsh(jc,j3)*dw*urb/r**2 !! + whh(jc,j3)*w*uhb/r**2 !! (wth) = wth(j3)*dw*utb/r**2 @@ -85,6 +86,7 @@ module sum_coriolis_terms_rlm ! use t_spheric_rlm_data use t_phys_address + use t_base_field_labels use t_poloidal_rotation use t_gaunt_coriolis_rlm ! @@ -124,7 +126,7 @@ subroutine select_sum_coriolis_rlm_10 & ! if(sph_rlm%istep_rlm(1) .eq. 1) then call sum_coriolis_rlm_10 & - & (b_trns, sph_rlm%nnod_rlm, sph_rlm%nidx_rlm, & + & (b_trns%base, sph_rlm%nnod_rlm, sph_rlm%nidx_rlm, & & sph_rlm%idx_gl_1d_rlm_j, sph_rlm%a_r_1d_rlm_r, & & omega_sph%ws_rlm, coef_cor, gt_cor%jgi_rlm, gt_cor%jei_rlm, & & gt_cor%sw_rlm, gt_cor%sr_rlm, gt_cor%tr_rlm, & @@ -133,7 +135,7 @@ subroutine select_sum_coriolis_rlm_10 & & pol_cor_rlm, hrz_cor_rlm, tor_cor_rlm) else call sum_coriolis_lrm_10 & - & (b_trns, sph_rlm%nnod_rlm, sph_rlm%nidx_rlm, & + & (b_trns%base, sph_rlm%nnod_rlm, sph_rlm%nidx_rlm, & & sph_rlm%idx_gl_1d_rlm_j, sph_rlm%a_r_1d_rlm_r, & & omega_sph%ws_rlm, coef_cor, gt_cor%jgi_rlm, gt_cor%jei_rlm, & & gt_cor%sw_rlm, gt_cor%sr_rlm, gt_cor%tr_rlm, & @@ -146,14 +148,14 @@ end subroutine select_sum_coriolis_rlm_10 ! ! ------------------------------------------------------------------ ! - subroutine sum_coriolis_lrm_10(b_trns, & + subroutine sum_coriolis_lrm_10(t_base, & & nnod_rlm, nidx_rlm, idx_gl_1d_rlm_j, a_r_1d_rlm_r, & & omega_rlm, coef_cor, jgi_cor_rlm, jei_cor_rlm, & & sw_rlm, sr_rlm, tr_rlm, sh_rlm, hh_rlm, th_rlm, & & NB, n_WR, irev_sr_rlm, WR, & & pol_cor_rlm, hrz_cor_rlm, tor_cor_rlm) ! - type(phys_address), intent(in) :: b_trns + type(base_field_address), intent(in) :: t_base ! integer(kind = kint), intent(in) :: nnod_rlm integer(kind = kint), intent(in) :: nidx_rlm(2) @@ -204,15 +206,15 @@ subroutine sum_coriolis_lrm_10(b_trns, & ir_21 = irev_sr_rlm(i21) - 1 ir_12 = irev_sr_rlm(i12) - 1 ! - sp_vr_l1 = WR(b_trns%base%i_velo + NB*ir_12) - sp_vh_l1 = WR(b_trns%base%i_velo+1 + NB*ir_12) - sp_vt_k1 = WR(b_trns%base%i_velo+2 + NB*ir_11) - sp_vt_k2 = WR(b_trns%base%i_velo+2 + NB*ir_21) - sp_dvp_k1 = WR(b_trns%base%i_velo+1 + NB*ir_11) - sp_dvp_k2 = WR(b_trns%base%i_velo+1 + NB*ir_21) - sp_vt_l1 = WR(b_trns%base%i_velo+2 + NB*ir_12) - sp_vp_k1 = WR(b_trns%base%i_velo + NB*ir_11) - sp_vp_k2 = WR(b_trns%base%i_velo + NB*ir_21) + sp_vr_l1 = WR(t_base%i_velo + NB*ir_12) + sp_vh_l1 = WR(t_base%i_velo+1 + NB*ir_12) + sp_vt_k1 = WR(t_base%i_velo+2 + NB*ir_11) + sp_vt_k2 = WR(t_base%i_velo+2 + NB*ir_21) + sp_dvp_k1 = WR(t_base%i_velo+1 + NB*ir_11) + sp_dvp_k2 = WR(t_base%i_velo+1 + NB*ir_21) + sp_vt_l1 = WR(t_base%i_velo+2 + NB*ir_12) + sp_vp_k1 = WR(t_base%i_velo + NB*ir_11) + sp_vp_k2 = WR(t_base%i_velo + NB*ir_21) ! pol_cor_rlm(i_rlm) & & = sr_rlm(1,j_rlm) * omega_rlm(k_rlm,1) * sp_vh_l1 & @@ -257,7 +259,7 @@ subroutine sum_coriolis_lrm_10(b_trns, & ! & jei_cor_rlm(j_rlm,1) i11 = j11 + (k_rlm-1)*nidx_rlm(2) ir_11 = irev_sr_rlm(i11) - 1 - sp_vt_k1 = WR(b_trns%base%i_velo+2 + NB*ir_11) + sp_vt_k1 = WR(t_base%i_velo+2 + NB*ir_11) ! pol_cor_rlm(i_rlm) & & = -(two/three) * omega_rlm(k_rlm,1) * sp_vt_k1 @@ -269,14 +271,14 @@ end subroutine sum_coriolis_lrm_10 !* !* ------------------------------------------------------------------ ! - subroutine sum_coriolis_rlm_10(b_trns, & + subroutine sum_coriolis_rlm_10(t_base, & & nnod_rlm, nidx_rlm, idx_gl_1d_rlm_j, a_r_1d_rlm_r, & & omega_rlm, coef_cor, jgi_cor_rlm, jei_cor_rlm, & & sw_rlm, sr_rlm, tr_rlm, sh_rlm, hh_rlm, th_rlm, & & NB, n_WR, irev_sr_rlm, WR, & & pol_cor_rlm, hrz_cor_rlm, tor_cor_rlm) ! - type(phys_address), intent(in) :: b_trns + type(base_field_address), intent(in) :: t_base ! integer(kind = kint), intent(in) :: nnod_rlm integer(kind = kint), intent(in) :: nidx_rlm(2) @@ -327,15 +329,15 @@ subroutine sum_coriolis_rlm_10(b_trns, & ir_21 = irev_sr_rlm(i21) - 1 ir_12 = irev_sr_rlm(i12) - 1 ! - sp_vr_l1 = WR(b_trns%base%i_velo + NB*ir_12) - sp_vh_l1 = WR(b_trns%base%i_velo+1 + NB*ir_12) - sp_vt_k1 = WR(b_trns%base%i_velo+2 + NB*ir_11) - sp_vt_k2 = WR(b_trns%base%i_velo+2 + NB*ir_21) - sp_dvp_k1 = WR(b_trns%base%i_velo+1 + NB*ir_11) - sp_dvp_k2 = WR(b_trns%base%i_velo+1 + NB*ir_21) - sp_vt_l1 = WR(b_trns%base%i_velo+2 + NB*ir_12) - sp_vp_k1 = WR(b_trns%base%i_velo + NB*ir_11) - sp_vp_k2 = WR(b_trns%base%i_velo + NB*ir_21) + sp_vr_l1 = WR(t_base%i_velo + NB*ir_12) + sp_vh_l1 = WR(t_base%i_velo+1 + NB*ir_12) + sp_vt_k1 = WR(t_base%i_velo+2 + NB*ir_11) + sp_vt_k2 = WR(t_base%i_velo+2 + NB*ir_21) + sp_dvp_k1 = WR(t_base%i_velo+1 + NB*ir_11) + sp_dvp_k2 = WR(t_base%i_velo+1 + NB*ir_21) + sp_vt_l1 = WR(t_base%i_velo+2 + NB*ir_12) + sp_vp_k1 = WR(t_base%i_velo + NB*ir_11) + sp_vp_k2 = WR(t_base%i_velo + NB*ir_21) ! pol_cor_rlm(i_rlm) & & = sr_rlm(1,j_rlm) * omega_rlm(k_rlm,1) * sp_vh_l1 & @@ -379,7 +381,7 @@ subroutine sum_coriolis_rlm_10(b_trns, & ! & jei_cor_rlm(j_rlm,1) i11 = (j11-1)*nidx_rlm(1) + k_rlm ir_11 = irev_sr_rlm(i11) - 1 - sp_vt_k1 = WR(b_trns%base%i_velo+2 + NB*ir_11) + sp_vt_k1 = WR(t_base%i_velo+2 + NB*ir_11) ! pol_cor_rlm(i_rlm) & & = -(two/three) * omega_rlm(k_rlm,1) * sp_vt_k1 diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/sum_rot_coriolis_terms_rlm.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/sum_rot_coriolis_terms_rlm.f90 index d766bca8..8500dc35 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/sum_rot_coriolis_terms_rlm.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/sum_rot_coriolis_terms_rlm.f90 @@ -82,11 +82,14 @@ module sum_rot_coriolis_terms_rlm ! use t_spheric_rlm_data use t_phys_address + use t_base_field_labels use t_poloidal_rotation use t_schmidt_poly_on_rtm use t_gaunt_coriolis_rlm ! implicit none +! + private :: sum_rot_coriolis_rlm_10, sum_rot_coriolis_lrm_10 ! ! ------------------------------------------------------------------ ! @@ -118,13 +121,13 @@ subroutine select_sum_rot_coriolis_rlm_10(b_trns, sph_rlm, leg, & ! ! if(sph_rlm%istep_rlm(1) .eq. 1) then - call sum_rot_coriolis_rlm_10(b_trns, & + call sum_rot_coriolis_rlm_10(b_trns%base, & & sph_rlm%nnod_rlm, sph_rlm%nidx_rlm, sph_rlm%a_r_1d_rlm_r, & & leg%g_sph_rlm, omega_sph%ws_rlm, coef_cor, & & gt_cor%jgi_rlm, gt_cor%jei_rlm, gt_cor%sw_rlm, gt_cor%tw_rlm, & & NB, n_WR, irev_sr_rlm, WR, d_rotp_cor_rlm, d_rott_cor_rlm) else - call sum_rot_coriolis_lrm_10(b_trns, & + call sum_rot_coriolis_lrm_10(b_trns%base, & & sph_rlm%nnod_rlm, sph_rlm%nidx_rlm, sph_rlm%a_r_1d_rlm_r, & & leg%g_sph_rlm, omega_sph%ws_rlm, coef_cor, & & gt_cor%jgi_rlm, gt_cor%jei_rlm, gt_cor%sw_rlm, gt_cor%tw_rlm, & @@ -136,12 +139,12 @@ end subroutine select_sum_rot_coriolis_rlm_10 ! ------------------------------------------------------------------ ! ------------------------------------------------------------------ ! - subroutine sum_rot_coriolis_lrm_10(b_trns, nnod_rlm, nidx_rlm, & + subroutine sum_rot_coriolis_lrm_10(t_base, nnod_rlm, nidx_rlm, & & a_r_1d_rlm_r, g_sph_rlm, omega_rlm, coef_cor, & & jgi_cor_rlm, jei_cor_rlm, sw_rlm, tw_rlm, NB, n_WR, & & irev_sr_rlm, WR, d_rotp_cor_rlm, d_rott_cor_rlm) ! - type(phys_address), intent(in) :: b_trns + type(base_field_address), intent(in) :: t_base ! integer(kind = kint), intent(in) :: nnod_rlm integer(kind = kint), intent(in) :: nidx_rlm(2) @@ -188,22 +191,22 @@ subroutine sum_rot_coriolis_lrm_10(b_trns, nnod_rlm, nidx_rlm, & ir_21 = irev_sr_rlm(i21) - 1 ir_12 = irev_sr_rlm(i12) - 1 ! - sp_dvp_k1 = WR(b_trns%base%i_velo+1 + NB*ir_11) - sp_dvp_k2 = WR(b_trns%base%i_velo+1 + NB*ir_21) - sp_vt_l1 = WR(b_trns%base%i_velo+2 + NB*ir_12) - sp_vp_k1 = WR(b_trns%base%i_velo + NB*ir_11) - sp_vp_k2 = WR(b_trns%base%i_velo + NB*ir_21) + sp_dvp_k1 = WR(t_base%i_velo+1 + NB*ir_11) + sp_dvp_k2 = WR(t_base%i_velo+1 + NB*ir_21) + sp_vt_l1 = WR(t_base%i_velo+2 + NB*ir_12) + sp_vp_k1 = WR(t_base%i_velo + NB*ir_11) + sp_vp_k2 = WR(t_base%i_velo + NB*ir_21) ! sp_d2vp_l1 = (a_r_1d_rlm_r(k_rlm)*a_r_1d_rlm_r(k_rlm) & - & * g_sph_rlm(j_rlm,3)*WR(b_trns%base%i_velo + NB*ir_12) & - & - WR(b_trns%base%i_vort+2 + NB*ir_12)) - sp_vp_l1 = WR(b_trns%base%i_velo+NB*ir_12) - sp_wp_k1 = WR(b_trns%base%i_vort+NB*ir_11) - sp_wp_k2 = WR(b_trns%base%i_vort+NB*ir_21) - sp_dwp_k1 = (WR(b_trns%base%i_vort+1+NB*ir_11) & - & - two*a_r_1d_rlm_r(k_rlm)*WR(b_trns%base%i_vort+NB*ir_11)) - sp_dwp_k2 = (WR(b_trns%base%i_vort+1+NB*ir_21) & - & - two*a_r_1d_rlm_r(k_rlm)*WR(b_trns%base%i_vort+NB*ir_21)) + & * g_sph_rlm(j_rlm,3)*WR(t_base%i_velo + NB*ir_12) & + & - WR(t_base%i_vort+2 + NB*ir_12)) + sp_vp_l1 = WR(t_base%i_velo+NB*ir_12) + sp_wp_k1 = WR(t_base%i_vort+NB*ir_11) + sp_wp_k2 = WR(t_base%i_vort+NB*ir_21) + sp_dwp_k1 = (WR(t_base%i_vort+1+NB*ir_11) & + & - two*a_r_1d_rlm_r(k_rlm)*WR(t_base%i_vort+NB*ir_11)) + sp_dwp_k2 = (WR(t_base%i_vort+1+NB*ir_21) & + & - two*a_r_1d_rlm_r(k_rlm)*WR(t_base%i_vort+NB*ir_21)) ! d_rotp_cor_rlm(i_rlm) & & = sw_rlm(1,1,j_rlm) * omega_rlm(k_rlm,0) * sp_dvp_k1 & @@ -235,12 +238,12 @@ end subroutine sum_rot_coriolis_lrm_10 !* !* ------------------------------------------------------------------ ! - subroutine sum_rot_coriolis_rlm_10(b_trns, nnod_rlm, nidx_rlm, & + subroutine sum_rot_coriolis_rlm_10(t_base, nnod_rlm, nidx_rlm, & & a_r_1d_rlm_r, g_sph_rlm, omega_rlm, coef_cor, & & jgi_cor_rlm, jei_cor_rlm, sw_rlm, tw_rlm, NB, n_WR, & & irev_sr_rlm, WR, d_rotp_cor_rlm, d_rott_cor_rlm) ! - type(phys_address), intent(in) :: b_trns + type(base_field_address), intent(in) :: t_base ! integer(kind = kint), intent(in) :: nnod_rlm integer(kind = kint), intent(in) :: nidx_rlm(2) @@ -287,22 +290,22 @@ subroutine sum_rot_coriolis_rlm_10(b_trns, nnod_rlm, nidx_rlm, & ir_21 = irev_sr_rlm(i21) - 1 ir_12 = irev_sr_rlm(i12) - 1 ! - sp_dvp_k1 = WR(b_trns%base%i_velo+1 + NB*ir_11) - sp_dvp_k2 = WR(b_trns%base%i_velo+1 + NB*ir_21) - sp_vt_l1 = WR(b_trns%base%i_velo+2 + NB*ir_12) - sp_vp_k1 = WR(b_trns%base%i_velo + NB*ir_11) - sp_vp_k2 = WR(b_trns%base%i_velo + NB*ir_21) + sp_dvp_k1 = WR(t_base%i_velo+1 + NB*ir_11) + sp_dvp_k2 = WR(t_base%i_velo+1 + NB*ir_21) + sp_vt_l1 = WR(t_base%i_velo+2 + NB*ir_12) + sp_vp_k1 = WR(t_base%i_velo + NB*ir_11) + sp_vp_k2 = WR(t_base%i_velo + NB*ir_21) ! sp_d2vp_l1 = (a_r_1d_rlm_r(k_rlm)*a_r_1d_rlm_r(k_rlm) & - & * g_sph_rlm(j_rlm,3)*WR(b_trns%base%i_velo + NB*ir_12) & - & - WR(b_trns%base%i_vort+2 + NB*ir_12)) - sp_vp_l1 = WR(b_trns%base%i_velo+NB*ir_12) - sp_wp_k1 = WR(b_trns%base%i_vort+NB*ir_11) - sp_wp_k2 = WR(b_trns%base%i_vort+NB*ir_21) - sp_dwp_k1 = (WR(b_trns%base%i_vort+1+NB*ir_11) & - & - two*a_r_1d_rlm_r(k_rlm)*WR(b_trns%base%i_vort+NB*ir_11)) - sp_dwp_k2 = (WR(b_trns%base%i_vort+1+NB*ir_21) & - & - two*a_r_1d_rlm_r(k_rlm)*WR(b_trns%base%i_vort+NB*ir_21)) + & * g_sph_rlm(j_rlm,3)*WR(t_base%i_velo + NB*ir_12) & + & - WR(t_base%i_vort+2 + NB*ir_12)) + sp_vp_l1 = WR(t_base%i_velo+NB*ir_12) + sp_wp_k1 = WR(t_base%i_vort+NB*ir_11) + sp_wp_k2 = WR(t_base%i_vort+NB*ir_21) + sp_dwp_k1 = (WR(t_base%i_vort+1+NB*ir_11) & + & - two*a_r_1d_rlm_r(k_rlm)*WR(t_base%i_vort+NB*ir_11)) + sp_dwp_k2 = (WR(t_base%i_vort+1+NB*ir_21) & + & - two*a_r_1d_rlm_r(k_rlm)*WR(t_base%i_vort+NB*ir_21)) ! d_rotp_cor_rlm(i_rlm) & & = sw_rlm(1,1,j_rlm) * omega_rlm(k_rlm,0) * sp_dvp_k1 & diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/sum_rotation_of_forces.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/sum_rotation_of_forces.f90 index 133cd81a..361cc3e8 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/sum_rotation_of_forces.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/sum_rotation_of_forces.f90 @@ -8,12 +8,12 @@ !! !!@verbatim !! subroutine sum_forces_to_explicit & -!! & (fl_prop, ipol_exp, ipol_rot_frc, rj_fld) +!! & (fl_prop, ipol_exp, ipol_force, rj_fld) !! subroutine licv_forces_to_explicit & -!! & (fl_prop, ipol_exp, ipol_rot_frc, rj_fld) +!! & (fl_prop, ipol_exp, ipol_force, rj_fld) !! type(fluid_property), intent(in) :: fl_prop !! type(explicit_term_address), intent(in) :: ipol_exp -!! type(base_force_address), intent(in) :: ipol_rot_frc +!! type(base_force_address), intent(in) :: ipol_force !! type(phys_data), intent(inout) :: rj_fld !!@endverbatim ! @@ -41,81 +41,49 @@ module sum_rotation_of_forces !* ------------------------------------------------------------------ ! subroutine sum_forces_to_explicit & - & (fl_prop, ipol_exp, ipol_rot_frc, rj_fld) + & (fl_prop, ipol_exp, ipol_force, rj_fld) ! use copy_nodal_fields use cal_vorticity_terms_adams ! type(fluid_property), intent(in) :: fl_prop type(explicit_term_address), intent(in) :: ipol_exp - type(base_force_address), intent(in) :: ipol_rot_frc + type(base_force_address), intent(in) :: ipol_force type(phys_data), intent(inout) :: rj_fld ! ! - if( fl_prop%iflag_4_inertia & - & .and. fl_prop%iflag_4_gravity & - & .and. fl_prop%iflag_4_coriolis & - & .and. fl_prop%iflag_4_lorentz) then - call set_MHD_terms_to_force & - & (ipol_exp, ipol_rot_frc, ipol_rot_frc%i_buoyancy, & - & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) - else if( fl_prop%iflag_4_inertia & - & .and. (fl_prop%iflag_4_gravity .eqv. .FALSE.) & - & .and. fl_prop%iflag_4_composit_buo & - & .and. fl_prop%iflag_4_coriolis & - & .and. fl_prop%iflag_4_lorentz) then - call set_MHD_terms_to_force & - & (ipol_exp, ipol_rot_frc, ipol_rot_frc%i_comp_buo, & - & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) - else if( fl_prop%iflag_4_inertia & - & .and. fl_prop%iflag_4_gravity & - & .and. fl_prop%iflag_4_coriolis & - & .and. (fl_prop%iflag_4_lorentz .eqv. .FALSE.)) then - call set_rot_cv_terms_to_force & - & (ipol_exp, ipol_rot_frc, ipol_rot_frc%i_buoyancy, & - & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) - else if( fl_prop%iflag_4_inertia & - & .and. (fl_prop%iflag_4_gravity .eqv. .FALSE.) & - & .and. fl_prop%iflag_4_composit_buo & - & .and. fl_prop%iflag_4_coriolis & - & .and. (fl_prop%iflag_4_lorentz .eqv. .FALSE.)) then - call set_rot_cv_terms_to_force & - & (ipol_exp, ipol_rot_frc, ipol_rot_frc%i_comp_buo, & - & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) - else - call clear_field_data & - & (rj_fld, n_vector, ipol_exp%i_forces) + call clear_field_data & + & (rj_fld, n_vector, ipol_exp%i_forces) ! !$omp parallel - if(fl_prop%iflag_4_inertia) then - call add_rot_advection_to_force & - & (ipol_exp%i_forces, ipol_rot_frc%i_m_advect, & + if(fl_prop%flag_inertia) then + call subtract_advection_to_force & + & (ipol_exp%i_forces, ipol_force%i_m_advect, & & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) end if ! - if(fl_prop%iflag_4_coriolis) then - call add_each_force_to_rot_forces & - & (ipol_exp%i_forces, ipol_rot_frc%i_Coriolis, & - & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) - end if - if(fl_prop%iflag_4_lorentz) then - call add_each_force_to_rot_forces & - & (ipol_exp%i_forces, ipol_rot_frc%i_lorentz, & - & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) - end if + if(fl_prop%flag_coriolis) then + call add_each_force_to_forces & + & (ipol_exp%i_forces, ipol_force%i_Coriolis, & + & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) + end if + if(fl_prop%flag_lorentz) then + call add_each_force_to_forces & + & (ipol_exp%i_forces, ipol_force%i_lorentz, & + & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) + end if ! - if(fl_prop%iflag_4_gravity) then - call add_buoyancy_to_vort_force & - & (ipol_exp%i_forces, ipol_rot_frc%i_buoyancy, & - & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) - end if - if(fl_prop%iflag_4_composit_buo) then - call add_buoyancy_to_vort_force & - & (ipol_exp%i_forces, ipol_rot_frc%i_comp_buo, & - & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) - end if -!$omp end parallel + if(fl_prop%flag_thermal_buoyancy) then + call add_each_force_to_forces & + & (ipol_exp%i_forces, ipol_force%i_buoyancy, & + & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) end if + if(fl_prop%flag_comp_buoyancy) then + call add_each_force_to_forces & + & (ipol_exp%i_forces, ipol_force%i_comp_buo, & + & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) + end if +!$omp end parallel ! end subroutine sum_forces_to_explicit ! @@ -123,31 +91,32 @@ end subroutine sum_forces_to_explicit !* ------------------------------------------------------------------ !* subroutine licv_forces_to_explicit & - & (fl_prop, ipol_exp, ipol_rot_frc, rj_fld) + & (fl_prop, ipol_exp, ipol_force, rj_fld) ! use m_phys_constants use cal_vorticity_terms_adams ! type(fluid_property), intent(in) :: fl_prop type(explicit_term_address), intent(in) :: ipol_exp - type(base_force_address), intent(in) :: ipol_rot_frc + type(base_force_address), intent(in) :: ipol_force ! type(phys_data), intent(inout) :: rj_fld ! ! !$omp parallel - if(fl_prop%iflag_4_coriolis) then - call add_each_force_to_rot_forces & - & (ipol_exp%i_forces, ipol_rot_frc%i_Coriolis, & + if(fl_prop%flag_coriolis) then + call add_each_force_to_forces & + & (ipol_exp%i_forces, ipol_force%i_Coriolis, & & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) end if - if(fl_prop%iflag_4_gravity) then - call add_buoyancy_to_vort_force & - & (ipol_exp%i_forces, ipol_rot_frc%i_buoyancy, & + if(fl_prop%flag_thermal_buoyancy) then + call add_each_force_to_forces & + & (ipol_exp%i_forces, ipol_force%i_buoyancy, & & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) - else if(fl_prop%iflag_4_composit_buo) then - call add_buoyancy_to_vort_force & - & (ipol_exp%i_forces, ipol_rot_frc%i_comp_buo, & + end if + if(fl_prop%flag_comp_buoyancy) then + call add_each_force_to_forces & + & (ipol_exp%i_forces, ipol_force%i_comp_buo, & & rj_fld%n_point, rj_fld%ntot_phys, rj_fld%d_fld) end if !$omp end parallel diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/t_MHD_step_parameter.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/t_MHD_step_parameter.f90 index e49757c8..ac9a24a7 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/t_MHD_step_parameter.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/t_MHD_step_parameter.f90 @@ -83,10 +83,10 @@ subroutine s_set_control_4_time_steps(mr_ctl, tctl, MHD_step) call set_initial_field_id & & (mr_ctl%restart_flag_ctl, tctl, MHD_step%init_d%time) ! - MHD_step%flex_p%iflag_flexible_step = iflag_fixed_step + MHD_step%time_d%flag_flex_step = .FALSE. if(tctl%flexible_step_ctl%iflag .gt. 0 & & .and. yes_flag(tctl%flexible_step_ctl%charavalue)) then - MHD_step%flex_p%iflag_flexible_step = iflag_flex_step + MHD_step%time_d%flag_flex_step = .TRUE. end if ! if (tctl%dt_ctl%iflag .eq. 0) then @@ -95,13 +95,10 @@ subroutine s_set_control_4_time_steps(mr_ctl, tctl, MHD_step) else MHD_step%init_d%dt = tctl%dt_ctl%realvalue end if -! - call set_control_flex_time_steps & - & (tctl, MHD_step%init_d, MHD_step%flex_p) ! ! parameters for time evolution ! - if(MHD_step%flex_p%iflag_flexible_step .eq. iflag_flex_step) then + if(MHD_step%time_d%flag_flex_step) then if (iflag_debug .ge. iflag_routine_msg) & & write(*,*) 'set_flex_time_step_controls' call set_flex_time_step_controls(tctl, MHD_step) @@ -110,7 +107,12 @@ subroutine s_set_control_4_time_steps(mr_ctl, tctl, MHD_step) & write(*,*) 'set_fixed_time_step_controls' call set_fixed_time_step_controls(tctl, MHD_step) end if + MHD_step%init_d%flag_flex_step = MHD_step%time_d%flag_flex_step +! + call set_control_flex_time_steps & + & (tctl, MHD_step%init_d, MHD_step%flex_p) ! + if (MHD_step%finish_d%i_end_step .eq. -1) then if (tctl%elapsed_time_ctl%iflag .eq. 0) then e_message & diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/t_SPH_MHD_model_data.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/t_SPH_MHD_model_data.f90 index 2ea685d0..0cc5c403 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/t_SPH_MHD_model_data.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/t_SPH_MHD_model_data.f90 @@ -16,6 +16,7 @@ module t_SPH_MHD_model_data use m_precision use t_control_parameter use t_poloidal_rotation + use t_phys_data use t_radial_reference_field use t_boundary_data_sph_MHD use t_bc_data_list @@ -41,6 +42,9 @@ module t_SPH_MHD_model_data type(MHD_BC_lists) :: MHD_BC !> Structures for boundary conditions type(boundary_spectra) :: bc_IO +! +!> Radial variations + type(phys_data) :: radial_variation end type SPH_MHD_model_data ! end module t_SPH_MHD_model_data diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/t_SPH_MHD_zmean_sections.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/t_SPH_MHD_zmean_sections.f90 index c612a3e3..f93be083 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/t_SPH_MHD_zmean_sections.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/t_SPH_MHD_zmean_sections.f90 @@ -7,16 +7,18 @@ !>@brief Make zonal mean sections !! !!@verbatim -!! subroutine init_zonal_mean_sections(viz_step, geofem, edge_comm,& -!! & nod_fld, zm_sects, zmeans, m_SR) +!! subroutine init_zonal_mean_sections(elps_SECT, viz_step, & +!! & geofem, edge_comm, nod_fld, zm_sects, zmeans, m_SR) +!! type(elapsed_labels_4_SECTIONS), intent(in) :: elps_SECT !! type(VIZ_step_params), intent(in) :: viz_step !! type(mesh_data), intent(in) :: geofem !! type(phys_data), intent(in) :: nod_fld !! type(sph_dynamo_section_controls), intent(inout) :: zm_sects !! type(sph_zonal_mean_sectioning), intent(inout) :: zmeans !! type(mesh_SR), intent(inout) :: m_SR -!! subroutine SPH_MHD_zmean_sections(viz_step, time_d, & +!! subroutine SPH_MHD_zmean_sections(elps_SECT, viz_step, time_d, & !! & sph, geofem, WK, nod_fld, zmeans, m_SR) +!! type(elapsed_labels_4_SECTIONS), intent(in) :: elps_SECT !! type(VIZ_step_params), intent(in) :: viz_step !! type(time_data), intent(in) :: time_d !! type(sph_grids), intent(in) :: sph @@ -33,7 +35,6 @@ module t_SPH_MHD_zmean_sections ! use m_machine_parameter use m_work_time - use m_elapsed_labels_4_VIZ use calypso_mpi ! use t_time_data @@ -45,6 +46,7 @@ module t_SPH_MHD_zmean_sections use t_cross_section use t_mesh_SR use t_VIZ_step_parameter + use t_elapsed_labels_4_SECTIONS ! implicit none ! @@ -64,11 +66,12 @@ module t_SPH_MHD_zmean_sections ! ! --------------------------------------------------------------------- ! - subroutine init_zonal_mean_sections(viz_step, geofem, edge_comm, & - & nod_fld, zm_sects, zmeans, m_SR) + subroutine init_zonal_mean_sections(elps_SECT, viz_step, & + & geofem, edge_comm, nod_fld, zm_sects, zmeans, m_SR) ! use t_control_data_dynamo_sects ! + type(elapsed_labels_4_SECTIONS), intent(in) :: elps_SECT type(VIZ_step_params), intent(in) :: viz_step type(mesh_data), intent(in) :: geofem type(communication_table), intent(in) :: edge_comm @@ -79,25 +82,30 @@ subroutine init_zonal_mean_sections(viz_step, geofem, edge_comm, & type(mesh_SR), intent(inout) :: m_SR ! ! - if(iflag_VIZ_time) call start_elapsed_time(ist_elapsed_VIZ+1) + if(elps_SECT%flag_elapsed_S) & + & call start_elapsed_time(elps_SECT%ist_elapsed_S+1) call SECTIONING_initialize & - & (viz_step%PSF_t%increment, geofem, edge_comm, nod_fld, & - & zm_sects%zm_psf_ctls, zmeans%zm_psf, m_SR%SR_sig, m_SR%SR_il) - call SECTIONING_initialize(viz_step%PSF_t%increment, & + & (viz_step%PSF_t%increment, elps_SECT%elps_PSF, & + & geofem, edge_comm, nod_fld, zm_sects%zm_psf_ctls, & + & zmeans%zm_psf, m_SR%SR_sig, m_SR%SR_il) + call SECTIONING_initialize & + & (viz_step%PSF_t%increment, elps_SECT%elps_PSF, & & geofem, edge_comm, nod_fld, zm_sects%zRMS_psf_ctls, & & zmeans%zrms_psf, m_SR%SR_sig, m_SR%SR_il) - if(iflag_VIZ_time) call end_elapsed_time(ist_elapsed_VIZ+1) + if(elps_SECT%flag_elapsed_S) & + & call end_elapsed_time(elps_SECT%ist_elapsed_S+1) ! end subroutine init_zonal_mean_sections ! ! --------------------------------------------------------------------- ! - subroutine SPH_MHD_zmean_sections(viz_step, time_d, & + subroutine SPH_MHD_zmean_sections(elps_SECT, viz_step, time_d, & & sph, geofem, WK, nod_fld, zmeans, m_SR) ! use FEM_analyzer_sph_MHD use nod_phys_send_recv ! + type(elapsed_labels_4_SECTIONS), intent(in) :: elps_SECT type(VIZ_step_params), intent(in) :: viz_step type(sph_grids), intent(in) :: sph ! @@ -110,23 +118,24 @@ subroutine SPH_MHD_zmean_sections(viz_step, time_d, & type(mesh_SR), intent(inout) :: m_SR ! ! - call SPH_MHD_zonal_mean_section(viz_step, time_d, sph, geofem, & - & nod_fld, zmeans%zm_psf, m_SR) - call SPH_MHD_zonal_RMS_section(viz_step, time_d, sph, geofem, WK, & - & nod_fld, zmeans%zrms_psf, m_SR) + call SPH_MHD_zonal_mean_section(elps_SECT, viz_step, time_d, & + & sph, geofem, nod_fld, zmeans%zm_psf, m_SR) + call SPH_MHD_zonal_RMS_section(elps_SECT, viz_step, time_d, & + & sph, geofem, WK, nod_fld, zmeans%zrms_psf, m_SR) ! end subroutine SPH_MHD_zmean_sections ! ! --------------------------------------------------------------------- ! --------------------------------------------------------------------- ! - subroutine SPH_MHD_zonal_mean_section(viz_step, time_d, & - & sph, geofem, nod_fld, zm_psf, m_SR) + subroutine SPH_MHD_zonal_mean_section & + & (elps_SECT, viz_step, time_d, sph, geofem, nod_fld, & + & zm_psf, m_SR) ! - use m_elapsed_labels_4_VIZ use sph_rtp_zonal_rms_data use nod_phys_send_recv ! + type(elapsed_labels_4_SECTIONS), intent(in) :: elps_SECT type(VIZ_step_params), intent(in) :: viz_step type(sph_grids), intent(in) :: sph ! @@ -149,25 +158,28 @@ subroutine SPH_MHD_zonal_mean_section(viz_step, time_d, & & m_SR%v_sol, m_SR%SR_sig, m_SR%SR_r) ! if(zm_psf%num_psf .gt. 0) then - if(iflag_VIZ_time) call start_elapsed_time(ist_elapsed_VIZ+2) + if(elps_SECT%flag_elapsed_S) & + & call start_elapsed_time(elps_SECT%ist_elapsed_S+2) if (iflag_debug.gt.0) write(*,*) 'SECTIONING_visualize zmean' call SECTIONING_visualize & - & (viz_step%istep_psf, time_d, geofem, nod_fld, zm_psf) - if(iflag_VIZ_time) call end_elapsed_time(ist_elapsed_VIZ+2) + & (viz_step%istep_psf, elps_SECT%elps_PSF, & + & time_d, geofem, nod_fld, zm_psf) + if(elps_SECT%flag_elapsed_S) & + & call end_elapsed_time(elps_SECT%ist_elapsed_S+2) end if ! end subroutine SPH_MHD_zonal_mean_section ! ! --------------------------------------------------------------------- ! - subroutine SPH_MHD_zonal_RMS_section(viz_step, time_d, sph, & - & geofem, WK, nod_fld, zrms_psf, m_SR) + subroutine SPH_MHD_zonal_RMS_section(elps_SECT, viz_step, time_d, & + & sph, geofem, WK, nod_fld, zrms_psf, m_SR) ! - use m_elapsed_labels_4_VIZ use FEM_analyzer_sph_MHD use sph_rtp_zonal_rms_data use nod_phys_send_recv ! + type(elapsed_labels_4_SECTIONS), intent(in) :: elps_SECT type(VIZ_step_params), intent(in) :: viz_step type(sph_grids), intent(in) :: sph ! @@ -192,11 +204,14 @@ subroutine SPH_MHD_zonal_RMS_section(viz_step, time_d, sph, & & m_SR%v_sol, m_SR%SR_sig, m_SR%SR_r) ! if(zrms_psf%num_psf .gt. 0) then - if(iflag_VIZ_time) call start_elapsed_time(ist_elapsed_VIZ+2) + if(elps_SECT%flag_elapsed_S) & + & call start_elapsed_time(elps_SECT%ist_elapsed_S+2) if (iflag_debug.gt.0) write(*,*) 'SECTIONING_visualize RMS' call SECTIONING_visualize & - & (viz_step%istep_psf, time_d, geofem, nod_fld, zrms_psf) - if(iflag_VIZ_time) call end_elapsed_time(ist_elapsed_VIZ+2) + & (viz_step%istep_psf, elps_SECT%elps_PSF, & + & time_d, geofem, nod_fld, zrms_psf) + if(elps_SECT%flag_elapsed_S) & + & call end_elapsed_time(elps_SECT%ist_elapsed_S+2) end if ! end subroutine SPH_MHD_zonal_RMS_section diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/t_boundary_data_sph_MHD.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/t_boundary_data_sph_MHD.f90 index 3dc9a7b5..97314ac3 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/t_boundary_data_sph_MHD.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/t_boundary_data_sph_MHD.f90 @@ -28,7 +28,16 @@ module t_boundary_data_sph_MHD use t_boundary_params_sph_MHD use t_boundary_sph_spectr use t_coef_fdm2_MHD_boundaries - use t_coef_fdm4_MHD_boundaries + use t_coef_fdm4_zero_vpol_ICB + use t_coef_fdm4_free_vpol_ICB + use t_coef_fdm4_zero_vpol_CMB + use t_coef_fdm4_free_vpol_CMB + use t_coef_fdm4_vpol_centre + use t_coef_fdm3_n2e_zero_vp_ICB + use t_coef_fdm3_n2e_free_vp_ICB + use t_coef_fdm3_n2e_zero_vp_CMB + use t_coef_fdm3_n2e_free_vp_CMB + use t_coef_fdm3_n2e_zero_vp_CTR use t_time_data use t_spheric_parameter use t_control_parameter @@ -58,20 +67,34 @@ module t_boundary_data_sph_MHD ! !> Structure for FDM matrix of center type(fdm2_center_mat) :: fdm2_center +!> Structure for FDM matrix of free slip boundary at center + type(fdm3_n2e_CTR_vpol) :: fdm3e_center +!> Structure for FDM matrix of free slip boundary at center + type(fdm4_centre_vpol) :: fdm4_center + !> Structure for FDM matrix of free slip boundary at ICB type(fdm2_free_slip) :: fdm2_free_ICB +!> Structure for FDM matrix at ICB element + type(fdm3_n2e_ICB_zero_vpol) :: fdm3e_vp0_ICB +!> Structure for FDM matrix of free slip boundary at ICB element + type(fdm3_n2e_ICB_free_vpol) :: fdm3e_free_ICB +! !> Structure for FDM matrix of free slip boundary at CMB type(fdm2_free_slip) :: fdm2_free_CMB +!> Structure for FDM matrix at CMB element with zero poloidal + type(fdm3_n2e_CMB_zero_vpol) :: fdm3e_vp0_CMB +!> Structure for FDM matrix of free slip boundary at CMB element + type(fdm3_n2e_CMB_free_vpol) :: fdm3e_free_CMB ! !> Structure for 4th order FDM matrix of non-slip boundary at ICB - type(fdm4_ICB_vpol) :: fdm4_noslip_ICB + type(fdm4_ICB_zero_vpol) :: fdm4_noslip_ICB !> Structure for 4th order FDM matrix of free slip boundary at ICB - type(fdm4_ICB_vpol) :: fdm4_free_ICB + type(fdm4_ICB_free_vpol) :: fdm4_free_ICB ! !> Structure for 4th order FDM matrix of non-slip boundary at CMB - type(fdm4_CMB_vpol) :: fdm4_noslip_CMB + type(fdm4_CMB_zero_vpol) :: fdm4_noslip_CMB !> Structure for 4th order FDM matrix of free slip boundary at CMB - type(fdm4_CMB_vpol) :: fdm4_free_CMB + type(fdm4_CMB_free_vpol) :: fdm4_free_vp_CMB end type sph_MHD_boundary_data ! ! ---------------------------------------------------------------------- diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/t_coef_fdm2_MHD_boundaries.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/t_coef_fdm2_MHD_boundaries.f90 index 029891c1..843f0ec1 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/t_coef_fdm2_MHD_boundaries.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/t_coef_fdm2_MHD_boundaries.f90 @@ -8,10 +8,14 @@ !! at CMB with free slip boundary !! !!@verbatim -!! subroutine check_coef_fdm_free_slip(fdm2_free_mat) +!! subroutine check_fdm_coef_free_slip_ICB(id_file, fdm2_free_mat) +!! integer(kind = kint), intent(in) :: id_file +!! type(fdm2_free_slip), intent(in) :: fdm2_free_mat +!! subroutine check_fdm_coef_free_slip_CMB(id_file, fdm2_free_mat) +!! integer(kind = kint), intent(in) :: id_file !! type(fdm2_free_slip), intent(in) :: fdm2_free_mat !! subroutine check_coef_fdm_fix_dr_2ctr(fdm2_center) -!! type(fdm4_ICB_vpol), intent(in) :: fdm2_center +!! type(fdm2_ICB_vpol), intent(in) :: fdm2_center !! !! Matrix to evaluate radial derivative of poloidal velocity !! at CMB with free slip boundary @@ -128,29 +132,57 @@ module t_coef_fdm2_MHD_boundaries ! ! ----------------------------------------------------------------------- ! - subroutine check_coef_fdm_free_slip(fdm2_free_mat) + subroutine check_fdm_coef_free_slip_ICB(id_file, fdm2_free_mat) ! + integer(kind = kint), intent(in) :: id_file type(fdm2_free_slip), intent(in) :: fdm2_free_mat ! ! - write(50,*) ' fdm2_free_mat%dmat_vp' - write(50,*) ' mat_fdm11, mat_fdm12' - write(50,'(1p9E25.15e3)') fdm2_free_mat%dmat_vp(-1:0,1) - write(50,*) ' mat_fdm21, mat_fdm22' - write(50,'(1p9E25.15e3)') fdm2_free_mat%dmat_vp(-1:0,2) - write(50,*) ' mat_fdm31, mat_fdm32' - write(50,'(1p9E25.15e3)') fdm2_free_mat%dmat_vp(-1:0,3) + write(id_file,*) ' fdm2_free_mat%dmat_vp at ICB' + write(id_file,*) ' no delivative dmat_vp(0,1), dmat_vp(1,1)' + write(id_file,'(1p9E25.15e3)') fdm2_free_mat%dmat_vp(0:1,1) + write(id_file,*) ' first delivative dmat_vp(0,2), dmat_vp(1,2)' + write(id_file,'(1p9E25.15e3)') fdm2_free_mat%dmat_vp(0:1,2) + write(id_file,*) ' second delivative dmat_vp(0,3), dmat_vp(1,3)' + write(id_file,'(1p9E25.15e3)') fdm2_free_mat%dmat_vp(0:1,3) +! + write(id_file,*) ' fdm2_free_mat%dmat_vt at ICB' + write(id_file,*) ' no delivative dmat_vt(0,1), dmat_vt(1,1)' + write(id_file,'(1p9E25.15e3)') fdm2_free_mat%dmat_vt(0:1,1) + write(id_file,*) ' first delivative dmat_vt(0,2), dmat_vt(1,2)' + write(id_file,'(1p9E25.15e3)') fdm2_free_mat%dmat_vt(0:1,2) + write(id_file,*) ' second delivative dmat_vt(0,3), dmat_vt(1,3)' + write(id_file,'(1p9E25.15e3)') fdm2_free_mat%dmat_vt(0:1,3) +! + end subroutine check_fdm_coef_free_slip_ICB ! - write(50,*) ' fdm2_free_mat%dmat_vt' - write(50,*) ' mat_fdm11, mat_fdm12' - write(50,'(1p9E25.15e3)') fdm2_free_mat%dmat_vt(-1:0,1) - write(50,*) ' mat_fdm21, mat_fdm22' - write(50,'(1p9E25.15e3)') fdm2_free_mat%dmat_vt(-1:0,2) - write(50,*) ' mat_fdm31, mat_fdm32' - write(50,'(1p9E25.15e3)') fdm2_free_mat%dmat_vt(-1:0,3) +! ----------------------------------------------------------------------- +! + subroutine check_fdm_coef_free_slip_CMB(id_file, fdm2_free_mat) ! - end subroutine check_coef_fdm_free_slip + integer(kind = kint), intent(in) :: id_file + type(fdm2_free_slip), intent(in) :: fdm2_free_mat ! +! + write(id_file,*) ' fdm2_free_mat%dmat_vp at CMB' + write(id_file,*) ' no delivative dmat_vp(-1,1), dmat_vp(0,1)' + write(id_file,'(1p9E25.15e3)') fdm2_free_mat%dmat_vp(-1:0,1) + write(id_file,*) ' first delivative dmat_vp(-1,2), dmat_vp(0,2)' + write(id_file,'(1p9E25.15e3)') fdm2_free_mat%dmat_vp(-1:0,2) + write(id_file,*) ' second delivative dmat_vp(-1,3), dmat_vp(0,3)' + write(id_file,'(1p9E25.15e3)') fdm2_free_mat%dmat_vp(-1:0,3) +! + write(id_file,*) ' fdm2_free_mat%dmat_vt at CMB' + write(id_file,*) ' no delivative dmat_vt(-1,1), dmat_vt(0,1)' + write(id_file,'(1p9E25.15e3)') fdm2_free_mat%dmat_vt(-1:0,1) + write(id_file,*) ' first delivative dmat_vt(-1,2), dmat_vt(0,2)' + write(id_file,'(1p9E25.15e3)') fdm2_free_mat%dmat_vt(-1:0,2) + write(id_file,*) ' second delivative dmat_vt(-1,3), dmat_vt(0,3)' + write(id_file,'(1p9E25.15e3)') fdm2_free_mat%dmat_vt(-1:0,3) +! + end subroutine check_fdm_coef_free_slip_CMB +! +! ----------------------------------------------------------------------- ! ----------------------------------------------------------------------- ! subroutine check_coef_fdm_fix_dr_2ctr(fdm2_center) diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/t_coef_fdm4_MHD_boundaries.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/t_coef_fdm4_MHD_boundaries.f90 deleted file mode 100644 index 115b0a08..00000000 --- a/src/Fortran_libraries/MHD_src/sph_MHD/t_coef_fdm4_MHD_boundaries.f90 +++ /dev/null @@ -1,185 +0,0 @@ -!>@file t_coef_fdm4_MHD_boundaries.f90 -!!@brief module t_coef_fdm4_MHD_boundaries -!! -!!@author H. Matsui -!!@date Programmed in May., 2013 -! -!>@brief Matrix to evaluate radial derivative for non-slip at ICB -!! -!!@verbatim -!! subroutine check_4th_ICB_vpol_fdm(fdm4_vpol_ICB) -!! type(fdm4_ICB_vpol), intent(in) :: fdm4_vpol_ICB -!! subroutine check_4th_CMB_vpol_fdm(fdm4_vpol_CMB) -!! type(fdm4_CMB_vpol), intent(in) :: fdm4_vpol_CMB -!! -!! Matrix for poloidal velocity with non-slip boundary at ICB -!! d2fdr2 = fdm4_noslip_ICB%dmat_vp0( 2,3) * d_rj(ICB-2) -!! + fdm4_noslip_ICB%dmat_vp0( 1,3) * d_rj(ICB-1) -!! + fdm4_noslip_ICB%dmat_vp0( 0,3) * d_rj(ICB ) -!! d3fdr3 = fdm4_noslip_ICB%dmat_vp0( 2,4) * d_rj(ICB-2) -!! + fdm4_noslip_ICB%dmat_vp0( 1,4) * d_rj(ICB-1) -!! + fdm4_noslip_ICB%dmat_vp0( 0,4) * d_rj(ICB ) -!! -!! Matrix for poloidal velocity with non-slip boundary at next of ICB -!! dfdr = fdm4_noslip_ICB%dmat_vp1( 2,2) * d_rj(ICB-3) -!! + fdm4_noslip_ICB%dmat_vp1( 1,2) * d_rj(ICB-2) -!! + fdm4_noslip_ICB%dmat_vp1( 0,2) * d_rj(ICB-1) -!! + fdm4_noslip_ICB%dmat_vp1(-1,2) * d_rj(ICB ) -!! d2fdr2 = fdm4_noslip_ICB%dmat_vp1( 2,3) * d_rj(ICB-3) -!! + fdm4_noslip_ICB%dmat_vp1( 1,3) * d_rj(ICB-2) -!! + fdm4_noslip_ICB%dmat_vp1( 0,3) * d_rj(ICB-1) -!! + fdm4_noslip_ICB%dmat_vp1(-1,3) * d_rj(ICB ) -!! d3fdr3 = fdm4_noslip_ICB%dmat_vp1( 2,4) * d_rj(ICB-3) -!! + fdm4_noslip_ICB%dmat_vp1( 1,4) * d_rj(ICB-2) -!! + fdm4_noslip_ICB%dmat_vp1( 0,4) * d_rj(ICB-1) -!! + fdm4_noslip_ICB%dmat_vp1(-1,4) * d_rj(ICB ) -!! d4fdr4 = fdm4_noslip_ICB%dmat_vp1( 2,5) * d_rj(ICB-3) -!! + fdm4_noslip_ICB%dmat_vp1( 1,5) * d_rj(ICB-2) -!! + fdm4_noslip_ICB%dmat_vp1( 0,5) * d_rj(ICB-1) -!! + fdm4_noslip_ICB%dmat_vp1(-1,5) * d_rj(ICB ) -!! -!! Matrix for poloidal velocity with non-slip boundary at CMB -!! dfdr = 0.0 -!! d2fdr2 = fdm4_noslip_CMB%dmat_vp0(-2,3) * d_rj(CMB-2) -!! + fdm4_noslip_CMB%dmat_vp0(-1,3) * d_rj(CMB-1) -!! + fdm4_noslip_CMB%dmat_vp0( 0,3) * d_rj(CMB ) -!! d3fdr3 = fdm4_noslip_CMB%dmat_vp0(-2,4) * d_rj(CMB-2) -!! + fdm4_noslip_CMB%dmat_vp0(-1,4) * d_rj(CMB-1) -!! + fdm4_noslip_CMB%dmat_vp0( 0,4) * d_rj(CMB ) -!! -!! Matrix for poloidal velocity with non-slip boundary at next of CMB -!! dfdr = fdm4_noslip_CMB%dmat_vp1(-2,2) * d_rj(CMB-3) -!! + fdm4_noslip_CMB%dmat_vp1(-1,2) * d_rj(CMB-2) -!! + fdm4_noslip_CMB%dmat_vp1( 0,2) * d_rj(CMB-1) -!! + fdm4_noslip_CMB%dmat_vp1( 1,2) * d_rj(CMB ) -!! d2fdr2 = fdm4_noslip_CMB%dmat_vp1(-2,3) * d_rj(CMB-3) -!! + fdm4_noslip_CMB%dmat_vp1(-1,3) * d_rj(CMB-2) -!! + fdm4_noslip_CMB%dmat_vp1( 0,3) * d_rj(CMB-1) -!! + fdm4_noslip_CMB%dmat_vp1( 1,3) * d_rj(CMB ) -!! d3fdr3 = fdm4_noslip_CMB%dmat_vp1(-2,4) * d_rj(CMB-3) -!! + fdm4_noslip_CMB%dmat_vp1(-1,4) * d_rj(CMB-2) -!! + fdm4_noslip_CMB%dmat_vp1( 0,4) * d_rj(CMB-1) -!! + fdm4_noslip_CMB%dmat_vp1( 1,4) * d_rj(CMB ) -!! d4fdr4 = fdm4_noslip_CMB%dmat_vp1(-2,5) * d_rj(CMB-3) -!! + fdm4_noslip_CMB%dmat_vp1(-1,5) * d_rj(CMB-2) -!! + fdm4_noslip_CMB%dmat_vp1( 0,5) * d_rj(CMB-1) -!! + fdm4_noslip_CMB%dmat_vp1( 1,5) * d_rj(CMB ) -!! -!! -!! Matrix for poloidal velocity with free-slip boundary at ICB -!! dfdr = fdm4_free_ICB%dmat_vp0( 2,2) * d_rj(ICB+2) -!! + fdm4_free_ICB%dmat_vp0( 1,2) * d_rj(ICB+1) -!! + fdm4_free_ICB%dmat_vp0( 0,2) * d_rj(ICB ) -!! d2fdr2 = fdm4_free_ICB%dmat_vp0( 2,3) * d_rj(ICB+2) -!! + fdm4_free_ICB%dmat_vp0( 1,3) * d_rj(ICB+1) -!! + fdm4_free_ICB%dmat_vp0( 0,3) * d_rj(ICB ) -!! d3fdr3 = fdm4_free_ICB%dmat_vp0( 2,4) * d_rj(ICB+2) -!! + fdm4_free_ICB%dmat_vp0( 1,4) * d_rj(ICB+1) -!! + fdm4_free_ICB%dmat_vp0( 0,4) * d_rj(ICB ) -!! -!! Matrix for poloidal velocity with free-slip boundary at next of ICB -!! dfdr = fdm4_free_ICB%dmat_vp1( 2,2) * d_rj(ICB+3) -!! + fdm4_free_ICB%dmat_vp1( 1,2) * d_rj(ICB+2) -!! + fdm4_free_ICB%dmat_vp1( 0,2) * d_rj(ICB+1) -!! + fdm4_free_ICB%dmat_vp1(-1,2) * d_rj(ICB ) -!! d2fdr2 = fdm4_free_ICB%dmat_vp1( 2,3) * d_rj(ICB+3) -!! + fdm4_free_ICB%dmat_vp1( 1,3) * d_rj(ICB+2) -!! + fdm4_free_ICB%dmat_vp1( 0,3) * d_rj(ICB+1) -!! + fdm4_free_ICB%dmat_vp1(-1,3) * d_rj(ICB ) -!! d3fdr3 = fdm4_free_ICB%dmat_vp1( 2,4) * d_rj(ICB+3) -!! + fdm4_free_ICB%dmat_vp1( 1,4) * d_rj(ICB+2) -!! + fdm4_free_ICB%dmat_vp1( 0,4) * d_rj(ICB+1) -!! + fdm4_free_ICB%dmat_vp1(-1,4) * d_rj(ICB ) -!! d4fdr4 = fdm4_free_ICB%dmat_vp1( 2,5) * d_rj(ICB+3) -!! + fdm4_free_ICB%dmat_vp1( 1,5) * d_rj(ICB+2) -!! + fdm4_free_ICB%dmat_vp1( 0,5) * d_rj(ICB+1) -!! + fdm4_free_ICB%dmat_vp1(-1,5) * d_rj(ICB ) -!!@endverbatim -!! -!!@n @param r_from_ICB(0:3) radius to three next points of ICB -!! - module t_coef_fdm4_MHD_boundaries -! - use m_precision -! - use m_constants -! - implicit none -! -! - type fdm4_ICB_vpol -!> Matrix to evaluate radial derivative at ICB - real(kind = kreal) :: dmat_vp0(0:2,2:4) -!> Matrix to evaluate radial derivative at next of ICB - real(kind = kreal) :: dmat_vp1(-1:2,5) - end type fdm4_ICB_vpol -! - type fdm4_CMB_vpol -!> Matrix to evaluate radial derivative at CMB - real(kind = kreal) :: dmat_vp0(-2:0,2:4) -!> Matrix to evaluate radial derivative at next of CMB - real(kind = kreal) :: dmat_vp1(-2:1,2:5) - end type fdm4_CMB_vpol -! -! -! ----------------------------------------------------------------------- -! - contains -! -! ----------------------------------------------------------------------- -! - subroutine check_4th_ICB_vpol_fdm(fdm4_vpol_ICB) -! - type(fdm4_ICB_vpol), intent(in) :: fdm4_vpol_ICB -! -! - write(50,*) ' fdm4_vpol_ICB%dmat_vp0' - write(50,*) 'matrix for dfdr' - write(50,'(1p9E25.15e3)') fdm4_vpol_ICB%dmat_vp0(0:2,2) - write(50,*) 'matrix for d2fdr2' - write(50,'(1p9E25.15e3)') fdm4_vpol_ICB%dmat_vp0(0:2,3) - write(50,*) 'matrix for d3fdr3' - write(50,'(1p9E25.15e3)') fdm4_vpol_ICB%dmat_vp0(0:2,4) -! - write(50,*) ' fdm4_vpol_ICB%dmat_vp1' - write(50,*) 'matrix for dfdr' - write(50,'(1p9E25.15e3)') fdm4_vpol_ICB%dmat_vp1(-1:2,2) - write(50,*) 'matrix for d2fdr2' - write(50,'(1p9E25.15e3)') fdm4_vpol_ICB%dmat_vp1(-1:2,3) - write(50,*) 'matrix for d3fdr3' - write(50,'(1p9E25.15e3)') fdm4_vpol_ICB%dmat_vp1(-1:2,4) - write(50,*) 'matrix for d4fdr4' - write(50,'(1p9E25.15e3)') fdm4_vpol_ICB%dmat_vp1(-1:2,5) -! - end subroutine check_4th_ICB_vpol_fdm -! -! ----------------------------------------------------------------------- -! - subroutine check_4th_CMB_vpol_fdm(fdm4_vpol_CMB) -! - type(fdm4_CMB_vpol), intent(in) :: fdm4_vpol_CMB -! -! - write(50,*) ' fdm4_vpol_CMB%dmat_vp0' - write(50,*) 'matrix for dfdr' - write(50,'(1p9E25.15e3)') fdm4_vpol_CMB%dmat_vp0(-2:0,2) - write(50,*) 'matrix for d3fdr3' - write(50,'(1p9E25.15e3)') fdm4_vpol_CMB%dmat_vp0(-2:0,3) - write(50,*) 'matrix for d3fdr3' - write(50,'(1p9E25.15e3)') fdm4_vpol_CMB%dmat_vp0(-2:0,4) -! - write(50,*) ' fdm4_vpol_CMB%dmat_vp1' - write(50,*) 'matrix for dfdr' - write(50,'(1p9E25.15e3)') fdm4_vpol_CMB%dmat_vp1(-2:1,2) - write(50,*) 'matrix for d2fdr2' - write(50,'(1p9E25.15e3)') fdm4_vpol_CMB%dmat_vp1(-2:1,3) - write(50,*) 'matrix for d3fdr3' - write(50,'(1p9E25.15e3)') fdm4_vpol_CMB%dmat_vp1(-2:1,4) - write(50,*) 'matrix for d4fdr4' - write(50,'(1p9E25.15e3)') fdm4_vpol_CMB%dmat_vp1(-2:1,5) -! - end subroutine check_4th_CMB_vpol_fdm -! -! ----------------------------------------------------------------------- -! - end module t_coef_fdm4_MHD_boundaries diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/t_control_parameter.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/t_control_parameter.f90 index 521090b9..c2012a7f 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/t_control_parameter.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/t_control_parameter.f90 @@ -18,6 +18,8 @@ module t_control_parameter use t_physical_property use t_reference_scalar_param use t_coef_parameters_list + use t_ctl_param_val_density + use t_ctl_param_val_diffusion ! implicit none ! @@ -29,9 +31,21 @@ module t_control_parameter ! !> Structure for fluid property type(fluid_property) :: fl_prop +!> flag for polytrope + logical :: flag_ref_density_valiation = .FALSE. +!> Structure for polytrope + type(polytrope_parameters) :: polytrope_param +!> flag for valuable viscosity + logical :: flag_viscous_variation = .FALSE. +!> Structure for valuable diffusivity + type(val_diffuse_parameters) :: val_viscous_param ! !> Structure for manetic property type(conductive_property) :: cd_prop +!> flag for valuable magnetic diffusivity + logical :: flag_mag_diffuse_variation = .FALSE. +!> Structure for valuable magnetic diffusivity + type(val_diffuse_parameters) :: val_mag_diffuse_param ! !> Structure for thermal property type(scalar_property) :: ht_prop @@ -39,6 +53,10 @@ module t_control_parameter type(reference_scalar_param) :: ref_param_T !> Takepiro stratified temperature type(takepiro_model_param) :: takepito_T +!> flag for valuable thermal diffusivity + logical :: flag_term_diffuse_variation = .FALSE. +!> Structure for valuable thermal diffusivity + type(val_diffuse_parameters) :: val_thermal_diffuse_param ! !> Structure for compositon property type(scalar_property) :: cp_prop @@ -46,6 +64,10 @@ module t_control_parameter type(reference_scalar_param) :: ref_param_C !> Takepiro stratified composition type(takepiro_model_param) :: takepito_C +!> flag for valuable compositional diffusivity + logical :: flag_comp_diffuse_variation = .FALSE. +!> Structure for valuable compositional diffusivity + type(val_diffuse_parameters) :: val_comp_diffuse_param ! !> Structure for normalization parameters type(coef_parameters_list) :: MHD_coef_list diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/t_coriolis_terms_rlm.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/t_coriolis_terms_rlm.f90 index 27fc313a..11078898 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/t_coriolis_terms_rlm.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/t_coriolis_terms_rlm.f90 @@ -12,20 +12,12 @@ !! !! subroutine init_sum_coriolis_rlm & !! & (l_truncation, sph_rlm, sph_bc_U, leg, gt_cor, cor_rlm) -!! -!! subroutine sum_rot_coriolis_rlm(ncomp_trans, sph_rlm, comm_rlm, & -!! & fl_prop, sph_bc_U, omega_sph, b_trns, leg, gt_cor, & -!! & n_WR, WR, cor_rlm) -!! subroutine sum_coriolis_rlm(ncomp_trans, sph_rlm, comm_rlm, & -!! & fl_prop, sph_bc_U, omega_sph, b_trns, gt_cor, & -!! & n_WR, WR, cor_rlm) !! type(phys_address), intent(in) :: b_trns -!! subroutine copy_coriolis_terms_rlm & -!! & (ncomp_trans, sph_rlm, comm_rlm, fl_prop, & -!! & f_trns, cor_rlm, n_WS, WS) -!! type(phys_address), intent(in) :: f_trns !! +!! subroutine alloc_d_coriolis_rlm(nnod_rlm, jmax_rlm, cor_rlm) !! subroutine dealloc_d_coriolis_rlm(cor_rlm) +!! integer(kind = kint), intent(in) :: nnod_rlm, jmax_rlm +!! type(coriolis_rlm_data), intent(inout) :: cor_rlm !! !!************************************************ !! @@ -82,31 +74,15 @@ module t_coriolis_terms_rlm use m_constants ! use t_spheric_rlm_data - use t_sph_trans_comm_tbl use t_poloidal_rotation use t_addresses_sph_transform use t_schmidt_poly_on_rtm - use t_physical_property use t_boundary_params_sph_MHD use t_gaunt_coriolis_rlm ! implicit none ! ! -!> Address for poloidal componenet of Coriolis term - integer(kind = kint), parameter, private :: ip_rlm_coriolis = 1 -!> Address for horizontal componenet of Coriolis term - integer(kind = kint), parameter, private :: ih_rlm_coriolis = 2 -!> Address for toroidal componenet of Coriolis term - integer(kind = kint), parameter, private :: it_rlm_coriolis = 3 -! -!> Address for poloidal componenet of rotation of Coriolis term - integer(kind = kint), parameter, private :: ip_rlm_rot_cor = 1 -!> Address for toroidal componenet of rotation of Coriolis term - integer(kind = kint), parameter, private :: it_rlm_rot_cor = 2 -!> Address for divergence of Coriolis term - integer(kind = kint), parameter, private :: ip_rlm_div_cor = 3 -! !> Structure of Coriolis terms in@f$ f(r,l,m) @f$. type coriolis_rlm_data !> local spectr index for ICB and @f$ m = -1, 0, 1@f$. @@ -126,7 +102,7 @@ module t_coriolis_terms_rlm integer (kind=kint) :: idx_rlm_degree_one(-1:1) = (/0,0,0/) ! !> Number of compoennt of coriolis term data - integer(kind = kint) :: ncomp_coriolis_rlm = 3 + integer(kind = kint) :: ncomp_coriolis_rlm = 6 !> Coriolis term real(kind = kreal), allocatable :: d_cor_rlm(:,:) !> Coriolis term at inner boundary @@ -199,168 +175,7 @@ subroutine init_sum_coriolis_rlm & end subroutine init_sum_coriolis_rlm ! ! ----------------------------------------------------------------------- -! - subroutine sum_rot_coriolis_rlm(ncomp_trans, sph_rlm, comm_rlm, & - & fl_prop, sph_bc_U, omega_sph, b_trns, leg, gt_cor, & - & n_WR, WR, cor_rlm) -! - use t_physical_property - use t_boundary_params_sph_MHD - use sum_rot_coriolis_terms_rlm - use sum_boundary_coriolis_rlm -! use sum_div_coriolis_terms_rlm -! - type(sph_rlm_grid), intent(in) :: sph_rlm - type(sph_comm_tbl), intent(in) :: comm_rlm - type(fluid_property), intent(in) :: fl_prop - type(sph_boundary_type), intent(in) :: sph_bc_U - type(sph_rotation), intent(in) :: omega_sph - type(phys_address), intent(in) :: b_trns - type(legendre_4_sph_trans), intent(in) :: leg -! - type(gaunt_coriolis_rlm), intent(in) :: gt_cor -! - integer(kind = kint), intent(in) :: ncomp_trans, n_WR - real(kind = kreal), intent(in) :: WR(n_WR) -! - type(coriolis_rlm_data), intent(inout) :: cor_rlm -! -! - if(fl_prop%iflag_4_coriolis .eqv. .FALSE.) return -! - call select_sum_rot_coriolis_rlm_10(b_trns, & - & sph_rlm, leg, omega_sph, gt_cor, fl_prop%coef_cor, & - & ncomp_trans, n_WR, comm_rlm%irev_sr, WR, & - & cor_rlm%d_cor_rlm(1,ip_rlm_rot_cor), & - & cor_rlm%d_cor_rlm(1,it_rlm_rot_cor)) -! - if(sph_bc_U%iflag_icb .eq. iflag_rotatable_ic) then - call inner_core_rot_z_coriolis_rlm(b_trns, & - & sph_rlm%nnod_rlm, sph_rlm%nidx_rlm, sph_rlm%istep_rlm, & - & sph_rlm%radius_1d_rlm_r, omega_sph%ws_rlm, & - & fl_prop%coef_cor, ncomp_trans, n_WR, comm_rlm%irev_sr, WR, & - & cor_rlm%idx_rlm_ICB, cor_rlm%idx_rlm_degree_one, & - & cor_rlm%d_cor_rlm(1,ip_rlm_rot_cor)) - end if -! - -! if(sph_rlm%istep_rlm(1) .eq. 1) then -! call sum_div_coriolis_rlm_10 & -! & (b_trns, sph_rlm%nnod_rlm, sph_rlm%nidx_rlm, & -! & sph_rlm%idx_gl_1d_rlm_j, sph_rlm%a_r_1d_rlm_r, & -! & omega_sph%ws_rlm, fl_prop%coef_cor, & -! & gt_cor%jgi_rlm, gt_cor%jei_rlm, gt_cor%sd_rlm, gt_cor%td_rlm,& -! & ncomp_trans, n_WR, comm_rlm%irev_sr, WR, & -! & cor_rlm%d_cor_rlm(1,ip_rlm_div_cor)) -! else -! call sum_div_coriolis_lrm_10 & -! & (b_trns, sph_rlm%nnod_rlm, sph_rlm%nidx_rlm, & -! & sph_rlm%idx_gl_1d_rlm_j, sph_rlm%a_r_1d_rlm_r, & -! & omega_sph%ws_rlm, fl_prop%coef_cor, & -! & gt_cor%jgi_rlm, gt_cor%jei_rlm, gt_cor%sd_rlm, gt_cor%td_rlm,& -! & ncomp_trans, n_WR, comm_rlm%irev_sr, WR, & -! & cor_rlm%d_cor_rlm(1,ip_rlm_div_cor)) -! end if -! -! call sum_r_coriolis_bc_rlm_10(b_trns, & -! & sph_rlm%nnod_rlm, sph_rlm%nidx_rlm, sph_rlm%idx_gl_1d_rlm_j, & -! & omega_sph%ws_rlm, fl_prop%coef_cor, & -! & gt_cor%jgi_rlm, gt_cor%jei_rlm, gt_cor%sr_rlm, gt_cor%tr_rlm,& -! & ncomp_trans, kr_in_U_rlm, n_WR, comm_rlm%irev_sr, & -! & WR, cor_rlm%d_cor_in_rlm) -! call sum_r_coriolis_bc_rlm_10(b_trns, & -! & sph_rlm%nnod_rlm, sph_rlm%nidx_rlm, sph_rlm%idx_gl_1d_rlm_j, & -! & omega_sph%ws_rlm, fl_prop%coef_cor, & -! & gt_cor%jgi_rlm, gt_cor%jei_rlm, gt_cor%sr_rlm, gt_cor%tr_rlm,& -! & ncomp_trans, kr_out_U_rlm, n_WR, comm_rlm%irev_sr, & -! & WR, cor_rlm%d_cor_out_rlm) -! - end subroutine sum_rot_coriolis_rlm -! -! ----------------------------------------------------------------------- -! - subroutine sum_coriolis_rlm(ncomp_trans, sph_rlm, comm_rlm, & - & fl_prop, sph_bc_U, omega_sph, b_trns, gt_cor, & - & n_WR, WR, cor_rlm) -! - use t_physical_property - use t_boundary_params_sph_MHD - use sum_coriolis_terms_rlm - use sum_boundary_coriolis_rlm -! - type(sph_rlm_grid), intent(in) :: sph_rlm - type(sph_comm_tbl), intent(in) :: comm_rlm - type(fluid_property), intent(in) :: fl_prop - type(sph_boundary_type), intent(in) :: sph_bc_U - type(sph_rotation), intent(in) :: omega_sph - type(phys_address), intent(in) :: b_trns -! - type(gaunt_coriolis_rlm), intent(in) :: gt_cor -! - integer(kind = kint), intent(in) :: ncomp_trans, n_WR - real(kind = kreal), intent(in) :: WR(n_WR) -! - type(coriolis_rlm_data), intent(inout) :: cor_rlm -! -! - if(fl_prop%iflag_4_coriolis .eqv. .FALSE.) return -! - call select_sum_coriolis_rlm_10 & - & (b_trns, sph_rlm, omega_sph, gt_cor, fl_prop%coef_cor, & - & ncomp_trans, n_WR, comm_rlm%irev_sr, WR, & - & cor_rlm%d_cor_rlm(1,ip_rlm_coriolis), & - & cor_rlm%d_cor_rlm(1,ih_rlm_coriolis), & - & cor_rlm%d_cor_rlm(1,it_rlm_coriolis)) -! - if(sph_bc_U%iflag_icb .eq. iflag_rotatable_ic) then - call inner_core_rot_z_coriolis_rlm(b_trns, & - & sph_rlm%nnod_rlm, sph_rlm%nidx_rlm, sph_rlm%istep_rlm, & - & sph_rlm%radius_1d_rlm_r, omega_sph%ws_rlm, & - & fl_prop%coef_cor, ncomp_trans, n_WR, comm_rlm%irev_sr, WR, & - & cor_rlm%idx_rlm_ICB, cor_rlm%idx_rlm_degree_one, & - & cor_rlm%d_cor_rlm(1,it_rlm_coriolis)) - end if -! - end subroutine sum_coriolis_rlm -! -! ----------------------------------------------------------------------- -! - subroutine copy_coriolis_terms_rlm & - & (ncomp_trans, sph_rlm, comm_rlm, fl_prop, & - & f_trns, cor_rlm, n_WS, WS) -! - use m_sph_communicators - use sum_coriolis_terms_rlm - use sel_spherical_SRs -! - type(sph_rlm_grid), intent(in) :: sph_rlm - type(sph_comm_tbl), intent(in) :: comm_rlm - type(fluid_property), intent(in) :: fl_prop - type(phys_address), intent(in) :: f_trns - type(coriolis_rlm_data), intent(in) :: cor_rlm -! - integer(kind = kint), intent(in) :: ncomp_trans, n_WS - real(kind = kreal), intent(inout) :: WS(n_WS) -! -! - if(fl_prop%iflag_4_coriolis .eqv. .FALSE.) return -! - call sel_calypso_to_send_scalar & - & (ncomp_trans, sph_rlm%nnod_rlm, n_WS, & - & comm_rlm%nneib_domain, comm_rlm%istack_sr, comm_rlm%item_sr, & - & cor_rlm%ncomp_coriolis_rlm, ip_rlm_rot_cor, & - & f_trns%rot_forces%i_Coriolis, cor_rlm%d_cor_rlm(1,1), WS(1)) - call sel_calypso_to_send_scalar & - & (ncomp_trans, sph_rlm%nnod_rlm, n_WS, & - & comm_rlm%nneib_domain, comm_rlm%istack_sr, comm_rlm%item_sr, & - & cor_rlm%ncomp_coriolis_rlm, it_rlm_rot_cor, & - & (f_trns%rot_forces%i_Coriolis+2), cor_rlm%d_cor_rlm(1,1), & - & WS(1)) -! - end subroutine copy_coriolis_terms_rlm -! ! ----------------------------------------------------------------------- -! ------------------------------------------------------------------ ! subroutine alloc_d_coriolis_rlm(nnod_rlm, jmax_rlm, cor_rlm) ! @@ -368,11 +183,10 @@ subroutine alloc_d_coriolis_rlm(nnod_rlm, jmax_rlm, cor_rlm) type(coriolis_rlm_data), intent(inout) :: cor_rlm ! ! - cor_rlm%ncomp_coriolis_rlm = 3 - allocate( cor_rlm%d_cor_rlm(nnod_rlm,cor_rlm%ncomp_coriolis_rlm) ) + allocate(cor_rlm%d_cor_rlm(nnod_rlm,cor_rlm%ncomp_coriolis_rlm)) ! - allocate( cor_rlm%d_cor_in_rlm(jmax_rlm) ) - allocate( cor_rlm%d_cor_out_rlm(jmax_rlm) ) + allocate(cor_rlm%d_cor_in_rlm(jmax_rlm)) + allocate(cor_rlm%d_cor_out_rlm(jmax_rlm)) ! if(nnod_rlm .le. 0) return cor_rlm%d_cor_rlm = 0.0d0 diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/t_ctl_param_val_density.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/t_ctl_param_val_density.f90 new file mode 100644 index 00000000..1e9323f6 --- /dev/null +++ b/src/Fortran_libraries/MHD_src/sph_MHD/t_ctl_param_val_density.f90 @@ -0,0 +1,160 @@ +!>@file t_ctl_param_val_density.f90 +!!@brief module t_ctl_param_val_density +!! +!!@author H. Matsui +!!@date Programmed in 2006 +! +!> @brief Control parameter for polytrope +!! +!!@verbatim +!! subroutine dealloc_density_variation_list(polytrope_param) +!! type(polytrope_parameters), intent(inout) :: polytrope_param +!! subroutine set_valuable_density_ctl(my_rank, polytrope_c, & +!! & polytrope_param, flag_ref_density_valiation) +!! integer, intent(in) :: my_rank +!! type(val_density_ctl), intent(in) :: polytrope_c +!! type(polytrope_parameters), intent(inout) :: polytrope_param +!! logical, intent(inout) :: flag_ref_density_valiation +!! +!! subroutine check_polytrope_parameters(polytrope_param) +!! type(polytrope_parameters), intent(in) :: polytrope_param +!!@endverbatim +! + module t_ctl_param_val_density +! + use m_precision + use m_constants +! +!> Block for polytorope definision + type polytrope_parameters +!> Stepped variation flag + logical :: flag_stepped = .FALSE. +! +!> Density file name + character(len = kchara) :: density_file_name +! +!> Radius and Density at inner boundary + real(kind = kreal) :: rho_bottom(2) = (/zero, one/) +!> Radius and Density at outer boundary + real(kind = kreal) :: rho_top(2) = (/one, one/) +!> Polytrope index + real(kind = kreal) :: polytrope_idx = zero +! +!> Number of list + integer(kind = kint) :: num_density_list = 0 +!> Polytrope index + real(kind = kreal), allocatable :: density_radius(:) +!> Polytrope index + real(kind = kreal), allocatable :: density_list(:) + end type polytrope_parameters +! +! ---------------------------------------------------------------------- +! + contains +! +! ---------------------------------------------------------------------- +! + subroutine alloc_density_variation_list(num, polytrope_param) +! + integer(kind = kint), intent(in) :: num + type(polytrope_parameters), intent(inout) :: polytrope_param +! + polytrope_param%num_density_list = num + allocate(polytrope_param%density_radius(num)) + allocate(polytrope_param%density_list(num)) +! + if(num .le. 0) return + polytrope_param%density_radius(1:num) = zero + polytrope_param%density_list(1:num) = zero +! + end subroutine alloc_density_variation_list +! +! ---------------------------------------------------------------------- +! + subroutine dealloc_density_variation_list(polytrope_param) +! + type(polytrope_parameters), intent(inout) :: polytrope_param +! + deallocate(polytrope_param%density_radius) + deallocate(polytrope_param%density_list) +! + end subroutine dealloc_density_variation_list +! +! ---------------------------------------------------------------------- +! + subroutine set_valuable_density_ctl(my_rank, polytrope_c, & + & polytrope_param, flag_ref_density_valiation) +! + use t_ctl_data_valuable_density + use skip_comment_f +! + integer, intent(in) :: my_rank + type(val_density_ctl), intent(in) :: polytrope_c + type(polytrope_parameters), intent(inout) :: polytrope_param + logical, intent(inout) :: flag_ref_density_valiation +! +! + flag_ref_density_valiation = .FALSE. + if(polytrope_c%r_variation_ctl%iflag .gt. 0) then + flag_ref_density_valiation & + & = yes_flag(polytrope_c%r_variation_ctl%charavalue) + end if + if(flag_ref_density_valiation .eqv. .FALSE.) return +! + iflag = polytrope_c%bottom_density_ctl%iflag & + & * polytrope_c%top_density_ctl%iflag & + & * polytrope_c%polytrope_index_ctl%iflag + if(iflag .gt. 0) then + polytrope_param%rho_bottom(1:2) & + & = polytrope_c%bottom_density_ctl%realvalue(1:2) + polytrope_param%rho_top(1:2) & + & = polytrope_c%top_density_ctl%realvalue(1:2) + polytrope_param%polytrope_idx & + & = polytrope_c%polytrope_index_ctl%realvalue +! + else if(polytrope_c%variation_file_name%iflag .gt. 0) then + polytrope_param%density_file_name & + & = polytrope_c%variation_file_name%charavalue + polytrope_param%num_density_list = -1 +! + else if(polytrope_c%density_list_ctl%num .gt. 0) then + call alloc_density_variation_list & + & (polytrope_c%density_list_ctl%num, polytrope_param) +! + do i = 1, polytrope_param%num_density_list + polytrope_param%density_radius(i) & + & = polytrope_c%density_list_ctl%vec1(i) + polytrope_param%density_list(i) & + & = polytrope_c%density_list_ctl%vec2(i) + end do + else + if(my_rank .eq. 0) write(*,*) 'Set density variation controls' + flag_ref_density_valiation = .FALSE. + end if +! + end subroutine set_valuable_density_ctl +! +! ---------------------------------------------------------------------- +! + subroutine check_polytrope_parameters(polytrope_param) +! + type(polytrope_parameters), intent(in) :: polytrope_param +! +! + write(*,*) 'flag_stepped', polytrope_param%flag_stepped + write(*,*) 'rho_bottom (r, rho)', polytrope_param%rho_bottom(1:2) + write(*,*) 'rho_top (r, rho)', polytrope_param%rho_top(1:2) + write(*,*) 'polytrope_idx', polytrope_param%polytrope_idx +! + write(*,*) 'num_density_list', polytrope_param%num_density_list + do i = 1, polytrope_param%num_density_list + write(*,*) i, polytrope_param%density_radius(i), & + & polytrope_param%density_list(i) + end do +! + end subroutine check_polytrope_parameters +! +! ---------------------------------------------------------------------- +! + end module t_ctl_param_val_density + diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/t_flex_delta_t_parameter.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/t_flex_delta_t_parameter.f90 index 26c77a8f..e74bcd61 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/t_flex_delta_t_parameter.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/t_flex_delta_t_parameter.f90 @@ -33,16 +33,8 @@ module t_flex_delta_t_parameter use t_ctl_data_4_time_steps ! implicit none -! -!> Fixed time step flag - integer(kind=kint), parameter :: iflag_fixed_step = 0 -!> Flexible time step flag - integer(kind=kint), parameter :: iflag_flex_step = 1 -! ! type flexible_stepping_parameter -!> flag for time stepping - integer(kind=kint) :: iflag_flexible_step = iflag_fixed_step !> Integer flag if time stepping is changed integer(kind= kint) :: iflag_flex_step_changed = id_turn_OFF ! @@ -149,7 +141,7 @@ subroutine set_control_flex_time_steps(tctl, init_d, flex_p) call cal_num_digit_real & & (init_d%dt, flex_p%dt_fact, flex_p%idt_digit) ! - if(flex_p%iflag_flexible_step .eq. iflag_flex_step) then + if(init_d%flag_flex_step) then if (tctl%min_delta_t_ctl%iflag .eq. 0) then e_message = 'Set maximum delta t' call calypso_MPI_abort(ierr_evo, e_message) diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/t_physical_property.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/t_physical_property.f90 index 16d222ca..5b2133be 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/t_physical_property.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/t_physical_property.f90 @@ -72,24 +72,24 @@ module t_physical_property real (kind=kreal) :: coef_diffuse ! !> Force flag for Filtered inertia term - logical :: iflag_4_inertia = .TRUE. + logical :: flag_inertia = .TRUE. !> Force flag for Coriolis force - logical :: iflag_4_coriolis = .FALSE. + logical :: flag_coriolis = .FALSE. !> Force flag for Lorentz force - logical :: iflag_4_lorentz = .FALSE. + logical :: flag_lorentz = .FALSE. !> Force flag for thermal buoyancy - logical :: iflag_4_gravity = .FALSE. + logical :: flag_thermal_buoyancy = .FALSE. !> Force flag for compositional buoyancy - logical :: iflag_4_composit_buo = .FALSE. + logical :: flag_comp_buoyancy = .FALSE. ! !> Force flag for Filtered inertia term - logical :: iflag_4_filter_inertia = .FALSE. + logical :: flag_filter_inertia = .FALSE. !> Force flag for Filtered Lorentz force - logical :: iflag_4_filter_lorentz = .FALSE. + logical :: flag_filter_lorentz = .FALSE. !> Force flag for filtered thermal buoyancy - logical :: iflag_4_filter_gravity = .FALSE. + logical :: flag_filter_gravity = .FALSE. !> Force flag for filtered compositional buoyancy - logical :: iflag_4_filter_comp_buo = .FALSE. + logical :: flag_filter_comp_buo = .FALSE. ! !> coefficient for Coriolis force real (kind=kreal) :: coef_cor = zero @@ -100,6 +100,22 @@ module t_physical_property !> coefficient for chemical buoyancy real (kind=kreal) :: coef_comp_buo = zero ! +!> Flag of radial valuable viscosity + logical :: flag_viscous_variation = .FALSE. +!> Flag of radial valuable density + logical :: flag_ref_density_valiation = .FALSE. +! +!> radial field index for density variation + integer(kind = kint) :: ir_rho = izero +!> radial field index for density variation + integer(kind = kint) :: ir_drho_norm = izero +!> radial field index for density variation + integer(kind = kint) :: ir_d2rho_norm = izero +!> radial field index for density variation + integer(kind = kint) :: ir_nu = izero +!> radial field index for density variation + integer(kind = kint) :: ir_dnu_norm = izero +! !> flag for gravity type integer (kind=kint) :: i_grav !> gravity direction for constant gravity @@ -108,7 +124,7 @@ module t_physical_property real (kind=kreal) :: sys_rot(3) = (/zero, zero, one/) ! !> Buoyancy model for FEM - integer(kind = kint) :: iflag_FEM_gravity = id_FORCE_ele_int + integer(kind = kint) :: iflag_FEM_gravity = id_FORCE_ele_int !> Coriolis force model for FEM integer(kind = kint) :: iflag_FEM_coriolis = id_FORCE_ele_int !> Coriolis force model for FEM @@ -143,6 +159,11 @@ module t_physical_property !> coefficient for magnetic induction real (kind=kreal) :: coef_induct ! +!> radial field index for diffusivity variation + integer(kind = kint) :: ir_eta = izero +!> radial field index for diffusivity variation + integer(kind = kint) :: ir_deta_norm = izero +! !> Ratio of magnetic energy to kinetic energy scale real (kind=kreal) :: me_to_ke_ratio ! @@ -176,6 +197,11 @@ module t_physical_property !> coefficient for heat source term real(kind = kreal) :: coef_source = zero ! +!> radial field index for diffusivity variation + integer(kind = kint) :: ir_kappa = izero +!> radial field index for diffusivity variation + integer(kind = kint) :: ir_dkappa_norm = izero +! !> coefficient for diffusion reduction for ICB real(kind = kreal) :: diffusie_reduction_ICB = one ! diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/t_work_SPH_MHD.f90 b/src/Fortran_libraries/MHD_src/sph_MHD/t_work_SPH_MHD.f90 index b47d5db2..d4dc8d56 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/t_work_SPH_MHD.f90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/t_work_SPH_MHD.f90 @@ -30,8 +30,10 @@ module t_work_SPH_MHD type(fdm_matrices) :: r_2nd !> Structure of 4th order FDM matrices type(fdm_matrices) :: r_4th -!> Structure of 1st order FDM matrices on element - type(fdm_matrices) :: r_2nd_ele +!> Structure of 3rd order FDM matrices on element + type(fdm_matrices) :: r_n2e_3rd +!> Structure of 1st order FDM matrices from element + type(fdm_matrices) :: r_e2n_1st ! !> Structure of band matrices for dynamo simulation type(MHD_radial_matrices) :: MHD_mats diff --git a/src/Fortran_libraries/MHD_src/sph_MHD/test_legendre_transforms.F90 b/src/Fortran_libraries/MHD_src/sph_MHD/test_legendre_transforms.F90 index ea4fcc3f..314b1072 100644 --- a/src/Fortran_libraries/MHD_src/sph_MHD/test_legendre_transforms.F90 +++ b/src/Fortran_libraries/MHD_src/sph_MHD/test_legendre_transforms.F90 @@ -131,9 +131,9 @@ subroutine s_test_legendre_transforms(sph, comms_sph, & ! starttime = MPI_WTIME() call sph_back_trans_4_MHD(sph, comms_sph, fl_prop, sph_bc_U, & - & omega_sph, trans_p, gt_cor, rj_fld, trns_MHD%b_trns, & - & trns_MHD%backward, WK_leg, WK_FFTs_MHD, cor_rlm, & - & SR_sig, SR_r) + & omega_sph, trans_p, gt_cor, rj_fld, & + & trns_MHD%b_trns, trns_MHD%f_trns, trns_MHD%backward, & + & WK_leg, WK_FFTs_MHD, cor_rlm, SR_sig, SR_r) call sph_forward_trans_4_MHD(sph, comms_sph, fl_prop, & & trans_p, cor_rlm, trns_MHD%f_trns, trns_MHD%forward, & & WK_leg, WK_FFTs_MHD, rj_fld, SR_sig, SR_r) diff --git a/src/Fortran_libraries/PARALLEL_src/COMM_src/bcast_4_time_step_ctl.f90 b/src/Fortran_libraries/PARALLEL_src/COMM_src/bcast_4_time_step_ctl.f90 index 7be60ce7..34281a6d 100644 --- a/src/Fortran_libraries/PARALLEL_src/COMM_src/bcast_4_time_step_ctl.f90 +++ b/src/Fortran_libraries/PARALLEL_src/COMM_src/bcast_4_time_step_ctl.f90 @@ -117,6 +117,7 @@ subroutine bcast_ctl_data_4_time_step(tctl) call bcast_ctl_type_r1(tctl%delta_t_pvr_ctl) call bcast_ctl_type_r1(tctl%delta_t_fline_ctl) call bcast_ctl_type_r1(tctl%delta_t_lic_ctl) + call bcast_ctl_type_r1(tctl%delta_t_tracer_output_ctl) call bcast_ctl_type_r1(tctl%delta_t_field_ctl) call bcast_ctl_type_r1(tctl%delta_t_monitor_ctl) call bcast_ctl_type_r1(tctl%delta_t_sgs_coefs_ctl) @@ -135,6 +136,7 @@ subroutine bcast_ctl_data_4_time_step(tctl) call bcast_ctl_type_i1(tctl%i_step_map_ctl) call bcast_ctl_type_i1(tctl%i_step_pvr_ctl) call bcast_ctl_type_i1(tctl%i_step_lic_ctl) + call bcast_ctl_type_i1(tctl%i_step_tracer_output_ctl) call bcast_ctl_type_i1(tctl%i_step_fline_ctl) ! call bcast_ctl_type_i1(tctl%i_step_ucd_ctl) diff --git a/src/Fortran_libraries/PARALLEL_src/COMM_src/const_element_comm_tables.f90 b/src/Fortran_libraries/PARALLEL_src/COMM_src/const_element_comm_tables.f90 index 04743c7e..21c7b9f4 100644 --- a/src/Fortran_libraries/PARALLEL_src/COMM_src/const_element_comm_tables.f90 +++ b/src/Fortran_libraries/PARALLEL_src/COMM_src/const_element_comm_tables.f90 @@ -334,8 +334,8 @@ subroutine set_node_ele_double_address & ! call set_node_double_numbering(node, nod_comm, inod_dbl, & & SR_sig, SR_i) - call set_ele_double_numbering(ele, ele_comm, inod_dbl, iele_dbl, & - & SR_sig, SR_i) + call set_ele_double_numbering(ele%numele, ele%ie(1,1), ele_comm, & + & inod_dbl, iele_dbl, SR_sig, SR_i) ! end subroutine set_node_ele_double_address ! diff --git a/src/Fortran_libraries/PARALLEL_src/COMM_src/m_elapsed_labels_SEND_RECV.f90 b/src/Fortran_libraries/PARALLEL_src/COMM_src/m_elapsed_labels_SEND_RECV.f90 index d4cc2f31..b5a3604b 100644 --- a/src/Fortran_libraries/PARALLEL_src/COMM_src/m_elapsed_labels_SEND_RECV.f90 +++ b/src/Fortran_libraries/PARALLEL_src/COMM_src/m_elapsed_labels_SEND_RECV.f90 @@ -1,5 +1,5 @@ !>@file m_elapsed_labels_SEND_RECV.f90 -!!@brief module d +!!@brief module m_elapsed_labels_SEND_RECV !! !!@author H. Matsui !!@date Programmed in Nov., 2018 diff --git a/src/Fortran_libraries/PARALLEL_src/COMM_src/m_sph_communicators.f90 b/src/Fortran_libraries/PARALLEL_src/COMM_src/m_sph_communicators.f90 index be06f53e..3068ece1 100644 --- a/src/Fortran_libraries/PARALLEL_src/COMM_src/m_sph_communicators.f90 +++ b/src/Fortran_libraries/PARALLEL_src/COMM_src/m_sph_communicators.f90 @@ -98,19 +98,19 @@ subroutine split_rtp_comms(nneib_domain_rtp, id_domain_rtp, & nprocs_rj = nprocs_rj4 my_rank_rj = my_rank_rj4 ! - if(i_debug .eq. 0) return -! - write(*,'(a,6i16)') 'my_rank, RTP_COMM, np_rtp, rank_rtp', & - & my_rank, CALYPSO_RTP_COMM, nprocs_rtp, my_rank_rtp - write(*,'(a,6i16)') 'my_rank, RJ_COMM, np_rj, rank_rj ', & - & my_rank, CALYPSO_RJ_COMM, nprocs_rj, my_rank_rj -! - call MPI_ALLREDUCE(my_rank, isum_rtp, 1, CALYPSO_FOUR_INT, & - & MPI_SUM, CALYPSO_RTP_COMM, ierr_MPI) - call MPI_ALLREDUCE(my_rank, isum_rj, 1, CALYPSO_FOUR_INT, & - & MPI_SUM, & - & CALYPSO_RJ_COMM, ierr_MPI) - write(*,'(a,6i16)') 'SUM_test', my_rank, isum_rtp, isum_rj +! if(i_debug .eq. 0) return +! +! write(*,'(a,6i16)') 'my_rank, RTP_COMM, np_rtp, rank_rtp', & +! & my_rank, CALYPSO_RTP_COMM, nprocs_rtp, my_rank_rtp +! write(*,'(a,6i16)') 'my_rank, RJ_COMM, np_rj, rank_rj ', & +! & my_rank, CALYPSO_RJ_COMM, nprocs_rj, my_rank_rj +! +! call MPI_ALLREDUCE(my_rank, isum_rtp, 1, CALYPSO_FOUR_INT, & +! & MPI_SUM, CALYPSO_RTP_COMM, ierr_MPI) +! call MPI_ALLREDUCE(my_rank, isum_rj, 1, CALYPSO_FOUR_INT, & +! & MPI_SUM, & +! & CALYPSO_RJ_COMM, ierr_MPI) +! write(*,'(a,6i16)') 'SUM_test', my_rank, isum_rtp, isum_rj ! end subroutine split_rtp_comms ! diff --git a/src/Fortran_libraries/PARALLEL_src/COMM_src/m_work_time.f90 b/src/Fortran_libraries/PARALLEL_src/COMM_src/m_work_time.f90 index b5820013..e570fadc 100644 --- a/src/Fortran_libraries/PARALLEL_src/COMM_src/m_work_time.f90 +++ b/src/Fortran_libraries/PARALLEL_src/COMM_src/m_work_time.f90 @@ -30,6 +30,13 @@ module m_work_time ! implicit none ! +!> Structure of labels for elapsed time data + type elapsed_lables + logical :: flag_elapsed = .FALSE. + integer(kind = kint) :: ist_elapsed = 0 + integer(kind = kint) :: ied_elapsed = 0 + end type elapsed_lables +! ! integer(kind = kint) :: iflag_time_4_each_pe = 0 ! diff --git a/src/Fortran_libraries/PARALLEL_src/COMM_src/t_element_double_number.f90 b/src/Fortran_libraries/PARALLEL_src/COMM_src/t_element_double_number.f90 index 93bb192d..df427b64 100644 --- a/src/Fortran_libraries/PARALLEL_src/COMM_src/t_element_double_number.f90 +++ b/src/Fortran_libraries/PARALLEL_src/COMM_src/t_element_double_number.f90 @@ -199,7 +199,7 @@ subroutine find_belonged_pe_4_edge(my_rank, inod_dbl, & ! !$omp parallel workshare iedge_dbl%irank(1:numedge) = -1 - iedge_dbl%k_ref(1:numedge) = 0 + iedge_dbl%k_ref(1:numedge) = 0 !$omp end parallel workshare ! !%omp parallel do private(iedge,ie_edge_one,nnod_same) diff --git a/src/Fortran_libraries/PARALLEL_src/COMM_src/t_para_double_numbering.f90 b/src/Fortran_libraries/PARALLEL_src/COMM_src/t_para_double_numbering.f90 index b50eab23..6360d51c 100644 --- a/src/Fortran_libraries/PARALLEL_src/COMM_src/t_para_double_numbering.f90 +++ b/src/Fortran_libraries/PARALLEL_src/COMM_src/t_para_double_numbering.f90 @@ -18,9 +18,10 @@ !! type(node_ele_double_number), intent(inout) :: inod_dbl !! type(send_recv_status), intent(inout) :: SR_sig !! type(send_recv_int_buffer), intent(inout) :: SR_i -!! subroutine set_ele_double_numbering & -!! & (ele, ele_comm, inod_dbl, iele_dbl, SR_sig, SR_i) -!! type(element_data), intent(in) :: ele +!! subroutine set_ele_double_numbering(numele, ie, ele_comm, & +!! & inod_dbl, iele_dbl, SR_sig, SR_i) +!! integer(kind = kint), intent(in) :: numele +!! integer(kind = kint), intent(in) :: ie(numele,1) !! type(communication_table), intent(in) :: ele_comm !! type(node_ele_double_number), intent(in) :: inod_dbl !! type(node_ele_double_number), intent(inout) :: iele_dbl @@ -126,8 +127,8 @@ end subroutine set_node_double_numbering ! ! ----------------------------------------------------------------------- ! - subroutine set_ele_double_numbering & - & (ele, ele_comm, inod_dbl, iele_dbl, SR_sig, SR_i) + subroutine set_ele_double_numbering(numele, ie, ele_comm, & + & inod_dbl, iele_dbl, SR_sig, SR_i) ! use t_solver_SR @@ -136,7 +137,8 @@ subroutine set_ele_double_numbering & use t_comm_table use solver_SR_type ! - type(element_data), intent(in) :: ele + integer(kind = kint), intent(in) :: numele + integer(kind = kint), intent(in) :: ie(numele,1) type(communication_table), intent(in) :: ele_comm type(node_ele_double_number), intent(in) :: inod_dbl ! @@ -148,13 +150,15 @@ subroutine set_ele_double_numbering & integer(kind = kint) :: iele ! !$omp parallel do - do iele = 1, ele%numele + do iele = 1, numele iele_dbl%index(iele) = iele - iele_dbl%irank(iele) = inod_dbl%irank(ele%ie(iele,1)) + iele_dbl%irank(iele) = my_rank end do !$omp end parallel do ! - call SOLVER_SEND_RECV_int_type(ele%numele, ele_comm, & + call SOLVER_SEND_RECV_int_type(numele, ele_comm, & + & SR_sig, SR_i, iele_dbl%irank(1)) + call SOLVER_SEND_RECV_int_type(numele, ele_comm, & & SR_sig, SR_i, iele_dbl%index(1)) ! end subroutine set_ele_double_numbering diff --git a/src/Fortran_libraries/PARALLEL_src/COMM_src/t_work_time.f90 b/src/Fortran_libraries/PARALLEL_src/COMM_src/t_work_time.f90 index efb2a6d1..7542d9b2 100644 --- a/src/Fortran_libraries/PARALLEL_src/COMM_src/t_work_time.f90 +++ b/src/Fortran_libraries/PARALLEL_src/COMM_src/t_work_time.f90 @@ -33,6 +33,7 @@ module t_work_time ! integer(kind = kint), parameter, private :: id_timer_file = 13 ! +!> Structure of elapsed time data display type elapsed_time_data !> Number of elapsed log items integer(kind = kint) :: num_elapsed diff --git a/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_edge_data_IO.f90 b/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_edge_data_IO.f90 index 036dbc2b..419674e8 100644 --- a/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_edge_data_IO.f90 +++ b/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_edge_data_IO.f90 @@ -70,7 +70,6 @@ subroutine mpi_read_edge_connection & call mpi_read_domain_info(IO_param, comm_IO) ! call mpi_skip_read(IO_param, len(hd_edge_connect())) - call mpi_read_num_element(IO_param, ele_IO) call mpi_read_element_info(IO_param, ele_IO) ! call mpi_skip_read(IO_param, len(hd_edge_on_surf())) @@ -142,7 +141,6 @@ subroutine mpi_read_edge_geometry(IO_param, nod_IO, sfed_IO) ! ! call mpi_skip_read(IO_param, len(hd_edge_point())) - call mpi_read_number_of_node(IO_param, nod_IO) call mpi_read_geometry_info(IO_param, nod_IO) ! call mpi_skip_read(IO_param, len(hd_edge_dir())) diff --git a/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_edge_data_IO_b.f90 b/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_edge_data_IO_b.f90 index e6c44b45..b59308fe 100644 --- a/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_edge_data_IO_b.f90 +++ b/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_edge_data_IO_b.f90 @@ -66,7 +66,6 @@ subroutine mpi_read_edge_connection_b & ! call mpi_read_domain_info_b(IO_param, comm_IO) ! - call mpi_read_number_of_element_b(IO_param, ele_IO) call mpi_read_element_info_b(IO_param, ele_IO) call mpi_read_surface_4_element_b(IO_param, sfed_IO) call mpi_read_edge_4_element_b(IO_param, sfed_IO) @@ -104,13 +103,14 @@ end subroutine mpi_write_edge_connection_b !------------------------------------------------------------------ ! subroutine mpi_read_edge_geometry_b(IO_param, nod_IO, sfed_IO) +! + use MPI_node_geometry_IO_b ! type(calypso_MPI_IO_params), intent(inout) :: IO_param type(node_data), intent(inout) :: nod_IO type(surf_edge_IO_data), intent(inout) :: sfed_IO ! ! - call mpi_read_number_of_node_b(IO_param, nod_IO) call mpi_read_geometry_info_b(IO_param, nod_IO) ! call mpi_read_vect_in_ele_b(IO_param, nod_IO, sfed_IO) diff --git a/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_element_connect_IO.f90 b/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_element_connect_IO.f90 index ba330875..cbc9a20e 100644 --- a/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_element_connect_IO.f90 +++ b/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_element_connect_IO.f90 @@ -116,7 +116,8 @@ subroutine mpi_read_element_info(IO_param, ele_IO) ! integer (kind = kint) :: i, num_tmp ! -! +! ---- read element data ------- + call mpi_read_num_element(IO_param, ele_IO) call alloc_element_types(ele_IO) ! call mpi_read_element_type & diff --git a/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_element_connect_IO_b.f90 b/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_element_connect_IO_b.f90 index 04399c1b..29d5e45a 100644 --- a/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_element_connect_IO_b.f90 +++ b/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_element_connect_IO_b.f90 @@ -131,6 +131,7 @@ subroutine mpi_read_element_info_b(IO_param, ele_IO) integer(kind = kint) :: i ! ! + call mpi_read_number_of_element_b(IO_param, ele_IO) call alloc_element_types(ele_IO) ! num64 = ele_IO%numele diff --git a/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_element_file_IO.f90 b/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_element_file_IO.f90 index fbe32fdd..02bd63cf 100644 --- a/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_element_file_IO.f90 +++ b/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_element_file_IO.f90 @@ -208,7 +208,6 @@ subroutine mpi_read_element_geometry(IO_param, nod_IO, sfed_IO) ! ! call mpi_skip_read(IO_param, len(hd_ecomm_point())) - call mpi_read_number_of_node(IO_param, nod_IO) call mpi_read_geometry_info(IO_param, nod_IO) ! call mpi_skip_read(IO_param, len(hd_ecomm_vol())) diff --git a/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_element_file_IO_b.f90 b/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_element_file_IO_b.f90 index 42636e7b..dcc9e9d5 100644 --- a/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_element_file_IO_b.f90 +++ b/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_element_file_IO_b.f90 @@ -200,7 +200,6 @@ subroutine mpi_read_element_geometry_b & type(surf_edge_IO_data), intent(inout) :: sfed_IO ! ! - call mpi_read_number_of_node_b(IO_param, nod_IO) call mpi_read_geometry_info_b(IO_param, nod_IO) ! call mpi_read_scl_in_ele_b(IO_param, nod_IO, sfed_IO) diff --git a/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_mesh_data_IO.f90 b/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_mesh_data_IO.f90 index ed12d71e..4257c6a5 100644 --- a/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_mesh_data_IO.f90 +++ b/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_mesh_data_IO.f90 @@ -13,8 +13,6 @@ !! type(mesh_geometry), intent(in) :: mesh_IO !! type(mesh_groups), intent(in) :: mesh_group_IO !! -!! subroutine mpi_read_num_node(IO_param, mesh_IO) -!! subroutine mpi_read_num_node_ele(IO_param, mesh_IO) !! subroutine mpi_read_geometry_data(IO_param, mesh_IO) !! subroutine mpi_read_mesh_groups(IO_param, mesh_group_IO) !! type(mesh_geometry), intent(inout) :: mesh_IO @@ -103,7 +101,7 @@ end subroutine mpi_write_mesh_groups !------------------------------------------------------------------ !------------------------------------------------------------------ ! - subroutine mpi_read_num_node(IO_param, mesh_IO) + subroutine mpi_read_geometry_data(IO_param, mesh_IO) ! type(calypso_MPI_IO_params), intent(inout) :: IO_param type(mesh_geometry), intent(inout) :: mesh_IO @@ -111,39 +109,12 @@ subroutine mpi_read_num_node(IO_param, mesh_IO) ! call mpi_skip_read(IO_param, len(hd_fem_para())) call mpi_read_domain_info(IO_param, mesh_IO%nod_comm) -! + call mpi_skip_read(IO_param, len(hd_fem_node())) - call mpi_read_number_of_node(IO_param, mesh_IO%node) -! - end subroutine mpi_read_num_node -! -!------------------------------------------------------------------ -! - subroutine mpi_read_num_node_ele(IO_param, mesh_IO) -! - type(calypso_MPI_IO_params), intent(inout) :: IO_param - type(mesh_geometry), intent(inout) :: mesh_IO -! -! - call mpi_read_num_node(IO_param, mesh_IO) call mpi_read_geometry_info(IO_param, mesh_IO%node) ! ! ---- read element data ------- -! call mpi_skip_read(IO_param, len(hd_fem_elem())) - call mpi_read_num_element(IO_param, mesh_IO%ele) -! - end subroutine mpi_read_num_node_ele -! -!------------------------------------------------------------------ -! - subroutine mpi_read_geometry_data(IO_param, mesh_IO) -! - type(calypso_MPI_IO_params), intent(inout) :: IO_param - type(mesh_geometry), intent(inout) :: mesh_IO -! -! - call mpi_read_num_node_ele(IO_param, mesh_IO) call mpi_read_element_info(IO_param, mesh_IO%ele) ! ! ---- import & export diff --git a/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_mesh_data_IO_b.f90 b/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_mesh_data_IO_b.f90 index ff03b282..2c7dab45 100644 --- a/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_mesh_data_IO_b.f90 +++ b/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_mesh_data_IO_b.f90 @@ -17,8 +17,6 @@ !! !! subroutine mpi_read_geometry_data_b(IO_param, mesh_IO) !! subroutine mpi_read_mesh_groups_b(IO_param, mesh_group_IO) -!! subroutine mpi_read_num_node_ele_b(IO_param, mesh_IO) -!! subroutine mpi_read_num_node_ele(IO_param, mesh_IO) !! type(mesh_geometry), intent(inout) :: mesh_IO !! type(mesh_groups), intent(inout) :: mesh_group_IO !!@endverbatim @@ -86,58 +84,21 @@ end subroutine mpi_write_mesh_groups_b !------------------------------------------------------------------ !------------------------------------------------------------------ ! - subroutine mpi_read_num_node_ele(IO_param, mesh_IO) + subroutine mpi_read_geometry_data_b(IO_param, mesh_IO) ! use m_error_IDs use MPI_domain_data_IO_b use MPI_node_geometry_IO_b -! - type(calypso_MPI_IO_params), intent(inout) :: IO_param - type(mesh_geometry), intent(inout) :: mesh_IO -! -! - call mpi_read_domain_info_b(IO_param, mesh_IO%nod_comm) - call mpi_read_number_of_node_b(IO_param, mesh_IO%node) -! - end subroutine mpi_read_num_node_ele -! -!------------------------------------------------------------------ -! - subroutine mpi_read_num_node_ele_b(IO_param, mesh_IO) -! - use m_error_IDs - use MPI_node_geometry_IO_b use MPI_element_connect_IO_b ! type(calypso_MPI_IO_params), intent(inout) :: IO_param type(mesh_geometry), intent(inout) :: mesh_IO ! ! - call mpi_read_num_node_ele(IO_param, mesh_IO) + call mpi_read_domain_info_b(IO_param, mesh_IO%nod_comm) call mpi_read_geometry_info_b(IO_param, mesh_IO%node) ! ! ---- read element data ------- -! - call mpi_read_number_of_element_b(IO_param, mesh_IO%ele) -! - end subroutine mpi_read_num_node_ele_b -! -!------------------------------------------------------------------ -! - subroutine mpi_read_geometry_data_b(IO_param, mesh_IO) -! - use m_error_IDs - use MPI_domain_data_IO_b - use MPI_element_connect_IO_b -! - type(calypso_MPI_IO_params), intent(inout) :: IO_param - type(mesh_geometry), intent(inout) :: mesh_IO -! -! - call mpi_read_num_node_ele_b(IO_param, mesh_IO) -! -! ---- read element data ------- -! call mpi_read_element_info_b(IO_param, mesh_IO%ele) ! ! ---- import & export diff --git a/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_mesh_file_IO.f90 b/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_mesh_file_IO.f90 index e1e82aaa..d628bcfe 100644 --- a/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_mesh_file_IO.f90 +++ b/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_mesh_file_IO.f90 @@ -110,7 +110,12 @@ subroutine mpi_read_node_size & & 'Read ascii mesh file: ', trim(file_name) ! call open_read_mpi_file(file_name, num_pe, id_rank, IO_param) - call mpi_read_num_node(IO_param, mesh_IO) +! + call mpi_skip_read(IO_param, len(hd_fem_para())) + call mpi_read_domain_info(IO_param, mesh_IO%nod_comm) +! + call mpi_skip_read(IO_param, len(hd_fem_node())) + call mpi_read_number_of_node(IO_param, mesh_IO%node) call close_mpi_file(IO_param) ! ! @@ -134,7 +139,15 @@ subroutine mpi_read_geometry_size & & 'Read ascii mesh file: ', trim(file_name) ! call open_read_mpi_file(file_name, num_pe, id_rank, IO_param) - call mpi_read_num_node_ele(IO_param, mesh_IO) +! + call mpi_skip_read(IO_param, len(hd_fem_para())) + call mpi_read_domain_info(IO_param, mesh_IO%nod_comm) +! + call mpi_skip_read(IO_param, len(hd_fem_node())) + call mpi_read_geometry_info(IO_param, mesh_IO%node) +! ---- read element data ------- + call mpi_skip_read(IO_param, len(hd_fem_elem())) + call mpi_read_num_element(IO_param, mesh_IO%ele) call close_mpi_file(IO_param) ! end subroutine mpi_read_geometry_size diff --git a/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_mesh_file_IO_b.f90 b/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_mesh_file_IO_b.f90 index 48d45088..967c8782 100644 --- a/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_mesh_file_IO_b.f90 +++ b/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_mesh_file_IO_b.f90 @@ -98,6 +98,7 @@ subroutine mpi_read_node_size_b & & (num_pe, id_rank, file_name, mesh_IO) ! use MPI_domain_data_IO_b + use MPI_node_geometry_IO_b use MPI_mesh_data_IO_b ! integer, intent(in) :: num_pe, id_rank @@ -111,18 +112,21 @@ subroutine mpi_read_node_size_b & ! call open_read_mpi_file_b & & (file_name, num_pe, id_rank, IO_param) - call mpi_read_num_node_ele(IO_param, mesh_IO) + call mpi_read_domain_info_b(IO_param, mesh_IO%nod_comm) + call mpi_read_number_of_node_b(IO_param, mesh_IO%node) call close_mpi_file(IO_param) ! end subroutine mpi_read_node_size_b ! !------------------------------------------------------------------ ! - subroutine mpi_read_geometry_size_b & - & (num_pe, id_rank, file_name, mesh_IO) + subroutine mpi_read_geometry_size_b & + & (num_pe, id_rank, file_name, mesh_IO) ! - use MPI_domain_data_IO_b - use MPI_mesh_data_IO_b + use MPI_domain_data_IO_b + use MPI_mesh_data_IO_b + use MPI_element_connect_IO_b + use MPI_node_geometry_IO_b ! integer, intent(in) :: num_pe, id_rank character(len=kchara), intent(in) :: file_name @@ -135,7 +139,11 @@ subroutine mpi_read_geometry_size_b & ! call open_read_mpi_file_b & & (file_name, num_pe, id_rank, IO_param) - call mpi_read_num_node_ele_b(IO_param, mesh_IO) + call mpi_read_domain_info_b(IO_param, mesh_IO%nod_comm) + call mpi_read_geometry_info_b(IO_param, mesh_IO%node) +! +! ---- read element data ------- + call mpi_read_number_of_element_b(IO_param, mesh_IO%ele) call close_mpi_file(IO_param) ! end subroutine mpi_read_geometry_size_b diff --git a/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_node_geometry_IO.f90 b/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_node_geometry_IO.f90 index 6e2c39c2..38ee90df 100644 --- a/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_node_geometry_IO.f90 +++ b/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_node_geometry_IO.f90 @@ -113,6 +113,7 @@ subroutine mpi_read_geometry_info(IO_param, nod_IO) integer(kind = kint_gl) :: num64 ! ! + call mpi_read_number_of_node(IO_param, nod_IO) call alloc_node_geometry_base(nod_IO) ! num64 = nod_IO%numnod diff --git a/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_node_geometry_IO_b.f90 b/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_node_geometry_IO_b.f90 index 3a241edd..815c4516 100644 --- a/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_node_geometry_IO_b.f90 +++ b/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_node_geometry_IO_b.f90 @@ -141,6 +141,7 @@ subroutine mpi_read_geometry_info_b(IO_param, nod_IO) integer(kind = kint_gl) :: num64 ! ! + call mpi_read_number_of_node_b(IO_param, nod_IO) call alloc_node_geometry_base(nod_IO) ! num64 = nod_IO%numnod diff --git a/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_surface_data_IO.f90 b/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_surface_data_IO.f90 index c0865ea2..6548c86e 100644 --- a/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_surface_data_IO.f90 +++ b/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_surface_data_IO.f90 @@ -67,7 +67,6 @@ subroutine mpi_read_surface_connection & call mpi_read_domain_info(IO_param, comm_IO) ! call mpi_skip_read(IO_param, len(hd_surf_connect())) - call mpi_read_num_element(IO_param, ele_IO) call mpi_read_element_info(IO_param, ele_IO) ! call mpi_skip_read(IO_param, len(hd_surf_on_ele())) @@ -133,7 +132,6 @@ subroutine mpi_read_surface_geometry(IO_param, nod_IO, sfed_IO) ! ! call mpi_skip_read(IO_param, len(hd_surf_point())) - call mpi_read_number_of_node(IO_param, nod_IO) call mpi_read_geometry_info(IO_param, nod_IO) ! call mpi_skip_read(IO_param, len(hd_surf_norm())) diff --git a/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_surface_data_IO_b.f90 b/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_surface_data_IO_b.f90 index 36eb4dcb..cbf8eede 100644 --- a/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_surface_data_IO_b.f90 +++ b/src/Fortran_libraries/PARALLEL_src/MPI_IO/MPI_surface_data_IO_b.f90 @@ -67,7 +67,6 @@ subroutine mpi_read_surface_connection_b & ! call mpi_read_domain_info_b(IO_param, comm_IO) ! - call mpi_read_number_of_element_b(IO_param, ele_IO) call mpi_read_element_info_b(IO_param, ele_IO) call mpi_read_surface_4_element_b(IO_param, sfed_IO) ! @@ -106,13 +105,14 @@ end subroutine mpi_write_surface_connection_b ! subroutine mpi_read_surface_geometry_b & & (IO_param, nod_IO, sfed_IO) +! + use MPI_node_geometry_IO_b ! type(calypso_MPI_IO_params), intent(inout) :: IO_param type(node_data), intent(inout) :: nod_IO type(surf_edge_IO_data), intent(inout) :: sfed_IO ! ! - call mpi_read_number_of_node_b(IO_param, nod_IO) call mpi_read_geometry_info_b(IO_param, nod_IO) ! call mpi_read_vect_in_ele_b(IO_param, nod_IO, sfed_IO) diff --git a/src/Fortran_libraries/PARALLEL_src/MPI_IO/Makefile.depends b/src/Fortran_libraries/PARALLEL_src/MPI_IO/Makefile.depends index 2ea64252..33ab36ef 100644 --- a/src/Fortran_libraries/PARALLEL_src/MPI_IO/Makefile.depends +++ b/src/Fortran_libraries/PARALLEL_src/MPI_IO/Makefile.depends @@ -36,7 +36,7 @@ MPI_mesh_data_IO_b.o: $(MPI_IO_DIR)/MPI_mesh_data_IO_b.f90 m_precision.o m_const $(F90) -c $(F90OPTFLAGS) $< MPI_mesh_file_IO.o: $(MPI_IO_DIR)/MPI_mesh_file_IO.f90 m_precision.o m_machine_parameter.o t_mesh_data.o t_calypso_mpi_IO_param.o MPI_ascii_data_IO.o MPI_mesh_data_IO.o mesh_data_IO.o groups_IO.o node_geometry_IO.o element_connect_IO.o m_fem_mesh_labels.o $(F90) -c $(F90OPTFLAGS) $< -MPI_mesh_file_IO_b.o: $(MPI_IO_DIR)/MPI_mesh_file_IO_b.f90 m_precision.o m_machine_parameter.o m_calypso_mpi_IO.o t_mesh_data.o t_calypso_mpi_IO_param.o MPI_ascii_data_IO.o MPI_mesh_data_IO_b.o MPI_groups_IO_b.o MPI_domain_data_IO_b.o +MPI_mesh_file_IO_b.o: $(MPI_IO_DIR)/MPI_mesh_file_IO_b.f90 m_precision.o m_machine_parameter.o m_calypso_mpi_IO.o t_mesh_data.o t_calypso_mpi_IO_param.o MPI_ascii_data_IO.o MPI_mesh_data_IO_b.o MPI_groups_IO_b.o MPI_domain_data_IO_b.o MPI_node_geometry_IO_b.o MPI_element_connect_IO_b.o $(F90) -c $(F90OPTFLAGS) $< MPI_node_geometry_IO.o: $(MPI_IO_DIR)/MPI_node_geometry_IO.f90 m_precision.o m_phys_constants.o t_geometry_data.o t_read_mesh_data.o t_surf_edge_IO.o MPI_position_IO.o MPI_vectors_IO.o $(F90) -c $(F90OPTFLAGS) $< diff --git a/src/Fortran_libraries/PARALLEL_src/MPI_IO/field_IO_select.F90 b/src/Fortran_libraries/PARALLEL_src/MPI_IO/field_IO_select.F90 index 7591b69b..13a7e54a 100644 --- a/src/Fortran_libraries/PARALLEL_src/MPI_IO/field_IO_select.F90 +++ b/src/Fortran_libraries/PARALLEL_src/MPI_IO/field_IO_select.F90 @@ -135,7 +135,7 @@ subroutine sel_write_step_FEM_field_file & ! file_name = set_FEM_fld_file_name(file_IO%file_prefix, & & file_IO%iflag_format, my_rank, istep_fld) - call sel_write_step_field_file (file_name, file_IO, t_IO, fld_IO) + call sel_write_step_field_file(file_name, file_IO, t_IO, fld_IO) ! end subroutine sel_write_step_FEM_field_file ! diff --git a/src/Fortran_libraries/PARALLEL_src/MPI_IO/field_block_MPI_IO_b.f90 b/src/Fortran_libraries/PARALLEL_src/MPI_IO/field_block_MPI_IO_b.f90 index 0334afb5..2f4f02d8 100644 --- a/src/Fortran_libraries/PARALLEL_src/MPI_IO/field_block_MPI_IO_b.f90 +++ b/src/Fortran_libraries/PARALLEL_src/MPI_IO/field_block_MPI_IO_b.f90 @@ -13,8 +13,9 @@ !! & i_time_step_IO, time_IO, delta_t_IO, & !! & nnod, num_field, ntot_comp, ncomp_field, & !! & field_name, d_nod, istack_merged) -!! subroutine read_field_header_mpi_b & -!! & (num_pe, IO_param_l, t_IO, nnod, istack_merged) +!! subroutine read_field_time_mpi_b(num_pe, IO_param_l, t_IO) +!! subroutine read_num_field_mpi_b & +!! & (num_pe, IO_param_l, nnod, istack_merged) !!@endverbatim ! module field_block_MPI_IO_b @@ -92,8 +93,7 @@ end subroutine write_field_data_mpi_b ! ----------------------------------------------------------------------- ! ----------------------------------------------------------------------- ! - subroutine read_field_header_mpi_b & - & (num_pe, IO_param_l, t_IO, nnod, istack_merged) + subroutine read_field_time_mpi_b(num_pe, IO_param_l, t_IO) ! use m_phys_constants use field_data_MPI_IO @@ -103,8 +103,6 @@ subroutine read_field_header_mpi_b & integer, intent(in) :: num_pe type(calypso_MPI_IO_params), intent(inout) :: IO_param_l type(time_data), intent(inout) :: t_IO - integer(kind = kint_gl), intent(inout) :: nnod - integer(kind = kint_gl), intent(inout) :: istack_merged(0:num_pe) ! ! call mpi_read_process_id_b(IO_param_l) @@ -112,13 +110,31 @@ subroutine read_field_header_mpi_b & call mpi_read_one_inthead_b(IO_param_l, t_IO%i_time_step) call mpi_read_one_realhead_b(IO_param_l, t_IO%time) call mpi_read_one_realhead_b(IO_param_l, t_IO%dt) +! + end subroutine read_field_time_mpi_b +! +! ----------------------------------------------------------------------- +! + subroutine read_num_field_mpi_b & + & (num_pe, IO_param_l, nnod, istack_merged) +! + use m_phys_constants + use field_data_MPI_IO + use MPI_binary_head_IO + use transfer_to_long_integers +! + integer, intent(in) :: num_pe + type(calypso_MPI_IO_params), intent(inout) :: IO_param_l + integer(kind = kint_gl), intent(inout) :: nnod + integer(kind = kint_gl), intent(inout) :: istack_merged(0:num_pe) +! ! call mpi_read_i8stack_head_b & & (IO_param_l, cast_long(num_pe), istack_merged) call sync_field_header_mpi & & (num_pe, IO_param_l%id_rank, istack_merged, nnod) ! - end subroutine read_field_header_mpi_b + end subroutine read_num_field_mpi_b ! ! ----------------------------------------------------------------------- ! diff --git a/src/Fortran_libraries/PARALLEL_src/MPI_IO/field_file_MPI_IO_b.f90 b/src/Fortran_libraries/PARALLEL_src/MPI_IO/field_file_MPI_IO_b.f90 index 80ade68c..0299f319 100644 --- a/src/Fortran_libraries/PARALLEL_src/MPI_IO/field_file_MPI_IO_b.f90 +++ b/src/Fortran_libraries/PARALLEL_src/MPI_IO/field_file_MPI_IO_b.f90 @@ -110,9 +110,10 @@ subroutine read_step_field_file_mpi_b & & (file_name, num_pe, id_rank, IO_param) ! call alloc_merged_field_stack(IO_param%nprocs_in, fld_IO) - call read_field_header_mpi_b(num_pe, IO_param, t_IO, & + call read_field_time_mpi_b(num_pe, IO_param, t_IO) + call read_num_field_mpi_b(num_pe, IO_param, & & num64, fld_IO%istack_numnod_IO) - fld_IO%nnod_IO = num64 + fld_IO%nnod_IO = int(num64, KIND(fld_IO%nnod_IO)) call mpi_read_one_inthead_b(IO_param, fld_IO%num_field_IO) ! num64 = fld_IO%num_field_IO @@ -160,9 +161,10 @@ subroutine read_alloc_stp_fld_file_mpi_b & & (file_name, num_pe, id_rank, IO_param) ! call alloc_merged_field_stack(IO_param%nprocs_in, fld_IO) - call read_field_header_mpi_b(num_pe, IO_param, t_IO, & + call read_field_time_mpi_b(num_pe, IO_param, t_IO) + call read_num_field_mpi_b(num_pe, IO_param, & & num64, fld_IO%istack_numnod_IO) - fld_IO%nnod_IO = num64 + fld_IO%nnod_IO = int(num64, KIND(fld_IO%nnod_IO)) call mpi_read_one_inthead_b(IO_param, fld_IO%num_field_IO) ! num64 = fld_IO%num_field_IO @@ -217,9 +219,10 @@ subroutine read_alloc_stp_fld_head_mpi_b & & (file_name, num_pe, id_rank, IO_param) ! call alloc_merged_field_stack(IO_param%nprocs_in, fld_IO) - call read_field_header_mpi_b(num_pe, IO_param, t_IO, & + call read_field_time_mpi_b(num_pe, IO_param, t_IO) + call read_num_field_mpi_b(num_pe, IO_param, & & num64, fld_IO%istack_numnod_IO) - fld_IO%nnod_IO = num64 + fld_IO%nnod_IO = int(num64, KIND(fld_IO%nnod_IO)) call mpi_read_one_inthead_b(IO_param, fld_IO%num_field_IO) ! num64 = fld_IO%num_field_IO diff --git a/src/Fortran_libraries/PARALLEL_src/MPI_IO/ucd_field_MPI_IO_b.f90 b/src/Fortran_libraries/PARALLEL_src/MPI_IO/ucd_field_MPI_IO_b.f90 index c4c11e37..c2b5a574 100644 --- a/src/Fortran_libraries/PARALLEL_src/MPI_IO/ucd_field_MPI_IO_b.f90 +++ b/src/Fortran_libraries/PARALLEL_src/MPI_IO/ucd_field_MPI_IO_b.f90 @@ -106,8 +106,9 @@ subroutine read_ucd_field_file_mpi_b & ! call open_read_mpi_file_b & & (file_name, num_pe, id_rank, IO_param) - call read_field_header_mpi_b & - & (num_pe, IO_param, t_IO, ucd%nnod, ucd%istack_merged_nod) + call read_field_time_mpi_b(num_pe, IO_param, t_IO) + call read_num_field_mpi_b & + & (num_pe, IO_param, ucd%nnod, ucd%istack_merged_nod) call mpi_read_one_inthead_b(IO_param, ucd%num_field) ! call mpi_read_mul_inthead_b & @@ -147,8 +148,9 @@ subroutine read_alloc_ucd_fld_file_mpi_b & ! call open_read_mpi_file_b & & (file_name, num_pe, id_rank, IO_param) - call read_field_header_mpi_b & - & (num_pe, IO_param, t_IO, ucd%nnod, ucd%istack_merged_nod) + call read_field_time_mpi_b(num_pe, IO_param, t_IO) + call read_num_field_mpi_b & + & (num_pe, IO_param, ucd%nnod, ucd%istack_merged_nod) call mpi_read_one_inthead_b(IO_param, ucd%num_field) ! call allocate_ucd_phys_name(ucd) @@ -196,8 +198,9 @@ subroutine read_alloc_ucd_prm_file_mpi_b & & 'read binary data by MPI-IO: ', trim(file_name) call open_read_mpi_file_b & & (file_name, num_pe, id_rank, IO_param) - call read_field_header_mpi_b & - & (num_pe, IO_param, t_IO, ucd%nnod, ucd%istack_merged_nod) + call read_field_time_mpi_b(num_pe, IO_param, t_IO) + call read_num_field_mpi_b & + & (num_pe, IO_param, ucd%nnod, ucd%istack_merged_nod) call mpi_read_one_inthead_b(IO_param, ucd%num_field) ! call allocate_ucd_phys_name(ucd) diff --git a/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_edge_data_IO.f90 b/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_edge_data_IO.f90 index 6fd2ac38..bc50d073 100644 --- a/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_edge_data_IO.f90 +++ b/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_edge_data_IO.f90 @@ -142,7 +142,6 @@ subroutine gz_mpi_read_edge_geometry(IO_param, nod_IO, sfed_IO) ! ! call gz_mpi_skip_header(IO_param, len(hd_edge_point())) - call gz_mpi_read_number_of_node(IO_param, nod_IO) call gz_mpi_read_geometry_info(IO_param, nod_IO) ! call gz_mpi_skip_header(IO_param, len(hd_edge_dir())) diff --git a/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_edge_data_IO_b.f90 b/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_edge_data_IO_b.f90 index 997993ae..d0e86a23 100644 --- a/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_edge_data_IO_b.f90 +++ b/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_edge_data_IO_b.f90 @@ -68,7 +68,6 @@ subroutine gz_mpi_read_edge_connect_b & ! call gz_mpi_read_domain_info_b(IO_param, comm_IO) ! - call gz_mpi_read_num_element_b(IO_param, ele_IO) call gz_mpi_read_ele_info_b(IO_param, ele_IO) ! call gz_mpi_read_surf_4_elem_b(IO_param, sfed_IO) @@ -114,7 +113,6 @@ subroutine gz_mpi_read_edge_geometry_b & type(surf_edge_IO_data), intent(inout) :: sfed_IO ! ! - call gz_mpi_read_number_of_node_b(IO_param, nod_IO) call gz_mpi_read_geometry_info_b(IO_param, nod_IO) ! call gz_mpi_read_vect_in_ele_b(IO_param, nod_IO, sfed_IO) diff --git a/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_element_connect_IO_b.f90 b/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_element_connect_IO_b.f90 index 09637c5b..0e7e7844 100644 --- a/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_element_connect_IO_b.f90 +++ b/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_element_connect_IO_b.f90 @@ -130,7 +130,9 @@ subroutine gz_mpi_read_ele_info_b(IO_param, ele_IO) integer (kind = kint) :: i ! ! + call gz_mpi_read_num_element_b(IO_param, ele_IO) call alloc_element_types(ele_IO) + num64 = ele_IO%numele call gz_mpi_read_int_vector_b & & (IO_param, num64, ele_IO%elmtyp) diff --git a/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_element_file_IO.f90 b/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_element_file_IO.f90 index 4ea888db..aead3a11 100644 --- a/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_element_file_IO.f90 +++ b/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_element_file_IO.f90 @@ -216,7 +216,6 @@ subroutine gz_mpi_read_ele_geometry(IO_param, nod_IO, sfed_IO) ! ! call gz_mpi_skip_header(IO_param, len(hd_ecomm_point())) - call gz_mpi_read_number_of_node(IO_param, nod_IO) call gz_mpi_read_geometry_info(IO_param, nod_IO) ! call gz_mpi_skip_header(IO_param, len(hd_ecomm_vol())) diff --git a/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_element_file_IO_b.f90 b/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_element_file_IO_b.f90 index ec1d8a3f..771bcaca 100644 --- a/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_element_file_IO_b.f90 +++ b/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_element_file_IO_b.f90 @@ -209,7 +209,6 @@ subroutine gz_mpi_read_ele_geometry_b(IO_param, nod_IO, sfed_IO) type(surf_edge_IO_data), intent(inout) :: sfed_IO ! ! - call gz_mpi_read_number_of_node_b(IO_param, nod_IO) call gz_mpi_read_geometry_info_b(IO_param, nod_IO) ! call gz_mpi_read_scl_in_ele_b(IO_param, nod_IO, sfed_IO) diff --git a/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_mesh_data_IO.f90 b/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_mesh_data_IO.f90 index 6fa244e6..b9c3ba77 100644 --- a/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_mesh_data_IO.f90 +++ b/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_mesh_data_IO.f90 @@ -14,8 +14,6 @@ !! type(mesh_geometry), intent(in) :: mesh_IO !! type(mesh_groups), intent(in) :: mesh_group_IO !! -!! subroutine gz_mpi_read_num_node(IO_param, mesh_IO) -!! subroutine gz_mpi_read_num_node_ele(IO_param, mesh_IO) !! subroutine gz_mpi_read_geometry_data(IO_param, mesh_IO) !! subroutine gz_mpi_read_mesh_groups(IO_param, mesh_group_IO) !! type(calypso_MPI_IO_params), intent(inout) :: IO_param @@ -105,7 +103,7 @@ end subroutine gz_mpi_write_mesh_groups !------------------------------------------------------------------ !------------------------------------------------------------------ ! - subroutine gz_mpi_read_num_node(IO_param, mesh_IO) + subroutine gz_mpi_read_geometry_data(IO_param, mesh_IO) ! type(calypso_MPI_IO_params), intent(inout) :: IO_param type(mesh_geometry), intent(inout) :: mesh_IO @@ -115,38 +113,11 @@ subroutine gz_mpi_read_num_node(IO_param, mesh_IO) call gz_mpi_read_domain_info(IO_param, mesh_IO%nod_comm) ! call gz_mpi_skip_header(IO_param, len(hd_fem_node())) - call gz_mpi_read_number_of_node(IO_param, mesh_IO%node) -! - end subroutine gz_mpi_read_num_node -! -!------------------------------------------------------------------ -! - subroutine gz_mpi_read_num_node_ele(IO_param, mesh_IO) -! - type(calypso_MPI_IO_params), intent(inout) :: IO_param - type(mesh_geometry), intent(inout) :: mesh_IO -! -! - call gz_mpi_read_num_node(IO_param, mesh_IO) call gz_mpi_read_geometry_info(IO_param, mesh_IO%node) ! ! ---- read element data ------- -! call gz_mpi_skip_header(IO_param, len(hd_fem_elem())) call gz_mpi_read_num_element(IO_param, mesh_IO%ele) -! - end subroutine gz_mpi_read_num_node_ele -! -!------------------------------------------------------------------ -! - subroutine gz_mpi_read_geometry_data(IO_param, mesh_IO) -! - type(calypso_MPI_IO_params), intent(inout) :: IO_param - type(mesh_geometry), intent(inout) :: mesh_IO -! -! - call gz_mpi_read_num_node_ele(IO_param, mesh_IO) -! call gz_mpi_read_element_info(IO_param, mesh_IO%ele) ! ! ---- import & export diff --git a/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_mesh_data_IO_b.f90 b/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_mesh_data_IO_b.f90 index f46e6c9f..377834ce 100644 --- a/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_mesh_data_IO_b.f90 +++ b/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_mesh_data_IO_b.f90 @@ -14,8 +14,6 @@ !! type(mesh_geometry), intent(in) :: mesh_IO !! type(mesh_groups), intent(in) :: mesh_group_IO !! -!! subroutine gz_mpi_read_num_node_b(IO_param, mesh_IO) -!! subroutine gz_mpi_read_num_node_ele_b(IO_param, mesh_IO) !! subroutine gz_mpi_read_geometry_data_b(IO_param, mesh_IO) !! subroutine gz_mpi_read_mesh_groups_b(IO_param, mesh_group_IO) !! type(calypso_MPI_IO_params), intent(inout) :: IO_param @@ -85,7 +83,7 @@ end subroutine gz_mpi_write_mesh_groups_b !------------------------------------------------------------------ !------------------------------------------------------------------ ! - subroutine gz_mpi_read_num_node_b(IO_param, mesh_IO) + subroutine gz_mpi_read_geometry_data_b(IO_param, mesh_IO) ! use m_error_IDs ! @@ -95,44 +93,11 @@ subroutine gz_mpi_read_num_node_b(IO_param, mesh_IO) ! call gz_mpi_read_domain_info_b(IO_param, mesh_IO%nod_comm) ! - call gz_mpi_read_number_of_node_b(IO_param, mesh_IO%node) -! - end subroutine gz_mpi_read_num_node_b -! -!------------------------------------------------------------------ -! - subroutine gz_mpi_read_num_node_ele_b(IO_param, mesh_IO) -! - use m_error_IDs -! - type(calypso_MPI_IO_params), intent(inout) :: IO_param - type(mesh_geometry), intent(inout) :: mesh_IO -! -! - call gz_mpi_read_num_node_b(IO_param, mesh_IO) call gz_mpi_read_geometry_info_b(IO_param, mesh_IO%node) -! ! ---- read element data ------- -! - call gz_mpi_read_num_element_b(IO_param, mesh_IO%ele) -! - end subroutine gz_mpi_read_num_node_ele_b -! -!------------------------------------------------------------------ -! - subroutine gz_mpi_read_geometry_data_b(IO_param, mesh_IO) -! - use m_error_IDs -! - type(calypso_MPI_IO_params), intent(inout) :: IO_param - type(mesh_geometry), intent(inout) :: mesh_IO -! -! - call gz_mpi_read_num_node_ele_b(IO_param, mesh_IO) call gz_mpi_read_ele_info_b(IO_param, mesh_IO%ele) ! ! ---- import & export -! call gz_mpi_read_import_data_b(IO_param, mesh_IO%nod_comm) call gz_mpi_read_export_data_b(IO_param, mesh_IO%nod_comm) ! diff --git a/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_mesh_file_IO.f90 b/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_mesh_file_IO.f90 index a79662ba..c907afed 100644 --- a/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_mesh_file_IO.f90 +++ b/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_mesh_file_IO.f90 @@ -103,7 +103,11 @@ subroutine gz_mpi_read_node_size & ! call open_read_mpi_file & & (file_name, num_pe, id_rank, IO_param) - call gz_mpi_read_num_node(IO_param, mesh_IO) + call gz_mpi_skip_header(IO_param, len(hd_fem_para())) + call gz_mpi_read_domain_info(IO_param, mesh_IO%nod_comm) +! + call gz_mpi_skip_header(IO_param, len(hd_fem_node())) + call gz_mpi_read_number_of_node(IO_param, mesh_IO%node) call close_mpi_file(IO_param) ! end subroutine gz_mpi_read_node_size @@ -123,7 +127,15 @@ subroutine gz_mpi_read_geometry_size & ! call open_read_mpi_file & & (file_name, num_pe, id_rank, IO_param) - call gz_mpi_read_num_node_ele(IO_param, mesh_IO) + + call gz_mpi_skip_header(IO_param, len(hd_fem_para())) + call gz_mpi_read_domain_info(IO_param, mesh_IO%nod_comm) +! + call gz_mpi_skip_header(IO_param, len(hd_fem_node())) + call gz_mpi_read_geometry_info(IO_param, mesh_IO%node) +! ---- read element data ------- + call gz_mpi_skip_header(IO_param, len(hd_fem_elem())) + call gz_mpi_read_num_element(IO_param, mesh_IO%ele) call close_mpi_file(IO_param) ! end subroutine gz_mpi_read_geometry_size diff --git a/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_mesh_file_IO_b.f90 b/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_mesh_file_IO_b.f90 index 3e12eb6a..8a29d911 100644 --- a/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_mesh_file_IO_b.f90 +++ b/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_mesh_file_IO_b.f90 @@ -118,7 +118,8 @@ subroutine gz_mpi_read_node_size_b & ! call open_read_gz_mpi_file_b & & (file_name, num_pe, id_rank, IO_param) - call gz_mpi_read_num_node_b(IO_param, mesh_IO) + call gz_mpi_read_domain_info_b(IO_param, mesh_IO%nod_comm) + call gz_mpi_read_number_of_node_b(IO_param, mesh_IO%node) call close_mpi_file(IO_param) ! end subroutine gz_mpi_read_node_size_b @@ -143,7 +144,10 @@ subroutine gz_mpi_read_geometry_size_b & ! call open_read_gz_mpi_file_b & & (file_name, num_pe, id_rank, IO_param) - call gz_mpi_read_num_node_ele_b(IO_param, mesh_IO) + call gz_mpi_read_domain_info_b(IO_param, mesh_IO%nod_comm) + call gz_mpi_read_geometry_info_b(IO_param, mesh_IO%node) +! ---- read element data ------- + call gz_mpi_read_num_element_b(IO_param, mesh_IO%ele) call close_mpi_file(IO_param) ! end subroutine gz_mpi_read_geometry_size_b diff --git a/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_node_geometry_IO.f90 b/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_node_geometry_IO.f90 index 72bcfc50..96b48ae0 100644 --- a/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_node_geometry_IO.f90 +++ b/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_node_geometry_IO.f90 @@ -115,6 +115,7 @@ subroutine gz_mpi_read_geometry_info(IO_param, nod_IO) type(node_data), intent(inout) :: nod_IO ! ! + call gz_mpi_read_number_of_node(IO_param, nod_IO) call alloc_node_geometry_base(nod_IO) ! call gz_mpi_read_node_position & diff --git a/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_node_geometry_IO_b.f90 b/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_node_geometry_IO_b.f90 index bd91b6a9..e311c6e2 100644 --- a/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_node_geometry_IO_b.f90 +++ b/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_node_geometry_IO_b.f90 @@ -127,6 +127,7 @@ subroutine gz_mpi_read_geometry_info_b(IO_param, nod_IO) integer(kind = kint_gl) :: num64 ! ! + call gz_mpi_read_number_of_node_b(IO_param, nod_IO) call alloc_node_geometry_base(nod_IO) ! num64 = nod_IO%numnod diff --git a/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_surface_data_IO.f90 b/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_surface_data_IO.f90 index d939f3f3..3daa856b 100644 --- a/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_surface_data_IO.f90 +++ b/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_surface_data_IO.f90 @@ -135,7 +135,6 @@ subroutine gz_mpi_read_surf_geometry(IO_param, nod_IO, sfed_IO) ! ! call gz_mpi_skip_header(IO_param, len(hd_surf_point())) - call gz_mpi_read_number_of_node(IO_param, nod_IO) call gz_mpi_read_geometry_info(IO_param, nod_IO) ! call gz_mpi_skip_header(IO_param, len(hd_surf_norm())) diff --git a/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_surface_data_IO_b.f90 b/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_surface_data_IO_b.f90 index 5eb5344a..4b3c42d2 100644 --- a/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_surface_data_IO_b.f90 +++ b/src/Fortran_libraries/PARALLEL_src/MPI_ZLIB_IO/gz_MPI_surface_data_IO_b.f90 @@ -67,7 +67,6 @@ subroutine gz_mpi_read_surf_connect_b & ! call gz_mpi_read_domain_info_b(IO_param, comm_IO) ! - call gz_mpi_read_num_element_b(IO_param, ele_IO) call gz_mpi_read_ele_info_b(IO_param, ele_IO) call gz_mpi_read_surf_4_elem_b(IO_param, sfed_IO) ! @@ -111,7 +110,6 @@ subroutine gz_mpi_read_surf_geometry_b & type(surf_edge_IO_data), intent(inout) :: sfed_IO ! ! - call gz_mpi_read_number_of_node_b(IO_param, nod_IO) call gz_mpi_read_geometry_info_b(IO_param, nod_IO) ! call gz_mpi_read_vect_in_ele_b(IO_param, nod_IO, sfed_IO) diff --git a/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/init_rms_4_sph_spectr.f90 b/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/init_rms_4_sph_spectr.f90 index be1823f6..cbaf503d 100644 --- a/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/init_rms_4_sph_spectr.f90 +++ b/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/init_rms_4_sph_spectr.f90 @@ -62,7 +62,7 @@ subroutine s_init_rms_4_sph_spectr(sph_params, sph_rj, rj_fld, & integer(kind = kint) :: i, k ! ! - call set_all_layer_sph_spectr(sph_params, sph_rj, pwr) + call set_all_layer_sph_spectr(sph_rj, pwr) if(iflag_dipolarity .gt. 0) then call append_CMB_layer_f_dipolarity(sph_params, pwr) end if diff --git a/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/init_sph_spec_radial_param.f90 b/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/init_sph_spec_radial_param.f90 index beaee4c6..017a27b4 100644 --- a/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/init_sph_spec_radial_param.f90 +++ b/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/init_sph_spec_radial_param.f90 @@ -12,7 +12,7 @@ !! type(sph_shell_parameters), intent(in) :: sph_params !! type(sph_rj_grid), intent(in) :: sph_rj !! type(sph_vol_mean_squares), intent(inout) :: v_pwr -!! subroutine set_all_layer_sph_spectr(sph_params, sph_rj, pwr) +!! subroutine set_all_layer_sph_spectr(sph_rj, pwr) !! subroutine append_CMB_layer_f_dipolarity(sph_params, pwr) !! subroutine set_layers_4_sph_spectr(sph_rj, pwr) !! type(sph_shell_parameters), intent(in) :: sph_params @@ -115,9 +115,8 @@ end subroutine init_sph_vol_spectr_r_param ! ! ---------------------------------------------------------------------- ! - subroutine set_all_layer_sph_spectr(sph_params, sph_rj, pwr) + subroutine set_all_layer_sph_spectr(sph_rj, pwr) ! - type(sph_shell_parameters), intent(in) :: sph_params type(sph_rj_grid), intent(in) :: sph_rj ! type(sph_mean_squares), intent(inout) :: pwr diff --git a/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/parallel_load_data_4_sph.f90 b/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/parallel_load_data_4_sph.f90 index de98ce7d..608cb378 100644 --- a/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/parallel_load_data_4_sph.f90 +++ b/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/parallel_load_data_4_sph.f90 @@ -35,6 +35,12 @@ !! type(sph_rj_grid), intent(inout) :: sph_rj !! type(sph_comm_tbl), intent(inout) :: comm_rj !! +!! subroutine set_radius_dat_sph_MHD & +!! & (radial_rj_grp, sph_params, sph_rj) +!! type(group_data), intent(in) :: radial_rj_grp +!! type(sph_rj_grid), intent(inout) :: sph_rj +!! type(sph_shell_parameters), intent(inout) :: sph_params +!! !! subroutine dealloc_sph_modes(sph, comms_sph, sph_grps) !! type(sph_grids), intent(inout) :: sph !! type(sph_comm_tables), intent(inout) :: comms_sph @@ -62,8 +68,6 @@ module parallel_load_data_4_sph implicit none ! type(sph_file_data_type), save, private :: sph_file_l -! - private :: set_radius_dat_sph_MHD ! ! ----------------------------------------------------------------------- ! diff --git a/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/radial_interpolation.f90 b/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/radial_interpolation.f90 index cc86e826..155f0439 100644 --- a/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/radial_interpolation.f90 +++ b/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/radial_interpolation.f90 @@ -212,19 +212,23 @@ subroutine interpolate_radial_field & ! real (kind=kreal), intent(inout) :: d_r(nri_new,ncomp) ! - integer(kind = kint) :: k, j, nd, i1, i2 + integer(kind = kint) :: k, nd, i1, i2 ! ! !$omp parallel private(nd) do nd = 1, ncomp -!$omp do private(k,j,i1,i2) +!$omp do private(k,i1,i2) do k = 1, nri_new - do j = 1, 1 + if(k_old2new_in(k) .le. 0) then + d_r(k,nd) = d_IO(1,nd) + else if(k_old2new_out(k) .gt. n_rj_org) then + d_r(k,nd) = d_IO(n_rj_org,nd) + else i1 = k_old2new_in(k) i2 = k_old2new_out(k) d_r(k,nd) = coef_old2new_in(k) * d_IO(i1,nd) & & + (one - coef_old2new_in(k)) * d_IO(i2,nd) - end do + end if end do !$omp end do nowait end do diff --git a/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/t_sph_matrices.f90 b/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/t_sph_matrices.f90 index 3eedd9ff..67a27c4d 100644 --- a/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/t_sph_matrices.f90 +++ b/src/Fortran_libraries/PARALLEL_src/SPH_SHELL_src/t_sph_matrices.f90 @@ -8,6 +8,13 @@ !! !!@verbatim !! subroutine alloc_band_mat_sph(nband, sph_rj, smat) +!! integer(kind = kint), intent(in) :: nband +!! type(sph_rj_grid), intent(in) :: sph_rj +!! type(band_matrices_type), intent(inout) :: smat +!! subroutine alloc_band_matrices_type(nband, nri, jmax, smat) +!! integer(kind = kint), intent(in) :: nband, nri, jmax +!! type(band_matrices_type), intent(inout) :: smat +!! !! subroutine set_unit_on_diag(smat) !! subroutine dealloc_band_mat_sph(smat) !! @@ -75,9 +82,23 @@ subroutine alloc_band_mat_sph(nband, sph_rj, smat) type(sph_rj_grid), intent(in) :: sph_rj type(band_matrices_type), intent(inout) :: smat ! + call alloc_band_matrices_type & + & (nband, sph_rj%nidx_rj(1), sph_rj%nidx_rj(2), smat) +! + end subroutine alloc_band_mat_sph +! +! ----------------------------------------------------------------------- ! - smat%n_vect = sph_rj%nidx_rj(1) - smat%n_comp = sph_rj%nidx_rj(2) + subroutine alloc_band_matrices_type(nband, nri, jmax, smat) +! + use t_spheric_rj_data +! + integer(kind = kint), intent(in) :: nband, nri, jmax + type(band_matrices_type), intent(inout) :: smat +! +! + smat%n_vect = nri + smat%n_comp = jmax smat%n_band = nband smat%n_band_lu = 2*nband - 1 ! @@ -92,7 +113,7 @@ subroutine alloc_band_mat_sph(nband, sph_rj, smat) smat%det = 0.0d0 smat%i_pivot = 0 ! - end subroutine alloc_band_mat_sph + end subroutine alloc_band_matrices_type ! ! ----------------------------------------------------------------------- ! diff --git a/src/Fortran_libraries/SERIAL_src/BASE/cvt_xyz_tensor_2_cyl_smp.f90 b/src/Fortran_libraries/SERIAL_src/BASE/cvt_xyz_tensor_2_cyl_smp.f90 index 3476ce26..3e9c3fab 100644 --- a/src/Fortran_libraries/SERIAL_src/BASE/cvt_xyz_tensor_2_cyl_smp.f90 +++ b/src/Fortran_libraries/SERIAL_src/BASE/cvt_xyz_tensor_2_cyl_smp.f90 @@ -20,12 +20,11 @@ !! & tensor, t_sp, xx, yy, s, a_s) !! subroutine cal_sz_tensor_smp(np_smp, numnod, inod_smp_stack, & !! & tensor, t_sz, xx, yy, s, a_s) -!! subroutine cal_pp_cyl_tensor_smp(np_smp, numnod, inod_smp_stack,& -!! & tensor, t_pp, xx, yy, s, a_s) -!! subroutine cal_pz_tensor_smp(np_smp, numnod, inod_smp_stack, & -!! & tensor, t_pz, xx, yy, s, a_s) -!! subroutine cal_zz_tensor_smp(np_smp, numnod, inod_smp_stack, & -!! & tensor, t_zz) +!! subroutine cal_pp_cyl_tensor_smp(numnod, tensor, t_pp, & +!! & xx, yy, s, a_s) +!! subroutine cal_pz_tensor_smp(numnod, tensor, t_pz, & +!! & xx, yy, s, a_s) +!! subroutine cal_zz_tensor_smp(numnod, tensor, t_zz) !!@endverbatim !! !!@n @param np_smp Number of SMP processes @@ -331,11 +330,10 @@ end subroutine cal_sz_tensor_smp ! ! ----------------------------------------------------------------------- ! - subroutine cal_pp_cyl_tensor_smp(np_smp, numnod, inod_smp_stack, & - & tensor, t_pp, xx, yy, s, a_s) + subroutine cal_pp_cyl_tensor_smp(numnod, tensor, t_pp, & + & xx, yy, s, a_s) ! - integer (kind = kint), intent(in) :: np_smp, numnod - integer (kind = kint), intent(in) :: inod_smp_stack(0:np_smp) + integer (kind = kint), intent(in) :: numnod real(kind=kreal), intent(in) :: tensor(numnod,6) real(kind=kreal), intent(in) :: xx(numnod), yy(numnod) real(kind=kreal), intent(in) :: s(numnod) @@ -343,29 +341,24 @@ subroutine cal_pp_cyl_tensor_smp(np_smp, numnod, inod_smp_stack, & ! real(kind=kreal), intent(inout) :: t_pp(numnod) ! - integer (kind = kint) :: ip, inod, ist, ied + integer (kind = kint) :: inod real(kind=kreal) :: txx, txy, tyy ! ! -!$omp do private(inod,ist,ied,txx,txy,tyy) - do ip = 1, np_smp - ist = inod_smp_stack(ip-1) + 1 - ied = inod_smp_stack(ip) - do inod = ist, ied - txx = tensor(inod,1) - txy = tensor(inod,2) - tyy = tensor(inod,4) -! - if ( s(inod).eq.0.0 ) then - t_pp(inod) = tyy - else - t_pp(inod) = ( txx * yy(inod)*yy(inod) & - & - two*txy * xx(inod)*yy(inod) & - & + tyy * xx(inod)*xx(inod) ) & - & * a_s(inod) * a_s(inod) - end if -! - end do +!$omp do private(inod,txx,txy,tyy) + do inod = 1, numnod + txx = tensor(inod,1) + txy = tensor(inod,2) + tyy = tensor(inod,4) +! + if ( s(inod).eq.0.0 ) then + t_pp(inod) = tyy + else + t_pp(inod) = ( txx * yy(inod)*yy(inod) & + & - two*txy * xx(inod)*yy(inod) & + & + tyy * xx(inod)*xx(inod) ) & + & * a_s(inod) * a_s(inod) + end if end do !$omp end do nowait ! @@ -373,11 +366,10 @@ end subroutine cal_pp_cyl_tensor_smp ! ! ----------------------------------------------------------------------- ! - subroutine cal_pz_tensor_smp(np_smp, numnod, inod_smp_stack, & - & tensor, t_pz, xx, yy, s, a_s) + subroutine cal_pz_tensor_smp(numnod, tensor, t_pz, & + & xx, yy, s, a_s) ! - integer (kind = kint), intent(in) :: np_smp, numnod - integer (kind = kint), intent(in) :: inod_smp_stack(0:np_smp) + integer (kind = kint), intent(in) :: numnod real(kind=kreal), intent(in) :: tensor(numnod,6) real(kind=kreal), intent(in) :: xx(numnod), yy(numnod) real(kind=kreal), intent(in) :: s(numnod) @@ -385,26 +377,21 @@ subroutine cal_pz_tensor_smp(np_smp, numnod, inod_smp_stack, & ! real(kind=kreal), intent(inout) :: t_pz(numnod) ! - integer (kind = kint) :: ip, inod, ist, ied + integer (kind = kint) :: inod real(kind=kreal) :: txz, tyz ! ! -!$omp do private(inod,ist,ied,txz,tyz) - do ip = 1, np_smp - ist = inod_smp_stack(ip-1) + 1 - ied = inod_smp_stack(ip) - do inod = ist, ied - txz = tensor(inod,3) - tyz = tensor(inod,5) -! - if ( s(inod).eq.0.0 ) then - t_pz(inod) = tyz - else - t_pz(inod) = ( -txz * yy(inod) & - & + tyz * xx(inod) ) * a_s(inod) - end if +!$omp do private(inod,txz,tyz) + do inod = 1, numnod + txz = tensor(inod,3) + tyz = tensor(inod,5) ! - end do + if ( s(inod).eq.0.0 ) then + t_pz(inod) = tyz + else + t_pz(inod) = ( -txz * yy(inod) & + & + tyz * xx(inod) ) * a_s(inod) + end if end do !$omp end do nowait ! @@ -412,27 +399,16 @@ end subroutine cal_pz_tensor_smp ! ! ----------------------------------------------------------------------- ! - subroutine cal_zz_tensor_smp(np_smp, numnod, inod_smp_stack, & - & tensor, t_zz) -! - integer (kind = kint), intent(in) :: np_smp, numnod - integer (kind = kint), intent(in) :: inod_smp_stack(0:np_smp) - real(kind=kreal), intent(in) :: tensor(numnod,6) + subroutine cal_zz_tensor_smp(numnod, tensor, t_zz) ! - real(kind=kreal), intent(inout) :: t_zz(numnod) -! - integer (kind = kint) :: ip, inod, ist, ied + integer (kind = kint), intent(in) :: numnod + real(kind=kreal), intent(in) :: tensor(numnod,6) ! + real(kind=kreal), intent(inout) :: t_zz(numnod) ! -!$omp do private(inod,ist,ied) - do ip = 1, np_smp - ist = inod_smp_stack(ip-1) + 1 - ied = inod_smp_stack(ip) - do inod = ist, ied - t_zz(inod) = tensor(inod,6) - end do - end do -!$omp end do nowait +!$omp workshare + t_zz(1:numnod) = tensor(1:numnod,6) +!$omp end workshare nowait ! end subroutine cal_zz_tensor_smp ! diff --git a/src/Fortran_libraries/SERIAL_src/BASE/t_time_data.f90 b/src/Fortran_libraries/SERIAL_src/BASE/t_time_data.f90 index 49c8846a..9f19557a 100644 --- a/src/Fortran_libraries/SERIAL_src/BASE/t_time_data.f90 +++ b/src/Fortran_libraries/SERIAL_src/BASE/t_time_data.f90 @@ -35,6 +35,8 @@ module t_time_data ! !> Structure for time data type time_data +!> flag for frexible time step + logical :: flag_flex_step = .FALSE. !> Time step integer(kind = kint) :: i_time_step !> Time @f$ t @f$ @@ -57,6 +59,8 @@ module t_time_data real(kind=kreal) :: elapsed_local !> Maximum elapsed time real(kind=kreal) :: elapsed_max +!> + logical :: flag_terminate_by_elapsed = .FALSE. end type finish_data ! ! ------------------------------------------------------------------- diff --git a/src/Fortran_libraries/SERIAL_src/IO/ctl_data_4_time_steps_IO.f90 b/src/Fortran_libraries/SERIAL_src/IO/ctl_data_4_time_steps_IO.f90 index cce0d44f..1065621c 100644 --- a/src/Fortran_libraries/SERIAL_src/IO/ctl_data_4_time_steps_IO.f90 +++ b/src/Fortran_libraries/SERIAL_src/IO/ctl_data_4_time_steps_IO.f90 @@ -38,9 +38,11 @@ !! delta_t_isosurface_ctl 1.0e-3 !! delta_t_map_projection_ctl 1.0e-3 !! delta_t_pvr_ctl 1.0e-2 -!! delta_t_fline_ctl 1.0e-1 !! delta_t_LIC_ctl 1.0e-1 -!! delta_t_field_ctl 1.0e-3 +!! delta_t_fline_ctl 1.0e-1 +!! delta_t_fline_ctl 1.0e-1 +!! +!! delta_t_tracer_output 1.0e-3 !! delta_t_monitor_ctl 1.0e-4 !! delta_t_sgs_coefs_ctl 2.0e-5 !! delta_t_boundary_ctl 1.0e-4 @@ -139,6 +141,8 @@ module ctl_data_4_time_steps_IO & :: hd_delta_t_lic = 'delta_t_LIC_ctl' character(len=kchara), parameter, private & & :: hd_delta_t_fline = 'delta_t_fline_ctl' + character(len=kchara), parameter, private & + & :: hd_delta_t_tracer = 'delta_t_tracer_output' ! character(len=kchara), parameter, private & & :: hd_delta_t_ucd = 'delta_t_field_ctl' @@ -167,9 +171,11 @@ module ctl_data_4_time_steps_IO character(len=kchara), parameter, private & & :: hd_i_step_pvr = 'i_step_pvr_ctl' character(len=kchara), parameter, private & + & :: hd_i_step_lic = 'i_step_LIC_ctl' + character(len=kchara), parameter, private & & :: hd_i_step_fline = 'i_step_fline_ctl' character(len=kchara), parameter, private & - & :: hd_i_step_lic = 'i_step_LIC_ctl' + & :: hd_i_step_tracer = 'i_step_tracer_output' ! character(len=kchara), parameter, private & & :: hd_i_step_ucd = 'i_step_field_ctl' @@ -248,10 +254,13 @@ subroutine read_control_time_step_data & ! call read_real_ctl_type(c_buf, hd_delta_t_pvr, & & tctl%delta_t_pvr_ctl) - call read_real_ctl_type(c_buf, hd_delta_t_fline, & - & tctl%delta_t_fline_ctl) call read_real_ctl_type(c_buf, hd_delta_t_lic, & & tctl%delta_t_lic_ctl) +! + call read_real_ctl_type(c_buf, hd_delta_t_fline, & + & tctl%delta_t_fline_ctl) + call read_real_ctl_type(c_buf, hd_delta_t_tracer, & + & tctl%delta_t_tracer_output_ctl) ! call read_real_ctl_type(c_buf, hd_delta_t_ucd, & & tctl%delta_t_field_ctl) @@ -294,8 +303,11 @@ subroutine read_control_time_step_data & & tctl%i_step_pvr_ctl) call read_integer_ctl_type(c_buf, hd_i_step_lic, & & tctl%i_step_lic_ctl) +! call read_integer_ctl_type(c_buf, hd_i_step_fline, & & tctl%i_step_fline_ctl) + call read_integer_ctl_type(c_buf, hd_i_step_tracer, & + & tctl%i_step_tracer_output_ctl) ! call read_integer_ctl_type(c_buf, hd_i_step_ucd, & & tctl%i_step_ucd_ctl) @@ -353,8 +365,9 @@ subroutine write_control_time_step_data(id_control, tctl, level) maxlen = max(maxlen, len_trim(hd_delta_t_isosurf)) maxlen = max(maxlen, len_trim(hd_delta_t_map_projection)) maxlen = max(maxlen, len_trim(hd_delta_t_pvr)) - maxlen = max(maxlen, len_trim(hd_delta_t_fline)) maxlen = max(maxlen, len_trim(hd_delta_t_lic)) + maxlen = max(maxlen, len_trim(hd_delta_t_fline)) + maxlen = max(maxlen, len_trim(hd_delta_t_tracer)) ! maxlen = max(maxlen, len_trim(hd_delta_t_ucd)) maxlen = max(maxlen, len_trim(hd_delta_t_monitor)) @@ -371,6 +384,7 @@ subroutine write_control_time_step_data(id_control, tctl, level) maxlen = max(maxlen, len_trim(hd_i_step_psf)) maxlen = max(maxlen, len_trim(hd_i_step_pvr)) maxlen = max(maxlen, len_trim(hd_i_step_fline)) + maxlen = max(maxlen, len_trim(hd_i_step_tracer)) maxlen = max(maxlen, len_trim(hd_i_step_lic)) maxlen = max(maxlen, len_trim(hd_i_step_ucd)) maxlen = max(maxlen, len_trim(hd_i_step_monitor)) @@ -407,9 +421,13 @@ subroutine write_control_time_step_data(id_control, tctl, level) call write_integer_ctl_type(id_control, level, maxlen, & & tctl%i_step_pvr_ctl) call write_integer_ctl_type(id_control, level, maxlen, & + & tctl%i_step_lic_ctl) +! + call write_integer_ctl_type(id_control, level, maxlen, & & tctl%i_step_fline_ctl) call write_integer_ctl_type(id_control, level, maxlen, & - & tctl%i_step_lic_ctl) + & tctl%i_step_tracer_output_ctl) +! call write_integer_ctl_type(id_control, level, maxlen, & & tctl%i_step_ucd_ctl) call write_integer_ctl_type(id_control, level, maxlen, & @@ -443,9 +461,12 @@ subroutine write_control_time_step_data(id_control, tctl, level) call write_real_ctl_type(id_control, level, maxlen, & & tctl%delta_t_pvr_ctl) call write_real_ctl_type(id_control, level, maxlen, & + & tctl%delta_t_lic_ctl) +! + call write_real_ctl_type(id_control, level, maxlen, & & tctl%delta_t_fline_ctl) call write_real_ctl_type(id_control, level, maxlen, & - & tctl%delta_t_lic_ctl) + & tctl%delta_t_tracer_output_ctl) ! ! call write_real_ctl_type(id_control, level, maxlen, & @@ -521,10 +542,13 @@ subroutine init_ctl_time_step_label(hd_block, tctl) ! call init_real_ctl_item_label(hd_delta_t_pvr, & & tctl%delta_t_pvr_ctl) - call init_real_ctl_item_label(hd_delta_t_fline, & - & tctl%delta_t_fline_ctl) call init_real_ctl_item_label(hd_delta_t_lic, & & tctl%delta_t_lic_ctl) +! + call init_real_ctl_item_label(hd_delta_t_fline, & + & tctl%delta_t_fline_ctl) + call init_real_ctl_item_label(hd_delta_t_tracer, & + & tctl%delta_t_tracer_output_ctl) ! call init_real_ctl_item_label(hd_delta_t_ucd, & & tctl%delta_t_field_ctl) @@ -567,8 +591,11 @@ subroutine init_ctl_time_step_label(hd_block, tctl) & tctl%i_step_pvr_ctl) call init_int_ctl_item_label(hd_i_step_lic, & & tctl%i_step_lic_ctl) +! call init_int_ctl_item_label(hd_i_step_fline, & & tctl%i_step_fline_ctl) + call init_int_ctl_item_label(hd_i_step_tracer, & + & tctl%i_step_tracer_output_ctl) ! call init_int_ctl_item_label(hd_i_step_ucd, & & tctl%i_step_ucd_ctl) diff --git a/src/Fortran_libraries/SERIAL_src/IO/edge_data_IO.f90 b/src/Fortran_libraries/SERIAL_src/IO/edge_data_IO.f90 index cbf1ef9d..2840a0ca 100644 --- a/src/Fortran_libraries/SERIAL_src/IO/edge_data_IO.f90 +++ b/src/Fortran_libraries/SERIAL_src/IO/edge_data_IO.f90 @@ -81,9 +81,8 @@ subroutine read_edge_connection & ! write(id_file,'(a)') '! (type and connection) ' ! write(id_file,'(a)') '!' ! - call read_number_of_element(id_file, ele_IO, ierr) + call read_element_info(id_file, ele_IO, ierr) if(ierr .ne. 0) return - call read_element_info(id_file, ele_IO) ! ! write(id_file,'(a)') '!' ! write(id_file,'(a)') '! 2.2 edge id for each surface' @@ -170,9 +169,8 @@ subroutine read_edge_geometry(id_file, nod_IO, sfed_IO, iend) ! write(id_file,'(a)') '! 4.1. center of edge' ! write(id_file,'(a)') '!' ! - call read_number_of_node(id_file, nod_IO, iend) + call read_geometry_info(id_file, nod_IO, iend) if(iend .ne. 0) return - call read_geometry_info(id_file, nod_IO) ! ! write(id_file,'(a)') '!' ! write(id_file,'(a)') '! 4.2 direction of edge' diff --git a/src/Fortran_libraries/SERIAL_src/IO/element_connect_IO.f90 b/src/Fortran_libraries/SERIAL_src/IO/element_connect_IO.f90 index 77fc9488..a506df34 100644 --- a/src/Fortran_libraries/SERIAL_src/IO/element_connect_IO.f90 +++ b/src/Fortran_libraries/SERIAL_src/IO/element_connect_IO.f90 @@ -17,9 +17,10 @@ !! integer (kind = kint), intent(in) :: id_file !! type(element_data), intent(inout) :: ele_IO !! integer (kind=kint), intent(inout) :: iend -!! subroutine read_element_info(id_file, ele_IO) +!! subroutine read_element_info(id_file, ele_IO, iend) !! type(element_data), intent(inout) :: ele_IO !! type(surf_edge_IO_data), intent(inout) :: sfed_IO +!! integer (kind=kint), intent(inout) :: iend !! subroutine read_surface_4_element(id_file, sfed_IO) !! subroutine read_edge_4_element(id_file, sfed_IO) !! type(surf_edge_IO_data), intent(inout) :: sfed_IO @@ -121,16 +122,19 @@ end subroutine read_number_of_element ! !------------------------------------------------------------------ ! - subroutine read_element_info(id_file, ele_IO) + subroutine read_element_info(id_file, ele_IO, iend) ! use set_nnod_4_ele_by_type ! integer (kind = kint), intent(in) :: id_file type(element_data), intent(inout) :: ele_IO + integer (kind=kint), intent(inout) :: iend ! integer (kind = kint) :: i ! ! + call read_number_of_element(id_file, ele_IO, iend) + if(iend .ne. 0) return call alloc_element_types(ele_IO) ! read(id_file,*) (ele_IO%elmtyp(i),i=1,ele_IO%numele) diff --git a/src/Fortran_libraries/SERIAL_src/IO/element_data_IO.f90 b/src/Fortran_libraries/SERIAL_src/IO/element_data_IO.f90 index 1b901818..d42e90dc 100644 --- a/src/Fortran_libraries/SERIAL_src/IO/element_data_IO.f90 +++ b/src/Fortran_libraries/SERIAL_src/IO/element_data_IO.f90 @@ -50,9 +50,8 @@ subroutine read_element_geometry(id_file, nod_IO, sfed_IO, iend) ! write(id_file,'(a)') '! 3.1 center of element (position) ' ! write(id_file,'(a)') '!' ! - call read_number_of_node(id_file, nod_IO, iend) + call read_geometry_info(id_file, nod_IO, iend) if(iend .ne. 0) return - call read_geometry_info(id_file, nod_IO) ! ! write(id_file,'(a)') '!' ! write(id_file,'(a)') '! 3.2 Volume of element ' diff --git a/src/Fortran_libraries/SERIAL_src/IO/field_data_IO_b.f90 b/src/Fortran_libraries/SERIAL_src/IO/field_data_IO_b.f90 index 24d3f649..cbe9932b 100644 --- a/src/Fortran_libraries/SERIAL_src/IO/field_data_IO_b.f90 +++ b/src/Fortran_libraries/SERIAL_src/IO/field_data_IO_b.f90 @@ -13,8 +13,8 @@ !! type(time_data), intent(in) :: t_IO !! type(binary_IO_buffer), intent(inout) :: bbuf !! -!! subroutine read_step_data_b & -!! & (bbuf, t_IO, istack_merged, num_field) +!! subroutine read_step_data_b(bbuf, t_IO) +!! subroutine read_field_num_b(bbuf, istack_merged, num_field) !! subroutine read_field_data_b & !! & (bbuf, num_field, field_name, nnod64, ntot_comp, vect) !! type(binary_IO_buffer), intent(inout) :: bbuf @@ -98,14 +98,10 @@ end subroutine write_field_data_b ! ----------------------------------------------------------------------- ! ----------------------------------------------------------------------- ! - subroutine read_step_data_b & - & (bbuf, t_IO, istack_merged, num_field) + subroutine read_step_data_b(bbuf, t_IO) ! type(binary_IO_buffer), intent(inout) :: bbuf type(time_data), intent(inout) :: t_IO -! - integer(kind=kint_gl), intent(inout) :: istack_merged(1) - integer(kind=kint), intent(inout) :: num_field ! integer(kind = kint) :: irank_read integer(kind = kint_gl), parameter :: ione64 = 1 @@ -118,14 +114,27 @@ subroutine read_step_data_b & call read_one_real_b(bbuf, t_IO%time) if(bbuf%ierr_bin .ne. 0) return call read_one_real_b(bbuf, t_IO%dt) - if(bbuf%ierr_bin .ne. 0) return +! + end subroutine read_step_data_b +! +! ----------------------------------------------------------------------- +! + subroutine read_field_num_b(bbuf, istack_merged, num_field) +! + type(binary_IO_buffer), intent(inout) :: bbuf +! + integer(kind=kint_gl), intent(inout) :: istack_merged(1) + integer(kind=kint), intent(inout) :: num_field +! + integer(kind = kint_gl), parameter :: ione64 = 1 +! ! call read_mul_int8_b(bbuf, ione64, istack_merged) if(bbuf%ierr_bin .ne. 0) return ! call read_one_integer_b(bbuf, num_field) ! - end subroutine read_step_data_b + end subroutine read_field_num_b ! ! ----------------------------------------------------------------------- ! ----------------------------------------------------------------------- diff --git a/src/Fortran_libraries/SERIAL_src/IO/field_file_IO_b.f90 b/src/Fortran_libraries/SERIAL_src/IO/field_file_IO_b.f90 index 3a3f83ce..f95c5b91 100644 --- a/src/Fortran_libraries/SERIAL_src/IO/field_file_IO_b.f90 +++ b/src/Fortran_libraries/SERIAL_src/IO/field_file_IO_b.f90 @@ -107,8 +107,10 @@ subroutine read_step_field_file_b & bbuf_fld%id_binary = id_read_fld call open_read_binary_file(file_name, id_rank, bbuf_fld) if(bbuf_fld%ierr_bin .ne. 0) goto 99 - call read_step_data_b & - & (bbuf_fld, t_IO, istack_merged, fld_IO%num_field_IO) + call read_step_data_b(bbuf_fld, t_IO) + if(bbuf_fld%ierr_bin .ne. 0) goto 99 + call read_field_num_b & + & (bbuf_fld, istack_merged, fld_IO%num_field_IO) if(bbuf_fld%ierr_bin .ne. 0) goto 99 ! call read_mul_integer_b & @@ -202,8 +204,10 @@ subroutine read_and_allocate_step_b(bbuf, t_IO, fld_IO) integer(kind = kint_gl) :: istack_merged(1) ! ! - call read_step_data_b & - & (bbuf, t_IO, istack_merged, fld_IO%num_field_IO) + call read_step_data_b(bbuf, t_IO) + if(bbuf%ierr_bin .ne. 0) return + call read_field_num_b & + & (bbuf, istack_merged, fld_IO%num_field_IO) fld_IO%nnod_IO = int(istack_merged(1), KIND(fld_IO%nnod_IO)) if(bbuf%ierr_bin .ne. 0) return ! diff --git a/src/Fortran_libraries/SERIAL_src/IO/gz_field_data_IO_b.f90 b/src/Fortran_libraries/SERIAL_src/IO/gz_field_data_IO_b.f90 index bd15d37d..1124b0b2 100644 --- a/src/Fortran_libraries/SERIAL_src/IO/gz_field_data_IO_b.f90 +++ b/src/Fortran_libraries/SERIAL_src/IO/gz_field_data_IO_b.f90 @@ -15,8 +15,9 @@ !! type(buffer_4_gzip), intent(inout) :: zbuf !! !! subroutine gz_read_step_data_b(FPz_f, zbuf, id_rank, & -!! & i_time_step_IO, time_IO, delta_t_IO, & -!! & istack_merged, num_field) +!! & i_time_step_IO, time_IO, delta_t_IO) +!! subroutine gz_read_num_field_b(FPz_f, zbuf, & +!! & istack_merged, num_field) !! subroutine gz_read_field_data_b & !! & (FPz_f, zbuf, nnod, num_field, ncomp, field_name, vect) !! character, pointer, intent(in) :: FPz_f @@ -109,8 +110,7 @@ end subroutine gz_write_field_data_b ! ----------------------------------------------------------------------- ! subroutine gz_read_step_data_b(FPz_f, zbuf, id_rank, & - & i_time_step_IO, time_IO, delta_t_IO, & - & istack_merged, num_field) + & i_time_step_IO, time_IO, delta_t_IO) ! use m_error_IDs ! @@ -120,12 +120,8 @@ subroutine gz_read_step_data_b(FPz_f, zbuf, id_rank, & type(buffer_4_gzip), intent(inout) :: zbuf integer(kind=kint), intent(inout) :: i_time_step_IO real(kind = kreal), intent(inout) :: time_IO, delta_t_IO -! - integer(kind = kint_gl), intent(inout) :: istack_merged(1) - integer(kind = kint), intent(inout) :: num_field ! integer(kind = kint) :: id_read_rank - integer(kind = kint_gl), parameter :: ione64 = 1 ! ! call gz_read_one_integer_b(FPz_f, zbuf, id_read_rank) @@ -143,14 +139,32 @@ subroutine gz_read_step_data_b(FPz_f, zbuf, id_rank, & ! call gz_read_one_real_b(FPz_f, zbuf, delta_t_IO) if(zbuf%ierr_zlib .ne. 0) return +! + end subroutine gz_read_step_data_b +! +! ----------------------------------------------------------------------- +! + subroutine gz_read_num_field_b(FPz_f, zbuf, & + & istack_merged, num_field) +! + use m_error_IDs +! + character, pointer, intent(in) :: FPz_f +! + type(buffer_4_gzip), intent(inout) :: zbuf +! + integer(kind = kint_gl), intent(inout) :: istack_merged(1) + integer(kind = kint), intent(inout) :: num_field +! + integer(kind = kint_gl), parameter :: ione64 = 1 +! ! call gz_read_mul_int8_b(FPz_f, zbuf, ione64, istack_merged(1)) if(zbuf%ierr_zlib .ne. 0) return ! call gz_read_one_integer_b(FPz_f, zbuf, num_field) - if(zbuf%ierr_zlib .ne. 0) return ! - end subroutine gz_read_step_data_b + end subroutine gz_read_num_field_b ! ! ----------------------------------------------------------------------- ! ----------------------------------------------------------------------- diff --git a/src/Fortran_libraries/SERIAL_src/IO/gz_field_file_IO_b.f90 b/src/Fortran_libraries/SERIAL_src/IO/gz_field_file_IO_b.f90 index 0014dfeb..11dfea5a 100644 --- a/src/Fortran_libraries/SERIAL_src/IO/gz_field_file_IO_b.f90 +++ b/src/Fortran_libraries/SERIAL_src/IO/gz_field_file_IO_b.f90 @@ -101,8 +101,11 @@ subroutine gz_read_step_field_file_b & if(zbuf_fld%ierr_zlib .ne. 0) go to 99 ! call gz_read_step_data_b(FPz_fld, zbuf_fld, & - & id_rank, t_IO%i_time_step, t_IO%time, t_IO%dt, & - & istack_merged, fld_IO%num_field_IO) + & id_rank, t_IO%i_time_step, t_IO%time, t_IO%dt) + if(zbuf_fld%ierr_zlib .ne. 0) go to 99 +! + call gz_read_num_field_b(FPz_fld, zbuf_fld, & + & istack_merged, fld_IO%num_field_IO) if(zbuf_fld%ierr_zlib .ne. 0) go to 99 ! call gz_read_mul_integer_b(FPz_fld, zbuf_fld, & @@ -145,8 +148,11 @@ subroutine gz_rd_alloc_st_fld_file_b & if(zbuf_fld%ierr_zlib .ne. 0) go to 99 ! call gz_read_step_data_b(FPz_fld, zbuf_fld, & - & id_rank, t_IO%i_time_step, t_IO%time, t_IO%dt, & - & istack_merged, fld_IO%num_field_IO) + & id_rank, t_IO%i_time_step, t_IO%time, t_IO%dt) + if(zbuf_fld%ierr_zlib .ne. 0) go to 99 +! + call gz_read_num_field_b(FPz_fld, zbuf_fld, & + & istack_merged, fld_IO%num_field_IO) if(zbuf_fld%ierr_zlib .ne. 0) go to 99 ! call alloc_phys_name_IO(fld_IO) @@ -193,8 +199,11 @@ subroutine gz_rd_alloc_st_fld_head_b & if(zbuf_fld%ierr_zlib .ne. 0) go to 99 ! call gz_read_step_data_b(FPz_fld, zbuf_fld, & - & id_rank, t_IO%i_time_step, t_IO%time, t_IO%dt, & - & istack_merged, fld_IO%num_field_IO) + & id_rank, t_IO%i_time_step, t_IO%time, t_IO%dt) + if(zbuf_fld%ierr_zlib .ne. 0) go to 99 +! + call gz_read_num_field_b(FPz_fld, zbuf_fld, & + & istack_merged, fld_IO%num_field_IO) if(zbuf_fld%ierr_zlib .ne. 0) go to 99 ! call alloc_phys_name_IO(fld_IO) diff --git a/src/Fortran_libraries/SERIAL_src/IO/mesh_data_IO.f90 b/src/Fortran_libraries/SERIAL_src/IO/mesh_data_IO.f90 index c72ad357..8b7d4934 100644 --- a/src/Fortran_libraries/SERIAL_src/IO/mesh_data_IO.f90 +++ b/src/Fortran_libraries/SERIAL_src/IO/mesh_data_IO.f90 @@ -13,8 +13,6 @@ !! type(mesh_geometry), intent(in) :: mesh_IO !! type(mesh_groups), intent(in) :: mesh_group_IO !! -!! subroutine read_num_node(id_file, id_rank, mesh_IO, ierr) -!! subroutine read_num_node_ele(id_file, id_rank, mesh_IO, ierr) !! subroutine read_geometry_data(id_file, id_rank, mesh_IO, ierr) !! subroutine read_mesh_groups(id_file, mesh_group_IO, ierr) !! integer(kind = kint), intent(in) :: id_file @@ -114,7 +112,7 @@ end subroutine write_mesh_groups !------------------------------------------------------------------ !------------------------------------------------------------------ ! - subroutine read_num_node(id_file, id_rank, mesh_IO, ierr) + subroutine read_geometry_data(id_file, id_rank, mesh_IO, ierr) ! integer(kind = kint), intent(in) :: id_file integer, intent(in) :: id_rank @@ -122,57 +120,21 @@ subroutine read_num_node(id_file, id_rank, mesh_IO, ierr) type(mesh_geometry), intent(inout) :: mesh_IO integer(kind = kint), intent(inout) :: ierr ! -! write(*,*) 'read_domain_info' +! +! write(*,*) 'read_number_of_element' call read_domain_info & & (id_file, id_rank, mesh_IO%nod_comm, ierr) if(ierr .ne. 0) return -! write(*,*) 'read_number_of_node' - call read_number_of_node(id_file, mesh_IO%node, ierr) -! - end subroutine read_num_node -! -!------------------------------------------------------------------ -! - subroutine read_num_node_ele(id_file, id_rank, mesh_IO, ierr) -! - integer(kind = kint), intent(in) :: id_file - integer, intent(in) :: id_rank -! - type(mesh_geometry), intent(inout) :: mesh_IO - integer(kind = kint), intent(inout) :: ierr -! -! - call read_num_node(id_file, id_rank, mesh_IO, ierr) - if(ierr .ne. 0) return -! - call read_geometry_info(id_file, mesh_IO%node) -! -! ---- read element data ------- ! -! write(*,*) 'read_number_of_element' - call read_number_of_element(id_file, mesh_IO%ele, ierr) -! - end subroutine read_num_node_ele -! -!------------------------------------------------------------------ -! - subroutine read_geometry_data(id_file, id_rank, mesh_IO, ierr) -! - integer(kind = kint), intent(in) :: id_file - integer, intent(in) :: id_rank -! - type(mesh_geometry), intent(inout) :: mesh_IO - integer(kind = kint), intent(inout) :: ierr -! -! -! write(*,*) 'read_number_of_element' - call read_num_node_ele(id_file, id_rank, mesh_IO, ierr) +! ---- read node data ------- + call read_geometry_info(id_file, mesh_IO%node, ierr) if(ierr .ne. 0) return ! ! ---- read element data ------- ! ! write(*,*) 'read_element_info' - call read_element_info(id_file, mesh_IO%ele) + call read_element_info(id_file, mesh_IO%ele, ierr) + if(ierr .ne. 0) return ! ! ---- import & export ! @@ -256,11 +218,10 @@ subroutine read_filter_geometry & ! ! write(*,*) 'read_domain_info' call read_domain_info(id_file, id_rank, comm_IO, ierr) + if(ierr .ne. 0) return ! -! write(*,*) 'read_geometry_info' - call read_number_of_node(id_file, nod_IO, ierr) - if(ierr .ne. 0) return - call read_geometry_info(id_file, nod_IO) + call read_geometry_info(id_file, nod_IO, ierr) + if(ierr .ne. 0) return ! ! ---- import & export ! diff --git a/src/Fortran_libraries/SERIAL_src/IO/mesh_file_IO.f90 b/src/Fortran_libraries/SERIAL_src/IO/mesh_file_IO.f90 index 75243f78..76641127 100644 --- a/src/Fortran_libraries/SERIAL_src/IO/mesh_file_IO.f90 +++ b/src/Fortran_libraries/SERIAL_src/IO/mesh_file_IO.f90 @@ -120,7 +120,15 @@ subroutine read_node_size(id_rank, file_name, mesh_IO, ierr) & 'Read ascii mesh file: ', trim(file_name) ! open(input_file_code, file = file_name, form = 'formatted') - call read_num_node(input_file_code, id_rank, mesh_IO, ierr) +! write(*,*) 'read_domain_info' + call read_domain_info & + & (input_file_code, id_rank, mesh_IO%nod_comm, ierr) + if(ierr .ne. 0) go to 99 +! +! write(*,*) 'read_number_of_node' + call read_number_of_node(input_file_code, mesh_IO%node, ierr) + + 99 continue close(input_file_code) ! ! @@ -144,8 +152,17 @@ subroutine read_geometry_size & & 'Read ascii mesh file: ', trim(file_name) ! open(input_file_code, file = file_name, form = 'formatted') - call read_num_node_ele & - & (input_file_code, id_rank, mesh_IO, ierr) + call read_domain_info & + & (input_file_code, id_rank, mesh_IO%nod_comm, ierr) + if(ierr .ne. 0) go to 99 +! + call read_geometry_info(input_file_code, mesh_IO%node, ierr) + if(ierr .ne. 0) go to 99 +! +! write(*,*) 'read_number_of_element' + call read_number_of_element(input_file_code, mesh_IO%ele, ierr) +! + 99 continue close(input_file_code) ! end subroutine read_geometry_size diff --git a/src/Fortran_libraries/SERIAL_src/IO/node_geometry_IO.f90 b/src/Fortran_libraries/SERIAL_src/IO/node_geometry_IO.f90 index f1b9dc12..22350dec 100644 --- a/src/Fortran_libraries/SERIAL_src/IO/node_geometry_IO.f90 +++ b/src/Fortran_libraries/SERIAL_src/IO/node_geometry_IO.f90 @@ -18,7 +18,7 @@ !! type(surf_edge_IO_data), intent(in) :: sfed_IO !! !! subroutine read_number_of_node(id_file, nod_IO, iend) -!! subroutine read_geometry_info(id_file, nod_IO) +!! subroutine read_geometry_info(id_file, nod_IO, iend) !! subroutine read_scalar_in_element & !! & (id_file, nod_IO, sfed_IO, iend) !! subroutine read_vector_in_element & @@ -110,7 +110,7 @@ subroutine write_scalar_in_element(id_file, nod_IO, sfed_IO) ! write(id_file,'(2i16)') nod_IO%numnod, nod_IO%internal_node do i = 1, nod_IO%numnod - write(id_file,'(1p3e23.15)') sfed_IO%ele_scalar(i) + write(id_file,'(1p3E25.15e3)') sfed_IO%ele_scalar(i) end do ! end subroutine write_scalar_in_element @@ -127,7 +127,7 @@ subroutine write_vector_in_element(id_file, nod_IO, sfed_IO) ! write(id_file,'(2i16)') nod_IO%numnod, nod_IO%internal_node do i = 1, nod_IO%numnod - write(id_file,'(1p3e23.15)') sfed_IO%ele_vector(i,1:3) + write(id_file,'(1p3E25.15e3)') sfed_IO%ele_vector(i,1:3) end do ! end subroutine write_vector_in_element @@ -153,14 +153,17 @@ end subroutine read_number_of_node ! !------------------------------------------------------------------ ! - subroutine read_geometry_info(id_file, nod_IO) + subroutine read_geometry_info(id_file, nod_IO, iend) ! integer (kind = kint), intent(in) :: id_file type(node_data), intent(inout) :: nod_IO + integer(kind = kint), intent(inout) :: iend ! integer (kind = kint) :: i, k ! ! + call read_number_of_node(id_file, nod_IO, iend) + if(iend .ne. 0) return call alloc_node_geometry_base(nod_IO) ! do i=1, nod_IO%numnod diff --git a/src/Fortran_libraries/SERIAL_src/IO/set_ucd_file_names.f90 b/src/Fortran_libraries/SERIAL_src/IO/set_ucd_file_names.f90 index db347372..7b77cddc 100644 --- a/src/Fortran_libraries/SERIAL_src/IO/set_ucd_file_names.f90 +++ b/src/Fortran_libraries/SERIAL_src/IO/set_ucd_file_names.f90 @@ -17,8 +17,6 @@ !! character(len=kchara) function set_parallel_grd_file_name & !! & (file_prefix, itype_file, id_rank) !! -!! character(len=kchara) function set_single_ucd_file_name & -!! & (file_prefix, itype_file, istep_ucd) !! character(len=kchara) function & !! & set_single_grd_file_name(file_prefix, itype_file) !! @@ -198,47 +196,6 @@ end function set_parallel_grd_file_name ! !------------------------------------------------------------------ !------------------------------------------------------------------ -! - character(len=kchara) function set_single_ucd_file_name & - & (file_prefix, itype_file, istep_ucd) -! - use set_parallel_file_name - use set_mesh_extensions - use set_ucd_extensions -! - integer(kind=kint), intent(in) :: itype_file, istep_ucd - character(len=kchara), intent(in) :: file_prefix - character(len=kchara) :: fname_tmp, file_name -! -! - file_name = add_int_suffix(istep_ucd, file_prefix) -! - if ( mod(itype_file,icent)/iten .eq. iflag_vtk/iten) then - fname_tmp = add_vtk_extension(file_name) - else if(mod(itype_file,icent)/iten .eq. iflag_vtd/iten) then - fname_tmp = add_vtd_extension(file_name) - else if(mod(itype_file,icent)/iten .eq. iflag_ucd/iten) then - fname_tmp = add_ucd_extension(file_name) - else if(mod(itype_file,icent)/iten .eq. iflag_udt/iten) then - fname_tmp = add_udt_extension(file_name) - else if(mod(itype_file,icent)/iten .eq. iflag_ucd_bin/iten) then - fname_tmp = add_sfm_extension(file_name) - else if(mod(itype_file,icent)/iten .eq. iflag_udt_bin/iten) then - fname_tmp = add_sdt_extension(file_name) - else - fname_tmp = add_fld_extension(file_name) - end if -! - if ( mod(itype_file,iten) .eq. iflag_gzip) then - file_name = add_gzip_extension(fname_tmp) - else - file_name = fname_tmp - end if - set_single_ucd_file_name = file_name -! - end function set_single_ucd_file_name -! -!------------------------------------------------------------------ ! character(len=kchara) function & & set_single_grd_file_name(file_prefix, itype_file) diff --git a/src/Fortran_libraries/SERIAL_src/IO/surface_data_IO.f90 b/src/Fortran_libraries/SERIAL_src/IO/surface_data_IO.f90 index 4bf32dcf..3dc66397 100644 --- a/src/Fortran_libraries/SERIAL_src/IO/surface_data_IO.f90 +++ b/src/Fortran_libraries/SERIAL_src/IO/surface_data_IO.f90 @@ -76,9 +76,8 @@ subroutine read_surface_connection & ! write(id_file,'(a)') '! (type and connection) ' ! write(id_file,'(a)') '!' ! - call read_number_of_element(id_file, ele_IO, ierr) + call read_element_info(id_file, ele_IO, ierr) if(ierr .ne. 0) return - call read_element_info(id_file, ele_IO) ! ! write(id_file,'(a)') '!' ! write(id_file,'(a)') '! 2.2 surface id for each element' @@ -87,8 +86,7 @@ subroutine read_surface_connection & ! write(id_file,'(a)') '!' ! call read_surface_4_element(id_file, sfed_IO) -! -! + if(ierr .ne. 0) return ! ! write(id_file,'(a)') '!' ! write(id_file,'(a)') '! 3.import / export information ' @@ -159,9 +157,8 @@ subroutine read_surface_geometry(id_file, nod_IO, sfed_IO, iend) ! write(id_file,'(a)') '! 4.1 center of surface' ! write(id_file,'(a)') '!' ! - call read_number_of_node(id_file, nod_IO, iend) + call read_geometry_info(id_file, nod_IO, iend) if(iend .ne. 0) return - call read_geometry_info(id_file, nod_IO) ! ! write(id_file,'(a)') '!' ! write(id_file,'(a)') '! 4.2 normal vector of surface' diff --git a/src/Fortran_libraries/SERIAL_src/IO/t_ctl_data_4_time_steps.f90 b/src/Fortran_libraries/SERIAL_src/IO/t_ctl_data_4_time_steps.f90 index 65efad1e..1cf43c4b 100644 --- a/src/Fortran_libraries/SERIAL_src/IO/t_ctl_data_4_time_steps.f90 +++ b/src/Fortran_libraries/SERIAL_src/IO/t_ctl_data_4_time_steps.f90 @@ -262,6 +262,11 @@ module t_ctl_data_4_time_steps type(read_real_item) :: delta_t_sgs_coefs_ctl !> time interval to output boundary data type(read_real_item) :: delta_t_boundary_ctl +! +!> time interval for field line + type(read_real_item) :: delta_t_tracer_output_ctl +!> Increment for field line + type(read_integer_item) :: i_step_tracer_output_ctl ! integer (kind=kint) :: i_tstep = 0 end type time_data_control diff --git a/src/Fortran_libraries/SERIAL_src/IO/ucd_data_to_buffer.f90 b/src/Fortran_libraries/SERIAL_src/IO/ucd_data_to_buffer.f90 index f74cff0a..db56ebe4 100644 --- a/src/Fortran_libraries/SERIAL_src/IO/ucd_data_to_buffer.f90 +++ b/src/Fortran_libraries/SERIAL_src/IO/ucd_data_to_buffer.f90 @@ -28,8 +28,9 @@ module ucd_data_to_buffer character(len=3), parameter :: UCD_HEX = 'hex' character(len=3), parameter :: UCD_TRI = 'tri' character(len=4), parameter :: UCD_LNE = 'line' + character(len=2), parameter :: UCD_PNT = 'pt' ! - private :: UCD_HEX, UCD_TRI, UCD_LNE + private :: UCD_HEX, UCD_TRI, UCD_LNE, UCD_PNT ! ! ---------------------------------------------------------------------- ! @@ -140,6 +141,8 @@ character(len=6) function ucd_eletype(nnod_ele) ucd_eletype = ' '// UCD_TRI // ' ' else if(nnod_ele.eq.num_linear_edge) then ucd_eletype = ' '// UCD_LNE // ' ' + else if(nnod_ele.eq.num_linear_point) then + ucd_eletype = ' '// UCD_PNT // ' ' else ucd_eletype = ' '// UCD_HEX // ' ' end if @@ -163,6 +166,8 @@ integer(kind = kint) function nnod_ele_by_ucd_eletype(eletype) nnod_ele_by_ucd_eletype = num_triangle else if(cmp_no_case(eletype, UCD_LNE)) then nnod_ele_by_ucd_eletype = num_linear_edge + else if(cmp_no_case(eletype, UCD_PNT)) then + nnod_ele_by_ucd_eletype = num_linear_point else nnod_ele_by_ucd_eletype = num_t_linear end if diff --git a/src/Fortran_libraries/SERIAL_src/IO/ucd_field_file_IO_b.f90 b/src/Fortran_libraries/SERIAL_src/IO/ucd_field_file_IO_b.f90 index 16cd2be8..c27e72c5 100644 --- a/src/Fortran_libraries/SERIAL_src/IO/ucd_field_file_IO_b.f90 +++ b/src/Fortran_libraries/SERIAL_src/IO/ucd_field_file_IO_b.f90 @@ -105,8 +105,10 @@ subroutine read_ucd_2_fld_file_b & bbuf_ucd%id_binary = id_read_fld call open_read_binary_file(file_name, id_rank, bbuf_ucd) if(bbuf_ucd%ierr_bin .ne. 0) goto 99 - call read_step_data_b & - & (bbuf_ucd, t_IO, istack_merged, ucd%num_field) + call read_step_data_b(bbuf_ucd, t_IO) + if(bbuf_ucd%ierr_bin .ne. 0) go to 99 + call read_field_num_b & + & (bbuf_ucd, istack_merged, ucd%num_field) ucd%nnod = istack_merged(1) if(bbuf_ucd%ierr_bin .ne. 0) go to 99 ! @@ -148,8 +150,11 @@ subroutine read_alloc_ucd_2_fld_file_b & bbuf_ucd%id_binary = id_read_fld call open_read_binary_file(file_name, id_rank, bbuf_ucd) if(bbuf_ucd%ierr_bin .ne. 0) goto 99 - call read_step_data_b & - & (bbuf_ucd, t_IO, istack_merged, ucd%num_field) + call read_step_data_b(bbuf_ucd, t_IO) + ucd%nnod = istack_merged(1) + if(bbuf_ucd%ierr_bin .ne. 0) goto 99 + call read_field_num_b & + & (bbuf_ucd, istack_merged, ucd%num_field) ucd%nnod = istack_merged(1) if(bbuf_ucd%ierr_bin .ne. 0) goto 99 ! @@ -197,8 +202,11 @@ subroutine read_alloc_ucd_2_fld_header_b & bbuf_ucd%id_binary = id_read_fld call open_read_binary_file(file_name, id_rank, bbuf_ucd) if(bbuf_ucd%ierr_bin .ne. 0) goto 99 - call read_step_data_b & - & (bbuf_ucd, t_IO, istack_merged, ucd%num_field) + call read_step_data_b(bbuf_ucd, t_IO) + ucd%nnod = istack_merged(1) + if(bbuf_ucd%ierr_bin .ne. 0) go to 99 + call read_field_num_b & + & (bbuf_ucd, istack_merged, ucd%num_field) ucd%nnod = istack_merged(1) if(bbuf_ucd%ierr_bin .ne. 0) go to 99 ! diff --git a/src/Fortran_libraries/SERIAL_src/IO/vtk_data_to_buffer.f90 b/src/Fortran_libraries/SERIAL_src/IO/vtk_data_to_buffer.f90 index 149a159d..6afa696a 100644 --- a/src/Fortran_libraries/SERIAL_src/IO/vtk_data_to_buffer.f90 +++ b/src/Fortran_libraries/SERIAL_src/IO/vtk_data_to_buffer.f90 @@ -245,14 +245,16 @@ integer(kind = kint) function vtk_cell_type(nnod_ele) integer(kind = kint), intent(in) :: nnod_ele ! ! - if (nnod_ele .eq. num_t_linear) then + if (nnod_ele .eq. num_t_linear) then vtk_cell_type = 12 - else if (nnod_ele .eq. num_t_quad) then + else if (nnod_ele .eq. num_t_quad) then vtk_cell_type = 25 - else if (nnod_ele .eq. num_triangle) then + else if (nnod_ele .eq. num_triangle) then vtk_cell_type = 5 - else if (nnod_ele .eq. num_linear_edge) then + else if (nnod_ele .eq. num_linear_edge) then vtk_cell_type = 3 + else if (nnod_ele .eq. num_linear_point) then + vtk_cell_type = 1 else vtk_cell_type = 12 end if diff --git a/src/Fortran_libraries/SERIAL_src/IO/write_pick_sph_spectr_data.F90 b/src/Fortran_libraries/SERIAL_src/IO/write_pick_sph_spectr_data.F90 index 9a601033..0be4716a 100644 --- a/src/Fortran_libraries/SERIAL_src/IO/write_pick_sph_spectr_data.F90 +++ b/src/Fortran_libraries/SERIAL_src/IO/write_pick_sph_spectr_data.F90 @@ -35,7 +35,10 @@ module write_pick_sph_spectr_data ! implicit none ! +#ifdef ZLIB_IO private :: gz_write_picked_spec_data +#endif +! private :: dup_pick_sph_file_header_base ! ! ----------------------------------------------------------------------- diff --git a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/Makefile.depends b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/Makefile.depends index 64ebeb42..f2d2cdf2 100644 --- a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/Makefile.depends +++ b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/Makefile.depends @@ -44,7 +44,7 @@ gz_mesh_data_IO_b.o: $(ZLIB_IO_DIR)/gz_mesh_data_IO_b.f90 m_precision.o m_consta $(F90) -c $(F90OPTFLAGS) $< gz_mesh_file_IO.o: $(ZLIB_IO_DIR)/gz_mesh_file_IO.f90 m_precision.o m_machine_parameter.o t_mesh_data.o gz_mesh_data_IO.o skip_gz_comment.o $(F90) -c $(F90OPTFLAGS) $< -gz_mesh_file_IO_b.o: $(ZLIB_IO_DIR)/gz_mesh_file_IO_b.f90 m_precision.o m_machine_parameter.o t_mesh_data.o t_buffer_4_gzip.o binary_IO.o gz_mesh_data_IO_b.o gz_binary_IO.o gzip_file_access.o +gz_mesh_file_IO_b.o: $(ZLIB_IO_DIR)/gz_mesh_file_IO_b.f90 m_precision.o m_machine_parameter.o t_mesh_data.o t_buffer_4_gzip.o binary_IO.o gz_mesh_data_IO_b.o gz_binary_IO.o gzip_file_access.o gz_domain_data_IO_b.o gz_node_geometry_IO_b.o gz_element_connect_IO_b.o $(F90) -c $(F90OPTFLAGS) $< gz_node_geometry_IO.o: $(ZLIB_IO_DIR)/gz_node_geometry_IO.f90 m_precision.o t_geometry_data.o t_surf_edge_IO.o t_buffer_4_gzip.o gzip_file_access.o skip_gz_comment.o $(F90) -c $(F90OPTFLAGS) $< diff --git a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/cal_buoyancies_sph_MHD.f90 b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/cal_buoyancies_sph_MHD.f90 index 812bf68b..dd8141d9 100644 --- a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/cal_buoyancies_sph_MHD.f90 +++ b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/cal_buoyancies_sph_MHD.f90 @@ -18,26 +18,26 @@ !! real(kind = kreal), intent(inout) :: d_rj(nnod_rj,ntot_phys_rj) !! !! subroutine rot_self_dbl_buoyancy_sph_MHD(kr_in, kr_out, & -!! & coef_t_buo, is_t, coef_c_buo, is_c, it_res, & +!! & coef_t_buo, is_t, coef_c_buo, is_c, is_buo, & !! & nidx_rj, radius_1d_rj_r, nnod_rj, ntot_phys_rj, d_rj) !! subroutine rot_r_cst_dbl_buoyancy_sph_MHD(kr_in, kr_out, & -!! & coef_t_buo, is_t, coef_c_buo, is_c, it_res, & +!! & coef_t_buo, is_t, coef_c_buo, is_c, is_buo, & !! & nidx_rj, nnod_rj, ntot_phys_rj, d_rj) !! integer(kind = kint), intent(in) :: kr_in, kr_out !! integer(kind= kint), intent(in) :: is_t, is_c -!! integer(kind= kint), intent(in) :: it_res +!! integer(kind= kint), intent(in) :: is_buo !! integer(kind = kint), intent(in) :: nidx_rj(2) !! integer(kind = kint), intent(in) :: nnod_rj, ntot_phys_rj !! real(kind = kreal), intent(in) :: radius_1d_rj_r(nidx_rj(1)) !! real(kind = kreal), intent(in) :: coef_t_buo, coef_c_buo !! real(kind = kreal), intent(inout) :: d_rj(nnod_rj,ntot_phys_rj) !! subroutine rot_self_buoyancy_sph_MHD(kr_in, kr_out, coef, & -!! & is_fld, it_res, nidx_rj, radius_1d_rj_r, & +!! & is_fld, is_buo, nidx_rj, radius_1d_rj_r, & !! & nnod_rj, ntot_phys_rj, d_rj) !! subroutine rot_r_const_buoyancy_sph_MHD(kr_in, kr_out, coef, & -!! & is_fld, it_res, nidx_rj, nnod_rj, ntot_phys_rj, d_rj) +!! & is_fld, is_buo, nidx_rj, nnod_rj, ntot_phys_rj, d_rj) !! integer(kind = kint), intent(in) :: kr_in, kr_out -!! integer(kind= kint), intent(in) :: is_fld, it_res +!! integer(kind= kint), intent(in) :: is_fld, is_buo !! integer(kind = kint), intent(in) :: nidx_rj(2) !! integer(kind = kint), intent(in) :: nnod_rj, ntot_phys_rj !! real(kind = kreal), intent(in) :: radius_1d_rj_r(nidx_rj(1)) @@ -108,12 +108,12 @@ end subroutine cal_boussinesq_density_sph !----------------------------------------------------------------------- ! subroutine rot_self_dbl_buoyancy_sph_MHD(kr_in, kr_out, & - & coef_t_buo, is_t, coef_c_buo, is_c, it_res, & + & coef_t_buo, is_t, coef_c_buo, is_c, is_buo, & & nidx_rj, radius_1d_rj_r, nnod_rj, ntot_phys_rj, d_rj) ! integer(kind = kint), intent(in) :: kr_in, kr_out integer(kind= kint), intent(in) :: is_t, is_c - integer(kind= kint), intent(in) :: it_res + integer(kind= kint), intent(in) :: is_buo integer(kind = kint), intent(in) :: nidx_rj(2) integer(kind = kint), intent(in) :: nnod_rj, ntot_phys_rj real(kind = kreal), intent(in) :: radius_1d_rj_r(nidx_rj(1)) @@ -130,7 +130,9 @@ subroutine rot_self_dbl_buoyancy_sph_MHD(kr_in, kr_out, & j = mod((inod-1),nidx_rj(2)) + 1 k = 1 + (inod- j) / nidx_rj(2) ! - d_rj(inod,it_res) = ( coef_t_buo * d_rj(inod,is_t) & + d_rj(inod,is_buo ) = 0.0d0 + d_rj(inod,is_buo+1) = 0.0d0 + d_rj(inod,is_buo+2) = (coef_t_buo * d_rj(inod,is_t) & & + coef_c_buo * d_rj(inod,is_c) ) & & * radius_1d_rj_r(k) end do @@ -141,12 +143,12 @@ end subroutine rot_self_dbl_buoyancy_sph_MHD !----------------------------------------------------------------------- ! subroutine rot_r_cst_dbl_buoyancy_sph_MHD(kr_in, kr_out, & - & coef_t_buo, is_t, coef_c_buo, is_c, it_res, & + & coef_t_buo, is_t, coef_c_buo, is_c, is_buo, & & nidx_rj, nnod_rj, ntot_phys_rj, d_rj) ! integer(kind = kint), intent(in) :: kr_in, kr_out integer(kind= kint), intent(in) :: is_t, is_c - integer(kind= kint), intent(in) :: it_res + integer(kind= kint), intent(in) :: is_buo integer(kind = kint), intent(in) :: nidx_rj(2) integer(kind = kint), intent(in) :: nnod_rj, ntot_phys_rj real(kind = kreal), intent(in) :: coef_t_buo, coef_c_buo @@ -162,8 +164,10 @@ subroutine rot_r_cst_dbl_buoyancy_sph_MHD(kr_in, kr_out, & j = mod((inod-1),nidx_rj(2)) + 1 k = 1 + (inod- j) / nidx_rj(2) ! - d_rj(inod,it_res) = coef_t_buo * d_rj(inod,is_t) & - & + coef_c_buo * d_rj(inod,is_c) + d_rj(inod,is_buo ) = 0.0d0 + d_rj(inod,is_buo+1) = 0.0d0 + d_rj(inod,is_buo+2) = coef_t_buo * d_rj(inod,is_t) & + & + coef_c_buo * d_rj(inod,is_c) end do !$omp end parallel do ! @@ -173,11 +177,11 @@ end subroutine rot_r_cst_dbl_buoyancy_sph_MHD !----------------------------------------------------------------------- ! subroutine rot_self_buoyancy_sph_MHD(kr_in, kr_out, coef, & - & is_fld, it_res, nidx_rj, radius_1d_rj_r, & + & is_fld, is_buo, nidx_rj, radius_1d_rj_r, & & nnod_rj, ntot_phys_rj, d_rj) ! integer(kind = kint), intent(in) :: kr_in, kr_out - integer(kind= kint), intent(in) :: is_fld, it_res + integer(kind= kint), intent(in) :: is_fld, is_buo integer(kind = kint), intent(in) :: nidx_rj(2) integer(kind = kint), intent(in) :: nnod_rj, ntot_phys_rj real(kind = kreal), intent(in) :: radius_1d_rj_r(nidx_rj(1)) @@ -193,7 +197,10 @@ subroutine rot_self_buoyancy_sph_MHD(kr_in, kr_out, coef, & do inod = ist, ied j = mod((inod-1),nidx_rj(2)) + 1 k = 1 + (inod- j) / nidx_rj(2) - d_rj(inod,it_res) & +! + d_rj(inod,is_buo ) = 0.0d0 + d_rj(inod,is_buo+1) = 0.0d0 + d_rj(inod,is_buo+2) & & = coef * d_rj(inod,is_fld) * radius_1d_rj_r(k) end do !$omp end parallel do @@ -203,10 +210,10 @@ end subroutine rot_self_buoyancy_sph_MHD !----------------------------------------------------------------------- ! subroutine rot_r_const_buoyancy_sph_MHD(kr_in, kr_out, coef, & - & is_fld, it_res, nidx_rj, nnod_rj, ntot_phys_rj, d_rj) + & is_fld, is_buo, nidx_rj, nnod_rj, ntot_phys_rj, d_rj) ! integer(kind = kint), intent(in) :: kr_in, kr_out - integer(kind= kint), intent(in) :: is_fld, it_res + integer(kind= kint), intent(in) :: is_fld, is_buo integer(kind = kint), intent(in) :: nidx_rj(2) integer(kind = kint), intent(in) :: nnod_rj, ntot_phys_rj real(kind = kreal), intent(in) :: coef @@ -221,7 +228,10 @@ subroutine rot_r_const_buoyancy_sph_MHD(kr_in, kr_out, coef, & do inod = ist, ied j = mod((inod-1),nidx_rj(2)) + 1 k = 1 + (inod- j) / nidx_rj(2) - d_rj(inod,it_res) = coef * d_rj(inod,is_fld) +! + d_rj(inod,is_buo ) = 0.0d0 + d_rj(inod,is_buo+1) = 0.0d0 + d_rj(inod,is_buo+2) = coef * d_rj(inod,is_fld) end do !$omp end parallel do ! @@ -255,6 +265,8 @@ subroutine cal_self_buoyancy_sph_MHD(kr_in, kr_out, g_sph_rj, & k = 1 + (inod- j) / nidx_rj(2) d_rj(inod,is_buo) = coef * g_sph_rj(j,13) & & * d_rj(inod,is_fld) * radius_1d_rj_r(k)**3 + d_rj(inod,is_buo+1) = 0.0d0 + d_rj(inod,is_buo+2) = 0.0d0 end do !$omp end parallel do ! @@ -287,6 +299,8 @@ subroutine cal_radial_buoyancy_sph_MHD(kr_in, kr_out, g_sph_rj, & k = 1 + (inod- j) / nidx_rj(2) d_rj(inod,is_buo) = coef * g_sph_rj(j,13) & & * d_rj(inod,is_fld) * radius_1d_rj_r(k)**2 + d_rj(inod,is_buo+1) = 0.0d0 + d_rj(inod,is_buo+2) = 0.0d0 end do !$omp end parallel do ! diff --git a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_edge_data_IO.f90 b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_edge_data_IO.f90 index 7fc5324b..f35f6e65 100644 --- a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_edge_data_IO.f90 +++ b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_edge_data_IO.f90 @@ -185,7 +185,6 @@ subroutine gz_read_edge_geometry(FPz_f, nod_IO, sfed_IO, zbuf) ! write(id_file,'(a,a1)') '! 4.1. center of edge', char(0) ! write(id_file,'(a,a1)') '!', char(0) ! - call gz_read_number_of_node(FPz_f, nod_IO, zbuf) call gz_read_geometry_info(FPz_f, nod_IO, zbuf) ! ! write(id_file,'(a,a1)') '!', char(0) diff --git a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_edge_data_IO_b.f90 b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_edge_data_IO_b.f90 index aa44b4f8..aae71744 100644 --- a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_edge_data_IO_b.f90 +++ b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_edge_data_IO_b.f90 @@ -79,8 +79,6 @@ subroutine gz_read_edge_connection_b & if(zbuf%ierr_zlib .ne. 0) return ! ! textbuf = hd_edge_connect() // char(0) - call gz_read_number_of_element_b(FPz_f, zbuf, ele_IO) - if(zbuf%ierr_zlib .ne. 0) return call gz_read_element_info_b(FPz_f, zbuf, ele_IO) if(zbuf%ierr_zlib .ne. 0) return ! @@ -162,9 +160,6 @@ subroutine gz_read_edge_geometry_b(FPz_f, zbuf, nod_IO, sfed_IO) ! ! ! textbuf = hd_edge_point() // char(0) - call gz_read_number_of_node_b(FPz_f, zbuf, nod_IO) - if(zbuf%ierr_zlib .ne. 0) return -! call gz_read_geometry_info_b(FPz_f, zbuf, nod_IO) if(zbuf%ierr_zlib .ne. 0) return ! diff --git a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_element_connect_IO_b.f90 b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_element_connect_IO_b.f90 index b855b1f9..415318fd 100644 --- a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_element_connect_IO_b.f90 +++ b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_element_connect_IO_b.f90 @@ -168,6 +168,8 @@ subroutine gz_read_element_info_b(FPz_f, zbuf, ele_IO) ! integer (kind = kint) :: i ! + call gz_read_number_of_element_b(FPz_f, zbuf, ele_IO) + if(zbuf%ierr_zlib .ne. 0) return ! call alloc_element_types(ele_IO) call gz_read_mul_integer_b & diff --git a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_element_file_IO.f90 b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_element_file_IO.f90 index 9ca887ca..3edbf319 100644 --- a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_element_file_IO.f90 +++ b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_element_file_IO.f90 @@ -227,7 +227,6 @@ subroutine gz_read_element_geometry & ! ! write(zbuf%fixbuf(1),'(a,a1)') '! 3.element information', & ! & char(0) - call gz_read_number_of_node(FPz_f, nod_IO, zbuf) call gz_read_geometry_info(FPz_f, nod_IO, zbuf) ! ! write(zbuf%fixbuf(1),'(a,a1)') '! 3.2 Volume of element ', & diff --git a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_element_file_IO_b.f90 b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_element_file_IO_b.f90 index 09611dc8..f7b1341c 100644 --- a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_element_file_IO_b.f90 +++ b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_element_file_IO_b.f90 @@ -244,9 +244,6 @@ subroutine gz_read_element_geometry_b & ! write(textbuf,'(a,a1)') '! 3.1 center of element (position) ', & ! & char(0) ! write(textbuf,'(a,a1)') '!', char(0) -! - call gz_read_number_of_node_b(FPz_f, zbuf, nod_IO) - if(zbuf%ierr_zlib .ne. 0) return ! call gz_read_geometry_info_b(FPz_f, zbuf, nod_IO) if(zbuf%ierr_zlib .ne. 0) return diff --git a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_layer_spectr_monitor_IO.F90 b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_layer_spectr_monitor_IO.F90 index 32ac0031..e0ca41d2 100644 --- a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_layer_spectr_monitor_IO.F90 +++ b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_layer_spectr_monitor_IO.F90 @@ -55,7 +55,9 @@ module gz_layer_spectr_monitor_IO ! implicit none ! +#ifdef ZLIB_IO private :: gz_write_layer_spectr_monitor +#endif ! ! ----------------------------------------------------------------------- ! diff --git a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_mesh_data_IO.f90 b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_mesh_data_IO.f90 index 8e851cb8..f1275f83 100644 --- a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_mesh_data_IO.f90 +++ b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_mesh_data_IO.f90 @@ -14,9 +14,6 @@ !! type(mesh_groups), intent(in) :: mesh_group_IO !! type(buffer_4_gzip), intent(inout) :: zbuf !! -!! subroutine gz_read_num_node(FPz_f, id_rank, mesh_IO, zbuf, ierr) -!! subroutine gz_read_num_node_ele(FPz_f, id_rank, & -!! & mesh_IO, zbuf, ierr) !! subroutine gz_read_geometry_data(FPz_f, id_rank, & !! & mesh_IO, zbuf, ierr) !! subroutine gz_read_mesh_groups(FPz_f, mesh_group_IO, zbuf) @@ -79,7 +76,6 @@ subroutine gz_write_geometry_data(FPz_f, id_rank, mesh_IO, zbuf) ! zbuf%fixbuf(1) = hd_fem_node() // char(0) call gz_write_textbuf_no_lf(FPz_f, zbuf) -! call gz_write_geometry_info(FPz_f, mesh_IO%node, zbuf) ! ! @@ -176,7 +172,8 @@ end subroutine gz_write_filter_geometry !------------------------------------------------------------------ !------------------------------------------------------------------ ! - subroutine gz_read_num_node(FPz_f, id_rank, mesh_IO, zbuf, ierr) + subroutine gz_read_geometry_data(FPz_f, id_rank, & + & mesh_IO, zbuf, ierr) ! character, pointer, intent(in) :: FPz_f integer, intent(in) :: id_rank @@ -187,54 +184,16 @@ subroutine gz_read_num_node(FPz_f, id_rank, mesh_IO, zbuf, ierr) ! ! ! write(*,*) 'gz_read_domain_info' - call gz_read_domain_info & - & (FPz_f, id_rank, mesh_IO%nod_comm, zbuf, ierr) -! write(*,*) 'gz_read_number_of_node' - call gz_read_number_of_node(FPz_f, mesh_IO%node, zbuf) + call gz_read_domain_info & + & (FPz_f, id_rank, mesh_IO%nod_comm, zbuf, ierr) + if(ierr .gt. 0) return ! - end subroutine gz_read_num_node -! -!------------------------------------------------------------------ -! - subroutine gz_read_num_node_ele(FPz_f, id_rank, & - & mesh_IO, zbuf, ierr) -! - character, pointer, intent(in) :: FPz_f - integer, intent(in) :: id_rank -! - type(mesh_geometry), intent(inout) :: mesh_IO - type(buffer_4_gzip), intent(inout) :: zbuf - integer(kind = kint), intent(inout) :: ierr -! -! - call gz_read_num_node(FPz_f, id_rank, mesh_IO, zbuf, ierr) -! write(*,*) 'gz_read_geometry_info' call gz_read_geometry_info(FPz_f, mesh_IO%node, zbuf) ! ! ---- read element data ------- ! ! write(*,*) 'gz_read_number_of_element' call gz_read_number_of_element(FPz_f, mesh_IO%ele, zbuf) -! - end subroutine gz_read_num_node_ele -! -!------------------------------------------------------------------ -! - subroutine gz_read_geometry_data(FPz_f, id_rank, & - & mesh_IO, zbuf, ierr) -! - character, pointer, intent(in) :: FPz_f - integer, intent(in) :: id_rank -! - type(mesh_geometry), intent(inout) :: mesh_IO - type(buffer_4_gzip), intent(inout) :: zbuf - integer(kind = kint), intent(inout) :: ierr -! -! - call gz_read_num_node_ele(FPz_f, id_rank, mesh_IO, zbuf, ierr) -! -! ---- read element data ------- -! ! write(*,*) 'gz_read_element_info' call gz_read_element_info(FPz_f, mesh_IO%ele, zbuf) ! @@ -286,8 +245,7 @@ subroutine gz_read_filter_geometry & ! ! write(*,*) 'gz_read_domain_info' call gz_read_domain_info(FPz_f, id_rank, comm_IO, zbuf, ierr) -! write(*,*) 'gz_read_number_of_node' - call gz_read_number_of_node(FPz_f, nod_IO, zbuf) + ! write(*,*) 'gz_read_geometry_info' call gz_read_geometry_info(FPz_f, nod_IO, zbuf) ! diff --git a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_mesh_data_IO_b.f90 b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_mesh_data_IO_b.f90 index 108b0310..4f79e678 100644 --- a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_mesh_data_IO_b.f90 +++ b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_mesh_data_IO_b.f90 @@ -16,8 +16,6 @@ !! type(mesh_groups), intent(in) :: mesh_group_IO !! type(buffer_4_gzip), intent(inout) :: zbuf !! -!! subroutine gz_read_num_node_b(FPz_f, id_rank, zbuf, mesh_IO) -!! subroutine gz_read_num_node_ele_b(FPz_f, id_rank, zbuf, mesh_IO) !! subroutine gz_read_geometry_data_b & !! & (FPz_f, id_rank, zbuf, mesh_IO) !! subroutine gz_read_mesh_groups_b(FPz_f, zbuf, mesh_group_IO) @@ -100,55 +98,6 @@ end subroutine gz_write_mesh_groups_b ! !------------------------------------------------------------------ !------------------------------------------------------------------ -! - subroutine gz_read_num_node_b(FPz_f, id_rank, zbuf, mesh_IO) -! - use gz_domain_data_IO_b - use gz_node_geometry_IO_b -! - character, pointer, intent(in) :: FPz_f - integer, intent(in) :: id_rank -! - type(buffer_4_gzip), intent(inout) :: zbuf - type(mesh_geometry), intent(inout) :: mesh_IO -! -! - call gz_read_domain_info_b(FPz_f, id_rank, zbuf, mesh_IO%nod_comm) - if(zbuf%ierr_zlib .ne. 0) return -! - call gz_read_number_of_node_b(FPz_f, zbuf, mesh_IO%node) - if(zbuf%ierr_zlib .ne. 0) return -! - end subroutine gz_read_num_node_b -! -!------------------------------------------------------------------ -! - subroutine gz_read_num_node_ele_b(FPz_f, id_rank, zbuf, mesh_IO) -! - use gz_domain_data_IO_b - use gz_node_geometry_IO_b - use gz_element_connect_IO_b -! - character, pointer, intent(in) :: FPz_f - integer, intent(in) :: id_rank -! - type(buffer_4_gzip), intent(inout) :: zbuf - type(mesh_geometry), intent(inout) :: mesh_IO -! -! - call gz_read_num_node_b(FPz_f, id_rank, zbuf, mesh_IO) - if(zbuf%ierr_zlib .ne. 0) return - call gz_read_geometry_info_b(FPz_f, zbuf, mesh_IO%node) - if(zbuf%ierr_zlib .ne. 0) return -! -! ---- read element data ------- -! - call gz_read_number_of_element_b(FPz_f, zbuf, mesh_IO%ele) - if(zbuf%ierr_zlib .ne. 0) return -! - end subroutine gz_read_num_node_ele_b -! -!------------------------------------------------------------------ ! subroutine gz_read_geometry_data_b & & (FPz_f, id_rank, zbuf, mesh_IO) @@ -164,7 +113,10 @@ subroutine gz_read_geometry_data_b & type(mesh_geometry), intent(inout) :: mesh_IO ! ! - call gz_read_num_node_ele_b(FPz_f, id_rank, zbuf, mesh_IO) + call gz_read_domain_info_b(FPz_f, id_rank, zbuf, & + & mesh_IO%nod_comm) + if(zbuf%ierr_zlib .ne. 0) return + call gz_read_geometry_info_b(FPz_f, zbuf, mesh_IO%node) if(zbuf%ierr_zlib .ne. 0) return ! ! ---- read element data ------- diff --git a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_mesh_file_IO.f90 b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_mesh_file_IO.f90 index e4bf91ef..38d9bd51 100644 --- a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_mesh_file_IO.f90 +++ b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_mesh_file_IO.f90 @@ -114,7 +114,14 @@ subroutine gz_read_node_size & ! call open_rd_gzfile_a(FPz_msh, file_name, zbuf_m) ! - call gz_read_num_node(FPz_msh, id_rank, mesh_IO, zbuf_m, ierr) +! write(*,*) 'gz_read_domain_info' + call gz_read_domain_info & + & (FPz_msh, id_rank, mesh_IO%nod_comm, zbuf_m, ierr) + if(ierr .gt. 0) go to 99 +! write(*,*) 'gz_read_number_of_node' + call gz_read_number_of_node(FPz_msh, mesh_IO%node, zbuf_m) + + 99 continue call close_gzfile_a(FPz_msh, zbuf_m) ! end subroutine gz_read_node_size @@ -138,8 +145,16 @@ subroutine gz_read_geometry_size & ! call open_rd_gzfile_a(FPz_msh, file_name, zbuf_m) ! - call gz_read_num_node_ele(FPz_msh, id_rank, & - & mesh_IO, zbuf_m, ierr) +! write(*,*) 'gz_read_domain_info' + call gz_read_domain_info & + & (FPz_msh, id_rank, mesh_IO%nod_comm, zbuf_m, ierr) + if(ierr .gt. 0) go to 99 +! + call gz_read_geometry_info(FPz_msh, mesh_IO%node, zbuf_m) +! write(*,*) 'gz_read_number_of_element' + call gz_read_number_of_element(FPz_msh, mesh_IO%ele, zbuf_m) + + 99 continue call close_gzfile_a(FPz_msh, zbuf_m) ! end subroutine gz_read_geometry_size diff --git a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_mesh_file_IO_b.f90 b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_mesh_file_IO_b.f90 index 5d64caad..ae1d0652 100644 --- a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_mesh_file_IO_b.f90 +++ b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_mesh_file_IO_b.f90 @@ -118,6 +118,8 @@ subroutine gz_read_node_size_b & & (id_rank, file_name, mesh_IO, ierr) ! use gzip_file_access + use gz_domain_data_IO_b + use gz_node_geometry_IO_b ! integer, intent(in) :: id_rank character(len=kchara), intent(in) :: file_name @@ -132,7 +134,11 @@ subroutine gz_read_node_size_b & call open_rd_gzfile_b(FPz_msh, file_name, id_rank, zbuf_mesh) if(zbuf_mesh%ierr_zlib .ne. 0) goto 99 ! - call gz_read_num_node_b(FPz_msh, id_rank, zbuf_mesh, mesh_IO) + call gz_read_domain_info_b(FPz_msh, id_rank, zbuf_mesh, & + & mesh_IO%nod_comm) + if(zbuf_mesh%ierr_zlib .ne. 0) return + call gz_read_number_of_node_b(FPz_msh, zbuf_mesh, mesh_IO%node) + if(zbuf_mesh%ierr_zlib .ne. 0) return ! 99 continue call close_gzfile_b(FPz_msh) @@ -146,6 +152,9 @@ subroutine gz_read_geometry_size_b & & (id_rank, file_name, mesh_IO, ierr) ! use gzip_file_access + use gz_domain_data_IO_b + use gz_node_geometry_IO_b + use gz_element_connect_IO_b ! integer, intent(in) :: id_rank character(len=kchara), intent(in) :: file_name @@ -160,8 +169,13 @@ subroutine gz_read_geometry_size_b & call open_rd_gzfile_b(FPz_msh, file_name, id_rank, zbuf_mesh) if(zbuf_mesh%ierr_zlib .ne. 0) goto 99 ! - call gz_read_num_node_ele_b(FPz_msh, id_rank, & - & zbuf_mesh, mesh_IO) + call gz_read_domain_info_b(FPz_msh, id_rank, zbuf_mesh, & + & mesh_IO%nod_comm) + if(zbuf_mesh%ierr_zlib .ne. 0) return + call gz_read_geometry_info_b(FPz_msh, zbuf_mesh, mesh_IO%node) + if(zbuf_mesh%ierr_zlib .ne. 0) return + call gz_read_number_of_element_b(FPz_msh, zbuf_mesh, mesh_IO%ele) + if(zbuf_mesh%ierr_zlib .ne. 0) return ! 99 continue call close_gzfile_b(FPz_msh) diff --git a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_node_geometry_IO.f90 b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_node_geometry_IO.f90 index f4d17bc1..b7acf9dd 100644 --- a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_node_geometry_IO.f90 +++ b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_node_geometry_IO.f90 @@ -150,6 +150,7 @@ subroutine gz_read_geometry_info(FPz_f, nod_IO, zbuf) integer (kind = kint) :: i, k ! ! + call gz_read_number_of_node(FPz_f, nod_IO, zbuf) call alloc_node_geometry_base(nod_IO) ! do i=1, nod_IO%numnod diff --git a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_node_geometry_IO_b.f90 b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_node_geometry_IO_b.f90 index d7644b96..08f75d3b 100644 --- a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_node_geometry_IO_b.f90 +++ b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_node_geometry_IO_b.f90 @@ -150,6 +150,9 @@ subroutine gz_read_geometry_info_b(FPz_f, zbuf, nod_IO) type(buffer_4_gzip), intent(inout) :: zbuf type(node_data), intent(inout) :: nod_IO ! +! + call gz_read_number_of_node_b(FPz_f, zbuf, nod_IO) + if(zbuf%ierr_zlib .ne. 0) return ! call alloc_node_geometry_base(nod_IO) ! diff --git a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_surface_data_IO.f90 b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_surface_data_IO.f90 index 9443e4b1..7eee0fed 100644 --- a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_surface_data_IO.f90 +++ b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_surface_data_IO.f90 @@ -181,7 +181,6 @@ subroutine gz_read_surface_geometry & ! write(id_file,'(a)') '! 4.1 center of surface' ! write(id_file,'(a)') '!' ! - call gz_read_number_of_node(FPz_f, nod_IO, zbuf) call gz_read_geometry_info(FPz_f, nod_IO, zbuf) ! ! write(id_file,'(a)') '!' @@ -216,17 +215,14 @@ subroutine gz_write_surface_geometry & ! zbuf%fixbuf(1) = hd_surf_point() // char(0) call gz_write_textbuf_no_lf(FPz_f, zbuf) -! call gz_write_geometry_info(FPz_f, nod_IO, zbuf) ! zbuf%fixbuf(1) = hd_surf_norm() // char(0) call gz_write_textbuf_no_lf(FPz_f, zbuf) -! call gz_write_vector_in_element(FPz_f, nod_IO, sfed_IO, zbuf) ! zbuf%fixbuf(1) = hd_surf_area() // char(0) call gz_write_textbuf_no_lf(FPz_f, zbuf) -! call gz_write_scalar_in_element(FPz_f, nod_IO, sfed_IO, zbuf) ! end subroutine gz_write_surface_geometry diff --git a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_surface_data_IO_b.f90 b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_surface_data_IO_b.f90 index 21d88787..39431ea0 100644 --- a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_surface_data_IO_b.f90 +++ b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_surface_data_IO_b.f90 @@ -77,8 +77,6 @@ subroutine gz_read_surface_connection_b & if(zbuf%ierr_zlib .ne. 0) return ! ! textbuf = hd_surf_connect() // char(0) - call gz_read_number_of_element_b(FPz_f, zbuf, ele_IO) - if(zbuf%ierr_zlib .ne. 0) return call gz_read_element_info_b(FPz_f, zbuf, ele_IO) if(zbuf%ierr_zlib .ne. 0) return ! @@ -154,9 +152,6 @@ subroutine gz_read_surface_geometry_b & ! ! ! textbuf = hd_surf_point() // char(0) - call gz_read_number_of_node_b(FPz_f, zbuf, nod_IO) - if(zbuf%ierr_zlib .ne. 0) return -! call gz_read_geometry_info_b(FPz_f, zbuf, nod_IO) if(zbuf%ierr_zlib .ne. 0) return ! diff --git a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_ucd_field_file_IO_b.f90 b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_ucd_field_file_IO_b.f90 index 6c3d5237..e624e580 100644 --- a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_ucd_field_file_IO_b.f90 +++ b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_ucd_field_file_IO_b.f90 @@ -103,8 +103,11 @@ subroutine gz_read_ucd_2_fld_file_b & if(zbuf_fu%ierr_zlib .ne. 0) go to 99 ! call gz_read_step_data_b(FPz_udt, zbuf_fu, & - & id_rank, t_IO%i_time_step, t_IO%time, t_IO%dt, & - & istack_merged, ucd%num_field) + & id_rank, t_IO%i_time_step, t_IO%time, t_IO%dt) + if(zbuf_fu%ierr_zlib .ne. 0) go to 99 +! + call gz_read_num_field_b(FPz_udt, zbuf_fu, & + & istack_merged, ucd%num_field) if(zbuf_fu%ierr_zlib .ne. 0) go to 99 ! call gz_read_mul_integer_b & @@ -149,8 +152,11 @@ subroutine gz_read_alloc_ucd_2_fld_file_b & if(zbuf_fu%ierr_zlib .ne. 0) go to 99 ! call gz_read_step_data_b(FPz_udt, zbuf_fu, & - & id_rank, t_IO%i_time_step, t_IO%time, t_IO%dt, & - & istack_merged, ucd%num_field) + & id_rank, t_IO%i_time_step, t_IO%time, t_IO%dt) + if(zbuf_fu%ierr_zlib .ne. 0) go to 99 +! + call gz_read_num_field_b(FPz_udt, zbuf_fu, & + & istack_merged, ucd%num_field) if(zbuf_fu%ierr_zlib .ne. 0) go to 99 ! call allocate_ucd_phys_name(ucd) diff --git a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_volume_spectr_monitor_IO.F90 b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_volume_spectr_monitor_IO.F90 index 78911806..ad4aa67a 100644 --- a/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_volume_spectr_monitor_IO.F90 +++ b/src/Fortran_libraries/SERIAL_src/IO_ZLIB/gz_volume_spectr_monitor_IO.F90 @@ -46,7 +46,9 @@ module gz_volume_spectr_monitor_IO ! implicit none ! +#ifdef ZLIB_IO private :: gz_write_volume_spectr_monitor +#endif ! ! ----------------------------------------------------------------------- ! diff --git a/src/Fortran_libraries/SERIAL_src/SPH_SPECTR_src/Makefile.depends b/src/Fortran_libraries/SERIAL_src/SPH_SPECTR_src/Makefile.depends index 12b4e5bb..d7357576 100644 --- a/src/Fortran_libraries/SERIAL_src/SPH_SPECTR_src/Makefile.depends +++ b/src/Fortran_libraries/SERIAL_src/SPH_SPECTR_src/Makefile.depends @@ -24,6 +24,8 @@ count_num_sph_smp.o: $(SPH_SPECTR_DIR)/count_num_sph_smp.f90 m_precision.o m_con $(F90) -c $(F90OPTFLAGS) $< extend_potential_field.o: $(SPH_SPECTR_DIR)/extend_potential_field.f90 m_precision.o m_constants.o t_spheric_rj_data.o $(F90) -c $(F90OPTFLAGS) $< +first_fdm_ele_to_node.o: $(SPH_SPECTR_DIR)/first_fdm_ele_to_node.f90 m_precision.o m_constants.o m_machine_parameter.o t_spheric_parameter.o t_fdm_coefs.o cal_inverse_small_matrix.o + $(F90) -c $(F90OPTFLAGS) $< half_chebyshev_radial_grid.o: $(SPH_SPECTR_DIR)/half_chebyshev_radial_grid.f90 m_precision.o m_constants.o $(F90) -c $(F90OPTFLAGS) $< load_data_for_sph_IO.o: $(SPH_SPECTR_DIR)/load_data_for_sph_IO.f90 m_precision.o t_spheric_rtp_data.o t_spheric_rtm_data.o t_spheric_rlm_data.o t_spheric_rj_data.o t_sph_trans_comm_tbl.o t_spheric_group.o t_spheric_data_IO.o copy_sph_comm_table_4_IO.o copy_sph_rtp_node_4_IO.o set_group_types_4_IO.o copy_sph_rj_mode_4_IO.o copy_sph_rtm_node_4_IO.o copy_sph_rlm_mode_4_IO.o @@ -84,4 +86,6 @@ t_spheric_rtm_data.o: $(SPH_SPECTR_DIR)/t_spheric_rtm_data.f90 m_precision.o m_c $(F90) -c $(F90OPTFLAGS) $< t_spheric_rtp_data.o: $(SPH_SPECTR_DIR)/t_spheric_rtp_data.f90 m_precision.o m_constants.o m_spheric_constants.o m_machine_parameter.o $(F90) -c $(F90OPTFLAGS) $< +third_fdm_node_to_ele.o: $(SPH_SPECTR_DIR)/third_fdm_node_to_ele.f90 m_precision.o m_constants.o m_machine_parameter.o t_spheric_parameter.o t_fdm_coefs.o cal_inverse_small_matrix.o + $(F90) -c $(F90OPTFLAGS) $< diff --git a/src/Fortran_libraries/SERIAL_src/SPH_SPECTR_src/first_fdm_ele_to_node.f90 b/src/Fortran_libraries/SERIAL_src/SPH_SPECTR_src/first_fdm_ele_to_node.f90 new file mode 100644 index 00000000..af28d995 --- /dev/null +++ b/src/Fortran_libraries/SERIAL_src/SPH_SPECTR_src/first_fdm_ele_to_node.f90 @@ -0,0 +1,209 @@ +!>@file first_fdm_ele_to_node.f90 +!!@brief module first_fdm_ele_to_node +!! +!!@author H. Matsui +!!@date Programmed in Jan, 2010 +! +!>@brief First order FDM from element to node +!! +!!@verbatim +!! subroutine const_first_fdm_ele_to_node(sph_rj, fdm_1st_nod) +!! type(sph_rj_grid), intent(in) :: sph_rj +!! type(fdm_matrices), intent(inout) :: fdm_1st_nod +!! subroutine cal_first_fdm_ele_to_node(i_th, kr_in, kr_out, & +!! & sph_rj, fdm_1st_nod, dele_rj, dnod_dr) +!! type(sph_rj_grid), intent(in) :: sph_rj +!! integer(kind = kint), intent(in) :: i_th, kr_in, kr_out +!! real(kind = kreal), intent(in) :: dele_rj(sph_rj%nnod_rj) +!! type(fdm_matrices), intent(in) :: fdm_1st_nod +!! real(kind = kreal), intent(inout) :: dnod_dr(sph_rj%nnod_rj) +!! ---------------------------------------------------------------------- +!! Coeeficients for derivatives by 1d finite difference method +!! +!! define of elemental field +!! r_ele(k) = half *(r_nod(k-1) + r_nod(k)) +!! d_ele(k) = half *(d_nod(k-1) + d_nod(k)) +!! +!! derivatives on node by element field +!! dfdr_nod(k) = fdm_1st_nod%fdm(1)%dmat(k,0) * d_ele(k ) +!! + fdm_1st_nod%fdm(1)%dmat(k,1) * d_ele(k+1) +!! +!! fdm_1st_nod%fdm(1)%dmat = d1nod_mat_fdm_2e +!! +!! ---------------------------------------------------------------------- +!! Work array to obtain 1d FDM +!! +!! derivatives on node by element field +!! dfdr_nod(k) = fdm_1st_nod%wk_mat(2,1) * d_ele(k) +!! + fdm_1st_nod%wk_mat(2,2) * d_ele(k+1) +!! ---------------------------------------------------------------------- +!! Numbering of node and element +!! n_k-1 e_k n_k e_k+1 n_k+1 +!! +----x----+----x----+---..... +!! r(k-1) r(k) r(k+1) +!!@endverbatim +!! +!!@n @param nri number of radial grid points +!!@n @param r(nri) radius +! + module first_fdm_ele_to_node +! + use m_precision + use m_constants + use m_machine_parameter + use t_spheric_parameter + use t_fdm_coefs +! + implicit none +! + private :: set_first_fdm_ele_to_node, copy_first_fdm_ele_to_node + private :: cal_sph_vect_dr_nod_1 +! +! ------------------------------------------------------------------- +! + contains +! +! ------------------------------------------------------------------- +! + subroutine const_first_fdm_ele_to_node(sph_rj, fdm_1st_nod) +! + type(sph_rj_grid), intent(in) :: sph_rj +! + type(fdm_matrices), intent(inout) :: fdm_1st_nod +! + real(kind = kreal), allocatable :: mat_fdm(:,:,:) +! +! + call alloc_nod_fdm_matrices & + & (sph_rj%nidx_rj(1), izero, ione, izero, ione, fdm_1st_nod) +! + allocate(mat_fdm(2,2,sph_rj%nidx_rj(1))) + mat_fdm(1:2,1:2,1:sph_rj%nidx_rj(1)) = 0.0d0 +! + call set_first_fdm_ele_to_node & + & (sph_rj%nidx_rj(1), sph_rj%radius_1d_rj_r, mat_fdm) +! + call copy_first_fdm_ele_to_node & + & (sph_rj%nidx_rj(1), mat_fdm, fdm_1st_nod%fdm) + deallocate(mat_fdm) +! + if(iflag_debug .gt. 0) then + write(*,*) 'check First order FDM from element' + call check_fdm_coefs & + & (sph_rj%nidx_rj(1), sph_rj%radius_1d_rj_r, fdm_1st_nod) + end if +! + end subroutine const_first_fdm_ele_to_node +! +! ----------------------------------------------------------------------- +! + subroutine cal_first_fdm_ele_to_node(i_th, kr_in, kr_out, & + & sph_rj, fdm_1st_nod, dele_rj, dnod_dr) +! + type(sph_rj_grid), intent(in) :: sph_rj + integer(kind = kint), intent(in) :: i_th, kr_in, kr_out + real(kind = kreal), intent(in) :: dele_rj(sph_rj%nnod_rj) + type(fdm_matrices), intent(in) :: fdm_1st_nod +! + real(kind = kreal), intent(inout) :: dnod_dr(sph_rj%nnod_rj) +! + call cal_sph_vect_dr_nod_1(kr_in, kr_out, sph_rj, & + & fdm_1st_nod%fdm(i_th), dele_rj, dnod_dr) +! + end subroutine cal_first_fdm_ele_to_node +! +! ----------------------------------------------------------------------- +! ----------------------------------------------------------------------- +! + subroutine set_first_fdm_ele_to_node(nri, r, mat_fdm) +! + use cal_inverse_small_matrix +! + integer(kind = kint), intent(in) :: nri + real(kind = kreal), intent(in) :: r(nri) + real(kind = kreal), intent(inout) :: mat_fdm(2,2,nri) +! + integer(kind = kint) :: kr, ierr +! + real(kind = kreal) :: mat_taylor_2(2,2) +! +! + do kr = 1, nri + mat_taylor_2(1,1) = one + if (kr .eq. 1) then + mat_taylor_2(1,2) = - half * r(1) + else + mat_taylor_2(1,2) = - half * (r(kr) - r(kr-1)) + end if +! + mat_taylor_2(2,1) = one + if (kr .eq. nri) then + mat_taylor_2(2,2) = half * (r(kr) - r(kr-1)) + else + mat_taylor_2(2,2) = half * (r(kr+1) - r(kr)) + end if +! + call cal_inverse_22_matrix & + & (mat_taylor_2, mat_fdm(1,1,kr), ierr) + end do +! + end subroutine set_first_fdm_ele_to_node +! +! ----------------------------------------------------------------------- +! + subroutine copy_first_fdm_ele_to_node(nri, mat_fdm, fdm) +! + integer(kind = kint), intent(in) :: nri + real(kind = kreal), intent(in) :: mat_fdm(2,2,nri) + type(fdm_matrix), intent(inout) :: fdm(0:1) +! + integer(kind= kint) :: k +! +! +!$omp parallel do private (k) + do k = 1, nri-1 + fdm(0)%dmat(k, 0) = mat_fdm(1,1,k) + fdm(0)%dmat(k, 1) = mat_fdm(1,2,k) +! + fdm(1)%dmat(k, 0) = mat_fdm(2,1,k) + fdm(1)%dmat(k, 1) = mat_fdm(2,2,k) + end do +!$omp end parallel do +! + end subroutine copy_first_fdm_ele_to_node +! +! ----------------------------------------------------------------------- +! ----------------------------------------------------------------------- +! + subroutine cal_sph_vect_dr_nod_1(kr_in, kr_out, sph_rj, & + & fdm1, dele_rj, dnod_dr) +! + type(sph_rj_grid), intent(in) :: sph_rj + type(fdm_matrix), intent(in) :: fdm1 + integer(kind = kint), intent(in) :: kr_in, kr_out + real(kind = kreal), intent(in) :: dele_rj(sph_rj%nnod_rj) +! + real(kind = kreal), intent(inout) :: dnod_dr(sph_rj%nnod_rj) +! + integer(kind = kint) :: inod, i_p1, j, k + integer(kind = kint) :: ist, ied +! +! + ist = kr_in * sph_rj%nidx_rj(2) + 1 + ied = kr_out * sph_rj%nidx_rj(2) +!$omp parallel do private(inod,i_p1,j,k) + do inod = ist, ied + i_p1 = inod + sph_rj%nidx_rj(2) + j = mod((inod-1),sph_rj%nidx_rj(2)) + 1 + k = 1 + (inod- j) / sph_rj%nidx_rj(2) +! + dnod_dr(inod) = fdm1%dmat(k, 0) * dele_rj(inod) & + & + fdm1%dmat(k, 1) * dele_rj(i_p1) + end do +!$omp end parallel do +! + end subroutine cal_sph_vect_dr_nod_1 +! +! ----------------------------------------------------------------------- +! + end module first_fdm_ele_to_node diff --git a/src/Fortran_libraries/SERIAL_src/SPH_SPECTR_src/second_fdm_node_coefs.f90 b/src/Fortran_libraries/SERIAL_src/SPH_SPECTR_src/second_fdm_node_coefs.f90 index 5457c0c0..08384cc9 100644 --- a/src/Fortran_libraries/SERIAL_src/SPH_SPECTR_src/second_fdm_node_coefs.f90 +++ b/src/Fortran_libraries/SERIAL_src/SPH_SPECTR_src/second_fdm_node_coefs.f90 @@ -78,7 +78,7 @@ subroutine const_second_fdm_coefs(sph_params, sph_rj, fdm_2nd) ! ! call alloc_nod_fdm_matrices & - & (sph_rj%nidx_rj(1), itwo, ione, ione, fdm_2nd) + & (sph_rj%nidx_rj(1), ione, itwo, ione, ione, fdm_2nd) ! allocate(mat_fdm(3,3,sph_rj%nidx_rj(1))) mat_fdm(1:3,1:3,1:sph_rj%nidx_rj(1)) = 0.0d0 diff --git a/src/Fortran_libraries/SERIAL_src/SPH_SPECTR_src/set_radius_4_sph_dynamo.f90 b/src/Fortran_libraries/SERIAL_src/SPH_SPECTR_src/set_radius_4_sph_dynamo.f90 index 8ecf38ab..d3b0ee27 100644 --- a/src/Fortran_libraries/SERIAL_src/SPH_SPECTR_src/set_radius_4_sph_dynamo.f90 +++ b/src/Fortran_libraries/SERIAL_src/SPH_SPECTR_src/set_radius_4_sph_dynamo.f90 @@ -65,7 +65,7 @@ subroutine set_radius_dat_4_sph_dynamo & real(kind = kreal), intent(inout) :: r_ele_rj(nri) real(kind = kreal), intent(inout) :: ar_ele_rj(nri,3) real(kind = kreal), intent(inout) :: R_earth(0:2) - real(kind = kreal), intent(inout) ::r_ICB, r_CMB + real(kind = kreal), intent(inout) :: r_ICB, r_CMB ! integer(kind = kint) :: k, kk ! @@ -99,14 +99,14 @@ subroutine set_radius_dat_4_sph_dynamo & & r_ICB, r_CMB, radius_1d_rj_r, iflag_radial_grid) ! ! - do k = 1 ,nlayer_CMB + do k = 1, nri ar_1d_rj(k,1) = one / radius_1d_rj_r(k) ar_1d_rj(k,2) = ar_1d_rj(k,1)**2 ar_1d_rj(k,3) = ar_1d_rj(k,1)**3 end do ! r_ele_rj(1) = half * radius_1d_rj_r(1) - do k = 2 ,nlayer_CMB + do k = 2, nri r_ele_rj(k) = half * (radius_1d_rj_r(k-1) + radius_1d_rj_r(k)) ar_ele_rj(k,1) = one / r_ele_rj(k) ar_ele_rj(k,2) = ar_ele_rj(k,1)**2 diff --git a/src/Fortran_libraries/SERIAL_src/SPH_SPECTR_src/t_fdm_coefs.f90 b/src/Fortran_libraries/SERIAL_src/SPH_SPECTR_src/t_fdm_coefs.f90 index b143ca8b..925c0a64 100644 --- a/src/Fortran_libraries/SERIAL_src/SPH_SPECTR_src/t_fdm_coefs.f90 +++ b/src/Fortran_libraries/SERIAL_src/SPH_SPECTR_src/t_fdm_coefs.f90 @@ -25,7 +25,7 @@ !! ---------------------------------------------------------------------- !! !! subroutine alloc_nod_fdm_matrices & -!! & (nri, num_order, n_minus, n_plus, fdmn_nod) +!! & (nri, ist_order, num_order, n_minus, n_plus, fdmn_nod) !! subroutine dealloc_nod_fdm_matrices(fdmn_nod) !! integer(kind = kint), intent(in) :: nri, num_order !! integer(kind = kint), intent(in) :: n_minus, n_plus @@ -59,7 +59,9 @@ module t_fdm_coefs ! !> Structure of FDM matrices type fdm_matrices -!> Coefficients to evaluate first radial derivative +!> Minimum order for derivative + integer(kind = kint) :: ist_order +!> Maximum order for derivative integer(kind = kint) :: n_order !> Structure of FDM matrix type(fdm_matrix), allocatable :: fdm(:) @@ -75,19 +77,20 @@ module t_fdm_coefs ! ----------------------------------------------------------------------- ! subroutine alloc_nod_fdm_matrices & - & (nri, num_order, n_minus, n_plus, fdmn_nod) + & (nri, ist_order, num_order, n_minus, n_plus, fdmn_nod) ! - integer(kind = kint), intent(in) :: nri, num_order + integer(kind = kint), intent(in) :: nri, ist_order, num_order integer(kind = kint), intent(in) :: n_minus, n_plus type(fdm_matrices), intent(inout) :: fdmn_nod ! integer(kind = kint) :: i ! ! - fdmn_nod%n_order = num_order - allocate( fdmn_nod%fdm(fdmn_nod%n_order) ) + fdmn_nod%ist_order = ist_order + fdmn_nod%n_order = num_order + allocate( fdmn_nod%fdm(ist_order:num_order) ) ! - do i = 1, fdmn_nod%n_order + do i = fdmn_nod%ist_order, fdmn_nod%n_order call alloc_fdm_matrix(nri, n_minus, n_plus, fdmn_nod%fdm(i)) end do ! @@ -102,7 +105,7 @@ subroutine dealloc_nod_fdm_matrices(fdmn_nod) integer(kind = kint) :: i ! ! - do i = 1, fdmn_nod%n_order + do i = fdmn_nod%ist_order, fdmn_nod%n_order call dealloc_fdm_matrix(fdmn_nod%fdm(i)) end do ! @@ -122,7 +125,7 @@ subroutine check_fdm_coefs(nri, r, fdmn_nod) integer(kind = kint) :: i ! ! - do i = 1, fdmn_nod%n_order + do i = fdmn_nod%ist_order, fdmn_nod%n_order write(50,*) 'Matrix for differences: ', i call check_fdm_coef(nri, r, fdmn_nod%fdm(i)) end do diff --git a/src/Fortran_libraries/SERIAL_src/SPH_SPECTR_src/third_fdm_node_to_ele.f90 b/src/Fortran_libraries/SERIAL_src/SPH_SPECTR_src/third_fdm_node_to_ele.f90 new file mode 100644 index 00000000..f6d61406 --- /dev/null +++ b/src/Fortran_libraries/SERIAL_src/SPH_SPECTR_src/third_fdm_node_to_ele.f90 @@ -0,0 +1,251 @@ +!>@file third_fdm_node_to_ele.f90 +!!@brief module third_fdm_node_to_ele +!! +!!@author H. Matsui +!!@date Programmed in Jan, 2020 +! +!>@brief Third order FDM from node to element +!! +!!@verbatim +!! subroutine const_third_fdm_node_to_ele(sph_rj, fdm_3rd_ele) +!! type(sph_rj_grid), intent(in) :: sph_rj +!! type(fdm_matrices), intent(inout) :: fdm_3rd_ele +!! subroutine cal_third_fdm_node_to_ele(i_th, kr_in, kr_out, & +!! & sph_rj, fdm_3rd_ele, d_rj, dele_dr) +!! type(sph_rj_grid), intent(in) :: sph_rj +!! integer(kind = kint), intent(in) :: i_th, kr_in, kr_out +!! real(kind = kreal), intent(in) :: d_rj(sph_rj%nnod_rj) +!! type(fdm_matrices), intent(in) :: fdm_3rd_ele +!! real(kind = kreal), intent(inout) :: dele_dr(sph_rj%nnod_rj) +!! ---------------------------------------------------------------------- +!! Coeeficients for derivatives by 1d finite difference method +!! +!! define of elemental field +!! r_ele(k) = half *(r_nod(k-1) + r_nod(k)) +!! d_ele(k) = half *(d_nod(k-1) + d_nod(k)) +!! +!! derivatives on node by element field +!! dfdr_ele(k) = fdm_3rd_ele%fdm(1)%dmat(k,-2) * d_nod(k-2) +!! + fdm_3rd_ele%fdm(1)%dmat(k,-1) * d_nod(k-1) +!! + fdm_3rd_ele%fdm(1)%dmat(k, 0) * d_nod(k ) +!! + fdm_3rd_ele%fdm(1)%dmat(k, 1) * d_nod(k+1) +!! d2fdr2_ele(k) = fdm_3rd_ele%fdm(2)%dmat(k,-2) * d_nod(k-2) +!! + fdm_3rd_ele%fdm(2)%dmat(k,-1) * d_nod(k-1) +!! + fdm_3rd_ele%fdm(2)%dmat(k, 0) * d_nod(k ) +!! + fdm_3rd_ele%fdm(2)%dmat(k, 1) * d_nod(k+1) +!! d3fdr3_ele(k) = fdm_3rd_ele%fdm(3)%dmat(k,-2) * d_nod(k-2) +!! + fdm_3rd_ele%fdm(3)%dmat(k,-1) * d_nod(k-1) +!! + fdm_3rd_ele%fdm(3)%dmat(k, 0) * d_nod(k ) +!! + fdm_3rd_ele%fdm(3)%dmat(k, 1) * d_nod(k+1) +!! +!! fdm_3rd_ele%fdm(1)%dmat = d1nod_mat_fdm_2e +!! +!! ---------------------------------------------------------------------- +!! Work array to obtain 1d FDM +!! +!! derivatives on node by element field +!! dfdr_ele(k) = fdm_3rd_ele%wk_mat(2,1) * d_ele(k-1) +!! + fdm_3rd_ele%wk_mat(2,2) * d_ele(k ) +!! ---------------------------------------------------------------------- +!! Numbering of node and element +!! n_k-2 e_k-1 n_k-1 e_k n_k e_k+1 n_k+1 +!! ...+-----x-----+-----x-----+-----x-----+----..... +!! r(k-2) r(k-1) r(k) r(k+1) +!!@endverbatim +!! +!!@n @param nri number of radial grid points +!!@n @param r(nri) radius +! + module third_fdm_node_to_ele +! + use m_precision + use m_constants + use m_machine_parameter + use t_spheric_parameter + use t_fdm_coefs +! + implicit none +! + private :: set_third_fdm_node_to_ele, copy_third_fdm_node_to_ele + private :: cal_sph_vect_dxr_ele +! +! ------------------------------------------------------------------- +! + contains +! +! ------------------------------------------------------------------- +! + subroutine const_third_fdm_node_to_ele(sph_rj, fdm_3rd_ele) +! + type(sph_rj_grid), intent(in) :: sph_rj +! + type(fdm_matrices), intent(inout) :: fdm_3rd_ele +! + real(kind = kreal), allocatable :: mat_fdm(:,:,:) +! +! + call alloc_nod_fdm_matrices & + & (sph_rj%nidx_rj(1), izero, ithree, itwo, ione, fdm_3rd_ele) +! + allocate(mat_fdm(4,4,sph_rj%nidx_rj(1))) + mat_fdm(1:4,1:4,1:sph_rj%nidx_rj(1)) = 0.0d0 +! + call set_third_fdm_node_to_ele & + & (sph_rj%nidx_rj(1), sph_rj%radius_1d_rj_r, mat_fdm) +! + call copy_third_fdm_node_to_ele & + & (sph_rj%nidx_rj(1), mat_fdm, fdm_3rd_ele%fdm) + deallocate(mat_fdm) +! + if(iflag_debug .gt. 0) then + write(*,*) 'check Third order FDM on element' + call check_fdm_coefs & + & (sph_rj%nidx_rj(1), sph_rj%radius_1d_rj_r, fdm_3rd_ele) + end if +! + end subroutine const_third_fdm_node_to_ele +! +! ----------------------------------------------------------------------- +! + subroutine cal_third_fdm_node_to_ele(i_th, kr_in, kr_out, & + & sph_rj, fdm_3rd_ele, d_rj, dele_dr) +! + type(sph_rj_grid), intent(in) :: sph_rj + integer(kind = kint), intent(in) :: i_th, kr_in, kr_out + real(kind = kreal), intent(in) :: d_rj(sph_rj%nnod_rj) + type(fdm_matrices), intent(in) :: fdm_3rd_ele +! + real(kind = kreal), intent(inout) :: dele_dr(sph_rj%nnod_rj) +! +! + call cal_sph_vect_dxr_ele(kr_in, kr_out, sph_rj, & + & fdm_3rd_ele%fdm(i_th), d_rj, dele_dr) +! + end subroutine cal_third_fdm_node_to_ele +! +! ----------------------------------------------------------------------- +! ----------------------------------------------------------------------- +! + subroutine set_third_fdm_node_to_ele(nri, r, mat_fdm) +! + use cal_inverse_small_matrix +! + integer(kind = kint), intent(in) :: nri + real(kind = kreal), intent(in) :: r(nri) + real(kind = kreal), intent(inout) :: mat_fdm(4,4,nri) +! + integer(kind = kint) :: kr, ierr +! + real(kind = kreal) :: mat_taylor_4(4,4) + real(kind = kreal) :: dr_n2, dr_1, dr_p2 + real(kind = kreal), parameter :: asix = 1.0d0 / 6.0d0 +! +! + do kr = 1, nri + if (kr .eq. 1) then + dr_n2 = r(1) + dr_1 = half * r(1) + dr_p2 = r(2) - half * r(1) + else if(kr .eq. 2) then + dr_n2 = half*(r(2) + r(1)) + dr_1 = half*(r(2) - r(1)) + dr_p2 = r(3) - half*(r(2) + r(1)) + else if(kr .eq. nri) then + dr_n2 = half*(r(nri) + r(nri-1)) - r(nri-2) + dr_1 = half*(r(nri) - r(nri-1)) + dr_p2 = r(nri) - r(nri-1) + else + dr_n2 = half*(r(kr) + r(kr-1)) - r(kr-2) + dr_1 = half*(r(kr) - r(kr-1)) + dr_p2 = r(kr+1) - half*(r(kr) + r(kr-1)) + end if +! + mat_taylor_4(1,1) = one + mat_taylor_4(1,2) = -dr_n2 + mat_taylor_4(1,3) = half * dr_n2**2 + mat_taylor_4(1,4) = -asix * dr_n2**3 +! + mat_taylor_4(2,1) = one + mat_taylor_4(2,2) = -dr_1 + mat_taylor_4(2,3) = half * dr_1**2 + mat_taylor_4(2,4) = -asix * dr_1**3 +! + mat_taylor_4(3,1) = one + mat_taylor_4(3,2) = dr_1 + mat_taylor_4(3,3) = half * dr_1**2 + mat_taylor_4(3,4) = asix * dr_1**3 +! + mat_taylor_4(4,1) = one + mat_taylor_4(4,2) = dr_p2 + mat_taylor_4(4,3) = half * dr_p2**2 + mat_taylor_4(4,4) = asix * dr_p2**3 +! + call cal_inverse_44_matrix & + & (mat_taylor_4, mat_fdm(1,1,kr), ierr) + end do +! + end subroutine set_third_fdm_node_to_ele +! +! ----------------------------------------------------------------------- +! + subroutine copy_third_fdm_node_to_ele(nri, mat_fdm, fdm) +! + integer(kind = kint), intent(in) :: nri + real(kind = kreal), intent(in) :: mat_fdm(4,4,nri) + type(fdm_matrix), intent(inout) :: fdm(0:3) +! + integer(kind= kint) :: i, k +! +! +!$omp parallel do private (i,k) + do i = 0, 3 + do k = 1, nri-1 + fdm(i)%dmat(k,-2) = mat_fdm(i+1,1,k) + fdm(i)%dmat(k,-1) = mat_fdm(i+1,2,k) + fdm(i)%dmat(k, 0) = mat_fdm(i+1,3,k) + fdm(i)%dmat(k, 1) = mat_fdm(i+1,4,k) + end do + end do +!$omp end parallel do +! + end subroutine copy_third_fdm_node_to_ele +! +! ----------------------------------------------------------------------- +! ----------------------------------------------------------------------- +! + subroutine cal_sph_vect_dxr_ele(kr_in, kr_out, sph_rj, & + & fdm, d_rj, dele_dr) +! + type(sph_rj_grid), intent(in) :: sph_rj + type(fdm_matrix), intent(in) :: fdm + integer(kind = kint), intent(in) :: kr_in, kr_out + real(kind = kreal), intent(in) :: d_rj(sph_rj%nnod_rj) +! + real(kind = kreal), intent(inout) :: dele_dr(sph_rj%nnod_rj) +! + integer(kind = kint) :: inod, i_n2, i_n1, i_p1, j, k + integer(kind = kint) :: ist, ied +! +! + ist = kr_in * sph_rj%nidx_rj(2) + 1 + ied = kr_out * sph_rj%nidx_rj(2) +!$omp parallel do private(inod,i_n2,i_n1,i_p1,j,k) + do inod = ist, ied + i_n1 = inod - sph_rj%nidx_rj(2) + i_n2 = i_n1 - sph_rj%nidx_rj(2) + i_p1 = inod + sph_rj%nidx_rj(2) + j = mod((inod-1),sph_rj%nidx_rj(2)) + 1 + k = 1 + (inod- j) / sph_rj%nidx_rj(2) +! + dele_dr(inod) = fdm%dmat(k,-2) * d_rj(i_n2) & + & + fdm%dmat(k,-1) * d_rj(i_n1) & + & + fdm%dmat(k, 0) * d_rj(inod) & + & + fdm%dmat(k, 1) * d_rj(i_p1) + end do +!$omp end parallel do +! + end subroutine cal_sph_vect_dxr_ele +! +! ----------------------------------------------------------------------- +! + end module third_fdm_node_to_ele diff --git a/src/Fortran_libraries/SOLVER_src/direct_solver/m_ludcmp_band.f90 b/src/Fortran_libraries/SOLVER_src/direct_solver/m_ludcmp_band.f90 index f257cf25..b4c2b915 100644 --- a/src/Fortran_libraries/SOLVER_src/direct_solver/m_ludcmp_band.f90 +++ b/src/Fortran_libraries/SOLVER_src/direct_solver/m_ludcmp_band.f90 @@ -115,7 +115,8 @@ subroutine ludcmp_band(n, nband, band_a, band_lu ,indx, d) aamax = max(aamax, abs(band_a(k,j))) ! aamax = max(aamax, abs(a(i,j))) end do - if (aamax.eq.0.0d0) pause 'singular matrix in ludcmp_band' + if (aamax.eq.0.0d0) write(*,*) & + & '!!!!!! singular matrix in ludcmp !!!!!!' vv(i)=1.0d0 / aamax idx_org(i) = i end do diff --git a/src/Fortran_libraries/UTILS_src/MESH/Makefile.depends b/src/Fortran_libraries/UTILS_src/MESH/Makefile.depends index 4a91cf22..78748e87 100644 --- a/src/Fortran_libraries/UTILS_src/MESH/Makefile.depends +++ b/src/Fortran_libraries/UTILS_src/MESH/Makefile.depends @@ -16,7 +16,7 @@ const_kemoview_mesh.o: $(MESHDIR)/const_kemoview_mesh.f90 m_precision.o m_consta $(F90) -c $(F90OPTFLAGS) $< const_merged_surf_4_group.o: $(MESHDIR)/const_merged_surf_4_group.f90 m_precision.o t_sum_hash.o t_mesh_data.o t_surface_data.o t_viewer_ele_grp_surface.o set_surface_hash.o mark_surf_hash.o set_surface_data.o const_surface_data.o $(F90) -c $(F90OPTFLAGS) $< -const_mesh_information.o: $(MESHDIR)/const_mesh_information.f90 m_precision.o m_machine_parameter.o t_mesh_data.o t_geometry_data.o t_group_data.o t_group_connects.o t_surface_group_connect.o t_surface_group_normals.o t_surface_data.o t_edge_data.o t_element_group_table.o set_smp_4_group_types.o set_connects_4_surf_group.o set_surf_edge_mesh.o nod_and_ele_derived_info.o cal_mesh_position.o const_surface_data.o set_size_4_smp_types.o +const_mesh_information.o: $(MESHDIR)/const_mesh_information.f90 m_precision.o m_machine_parameter.o t_mesh_data.o t_geometry_data.o t_group_data.o t_group_connects.o t_surface_group_connect.o t_surface_group_normals.o t_surface_data.o t_edge_data.o t_element_group_table.o set_smp_4_group_types.o set_connects_4_surf_group.o set_surf_edge_mesh.o nod_and_ele_derived_info.o m_connect_hexa_2_tetra.o cal_mesh_position.o const_surface_data.o set_size_4_smp_types.o $(F90) -c $(F90OPTFLAGS) $< const_node_list_4_viewer.o: $(MESHDIR)/const_node_list_4_viewer.f90 m_precision.o m_geometry_constants.o t_viewer_mesh.o t_viewer_group.o $(F90) -c $(F90OPTFLAGS) $< @@ -44,6 +44,10 @@ load_element_mesh_data.o: $(MESHDIR)/load_element_mesh_data.f90 m_precision.o m_ $(F90) -c $(F90OPTFLAGS) $< load_mesh_data.o: $(MESHDIR)/load_mesh_data.f90 m_precision.o m_constants.o m_machine_parameter.o t_file_IO_parameter.o t_mesh_data.o t_comm_table.o t_geometry_data.o t_surface_data.o t_edge_data.o t_group_data.o mesh_IO_select.o set_nnod_4_ele_by_type.o cal_minmax_and_stacks.o set_element_data_4_IO.o copy_mesh_structures.o set_group_types_4_IO.o $(F90) -c $(F90OPTFLAGS) $< +m_27quad_2_8x8linear.o: $(MESHDIR)/m_27quad_2_8x8linear.f90 m_precision.o m_geometry_constants.o + $(F90) -c $(F90OPTFLAGS) $< +m_connect_hexa_2_tetra.o: $(MESHDIR)/m_connect_hexa_2_tetra.f90 m_precision.o m_27quad_2_8x8linear.o + $(F90) -c $(F90OPTFLAGS) $< m_geometry_constants.o: $(MESHDIR)/m_geometry_constants.f90 m_precision.o $(F90) -c $(F90OPTFLAGS) $< m_node_quad_2_linear_sf.o: $(MESHDIR)/m_node_quad_2_linear_sf.f90 m_precision.o m_geometry_constants.o diff --git a/src/Fortran_libraries/UTILS_src/MESH/const_mesh_information.f90 b/src/Fortran_libraries/UTILS_src/MESH/const_mesh_information.f90 index bddb587a..29e6fc48 100644 --- a/src/Fortran_libraries/UTILS_src/MESH/const_mesh_information.f90 +++ b/src/Fortran_libraries/UTILS_src/MESH/const_mesh_information.f90 @@ -8,7 +8,7 @@ !! !!@verbatim !! subroutine empty_mesh_info(id_rank, mesh, group) -!! subroutine dealloc_empty_mesh_info(mesh, group) +!! subroutine dealloc_empty_mesh_info(mesh) !! type(mesh_geometry), intent(inout) :: mesh !! type(mesh_groups), intent(inout) :: group !! @@ -85,12 +85,11 @@ end subroutine empty_mesh_info ! ! ---------------------------------------------------------------------- ! - subroutine dealloc_empty_mesh_info(mesh, group) + subroutine dealloc_empty_mesh_info(mesh) ! use nod_and_ele_derived_info ! type(mesh_geometry), intent(inout) :: mesh - type(mesh_groups), intent(inout) :: group ! ! call dealloc_nod_and_ele_infos(mesh) @@ -103,12 +102,14 @@ end subroutine dealloc_empty_mesh_info subroutine const_surface_infos(id_rank, node, ele, surf_grp, & & surf, surf_nod_grp) ! + use m_connect_hexa_2_tetra use t_element_group_table use cal_mesh_position use const_surface_data use set_surf_edge_mesh use set_connects_4_surf_group use set_size_4_smp_types + use nod_and_ele_derived_info ! use check_surface_groups ! integer, intent(in) :: id_rank @@ -118,7 +119,17 @@ subroutine const_surface_infos(id_rank, node, ele, surf_grp, & ! type(surface_data), intent(inout) :: surf type(surface_node_grp_data), intent(inout) :: surf_nod_grp +! + integer(kind = kint) :: num_internal_surf ! +! + if(ele%nnod_4_ele .eq. num_t_linear) then + call set_1_hexa_2_5_tetra + else if (ele%nnod_4_ele .eq. num_t_quad) then + call set_1_hexa_2_21_tetra + else if (ele%nnod_4_ele .eq. num_t_lag) then + call set_1_hexa_2_40_tetra + end if ! ! set connectivity and geometry for surface and edge if(iflag_debug .gt. 0) write(*,*) 'const_surf_connectivity' @@ -142,6 +153,11 @@ subroutine const_surface_infos(id_rank, node, ele, surf_grp, & if (iflag_debug.gt.0) write(*,*) 'set_center_of_surface' call alloc_surface_geometory(surf) call set_center_of_surface(node, surf) +! + call alloc_interior_surf(surf) + call easy_internal_element_flag & + & (node%internal_node, surf%numsurf, surf%ie_surf, & + & num_internal_surf, surf%interior_surf) ! end subroutine const_surface_infos ! diff --git a/src/Fortran_libraries/UTILS_src/MESH/m_27quad_2_8x8linear.f90 b/src/Fortran_libraries/UTILS_src/MESH/m_27quad_2_8x8linear.f90 new file mode 100644 index 00000000..c067faa4 --- /dev/null +++ b/src/Fortran_libraries/UTILS_src/MESH/m_27quad_2_8x8linear.f90 @@ -0,0 +1,214 @@ +!>@file m_27quad_2_8x8linear.f90 +!!@brief module m_27quad_2_8x8linear +!! +!!@author H. Matsui +!!@date Programmed in Apr., 2006 +!! +!>@brief Make linear elements from quad mesh +!! +!!@verbatim +!! subroutine set_27quad_2_8x8linear_1ele(ie1_q27, ie1_l) +!! integer(kind = kint), intent(in) :: ie1_q27(27) +!! integer(kind = kint), intent(inout) :: ie1_l(num_t_linear,8) +!! Caution!: i is connectivity and j is divided element +!! in ie1_l(i,j) +!! subroutine set_27quad_2_8x8linear(numele, numele8, ie_l, ie_q27) +!! subroutine gen_connect_quad27_from_quad20(nnod332, nele332, & +!! & nsurf332, ie_332, isf_ele_332, ie_333) +!!@endverbatim +! + module m_27quad_2_8x8linear +! + use m_precision + use m_geometry_constants +! + implicit none +! + integer(kind = kint), parameter :: id_quad27_8linear8(8,8) & + & = reshape((/ 1, 9, 25, 12, 17, 23, 27, 21, & + & 9, 2, 10, 25, 23, 18, 22, 27, & + & 25, 10, 3, 11, 27, 22, 19, 24, & + & 12, 25, 11, 4, 21, 27, 24, 20, & + & 17, 23, 27, 21, 5, 13, 26, 16, & + & 23, 18, 22, 27, 13, 6, 14, 26, & + & 27, 22, 19, 24, 26, 14, 7, 15, & + & 21, 27, 24, 20, 16, 26, 15, 8/),shape=(/8,8/)) +! +! --------------------------------------------------------------------- +! + contains +! +! --------------------------------------------------------------------- +! + subroutine set_27quad_2_8x8linear_1ele(ie1_q27, ie1_l) +! + integer(kind = kint), intent(in) :: ie1_q27(27) + integer(kind = kint), intent(inout) :: ie1_l(num_t_linear,8) +! +! + ie1_l(1:8,1) = ie1_q27(id_quad27_8linear8(1:8,1)) + ie1_l(1:8,2) = ie1_q27(id_quad27_8linear8(1:8,2)) + ie1_l(1:8,3) = ie1_q27(id_quad27_8linear8(1:8,3)) + ie1_l(1:8,4) = ie1_q27(id_quad27_8linear8(1:8,4)) + ie1_l(1:8,5) = ie1_q27(id_quad27_8linear8(1:8,5)) + ie1_l(1:8,6) = ie1_q27(id_quad27_8linear8(1:8,6)) + ie1_l(1:8,7) = ie1_q27(id_quad27_8linear8(1:8,7)) + ie1_l(1:8,8) = ie1_q27(id_quad27_8linear8(1:8,8)) +! + end subroutine set_27quad_2_8x8linear_1ele +! +! --------------------------------------------------------------------- +! + subroutine set_27quad_2_8x8linear(nele_q, ie_q27, nele_l, ie_l) +! + integer(kind = kint), intent(in) :: nele_q, nele_l + integer(kind = kint), intent(in) :: ie_q27(nele_q,27) + integer(kind = kint), intent(inout) :: ie_l(nele_l,8) +! + integer(kind = kint) :: iele + integer(kind = kint) :: iele1, iele2, iele3, iele4 + integer(kind = kint) :: iele5, iele6, iele7, iele8 +! +! +!$omp parallel do & +!$omp& private(iele1,iele2,iele3,iele4,iele5,iele6,iele7,iele8) +!$cdir parallel do & +!$cdir& private(iele1,iele2,iele3,iele4,iele5,iele6,iele7,iele8) +!poption parallel + do iele = 1, nele_q + iele1 = 8*(iele-1) + 1 + iele2 = 8*(iele-1) + 2 + iele3 = 8*(iele-1) + 3 + iele4 = 8*(iele-1) + 4 + iele5 = 8*(iele-1) + 5 + iele6 = 8*(iele-1) + 6 + iele7 = 8*(iele-1) + 7 + iele8 = 8*(iele-1) + 8 +! + ie_l(iele1,1) = ie_q27(iele,id_quad27_8linear8(1,1)) + ie_l(iele1,2) = ie_q27(iele,id_quad27_8linear8(2,1)) + ie_l(iele1,3) = ie_q27(iele,id_quad27_8linear8(3,1)) + ie_l(iele1,4) = ie_q27(iele,id_quad27_8linear8(4,1)) + ie_l(iele1,5) = ie_q27(iele,id_quad27_8linear8(5,1)) + ie_l(iele1,6) = ie_q27(iele,id_quad27_8linear8(6,1)) + ie_l(iele1,7) = ie_q27(iele,id_quad27_8linear8(7,1)) + ie_l(iele1,8) = ie_q27(iele,id_quad27_8linear8(8,1)) +! + ie_l(iele2,1) = ie_q27(iele,id_quad27_8linear8(1,2)) + ie_l(iele2,2) = ie_q27(iele,id_quad27_8linear8(2,2)) + ie_l(iele2,3) = ie_q27(iele,id_quad27_8linear8(3,2)) + ie_l(iele2,4) = ie_q27(iele,id_quad27_8linear8(4,2)) + ie_l(iele2,5) = ie_q27(iele,id_quad27_8linear8(5,2)) + ie_l(iele2,6) = ie_q27(iele,id_quad27_8linear8(6,2)) + ie_l(iele2,7) = ie_q27(iele,id_quad27_8linear8(7,2)) + ie_l(iele2,8) = ie_q27(iele,id_quad27_8linear8(8,2)) +! + ie_l(iele3,1) = ie_q27(iele,id_quad27_8linear8(1,3)) + ie_l(iele3,2) = ie_q27(iele,id_quad27_8linear8(2,3)) + ie_l(iele3,3) = ie_q27(iele,id_quad27_8linear8(3,3)) + ie_l(iele3,4) = ie_q27(iele,id_quad27_8linear8(4,3)) + ie_l(iele3,5) = ie_q27(iele,id_quad27_8linear8(5,3)) + ie_l(iele3,6) = ie_q27(iele,id_quad27_8linear8(6,3)) + ie_l(iele3,7) = ie_q27(iele,id_quad27_8linear8(7,3)) + ie_l(iele3,8) = ie_q27(iele,id_quad27_8linear8(8,3)) +! + ie_l(iele4,1) = ie_q27(iele,id_quad27_8linear8(1,4)) + ie_l(iele4,2) = ie_q27(iele,id_quad27_8linear8(2,4)) + ie_l(iele4,3) = ie_q27(iele,id_quad27_8linear8(3,4)) + ie_l(iele4,4) = ie_q27(iele,id_quad27_8linear8(4,4)) + ie_l(iele4,5) = ie_q27(iele,id_quad27_8linear8(5,4)) + ie_l(iele4,6) = ie_q27(iele,id_quad27_8linear8(6,4)) + ie_l(iele4,7) = ie_q27(iele,id_quad27_8linear8(7,4)) + ie_l(iele4,8) = ie_q27(iele,id_quad27_8linear8(8,4)) +! + ie_l(iele5,1) = ie_q27(iele,id_quad27_8linear8(1,5)) + ie_l(iele5,2) = ie_q27(iele,id_quad27_8linear8(2,5)) + ie_l(iele5,3) = ie_q27(iele,id_quad27_8linear8(3,5)) + ie_l(iele5,4) = ie_q27(iele,id_quad27_8linear8(4,5)) + ie_l(iele5,5) = ie_q27(iele,id_quad27_8linear8(5,5)) + ie_l(iele5,6) = ie_q27(iele,id_quad27_8linear8(6,5)) + ie_l(iele5,7) = ie_q27(iele,id_quad27_8linear8(7,5)) + ie_l(iele5,8) = ie_q27(iele,id_quad27_8linear8(8,5)) +! + ie_l(iele6,1) = ie_q27(iele,id_quad27_8linear8(1,6)) + ie_l(iele6,2) = ie_q27(iele,id_quad27_8linear8(2,6)) + ie_l(iele6,3) = ie_q27(iele,id_quad27_8linear8(3,6)) + ie_l(iele6,4) = ie_q27(iele,id_quad27_8linear8(4,6)) + ie_l(iele6,5) = ie_q27(iele,id_quad27_8linear8(5,6)) + ie_l(iele6,6) = ie_q27(iele,id_quad27_8linear8(6,6)) + ie_l(iele6,7) = ie_q27(iele,id_quad27_8linear8(7,6)) + ie_l(iele6,8) = ie_q27(iele,id_quad27_8linear8(8,6)) +! + ie_l(iele7,1) = ie_q27(iele,id_quad27_8linear8(1,7)) + ie_l(iele7,2) = ie_q27(iele,id_quad27_8linear8(2,7)) + ie_l(iele7,3) = ie_q27(iele,id_quad27_8linear8(3,7)) + ie_l(iele7,4) = ie_q27(iele,id_quad27_8linear8(4,7)) + ie_l(iele7,5) = ie_q27(iele,id_quad27_8linear8(5,7)) + ie_l(iele7,6) = ie_q27(iele,id_quad27_8linear8(6,7)) + ie_l(iele7,7) = ie_q27(iele,id_quad27_8linear8(7,7)) + ie_l(iele7,8) = ie_q27(iele,id_quad27_8linear8(8,7)) +! + ie_l(iele8,1) = ie_q27(iele,id_quad27_8linear8(1,8)) + ie_l(iele8,2) = ie_q27(iele,id_quad27_8linear8(2,8)) + ie_l(iele8,3) = ie_q27(iele,id_quad27_8linear8(3,8)) + ie_l(iele8,4) = ie_q27(iele,id_quad27_8linear8(4,8)) + ie_l(iele8,5) = ie_q27(iele,id_quad27_8linear8(5,8)) + ie_l(iele8,6) = ie_q27(iele,id_quad27_8linear8(6,8)) + ie_l(iele8,7) = ie_q27(iele,id_quad27_8linear8(7,8)) + ie_l(iele8,8) = ie_q27(iele,id_quad27_8linear8(8,8)) + end do +!$omp end parallel do +! + end subroutine set_27quad_2_8x8linear +! +! --------------------------------------------------------------------- +! + subroutine gen_connect_quad27_from_quad20(nnod332, nele332, & + & nsurf332, ie_332, isf_ele_332, ie_333) +! + integer(kind = kint), intent(in) :: nnod332, nele332, nsurf332 + integer(kind = kint), intent(in) :: ie_332(nele332,20) + integer(kind = kint), intent(in) :: isf_ele_332(nele332,6) +! + integer(kind = kint), intent(inout) :: ie_333(nele332,27) +! + integer(kind = kint) :: iele +! +! +!$omp parallel do + do iele = 1, nele332 + ie_333(iele, 1) = ie_332(iele, 1) + ie_333(iele, 2) = ie_332(iele, 2) + ie_333(iele, 3) = ie_332(iele, 3) + ie_333(iele, 4) = ie_332(iele, 4) + ie_333(iele, 5) = ie_332(iele, 5) + ie_333(iele, 6) = ie_332(iele, 6) + ie_333(iele, 7) = ie_332(iele, 7) + ie_333(iele, 8) = ie_332(iele, 8) + ie_333(iele, 9) = ie_332(iele, 9) + ie_333(iele,10) = ie_332(iele,10) + ie_333(iele,11) = ie_332(iele,11) + ie_333(iele,12) = ie_332(iele,12) + ie_333(iele,13) = ie_332(iele,13) + ie_333(iele,14) = ie_332(iele,14) + ie_333(iele,15) = ie_332(iele,15) + ie_333(iele,16) = ie_332(iele,16) + ie_333(iele,17) = ie_332(iele,17) + ie_333(iele,18) = ie_332(iele,18) + ie_333(iele,19) = ie_332(iele,19) + ie_333(iele,20) = ie_332(iele,20) + ie_333(iele,21) = abs(isf_ele_332(iele,1)) + nnod332 + ie_333(iele,22) = abs(isf_ele_332(iele,2)) + nnod332 + ie_333(iele,23) = abs(isf_ele_332(iele,3)) + nnod332 + ie_333(iele,24) = abs(isf_ele_332(iele,4)) + nnod332 + ie_333(iele,25) = abs(isf_ele_332(iele,5)) + nnod332 + ie_333(iele,26) = abs(isf_ele_332(iele,6)) + nnod332 + ie_333(iele,27) = iele + nnod332 + nsurf332 + end do +!$omp end parallel do +! + end subroutine gen_connect_quad27_from_quad20 +! +! --------------------------------------------------------------------- +! + end module m_27quad_2_8x8linear diff --git a/src/Fortran_libraries/UTILS_src/MESH/m_connect_hexa_2_tetra.f90 b/src/Fortran_libraries/UTILS_src/MESH/m_connect_hexa_2_tetra.f90 new file mode 100644 index 00000000..ff4bd1dd --- /dev/null +++ b/src/Fortran_libraries/UTILS_src/MESH/m_connect_hexa_2_tetra.f90 @@ -0,0 +1,115 @@ +!>@file m_connect_hexa_2_tetra.f90 +!!@brief module m_connect_hexa_2_tetra +!! +!!@author H. Matsui +!!@date Programmed in May, 2009 +! +!> @brief Index table to devide one hexahedron to tetrahidra +!! linear element -> 5 tetrahidra +!! quad element -> 21 tetrahidra +!! laglandge element -> 40 tetrahidra +!! +!! subroutine set_1_hexa_2_5_tetra +!! subroutine set_1_hexa_2_21_tetra +!! subroutine set_1_hexa_2_40_tetra +!! +!! subroutine deallocate_hex_2_tetra +! + module m_connect_hexa_2_tetra +! + use m_precision +! + implicit none +! +!> number of tetrahidra from one hexahedron element + integer(kind = kint) :: num_tetra +!> local index to construct tetrahidra from one hexahedron element +!! ie_tetra(i,j): i...tetrahidra ID, j...devided ID + integer(kind = kint), allocatable :: ie_tetra(:,:) +! +!> index table for linear element + integer(kind = kint), parameter :: ie_hex_2_5tetra(4,5) & + & = reshape( & + & (/ 1, 2, 3, 6, 3, 4, 1, 8, 6, 5, 8, 1, & + & 7, 6, 8, 3, 1, 3, 8, 6 /), & + & shape=(/4,5/)) +! +! +!> index table for quad element + integer(kind = kint), parameter :: ie_hex_2_21tetra(4,21) & + & = reshape( & + & (/ 9, 10, 11, 14, 11, 12, 9, 16, 14, 13, 16, 9, & + & 15, 14, 16, 11, 9, 11, 16, 14, 9, 13, 16, 17, & + & 16, 12, 9, 17, 9, 10, 14, 18, 14, 13, 9, 18, & + & 10, 11, 14, 19, 11, 15, 14, 19, 11, 12, 16, 20, & + & 16, 15, 11, 20, 1, 9, 12, 17, 2, 10, 9, 18, & + & 3, 11, 10, 19, 4, 12, 11, 20, 5, 16, 13, 17, & + & 6, 13, 14, 18, 7, 14, 15, 19, 8, 15, 16, 20 /), & + & shape=(/4,21/)) +! + private :: ie_hex_2_5tetra, ie_hex_2_21tetra +! +! ---------------------------------------------------------------------- +! + contains +! +! ---------------------------------------------------------------------- +! + subroutine set_1_hexa_2_5_tetra +! +! + num_tetra = 5 + allocate( ie_tetra(4,num_tetra) ) + ie_tetra(1:4,1:num_tetra) = ie_hex_2_5tetra(1:4,1:num_tetra) +! + end subroutine set_1_hexa_2_5_tetra +! +! ---------------------------------------------------------------------- +! + subroutine set_1_hexa_2_21_tetra +! +! + num_tetra = 21 + allocate( ie_tetra(4,num_tetra) ) + ie_tetra(1:4,1:num_tetra) = ie_hex_2_21tetra(1:4,1:num_tetra) +! + end subroutine set_1_hexa_2_21_tetra +! +! ---------------------------------------------------------------------- +! + subroutine set_1_hexa_2_40_tetra +! + use m_27quad_2_8x8linear +! + integer (kind=kint) :: i, j, k, i1, i2, i3, i4 +! + num_tetra = 40 + allocate( ie_tetra(4,num_tetra) ) +! + do j = 1, 8 + do i = 1, 5 + k = (j-1)*5 + i + i1 = ie_hex_2_5tetra(1,i) + i2 = ie_hex_2_5tetra(2,i) + i3 = ie_hex_2_5tetra(3,i) + i4 = ie_hex_2_5tetra(4,i) + ie_tetra(1,i) = id_quad27_8linear8(i1,j) + ie_tetra(2,i) = id_quad27_8linear8(i2,j) + ie_tetra(3,i) = id_quad27_8linear8(i3,j) + ie_tetra(4,i) = id_quad27_8linear8(i4,j) + end do + end do +! + end subroutine set_1_hexa_2_40_tetra +! +! ---------------------------------------------------------------------- +! + subroutine deallocate_hex_2_tetra +! + deallocate(ie_tetra) +! + end subroutine deallocate_hex_2_tetra +! +! ---------------------------------------------------------------------- +! + end module m_connect_hexa_2_tetra diff --git a/src/Fortran_libraries/UTILS_src/MESH/m_geometry_constants.f90 b/src/Fortran_libraries/UTILS_src/MESH/m_geometry_constants.f90 index 4c732e70..31c7bbe8 100644 --- a/src/Fortran_libraries/UTILS_src/MESH/m_geometry_constants.f90 +++ b/src/Fortran_libraries/UTILS_src/MESH/m_geometry_constants.f90 @@ -42,6 +42,9 @@ module m_geometry_constants !> number of nodes in linear edge integer(kind=kint), parameter :: num_linear_edge = 2 ! +!> number of nodes in linear edge + integer(kind=kint), parameter :: num_linear_point = 1 +! !> number of surface in each element integer(kind=kint), parameter :: nsurf_4_ele = 6 !> number of edge in each element diff --git a/src/Fortran_libraries/UTILS_src/MESH/nod_and_ele_derived_info.f90 b/src/Fortran_libraries/UTILS_src/MESH/nod_and_ele_derived_info.f90 index 36b25c7b..62453a4f 100644 --- a/src/Fortran_libraries/UTILS_src/MESH/nod_and_ele_derived_info.f90 +++ b/src/Fortran_libraries/UTILS_src/MESH/nod_and_ele_derived_info.f90 @@ -18,7 +18,7 @@ !! type(mesh_geometry), intent(in) :: org_mesh !! type(mesh_geometry), intent(inout) :: new_mesh !! -!! subroutine set_internal_element_flag(internal_node, numele, ie, & +!! subroutine easy_internal_element_flag(internal_node, numele, ie,& !! & internal_ele, interior_ele) !! integer(kind = kint), intent(in) :: internal_node !! integer(kind = kint), intent(in) :: numele @@ -61,7 +61,7 @@ subroutine set_nod_and_ele_infos(node, ele) if (iflag_debug.eq.1) write(*,*) 'set_center_of_element' call set_center_of_element(node, ele) end if - call set_internal_element_flag & + call easy_internal_element_flag & & (node%internal_node, ele%numele, ele%ie(1,1), & & ele%internal_ele, ele%interior_ele) ! @@ -112,7 +112,7 @@ end subroutine dealloc_nod_and_ele_infos ! ---------------------------------------------------------------------- ! ---------------------------------------------------------------------- ! - subroutine set_internal_element_flag(internal_node, numele, ie, & + subroutine easy_internal_element_flag(internal_node, numele, ie, & & internal_ele, interior_ele) ! integer(kind = kint), intent(in) :: internal_node @@ -143,7 +143,7 @@ subroutine set_internal_element_flag(internal_node, numele, ie, & !%omp end parallel do internal_ele = icou ! - end subroutine set_internal_element_flag + end subroutine easy_internal_element_flag ! ! ---------------------------------------------------------------------- ! diff --git a/src/Fortran_libraries/UTILS_src/MESH/t_surface_data.f90 b/src/Fortran_libraries/UTILS_src/MESH/t_surface_data.f90 index 450f156b..10d88af5 100644 --- a/src/Fortran_libraries/UTILS_src/MESH/t_surface_data.f90 +++ b/src/Fortran_libraries/UTILS_src/MESH/t_surface_data.f90 @@ -9,6 +9,7 @@ !!@verbatim !! subroutine allocate_inod_in_surf(surf) !! subroutine alloc_surface_connect(surf, nele) +!! subroutine alloc_global_surf_id(surf) !! subroutine alloc_interior_surf(surf) !! subroutine alloc_ext_surface(surf) !! subroutine alloc_iso_surface(surf) @@ -19,6 +20,8 @@ !! !! subroutine dealloc_inod_in_surf(surf) !! subroutine dealloc_surface_connect(surf) +!! +!! subroutine dealloc_global_surf_id(surf) !! subroutine dealloc_interior_surf(nele) !! subroutine deallocate_ext_surface_type(surf) !! subroutine deallocate_iso_surface_type(surf) @@ -143,19 +146,29 @@ end subroutine alloc_surface_connect ! ! --------------------------------------------------------------------- ! - subroutine alloc_interior_surf(surf) + subroutine alloc_global_surf_id(surf) ! type(surface_data), intent(inout) :: surf ! allocate(surf%isurf_global(surf%numsurf)) - allocate(surf%interior_surf(surf%numsurf)) + if (surf%numsurf .le. 0) return +!$omp parallel workshare + surf%isurf_global(1:surf%numsurf) = 0 +!$omp end parallel workshare ! - if (surf%numsurf.gt. 0) then + end subroutine alloc_global_surf_id +! +! --------------------------------------------------------------------- +! + subroutine alloc_interior_surf(surf) +! + type(surface_data), intent(inout) :: surf +! + allocate(surf%interior_surf(surf%numsurf)) + if (surf%numsurf .le. 0) return !$omp parallel workshare - surf%isurf_global = 0 - surf%interior_surf = 0 + surf%interior_surf = 0 !$omp end parallel workshare - end if ! end subroutine alloc_interior_surf ! @@ -271,13 +284,24 @@ subroutine dealloc_surface_connect(surf) end subroutine dealloc_surface_connect ! ! --------------------------------------------------------------------- +! + subroutine dealloc_global_surf_id(surf) +! + type(surface_data), intent(inout) :: surf +! + if(allocated(surf%isurf_global) .eqv. .FALSE.) return + deallocate(surf%isurf_global) +! + end subroutine dealloc_global_surf_id +! +! --------------------------------------------------------------------- ! subroutine dealloc_interior_surf(surf) ! type(surface_data), intent(inout) :: surf ! if(allocated(surf%interior_surf) .eqv. .FALSE.) return - deallocate(surf%isurf_global, surf%interior_surf) + deallocate(surf%interior_surf) ! end subroutine dealloc_interior_surf ! diff --git a/src/Fortran_libraries/VIZ_src/surfacing/FEM_to_PSF_bridge.f90 b/src/Fortran_libraries/VIZ_src/surfacing/FEM_to_PSF_bridge.f90 index d1f5045a..333c3ac0 100644 --- a/src/Fortran_libraries/VIZ_src/surfacing/FEM_to_PSF_bridge.f90 +++ b/src/Fortran_libraries/VIZ_src/surfacing/FEM_to_PSF_bridge.f90 @@ -8,7 +8,8 @@ !! !!@verbatim !! subroutine init_FEM_to_PSF_bridge & -!! & (viz_step, geofem, edge_comm, m_SR) +!! & (elps_SECT, viz_step, geofem, edge_comm, m_SR) +!! type(elapsed_labels_4_SECTIONS), intent(in) :: elps_SECT !! type(VIZ_step_params), intent(in) :: viz_step !! type(mesh_data), intent(inout) :: geofem !! type(communication_table), intent(inout) :: edge_comm @@ -35,11 +36,13 @@ module FEM_to_PSF_bridge ! ---------------------------------------------------------------------- ! subroutine init_FEM_to_PSF_bridge & - & (viz_step, geofem, edge_comm, m_SR) + & (elps_SECT, viz_step, geofem, edge_comm, m_SR) ! + use t_elapsed_labels_4_SECTIONS use parallel_FEM_mesh_init use const_element_comm_tables ! + type(elapsed_labels_4_SECTIONS), intent(in) :: elps_SECT type(VIZ_step_params), intent(in) :: viz_step type(mesh_data), intent(inout) :: geofem type(communication_table), intent(inout) :: edge_comm @@ -56,10 +59,14 @@ subroutine init_FEM_to_PSF_bridge & ! iflag = viz_step%PSF_t%increment + viz_step%ISO_t%increment if(iflag .gt. 0) then + if(elps_SECT%flag_elapsed_S) & + & call start_elapsed_time(elps_SECT%ist_elapsed_S+6) if(iflag_debug .gt. 0) write(*,*) 'const_edge_comm_table' call const_edge_comm_table & & (geofem%mesh%node, geofem%mesh%nod_comm, & & edge_comm, geofem%mesh%edge, m_SR) + if(elps_SECT%flag_elapsed_S) & + & call end_elapsed_time(elps_SECT%ist_elapsed_S+6) end if ! end subroutine init_FEM_to_PSF_bridge diff --git a/src/Fortran_libraries/VIZ_src/surfacing/Makefile.depends b/src/Fortran_libraries/VIZ_src/surfacing/Makefile.depends index 3867d05f..d46926ca 100644 --- a/src/Fortran_libraries/VIZ_src/surfacing/Makefile.depends +++ b/src/Fortran_libraries/VIZ_src/surfacing/Makefile.depends @@ -1,4 +1,4 @@ -FEM_to_PSF_bridge.o: $(PSF_SECTION_DIR)/FEM_to_PSF_bridge.f90 m_precision.o m_machine_parameter.o t_mesh_data.o t_phys_data.o t_comm_table.o t_VIZ_step_parameter.o t_mesh_SR.o parallel_FEM_mesh_init.o const_element_comm_tables.o +FEM_to_PSF_bridge.o: $(PSF_SECTION_DIR)/FEM_to_PSF_bridge.f90 m_precision.o m_machine_parameter.o t_mesh_data.o t_phys_data.o t_comm_table.o t_VIZ_step_parameter.o t_mesh_SR.o t_elapsed_labels_4_SECTIONS.o parallel_FEM_mesh_init.o const_element_comm_tables.o $(F90) -c $(F90OPTFLAGS) $< bcast_ctl_data_surfacings.o: $(PSF_SECTION_DIR)/bcast_ctl_data_surfacings.f90 m_precision.o m_machine_parameter.o calypso_mpi.o t_control_data_surfacings.o transfer_to_long_integers.o calypso_mpi_char.o calypso_mpi_int.o bcast_control_arrays.o bcast_section_control_data.o $(F90) -c $(F90OPTFLAGS) $< @@ -26,12 +26,12 @@ ctl_file_section_def_IO.o: $(PSF_SECTION_DIR)/ctl_file_section_def_IO.f90 m_prec $(F90) -c $(F90OPTFLAGS) $< ctl_file_sections_IO.o: $(PSF_SECTION_DIR)/ctl_file_sections_IO.f90 m_precision.o m_machine_parameter.o t_control_data_4_psf.o t_control_data_sections.o t_read_control_elements.o ctl_data_section_IO.o write_control_elements.o skip_comment_f.o $(F90) -c $(F90OPTFLAGS) $< +elapsed_labels_4_PSF.o: $(PSF_SECTION_DIR)/elapsed_labels_4_PSF.f90 m_precision.o m_work_time.o + $(F90) -c $(F90OPTFLAGS) $< find_node_and_patch_psf.o: $(PSF_SECTION_DIR)/find_node_and_patch_psf.f90 m_precision.o m_machine_parameter.o t_solver_SR.o t_solver_SR_int8.o t_psf_geometry_list.o t_psf_patch_data.o m_geometry_constants.o calypso_mpi.o calypso_mpi_int.o t_control_params_4_psf.o t_mesh_data.o t_surface_group_connect.o t_psf_case_table.o set_nodes_for_psf.o set_patches_for_psf.o const_element_comm_tables.o $(F90) -c $(F90OPTFLAGS) $< get_geometry_reference.o: $(PSF_SECTION_DIR)/get_geometry_reference.f90 m_precision.o m_constants.o set_components_flags.o $(F90) -c $(F90OPTFLAGS) $< -m_elapsed_labels_4_VIZ.o: $(PSF_SECTION_DIR)/m_elapsed_labels_4_VIZ.f90 m_precision.o m_work_time.o - $(F90) -c $(F90OPTFLAGS) $< m_intersection_data_0.o: $(PSF_SECTION_DIR)/m_intersection_data_0.f90 m_precision.o $(F90) -c $(F90OPTFLAGS) $< m_intersection_data_1.o: $(PSF_SECTION_DIR)/m_intersection_data_1.f90 m_precision.o @@ -138,9 +138,13 @@ t_control_params_4_iso.o: $(PSF_SECTION_DIR)/t_control_params_4_iso.f90 m_precis $(F90) -c $(F90OPTFLAGS) $< t_control_params_4_psf.o: $(PSF_SECTION_DIR)/t_control_params_4_psf.f90 m_precision.o m_error_IDs.o m_file_format_switch.o t_control_data_4_psf_def.o t_group_data.o t_psf_patch_data.o set_area_4_viz.o m_section_coef_flags.o set_cross_section_coefs.o set_coefs_of_sections.o $(F90) -c $(F90OPTFLAGS) $< -t_cross_section.o: $(PSF_SECTION_DIR)/t_cross_section.f90 calypso_mpi.o m_precision.o m_constants.o m_machine_parameter.o t_time_data.o t_mesh_data.o t_comm_table.o t_phys_data.o t_psf_geometry_list.o t_psf_patch_data.o t_ucd_data.o t_solver_SR.o t_solver_SR_int8.o t_psf_case_table.o t_surface_group_connect.o t_file_IO_parameter.o t_control_params_4_psf.o t_control_data_sections.o m_work_time.o m_elapsed_labels_4_VIZ.o m_geometry_constants.o set_psf_control.o search_ele_list_for_psf.o set_const_4_sections.o find_node_and_patch_psf.o set_fields_for_psf.o output_4_psf.o set_ucd_data_to_type.o m_field_file_format.o +t_cross_section.o: $(PSF_SECTION_DIR)/t_cross_section.f90 calypso_mpi.o m_precision.o m_constants.o m_machine_parameter.o m_work_time.o t_time_data.o t_mesh_data.o t_comm_table.o t_phys_data.o t_psf_geometry_list.o t_psf_patch_data.o t_ucd_data.o t_solver_SR.o t_solver_SR_int8.o t_psf_case_table.o t_surface_group_connect.o t_file_IO_parameter.o t_control_params_4_psf.o t_control_data_sections.o m_geometry_constants.o set_psf_control.o search_ele_list_for_psf.o set_const_4_sections.o find_node_and_patch_psf.o set_fields_for_psf.o output_4_psf.o set_ucd_data_to_type.o m_field_file_format.o + $(F90) -c $(F90OPTFLAGS) $< +t_ctl_params_viz_fields.o: $(PSF_SECTION_DIR)/t_ctl_params_viz_fields.f90 m_precision.o t_phys_data.o t_control_array_character2.o set_components_flags.o set_field_comp_for_viz.o + $(F90) -c $(F90OPTFLAGS) $< +t_elapsed_labels_4_SECTIONS.o: $(PSF_SECTION_DIR)/t_elapsed_labels_4_SECTIONS.f90 m_precision.o m_work_time.o elapsed_labels_4_PSF.o $(F90) -c $(F90OPTFLAGS) $< -t_isosurface.o: $(PSF_SECTION_DIR)/t_isosurface.f90 m_precision.o t_mesh_data.o t_comm_table.o t_phys_data.o t_psf_geometry_list.o t_psf_patch_data.o t_time_data.o t_psf_case_table.o t_ucd_data.o t_file_IO_parameter.o t_control_params_4_iso.o t_control_data_isosurfaces.o t_solver_SR.o t_solver_SR_int8.o m_constants.o m_machine_parameter.o calypso_mpi.o m_geometry_constants.o set_iso_control.o search_ele_list_for_psf.o m_work_time.o m_elapsed_labels_4_VIZ.o set_const_4_sections.o find_node_and_patch_psf.o set_fields_for_psf.o output_4_psf.o set_psf_control.o m_field_file_format.o +t_isosurface.o: $(PSF_SECTION_DIR)/t_isosurface.f90 m_precision.o m_work_time.o t_mesh_data.o t_comm_table.o t_phys_data.o t_psf_geometry_list.o t_psf_patch_data.o t_time_data.o t_psf_case_table.o t_ucd_data.o t_file_IO_parameter.o t_control_params_4_iso.o t_control_data_isosurfaces.o t_solver_SR.o t_solver_SR_int8.o m_constants.o m_machine_parameter.o calypso_mpi.o m_geometry_constants.o set_iso_control.o search_ele_list_for_psf.o set_const_4_sections.o find_node_and_patch_psf.o set_fields_for_psf.o output_4_psf.o set_psf_control.o m_field_file_format.o $(F90) -c $(F90OPTFLAGS) $< t_psf_case_table.o: $(PSF_SECTION_DIR)/t_psf_case_table.f90 m_precision.o m_intersection_data_0.o m_intersection_data_1.o m_intersection_data_2.o m_intersection_data_3.o m_intersection_data_4.o m_intersection_data_5.o m_intersection_data_6.o m_intersection_data_7.o m_intersection_data_8.o m_intersection_data_9.o m_intersection_data_10.o m_intersection_data_11.o m_intersection_data_12.o m_intersection_data_13.o m_intersection_data_14.o m_geometry_constants.o $(F90) -c $(F90OPTFLAGS) $< @@ -148,6 +152,6 @@ t_psf_geometry_list.o: $(PSF_SECTION_DIR)/t_psf_geometry_list.f90 m_precision.o $(F90) -c $(F90OPTFLAGS) $< t_psf_patch_data.o: $(PSF_SECTION_DIR)/t_psf_patch_data.f90 m_precision.o t_geometry_data.o t_phys_data.o $(F90) -c $(F90OPTFLAGS) $< -t_viz_sections.o: $(PSF_SECTION_DIR)/t_viz_sections.f90 m_precision.o m_machine_parameter.o m_work_time.o m_elapsed_labels_4_VIZ.o calypso_mpi.o t_VIZ_step_parameter.o t_time_data.o t_mesh_data.o t_comm_table.o t_phys_data.o t_cross_section.o t_isosurface.o t_mesh_SR.o t_control_data_surfacings.o +t_viz_sections.o: $(PSF_SECTION_DIR)/t_viz_sections.f90 m_precision.o m_machine_parameter.o m_work_time.o calypso_mpi.o t_VIZ_step_parameter.o t_time_data.o t_mesh_data.o t_comm_table.o t_phys_data.o t_cross_section.o t_isosurface.o t_mesh_SR.o t_elapsed_labels_4_SECTIONS.o t_control_data_surfacings.o $(F90) -c $(F90OPTFLAGS) $< diff --git a/src/Fortran_libraries/VIZ_src/surfacing/convert_components_4_viz.f90 b/src/Fortran_libraries/VIZ_src/surfacing/convert_components_4_viz.f90 index 96b491b7..3e8bb11d 100644 --- a/src/Fortran_libraries/VIZ_src/surfacing/convert_components_4_viz.f90 +++ b/src/Fortran_libraries/VIZ_src/surfacing/convert_components_4_viz.f90 @@ -156,16 +156,15 @@ subroutine convert_comps_4_viz(nnod, istack_n_smp, xx, & & dat_xyz(1,1), dat_viz(1,1), xx(1,1), xx(1,2), cyl_s, a_s) ! else if ( icomp_viz .eq. icomp_PP_cyl ) then - call cal_pp_cyl_tensor_smp(np_smp, nnod, istack_n_smp, & - & dat_xyz(1,1), dat_viz(1,1), xx(1,1), xx(1,2), cyl_s, a_s) + call cal_pp_cyl_tensor_smp(nnod, dat_xyz(1,1), dat_viz(1,1), & + & xx(1,1), xx(1,2), cyl_s, a_s) ! else if ( icomp_viz .eq. icomp_PZ) then - call cal_pz_tensor_smp(np_smp, nnod, istack_n_smp, & - & dat_xyz(1,1), dat_viz(1,1), xx(1,1), xx(1,2), cyl_s, a_s) + call cal_pz_tensor_smp(nnod, dat_xyz(1,1), dat_viz(1,1), & + & xx(1,1), xx(1,2), cyl_s, a_s) ! else if ( icomp_viz .eq. icomp_ZZ_cyl ) then - call cal_zz_tensor_smp(np_smp, nnod, istack_n_smp, & - & dat_xyz(1,1), dat_viz(1,1) ) + call cal_zz_tensor_smp(nnod, dat_xyz(1,1), dat_viz(1,1) ) end if !$omp end parallel ! diff --git a/src/Fortran_libraries/VIZ_src/surfacing/elapsed_labels_4_PSF.f90 b/src/Fortran_libraries/VIZ_src/surfacing/elapsed_labels_4_PSF.f90 new file mode 100644 index 00000000..12412bb3 --- /dev/null +++ b/src/Fortran_libraries/VIZ_src/surfacing/elapsed_labels_4_PSF.f90 @@ -0,0 +1,108 @@ +!>@file elapsed_labels_4_PSF.f90 +!!@brief module elapsed_labels_4_PSF +!! +!!@author H. Matsui +!!@date Programmed in April, 2013 +! +!>@brief Initialize elepsed time monitoring +!! +!!@verbatim +!! subroutine elpsed_label_4_PSF(elps_PSF, elps) +!! subroutine reset_elapse_after_init_PSF(elps_PSF, elps) +!! type(elapsed_lables), intent(inout) :: elps_PSF +!! type(elapsed_time_data), intent(inout) :: elps +!! +!! subroutine elpsed_label_4_ISO(elps_ISO, elps) +!! subroutine reset_elapse_after_init_ISO(elps_ISO, elps) +!! type(elapsed_lables), intent(inout) :: elps_ISO +!! type(elapsed_time_data), intent(inout) :: elps +!!@endverbatim +! + module elapsed_labels_4_PSF +! + use m_precision + use m_work_time +! + implicit none +! +! ---------------------------------------------------------------------- +! + contains +! +! ---------------------------------------------------------------------- +! + subroutine elpsed_label_4_PSF(elps_PSF, elps) +! + type(elapsed_lables), intent(inout) :: elps_PSF + type(elapsed_time_data), intent(inout) :: elps + integer(kind = kint), parameter :: num_append = 3 +! +! + call append_elapsed_timer(num_append, elps_PSF%ist_elapsed, & + & elps_PSF%ied_elapsed, elps) +! + elps%labels(elps_PSF%ist_elapsed+1) & + & = 'Find Section patch ' + elps%labels(elps_PSF%ist_elapsed+2) & + & = 'Interpolate data on Section ' + elps%labels(elps_PSF%ist_elapsed+3) & + & = 'Output Sectioning data ' +! + elps_PSF%flag_elapsed = .TRUE. +! + end subroutine elpsed_label_4_PSF +! +!----------------------------------------------------------------------- +! + subroutine reset_elapse_after_init_PSF(elps_PSF, elps) +! + type(elapsed_lables), intent(in) :: elps_PSF + type(elapsed_time_data), intent(inout) :: elps +! + if(elps_PSF%flag_elapsed .eqv. .FALSE.) return + call reset_elapsed_timer(elps_PSF%ist_elapsed+2, & + & elps_PSF%ist_elapsed+2, elps) +! + end subroutine reset_elapse_after_init_PSF +! +!----------------------------------------------------------------------- +!----------------------------------------------------------------------- +! + subroutine elpsed_label_4_ISO(elps_ISO, elps) +! + type(elapsed_lables), intent(inout) :: elps_ISO + type(elapsed_time_data), intent(inout) :: elps +! + integer(kind = kint), parameter :: num_append = 3 +! +! + call append_elapsed_timer(num_append, elps_ISO%ist_elapsed, & + & elps_ISO%ied_elapsed, elps) +! + elps%labels(elps_ISO%ist_elapsed+1) & + & = 'Find Isosurface patch ' + elps%labels(elps_ISO%ist_elapsed+2) & + & = 'Interpolate data on isosurface ' + elps%labels(elps_ISO%ist_elapsed+3) & + & = 'Output Isosurface data ' +! + elps_ISO%flag_elapsed = .TRUE. +! + end subroutine elpsed_label_4_ISO +! +!----------------------------------------------------------------------- +! + subroutine reset_elapse_after_init_ISO(elps_ISO, elps) +! + type(elapsed_lables), intent(in) :: elps_ISO + type(elapsed_time_data), intent(inout) :: elps +! + if(elps_ISO%flag_elapsed .eqv. .FALSE.) return + call reset_elapsed_timer(elps_ISO%ist_elapsed+2, & + & elps_ISO%ist_elapsed+2, elps) +! + end subroutine reset_elapse_after_init_ISO +! +!----------------------------------------------------------------------- +! + end module elapsed_labels_4_PSF diff --git a/src/Fortran_libraries/VIZ_src/surfacing/m_elapsed_labels_4_VIZ.f90 b/src/Fortran_libraries/VIZ_src/surfacing/m_elapsed_labels_4_VIZ.f90 deleted file mode 100644 index a96cb97c..00000000 --- a/src/Fortran_libraries/VIZ_src/surfacing/m_elapsed_labels_4_VIZ.f90 +++ /dev/null @@ -1,338 +0,0 @@ -!>@file m_elapsed_labels_4_VIZ.f90 -!!@brief module m_elapsed_labels_4_VIZ -!! -!!@author H. Matsui -!!@date Programmed in April, 2013 -! -!>@brief Initialize elepsed time monitoring -!! -!!@verbatim -!! subroutine elpsed_label_4_VIZ -!! subroutine reset_elapse_after_init_VIZ -!!@endverbatim -! - module m_elapsed_labels_4_VIZ -! - use m_precision - use m_work_time -! - implicit none -! - logical, save :: iflag_VIZ_time = .FALSE. - integer(kind = kint), save :: ist_elapsed_VIZ = 0 - integer(kind = kint), save :: ied_elapsed_VIZ = 0 -! - logical, save :: iflag_PVR_time = .FALSE. - integer(kind = kint), save :: ist_elapsed_PVR = 0 - integer(kind = kint), save :: ied_elapsed_PVR = 0 -! - logical, save :: iflag_LIC_time = .FALSE. - integer(kind = kint), save :: ist_elapsed_LIC = 0 - integer(kind = kint), save :: ied_elapsed_LIC = 0 -! - logical, save :: iflag_PSF_time = .FALSE. - integer(kind = kint), save :: ist_elapsed_PSF = 0 - integer(kind = kint), save :: ied_elapsed_PSF = 0 -! - logical, save :: iflag_ISO_time = .FALSE. - integer(kind = kint), save :: ist_elapsed_ISO = 0 - integer(kind = kint), save :: ied_elapsed_ISO = 0 -! - logical, save :: iflag_MAP_time = .FALSE. - integer(kind = kint), save :: ist_elapsed_MAP = 0 - integer(kind = kint), save :: ied_elapsed_MAP = 0 -! - private :: elpsed_label_4_VIZ_outline - private :: elpsed_label_4_PVR, elpsed_label_4_LIC - private :: reset_elapse_after_init_VIZ_top -! - private :: reset_elapse_after_init_PVR - private :: reset_elapse_after_init_LIC - private :: reset_elapse_after_init_PSF - private :: reset_elapse_after_init_ISO - private :: reset_elapse_after_init_MAP -! -! ---------------------------------------------------------------------- -! - contains -! -! ---------------------------------------------------------------------- -! - subroutine elpsed_label_4_VIZ -! -! - call elpsed_label_4_VIZ_outline - call elpsed_label_4_PVR - call elpsed_label_4_LIC -! - call elpsed_label_4_PSF - call elpsed_label_4_ISO - call elpsed_label_4_MAP -! - end subroutine elpsed_label_4_VIZ -! -! ---------------------------------------------------------------------- -! - subroutine reset_elapse_after_init_VIZ -! -! - call reset_elapse_after_init_VIZ_top -! call reset_elapse_after_init_PVR - call reset_elapse_after_init_LIC -! - call reset_elapse_after_init_PSF - call reset_elapse_after_init_ISO - call reset_elapse_after_init_MAP -! - end subroutine reset_elapse_after_init_VIZ -! -! ---------------------------------------------------------------------- -! ---------------------------------------------------------------------- -! - subroutine elpsed_label_4_VIZ_outline -! - integer(kind = kint), parameter :: num_append = 15 -! -! - call append_elapsed_times & - & (num_append, ist_elapsed_VIZ, ied_elapsed_VIZ) -! - elps1%labels(ist_elapsed_VIZ+ 1) & - & = 'Sectioning initialization. ' - elps1%labels(ist_elapsed_VIZ+ 2) = 'Sectioning. ' -! - elps1%labels(ist_elapsed_VIZ+ 3) & - & = 'Isosurfaceing initialization. ' - elps1%labels(ist_elapsed_VIZ+ 4) = 'Isosurfaceing. ' -! - elps1%labels(ist_elapsed_VIZ+ 5) & - & = 'Map projection initialization. ' - elps1%labels(ist_elapsed_VIZ+ 6) = 'Map projection. ' -! - elps1%labels(ist_elapsed_VIZ+ 7) & - & = 'Volume rendering initialization. ' - elps1%labels(ist_elapsed_VIZ+ 8) = 'Volume rendering. ' -! - elps1%labels(ist_elapsed_VIZ+ 9) & - & = 'LIC rendering initialization. ' - elps1%labels(ist_elapsed_VIZ+10) = 'LIC rendering. ' -! - elps1%labels(ist_elapsed_VIZ+11) & - & = 'fieldline initialization. ' - elps1%labels(ist_elapsed_VIZ+12) = 'fieldline. ' -! - elps1%labels(ist_elapsed_VIZ+13) = 'VTK output in viz module' - elps1%labels(ist_elapsed_VIZ+14) & - & = 'ele. comm. table for LIC ' - elps1%labels(ist_elapsed_VIZ+15) & - & = 'edge comm. table for surfacing ' -! - iflag_VIZ_time = .TRUE. -! - end subroutine elpsed_label_4_VIZ_outline -! -!----------------------------------------------------------------------- -! - subroutine elpsed_label_4_PVR -! - integer(kind = kint), parameter :: num_append = 12 -! -! - call append_elapsed_times & - & (num_append, ist_elapsed_PVR, ied_elapsed_PVR) -! - elps1%labels(ist_elapsed_PVR+1) & - & = 'Volume rendering w/o file output ' - elps1%labels(ist_elapsed_PVR+2) & - & = 'Volume rendering file output ' - elps1%labels(ist_elapsed_PVR+3) & - & = 'V. Rendering ray trace ' - elps1%labels(ist_elapsed_PVR+4) & - & = 'V. Rendering subimage composit ' -! - elps1%labels(ist_elapsed_PVR+5) & - & = 'bcast_pvr_controls ' - elps1%labels(ist_elapsed_PVR+6) & - & = 'set_pvr_controls ' - elps1%labels(ist_elapsed_PVR+7) & - & = 'each_PVR_initialize ' - elps1%labels(ist_elapsed_PVR+8) & - & = 's_const_comm_tbl_img_output ' - elps1%labels(ist_elapsed_PVR+9) & - & = 's_const_comm_tbl_img_composit ' - elps1%labels(ist_elapsed_PVR+10) & - & = 'calypso_SR_type_int pvr_init ' - elps1%labels(ist_elapsed_PVR+11) & - & = 'calypso_SR_type_1 pvr_init ' - elps1%labels(ist_elapsed_PVR+12) & - & = 'set_image_stacking_and_recv ' -! - iflag_PVR_time = .TRUE. -! - end subroutine elpsed_label_4_PVR -! -!----------------------------------------------------------------------- -! - subroutine elpsed_label_4_LIC -! - integer(kind = kint), parameter :: num_append = 9 -! -! - call append_elapsed_times & - & (num_append, ist_elapsed_LIC, ied_elapsed_LIC) -! - elps1%labels(ist_elapsed_LIC+1) & - & = 'LIC V. rendering w/o file output ' - elps1%labels(ist_elapsed_LIC+2) & - & = 'LIC V. rendering file output ' - elps1%labels(ist_elapsed_LIC+3) & - & = 'LIC V. Rendering ray trace ' - elps1%labels(ist_elapsed_LIC+4) & - & = 'Line integration for LIC ' - elps1%labels(ist_elapsed_LIC+5) & - & = 'LIC V. Rendering subimage composit ' - elps1%labels(ist_elapsed_LIC+6) & - & = 'LIC V. Rendering domain repartition ' - elps1%labels(ist_elapsed_LIC+7) & - & = 'LIC data transfer to new domain ' - elps1%labels(ist_elapsed_LIC+8) & - & = 'FEM_mesh_initialization for LIC mesh ' - elps1%labels(ist_elapsed_LIC+9) & - & = 'Data IO for line integration counts ' -! - iflag_LIC_time = .TRUE. -! - end subroutine elpsed_label_4_LIC -! -!----------------------------------------------------------------------- -! - subroutine elpsed_label_4_PSF -! - integer(kind = kint), parameter :: num_append = 3 -! -! - call append_elapsed_times & - & (num_append, ist_elapsed_PSF, ied_elapsed_PSF) -! - elps1%labels(ist_elapsed_PSF+1) & - & = 'Find Section patch ' - elps1%labels(ist_elapsed_PSF+2) & - & = 'Interpolate data on Section ' - elps1%labels(ist_elapsed_PSF+3) & - & = 'Output Sectioning data ' -! - iflag_PSF_time = .TRUE. -! - end subroutine elpsed_label_4_PSF -! -!----------------------------------------------------------------------- -! - subroutine elpsed_label_4_ISO -! - integer(kind = kint), parameter :: num_append = 3 -! -! - call append_elapsed_times & - & (num_append, ist_elapsed_ISO, ied_elapsed_ISO) -! - elps1%labels(ist_elapsed_ISO+1) & - & = 'Find Isosurface patch ' - elps1%labels(ist_elapsed_ISO+2) & - & = 'Interpolate data on isosurface ' - elps1%labels(ist_elapsed_ISO+3) & - & = 'Output Isosurface data ' -! - iflag_ISO_time = .TRUE. -! - end subroutine elpsed_label_4_ISO -! -!----------------------------------------------------------------------- -! - subroutine elpsed_label_4_MAP -! - integer(kind = kint), parameter :: num_append = 3 -! -! - call append_elapsed_times & - & (num_append, ist_elapsed_MAP, ied_elapsed_MAP) -! - elps1%labels(ist_elapsed_MAP+1) & - & = 'Collect map data ' - elps1%labels(ist_elapsed_MAP+2) & - & = 'Interpolate data on map ' - elps1%labels(ist_elapsed_MAP+3) & - & = 'Output Map image ' -! - iflag_MAP_time = .TRUE. -! - end subroutine elpsed_label_4_MAP -! -!----------------------------------------------------------------------- -!----------------------------------------------------------------------- -! - subroutine reset_elapse_after_init_VIZ_top -! -! - if(iflag_VIZ_time .eqv. .FALSE.) return - call reset_elapsed_times(ist_elapsed_VIZ+ 2, ist_elapsed_VIZ+ 2) - call reset_elapsed_times(ist_elapsed_VIZ+ 4, ist_elapsed_VIZ+ 4) - call reset_elapsed_times(ist_elapsed_VIZ+ 6, ist_elapsed_VIZ+ 6) - call reset_elapsed_times(ist_elapsed_VIZ+ 8, ist_elapsed_VIZ+ 8) - call reset_elapsed_times(ist_elapsed_VIZ+10, ist_elapsed_VIZ+10) - call reset_elapsed_times(ist_elapsed_VIZ+12, ist_elapsed_VIZ+12) -! - end subroutine reset_elapse_after_init_VIZ_top -! -!----------------------------------------------------------------------- -! - subroutine reset_elapse_after_init_PVR -! -! - if(iflag_PVR_time .eqv. .FALSE.) return - call reset_elapsed_times(ist_elapsed_PVR+1, ied_elapsed_PVR) -! - end subroutine reset_elapse_after_init_PVR -! -!----------------------------------------------------------------------- -! - subroutine reset_elapse_after_init_LIC -! -! - if(iflag_LIC_time .eqv. .FALSE.) return - call reset_elapsed_times(ist_elapsed_LIC+1, ied_elapsed_LIC) -! - end subroutine reset_elapse_after_init_LIC -! -!----------------------------------------------------------------------- -! - subroutine reset_elapse_after_init_PSF -! -! - if(iflag_PSF_time .eqv. .FALSE.) return - call reset_elapsed_times(ist_elapsed_PSF+2, ist_elapsed_PSF+2) -! - end subroutine reset_elapse_after_init_PSF -! -!----------------------------------------------------------------------- -! - subroutine reset_elapse_after_init_ISO -! -! - if(iflag_ISO_time .eqv. .FALSE.) return - call reset_elapsed_times(ist_elapsed_ISO+2, ist_elapsed_ISO+2) -! - end subroutine reset_elapse_after_init_ISO -! -!----------------------------------------------------------------------- -! - subroutine reset_elapse_after_init_MAP -! -! - if(iflag_ISO_time .eqv. .FALSE.) return - call reset_elapsed_times(ist_elapsed_MAP+2, ist_elapsed_MAP+2) -! - end subroutine reset_elapse_after_init_MAP -! -!----------------------------------------------------------------------- -! - end module m_elapsed_labels_4_VIZ diff --git a/src/Fortran_libraries/VIZ_src/surfacing/output_4_psf.f90 b/src/Fortran_libraries/VIZ_src/surfacing/output_4_psf.f90 index 384961b6..a58b4fdb 100644 --- a/src/Fortran_libraries/VIZ_src/surfacing/output_4_psf.f90 +++ b/src/Fortran_libraries/VIZ_src/surfacing/output_4_psf.f90 @@ -33,7 +33,6 @@ module output_4_psf ! use calypso_mpi use t_time_data - use t_time_data use t_ucd_data use t_file_IO_parameter use t_psf_patch_data diff --git a/src/Fortran_libraries/VIZ_src/surfacing/set_area_4_viz.f90 b/src/Fortran_libraries/VIZ_src/surfacing/set_area_4_viz.f90 index 423245f1..2f10619c 100644 --- a/src/Fortran_libraries/VIZ_src/surfacing/set_area_4_viz.f90 +++ b/src/Fortran_libraries/VIZ_src/surfacing/set_area_4_viz.f90 @@ -1,15 +1,20 @@ -! -! module set_area_4_viz -! -! programmed by H.Matsui on May, 2006 -! -! subroutine count_area_4_viz(num_mat, mat_name, & -! & num_area_grp, area_ele_grp, ngrp_area) -! subroutine s_set_area_4_viz(num_mat, mat_name, & -! & num_area_grp, area_ele_grp, ngrp_area, id_ele_grp_psf) -! -! subroutine set_surf_grp_id_4_viz(num_surf, surf_name, & -! & chosen_surf_grp, id_surf_grp) +!>@file set_area_4_viz.f90 +!!@brief module set_area_4_viz +!! +!!@author H. Matsui +!!@date Programmed in May, 2006 +! +!> @brief Choose group IDs to use +!! +!!@verbatim +!! subroutine count_area_4_viz(num_mat, mat_name, & +!! & num_area_grp, area_ele_grp, ngrp_area) +!! subroutine s_set_area_4_viz(num_mat, mat_name, & +!! & num_area_grp, area_ele_grp, ngrp_area, id_ele_grp_psf) +! +!! integer(kind = kint) function set_surf_grp_id_4_viz & +!! & (num_surf, surf_name, chosen_surf_grp) +!!@endverbatim ! module set_area_4_viz ! @@ -94,26 +99,29 @@ end subroutine s_set_area_4_viz ! --------------------------------------------------------------------- ! --------------------------------------------------------------------- ! - subroutine set_surf_grp_id_4_viz(num_surf, surf_name, & - & chosen_surf_grp, id_surf_grp) + integer(kind = kint) function set_surf_grp_id_4_viz & + & (num_surf, surf_name, chosen_surf_grp) ! integer(kind = kint), intent(in) :: num_surf character(len=kchara), intent(in) :: surf_name(num_surf) ! character(len=kchara), intent(in) :: chosen_surf_grp - integer(kind = kint), intent(inout) :: id_surf_grp ! + integer(kind = kint) :: id_surf_grp integer(kind = kint) :: id ! ! + id_surf_grp = 0 do id = 1, num_surf - if ( chosen_surf_grp .eq. surf_name(id)) then + if(chosen_surf_grp .eq. surf_name(id)) then id_surf_grp = id exit end if end do + set_surf_grp_id_4_viz = id_surf_grp + return ! - end subroutine set_surf_grp_id_4_viz + end function set_surf_grp_id_4_viz ! ! --------------------------------------------------------------------- ! diff --git a/src/Fortran_libraries/VIZ_src/surfacing/set_fields_for_psf.f90 b/src/Fortran_libraries/VIZ_src/surfacing/set_fields_for_psf.f90 index 583ddabc..da175def 100644 --- a/src/Fortran_libraries/VIZ_src/surfacing/set_fields_for_psf.f90 +++ b/src/Fortran_libraries/VIZ_src/surfacing/set_fields_for_psf.f90 @@ -230,9 +230,9 @@ subroutine set_field_on_psf(numnod, numedge, nnod_4_edge, & ! icou = 0 do i = 1, nfield_psf - call set_field_on_psf_xyz(numnod, numedge, nnod_4_edge, & - & ie_edge, nnod_patch, num_phys, ntot_phys, istack_ncomp, & - & d_nod, ifield_psf(i), ncomp_org(i), dat_tmp, psf_list) + call set_field_on_psf_xyz(numnod, numedge, nnod_4_edge, & + & ie_edge, nnod_patch, num_phys, ntot_phys, istack_ncomp, & + & d_nod, ifield_psf(i), ncomp_org(i), dat_tmp, psf_list) ! call convert_comps_4_viz(nnod_patch, istack_n_smp, & & xyz_psf, rr_psf, ar_psf, ss_psf, as_psf, & diff --git a/src/Fortran_libraries/VIZ_src/surfacing/t_VIZ_step_parameter.f90 b/src/Fortran_libraries/VIZ_src/surfacing/t_VIZ_step_parameter.f90 index e1b6d637..65a64f19 100644 --- a/src/Fortran_libraries/VIZ_src/surfacing/t_VIZ_step_parameter.f90 +++ b/src/Fortran_libraries/VIZ_src/surfacing/t_VIZ_step_parameter.f90 @@ -42,6 +42,8 @@ module t_VIZ_step_parameter type(IO_step_param) :: LIC_t !> time step paremters for field lines type(IO_step_param) :: FLINE_t +!> time step paremters for tracer + type(IO_step_param) :: TRACER_t ! !> step number for sectioning file integer(kind = kint) :: istep_psf = 0 @@ -55,6 +57,8 @@ module t_VIZ_step_parameter integer(kind = kint) :: istep_lic = 0 !> step number for field lines file integer(kind = kint) :: istep_fline = 0 +!> step number for field lines file + integer(kind = kint) :: istep_tracer = 0 end type VIZ_step_params ! !----------------------------------------------------------------------- @@ -111,6 +115,8 @@ subroutine istep_viz_w_fix_dt(i_step, viz_step) viz_step%istep_lic = istep_file_w_fix_dt(i_step, viz_step%LIC_t) viz_step%istep_fline & & = istep_file_w_fix_dt(i_step, viz_step%FLINE_t) + viz_step%istep_tracer & + & = istep_file_w_fix_dt(i_step, viz_step%TRACER_t) ! end subroutine istep_viz_w_fix_dt ! @@ -129,6 +135,8 @@ subroutine istep_viz_w_flex_dt(time_d, viz_step) viz_step%istep_lic = istep_file_w_flex_dt(time_d, viz_step%LIC_t) viz_step%istep_fline & & = istep_file_w_flex_dt(time_d, viz_step%FLINE_t) + viz_step%istep_tracer & + & = istep_file_w_flex_dt(time_d, viz_step%TRACER_t) ! end subroutine istep_viz_w_flex_dt ! @@ -167,6 +175,10 @@ subroutine viz_fixed_time_step_params(dt, tctl, viz_step) call output_step_4_fixed_step_ctl & & (izero, dt, tctl%i_step_lic_ctl, tctl%delta_t_lic_ctl, & & viz_step%LIC_t) +! + call output_step_4_fixed_step_ctl & + & (izero, dt, tctl%i_step_tracer_output_ctl, & + & tctl%delta_t_tracer_output_ctl, viz_step%TRACER_t) ! end subroutine viz_fixed_time_step_params ! @@ -204,6 +216,10 @@ subroutine viz_flex_time_step_controls(tctl, dt, viz_step) call output_step_4_flex_step_ctl & & (izero, dt, tctl%i_step_lic_ctl, tctl%delta_t_lic_ctl, & & viz_step%LIC_t) +! + call output_step_4_flex_step_ctl & + & (izero, dt, tctl%i_step_tracer_output_ctl, & + & tctl%delta_t_tracer_output_ctl, viz_step%TRACER_t) ! end subroutine viz_flex_time_step_controls ! diff --git a/src/Fortran_libraries/VIZ_src/surfacing/t_control_data_4_fld_on_psf.f90 b/src/Fortran_libraries/VIZ_src/surfacing/t_control_data_4_fld_on_psf.f90 index 3eabedc9..5d998d5e 100644 --- a/src/Fortran_libraries/VIZ_src/surfacing/t_control_data_4_fld_on_psf.f90 +++ b/src/Fortran_libraries/VIZ_src/surfacing/t_control_data_4_fld_on_psf.f90 @@ -37,7 +37,7 @@ !! begin field_on_isosurf !! result_type constant !! result_value 0.7 -!! array output_field 2 +!! array output_field !! output_field velocity vector end !! output_field magnetic_field radial end !! end array output_field diff --git a/src/Fortran_libraries/VIZ_src/surfacing/t_control_params_4_psf.f90 b/src/Fortran_libraries/VIZ_src/surfacing/t_control_params_4_psf.f90 index cd15ddb8..4125dc10 100644 --- a/src/Fortran_libraries/VIZ_src/surfacing/t_control_params_4_psf.f90 +++ b/src/Fortran_libraries/VIZ_src/surfacing/t_control_params_4_psf.f90 @@ -130,9 +130,9 @@ subroutine set_control_psf_define & tmpchara = psf_def_c%section_method_ctl%charavalue if(ierr .gt. 0 .and. cmp_no_case(tmpchara, cflag_grp)) then psf_def%id_section_method = 0 - call set_surf_grp_id_4_viz(sf_grp%num_grp, sf_grp%grp_name, & - & psf_def_c%psf_group_name_ctl%charavalue, & - & psf_def%id_psf_group) + psf_def%id_psf_group & + & = set_surf_grp_id_4_viz(sf_grp%num_grp, sf_grp%grp_name, & + & psf_def_c%psf_group_name_ctl%charavalue) else if(ierr .gt. 0) then write(e_message,'(a)') 'Set cross section mode' return diff --git a/src/Fortran_libraries/VIZ_src/surfacing/t_cross_section.f90 b/src/Fortran_libraries/VIZ_src/surfacing/t_cross_section.f90 index fe965586..bcd18043 100644 --- a/src/Fortran_libraries/VIZ_src/surfacing/t_cross_section.f90 +++ b/src/Fortran_libraries/VIZ_src/surfacing/t_cross_section.f90 @@ -8,8 +8,10 @@ !>@brief Structure for cross sectioning !! !!@verbatim -!! subroutine SECTIONING_initialize(increment_psf, geofem, & -!! & edge_comm, nod_fld, psf_ctls, psf, SR_sig, SR_il) +!! subroutine SECTIONING_initialize(increment_psf, elps_PSF, & +!! & geofem, edge_comm, nod_fld, psf_ctls, & +!! & psf, SR_sig, SR_il) +!! type(elapsed_lables), intent(in) :: elps_PSF !! type(mesh_data), intent(in) :: geofem !! type(communication_table), intent(in) :: edge_comm !! type(phys_data), intent(in) :: nod_fld @@ -17,8 +19,9 @@ !! type(sectioning_module), intent(inout) :: psf !! type(send_recv_status), intent(inout) :: SR_sig !! type(send_recv_int8_buffer), intent(inout) :: SR_il -!! subroutine SECTIONING_visualize & -!! & (istep_psf, time_d, geofem, nod_fld, psf) +!! subroutine SECTIONING_visualize(istep_psf, elps_PSF, time_d, & +!! & geofem, nod_fld, psf) +!! type(elapsed_lables), intent(in) :: elps_PSF !! type(time_data), intent(in) :: time_d !! type(mesh_data), intent(in) :: geofem !! type(phys_data), intent(in) :: nod_fld @@ -34,6 +37,7 @@ module t_cross_section ! use m_constants use m_machine_parameter + use m_work_time use calypso_mpi ! use t_time_data @@ -94,11 +98,10 @@ module t_cross_section ! ! --------------------------------------------------------------------- ! - subroutine SECTIONING_initialize(increment_psf, geofem, & - & edge_comm, nod_fld, psf_ctls, psf, SR_sig, SR_il) + subroutine SECTIONING_initialize(increment_psf, elps_PSF, & + & geofem, edge_comm, nod_fld, psf_ctls, & + & psf, SR_sig, SR_il) ! - use m_work_time - use m_elapsed_labels_4_VIZ use m_geometry_constants ! use calypso_mpi @@ -110,6 +113,7 @@ subroutine SECTIONING_initialize(increment_psf, geofem, & use output_4_psf ! integer(kind = kint), intent(in) :: increment_psf + type(elapsed_lables), intent(in) :: elps_PSF type(mesh_data), intent(in) :: geofem type(communication_table), intent(in) :: edge_comm type(phys_data), intent(in) :: nod_fld @@ -150,7 +154,8 @@ subroutine SECTIONING_initialize(increment_psf, geofem, & & (geofem%mesh%node, psf%psf_list(i_psf)) end do ! - if(iflag_PSF_time) call start_elapsed_time(ist_elapsed_PSF+1) + if(elps_PSF%flag_elapsed) & + & call start_elapsed_time(elps_PSF%ist_elapsed+1) if (iflag_debug.eq.1) write(*,*) 'set_const_4_crossections' call set_const_4_crossections & & (psf%num_psf, psf%psf_def, geofem%mesh%node, psf%psf_list) @@ -162,28 +167,30 @@ subroutine SECTIONING_initialize(increment_psf, geofem, & & psf%psf_grp_list, psf%psf_mesh, SR_sig, SR_il) ! call alloc_psf_field_data(psf%num_psf, psf%psf_mesh) - if(iflag_PSF_time) call end_elapsed_time(ist_elapsed_PSF+1) + if(elps_PSF%flag_elapsed) & + & call end_elapsed_time(elps_PSF%ist_elapsed+1) ! if (iflag_debug.eq.1) write(*,*) 'output_section_mesh' - if(iflag_PSF_time) call start_elapsed_time(ist_elapsed_PSF+3) + if(elps_PSF%flag_elapsed) & + & call start_elapsed_time(elps_PSF%ist_elapsed+3) call output_section_mesh(psf%num_psf, psf%psf_file_IO, & & psf%psf_mesh, psf%psf_out) - if(iflag_PSF_time) call end_elapsed_time(ist_elapsed_PSF+3) + if(elps_PSF%flag_elapsed) & + & call end_elapsed_time(elps_PSF%ist_elapsed+3) ! end subroutine SECTIONING_initialize ! ! --------------------------------------------------------------------- ! - subroutine SECTIONING_visualize & - & (istep_psf, time_d, geofem, nod_fld, psf) + subroutine SECTIONING_visualize(istep_psf, elps_PSF, time_d, & + & geofem, nod_fld, psf) ! - use m_work_time - use m_elapsed_labels_4_VIZ use set_fields_for_psf use set_ucd_data_to_type use output_4_psf ! integer(kind = kint), intent(in) :: istep_psf + type(elapsed_lables), intent(in) :: elps_PSF type(time_data), intent(in) :: time_d type(mesh_data), intent(in) :: geofem type(phys_data), intent(in) :: nod_fld @@ -193,17 +200,21 @@ subroutine SECTIONING_visualize & ! if (psf%num_psf.le.0 .or. istep_psf.le.0) return ! - if(iflag_PSF_time) call start_elapsed_time(ist_elapsed_PSF+2) + if(elps_PSF%flag_elapsed) & + & call start_elapsed_time(elps_PSF%ist_elapsed+2) call set_field_4_psf(psf%num_psf, geofem%mesh%edge, nod_fld, & & psf%psf_def, psf%psf_param, psf%psf_list, psf%psf_grp_list, & & psf%psf_mesh) - if(iflag_PSF_time) call end_elapsed_time(ist_elapsed_PSF+2) + if(elps_PSF%flag_elapsed) & + & call end_elapsed_time(elps_PSF%ist_elapsed+2) ! if (iflag_debug.eq.1) write(*,*) 'output_section_data' - if(iflag_PSF_time) call start_elapsed_time(ist_elapsed_PSF+3) + if(elps_PSF%flag_elapsed) & + & call start_elapsed_time(elps_PSF%ist_elapsed+3) call output_section_data(psf%num_psf, psf%psf_file_IO, & & istep_psf, time_d, psf%psf_time_IO, psf%psf_out) - if(iflag_PSF_time) call end_elapsed_time(ist_elapsed_PSF+3) + if(elps_PSF%flag_elapsed) & + & call end_elapsed_time(elps_PSF%ist_elapsed+3) ! end subroutine SECTIONING_visualize ! diff --git a/src/Fortran_libraries/VIZ_src/surfacing/t_ctl_params_viz_fields.f90 b/src/Fortran_libraries/VIZ_src/surfacing/t_ctl_params_viz_fields.f90 new file mode 100644 index 00000000..0559e4b5 --- /dev/null +++ b/src/Fortran_libraries/VIZ_src/surfacing/t_ctl_params_viz_fields.f90 @@ -0,0 +1,233 @@ +!>@file t_ctl_params_viz_fields.f90 +!!@brief module t_ctl_params_viz_fields +!! +!!@date Programmed by H.Matsui in Aug. 2011 +! +!>@brief control parameters for each field line +!! +!!@verbatim +!! subroutine dealloc_ctl_params_viz_fields(viz_fields) +!! type(ctl_params_viz_fields), intent(inout) :: viz_fields +!! subroutine set_ctl_params_viz_fields(field_output_ctl, nod_fld, & +!! & viz_fields) +!! type(phys_data), intent(in) :: nod_fld +!! type(ctl_array_c2), intent(in) :: field_output_ctl +!! type(ctl_params_viz_fields), intent(inout) :: viz_fields +!! +!! subroutine copy_ctl_params_viz_fields(num_field, viz_fields, & +!! & new_viz_fields) +!! subroutine append_ctl_params_viz_fields & +!! & (field_name, iphys_field, icomp_flag, & +!! & num_comp, ncomp_org, viz_fields) +!!@endverbatim +! + module t_ctl_params_viz_fields +! + use m_precision +! + implicit none +! +! +!> control parameter for vizulization field output + type ctl_params_viz_fields +!> number of field for coloring + integer(kind = kint) :: num_color_fields = 0 +!> number of field for coloring + integer(kind = kint) :: ntot_color_comp = 0 +!> Field name for fieldline color + character(len = kchara), allocatable :: color_field_name(:) +!> Field address for fieldline color + integer(kind = kint), allocatable :: ifleld_color_field(:) +!> component address for fieldline color + integer(kind = kint), allocatable :: icomp_color_field(:) +!> number of component for fieldline color + integer(kind = kint), allocatable :: istack_color_field(:) +!> number of component for fieldline color + integer(kind = kint), allocatable :: ncomp_color_field(:) +! +!> number of component for fieldline color + integer(kind = kint), allocatable :: ncomp_org_color_field(:) +!> number of component for fieldline color + integer(kind = kint), allocatable :: istack_org_ncomp(:) +!> number of field for coloring + integer(kind = kint) :: ntot_org_comp = 0 + end type ctl_params_viz_fields +! + private :: alloc_ctl_params_viz_fields +! +! --------------------------------------------------------------------- +! + contains +! +! --------------------------------------------------------------------- +! + subroutine alloc_ctl_params_viz_fields(num_field, viz_fields) +! + integer(kind = kint), intent(in) :: num_field + type(ctl_params_viz_fields), intent(inout) :: viz_fields +! + viz_fields%num_color_fields = num_field + allocate(viz_fields%color_field_name(num_field)) + allocate(viz_fields%ifleld_color_field(num_field)) + allocate(viz_fields%icomp_color_field(num_field)) + allocate(viz_fields%istack_color_field(0:num_field)) + allocate(viz_fields%ncomp_color_field(num_field)) + allocate(viz_fields%ncomp_org_color_field(num_field)) + allocate(viz_fields%istack_org_ncomp(0:num_field)) +! + end subroutine alloc_ctl_params_viz_fields +! +! --------------------------------------------------------------------- +! + subroutine dealloc_ctl_params_viz_fields(viz_fields) +! + type(ctl_params_viz_fields), intent(inout) :: viz_fields +! + deallocate(viz_fields%color_field_name) + deallocate(viz_fields%ifleld_color_field) + deallocate(viz_fields%icomp_color_field) + deallocate(viz_fields%istack_color_field) + deallocate(viz_fields%ncomp_color_field) + deallocate(viz_fields%ncomp_org_color_field) + deallocate(viz_fields%istack_org_ncomp) +! + end subroutine dealloc_ctl_params_viz_fields +! +! --------------------------------------------------------------------- +! --------------------------------------------------------------------- +! + subroutine append_ctl_params_viz_fields & + & (field_name, iphys_field, icomp_flag, & + & num_comp, ncomp_org, viz_fields) +! + character(len = kchara), intent(in) :: field_name + integer(kind = kint), intent(in) :: iphys_field, icomp_flag + integer(kind = kint), intent(in) :: num_comp, ncomp_org +! + type(ctl_params_viz_fields), intent(inout) :: viz_fields + type(ctl_params_viz_fields) :: tmp_fields + integer(kind = kint) :: new_num_fields +! + call alloc_ctl_params_viz_fields(viz_fields%num_color_fields, & + & tmp_fields) + call copy_ctl_params_viz_fields(viz_fields%num_color_fields, & + & viz_fields, tmp_fields) + call dealloc_ctl_params_viz_fields(viz_fields) +! + new_num_fields = viz_fields%num_color_fields + 1 + call alloc_ctl_params_viz_fields(new_num_fields, viz_fields) +! + call copy_ctl_params_viz_fields(tmp_fields%num_color_fields, & + & tmp_fields, viz_fields) + call dealloc_ctl_params_viz_fields(tmp_fields) +! + viz_fields%ntot_color_comp & + & = viz_fields%ntot_color_comp + num_comp + viz_fields%color_field_name(new_num_fields) = field_name + viz_fields%ifleld_color_field(new_num_fields) = iphys_field + viz_fields%icomp_color_field(new_num_fields) = icomp_flag + viz_fields%istack_color_field(new_num_fields) & + & = viz_fields%istack_color_field(new_num_fields-1) + num_comp + viz_fields%ncomp_color_field(new_num_fields) = num_comp + + viz_fields%ntot_org_comp & + & = viz_fields%ntot_org_comp + ncomp_org + viz_fields%ncomp_org_color_field(new_num_fields) = ncomp_org + viz_fields%istack_org_ncomp(new_num_fields) & + & = viz_fields%istack_org_ncomp(new_num_fields-1) + ncomp_org +! + end subroutine append_ctl_params_viz_fields +! +! --------------------------------------------------------------------- +! + subroutine copy_ctl_params_viz_fields(num_field, viz_fields, & + & new_viz_fields) +! + integer(kind = kint), intent(in) :: num_field + type(ctl_params_viz_fields), intent(in) :: viz_fields + type(ctl_params_viz_fields), intent(inout) :: new_viz_fields +! + new_viz_fields%ntot_color_comp = viz_fields%ntot_color_comp + new_viz_fields%ntot_org_comp = viz_fields%ntot_org_comp + new_viz_fields%istack_color_field(0) & + & = viz_fields%istack_color_field(0) + new_viz_fields%istack_org_ncomp(0) & + & = viz_fields%istack_org_ncomp(0) +!$omp parallel workshare + new_viz_fields%color_field_name(1:num_field) & + & = viz_fields%color_field_name(1:num_field) + new_viz_fields%ifleld_color_field(1:num_field) & + & = viz_fields%ifleld_color_field(1:num_field) + new_viz_fields%icomp_color_field(1:num_field) & + & = viz_fields%icomp_color_field(1:num_field) + new_viz_fields%istack_color_field(1:num_field) & + & = viz_fields%istack_color_field(1:num_field) + new_viz_fields%ncomp_color_field(1:num_field) & + & = viz_fields%ncomp_color_field(1:num_field) + new_viz_fields%ncomp_org_color_field(1:num_field) & + & = viz_fields%ncomp_org_color_field(1:num_field) + new_viz_fields%istack_org_ncomp(1:num_field) & + & = viz_fields%istack_org_ncomp(1:num_field) +!$omp end parallel workshare +! + end subroutine copy_ctl_params_viz_fields +! +! --------------------------------------------------------------------- +! + subroutine set_ctl_params_viz_fields(field_output_ctl, nod_fld, & + & viz_fields) +! + use t_phys_data + use t_control_array_character2 + use set_components_flags + use set_field_comp_for_viz +! + type(phys_data), intent(in) :: nod_fld + type(ctl_array_c2), intent(in) :: field_output_ctl + type(ctl_params_viz_fields), intent(inout) :: viz_fields +! + integer(kind = kint) :: i +! +! + if(field_output_ctl%num .le. izero) then + call alloc_ctl_params_viz_fields(ione, viz_fields) + else + call alloc_ctl_params_viz_fields & + & (field_output_ctl%num, viz_fields) + end if +! + if(field_output_ctl%num .le. izero) then + viz_fields%color_field_name(1) = 'data' + viz_fields%ifleld_color_field = -1 + viz_fields%icomp_color_field = -1 + viz_fields%ncomp_color_field = 1 + viz_fields%ncomp_org_color_field = 0 + else + call set_components_4_viz & + & (nod_fld%num_phys, nod_fld%phys_name, field_output_ctl%num, & + & field_output_ctl%c1_tbl, field_output_ctl%c2_tbl, & + & viz_fields%num_color_fields, viz_fields%ifleld_color_field, & + & viz_fields%icomp_color_field, viz_fields%ncomp_color_field, & + & viz_fields%ncomp_org_color_field, & + & viz_fields%color_field_name) + end if + viz_fields%istack_color_field(0) = 0 + viz_fields%istack_org_ncomp(0) = 0 + do i = 1, viz_fields%num_color_fields + viz_fields%istack_color_field(i) & + & = viz_fields%istack_color_field(i-1) & + & + viz_fields%ncomp_color_field(i) + viz_fields%istack_org_ncomp(i) & + & = viz_fields%istack_org_ncomp(i-1) & + & + viz_fields%ncomp_org_color_field(i) + end do + viz_fields%ntot_color_comp & + & = viz_fields%istack_color_field(viz_fields%num_color_fields) + viz_fields%ntot_org_comp & + & = viz_fields%istack_org_ncomp(viz_fields%num_color_fields) +! + end subroutine set_ctl_params_viz_fields +! +! --------------------------------------------------------------------- +! + end module t_ctl_params_viz_fields diff --git a/src/Fortran_libraries/VIZ_src/surfacing/t_elapsed_labels_4_SECTIONS.f90 b/src/Fortran_libraries/VIZ_src/surfacing/t_elapsed_labels_4_SECTIONS.f90 new file mode 100644 index 00000000..b42a2611 --- /dev/null +++ b/src/Fortran_libraries/VIZ_src/surfacing/t_elapsed_labels_4_SECTIONS.f90 @@ -0,0 +1,137 @@ +!>@file t_elapsed_labels_4_SECTIONS.f90 +!!@brief module t_elapsed_labels_4_SECTIONS +!! +!!@author H. Matsui +!!@date Programmed in April, 2013 +! +!>@brief Initialize elepsed time monitoring +!! +!!@verbatim +!! subroutine elpsed_label_4_SECT(flag_detailed, elps_SECT, elps) +!! subroutine reset_elapse_after_init_SECT(elps_SECT, elps) +!! logical intent(in) :: flag_detailed +!! type(elapsed_labels_4_SECTIONS), intent(inout) :: elps_SECT +!! type(elapsed_time_data), intent(inout) :: elps +!!@endverbatim +! + module t_elapsed_labels_4_SECTIONS +! + use m_precision + use m_work_time +! + implicit none +! + type elapsed_labels_4_SECTIONS + logical :: flag_elapsed_S = .FALSE. + integer(kind = kint) :: ist_elapsed_S = 0 + integer(kind = kint) :: ied_elapsed_S = 0 +! + type(elapsed_lables) :: elps_PSF + type(elapsed_lables) :: elps_ISO +! + type(elapsed_lables) :: elps_PVR + type(elapsed_lables) :: elps_LIC + type(elapsed_lables) :: elps_MAP +! + type(elapsed_lables) :: elps_FLINE + type(elapsed_lables) :: elps_TRACER + end type elapsed_labels_4_SECTIONS +! + private :: elpsed_label_4_SECTIONS + private :: reset_section_elapse_after_init +! +! ---------------------------------------------------------------------- +! + contains +! +! ---------------------------------------------------------------------- +! + subroutine elpsed_label_4_SECT(flag_detailed, elps_SECT, elps) +! + use elapsed_labels_4_PSF +! + logical, intent(in) :: flag_detailed + type(elapsed_labels_4_SECTIONS), intent(inout) :: elps_SECT + type(elapsed_time_data), intent(inout) :: elps +! +! + call elpsed_label_4_SECTIONS(elps_SECT, elps) +! + if(flag_detailed) then + call elpsed_label_4_PSF(elps_SECT%elps_PSF, elps) + call elpsed_label_4_ISO(elps_SECT%elps_ISO, elps) + else + elps_SECT%elps_PSF%flag_elapsed = .FALSE. + elps_SECT%elps_ISO%flag_elapsed = .FALSE. + end if +! + end subroutine elpsed_label_4_SECT +! +! ---------------------------------------------------------------------- +! + subroutine reset_elapse_after_init_SECT(elps_SECT, elps) +! + use elapsed_labels_4_PSF +! + type(elapsed_labels_4_SECTIONS), intent(in) :: elps_SECT + type(elapsed_time_data), intent(inout) :: elps +! +! + call reset_section_elapse_after_init(elps_SECT, elps) + call reset_elapse_after_init_PSF(elps_SECT%elps_PSF, elps) + call reset_elapse_after_init_ISO(elps_SECT%elps_ISO, elps) +! + end subroutine reset_elapse_after_init_SECT +! +! ---------------------------------------------------------------------- +! ---------------------------------------------------------------------- +! + subroutine elpsed_label_4_SECTIONS(elps_SECT, elps) +! + type(elapsed_labels_4_SECTIONS), intent(inout) :: elps_SECT + type(elapsed_time_data), intent(inout) :: elps + integer(kind = kint), parameter :: num_append = 6 +! +! + call append_elapsed_timer(num_append, elps_SECT%ist_elapsed_S, & + & elps_SECT%ied_elapsed_S, elps) +! + elps%labels(elps_SECT%ist_elapsed_S+ 1) & + & = 'Sectioning initialization. ' + elps%labels(elps_SECT%ist_elapsed_S+ 2) = 'Sectioning. ' +! + elps%labels(elps_SECT%ist_elapsed_S+ 3) & + & = 'Isosurfaceing initialization. ' + elps%labels(elps_SECT%ist_elapsed_S+ 4) = 'Isosurfaceing. ' +! + elps%labels(elps_SECT%ist_elapsed_S+5) & + & = 'VTK output in viz module' + elps%labels(elps_SECT%ist_elapsed_S+6) & + & = 'edge comm. table for vizualization ' +! + elps_SECT%flag_elapsed_S = .TRUE. +! + end subroutine elpsed_label_4_SECTIONS +! +!----------------------------------------------------------------------- +!----------------------------------------------------------------------- +! + subroutine reset_section_elapse_after_init(elps_SECT, elps) +! + type(elapsed_labels_4_SECTIONS), intent(in) :: elps_SECT + type(elapsed_time_data), intent(inout) :: elps +! + integer(kind = kint) :: i, i_viz +! + if(elps_SECT%flag_elapsed_S .eqv. .FALSE.) return + + do i = 1, 7 + i_viz = 2*i + elps_SECT%ist_elapsed_S + call reset_elapsed_timer(i_viz, i_viz, elps) + end do +! + end subroutine reset_section_elapse_after_init +! +!----------------------------------------------------------------------- +! + end module t_elapsed_labels_4_SECTIONS diff --git a/src/Fortran_libraries/VIZ_src/surfacing/t_isosurface.f90 b/src/Fortran_libraries/VIZ_src/surfacing/t_isosurface.f90 index 3c775f81..1361645f 100644 --- a/src/Fortran_libraries/VIZ_src/surfacing/t_isosurface.f90 +++ b/src/Fortran_libraries/VIZ_src/surfacing/t_isosurface.f90 @@ -10,12 +10,14 @@ !!@verbatim !! subroutine ISOSURF_initialize(increment_iso, geofem, & !! & nod_fld, iso_ctls, iso) +!! type(elapsed_lables), intent(in) :: elps_ISO !! type(mesh_data), intent(in) :: geofem !! type(isosurf_controls), intent(inout) :: iso_ctls !! type(isosurface_module), intent(inout) :: iso !! type(phys_data), intent(in) :: nod_fld -!! subroutine ISOSURF_visualize(istep_iso, time_d, & +!! subroutine ISOSURF_visualize(istep_iso, elps_ISO, time_d, & !! & geofem, edge_comm, nod_fld, iso, SR_sig, SR_il) +!! type(elapsed_lables), intent(in) :: elps_ISO !! type(time_data), intent(in) :: time_d !! type(mesh_data), intent(in) :: geofem !! type(communication_table), intent(in) :: edge_comm @@ -31,6 +33,7 @@ module t_isosurface ! use m_precision + use m_work_time use t_mesh_data use t_comm_table use t_phys_data @@ -137,11 +140,9 @@ end subroutine ISOSURF_initialize ! --------------------------------------------------------------------- ! --------------------------------------------------------------------- ! - subroutine ISOSURF_visualize(istep_iso, time_d, & + subroutine ISOSURF_visualize(istep_iso, elps_ISO, time_d, & & geofem, edge_comm, nod_fld, iso, SR_sig, SR_il) ! - use m_work_time - use m_elapsed_labels_4_VIZ use m_geometry_constants use t_time_data use t_ucd_data @@ -153,6 +154,7 @@ subroutine ISOSURF_visualize(istep_iso, time_d, & ! integer(kind = kint), intent(in) :: istep_iso ! + type(elapsed_lables), intent(in) :: elps_ISO type(time_data), intent(in) :: time_d type(mesh_data), intent(in) :: geofem type(communication_table), intent(in) :: edge_comm @@ -165,7 +167,8 @@ subroutine ISOSURF_visualize(istep_iso, time_d, & ! if (iso%num_iso.le.0 .or. istep_iso.le.0) return ! - if(iflag_ISO_time) call start_elapsed_time(ist_elapsed_ISO+1) + if(elps_ISO%flag_elapsed) & + & call start_elapsed_time(elps_ISO%ist_elapsed+1) if (iflag_debug.eq.1) write(*,*) 'set_const_4_isosurfaces' call set_const_4_isosurfaces(iso%num_iso, geofem%mesh%node, & & nod_fld, iso%iso_def, iso%iso_list) @@ -174,16 +177,20 @@ subroutine ISOSURF_visualize(istep_iso, time_d, & call set_node_and_patch_iso & & (iso%num_iso, geofem%mesh, edge_comm, iso%iso_case_tbls, & & iso%iso_search, iso%iso_list, iso%iso_mesh, SR_sig, SR_il) - if(iflag_ISO_time) call end_elapsed_time(ist_elapsed_ISO+1) + if(elps_ISO%flag_elapsed) & + & call end_elapsed_time(elps_ISO%ist_elapsed+1) ! if (iflag_debug.eq.1) write(*,*) 'set_field_4_iso' - if(iflag_ISO_time) call start_elapsed_time(ist_elapsed_ISO+2) + if(elps_ISO%flag_elapsed) & + & call start_elapsed_time(elps_ISO%ist_elapsed+2) call alloc_psf_field_data(iso%num_iso, iso%iso_mesh) call set_field_4_iso(iso%num_iso, geofem%mesh%edge, nod_fld, & & iso%iso_param, iso%iso_def, iso%iso_list, iso%iso_mesh) - if(iflag_ISO_time) call end_elapsed_time(ist_elapsed_ISO+2) + if(elps_ISO%flag_elapsed) & + & call end_elapsed_time(elps_ISO%ist_elapsed+2) ! - if(iflag_ISO_time) call start_elapsed_time(ist_elapsed_ISO+3) + if(elps_ISO%flag_elapsed) & + & call start_elapsed_time(elps_ISO%ist_elapsed+3) call output_isosurface & & (iso%num_iso, iso%iso_file_IO, istep_iso, time_d, & & iso%iso_mesh, iso%iso_time_IO, iso%iso_out) @@ -191,7 +198,8 @@ subroutine ISOSURF_visualize(istep_iso, time_d, & call dealloc_psf_field_data(iso%num_iso, iso%iso_mesh) call dealloc_psf_node_and_patch & & (iso%num_iso, iso%iso_list, iso%iso_mesh) - if(iflag_ISO_time) call end_elapsed_time(ist_elapsed_ISO+3) + if(elps_ISO%flag_elapsed) & + & call end_elapsed_time(elps_ISO%ist_elapsed+3) ! end subroutine ISOSURF_visualize ! diff --git a/src/Fortran_libraries/VIZ_src/surfacing/t_viz_sections.f90 b/src/Fortran_libraries/VIZ_src/surfacing/t_viz_sections.f90 index d7a44264..ddd2ca44 100644 --- a/src/Fortran_libraries/VIZ_src/surfacing/t_viz_sections.f90 +++ b/src/Fortran_libraries/VIZ_src/surfacing/t_viz_sections.f90 @@ -7,10 +7,12 @@ !>@brief Top routine for sectiong !! !!@verbatim -!! subroutine init_visualize_surface(viz_step, geofem, edge_comm, & +!! subroutine init_visualize_surface & +!! & (elps_SECT, viz_step, geofem, edge_comm, & !! & nod_fld, surfacing_ctls, viz_psfs, m_SR) -!! subroutine visualize_surface(viz_step, time_d, & +!! subroutine visualize_surface(elps_SECT, viz_step, time_d, & !! & geofem, edge_comm, nod_fld, viz_psfs, m_SR) +!! type(elapsed_labels_4_SECTIONS), intent(in) :: elps_SECT !! type(VIZ_step_params), intent(in) :: viz_step !! type(time_data), intent(in) :: time_d !! type(mesh_data), intent(in) :: geofem @@ -27,7 +29,6 @@ module t_viz_sections ! use m_machine_parameter use m_work_time - use m_elapsed_labels_4_VIZ use calypso_mpi ! use t_VIZ_step_parameter @@ -39,6 +40,7 @@ module t_viz_sections use t_cross_section use t_isosurface use t_mesh_SR + use t_elapsed_labels_4_SECTIONS ! implicit none ! @@ -56,11 +58,13 @@ module t_viz_sections ! ! --------------------------------------------------------------------- ! - subroutine init_visualize_surface(viz_step, geofem, edge_comm, & + subroutine init_visualize_surface & + & (elps_SECT, viz_step, geofem, edge_comm, & & nod_fld, surfacing_ctls, viz_psfs, m_SR) ! use t_control_data_surfacings ! + type(elapsed_labels_4_SECTIONS), intent(in) :: elps_SECT type(VIZ_step_params), intent(in) :: viz_step type(mesh_data), intent(in) :: geofem type(communication_table), intent(in) :: edge_comm @@ -71,17 +75,22 @@ subroutine init_visualize_surface(viz_step, geofem, edge_comm, & type(mesh_SR), intent(inout) :: m_SR ! ! - if(iflag_VIZ_time) call start_elapsed_time(ist_elapsed_VIZ+1) - call SECTIONING_initialize(viz_step%PSF_t%increment, & + if(elps_SECT%flag_elapsed_S) & + & call start_elapsed_time(elps_SECT%ist_elapsed_S+1) + call SECTIONING_initialize & + & (viz_step%PSF_t%increment, elps_SECT%elps_PSF, & & geofem, edge_comm, nod_fld, surfacing_ctls%psf_s_ctls, & & viz_psfs%psf, m_SR%SR_sig, m_SR%SR_il) - if(iflag_VIZ_time) call end_elapsed_time(ist_elapsed_VIZ+1) + if(elps_SECT%flag_elapsed_S) & + & call end_elapsed_time(elps_SECT%ist_elapsed_S+1) ! - if(iflag_VIZ_time) call start_elapsed_time(ist_elapsed_VIZ+3) + if(elps_SECT%flag_elapsed_S) & + & call start_elapsed_time(elps_SECT%ist_elapsed_S+3) call ISOSURF_initialize & & (viz_step%ISO_t%increment, geofem, nod_fld, & & surfacing_ctls%iso_s_ctls, viz_psfs%iso) - if(iflag_VIZ_time) call end_elapsed_time(ist_elapsed_VIZ+3) + if(elps_SECT%flag_elapsed_S) & + & call end_elapsed_time(elps_SECT%ist_elapsed_S+3) ! call dealloc_surfacing_controls(surfacing_ctls) ! @@ -89,9 +98,10 @@ end subroutine init_visualize_surface ! ! --------------------------------------------------------------------- ! - subroutine visualize_surface(viz_step, time_d, & + subroutine visualize_surface(elps_SECT, viz_step, time_d, & & geofem, edge_comm, nod_fld, viz_psfs, m_SR) ! + type(elapsed_labels_4_SECTIONS), intent(in) :: elps_SECT type(VIZ_step_params), intent(in) :: viz_step type(time_data), intent(in) :: time_d type(mesh_data), intent(in) :: geofem @@ -102,16 +112,20 @@ subroutine visualize_surface(viz_step, time_d, & type(mesh_SR), intent(inout) :: m_SR ! ! - if(iflag_VIZ_time) call start_elapsed_time(ist_elapsed_VIZ+2) - call SECTIONING_visualize & - & (viz_step%istep_psf, time_d, geofem, nod_fld, viz_psfs%psf) - if(iflag_VIZ_time) call end_elapsed_time(ist_elapsed_VIZ+2) + if(elps_SECT%flag_elapsed_S) & + & call start_elapsed_time(elps_SECT%ist_elapsed_S+2) + call SECTIONING_visualize(viz_step%istep_psf, elps_SECT%elps_PSF, & + & time_d, geofem, nod_fld, viz_psfs%psf) + if(elps_SECT%flag_elapsed_S) & + & call end_elapsed_time(elps_SECT%ist_elapsed_S+2) ! - if(iflag_VIZ_time) call start_elapsed_time(ist_elapsed_VIZ+4) - call ISOSURF_visualize(viz_step%istep_iso, time_d, & - & geofem, edge_comm, nod_fld, viz_psfs%iso, & + if(elps_SECT%flag_elapsed_S) & + & call start_elapsed_time(elps_SECT%ist_elapsed_S+4) + call ISOSURF_visualize(viz_step%istep_iso, elps_SECT%elps_ISO, & + & time_d, geofem, edge_comm, nod_fld, viz_psfs%iso, & & m_SR%SR_sig, m_SR%SR_il) - if(iflag_VIZ_time) call end_elapsed_time(ist_elapsed_VIZ+4) + if(elps_SECT%flag_elapsed_S) & + & call end_elapsed_time(elps_SECT%ist_elapsed_S+4) ! end subroutine visualize_surface ! diff --git a/src/programs/SPH_MHD/Makefile.depends b/src/programs/SPH_MHD/Makefile.depends index fa7f3dd0..91cb8d56 100644 --- a/src/programs/SPH_MHD/Makefile.depends +++ b/src/programs/SPH_MHD/Makefile.depends @@ -1,6 +1,6 @@ SPH_analyzer_MHD.o: $(SPH_MHD_MAINDIR)/SPH_analyzer_MHD.f90 m_precision.o m_constants.o m_work_time.o m_elapsed_labels_4_MHD.o t_phys_address.o t_control_parameter.o t_MHD_step_parameter.o t_MHD_file_parameter.o t_SPH_mesh_field_data.o t_FEM_mesh_field_data.o t_boundary_data_sph_MHD.o t_work_SPH_MHD.o t_field_data_IO.o t_mesh_SR.o calypso_mpi.o m_machine_parameter.o t_sph_boundary_input_data.o set_control_sph_mhd.o set_initial_sph_dynamo.o adjust_reference_fields.o set_bc_sph_mhd.o material_property.o init_radial_infos_sph_mhd.o const_radial_mat_4_sph.o cal_sol_sph_MHD_crank.o cal_nonlinear.o init_sphrical_transform_MHD.o check_dependency_for_MHD.o input_control_sph_MHD.o cal_write_sph_monitor_data.o t_field_4_dynamobench.o calypso_mpi_real.o cal_momentum_eq_explicit.o lead_fields_4_sph_mhd.o sph_mhd_rst_IO_control.o output_viz_file_control.o $(F90) -c $(F90OPTFLAGS) $< -analyzer_sph_MHD_w_psf.o: $(SPH_MHD_MAINDIR)/analyzer_sph_MHD_w_psf.f90 m_precision.o calypso_mpi.o m_machine_parameter.o m_work_time.o m_elapsed_labels_4_MHD.o m_elapsed_labels_SEND_RECV.o t_spherical_MHD.o t_sph_MHD_w_psf.o t_time_data.o t_ctl_data_MHD.o t_ctl_data_sph_MHD_w_psf.o t_SPH_mesh_field_data.o t_SPH_MHD_zmean_sections.o t_viz_sections.o input_control_sph_MHD.o set_control_sph_mhd.o set_control_4_SPH_to_FEM.o SPH_analyzer_MHD.o FEM_analyzer_sph_MHD.o FEM_to_PSF_bridge.o parallel_FEM_mesh_init.o init_sph_MHD_elapsed_label.o output_viz_file_control.o +analyzer_sph_MHD_w_psf.o: $(SPH_MHD_MAINDIR)/analyzer_sph_MHD_w_psf.f90 m_precision.o calypso_mpi.o m_machine_parameter.o m_work_time.o m_elapsed_labels_4_MHD.o m_elapsed_labels_SEND_RECV.o t_spherical_MHD.o t_sph_MHD_w_psf.o t_elapsed_labels_4_SECTIONS.o t_time_data.o t_ctl_data_MHD.o t_ctl_data_sph_MHD_w_psf.o t_SPH_mesh_field_data.o t_SPH_MHD_zmean_sections.o t_viz_sections.o input_control_sph_MHD.o set_control_sph_mhd.o set_control_4_SPH_to_FEM.o SPH_analyzer_MHD.o FEM_analyzer_sph_MHD.o FEM_to_PSF_bridge.o parallel_FEM_mesh_init.o init_sph_MHD_elapsed_label.o output_viz_file_control.o $(F90) -c $(F90OPTFLAGS) $< main_sph_MHD_w_psf.o: $(SPH_MHD_MAINDIR)/main_sph_MHD_w_psf.f90 m_precision.o calypso_mpi.o analyzer_sph_MHD_w_psf.o $(F90) -c $(F90OPTFLAGS) $< diff --git a/src/programs/SPH_MHD/SPH_analyzer_MHD.f90 b/src/programs/SPH_MHD/SPH_analyzer_MHD.f90 index 85fded46..15d4808f 100644 --- a/src/programs/SPH_MHD/SPH_analyzer_MHD.f90 +++ b/src/programs/SPH_MHD/SPH_analyzer_MHD.f90 @@ -99,8 +99,10 @@ subroutine SPH_initialize_MHD(MHD_files, SPH_model, FEM_dat, & ! if (iflag_debug.gt.0) write(*,*) 'init_r_infos_sph_mhd_evo' call init_r_infos_sph_mhd_evo(SPH_model%bc_IO, SPH_MHD%groups, & - & SPH_model%MHD_BC, SPH_MHD%ipol, SPH_MHD%sph, SPH_WK%r_2nd, & - & SPH_model%omega_sph, SPH_model%MHD_prop, SPH_model%sph_MHD_bc) + & SPH_model%MHD_BC, SPH_MHD%ipol, SPH_MHD%sph, SPH_WK%r_2nd, & + & SPH_WK%r_n2e_3rd, SPH_WK%r_e2n_1st, & + & SPH_model%omega_sph, SPH_model%MHD_prop, & + & SPH_model%radial_variation, SPH_model%sph_MHD_bc) ! ! --------------------------------- ! diff --git a/src/programs/SPH_MHD/analyzer_sph_MHD_w_psf.f90 b/src/programs/SPH_MHD/analyzer_sph_MHD_w_psf.f90 index 5661c733..ac7f2f55 100644 --- a/src/programs/SPH_MHD/analyzer_sph_MHD_w_psf.f90 +++ b/src/programs/SPH_MHD/analyzer_sph_MHD_w_psf.f90 @@ -24,6 +24,7 @@ module analyzer_sph_MHD_w_psf use m_elapsed_labels_SEND_RECV use t_spherical_MHD use t_sph_MHD_w_psf + use t_elapsed_labels_4_SECTIONS ! implicit none ! @@ -32,6 +33,10 @@ module analyzer_sph_MHD_w_psf !> Structure for visualization in spherical MHD type(sph_MHD_w_psf), save, private :: MPSFs ! +!> Elapsed time labels + logical, parameter :: flag_detailed1 = .TRUE. + type(elapsed_labels_4_SECTIONS), save :: elps_SECT1 +! ! ---------------------------------------------------------------------- ! contains @@ -67,6 +72,7 @@ subroutine initialize_sph_mhd_w_psf(control_file_name) MHDMs%MHD_step%finish_d%started_time = MPI_WTIME() call init_elapse_time_by_TOTAL call set_sph_MHD_elapsed_label + call elpsed_label_4_SECT(flag_detailed1, elps_SECT1, elps1) call elpsed_label_field_send_recv ! ! Load parameter file @@ -85,7 +91,7 @@ subroutine initialize_sph_mhd_w_psf(control_file_name) if(iflag_debug .gt. 0) write(*,*) 'FEM_initialize_sph_MHD' call FEM_initialize_sph_MHD(MHDMs%MHD_files, MHDMs%MHD_step, & & MPSFs%FEM_DAT, MHDMs%MHD_IO, MHDMs%m_SR) - call init_FEM_to_PSF_bridge(MHDMs%MHD_step%viz_step, & + call init_FEM_to_PSF_bridge(elps_SECT1, MHDMs%MHD_step%viz_step, & & MPSFs%FEM_DAT%geofem, MPSFs%edge_comm, MHDMs%m_SR) ! ! Initialize spherical transform dynamo @@ -99,11 +105,12 @@ subroutine initialize_sph_mhd_w_psf(control_file_name) ! Initialize visualization ! if(iflag_debug .gt. 0) write(*,*) 'init_visualize_surface' - call init_visualize_surface(MHDMs%MHD_step%viz_step, & + call init_visualize_surface(elps_SECT1, MHDMs%MHD_step%viz_step, & & MPSFs%FEM_DAT%geofem, MPSFs%edge_comm, MPSFs%FEM_DAT%field, & & add_SMHD_ctl1%surfacing_ctls, MPSFs%PSFs, MHDMs%m_SR) ! - call init_zonal_mean_sections(MHDMs%MHD_step%viz_step, & + call init_zonal_mean_sections & + & (elps_SECT1, MHDMs%MHD_step%viz_step, & & MPSFs%FEM_DAT%geofem, MPSFs%edge_comm, MPSFs%FEM_DAT%field, & & add_SMHD_ctl1%zm_sects, MPSFs%zsectios, MHDMs%m_SR) ! @@ -130,15 +137,10 @@ subroutine evolution_sph_mhd_w_psf ! --------------------- ! if(iflag_MHD_time) call start_elapsed_time(ist_elapsed_MHD+2) -! -!* ----------- set initial step data -------------- -!* - call copy_time_step_data(MHDMs%MHD_step%init_d, & - & MHDMs%MHD_step%time_d) - iflag_finish = 0 !* !* ------- time evelution loop start ----------- !* + iflag_finish = 0 do call evolve_time_data(MHDMs%MHD_step%time_d) ! @@ -180,16 +182,16 @@ subroutine evolution_sph_mhd_w_psf if(iflag_MHD_time) call start_elapsed_time(ist_elapsed_MHD+4) call istep_viz_w_fix_dt(MHDMs%MHD_step%time_d%i_time_step, & & MHDMs%MHD_step%viz_step) - call visualize_surface & - & (MHDMs%MHD_step%viz_step, MHDMs%MHD_step%time_d, & + call visualize_surface(elps_SECT1, & + & MHDMs%MHD_step%viz_step, MHDMs%MHD_step%time_d, & & MPSFs%FEM_DAT%geofem, MPSFs%edge_comm, & & MPSFs%FEM_DAT%field, MPSFs%PSFs, MHDMs%m_SR) !* !* ----------- Zonal means -------------- !* if(MHDMs%MHD_step%viz_step%istep_psf .ge. 0) then - call SPH_MHD_zmean_sections & - & (MHDMs%MHD_step%viz_step, MHDMs%MHD_step%time_d, & + call SPH_MHD_zmean_sections(elps_SECT1, & + & MHDMs%MHD_step%viz_step, MHDMs%MHD_step%time_d, & & MHDMs%SPH_MHD%sph, MPSFs%FEM_DAT%geofem, & & MHDMs%SPH_WK%trns_WK, MPSFs%FEM_DAT%field, & & MPSFs%zsectios, MHDMs%m_SR) diff --git a/src/programs/SPH_MHD/control_MHD b/src/programs/SPH_MHD/control_MHD index aa06ed48..a0a5b193 100644 --- a/src/programs/SPH_MHD/control_MHD +++ b/src/programs/SPH_MHD/control_MHD @@ -510,6 +510,53 @@ begin MHD_control SGS_terms_ctl gravity end end array SGS_terms_ctl end SGS_control +! + begin polytrope_ctl + density_variation_ctl ON + density_file_name 'density_variation' +! + bottom_density_ctl 0.53846 2.0 + top_density_ctl 1.53846 1.0 + polytrope_index_ctl 1.0 +! + array density_list_ctl + density_list_ctl 0.53846 1.2 + density_list_ctl 1.03846 1.05 + density_list_ctl 1.53846 1.0 + end array density_list_ctl + end polytrope_ctl +! + begin viscosity_ctl + radial_variation_ctl ON + variation_file_name 'viscous_variation' +! + array diffusivity_list_ctl + diffusivity_list_ctl 0.53846 1.2 + diffusivity_list_ctl 1.03846 1.05 + diffusivity_list_ctl 1.53846 1.0 + end array diffusivity_list_ctl + end viscosity_ctl +! + begin magnetic_diffusion_ctl + radial_variation_ctl ON + variation_file_name 'viscous_variation' +! + array diffusivity_list_ctl + diffusivity_list_ctl 0.53846 1.2 + diffusivity_list_ctl 1.03846 1.05 + diffusivity_list_ctl 1.53846 1.0 + end array diffusivity_list_ctl + end magnetic_diffusion_ctl +! + begin thermal_diffusion_ctl + radial_variation_ctl ON + variation_file_name 'viscous_variation' + end thermal_diffusion_ctl +! + begin composition_diffusion_ctl + radial_variation_ctl ON + variation_file_name 'viscous_variation' + end composition_diffusion_ctl end model ! ! diff --git a/src/programs/data_utilities/INITIAL_FIELD/SPH_analyzer_add_initial.f90 b/src/programs/data_utilities/INITIAL_FIELD/SPH_analyzer_add_initial.f90 index 4016292f..c892aee6 100644 --- a/src/programs/data_utilities/INITIAL_FIELD/SPH_analyzer_add_initial.f90 +++ b/src/programs/data_utilities/INITIAL_FIELD/SPH_analyzer_add_initial.f90 @@ -126,8 +126,10 @@ subroutine SPH_add_initial_field(MHD_files, MHD_step, SPH_model, & ! if (iflag_debug.gt.0) write(*,*) 'init_r_infos_sph_mhd_evo' call init_r_infos_sph_mhd_evo(SPH_model%bc_IO, SPH_MHD%groups, & - & SPH_model%MHD_BC, SPH_MHD%ipol, SPH_MHD%sph, SPH_WK%r_2nd, & - & SPH_model%omega_sph, SPH_model%MHD_prop, SPH_model%sph_MHD_bc) + & SPH_model%MHD_BC, SPH_MHD%ipol, SPH_MHD%sph, SPH_WK%r_2nd, & + & SPH_WK%r_n2e_3rd, SPH_WK%r_e2n_1st, & + & SPH_model%omega_sph, SPH_model%MHD_prop, & + & SPH_model%radial_variation, SPH_model%sph_MHD_bc) ! call alloc_schmidt_normalize(SPH_MHD%sph%sph_rlm%nidx_rlm(2), & & SPH_MHD%sph%sph_rj%nidx_rj(2), SPH_WK%trans_p%leg) @@ -140,7 +142,8 @@ subroutine SPH_add_initial_field(MHD_files, MHD_step, SPH_model, & ! if(iflag_debug.gt.0) write(*,*)' read_alloc_sph_restart_data' call read_alloc_sph_restart_data(MHD_files%fst_file_IO, & - & MHD_step%init_d, SPH_MHD%fld, MHD_step%rst_step) + & MHD_step%init_d, MHD_step%time_d, SPH_MHD%fld, & + & MHD_step%rst_step) ! ! --------------------------------- ! diff --git a/src/programs/data_utilities/INITIAL_FIELD/SPH_analyzer_const_initial.f90 b/src/programs/data_utilities/INITIAL_FIELD/SPH_analyzer_const_initial.f90 index d8365c1e..e9634a9a 100644 --- a/src/programs/data_utilities/INITIAL_FIELD/SPH_analyzer_const_initial.f90 +++ b/src/programs/data_utilities/INITIAL_FIELD/SPH_analyzer_const_initial.f90 @@ -122,8 +122,10 @@ subroutine SPH_const_initial_field(MHD_files, MHD_step, & ! if (iflag_debug.gt.0) write(*,*) 'init_r_infos_sph_mhd_evo' call init_r_infos_sph_mhd_evo(SPH_model%bc_IO, SPH_MHD%groups, & - & SPH_model%MHD_BC, SPH_MHD%ipol, SPH_MHD%sph, SPH_WK%r_2nd, & - & SPH_model%omega_sph, SPH_model%MHD_prop, SPH_model%sph_MHD_bc) + & SPH_model%MHD_BC, SPH_MHD%ipol, SPH_MHD%sph, SPH_WK%r_2nd, & + & SPH_WK%r_n2e_3rd, SPH_WK%r_e2n_1st, & + & SPH_model%omega_sph, SPH_model%MHD_prop, & + & SPH_model%radial_variation, SPH_model%sph_MHD_bc) ! call alloc_schmidt_normalize(SPH_MHD%sph%sph_rlm%nidx_rlm(2), & & SPH_MHD%sph%sph_rj%nidx_rj(2), SPH_WK%trans_p%leg) diff --git a/src/programs/data_utilities/INITIAL_FIELD/const_sph_initial_spectr.f90 b/src/programs/data_utilities/INITIAL_FIELD/const_sph_initial_spectr.f90 index a0fc8010..4906df46 100644 --- a/src/programs/data_utilities/INITIAL_FIELD/const_sph_initial_spectr.f90 +++ b/src/programs/data_utilities/INITIAL_FIELD/const_sph_initial_spectr.f90 @@ -728,12 +728,18 @@ subroutine set_initial_heat_source_sph & type(phys_address), intent(in) :: ipol type(phys_data), intent(inout) :: rj_fld ! - real (kind = kreal) :: rr, q + real (kind = kreal) :: rr, q, r_inside integer(kind = kint) :: inod, i_center integer :: jj, k ! ! if(ipol%base%i_heat_source .eq. izero) return +! + if(i_center .gt. 0) then + r_inside = zero + else + r_inside = sph_bc_T%r_ICB(0) + end if ! !$omp parallel do do inod = 1, nnod_rj(sph) @@ -745,21 +751,22 @@ subroutine set_initial_heat_source_sph & ! Find address for l = m = 0 jj = find_local_sph_mode_address(sph, 0, 0) ! - if (jj .gt. 0) then - q = (three / (sph_bc_T%r_CMB(0)**3 - sph_bc_T%r_ICB(0)**3)) & - & * (-bcs_T%CMB_Sspec%S_BC(jj) * sph_bc_T%r_CMB(0)**2 & - & - bcs_T%ICB_Sspec%S_BC(jj) * sph_bc_T%r_ICB(0)**2) + if (jj .le. 0) return + q = (three / (sph_bc_T%r_CMB(0)**3 - r_inside**3)) & + & * (-bcs_T%CMB_Sspec%S_BC(jj) * sph_bc_T%r_CMB(0)**2 & + & - bcs_T%ICB_Sspec%S_BC(jj) * r_inside**2) ! - do k = sph_bc_T%kr_in, sph_bc_T%kr_out - inod = local_sph_data_address(sph, k, jj) - rr = radius_1d_rj_r(sph, k) + do k = sph_bc_T%kr_in, sph_bc_T%kr_out + inod = local_sph_data_address(sph, k, jj) + rr = radius_1d_rj_r(sph, k) ! Substitute initial heat source - rj_fld%d_fld(inod,ipol%base%i_heat_source) = q - end do - end if + rj_fld%d_fld(inod,ipol%base%i_heat_source) = q + end do +! ! Center i_center = inod_rj_center(sph) if(i_center .gt. 0) then + jj = find_local_sph_mode_address(sph, 0, 0) rj_fld%d_fld(i_center,ipol%base%i_heat_source) = q end if ! diff --git a/src/programs/data_utilities/SNAPSHOT_MHD/Makefile.depends b/src/programs/data_utilities/SNAPSHOT_MHD/Makefile.depends index 0bcce25d..4bc95c98 100644 --- a/src/programs/data_utilities/SNAPSHOT_MHD/Makefile.depends +++ b/src/programs/data_utilities/SNAPSHOT_MHD/Makefile.depends @@ -1,6 +1,6 @@ SPH_analyzer_snap_w_vizs.o: $(SPH_SNAP_MAINDIR)/SPH_analyzer_snap_w_vizs.f90 m_precision.o m_work_time.o m_elapsed_labels_4_MHD.o t_SPH_MHD_model_data.o t_control_parameter.o t_phys_address.o t_MHD_file_parameter.o t_SPH_mesh_field_data.o t_FEM_mesh_field_data.o t_boundary_data_sph_MHD.o t_work_SPH_MHD.o t_sph_mhd_monitor_data_IO.o t_mesh_SR.o m_constants.o calypso_mpi.o m_machine_parameter.o t_sph_boundary_input_data.o set_control_sph_mhd.o adjust_reference_fields.o set_bc_sph_mhd.o material_property.o init_sphrical_transform_MHD.o init_radial_infos_sph_mhd.o const_radial_mat_4_sph.o r_interpolate_sph_data.o sph_mhd_rst_IO_control.o check_dependency_for_MHD.o input_control_sph_MHD.o cal_write_sph_monitor_data.o cal_nonlinear.o cal_sol_sph_MHD_crank.o lead_fields_4_sph_mhd.o output_viz_file_control.o sph_radial_grad_4_magne.o $(F90) -c $(F90OPTFLAGS) $< -analyzer_sph_snap_w_psf.o: $(SPH_SNAP_MAINDIR)/analyzer_sph_snap_w_psf.f90 m_precision.o calypso_mpi.o m_work_time.o m_elapsed_labels_4_MHD.o m_elapsed_labels_SEND_RECV.o m_machine_parameter.o t_spherical_MHD.o t_sph_MHD_w_psf.o t_ctl_data_MHD.o t_ctl_data_sph_MHD_w_psf.o t_viz_sections.o t_SPH_MHD_zmean_sections.o init_sph_MHD_elapsed_label.o input_control_sph_MHD.o SPH_analyzer_snap_w_vizs.o FEM_analyzer_sph_MHD.o FEM_to_PSF_bridge.o output_viz_file_control.o set_time_step_params.o +analyzer_sph_snap_w_psf.o: $(SPH_SNAP_MAINDIR)/analyzer_sph_snap_w_psf.f90 m_precision.o calypso_mpi.o m_work_time.o m_elapsed_labels_4_MHD.o m_elapsed_labels_SEND_RECV.o m_machine_parameter.o t_spherical_MHD.o t_sph_MHD_w_psf.o t_elapsed_labels_4_SECTIONS.o t_ctl_data_MHD.o t_ctl_data_sph_MHD_w_psf.o t_viz_sections.o t_SPH_MHD_zmean_sections.o init_sph_MHD_elapsed_label.o input_control_sph_MHD.o SPH_analyzer_snap_w_vizs.o FEM_analyzer_sph_MHD.o FEM_to_PSF_bridge.o output_viz_file_control.o set_time_step_params.o $(F90) -c $(F90OPTFLAGS) $< main_control_MHD_psf_check.o: $(SPH_SNAP_MAINDIR)/main_control_MHD_psf_check.f90 m_precision.o t_ctl_data_MHD.o t_ctl_data_sph_MHD_w_psf.o t_read_control_elements.o write_control_elements.o $(F90) -c $(F90OPTFLAGS) $< diff --git a/src/programs/data_utilities/SNAPSHOT_MHD/SPH_analyzer_snap_w_vizs.f90 b/src/programs/data_utilities/SNAPSHOT_MHD/SPH_analyzer_snap_w_vizs.f90 index c20fb28a..439217da 100644 --- a/src/programs/data_utilities/SNAPSHOT_MHD/SPH_analyzer_snap_w_vizs.f90 +++ b/src/programs/data_utilities/SNAPSHOT_MHD/SPH_analyzer_snap_w_vizs.f90 @@ -91,8 +91,10 @@ subroutine SPH_init_sph_snap_vizs(MHD_files, FEM_dat, SPH_model, & ! if (iflag_debug.gt.0) write(*,*) 'init_r_infos_sph_mhd_evo' call init_r_infos_sph_mhd_evo(SPH_model%bc_IO, SPH_MHD%groups, & - & SPH_model%MHD_BC, SPH_MHD%ipol, SPH_MHD%sph, SPH_WK%r_2nd, & - & SPH_model%omega_sph, SPH_model%MHD_prop, SPH_model%sph_MHD_bc) + & SPH_model%MHD_BC, SPH_MHD%ipol, SPH_MHD%sph, SPH_WK%r_2nd, & + & SPH_WK%r_n2e_3rd, SPH_WK%r_e2n_1st, & + & SPH_model%omega_sph, SPH_model%MHD_prop, & + & SPH_model%radial_variation, SPH_model%sph_MHD_bc) ! ! ------------------------------- ! @@ -105,7 +107,8 @@ subroutine SPH_init_sph_snap_vizs(MHD_files, FEM_dat, SPH_model, & ! if(iflag_debug.gt.0) write(*,*)' read_alloc_sph_restart_data' call read_alloc_sph_restart_data(MHD_files%fst_file_IO, & - & MHD_step%init_d, SPH_MHD%fld, MHD_step%rst_step) + & MHD_step%init_d, MHD_step%time_d, SPH_MHD%fld, & + & MHD_step%rst_step) ! ! --------------------------------- ! @@ -164,12 +167,11 @@ subroutine SPH_analyze_snap_vizs(MHD_files, SPH_model, MHD_step, & call read_alloc_sph_rst_4_snap(MHD_step%time_d%i_time_step, & & MHD_files%org_rj_file_IO, MHD_files%fst_file_IO, & & MHD_step%rst_step, SPH_MHD%sph, SPH_MHD%ipol, SPH_MHD%fld, & - & MHD_step%init_d, SPH_WK%rj_itp) + & MHD_step%time_d, SPH_WK%rj_itp) call extend_by_potential_with_j & & (SPH_MHD%sph%sph_rj, SPH_model%sph_MHD_bc%sph_bc_B, & & SPH_MHD%ipol%base%i_magne, SPH_MHD%ipol%base%i_current, & & SPH_MHD%fld) - call copy_time_data(MHD_step%init_d, MHD_step%time_d) ! if (iflag_debug.eq.1) write(*,*)' sync_temp_by_per_temp_sph' call sync_temp_by_per_temp_sph & diff --git a/src/programs/data_utilities/SNAPSHOT_MHD/analyzer_sph_snap_w_psf.f90 b/src/programs/data_utilities/SNAPSHOT_MHD/analyzer_sph_snap_w_psf.f90 index 711c888d..d33894f0 100644 --- a/src/programs/data_utilities/SNAPSHOT_MHD/analyzer_sph_snap_w_psf.f90 +++ b/src/programs/data_utilities/SNAPSHOT_MHD/analyzer_sph_snap_w_psf.f90 @@ -23,6 +23,7 @@ module analyzer_sph_snap_w_psf use m_machine_parameter use t_spherical_MHD use t_sph_MHD_w_psf + use t_elapsed_labels_4_SECTIONS ! implicit none ! @@ -33,6 +34,10 @@ module analyzer_sph_snap_w_psf !> Structure for visualization in spherical MHD type(sph_MHD_w_psf), save, private :: MPSFs ! +!> Elapsed time labels + logical, parameter :: flag_detailed1 = .TRUE. + type(elapsed_labels_4_SECTIONS), save :: elps_SECT1 +! ! ---------------------------------------------------------------------- ! contains @@ -63,6 +68,7 @@ subroutine initialize_sph_snap_w_psf(control_file_name) total_start = MPI_WTIME() call init_elapse_time_by_TOTAL call set_sph_MHD_elapsed_label + call elpsed_label_4_SECT(flag_detailed1, elps_SECT1, elps1) call elpsed_label_field_send_recv ! ! Load parameter file @@ -82,7 +88,7 @@ subroutine initialize_sph_snap_w_psf(control_file_name) call FEM_initialize_sph_MHD(SNAPs%MHD_files, SNAPs%MHD_step, & & MPSFs%FEM_DAT, SNAPs%MHD_IO, SNAPs%m_SR) call init_FEM_to_PSF_bridge & - & (SNAPs%MHD_step%viz_step, MPSFs%FEM_DAT%geofem, & + & (elps_SECT1, SNAPs%MHD_step%viz_step, MPSFs%FEM_DAT%geofem, & & MPSFs%edge_comm, SNAPs%m_SR) ! ! Initialize spherical transform dynamo @@ -93,17 +99,18 @@ subroutine initialize_sph_snap_w_psf(control_file_name) ! ! Initialize visualization if(iflag_debug .gt. 0) write(*,*) 'init_visualize_surface' - call init_visualize_surface(SNAPs%MHD_step%viz_step, & + call init_visualize_surface(elps_SECT1, SNAPs%MHD_step%viz_step, & & MPSFs%FEM_DAT%geofem, MPSFs%edge_comm, MPSFs%FEM_DAT%field, & & add_SMHD_ctl1%surfacing_ctls, MPSFs%PSFs, SNAPs%m_SR) call init_zonal_mean_sections & - & (SNAPs%MHD_step%viz_step, MPSFs%FEM_DAT%geofem, & + & (elps_SECT1, SNAPs%MHD_step%viz_step, MPSFs%FEM_DAT%geofem, & & MPSFs%edge_comm, MPSFs%FEM_DAT%field, add_SMHD_ctl1%zm_sects, & & MPSFs%zsectios, SNAPs%m_SR) ! if(iflag_MHD_time) call end_elapsed_time(ist_elapsed_MHD+1) call calypso_MPI_barrier call reset_elapse_4_init_sph_mhd + call reset_elapse_after_init_SECT(elps_SECT1, elps1) ! end subroutine initialize_sph_snap_w_psf ! @@ -165,16 +172,16 @@ subroutine evolution_sph_snap_w_psf if(iflag_MHD_time) call start_elapsed_time(ist_elapsed_MHD+4) call istep_viz_w_fix_dt(SNAPs%MHD_step%time_d%i_time_step, & & SNAPs%MHD_step%viz_step) - call visualize_surface & - & (SNAPs%MHD_step%viz_step, SNAPs%MHD_step%time_d, & + call visualize_surface(elps_SECT1, & + & SNAPs%MHD_step%viz_step, SNAPs%MHD_step%time_d, & & MPSFs%FEM_DAT%geofem, MPSFs%edge_comm, & & MPSFs%FEM_DAT%field, MPSFs%PSFs, SNAPs%m_SR) !* !* ----------- Zonal means -------------- !* if(SNAPs%MHD_step%viz_step%istep_psf .ge. 0) then - call SPH_MHD_zmean_sections & - & (SNAPs%MHD_step%viz_step, SNAPs%MHD_step%time_d, & + call SPH_MHD_zmean_sections(elps_SECT1, & + & SNAPs%MHD_step%viz_step, SNAPs%MHD_step%time_d, & & SNAPs%SPH_MHD%sph, MPSFs%FEM_DAT%geofem, & & SNAPs%SPH_WK%trns_WK, MPSFs%FEM_DAT%field, & & MPSFs%zsectios, SNAPs%m_SR) diff --git a/src/programs/data_utilities/TIME_HISTORIES/count_monitor_time_series.f90 b/src/programs/data_utilities/TIME_HISTORIES/count_monitor_time_series.f90 index d38dcb92..af1b2b8d 100644 --- a/src/programs/data_utilities/TIME_HISTORIES/count_monitor_time_series.f90 +++ b/src/programs/data_utilities/TIME_HISTORIES/count_monitor_time_series.f90 @@ -273,9 +273,9 @@ subroutine cal_time_ave_picked_sph_spectr(num_step, time, imask, & ! total_t = 1.0d-99 do icou = 1, num_step-1 -!$omp parallel workshare total_t = total_t + (time(icou+1) - time(icou)) & & * dble(imask(icou)) +!$omp parallel workshare ave_spec(1:num_comps) = ave_spec(1:num_comps) & & + half * (d_series(1:num_comps,icou) & & + d_series(1:num_comps,icou+1)) & diff --git a/src/programs/data_utilities/VIZ_only/Makefile.depends b/src/programs/data_utilities/VIZ_only/Makefile.depends index a81b5ce4..23406221 100644 --- a/src/programs/data_utilities/VIZ_only/Makefile.depends +++ b/src/programs/data_utilities/VIZ_only/Makefile.depends @@ -1,8 +1,8 @@ FEM_analyzer_viz_surf.o: $(VIZ_PLUG_DIR)/FEM_analyzer_viz_surf.f90 m_precision.o m_constants.o m_machine_parameter.o calypso_mpi.o t_time_data.o t_field_list_for_vizs.o t_VIZ_step_parameter.o t_IO_step_parameter.o t_FEM_mesh_field_4_viz.o t_mesh_SR.o mpi_load_mesh_data.o nod_phys_send_recv.o parallel_FEM_mesh_init.o set_parallel_file_name.o set_ucd_data_to_type.o parallel_ucd_IO_select.o const_element_comm_tables.o output_parallel_ucd_file.o $(F90) -c $(F90OPTFLAGS) $< -analyzer_VTK_convert.o: $(VIZ_PLUG_DIR)/analyzer_VTK_convert.f90 m_precision.o m_work_time.o t_viz_VTK_convert.o t_VIZ_only_step_parameter.o t_control_data_section_only.o t_FEM_mesh_field_4_viz.o t_file_IO_parameter.o t_vector_for_solver.o FEM_analyzer_viz_surf.o t_mesh_SR.o calypso_mpi.o m_elapsed_labels_4_VIZ.o m_elapsed_labels_SEND_RECV.o input_control_section_only.o +analyzer_VTK_convert.o: $(VIZ_PLUG_DIR)/analyzer_VTK_convert.f90 m_precision.o m_work_time.o t_viz_VTK_convert.o t_VIZ_only_step_parameter.o t_control_data_section_only.o t_FEM_mesh_field_4_viz.o t_file_IO_parameter.o t_vector_for_solver.o t_elapsed_labels_4_SECTIONS.o FEM_analyzer_viz_surf.o t_mesh_SR.o calypso_mpi.o m_elapsed_labels_SEND_RECV.o input_control_section_only.o $(F90) -c $(F90OPTFLAGS) $< -analyzer_psf.o: $(VIZ_PLUG_DIR)/analyzer_psf.f90 m_precision.o m_work_time.o t_viz_sections.o t_VIZ_only_step_parameter.o t_control_data_section_only.o t_FEM_mesh_field_4_viz.o t_mesh_SR.o FEM_analyzer_viz_surf.o calypso_mpi.o m_elapsed_labels_4_VIZ.o m_elapsed_labels_SEND_RECV.o input_control_section_only.o +analyzer_psf.o: $(VIZ_PLUG_DIR)/analyzer_psf.f90 m_precision.o m_work_time.o t_viz_sections.o t_VIZ_only_step_parameter.o t_control_data_section_only.o t_FEM_mesh_field_4_viz.o t_mesh_SR.o t_elapsed_labels_4_SECTIONS.o FEM_analyzer_viz_surf.o calypso_mpi.o m_elapsed_labels_SEND_RECV.o input_control_section_only.o $(F90) -c $(F90OPTFLAGS) $< input_control_section_only.o: $(VIZ_PLUG_DIR)/input_control_section_only.f90 m_precision.o m_machine_parameter.o t_control_data_section_only.o t_FEM_mesh_field_4_viz.o t_VIZ_only_step_parameter.o calypso_mpi.o t_read_control_elements.o calypso_mpi_int.o bcast_4_platform_ctl.o bcast_4_time_step_ctl.o bcast_ctl_data_surfacings.o bcast_control_arrays.o t_viz_sections.o m_file_format_switch.o m_default_file_prefix.o set_control_platform_item.o set_control_platform_data.o parallel_ucd_IO_select.o $(F90) -c $(F90OPTFLAGS) $< @@ -18,6 +18,6 @@ t_control_data_section_only.o: $(VIZ_PLUG_DIR)/t_control_data_section_only.f90 m $(F90) -c $(F90OPTFLAGS) $< t_field_list_for_vizs.o: $(VIZ_PLUG_DIR)/t_field_list_for_vizs.f90 m_precision.o m_machine_parameter.o t_control_array_character3.o t_phys_data.o set_each_field_name.o $(F90) -c $(F90OPTFLAGS) $< -t_viz_VTK_convert.o: $(VIZ_PLUG_DIR)/t_viz_VTK_convert.f90 m_precision.o m_machine_parameter.o m_work_time.o m_elapsed_labels_4_VIZ.o calypso_mpi.o t_VIZ_step_parameter.o t_time_data.o t_mesh_data.o t_phys_data.o t_ucd_data.o t_solver_SR.o t_solver_SR_int.o m_field_file_format.o t_control_array_character.o output_parallel_ucd_file.o mpi_abort_by_missing_zlib.o parallel_ucd_IO_select.o +t_viz_VTK_convert.o: $(VIZ_PLUG_DIR)/t_viz_VTK_convert.f90 m_precision.o m_machine_parameter.o m_work_time.o calypso_mpi.o t_VIZ_step_parameter.o t_time_data.o t_mesh_data.o t_phys_data.o t_ucd_data.o t_solver_SR.o t_solver_SR_int.o m_field_file_format.o t_control_array_character.o output_parallel_ucd_file.o mpi_abort_by_missing_zlib.o t_elapsed_labels_4_SECTIONS.o parallel_ucd_IO_select.o $(F90) -c $(F90OPTFLAGS) $< diff --git a/src/programs/data_utilities/VIZ_only/analyzer_VTK_convert.f90 b/src/programs/data_utilities/VIZ_only/analyzer_VTK_convert.f90 index 39c6d750..db14d874 100644 --- a/src/programs/data_utilities/VIZ_only/analyzer_VTK_convert.f90 +++ b/src/programs/data_utilities/VIZ_only/analyzer_VTK_convert.f90 @@ -17,6 +17,7 @@ module analyzer_VTK_convert use t_FEM_mesh_field_4_viz use t_file_IO_parameter use t_vector_for_solver + use t_elapsed_labels_4_SECTIONS use FEM_analyzer_viz_surf use t_mesh_SR ! @@ -36,10 +37,14 @@ module analyzer_VTK_convert type(mesh_SR) :: m_SR15 ! !> Structure for VTK file output paramters - type(field_IO_params) :: vtk_file_IO5 + type(field_IO_params) :: vtk_file_IO5 !> FEM field data to VTK type(ucd_data), save :: vtk_out5 ! +!> Elapsed time labels + logical, parameter :: flag_detailed1 = .TRUE. + type(elapsed_labels_4_SECTIONS), save :: elps_SECT1 +! ! --------------------------------------------------------------------- ! contains @@ -49,13 +54,12 @@ module analyzer_VTK_convert subroutine init_analyzer_VTK_convert ! use calypso_mpi - use m_elapsed_labels_4_VIZ use m_elapsed_labels_SEND_RECV use input_control_section_only ! ! call init_elapse_time_by_TOTAL - call elpsed_label_4_VIZ + call elpsed_label_4_SECT(flag_detailed1, elps_SECT1, elps1) call elpsed_label_field_send_recv ! ! read controls @@ -94,8 +98,8 @@ subroutine analyze_VTK_convert ! ! Generate field lines istep_ucd = istep_file_w_fix_dt(i_step, t_VIZ5%ucd_step) - call visualize_convert_vtk(i_step, istep_ucd, t_VIZ5%time_d, & - & vtk_file_IO5, vtk_out5) + call visualize_convert_vtk(i_step, istep_ucd, elps_SECT1, & + & t_VIZ5%time_d, vtk_file_IO5, vtk_out5) end do ! if(iflag_TOT_time) call end_elapsed_time(ied_total_elapsed) diff --git a/src/programs/data_utilities/VIZ_only/analyzer_psf.f90 b/src/programs/data_utilities/VIZ_only/analyzer_psf.f90 index 3c3dd122..dc54675e 100644 --- a/src/programs/data_utilities/VIZ_only/analyzer_psf.f90 +++ b/src/programs/data_utilities/VIZ_only/analyzer_psf.f90 @@ -16,6 +16,7 @@ module analyzer_psf use t_control_data_section_only use t_FEM_mesh_field_4_viz use t_mesh_SR + use t_elapsed_labels_4_SECTIONS use FEM_analyzer_viz_surf ! implicit none @@ -37,6 +38,10 @@ module analyzer_psf !> Edge communication table type(communication_table), save :: edge_comm_PSF ! +!> Elapsed time labels + logical, parameter :: flag_detailed1 = .TRUE. + type(elapsed_labels_4_SECTIONS), save :: elps_SECT1 +! ! --------------------------------------------------------------------- ! contains @@ -46,13 +51,12 @@ module analyzer_psf subroutine init_analyzer_psf ! use calypso_mpi - use m_elapsed_labels_4_VIZ use m_elapsed_labels_SEND_RECV use input_control_section_only ! ! call init_elapse_time_by_TOTAL - call elpsed_label_4_VIZ + call elpsed_label_4_SECT(flag_detailed1, elps_SECT1, elps1) call elpsed_label_field_send_recv ! ! read controls @@ -67,7 +71,7 @@ subroutine init_analyzer_psf & FEM_viz2, edge_comm_PSF, m_SR12) ! ! VIZ Initialization - call init_visualize_surface(t_VIZ2%viz_step, & + call init_visualize_surface(elps_SECT1, t_VIZ2%viz_step, & & FEM_viz2%geofem, edge_comm_PSF, FEM_viz2%field, & & sec_viz_ctl2%surfacing_ctls, viz_psfs2, m_SR12) ! @@ -95,7 +99,8 @@ subroutine analyze_psf t_VIZ2%viz_step%istep_iso & & = istep_file_w_fix_dt(i_step, t_VIZ2%viz_step%ISO_t) ! - call visualize_surface(t_VIZ2%viz_step, t_VIZ2%time_d, & + call visualize_surface(elps_SECT1, & + & t_VIZ2%viz_step, t_VIZ2%time_d, & & FEM_viz2%geofem, edge_comm_PSF, & & FEM_viz2%field, viz_psfs2, m_SR12) end do diff --git a/src/programs/data_utilities/VIZ_only/t_viz_VTK_convert.f90 b/src/programs/data_utilities/VIZ_only/t_viz_VTK_convert.f90 index 9ab46467..9f808650 100644 --- a/src/programs/data_utilities/VIZ_only/t_viz_VTK_convert.f90 +++ b/src/programs/data_utilities/VIZ_only/t_viz_VTK_convert.f90 @@ -24,9 +24,10 @@ !! type(ucd_data), intent(inout) :: vtk_out !! type(send_recv_status), intent(inout) :: SR_sig !! type(send_recv_int_buffer), intent(inout) :: SR_i -!! subroutine visualize_convert_vtk & -!! & (i_step, istep_ucd, time_d, vtk_file_IO, vtk_out) +!! subroutine visualize_convert_vtk(i_step, istep_ucd, elps_SECT, & +!! & time_d, vtk_file_IO, vtk_out) !! type(time_data), intent(in) :: time_d +!! type(elapsed_labels_4_SECTIONS), intent(in) :: elps_SECT !! type(field_IO_params), intent(in) :: vtk_file_IO !! type(ucd_data), intent(in) :: vtk_out !!@endverbatim @@ -37,7 +38,6 @@ module t_viz_VTK_convert ! use m_machine_parameter use m_work_time - use m_elapsed_labels_4_VIZ use calypso_mpi ! use t_VIZ_step_parameter @@ -108,21 +108,25 @@ end subroutine init_visualize_convert_vtk ! ! --------------------------------------------------------------------- ! - subroutine visualize_convert_vtk & - & (i_step, istep_ucd, time_d, vtk_file_IO, vtk_out) + subroutine visualize_convert_vtk(i_step, istep_ucd, elps_SECT, & + & time_d, vtk_file_IO, vtk_out) ! + use t_elapsed_labels_4_SECTIONS use parallel_ucd_IO_select ! integer(kind = kint), intent(in) :: i_step, istep_ucd + type(elapsed_labels_4_SECTIONS), intent(in) :: elps_SECT type(time_data), intent(in) :: time_d type(field_IO_params), intent(in) :: vtk_file_IO type(ucd_data), intent(in) :: vtk_out ! ! - if(iflag_VIZ_time) call start_elapsed_time(ist_elapsed_VIZ+13) + if(elps_SECT%flag_elapsed_S) & + & call start_elapsed_time(elps_SECT%ist_elapsed_S+5) call sel_write_parallel_ucd_file & & (istep_ucd, vtk_file_IO, time_d, vtk_out) - if(iflag_VIZ_time) call end_elapsed_time(ist_elapsed_VIZ+13) + if(elps_SECT%flag_elapsed_S) & + & call end_elapsed_time(elps_SECT%ist_elapsed_S+5) ! end subroutine visualize_convert_vtk !